@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.
- 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 +14 -13
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +14 -13
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +14 -13
- package/dist/{build-f737874d.cjs.dev.js → build-0a5986d1.cjs.dev.js} +7 -7
- package/dist/{build-85028596.esm.js → build-dbcd0936.esm.js} +7 -7
- package/dist/{build-136a1b89.cjs.prod.js → build-ec10df64.cjs.prod.js} +7 -7
- package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-16b1a575.cjs.dev.js} +8 -9
- package/dist/{build-vite-85211835.esm.js → build-vite-59e1f185.esm.js} +8 -9
- package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-5d317720.cjs.prod.js} +8 -9
- 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-c2f0d0d2.cjs.prod.js → config-sync-ce05c66c.cjs.prod.js} +70 -78
- package/dist/{config-sync-a6d29e7e.cjs.dev.js → config-sync-dbb43993.cjs.dev.js} +72 -80
- package/dist/{config-sync-ca738e38.esm.js → config-sync-e7f53a98.esm.js} +71 -79
- package/dist/{create-postcss-config-2a12c11b.esm.js → create-postcss-config-0a86560d.esm.js} +1 -1
- package/dist/{create-postcss-config-7ea95e6f.cjs.dev.js → create-postcss-config-381b636b.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-43a47b87.cjs.prod.js → create-postcss-config-91c09596.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-01784333.cjs.prod.js → create-webpack-config-for-development-37677a49.cjs.prod.js} +6 -6
- package/dist/{create-webpack-config-for-development-09988fe4.cjs.dev.js → create-webpack-config-for-development-488742b2.cjs.dev.js} +6 -6
- package/dist/{create-webpack-config-for-development-ca57ea56.esm.js → create-webpack-config-for-development-df3f7f7f.esm.js} +6 -6
- package/dist/{create-webpack-config-for-production-d1699ee5.cjs.dev.js → create-webpack-config-for-production-46d817cc.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-production-58d046e9.cjs.prod.js → create-webpack-config-for-production-aad64e2a.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-production-7b4166fc.esm.js → create-webpack-config-for-production-e22f78d2.esm.js} +7 -7
- package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-0b89aa0e.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-4464313c.esm.js} +1 -1
- package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-cbb5c559.cjs.dev.js} +1 -1
- package/dist/{deployment-previews-set-6baa8fc7.cjs.dev.js → deployment-previews-set-4edd48db.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-86ea8608.cjs.prod.js → deployment-previews-set-636fb1a3.cjs.prod.js} +22 -28
- package/dist/{deployment-previews-set-8b33d390.esm.js → deployment-previews-set-bbef95d2.esm.js} +22 -27
- package/dist/{graphql-requests-73d961d9.cjs.dev.js → graphql-requests-0a6eeb3a.cjs.prod.js} +5 -8
- package/dist/{graphql-requests-b6ca7894.esm.js → graphql-requests-14074b2b.esm.js} +5 -8
- package/dist/{graphql-requests-4ff022ec.cjs.prod.js → graphql-requests-23f7ddb1.cjs.dev.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-5c212340.esm.js → login-1b222f33.esm.js} +27 -30
- package/dist/{login-b4e3433c.cjs.prod.js → login-54ebae96.cjs.prod.js} +28 -31
- package/dist/{login-856475d9.cjs.dev.js → login-a6fd5fbf.cjs.dev.js} +28 -31
- package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
- package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
- package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
- package/dist/{package-85c56dad.esm.js → package-a34835d9.esm.js} +9 -11
- package/dist/{package-36c179b4.cjs.prod.js → package-d8b1f4c0.cjs.dev.js} +9 -11
- package/dist/{package-483f057b.cjs.dev.js → package-e1f7242c.cjs.prod.js} +9 -11
- 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-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
- package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
- package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
- package/dist/{start-33cc9cbb.cjs.prod.js → start-0be8a294.cjs.prod.js} +8 -9
- package/dist/{start-e28d1fec.cjs.dev.js → start-37ec4a7e.cjs.dev.js} +8 -9
- package/dist/{start-654d09ae.esm.js → start-890895df.esm.js} +8 -9
- package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
- package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
- package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
- package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
- package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.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 -11
- 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 +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
- 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
|
@@ -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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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"](
|
|
167
|
-
|
|
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
|
|
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 = [
|
|
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
|
-
|
|
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"](
|
|
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
|
|
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 = [
|
|
229
|
-
_forEachInstanceProperty__default["default"](
|
|
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(
|
|
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
|
|
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
|
-
|
|
307
|
-
submenuLinksDiff.push(
|
|
308
|
-
submenuLinksDiff.push(
|
|
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
|
|
315
|
-
const submenuLinkDiff = [
|
|
316
|
-
_forEachInstanceProperty__default["default"](
|
|
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(
|
|
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"](
|
|
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 =
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
588
|
-
const organizationChoices = _mapInstanceProperty__default["default"](
|
|
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(
|
|
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"](
|
|
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(
|
|
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(
|
|
648
|
-
console.log(
|
|
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(
|
|
659
|
-
console.log(
|
|
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"](
|
|
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(
|
|
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(
|
|
692
|
-
console.log(
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
724
|
-
const organizationChoices = _mapInstanceProperty__default["default"](
|
|
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(
|
|
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"](
|
|
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(
|
|
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(
|
|
785
|
-
console.log(
|
|
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:
|
|
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(
|
|
797
|
-
console.log(
|
|
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"](
|
|
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(
|
|
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:
|
|
818
|
+
customViewId: fetchedCustomView?.customView?.id || '',
|
|
827
819
|
applicationIdentifier
|
|
828
820
|
});
|
|
829
|
-
console.log(chalk__default["default"].green(
|
|
830
|
-
console.log(
|
|
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(
|
|
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(
|
|
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({
|