@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.
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +16 -15
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +16 -15
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +16 -15
- package/dist/{build-cdeab3a8.cjs.prod.js → build-ac598c6f.cjs.prod.js} +8 -8
- package/dist/{build-5a0c84e7.esm.js → build-d46960df.esm.js} +8 -8
- package/dist/{build-b9cbc1d1.cjs.dev.js → build-d4b1fdc5.cjs.dev.js} +8 -8
- package/dist/{build-vite-ce3c4fb6.esm.js → build-vite-2ea8a241.esm.js} +14 -16
- package/dist/{build-vite-aa0e7242.cjs.prod.js → build-vite-377f721f.cjs.prod.js} +14 -16
- package/dist/{build-vite-0e8f3463.cjs.dev.js → build-vite-e4eeb1a3.cjs.dev.js} +14 -16
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
- package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
- package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
- package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
- package/dist/{config-sync-2b56a941.cjs.dev.js → config-sync-1167a32c.cjs.dev.js} +17 -17
- package/dist/{config-sync-7031a7de.esm.js → config-sync-2745185a.esm.js} +17 -17
- package/dist/{config-sync-41bc7f5e.cjs.prod.js → config-sync-4b0feccb.cjs.prod.js} +17 -17
- package/dist/{config-sync-ci-6d12f2f3.cjs.dev.js → config-sync-ci-198a99b7.cjs.dev.js} +19 -25
- package/dist/{config-sync-ci-ea943de9.cjs.prod.js → config-sync-ci-59c9bb6f.cjs.prod.js} +19 -25
- package/dist/{config-sync-ci-1866c188.esm.js → config-sync-ci-9fd513b8.esm.js} +19 -24
- package/dist/{config-sync-helpers-79ccaaad.cjs.prod.js → config-sync-helpers-1f124caa.cjs.prod.js} +46 -55
- package/dist/{config-sync-helpers-36985f8c.cjs.dev.js → config-sync-helpers-41951889.cjs.dev.js} +48 -57
- package/dist/{config-sync-helpers-875ef4a4.esm.js → config-sync-helpers-6c78e679.esm.js} +47 -56
- package/dist/{create-postcss-config-1eeb3d9d.cjs.prod.js → create-postcss-config-10a7d74d.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-390e8a52.esm.js → create-postcss-config-19ba9dbb.esm.js} +1 -1
- package/dist/{create-postcss-config-13cb1cb8.cjs.dev.js → create-postcss-config-ea4e550d.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-development-dd95f3d5.esm.js → create-webpack-config-for-development-11a27bf0.esm.js} +7 -7
- package/dist/{create-webpack-config-for-development-6608b4e4.cjs.prod.js → create-webpack-config-for-development-32dfe76e.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-development-9a3a3a93.cjs.dev.js → create-webpack-config-for-development-c88f0c97.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-production-2e6e5036.cjs.prod.js → create-webpack-config-for-production-52b409ec.cjs.prod.js} +8 -8
- package/dist/{create-webpack-config-for-production-29b34b8c.cjs.dev.js → create-webpack-config-for-production-6a2efe24.cjs.dev.js} +8 -8
- package/dist/{create-webpack-config-for-production-31bb3d24.esm.js → create-webpack-config-for-production-70f06772.esm.js} +8 -8
- package/dist/{credentials-storage-bfaa78f0.esm.js → credentials-storage-67deadc3.esm.js} +1 -1
- package/dist/{credentials-storage-60a63c81.cjs.prod.js → credentials-storage-ea1c16dc.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-1826f1a2.cjs.dev.js → credentials-storage-fd195144.cjs.dev.js} +1 -1
- package/dist/{deployment-previews-set-a04efad3.cjs.dev.js → deployment-previews-set-26fd1791.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-410cecf1.esm.js → deployment-previews-set-3c1d36bf.esm.js} +22 -27
- package/dist/{deployment-previews-set-bebd7a04.cjs.prod.js → deployment-previews-set-64129683.cjs.prod.js} +22 -28
- package/dist/{graphql-requests-1ea68584.cjs.dev.js → graphql-requests-409eb664.cjs.dev.js} +5 -8
- package/dist/{graphql-requests-98b1b779.cjs.prod.js → graphql-requests-561ccac0.cjs.prod.js} +5 -8
- package/dist/{graphql-requests-c491206a.esm.js → graphql-requests-f6c2f942.esm.js} +5 -8
- package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
- package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
- package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
- package/dist/{login-a99d14e6.cjs.prod.js → login-63b5a86e.cjs.prod.js} +58 -37
- package/dist/{login-cd99208a.cjs.dev.js → login-c9031d14.cjs.dev.js} +58 -37
- package/dist/{login-b935aede.esm.js → login-d164278d.esm.js} +57 -36
- package/dist/{optimizations-1b3f8157.esm.js → optimizations-54382f7b.esm.js} +5 -7
- package/dist/{optimizations-09a6638c.cjs.prod.js → optimizations-56be74d6.cjs.dev.js} +5 -8
- package/dist/{optimizations-640ffcac.cjs.dev.js → optimizations-da5a0cfa.cjs.prod.js} +5 -8
- package/dist/{package-15124b28.esm.js → package-1ae014de.esm.js} +1 -1
- package/dist/{package-98adb0d5.cjs.dev.js → package-484213a4.cjs.dev.js} +1 -1
- package/dist/{package-90af7dfe.cjs.prod.js → package-b6a1b738.cjs.prod.js} +1 -1
- package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
- package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
- package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
- package/dist/{serve-ddf30b4c.esm.js → serve-22475fec.esm.js} +13 -13
- package/dist/{serve-87ef7d4f.cjs.prod.js → serve-3837602d.cjs.prod.js} +14 -13
- package/dist/{serve-760fc169.cjs.dev.js → serve-b1c12985.cjs.dev.js} +14 -13
- package/dist/{start-08895b5f.esm.js → start-8d12a788.esm.js} +9 -10
- package/dist/{start-d9bd5dfb.cjs.prod.js → start-ad28cbc1.cjs.prod.js} +9 -10
- package/dist/{start-a0945fde.cjs.dev.js → start-ffd9a387.cjs.dev.js} +9 -10
- package/dist/{start-vite-745d3123.esm.js → start-vite-4b0df191.esm.js} +4 -5
- package/dist/{start-vite-10e49e5c.cjs.dev.js → start-vite-698c9e82.cjs.dev.js} +4 -5
- package/dist/{start-vite-00514c35.cjs.prod.js → start-vite-dd8a1e26.cjs.prod.js} +4 -5
- package/dist/{try-load-nimbus-plugins-526dccbd.esm.js → try-load-nimbus-plugins-2f528d8f.esm.js} +1 -1
- package/dist/{try-load-nimbus-plugins-59c3a594.cjs.prod.js → try-load-nimbus-plugins-a713d7d3.cjs.prod.js} +1 -1
- package/dist/{try-load-nimbus-plugins-06ce5d83.cjs.dev.js → try-load-nimbus-plugins-d502a5fe.cjs.dev.js} +1 -1
- package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
- package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
- package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
- package/package.json +9 -9
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +7 -7
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +7 -7
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +7 -7
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
package/dist/{config-sync-helpers-36985f8c.cjs.dev.js → config-sync-helpers-41951889.cjs.dev.js}
RENAMED
|
@@ -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-
|
|
21
|
+
var graphqlRequests = require('./graphql-requests-409eb664.cjs.dev.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,23 +33,24 @@ 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
|
|
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
|
|
|
45
45
|
// Since not all terminal supports colors, to make things more consistent for testing purposes,
|
|
46
46
|
// during tests the color used is appended before the string instead of coloring it.
|
|
47
47
|
const isTest = process.env.NODE_ENV === 'test';
|
|
48
48
|
const red = str => {
|
|
49
|
-
if (isTest) return
|
|
49
|
+
if (isTest) return `<color-red>${str}</color-red>`;
|
|
50
50
|
return chalk__default["default"].red(str);
|
|
51
51
|
};
|
|
52
52
|
const green = str => {
|
|
53
|
-
if (isTest) return
|
|
53
|
+
if (isTest) return `<color-green>${str}</color-green>`;
|
|
54
54
|
return chalk__default["default"].green(str);
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -66,21 +66,19 @@ const getStringDiff = _ref => {
|
|
|
66
66
|
_ref$indentLevel = _ref.indentLevel,
|
|
67
67
|
indentLevel = _ref$indentLevel === void 0 ? 0 : _ref$indentLevel;
|
|
68
68
|
if (!previousValue && nextValue) {
|
|
69
|
-
|
|
70
|
-
return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(indent(indentLevel))).call(_context3, label, " added: ")).call(_context2, green(nextValue));
|
|
69
|
+
return `${indent(indentLevel)}${label} added: ${green(nextValue)}`;
|
|
71
70
|
}
|
|
72
71
|
if (previousValue && !nextValue) {
|
|
73
|
-
|
|
74
|
-
return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(indent(indentLevel))).call(_context5, label, " removed: ")).call(_context4, red(previousValue));
|
|
72
|
+
return `${indent(indentLevel)}${label} removed: ${red(previousValue)}`;
|
|
75
73
|
}
|
|
76
74
|
if (previousValue && nextValue && previousValue !== nextValue) {
|
|
77
|
-
|
|
78
|
-
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));
|
|
75
|
+
return `${indent(indentLevel)}${label} changed: ${red(previousValue)} => ${green(nextValue)}`;
|
|
79
76
|
}
|
|
80
77
|
return null;
|
|
81
78
|
};
|
|
82
79
|
// NOTE: this assumes that the array values are scalar values (not objects).
|
|
83
80
|
const getArrayDiff = _ref2 => {
|
|
81
|
+
var _context2, _context3;
|
|
84
82
|
let previousValue = _ref2.previousValue,
|
|
85
83
|
nextValue = _ref2.nextValue,
|
|
86
84
|
label = _ref2.label,
|
|
@@ -88,7 +86,7 @@ const getArrayDiff = _ref2 => {
|
|
|
88
86
|
indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
|
|
89
87
|
const oldArraySet = new _Set__default["default"](previousValue);
|
|
90
88
|
const arrayDiff = [];
|
|
91
|
-
nextValue
|
|
89
|
+
((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty__default["default"](_context3 = Function.call).call(_context3, _forEachInstanceProperty__default["default"](_context2), _context2))?.(item => {
|
|
92
90
|
if (oldArraySet.has(item)) {
|
|
93
91
|
oldArraySet.delete(item);
|
|
94
92
|
} else {
|
|
@@ -109,7 +107,7 @@ const getArrayDiff = _ref2 => {
|
|
|
109
107
|
return arrayDiff.join('\n');
|
|
110
108
|
};
|
|
111
109
|
const getPermissionsDiff = _ref3 => {
|
|
112
|
-
var
|
|
110
|
+
var _context4;
|
|
113
111
|
let previousValue = _ref3.previousValue,
|
|
114
112
|
nextValue = _ref3.nextValue;
|
|
115
113
|
const permissionDiff = ['permissions changed'];
|
|
@@ -122,12 +120,10 @@ const getPermissionsDiff = _ref3 => {
|
|
|
122
120
|
}, {});
|
|
123
121
|
const indentLevel = 1;
|
|
124
122
|
_forEachInstanceProperty__default["default"](nextValue).call(nextValue, newPermission => {
|
|
125
|
-
|
|
126
|
-
const currentDiff = [_concatInstanceProperty__default["default"](_context9 = "".concat(indent(indentLevel), "\"")).call(_context9, newPermission.name, "\" changed")];
|
|
123
|
+
const currentDiff = [`${indent(indentLevel)}"${newPermission.name}" changed`];
|
|
127
124
|
// if the permission name is not in the old config, it means it is a new addition.
|
|
128
125
|
if (!mappedOldPermissions[newPermission.name]) {
|
|
129
|
-
|
|
130
|
-
permissionDiff.push(_concatInstanceProperty__default["default"](_context0 = "".concat(indent(indentLevel), "\"")).call(_context0, green(newPermission.name), "\" was added"));
|
|
126
|
+
permissionDiff.push(`${indent(indentLevel)}"${green(newPermission.name)}" was added`);
|
|
131
127
|
}
|
|
132
128
|
|
|
133
129
|
// if permission name is in the old config, now we check if there was a change
|
|
@@ -144,22 +140,21 @@ const getPermissionsDiff = _ref3 => {
|
|
|
144
140
|
});
|
|
145
141
|
|
|
146
142
|
// if there are old permissions left, it means they were deleted in the new Permissions.
|
|
147
|
-
_forEachInstanceProperty__default["default"](
|
|
148
|
-
|
|
149
|
-
permissionDiff.push(_concatInstanceProperty__default["default"](_context10 = "".concat(indent(indentLevel), "\"")).call(_context10, red(oldPermissionName), "\" was removed"));
|
|
143
|
+
_forEachInstanceProperty__default["default"](_context4 = _Object$keys__default["default"](mappedOldPermissions)).call(_context4, oldPermissionName => {
|
|
144
|
+
permissionDiff.push(`${indent(indentLevel)}"${red(oldPermissionName)}" was removed`);
|
|
150
145
|
});
|
|
151
146
|
if (permissionDiff.length > 1) return permissionDiff.join('\n');
|
|
152
147
|
return null;
|
|
153
148
|
};
|
|
154
149
|
const getLabelAllLocalesDiff = _ref5 => {
|
|
155
|
-
var
|
|
150
|
+
var _context5;
|
|
156
151
|
let _ref5$previousValue = _ref5.previousValue,
|
|
157
152
|
previousValue = _ref5$previousValue === void 0 ? [] : _ref5$previousValue,
|
|
158
153
|
_ref5$nextValue = _ref5.nextValue,
|
|
159
154
|
nextValue = _ref5$nextValue === void 0 ? [] : _ref5$nextValue,
|
|
160
155
|
_ref5$indentLevel = _ref5.indentLevel,
|
|
161
156
|
indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
|
|
162
|
-
const labelAllLocalesDiff = [
|
|
157
|
+
const labelAllLocalesDiff = [`${indent(indentLevel - 1)}labelAllLocales changed`];
|
|
163
158
|
const mappedOldLabelAllLocales = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
|
|
164
159
|
let locale = _ref6.locale,
|
|
165
160
|
value = _ref6.value;
|
|
@@ -171,8 +166,7 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
171
166
|
if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
|
|
172
167
|
const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
|
|
173
168
|
if (oldLocaleValue !== newLabelAllLocale.value) {
|
|
174
|
-
|
|
175
|
-
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)));
|
|
169
|
+
labelAllLocalesDiff.push(`${indent(indentLevel)}locale "${newLabelAllLocale.locale}" changed: ${red(oldLocaleValue)} => ${green(newLabelAllLocale.value)}`);
|
|
176
170
|
}
|
|
177
171
|
delete mappedOldLabelAllLocales[newLabelAllLocale.locale];
|
|
178
172
|
} else {
|
|
@@ -186,7 +180,7 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
186
180
|
}
|
|
187
181
|
}
|
|
188
182
|
});
|
|
189
|
-
_forEachInstanceProperty__default["default"](
|
|
183
|
+
_forEachInstanceProperty__default["default"](_context5 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context5, key => {
|
|
190
184
|
const localeDiff = getStringDiff({
|
|
191
185
|
previousValue: key,
|
|
192
186
|
label: 'locale',
|
|
@@ -200,14 +194,14 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
200
194
|
return null;
|
|
201
195
|
};
|
|
202
196
|
const getTypeSettingsDiff = _ref7 => {
|
|
203
|
-
var
|
|
197
|
+
var _context6;
|
|
204
198
|
let previousValue = _ref7.previousValue,
|
|
205
199
|
nextValue = _ref7.nextValue;
|
|
206
200
|
const nonNullablePreviousValue = previousValue || {};
|
|
207
201
|
const nonNullableNextValue = nextValue || {};
|
|
208
202
|
const indentLevel = 1;
|
|
209
|
-
const typeSettingsDiff = [
|
|
210
|
-
_forEachInstanceProperty__default["default"](
|
|
203
|
+
const typeSettingsDiff = [`${indent(indentLevel - 1)}type settings changed`];
|
|
204
|
+
_forEachInstanceProperty__default["default"](_context6 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context6, key => {
|
|
211
205
|
const typeSettingDiff = getStringDiff({
|
|
212
206
|
previousValue: nonNullablePreviousValue[key],
|
|
213
207
|
nextValue: nonNullableNextValue[key],
|
|
@@ -257,7 +251,7 @@ const getMainMenuLinkDiff = _ref9 => {
|
|
|
257
251
|
indentLevel: 2
|
|
258
252
|
});
|
|
259
253
|
if (mainMenuLinkPermissionsDiff.length > 0) {
|
|
260
|
-
mainMenuLinkDiff.push(
|
|
254
|
+
mainMenuLinkDiff.push(`${indent(1)}permissions changed`);
|
|
261
255
|
mainMenuLinkDiff.push(mainMenuLinkPermissionsDiff);
|
|
262
256
|
}
|
|
263
257
|
const menuLabelsDiff = getLabelAllLocalesDiff({
|
|
@@ -273,7 +267,7 @@ const getMainMenuLinkDiff = _ref9 => {
|
|
|
273
267
|
return null;
|
|
274
268
|
};
|
|
275
269
|
const getSubmenuLinksDiff = _ref0 => {
|
|
276
|
-
var
|
|
270
|
+
var _context8;
|
|
277
271
|
let previousValue = _ref0.previousValue,
|
|
278
272
|
nextValue = _ref0.nextValue;
|
|
279
273
|
const submenuLinksDiff = ['submenuLink changed'];
|
|
@@ -284,17 +278,16 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
284
278
|
const previousOrder = getOrder(previousValue);
|
|
285
279
|
const newOrder = getOrder(nextValue);
|
|
286
280
|
if (previousOrder !== newOrder) {
|
|
287
|
-
|
|
288
|
-
submenuLinksDiff.push(
|
|
289
|
-
submenuLinksDiff.push(
|
|
290
|
-
submenuLinksDiff.push(_concatInstanceProperty__default["default"](_context17 = "".concat(indent(2), "new order: [")).call(_context17, newOrder, "]"));
|
|
281
|
+
submenuLinksDiff.push(`${indent(1)}submenu order changed`);
|
|
282
|
+
submenuLinksDiff.push(`${indent(2)}previous order: [${previousOrder}]`);
|
|
283
|
+
submenuLinksDiff.push(`${indent(2)}new order: [${newOrder}]`);
|
|
291
284
|
}
|
|
292
285
|
_forEachInstanceProperty__default["default"](nextValue).call(nextValue, newSubmenuLink => {
|
|
293
286
|
const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
|
|
294
287
|
if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
|
|
295
|
-
var
|
|
296
|
-
const submenuLinkDiff = [
|
|
297
|
-
_forEachInstanceProperty__default["default"](
|
|
288
|
+
var _context7;
|
|
289
|
+
const submenuLinkDiff = [`${indent(1)}menu link "${newSubmenuLink.uriPath}" changed`];
|
|
290
|
+
_forEachInstanceProperty__default["default"](_context7 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context7, key => {
|
|
298
291
|
switch (key) {
|
|
299
292
|
case 'defaultLabel':
|
|
300
293
|
{
|
|
@@ -318,7 +311,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
318
311
|
indentLevel: 3
|
|
319
312
|
});
|
|
320
313
|
if (submenuLinkPermissionsDiff.length > 0) {
|
|
321
|
-
submenuLinkDiff.push(
|
|
314
|
+
submenuLinkDiff.push(`${indent(2)}permissions changed`);
|
|
322
315
|
submenuLinkDiff.push(submenuLinkPermissionsDiff);
|
|
323
316
|
}
|
|
324
317
|
break;
|
|
@@ -353,7 +346,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
353
346
|
}
|
|
354
347
|
}
|
|
355
348
|
});
|
|
356
|
-
_forEachInstanceProperty__default["default"](
|
|
349
|
+
_forEachInstanceProperty__default["default"](_context8 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context8, key => {
|
|
357
350
|
const linksDiff = getStringDiff({
|
|
358
351
|
previousValue: key,
|
|
359
352
|
label: 'menu link',
|
|
@@ -527,13 +520,12 @@ const getCustomViewConfigDiff = (oldConfig, newConfig) => {
|
|
|
527
520
|
};
|
|
528
521
|
|
|
529
522
|
const getMcUrlLink = _ref => {
|
|
530
|
-
var _context, _context2, _context3;
|
|
531
523
|
let mcApiUrl = _ref.mcApiUrl,
|
|
532
524
|
organizationId = _ref.organizationId,
|
|
533
525
|
customEntityId = _ref.customEntityId,
|
|
534
526
|
isCustomView = _ref.isCustomView;
|
|
535
527
|
const mcUrl = mcApiUrl.replace('mc-api', 'mc');
|
|
536
|
-
const customEntityLink =
|
|
528
|
+
const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}`;
|
|
537
529
|
return customEntityLink;
|
|
538
530
|
};
|
|
539
531
|
const isCustomViewData = data => data.entryPointUriPath === undefined;
|
|
@@ -544,7 +536,7 @@ async function performCreateCustomApplication(_ref2) {
|
|
|
544
536
|
localCustomEntityData = _ref2.localCustomEntityData,
|
|
545
537
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
546
538
|
dryRun = _ref2.dryRun;
|
|
547
|
-
console.log(
|
|
539
|
+
console.log(`Creating Custom Application in organization "${chalk__default["default"].green(organizationName)}"...`);
|
|
548
540
|
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
549
541
|
if (dryRun) {
|
|
550
542
|
console.log();
|
|
@@ -567,9 +559,9 @@ async function performCreateCustomApplication(_ref2) {
|
|
|
567
559
|
customEntityId: createdCustomApplication.id
|
|
568
560
|
});
|
|
569
561
|
console.log(chalk__default["default"].green('Custom Application created successfully.'));
|
|
570
|
-
console.log(
|
|
571
|
-
console.log(
|
|
572
|
-
console.log(
|
|
562
|
+
console.log(`ID: ${chalk__default["default"].cyan(createdCustomApplication.id)}`);
|
|
563
|
+
console.log(`Please update the "env.production.applicationId" field in your local Custom Application config file with the ID above.`);
|
|
564
|
+
console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
|
|
573
565
|
return createdCustomApplication.id;
|
|
574
566
|
}
|
|
575
567
|
async function performUpdateCustomApplication(_ref3) {
|
|
@@ -582,7 +574,7 @@ async function performUpdateCustomApplication(_ref3) {
|
|
|
582
574
|
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
583
575
|
if (dryRun) {
|
|
584
576
|
console.log();
|
|
585
|
-
console.log(
|
|
577
|
+
console.log(`Dry run - would update Custom Application "${chalk__default["default"].green(data.entryPointUriPath)}" with:`);
|
|
586
578
|
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
587
579
|
return;
|
|
588
580
|
}
|
|
@@ -600,7 +592,7 @@ async function performUpdateCustomApplication(_ref3) {
|
|
|
600
592
|
customEntityId: applicationId
|
|
601
593
|
});
|
|
602
594
|
console.log(chalk__default["default"].green('Custom Application updated successfully.'));
|
|
603
|
-
console.log(
|
|
595
|
+
console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
|
|
604
596
|
}
|
|
605
597
|
async function performCreateCustomView(_ref4) {
|
|
606
598
|
let mcApiUrl = _ref4.mcApiUrl,
|
|
@@ -609,7 +601,7 @@ async function performCreateCustomView(_ref4) {
|
|
|
609
601
|
localCustomEntityData = _ref4.localCustomEntityData,
|
|
610
602
|
applicationIdentifier = _ref4.applicationIdentifier,
|
|
611
603
|
dryRun = _ref4.dryRun;
|
|
612
|
-
console.log(
|
|
604
|
+
console.log(`Creating Custom View in organization "${chalk__default["default"].green(organizationName)}"...`);
|
|
613
605
|
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
614
606
|
if (dryRun) {
|
|
615
607
|
console.log();
|
|
@@ -633,9 +625,9 @@ async function performCreateCustomView(_ref4) {
|
|
|
633
625
|
isCustomView: true
|
|
634
626
|
});
|
|
635
627
|
console.log(chalk__default["default"].green('Custom View created successfully.'));
|
|
636
|
-
console.log(
|
|
637
|
-
console.log(
|
|
638
|
-
console.log(
|
|
628
|
+
console.log(`ID: ${chalk__default["default"].cyan(createdCustomView.id)}`);
|
|
629
|
+
console.log(`Please update the "env.production.customViewId" field in your local Custom View config file with the ID above.`);
|
|
630
|
+
console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
|
|
639
631
|
return createdCustomView.id;
|
|
640
632
|
}
|
|
641
633
|
async function performUpdateCustomView(_ref5) {
|
|
@@ -648,7 +640,7 @@ async function performUpdateCustomView(_ref5) {
|
|
|
648
640
|
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
649
641
|
if (dryRun) {
|
|
650
642
|
console.log();
|
|
651
|
-
console.log(
|
|
643
|
+
console.log(`Dry run - would update Custom View "${chalk__default["default"].green(data.defaultLabel)}" with:`);
|
|
652
644
|
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
653
645
|
return;
|
|
654
646
|
}
|
|
@@ -667,7 +659,7 @@ async function performUpdateCustomView(_ref5) {
|
|
|
667
659
|
isCustomView: true
|
|
668
660
|
});
|
|
669
661
|
console.log(chalk__default["default"].green('Custom View updated successfully.'));
|
|
670
|
-
console.log(
|
|
662
|
+
console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
|
|
671
663
|
}
|
|
672
664
|
async function checkCustomApplicationStatus(_ref6) {
|
|
673
665
|
let mcApiUrl = _ref6.mcApiUrl,
|
|
@@ -699,7 +691,6 @@ async function checkCustomApplicationStatus(_ref6) {
|
|
|
699
691
|
};
|
|
700
692
|
}
|
|
701
693
|
async function checkCustomViewStatus(_ref7) {
|
|
702
|
-
var _fetchedCustomView$cu, _fetchedCustomView$cu2;
|
|
703
694
|
let mcApiUrl = _ref7.mcApiUrl,
|
|
704
695
|
customViewId = _ref7.customViewId,
|
|
705
696
|
applicationIdentifier = _ref7.applicationIdentifier,
|
|
@@ -718,13 +709,13 @@ async function checkCustomViewStatus(_ref7) {
|
|
|
718
709
|
const customViewLink = getMcUrlLink({
|
|
719
710
|
mcApiUrl,
|
|
720
711
|
organizationId: fetchedCustomView.organizationId,
|
|
721
|
-
customEntityId:
|
|
712
|
+
customEntityId: fetchedCustomView?.customView?.id || '',
|
|
722
713
|
isCustomView: true
|
|
723
714
|
});
|
|
724
715
|
return {
|
|
725
716
|
exists: true,
|
|
726
717
|
organizationId: fetchedCustomView.organizationId,
|
|
727
|
-
customViewId:
|
|
718
|
+
customViewId: fetchedCustomView?.customView?.id || '',
|
|
728
719
|
configDiff,
|
|
729
720
|
link: customViewLink
|
|
730
721
|
};
|