@commercetools-frontend/mc-scripts 27.9.1 → 27.9.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.
Files changed (85) 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 +16 -15
  5. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +16 -15
  6. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +16 -15
  7. package/dist/{build-cdeab3a8.cjs.prod.js → build-ac598c6f.cjs.prod.js} +8 -8
  8. package/dist/{build-5a0c84e7.esm.js → build-d46960df.esm.js} +8 -8
  9. package/dist/{build-b9cbc1d1.cjs.dev.js → build-d4b1fdc5.cjs.dev.js} +8 -8
  10. package/dist/{build-vite-ce3c4fb6.esm.js → build-vite-2ea8a241.esm.js} +14 -16
  11. package/dist/{build-vite-aa0e7242.cjs.prod.js → build-vite-377f721f.cjs.prod.js} +14 -16
  12. package/dist/{build-vite-0e8f3463.cjs.dev.js → build-vite-e4eeb1a3.cjs.dev.js} +14 -16
  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-2b56a941.cjs.dev.js → config-sync-1167a32c.cjs.dev.js} +17 -17
  20. package/dist/{config-sync-7031a7de.esm.js → config-sync-2745185a.esm.js} +17 -17
  21. package/dist/{config-sync-41bc7f5e.cjs.prod.js → config-sync-4b0feccb.cjs.prod.js} +17 -17
  22. package/dist/{config-sync-ci-6d12f2f3.cjs.dev.js → config-sync-ci-198a99b7.cjs.dev.js} +19 -25
  23. package/dist/{config-sync-ci-ea943de9.cjs.prod.js → config-sync-ci-59c9bb6f.cjs.prod.js} +19 -25
  24. package/dist/{config-sync-ci-1866c188.esm.js → config-sync-ci-9fd513b8.esm.js} +19 -24
  25. package/dist/{config-sync-helpers-79ccaaad.cjs.prod.js → config-sync-helpers-1f124caa.cjs.prod.js} +46 -55
  26. package/dist/{config-sync-helpers-36985f8c.cjs.dev.js → config-sync-helpers-41951889.cjs.dev.js} +48 -57
  27. package/dist/{config-sync-helpers-875ef4a4.esm.js → config-sync-helpers-6c78e679.esm.js} +47 -56
  28. package/dist/{create-postcss-config-1eeb3d9d.cjs.prod.js → create-postcss-config-10a7d74d.cjs.prod.js} +1 -1
  29. package/dist/{create-postcss-config-390e8a52.esm.js → create-postcss-config-19ba9dbb.esm.js} +1 -1
  30. package/dist/{create-postcss-config-13cb1cb8.cjs.dev.js → create-postcss-config-ea4e550d.cjs.dev.js} +1 -1
  31. package/dist/{create-webpack-config-for-development-dd95f3d5.esm.js → create-webpack-config-for-development-11a27bf0.esm.js} +7 -7
  32. package/dist/{create-webpack-config-for-development-6608b4e4.cjs.prod.js → create-webpack-config-for-development-32dfe76e.cjs.prod.js} +7 -7
  33. package/dist/{create-webpack-config-for-development-9a3a3a93.cjs.dev.js → create-webpack-config-for-development-c88f0c97.cjs.dev.js} +7 -7
  34. package/dist/{create-webpack-config-for-production-2e6e5036.cjs.prod.js → create-webpack-config-for-production-52b409ec.cjs.prod.js} +8 -8
  35. package/dist/{create-webpack-config-for-production-29b34b8c.cjs.dev.js → create-webpack-config-for-production-6a2efe24.cjs.dev.js} +8 -8
  36. package/dist/{create-webpack-config-for-production-31bb3d24.esm.js → create-webpack-config-for-production-70f06772.esm.js} +8 -8
  37. package/dist/{credentials-storage-bfaa78f0.esm.js → credentials-storage-67deadc3.esm.js} +1 -1
  38. package/dist/{credentials-storage-60a63c81.cjs.prod.js → credentials-storage-ea1c16dc.cjs.prod.js} +1 -1
  39. package/dist/{credentials-storage-1826f1a2.cjs.dev.js → credentials-storage-fd195144.cjs.dev.js} +1 -1
  40. package/dist/{deployment-previews-set-a04efad3.cjs.dev.js → deployment-previews-set-26fd1791.cjs.dev.js} +22 -28
  41. package/dist/{deployment-previews-set-410cecf1.esm.js → deployment-previews-set-3c1d36bf.esm.js} +22 -27
  42. package/dist/{deployment-previews-set-bebd7a04.cjs.prod.js → deployment-previews-set-64129683.cjs.prod.js} +22 -28
  43. package/dist/{graphql-requests-1ea68584.cjs.dev.js → graphql-requests-409eb664.cjs.dev.js} +5 -8
  44. package/dist/{graphql-requests-98b1b779.cjs.prod.js → graphql-requests-561ccac0.cjs.prod.js} +5 -8
  45. package/dist/{graphql-requests-c491206a.esm.js → graphql-requests-f6c2f942.esm.js} +5 -8
  46. package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
  47. package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
  48. package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
  49. package/dist/{login-a99d14e6.cjs.prod.js → login-63b5a86e.cjs.prod.js} +58 -37
  50. package/dist/{login-cd99208a.cjs.dev.js → login-c9031d14.cjs.dev.js} +58 -37
  51. package/dist/{login-b935aede.esm.js → login-d164278d.esm.js} +57 -36
  52. package/dist/{optimizations-1b3f8157.esm.js → optimizations-54382f7b.esm.js} +5 -7
  53. package/dist/{optimizations-09a6638c.cjs.prod.js → optimizations-56be74d6.cjs.dev.js} +5 -8
  54. package/dist/{optimizations-640ffcac.cjs.dev.js → optimizations-da5a0cfa.cjs.prod.js} +5 -8
  55. package/dist/{package-15124b28.esm.js → package-1ae014de.esm.js} +1 -1
  56. package/dist/{package-98adb0d5.cjs.dev.js → package-484213a4.cjs.dev.js} +1 -1
  57. package/dist/{package-90af7dfe.cjs.prod.js → package-b6a1b738.cjs.prod.js} +1 -1
  58. package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
  59. package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
  60. package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
  61. package/dist/{serve-ddf30b4c.esm.js → serve-22475fec.esm.js} +13 -13
  62. package/dist/{serve-87ef7d4f.cjs.prod.js → serve-3837602d.cjs.prod.js} +14 -13
  63. package/dist/{serve-760fc169.cjs.dev.js → serve-b1c12985.cjs.dev.js} +14 -13
  64. package/dist/{start-08895b5f.esm.js → start-8d12a788.esm.js} +9 -10
  65. package/dist/{start-d9bd5dfb.cjs.prod.js → start-ad28cbc1.cjs.prod.js} +9 -10
  66. package/dist/{start-a0945fde.cjs.dev.js → start-ffd9a387.cjs.dev.js} +9 -10
  67. package/dist/{start-vite-745d3123.esm.js → start-vite-4b0df191.esm.js} +4 -5
  68. package/dist/{start-vite-10e49e5c.cjs.dev.js → start-vite-698c9e82.cjs.dev.js} +4 -5
  69. package/dist/{start-vite-00514c35.cjs.prod.js → start-vite-dd8a1e26.cjs.prod.js} +4 -5
  70. package/dist/{try-load-nimbus-plugins-526dccbd.esm.js → try-load-nimbus-plugins-2f528d8f.esm.js} +1 -1
  71. package/dist/{try-load-nimbus-plugins-59c3a594.cjs.prod.js → try-load-nimbus-plugins-a713d7d3.cjs.prod.js} +1 -1
  72. package/dist/{try-load-nimbus-plugins-06ce5d83.cjs.dev.js → try-load-nimbus-plugins-d502a5fe.cjs.dev.js} +1 -1
  73. package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
  74. package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
  75. package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
  76. package/package.json +9 -9
  77. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  78. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  79. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  80. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +7 -7
  81. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +7 -7
  82. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +7 -7
  83. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
  84. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
  85. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
@@ -1,15 +1,14 @@
1
1
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
2
2
  import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
3
- import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
4
3
  import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
5
4
  import chalk from 'chalk';
6
5
  import { processConfig } from '@commercetools-frontend/application-config';
7
- import { i as isCustomViewData, c as checkCustomApplicationStatus, p as performCreateCustomApplication, a as performUpdateCustomApplication, b as checkCustomViewStatus, d as performCreateCustomView, e as performUpdateCustomView } from './config-sync-helpers-875ef4a4.esm.js';
8
- import { f as fetchUserOrganizations } from './graphql-requests-c491206a.esm.js';
6
+ import { i as isCustomViewData, c as checkCustomApplicationStatus, p as performCreateCustomApplication, a as performUpdateCustomApplication, b as checkCustomViewStatus, d as performCreateCustomView, e as performUpdateCustomView } from './config-sync-helpers-6c78e679.esm.js';
7
+ import { f as fetchUserOrganizations } from './graphql-requests-f6c2f942.esm.js';
9
8
  import _Date$now from '@babel/runtime-corejs3/core-js-stable/date/now';
10
9
  import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
11
10
  import { jwtDecode } from 'jwt-decode';
12
- import { C as CredentialsStorage } from './credentials-storage-bfaa78f0.esm.js';
11
+ import { C as CredentialsStorage } from './credentials-storage-67deadc3.esm.js';
13
12
  import '@babel/runtime-corejs3/core-js-stable/json/stringify';
14
13
  import 'lodash/omit';
15
14
  import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
@@ -21,6 +20,7 @@ import '@babel/runtime-corejs3/helpers/defineProperty';
21
20
  import '@babel/runtime-corejs3/core-js-stable/instance/repeat';
22
21
  import '@babel/runtime-corejs3/core-js-stable/set';
23
22
  import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
23
+ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
24
24
  import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
25
25
  import '@babel/runtime-corejs3/core-js-stable/instance/filter';
26
26
  import '@babel/runtime-corejs3/core-js-stable/object/keys';
@@ -29,7 +29,7 @@ import 'graphql';
29
29
  import 'graphql-request';
30
30
  import '@commercetools-frontend/constants';
31
31
  import '@commercetools/http-user-agent';
32
- import './package-15124b28.esm.js';
32
+ import './package-1ae014de.esm.js';
33
33
  import '@babel/runtime-corejs3/helpers/classCallCheck';
34
34
  import '@babel/runtime-corejs3/helpers/createClass';
35
35
  import 'node:fs';
@@ -91,7 +91,7 @@ async function authenticateForCI(_ref) {
91
91
  };
92
92
  }
93
93
  }
94
- throw new Error("No valid authentication found for CI mode. Please provide one of:\n" + " - ".concat(ENV_VARS$1.TOKEN, ": A valid MC session token\n") + " - Run \"mc-scripts login --headless\" with IDENTITY_EMAIL and IDENTITY_PASSWORD\n" + " - Run \"mc-scripts login\" interactively to create a session");
94
+ throw new Error(`No valid authentication found for CI mode. Please provide one of:\n` + ` - ${ENV_VARS$1.TOKEN}: A valid MC session token\n` + ` - Run "mc-scripts login --headless" with IDENTITY_EMAIL and IDENTITY_PASSWORD\n` + ` - Run "mc-scripts login" interactively to create a session`);
95
95
  }
96
96
 
97
97
  /**
@@ -102,7 +102,7 @@ const ENV_VARS = {
102
102
  ORGANIZATION_NAME: 'CT_ORGANIZATION_NAME'
103
103
  };
104
104
  async function resolveOrganization(_ref) {
105
- var _context5, _context7, _context8;
105
+ var _context3;
106
106
  let mcApiUrl = _ref.mcApiUrl,
107
107
  applicationIdentifier = _ref.applicationIdentifier,
108
108
  customViewId = _ref.customViewId;
@@ -112,7 +112,7 @@ async function resolveOrganization(_ref) {
112
112
  customViewId
113
113
  });
114
114
  if (userOrganizations.total === 0) {
115
- throw new Error("No organizations found. Please ensure you are an admin of at least one Organization.");
115
+ throw new Error(`No organizations found. Please ensure you are an admin of at least one Organization.`);
116
116
  }
117
117
 
118
118
  // Check if organization was provided via environment variables
@@ -122,8 +122,7 @@ async function resolveOrganization(_ref) {
122
122
  var _context;
123
123
  const matchingOrg = _findInstanceProperty(_context = userOrganizations.results).call(_context, org => org.id === organizationId);
124
124
  if (!matchingOrg) {
125
- var _context2;
126
- throw new Error(_concatInstanceProperty(_context2 = "Organization with ID \"".concat(organizationId, "\" (from ")).call(_context2, ENV_VARS.ORGANIZATION_ID, ") not found or you don't have admin access to it."));
125
+ throw new Error(`Organization with ID "${organizationId}" (from ${ENV_VARS.ORGANIZATION_ID}) not found or you don't have admin access to it.`);
127
126
  }
128
127
  return {
129
128
  id: matchingOrg.id,
@@ -131,11 +130,10 @@ async function resolveOrganization(_ref) {
131
130
  };
132
131
  }
133
132
  if (organizationName) {
134
- var _context3;
135
- const matchingOrg = _findInstanceProperty(_context3 = userOrganizations.results).call(_context3, org => org.name === organizationName);
133
+ var _context2;
134
+ const matchingOrg = _findInstanceProperty(_context2 = userOrganizations.results).call(_context2, org => org.name === organizationName);
136
135
  if (!matchingOrg) {
137
- var _context4;
138
- throw new Error(_concatInstanceProperty(_context4 = "Organization with name \"".concat(organizationName, "\" (from ")).call(_context4, ENV_VARS.ORGANIZATION_NAME, ") not found or you don't have admin access to it."));
136
+ throw new Error(`Organization with name "${organizationName}" (from ${ENV_VARS.ORGANIZATION_NAME}) not found or you don't have admin access to it.`);
139
137
  }
140
138
  return {
141
139
  id: matchingOrg.id,
@@ -147,7 +145,7 @@ async function resolveOrganization(_ref) {
147
145
  if (userOrganizations.total === 1) {
148
146
  const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
149
147
  organization = _userOrganizations$re[0];
150
- console.log("Using organization \"".concat(chalk.green(organization.name), "\" (only one available)."));
148
+ console.log(`Using organization "${chalk.green(organization.name)}" (only one available).`);
151
149
  return {
152
150
  id: organization.id,
153
151
  name: organization.name
@@ -155,11 +153,8 @@ async function resolveOrganization(_ref) {
155
153
  }
156
154
 
157
155
  // Multiple organizations and none specified - error in CI mode
158
- const orgNames = _mapInstanceProperty(_context5 = userOrganizations.results).call(_context5, org => {
159
- var _context6;
160
- return _concatInstanceProperty(_context6 = " - \"".concat(org.name, "\" (ID: ")).call(_context6, org.id, ")");
161
- }).join('\n');
162
- throw new Error(_concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = "Multiple organizations found. Please specify one using ".concat(ENV_VARS.ORGANIZATION_ID, " or ")).call(_context8, ENV_VARS.ORGANIZATION_NAME, " environment variable:\n")).call(_context7, orgNames));
156
+ const orgNames = _mapInstanceProperty(_context3 = userOrganizations.results).call(_context3, org => ` - "${org.name}" (ID: ${org.id})`).join('\n');
157
+ throw new Error(`Multiple organizations found. Please specify one using ${ENV_VARS.ORGANIZATION_ID} or ${ENV_VARS.ORGANIZATION_NAME} environment variable:\n${orgNames}`);
163
158
  }
164
159
  async function handleCustomApplication(_ref2) {
165
160
  let mcApiUrl = _ref2.mcApiUrl,
@@ -192,7 +187,7 @@ async function handleCustomApplication(_ref2) {
192
187
  // Check for changes
193
188
  if (!status.configDiff) {
194
189
  console.log(chalk.green('Custom Application is up-to-date.'));
195
- console.log("URL: ".concat(chalk.gray(status.link)));
190
+ console.log(`URL: ${chalk.gray(status.link)}`);
196
191
  return;
197
192
  }
198
193
  console.log('Changes detected:');
@@ -240,7 +235,7 @@ async function handleCustomView(_ref3) {
240
235
  // Check for changes
241
236
  if (!status.configDiff) {
242
237
  console.log(chalk.green('Custom View is up-to-date.'));
243
- console.log("URL: ".concat(chalk.gray(status.link)));
238
+ console.log(`URL: ${chalk.gray(status.link)}`);
244
239
  return;
245
240
  }
246
241
  console.log('Changes detected:');
@@ -262,7 +257,7 @@ async function run(options) {
262
257
  mcApiUrl = _applicationConfig$en.mcApiUrl,
263
258
  applicationIdentifier = _applicationConfig$en.applicationIdentifier,
264
259
  customViewId = _applicationConfig$en.customViewId;
265
- console.log("Environment: ".concat(chalk.green(mcApiUrl)));
260
+ console.log(`Environment: ${chalk.green(mcApiUrl)}`);
266
261
 
267
262
  // Authenticate for CI
268
263
  console.log('Authenticating...');
@@ -273,7 +268,7 @@ async function run(options) {
273
268
  console.log(chalk.green('Authentication successful.'));
274
269
  } catch (error) {
275
270
  if (error instanceof Error) {
276
- throw new Error("Authentication failed: ".concat(error.message));
271
+ throw new Error(`Authentication failed: ${error.message}`);
277
272
  }
278
273
  throw error;
279
274
  }
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
4
3
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
5
4
  var chalk = require('chalk');
6
5
  var omit = require('lodash/omit');
@@ -13,16 +12,16 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
13
12
  var _repeatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/repeat');
14
13
  var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
15
14
  var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
15
+ var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
16
16
  var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
17
17
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
18
18
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
19
19
  var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
20
20
  var applicationConfig = require('@commercetools-frontend/application-config');
21
- var graphqlRequests = require('./graphql-requests-98b1b779.cjs.prod.js');
21
+ var graphqlRequests = require('./graphql-requests-561ccac0.cjs.prod.js');
22
22
 
23
23
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
24
24
 
25
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
26
25
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
27
26
  var chalk__default = /*#__PURE__*/_interopDefault(chalk);
28
27
  var omit__default = /*#__PURE__*/_interopDefault(omit);
@@ -34,13 +33,14 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
34
33
  var _repeatInstanceProperty__default = /*#__PURE__*/_interopDefault(_repeatInstanceProperty);
35
34
  var _Set__default = /*#__PURE__*/_interopDefault(_Set);
36
35
  var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
36
+ var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
37
37
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
38
38
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
39
39
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
40
40
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
41
41
 
42
42
  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; }
43
- 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; }
43
+ 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; }
44
44
  const red = str => {
45
45
  return chalk__default["default"].red(str);
46
46
  };
@@ -60,21 +60,19 @@ const getStringDiff = _ref => {
60
60
  _ref$indentLevel = _ref.indentLevel,
61
61
  indentLevel = _ref$indentLevel === void 0 ? 0 : _ref$indentLevel;
62
62
  if (!previousValue && nextValue) {
63
- var _context2, _context3;
64
- return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(indent(indentLevel))).call(_context3, label, " added: ")).call(_context2, green(nextValue));
63
+ return `${indent(indentLevel)}${label} added: ${green(nextValue)}`;
65
64
  }
66
65
  if (previousValue && !nextValue) {
67
- var _context4, _context5;
68
- return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(indent(indentLevel))).call(_context5, label, " removed: ")).call(_context4, red(previousValue));
66
+ return `${indent(indentLevel)}${label} removed: ${red(previousValue)}`;
69
67
  }
70
68
  if (previousValue && nextValue && previousValue !== nextValue) {
71
- var _context6, _context7, _context8;
72
- 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));
69
+ return `${indent(indentLevel)}${label} changed: ${red(previousValue)} => ${green(nextValue)}`;
73
70
  }
74
71
  return null;
75
72
  };
76
73
  // NOTE: this assumes that the array values are scalar values (not objects).
77
74
  const getArrayDiff = _ref2 => {
75
+ var _context2, _context3;
78
76
  let previousValue = _ref2.previousValue,
79
77
  nextValue = _ref2.nextValue,
80
78
  label = _ref2.label,
@@ -82,7 +80,7 @@ const getArrayDiff = _ref2 => {
82
80
  indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
83
81
  const oldArraySet = new _Set__default["default"](previousValue);
84
82
  const arrayDiff = [];
85
- nextValue === null || nextValue === void 0 || _forEachInstanceProperty__default["default"](nextValue).call(nextValue, item => {
83
+ ((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty__default["default"](_context3 = Function.call).call(_context3, _forEachInstanceProperty__default["default"](_context2), _context2))?.(item => {
86
84
  if (oldArraySet.has(item)) {
87
85
  oldArraySet.delete(item);
88
86
  } else {
@@ -103,7 +101,7 @@ const getArrayDiff = _ref2 => {
103
101
  return arrayDiff.join('\n');
104
102
  };
105
103
  const getPermissionsDiff = _ref3 => {
106
- var _context1;
104
+ var _context4;
107
105
  let previousValue = _ref3.previousValue,
108
106
  nextValue = _ref3.nextValue;
109
107
  const permissionDiff = ['permissions changed'];
@@ -116,12 +114,10 @@ const getPermissionsDiff = _ref3 => {
116
114
  }, {});
117
115
  const indentLevel = 1;
118
116
  _forEachInstanceProperty__default["default"](nextValue).call(nextValue, newPermission => {
119
- var _context9;
120
- const currentDiff = [_concatInstanceProperty__default["default"](_context9 = "".concat(indent(indentLevel), "\"")).call(_context9, newPermission.name, "\" changed")];
117
+ const currentDiff = [`${indent(indentLevel)}"${newPermission.name}" changed`];
121
118
  // if the permission name is not in the old config, it means it is a new addition.
122
119
  if (!mappedOldPermissions[newPermission.name]) {
123
- var _context0;
124
- permissionDiff.push(_concatInstanceProperty__default["default"](_context0 = "".concat(indent(indentLevel), "\"")).call(_context0, green(newPermission.name), "\" was added"));
120
+ permissionDiff.push(`${indent(indentLevel)}"${green(newPermission.name)}" was added`);
125
121
  }
126
122
 
127
123
  // if permission name is in the old config, now we check if there was a change
@@ -138,22 +134,21 @@ const getPermissionsDiff = _ref3 => {
138
134
  });
139
135
 
140
136
  // if there are old permissions left, it means they were deleted in the new Permissions.
141
- _forEachInstanceProperty__default["default"](_context1 = _Object$keys__default["default"](mappedOldPermissions)).call(_context1, oldPermissionName => {
142
- var _context10;
143
- permissionDiff.push(_concatInstanceProperty__default["default"](_context10 = "".concat(indent(indentLevel), "\"")).call(_context10, red(oldPermissionName), "\" was removed"));
137
+ _forEachInstanceProperty__default["default"](_context4 = _Object$keys__default["default"](mappedOldPermissions)).call(_context4, oldPermissionName => {
138
+ permissionDiff.push(`${indent(indentLevel)}"${red(oldPermissionName)}" was removed`);
144
139
  });
145
140
  if (permissionDiff.length > 1) return permissionDiff.join('\n');
146
141
  return null;
147
142
  };
148
143
  const getLabelAllLocalesDiff = _ref5 => {
149
- var _context14;
144
+ var _context5;
150
145
  let _ref5$previousValue = _ref5.previousValue,
151
146
  previousValue = _ref5$previousValue === void 0 ? [] : _ref5$previousValue,
152
147
  _ref5$nextValue = _ref5.nextValue,
153
148
  nextValue = _ref5$nextValue === void 0 ? [] : _ref5$nextValue,
154
149
  _ref5$indentLevel = _ref5.indentLevel,
155
150
  indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
156
- const labelAllLocalesDiff = ["".concat(indent(indentLevel - 1), "labelAllLocales changed")];
151
+ const labelAllLocalesDiff = [`${indent(indentLevel - 1)}labelAllLocales changed`];
157
152
  const mappedOldLabelAllLocales = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
158
153
  let locale = _ref6.locale,
159
154
  value = _ref6.value;
@@ -165,8 +160,7 @@ const getLabelAllLocalesDiff = _ref5 => {
165
160
  if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
166
161
  const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
167
162
  if (oldLocaleValue !== newLabelAllLocale.value) {
168
- var _context11, _context12, _context13;
169
- 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)));
163
+ labelAllLocalesDiff.push(`${indent(indentLevel)}locale "${newLabelAllLocale.locale}" changed: ${red(oldLocaleValue)} => ${green(newLabelAllLocale.value)}`);
170
164
  }
171
165
  delete mappedOldLabelAllLocales[newLabelAllLocale.locale];
172
166
  } else {
@@ -180,7 +174,7 @@ const getLabelAllLocalesDiff = _ref5 => {
180
174
  }
181
175
  }
182
176
  });
183
- _forEachInstanceProperty__default["default"](_context14 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context14, key => {
177
+ _forEachInstanceProperty__default["default"](_context5 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context5, key => {
184
178
  const localeDiff = getStringDiff({
185
179
  previousValue: key,
186
180
  label: 'locale',
@@ -194,14 +188,14 @@ const getLabelAllLocalesDiff = _ref5 => {
194
188
  return null;
195
189
  };
196
190
  const getTypeSettingsDiff = _ref7 => {
197
- var _context15;
191
+ var _context6;
198
192
  let previousValue = _ref7.previousValue,
199
193
  nextValue = _ref7.nextValue;
200
194
  const nonNullablePreviousValue = previousValue || {};
201
195
  const nonNullableNextValue = nextValue || {};
202
196
  const indentLevel = 1;
203
- const typeSettingsDiff = ["".concat(indent(indentLevel - 1), "type settings changed")];
204
- _forEachInstanceProperty__default["default"](_context15 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context15, key => {
197
+ const typeSettingsDiff = [`${indent(indentLevel - 1)}type settings changed`];
198
+ _forEachInstanceProperty__default["default"](_context6 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context6, key => {
205
199
  const typeSettingDiff = getStringDiff({
206
200
  previousValue: nonNullablePreviousValue[key],
207
201
  nextValue: nonNullableNextValue[key],
@@ -251,7 +245,7 @@ const getMainMenuLinkDiff = _ref9 => {
251
245
  indentLevel: 2
252
246
  });
253
247
  if (mainMenuLinkPermissionsDiff.length > 0) {
254
- mainMenuLinkDiff.push("".concat(indent(1), "permissions changed"));
248
+ mainMenuLinkDiff.push(`${indent(1)}permissions changed`);
255
249
  mainMenuLinkDiff.push(mainMenuLinkPermissionsDiff);
256
250
  }
257
251
  const menuLabelsDiff = getLabelAllLocalesDiff({
@@ -267,7 +261,7 @@ const getMainMenuLinkDiff = _ref9 => {
267
261
  return null;
268
262
  };
269
263
  const getSubmenuLinksDiff = _ref0 => {
270
- var _context20;
264
+ var _context8;
271
265
  let previousValue = _ref0.previousValue,
272
266
  nextValue = _ref0.nextValue;
273
267
  const submenuLinksDiff = ['submenuLink changed'];
@@ -278,17 +272,16 @@ const getSubmenuLinksDiff = _ref0 => {
278
272
  const previousOrder = getOrder(previousValue);
279
273
  const newOrder = getOrder(nextValue);
280
274
  if (previousOrder !== newOrder) {
281
- var _context16, _context17;
282
- submenuLinksDiff.push("".concat(indent(1), "submenu order changed"));
283
- submenuLinksDiff.push(_concatInstanceProperty__default["default"](_context16 = "".concat(indent(2), "previous order: [")).call(_context16, previousOrder, "]"));
284
- submenuLinksDiff.push(_concatInstanceProperty__default["default"](_context17 = "".concat(indent(2), "new order: [")).call(_context17, newOrder, "]"));
275
+ submenuLinksDiff.push(`${indent(1)}submenu order changed`);
276
+ submenuLinksDiff.push(`${indent(2)}previous order: [${previousOrder}]`);
277
+ submenuLinksDiff.push(`${indent(2)}new order: [${newOrder}]`);
285
278
  }
286
279
  _forEachInstanceProperty__default["default"](nextValue).call(nextValue, newSubmenuLink => {
287
280
  const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
288
281
  if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
289
- var _context18, _context19;
290
- const submenuLinkDiff = [_concatInstanceProperty__default["default"](_context18 = "".concat(indent(1), "menu link \"")).call(_context18, newSubmenuLink.uriPath, "\" changed")];
291
- _forEachInstanceProperty__default["default"](_context19 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context19, key => {
282
+ var _context7;
283
+ const submenuLinkDiff = [`${indent(1)}menu link "${newSubmenuLink.uriPath}" changed`];
284
+ _forEachInstanceProperty__default["default"](_context7 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context7, key => {
292
285
  switch (key) {
293
286
  case 'defaultLabel':
294
287
  {
@@ -312,7 +305,7 @@ const getSubmenuLinksDiff = _ref0 => {
312
305
  indentLevel: 3
313
306
  });
314
307
  if (submenuLinkPermissionsDiff.length > 0) {
315
- submenuLinkDiff.push("".concat(indent(2), "permissions changed"));
308
+ submenuLinkDiff.push(`${indent(2)}permissions changed`);
316
309
  submenuLinkDiff.push(submenuLinkPermissionsDiff);
317
310
  }
318
311
  break;
@@ -347,7 +340,7 @@ const getSubmenuLinksDiff = _ref0 => {
347
340
  }
348
341
  }
349
342
  });
350
- _forEachInstanceProperty__default["default"](_context20 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context20, key => {
343
+ _forEachInstanceProperty__default["default"](_context8 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context8, key => {
351
344
  const linksDiff = getStringDiff({
352
345
  previousValue: key,
353
346
  label: 'menu link',
@@ -521,13 +514,12 @@ const getCustomViewConfigDiff = (oldConfig, newConfig) => {
521
514
  };
522
515
 
523
516
  const getMcUrlLink = _ref => {
524
- var _context, _context2, _context3;
525
517
  let mcApiUrl = _ref.mcApiUrl,
526
518
  organizationId = _ref.organizationId,
527
519
  customEntityId = _ref.customEntityId,
528
520
  isCustomView = _ref.isCustomView;
529
521
  const mcUrl = mcApiUrl.replace('mc-api', 'mc');
530
- 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);
522
+ const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}`;
531
523
  return customEntityLink;
532
524
  };
533
525
  const isCustomViewData = data => data.entryPointUriPath === undefined;
@@ -538,7 +530,7 @@ async function performCreateCustomApplication(_ref2) {
538
530
  localCustomEntityData = _ref2.localCustomEntityData,
539
531
  applicationIdentifier = _ref2.applicationIdentifier,
540
532
  dryRun = _ref2.dryRun;
541
- console.log("Creating Custom Application in organization \"".concat(chalk__default["default"].green(organizationName), "\"..."));
533
+ console.log(`Creating Custom Application in organization "${chalk__default["default"].green(organizationName)}"...`);
542
534
  const data = omit__default["default"](localCustomEntityData, ['id']);
543
535
  if (dryRun) {
544
536
  console.log();
@@ -561,9 +553,9 @@ async function performCreateCustomApplication(_ref2) {
561
553
  customEntityId: createdCustomApplication.id
562
554
  });
563
555
  console.log(chalk__default["default"].green('Custom Application created successfully.'));
564
- console.log("ID: ".concat(chalk__default["default"].cyan(createdCustomApplication.id)));
565
- console.log("Please update the \"env.production.applicationId\" field in your local Custom Application config file with the ID above.");
566
- console.log("URL: ".concat(chalk__default["default"].gray(customAppLink)));
556
+ console.log(`ID: ${chalk__default["default"].cyan(createdCustomApplication.id)}`);
557
+ console.log(`Please update the "env.production.applicationId" field in your local Custom Application config file with the ID above.`);
558
+ console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
567
559
  return createdCustomApplication.id;
568
560
  }
569
561
  async function performUpdateCustomApplication(_ref3) {
@@ -576,7 +568,7 @@ async function performUpdateCustomApplication(_ref3) {
576
568
  const data = omit__default["default"](localCustomEntityData, ['id']);
577
569
  if (dryRun) {
578
570
  console.log();
579
- console.log("Dry run - would update Custom Application \"".concat(chalk__default["default"].green(data.entryPointUriPath), "\" with:"));
571
+ console.log(`Dry run - would update Custom Application "${chalk__default["default"].green(data.entryPointUriPath)}" with:`);
580
572
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
581
573
  return;
582
574
  }
@@ -594,7 +586,7 @@ async function performUpdateCustomApplication(_ref3) {
594
586
  customEntityId: applicationId
595
587
  });
596
588
  console.log(chalk__default["default"].green('Custom Application updated successfully.'));
597
- console.log("URL: ".concat(chalk__default["default"].gray(customAppLink)));
589
+ console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
598
590
  }
599
591
  async function performCreateCustomView(_ref4) {
600
592
  let mcApiUrl = _ref4.mcApiUrl,
@@ -603,7 +595,7 @@ async function performCreateCustomView(_ref4) {
603
595
  localCustomEntityData = _ref4.localCustomEntityData,
604
596
  applicationIdentifier = _ref4.applicationIdentifier,
605
597
  dryRun = _ref4.dryRun;
606
- console.log("Creating Custom View in organization \"".concat(chalk__default["default"].green(organizationName), "\"..."));
598
+ console.log(`Creating Custom View in organization "${chalk__default["default"].green(organizationName)}"...`);
607
599
  const data = omit__default["default"](localCustomEntityData, ['id']);
608
600
  if (dryRun) {
609
601
  console.log();
@@ -627,9 +619,9 @@ async function performCreateCustomView(_ref4) {
627
619
  isCustomView: true
628
620
  });
629
621
  console.log(chalk__default["default"].green('Custom View created successfully.'));
630
- console.log("ID: ".concat(chalk__default["default"].cyan(createdCustomView.id)));
631
- console.log("Please update the \"env.production.customViewId\" field in your local Custom View config file with the ID above.");
632
- console.log("URL: ".concat(chalk__default["default"].gray(customViewLink)));
622
+ console.log(`ID: ${chalk__default["default"].cyan(createdCustomView.id)}`);
623
+ console.log(`Please update the "env.production.customViewId" field in your local Custom View config file with the ID above.`);
624
+ console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
633
625
  return createdCustomView.id;
634
626
  }
635
627
  async function performUpdateCustomView(_ref5) {
@@ -642,7 +634,7 @@ async function performUpdateCustomView(_ref5) {
642
634
  const data = omit__default["default"](localCustomEntityData, ['id']);
643
635
  if (dryRun) {
644
636
  console.log();
645
- console.log("Dry run - would update Custom View \"".concat(chalk__default["default"].green(data.defaultLabel), "\" with:"));
637
+ console.log(`Dry run - would update Custom View "${chalk__default["default"].green(data.defaultLabel)}" with:`);
646
638
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
647
639
  return;
648
640
  }
@@ -661,7 +653,7 @@ async function performUpdateCustomView(_ref5) {
661
653
  isCustomView: true
662
654
  });
663
655
  console.log(chalk__default["default"].green('Custom View updated successfully.'));
664
- console.log("URL: ".concat(chalk__default["default"].gray(customViewLink)));
656
+ console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
665
657
  }
666
658
  async function checkCustomApplicationStatus(_ref6) {
667
659
  let mcApiUrl = _ref6.mcApiUrl,
@@ -693,7 +685,6 @@ async function checkCustomApplicationStatus(_ref6) {
693
685
  };
694
686
  }
695
687
  async function checkCustomViewStatus(_ref7) {
696
- var _fetchedCustomView$cu, _fetchedCustomView$cu2;
697
688
  let mcApiUrl = _ref7.mcApiUrl,
698
689
  customViewId = _ref7.customViewId,
699
690
  applicationIdentifier = _ref7.applicationIdentifier,
@@ -712,13 +703,13 @@ async function checkCustomViewStatus(_ref7) {
712
703
  const customViewLink = getMcUrlLink({
713
704
  mcApiUrl,
714
705
  organizationId: fetchedCustomView.organizationId,
715
- customEntityId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu = fetchedCustomView.customView) === null || _fetchedCustomView$cu === void 0 ? void 0 : _fetchedCustomView$cu.id) || '',
706
+ customEntityId: fetchedCustomView?.customView?.id || '',
716
707
  isCustomView: true
717
708
  });
718
709
  return {
719
710
  exists: true,
720
711
  organizationId: fetchedCustomView.organizationId,
721
- customViewId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu2 = fetchedCustomView.customView) === null || _fetchedCustomView$cu2 === void 0 ? void 0 : _fetchedCustomView$cu2.id) || '',
712
+ customViewId: fetchedCustomView?.customView?.id || '',
722
713
  configDiff,
723
714
  link: customViewLink
724
715
  };