@commercetools-frontend/mc-scripts 24.10.0 → 24.12.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 +13 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +13 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +13 -14
- package/dist/{build-c91d680c.esm.js → build-1c7d82ef.esm.js} +7 -7
- package/dist/{build-bd986bac.cjs.dev.js → build-895fb1d2.cjs.dev.js} +7 -7
- package/dist/{build-9c26fe58.cjs.prod.js → build-be24f6d9.cjs.prod.js} +7 -7
- package/dist/{build-vite-5d317720.cjs.prod.js → build-vite-4a6c90c2.cjs.prod.js} +9 -8
- package/dist/{build-vite-59e1f185.esm.js → build-vite-85211835.esm.js} +9 -8
- package/dist/{build-vite-16b1a575.cjs.dev.js → build-vite-e26f6c9f.cjs.dev.js} +9 -8
- 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-f4ac88cc.cjs.dev.js → compile-html-8679f721.cjs.dev.js} +5 -2
- package/dist/{compile-html-025cd493.esm.js → compile-html-adfef598.esm.js} +4 -2
- package/dist/{compile-html-50fd05ec.cjs.prod.js → compile-html-b80f9651.cjs.prod.js} +5 -2
- package/dist/{config-sync-d57260cc.esm.js → config-sync-78ccf97c.esm.js} +79 -69
- package/dist/{config-sync-200c5df5.cjs.prod.js → config-sync-e32e3fa6.cjs.prod.js} +78 -67
- package/dist/{config-sync-6977827c.cjs.dev.js → config-sync-ffddb604.cjs.dev.js} +80 -69
- package/dist/{create-postcss-config-fe3387fa.cjs.prod.js → create-postcss-config-2d574316.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-152ced99.esm.js → create-postcss-config-3887c44a.esm.js} +1 -1
- package/dist/{create-postcss-config-fd3dee79.cjs.dev.js → create-postcss-config-a47547b4.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-development-527a632e.cjs.prod.js → create-webpack-config-for-development-03c59e8e.cjs.prod.js} +9 -7
- package/dist/{create-webpack-config-for-development-48e5e9d0.esm.js → create-webpack-config-for-development-2c20b570.esm.js} +9 -7
- package/dist/{create-webpack-config-for-development-049a78d6.cjs.dev.js → create-webpack-config-for-development-99b8871e.cjs.dev.js} +9 -7
- package/dist/{create-webpack-config-for-production-9452f0ea.cjs.dev.js → create-webpack-config-for-production-28456828.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-production-5ef997a2.cjs.prod.js → create-webpack-config-for-production-59e18392.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-production-991b35ad.esm.js → create-webpack-config-for-production-94bc1e6d.esm.js} +7 -7
- package/dist/{credentials-storage-0b89aa0e.cjs.prod.js → credentials-storage-381abf27.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-4464313c.esm.js → credentials-storage-7285d7b4.esm.js} +1 -1
- package/dist/{credentials-storage-cbb5c559.cjs.dev.js → credentials-storage-de220814.cjs.dev.js} +1 -1
- package/dist/{deployment-previews-set-93927f50.cjs.prod.js → deployment-previews-set-117c5626.cjs.prod.js} +28 -22
- package/dist/{deployment-previews-set-b9ebe08f.cjs.dev.js → deployment-previews-set-1e263b53.cjs.dev.js} +28 -22
- package/dist/{deployment-previews-set-178cacbc.esm.js → deployment-previews-set-a243363b.esm.js} +27 -22
- package/dist/{graphql-requests-6043a20b.esm.js → graphql-requests-54b9815d.esm.js} +8 -5
- package/dist/{graphql-requests-c5ecf40e.cjs.prod.js → graphql-requests-b4c8c047.cjs.dev.js} +8 -5
- package/dist/{graphql-requests-5527b635.cjs.dev.js → graphql-requests-b89caeb1.cjs.prod.js} +8 -5
- package/dist/{i18n-message-complilation-7311cb29.cjs.dev.js → i18n-message-complilation-393d344a.cjs.prod.js} +1 -1
- package/dist/{i18n-message-complilation-7762da61.cjs.prod.js → i18n-message-complilation-3f80e8d6.cjs.dev.js} +1 -1
- package/dist/{i18n-message-complilation-21d3b0aa.esm.js → i18n-message-complilation-8aec9d1b.esm.js} +1 -1
- package/dist/{login-2c875e0b.esm.js → login-0223db92.esm.js} +32 -23
- package/dist/{login-d7cb2619.cjs.dev.js → login-935abd52.cjs.dev.js} +35 -23
- package/dist/{login-73e9f04f.cjs.prod.js → login-bf7607cf.cjs.prod.js} +35 -23
- package/dist/{optimizations-fb93514f.cjs.prod.js → optimizations-ea21b802.cjs.prod.js} +8 -5
- package/dist/{optimizations-bf991634.esm.js → optimizations-ea71a24a.esm.js} +7 -5
- package/dist/{optimizations-7789145e.cjs.dev.js → optimizations-ebbeaf88.cjs.dev.js} +8 -5
- package/dist/{package-6a5c0475.esm.js → package-31f38f64.esm.js} +10 -10
- package/dist/{package-0d7eef40.cjs.dev.js → package-ad6a5026.cjs.prod.js} +10 -10
- package/dist/{package-c32ced1c.cjs.prod.js → package-dc76e3fe.cjs.dev.js} +10 -10
- package/dist/{paths-39f22b8b.esm.js → paths-7bf7e88e.esm.js} +9 -4
- package/dist/{paths-7768b440.cjs.prod.js → paths-af1a725a.cjs.prod.js} +10 -4
- package/dist/{paths-b76fc753.cjs.dev.js → paths-ec3e3a7d.cjs.dev.js} +10 -4
- package/dist/{serve-50d33f0b.cjs.dev.js → serve-04a03d5f.cjs.dev.js} +6 -4
- package/dist/{serve-8a506da6.cjs.prod.js → serve-2a863026.cjs.prod.js} +6 -4
- package/dist/{serve-1036c2de.esm.js → serve-fb1a0f5a.esm.js} +6 -4
- package/dist/{start-296a8335.cjs.prod.js → start-3a301547.cjs.prod.js} +9 -8
- package/dist/{start-f7aed0ed.esm.js → start-57d1d14c.esm.js} +9 -8
- package/dist/{start-66ec8479.cjs.dev.js → start-7e607d2a.cjs.dev.js} +9 -8
- package/dist/{start-vite-29078b3a.cjs.prod.js → start-vite-d548c121.cjs.prod.js} +4 -3
- package/dist/{start-vite-7d1161e8.esm.js → start-vite-d649d1f3.esm.js} +4 -3
- package/dist/{start-vite-068e9f73.cjs.dev.js → start-vite-eea72ba9.cjs.dev.js} +4 -3
- package/dist/{vite-plugin-svgr-de6ee7da.esm.js → vite-plugin-svgr-22c8d518.esm.js} +4 -4
- package/dist/{vite-plugin-svgr-4034a834.cjs.prod.js → vite-plugin-svgr-53ef97c7.cjs.dev.js} +4 -4
- package/dist/{vite-plugin-svgr-7d06f400.cjs.dev.js → vite-plugin-svgr-5de1cad9.cjs.prod.js} +4 -4
- package/package.json +10 -10
- 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
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "24.
|
|
8
|
+
var version = "24.12.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "24.
|
|
8
|
+
var version = "24.12.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
3
4
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
4
5
|
var fs = require('fs');
|
|
5
6
|
var chalk = require('chalk');
|
|
6
7
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
7
|
-
var paths = require('./paths-
|
|
8
|
+
var paths = require('./paths-ec3e3a7d.cjs.dev.js');
|
|
8
9
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
9
10
|
require('path');
|
|
10
11
|
require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
@@ -12,6 +13,7 @@ require('node:fs');
|
|
|
12
13
|
|
|
13
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
14
15
|
|
|
16
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
15
17
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
16
18
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
19
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
@@ -31,7 +33,8 @@ async function run(options) {
|
|
|
31
33
|
const transformerFn = require(transformerPath);
|
|
32
34
|
transformerFn(compiled);
|
|
33
35
|
} catch (error) {
|
|
34
|
-
|
|
36
|
+
var _context;
|
|
37
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
35
38
|
}
|
|
36
39
|
} else if (options.printSecurityHeaders) {
|
|
37
40
|
console.log(_JSON$stringify__default["default"](compiled.headers));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
1
2
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
2
3
|
import fs from 'fs';
|
|
3
4
|
import chalk from 'chalk';
|
|
4
5
|
import { compileHtml } from '@commercetools-frontend/mc-html-template';
|
|
5
|
-
import { p as paths } from './paths-
|
|
6
|
+
import { p as paths } from './paths-7bf7e88e.esm.js';
|
|
6
7
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
7
8
|
import 'path';
|
|
8
9
|
import './does-file-exist-32618334.esm.js';
|
|
@@ -23,7 +24,8 @@ async function run(options) {
|
|
|
23
24
|
const transformerFn = require(transformerPath);
|
|
24
25
|
transformerFn(compiled);
|
|
25
26
|
} catch (error) {
|
|
26
|
-
|
|
27
|
+
var _context;
|
|
28
|
+
throw new Error(_concatInstanceProperty(_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
27
29
|
}
|
|
28
30
|
} else if (options.printSecurityHeaders) {
|
|
29
31
|
console.log(_JSON$stringify(compiled.headers));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
3
4
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
4
5
|
var fs = require('fs');
|
|
5
6
|
var chalk = require('chalk');
|
|
6
7
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
7
|
-
var paths = require('./paths-
|
|
8
|
+
var paths = require('./paths-af1a725a.cjs.prod.js');
|
|
8
9
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
9
10
|
require('path');
|
|
10
11
|
require('./does-file-exist-be53305d.cjs.prod.js');
|
|
@@ -12,6 +13,7 @@ require('node:fs');
|
|
|
12
13
|
|
|
13
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
14
15
|
|
|
16
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
15
17
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
16
18
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
19
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
@@ -31,7 +33,8 @@ async function run(options) {
|
|
|
31
33
|
const transformerFn = require(transformerPath);
|
|
32
34
|
transformerFn(compiled);
|
|
33
35
|
} catch (error) {
|
|
34
|
-
|
|
36
|
+
var _context;
|
|
37
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
35
38
|
}
|
|
36
39
|
} else if (options.printSecurityHeaders) {
|
|
37
40
|
console.log(_JSON$stringify__default["default"](compiled.headers));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
2
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
2
3
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
3
4
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
4
5
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -7,7 +8,7 @@ import chalk from 'chalk';
|
|
|
7
8
|
import omit from 'lodash/omit';
|
|
8
9
|
import prompts from 'prompts';
|
|
9
10
|
import { sanitizeSvg, processConfig } from '@commercetools-frontend/application-config';
|
|
10
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
11
|
+
import { C as CredentialsStorage } from './credentials-storage-7285d7b4.esm.js';
|
|
11
12
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
12
13
|
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
13
14
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
@@ -19,7 +20,7 @@ import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
|
19
20
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
20
21
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
21
22
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
22
|
-
import { f as fetchCustomApplication, a as fetchUserOrganizations, c as createCustomApplication, u as updateCustomApplication, b as fetchCustomView, d as createCustomView, e as updateCustomView } from './graphql-requests-
|
|
23
|
+
import { f as fetchCustomApplication, a as fetchUserOrganizations, c as createCustomApplication, u as updateCustomApplication, b as fetchCustomView, d as createCustomView, e as updateCustomView } from './graphql-requests-54b9815d.esm.js';
|
|
23
24
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
24
25
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
25
26
|
import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
@@ -32,20 +33,20 @@ import 'graphql';
|
|
|
32
33
|
import 'graphql-request';
|
|
33
34
|
import '@commercetools-frontend/constants';
|
|
34
35
|
import '@commercetools/http-user-agent';
|
|
35
|
-
import './package-
|
|
36
|
+
import './package-31f38f64.esm.js';
|
|
36
37
|
|
|
37
38
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
39
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context21, _context22; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context21 = ownKeys(Object(t), !0)).call(_context21, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context22 = ownKeys(Object(t))).call(_context22, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
40
|
|
|
40
41
|
// Since not all terminal supports colors, to make things more consistent for testing purposes,
|
|
41
42
|
// during tests the color used is appended before the string instead of coloring it.
|
|
42
43
|
const isTest = process.env.NODE_ENV === 'test';
|
|
43
44
|
const red = str => {
|
|
44
|
-
if (isTest) return
|
|
45
|
+
if (isTest) return "<color-red>".concat(str, "</color-red>");
|
|
45
46
|
return chalk.red(str);
|
|
46
47
|
};
|
|
47
48
|
const green = str => {
|
|
48
|
-
if (isTest) return
|
|
49
|
+
if (isTest) return "<color-green>".concat(str, "</color-green>");
|
|
49
50
|
return chalk.green(str);
|
|
50
51
|
};
|
|
51
52
|
|
|
@@ -61,13 +62,16 @@ const getStringDiff = _ref => {
|
|
|
61
62
|
_ref$indentLevel = _ref.indentLevel,
|
|
62
63
|
indentLevel = _ref$indentLevel === void 0 ? 0 : _ref$indentLevel;
|
|
63
64
|
if (!previousValue && nextValue) {
|
|
64
|
-
|
|
65
|
+
var _context2, _context3;
|
|
66
|
+
return _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "".concat(indent(indentLevel))).call(_context3, label, " added: ")).call(_context2, green(nextValue));
|
|
65
67
|
}
|
|
66
68
|
if (previousValue && !nextValue) {
|
|
67
|
-
|
|
69
|
+
var _context4, _context5;
|
|
70
|
+
return _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = "".concat(indent(indentLevel))).call(_context5, label, " removed: ")).call(_context4, red(previousValue));
|
|
68
71
|
}
|
|
69
72
|
if (previousValue && nextValue && previousValue !== nextValue) {
|
|
70
|
-
|
|
73
|
+
var _context6, _context7, _context8;
|
|
74
|
+
return _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = "".concat(indent(indentLevel))).call(_context8, label, " changed: ")).call(_context7, red(previousValue), " => ")).call(_context6, green(nextValue));
|
|
71
75
|
}
|
|
72
76
|
return null;
|
|
73
77
|
};
|
|
@@ -80,7 +84,7 @@ const getArrayDiff = _ref2 => {
|
|
|
80
84
|
indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
|
|
81
85
|
const oldArraySet = new _Set(previousValue);
|
|
82
86
|
const arrayDiff = [];
|
|
83
|
-
nextValue
|
|
87
|
+
nextValue === null || nextValue === void 0 || _forEachInstanceProperty(nextValue).call(nextValue, item => {
|
|
84
88
|
if (oldArraySet.has(item)) {
|
|
85
89
|
oldArraySet.delete(item);
|
|
86
90
|
} else {
|
|
@@ -101,7 +105,7 @@ const getArrayDiff = _ref2 => {
|
|
|
101
105
|
return arrayDiff.join('\n');
|
|
102
106
|
};
|
|
103
107
|
const getPermissionsDiff = _ref3 => {
|
|
104
|
-
var
|
|
108
|
+
var _context1;
|
|
105
109
|
let previousValue = _ref3.previousValue,
|
|
106
110
|
nextValue = _ref3.nextValue;
|
|
107
111
|
const permissionDiff = ['permissions changed'];
|
|
@@ -114,10 +118,12 @@ const getPermissionsDiff = _ref3 => {
|
|
|
114
118
|
}, {});
|
|
115
119
|
const indentLevel = 1;
|
|
116
120
|
_forEachInstanceProperty(nextValue).call(nextValue, newPermission => {
|
|
117
|
-
|
|
121
|
+
var _context9;
|
|
122
|
+
const currentDiff = [_concatInstanceProperty(_context9 = "".concat(indent(indentLevel), "\"")).call(_context9, newPermission.name, "\" changed")];
|
|
118
123
|
// if the permission name is not in the old config, it means it is a new addition.
|
|
119
124
|
if (!mappedOldPermissions[newPermission.name]) {
|
|
120
|
-
|
|
125
|
+
var _context0;
|
|
126
|
+
permissionDiff.push(_concatInstanceProperty(_context0 = "".concat(indent(indentLevel), "\"")).call(_context0, green(newPermission.name), "\" was added"));
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
// if permission name is in the old config, now we check if there was a change
|
|
@@ -134,21 +140,22 @@ const getPermissionsDiff = _ref3 => {
|
|
|
134
140
|
});
|
|
135
141
|
|
|
136
142
|
// if there are old permissions left, it means they were deleted in the new Permissions.
|
|
137
|
-
_forEachInstanceProperty(
|
|
138
|
-
|
|
143
|
+
_forEachInstanceProperty(_context1 = _Object$keys(mappedOldPermissions)).call(_context1, oldPermissionName => {
|
|
144
|
+
var _context10;
|
|
145
|
+
permissionDiff.push(_concatInstanceProperty(_context10 = "".concat(indent(indentLevel), "\"")).call(_context10, red(oldPermissionName), "\" was removed"));
|
|
139
146
|
});
|
|
140
147
|
if (permissionDiff.length > 1) return permissionDiff.join('\n');
|
|
141
148
|
return null;
|
|
142
149
|
};
|
|
143
150
|
const getLabelAllLocalesDiff = _ref5 => {
|
|
144
|
-
var
|
|
151
|
+
var _context14;
|
|
145
152
|
let _ref5$previousValue = _ref5.previousValue,
|
|
146
153
|
previousValue = _ref5$previousValue === void 0 ? [] : _ref5$previousValue,
|
|
147
154
|
_ref5$nextValue = _ref5.nextValue,
|
|
148
155
|
nextValue = _ref5$nextValue === void 0 ? [] : _ref5$nextValue,
|
|
149
156
|
_ref5$indentLevel = _ref5.indentLevel,
|
|
150
157
|
indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
|
|
151
|
-
const labelAllLocalesDiff = [
|
|
158
|
+
const labelAllLocalesDiff = ["".concat(indent(indentLevel - 1), "labelAllLocales changed")];
|
|
152
159
|
const mappedOldLabelAllLocales = _reduceInstanceProperty(previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
|
|
153
160
|
let locale = _ref6.locale,
|
|
154
161
|
value = _ref6.value;
|
|
@@ -160,7 +167,8 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
160
167
|
if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
|
|
161
168
|
const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
|
|
162
169
|
if (oldLocaleValue !== newLabelAllLocale.value) {
|
|
163
|
-
|
|
170
|
+
var _context11, _context12, _context13;
|
|
171
|
+
labelAllLocalesDiff.push(_concatInstanceProperty(_context11 = _concatInstanceProperty(_context12 = _concatInstanceProperty(_context13 = "".concat(indent(indentLevel), "locale \"")).call(_context13, newLabelAllLocale.locale, "\" changed: ")).call(_context12, red(oldLocaleValue), " => ")).call(_context11, green(newLabelAllLocale.value)));
|
|
164
172
|
}
|
|
165
173
|
delete mappedOldLabelAllLocales[newLabelAllLocale.locale];
|
|
166
174
|
} else {
|
|
@@ -174,7 +182,7 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
174
182
|
}
|
|
175
183
|
}
|
|
176
184
|
});
|
|
177
|
-
_forEachInstanceProperty(
|
|
185
|
+
_forEachInstanceProperty(_context14 = _Object$keys(mappedOldLabelAllLocales)).call(_context14, key => {
|
|
178
186
|
const localeDiff = getStringDiff({
|
|
179
187
|
previousValue: key,
|
|
180
188
|
label: 'locale',
|
|
@@ -188,14 +196,14 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
188
196
|
return null;
|
|
189
197
|
};
|
|
190
198
|
const getTypeSettingsDiff = _ref7 => {
|
|
191
|
-
var
|
|
199
|
+
var _context15;
|
|
192
200
|
let previousValue = _ref7.previousValue,
|
|
193
201
|
nextValue = _ref7.nextValue;
|
|
194
202
|
const nonNullablePreviousValue = previousValue || {};
|
|
195
203
|
const nonNullableNextValue = nextValue || {};
|
|
196
204
|
const indentLevel = 1;
|
|
197
|
-
const typeSettingsDiff = [
|
|
198
|
-
_forEachInstanceProperty(
|
|
205
|
+
const typeSettingsDiff = ["".concat(indent(indentLevel - 1), "type settings changed")];
|
|
206
|
+
_forEachInstanceProperty(_context15 = _Object$keys(nonNullablePreviousValue)).call(_context15, key => {
|
|
199
207
|
const typeSettingDiff = getStringDiff({
|
|
200
208
|
previousValue: nonNullablePreviousValue[key],
|
|
201
209
|
nextValue: nonNullableNextValue[key],
|
|
@@ -245,7 +253,7 @@ const getMainMenuLinkDiff = _ref9 => {
|
|
|
245
253
|
indentLevel: 2
|
|
246
254
|
});
|
|
247
255
|
if (mainMenuLinkPermissionsDiff.length > 0) {
|
|
248
|
-
mainMenuLinkDiff.push(
|
|
256
|
+
mainMenuLinkDiff.push("".concat(indent(1), "permissions changed"));
|
|
249
257
|
mainMenuLinkDiff.push(mainMenuLinkPermissionsDiff);
|
|
250
258
|
}
|
|
251
259
|
const menuLabelsDiff = getLabelAllLocalesDiff({
|
|
@@ -261,7 +269,7 @@ const getMainMenuLinkDiff = _ref9 => {
|
|
|
261
269
|
return null;
|
|
262
270
|
};
|
|
263
271
|
const getSubmenuLinksDiff = _ref0 => {
|
|
264
|
-
var
|
|
272
|
+
var _context20;
|
|
265
273
|
let previousValue = _ref0.previousValue,
|
|
266
274
|
nextValue = _ref0.nextValue;
|
|
267
275
|
const submenuLinksDiff = ['submenuLink changed'];
|
|
@@ -272,16 +280,17 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
272
280
|
const previousOrder = getOrder(previousValue);
|
|
273
281
|
const newOrder = getOrder(nextValue);
|
|
274
282
|
if (previousOrder !== newOrder) {
|
|
275
|
-
|
|
276
|
-
submenuLinksDiff.push(
|
|
277
|
-
submenuLinksDiff.push(
|
|
283
|
+
var _context16, _context17;
|
|
284
|
+
submenuLinksDiff.push("".concat(indent(1), "submenu order changed"));
|
|
285
|
+
submenuLinksDiff.push(_concatInstanceProperty(_context16 = "".concat(indent(2), "previous order: [")).call(_context16, previousOrder, "]"));
|
|
286
|
+
submenuLinksDiff.push(_concatInstanceProperty(_context17 = "".concat(indent(2), "new order: [")).call(_context17, newOrder, "]"));
|
|
278
287
|
}
|
|
279
288
|
_forEachInstanceProperty(nextValue).call(nextValue, newSubmenuLink => {
|
|
280
289
|
const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
|
|
281
290
|
if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
|
|
282
|
-
var
|
|
283
|
-
const submenuLinkDiff = [
|
|
284
|
-
_forEachInstanceProperty(
|
|
291
|
+
var _context18, _context19;
|
|
292
|
+
const submenuLinkDiff = [_concatInstanceProperty(_context18 = "".concat(indent(1), "menu link \"")).call(_context18, newSubmenuLink.uriPath, "\" changed")];
|
|
293
|
+
_forEachInstanceProperty(_context19 = _Object$keys(mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context19, key => {
|
|
285
294
|
switch (key) {
|
|
286
295
|
case 'defaultLabel':
|
|
287
296
|
{
|
|
@@ -305,7 +314,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
305
314
|
indentLevel: 3
|
|
306
315
|
});
|
|
307
316
|
if (submenuLinkPermissionsDiff.length > 0) {
|
|
308
|
-
submenuLinkDiff.push(
|
|
317
|
+
submenuLinkDiff.push("".concat(indent(2), "permissions changed"));
|
|
309
318
|
submenuLinkDiff.push(submenuLinkPermissionsDiff);
|
|
310
319
|
}
|
|
311
320
|
break;
|
|
@@ -340,7 +349,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
340
349
|
}
|
|
341
350
|
}
|
|
342
351
|
});
|
|
343
|
-
_forEachInstanceProperty(
|
|
352
|
+
_forEachInstanceProperty(_context20 = _Object$keys(mappedSubmenuLinks)).call(_context20, key => {
|
|
344
353
|
const linksDiff = getStringDiff({
|
|
345
354
|
previousValue: key,
|
|
346
355
|
label: 'menu link',
|
|
@@ -515,17 +524,18 @@ const getCustomViewConfigDiff = (oldConfig, newConfig) => {
|
|
|
515
524
|
|
|
516
525
|
const credentialsStorage = new CredentialsStorage();
|
|
517
526
|
const getMcUrlLink = _ref => {
|
|
527
|
+
var _context, _context2, _context3;
|
|
518
528
|
let mcApiUrl = _ref.mcApiUrl,
|
|
519
529
|
organizationId = _ref.organizationId,
|
|
520
530
|
customEntityId = _ref.customEntityId,
|
|
521
531
|
isCustomView = _ref.isCustomView;
|
|
522
532
|
const mcUrl = mcApiUrl.replace('mc-api', 'mc');
|
|
523
|
-
const customEntityLink =
|
|
533
|
+
const customEntityLink = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "".concat(mcUrl, "/account/organizations/")).call(_context3, organizationId, "/custom-")).call(_context2, isCustomView ? 'views' : 'applications', "/owned/")).call(_context, customEntityId);
|
|
524
534
|
return customEntityLink;
|
|
525
535
|
};
|
|
526
536
|
const isCustomViewData = data => data.entryPointUriPath === undefined;
|
|
527
537
|
async function createOrUpdateCustomApplication(_ref2) {
|
|
528
|
-
var
|
|
538
|
+
var _context6;
|
|
529
539
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
530
540
|
localCustomEntityData = _ref2.localCustomEntityData,
|
|
531
541
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
@@ -536,14 +546,14 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
536
546
|
applicationIdentifier
|
|
537
547
|
});
|
|
538
548
|
if (!fetchedCustomApplication) {
|
|
539
|
-
var
|
|
549
|
+
var _context5;
|
|
540
550
|
const userOrganizations = await fetchUserOrganizations({
|
|
541
551
|
mcApiUrl,
|
|
542
552
|
applicationIdentifier
|
|
543
553
|
});
|
|
544
554
|
let organizationId, organizationName;
|
|
545
555
|
if (userOrganizations.total === 0) {
|
|
546
|
-
throw new Error(
|
|
556
|
+
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.");
|
|
547
557
|
}
|
|
548
558
|
if (userOrganizations.total === 1) {
|
|
549
559
|
const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
|
|
@@ -551,8 +561,8 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
551
561
|
organizationId = organization.id;
|
|
552
562
|
organizationName = organization.name;
|
|
553
563
|
} else {
|
|
554
|
-
var
|
|
555
|
-
const organizationChoices = _mapInstanceProperty(
|
|
564
|
+
var _context4;
|
|
565
|
+
const organizationChoices = _mapInstanceProperty(_context4 = userOrganizations.results).call(_context4, organization => ({
|
|
556
566
|
title: organization.name,
|
|
557
567
|
value: organization.id
|
|
558
568
|
}));
|
|
@@ -565,7 +575,7 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
565
575
|
}),
|
|
566
576
|
selectedOrganizationId = _await$prompts.organizationId;
|
|
567
577
|
if (!selectedOrganizationId) {
|
|
568
|
-
throw new Error(
|
|
578
|
+
throw new Error("No Organization selected, aborting.");
|
|
569
579
|
}
|
|
570
580
|
organizationId = selectedOrganizationId;
|
|
571
581
|
organizationName = _findInstanceProperty(organizationChoices).call(organizationChoices, _ref3 => {
|
|
@@ -576,7 +586,7 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
576
586
|
const _await$prompts2 = await prompts({
|
|
577
587
|
type: 'text',
|
|
578
588
|
name: 'confirmation',
|
|
579
|
-
message: _filterInstanceProperty(
|
|
589
|
+
message: _filterInstanceProperty(_context5 = ["You are about to create a new Custom Application in the \"".concat(chalk.green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be created.')]).call(_context5, Boolean).join('\n'),
|
|
580
590
|
initial: 'yes'
|
|
581
591
|
}),
|
|
582
592
|
confirmation = _await$prompts2.confirmation;
|
|
@@ -587,7 +597,7 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
587
597
|
const data = omit(localCustomEntityData, ['id']);
|
|
588
598
|
if (options.dryRun) {
|
|
589
599
|
console.log();
|
|
590
|
-
console.log(
|
|
600
|
+
console.log("The following payload would be used to create a new Custom Application.");
|
|
591
601
|
console.log();
|
|
592
602
|
console.log(chalk.gray(_JSON$stringify(data, null, 2)));
|
|
593
603
|
return;
|
|
@@ -611,8 +621,8 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
611
621
|
organizationId,
|
|
612
622
|
customEntityId: createdCustomApplication.id
|
|
613
623
|
});
|
|
614
|
-
console.log(chalk.green(
|
|
615
|
-
console.log(
|
|
624
|
+
console.log(chalk.green("Custom Application created.\nPlease update the \"env.production.applicationId\" field in your local Custom Application config file with the following value: \"".concat(chalk.green(createdCustomApplication.id), "\".")));
|
|
625
|
+
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk.gray(customAppLink), "\"."));
|
|
616
626
|
return;
|
|
617
627
|
}
|
|
618
628
|
const customAppLink = getMcUrlLink({
|
|
@@ -622,8 +632,8 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
622
632
|
});
|
|
623
633
|
const configDiff = getCustomApplicationConfigDiff(fetchedCustomApplication.application, localCustomEntityData);
|
|
624
634
|
if (!configDiff) {
|
|
625
|
-
console.log(chalk.green(
|
|
626
|
-
console.log(
|
|
635
|
+
console.log(chalk.green("Custom Application up-to-date."));
|
|
636
|
+
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk.gray(customAppLink), "\"."));
|
|
627
637
|
return;
|
|
628
638
|
}
|
|
629
639
|
console.log('Changes detected:');
|
|
@@ -632,7 +642,7 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
632
642
|
const _await$prompts3 = await prompts({
|
|
633
643
|
type: 'text',
|
|
634
644
|
name: 'confirmation',
|
|
635
|
-
message: _filterInstanceProperty(
|
|
645
|
+
message: _filterInstanceProperty(_context6 = ["You are about to update the Custom Application \"".concat(chalk.green(localCustomEntityData.entryPointUriPath), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be updated.')]).call(_context6, Boolean).join('\n'),
|
|
636
646
|
initial: 'yes'
|
|
637
647
|
}),
|
|
638
648
|
confirmation = _await$prompts3.confirmation;
|
|
@@ -643,7 +653,7 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
643
653
|
const data = omit(localCustomEntityData, ['id']);
|
|
644
654
|
if (options.dryRun) {
|
|
645
655
|
console.log();
|
|
646
|
-
console.log(
|
|
656
|
+
console.log("The following payload would be used to update the Custom Application \"".concat(chalk.green(data.entryPointUriPath), "\"."));
|
|
647
657
|
console.log();
|
|
648
658
|
console.log(chalk.gray(_JSON$stringify(data, null, 2)));
|
|
649
659
|
return;
|
|
@@ -655,11 +665,11 @@ async function createOrUpdateCustomApplication(_ref2) {
|
|
|
655
665
|
applicationId: fetchedCustomApplication.application.id,
|
|
656
666
|
applicationIdentifier
|
|
657
667
|
});
|
|
658
|
-
console.log(chalk.green(
|
|
659
|
-
console.log(
|
|
668
|
+
console.log(chalk.green("Custom Application updated."));
|
|
669
|
+
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk.gray(customAppLink), "\"."));
|
|
660
670
|
}
|
|
661
671
|
async function createOrUpdateCustomView(_ref4) {
|
|
662
|
-
var
|
|
672
|
+
var _fetchedCustomView$cu, _context9, _fetchedCustomView$cu2;
|
|
663
673
|
let mcApiUrl = _ref4.mcApiUrl,
|
|
664
674
|
localCustomEntityData = _ref4.localCustomEntityData,
|
|
665
675
|
customViewId = _ref4.customViewId,
|
|
@@ -671,7 +681,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
671
681
|
applicationIdentifier
|
|
672
682
|
});
|
|
673
683
|
if (!fetchedCustomView) {
|
|
674
|
-
var
|
|
684
|
+
var _context8;
|
|
675
685
|
const userOrganizations = await fetchUserOrganizations({
|
|
676
686
|
mcApiUrl,
|
|
677
687
|
customViewId,
|
|
@@ -679,7 +689,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
679
689
|
});
|
|
680
690
|
let organizationId, organizationName;
|
|
681
691
|
if (userOrganizations.total === 0) {
|
|
682
|
-
throw new Error(
|
|
692
|
+
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.");
|
|
683
693
|
}
|
|
684
694
|
if (userOrganizations.total === 1) {
|
|
685
695
|
const _userOrganizations$re2 = _slicedToArray(userOrganizations.results, 1),
|
|
@@ -687,8 +697,8 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
687
697
|
organizationId = organization.id;
|
|
688
698
|
organizationName = organization.name;
|
|
689
699
|
} else {
|
|
690
|
-
var
|
|
691
|
-
const organizationChoices = _mapInstanceProperty(
|
|
700
|
+
var _context7;
|
|
701
|
+
const organizationChoices = _mapInstanceProperty(_context7 = userOrganizations.results).call(_context7, organization => ({
|
|
692
702
|
title: organization.name,
|
|
693
703
|
value: organization.id
|
|
694
704
|
}));
|
|
@@ -701,7 +711,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
701
711
|
}),
|
|
702
712
|
selectedOrganizationId = _await$prompts4.organizationId;
|
|
703
713
|
if (!selectedOrganizationId) {
|
|
704
|
-
throw new Error(
|
|
714
|
+
throw new Error("No Organization selected, aborting.");
|
|
705
715
|
}
|
|
706
716
|
organizationId = selectedOrganizationId;
|
|
707
717
|
organizationName = _findInstanceProperty(organizationChoices).call(organizationChoices, _ref5 => {
|
|
@@ -712,7 +722,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
712
722
|
const _await$prompts5 = await prompts({
|
|
713
723
|
type: 'text',
|
|
714
724
|
name: 'confirmation',
|
|
715
|
-
message: _filterInstanceProperty(
|
|
725
|
+
message: _filterInstanceProperty(_context8 = ["You are about to create a new Custom View in the \"".concat(chalk.green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be created.')]).call(_context8, Boolean).join('\n'),
|
|
716
726
|
initial: 'yes'
|
|
717
727
|
}),
|
|
718
728
|
confirmation = _await$prompts5.confirmation;
|
|
@@ -723,7 +733,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
723
733
|
const data = omit(localCustomEntityData, ['id']);
|
|
724
734
|
if (options.dryRun) {
|
|
725
735
|
console.log();
|
|
726
|
-
console.log(
|
|
736
|
+
console.log("The following payload would be used to create a new Custom View.");
|
|
727
737
|
console.log();
|
|
728
738
|
console.log(chalk.gray(_JSON$stringify(data, null, 2)));
|
|
729
739
|
return;
|
|
@@ -748,20 +758,20 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
748
758
|
customEntityId: createdCustomView.id,
|
|
749
759
|
isCustomView: true
|
|
750
760
|
});
|
|
751
|
-
console.log(chalk.green(
|
|
752
|
-
console.log(
|
|
761
|
+
console.log(chalk.green("Custom View created.\nPlease update the \"env.production.customViewId\" field in your local Custom View config file with the following value: \"".concat(chalk.green(createdCustomView.id), "\".")));
|
|
762
|
+
console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk.gray(customViewLink), "\"."));
|
|
753
763
|
return;
|
|
754
764
|
}
|
|
755
765
|
const customViewLink = getMcUrlLink({
|
|
756
766
|
mcApiUrl,
|
|
757
767
|
organizationId: fetchedCustomView.organizationId,
|
|
758
|
-
customEntityId: fetchedCustomView
|
|
768
|
+
customEntityId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu = fetchedCustomView.customView) === null || _fetchedCustomView$cu === void 0 ? void 0 : _fetchedCustomView$cu.id) || '',
|
|
759
769
|
isCustomView: true
|
|
760
770
|
});
|
|
761
771
|
const configDiff = getCustomViewConfigDiff(fetchedCustomView.customView, localCustomEntityData);
|
|
762
772
|
if (!configDiff) {
|
|
763
|
-
console.log(chalk.green(
|
|
764
|
-
console.log(
|
|
773
|
+
console.log(chalk.green("Custom View up-to-date."));
|
|
774
|
+
console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk.gray(customViewLink), "\"."));
|
|
765
775
|
return;
|
|
766
776
|
}
|
|
767
777
|
console.log('Changes detected:');
|
|
@@ -770,7 +780,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
770
780
|
const _await$prompts6 = await prompts({
|
|
771
781
|
type: 'text',
|
|
772
782
|
name: 'confirmation',
|
|
773
|
-
message: _filterInstanceProperty(
|
|
783
|
+
message: _filterInstanceProperty(_context9 = ["You are about to update the Custom View \"".concat(chalk.green(localCustomEntityData.defaultLabel), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be updated.')]).call(_context9, Boolean).join('\n'),
|
|
774
784
|
initial: 'yes'
|
|
775
785
|
}),
|
|
776
786
|
confirmation = _await$prompts6.confirmation;
|
|
@@ -781,7 +791,7 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
781
791
|
const data = omit(localCustomEntityData, ['id']);
|
|
782
792
|
if (options.dryRun) {
|
|
783
793
|
console.log();
|
|
784
|
-
console.log(
|
|
794
|
+
console.log("The following payload would be used to update the Custom View \"".concat(chalk.green(data.defaultLabel), "\"."));
|
|
785
795
|
console.log();
|
|
786
796
|
console.log(chalk.gray(_JSON$stringify(data, null, 2)));
|
|
787
797
|
return;
|
|
@@ -790,11 +800,11 @@ async function createOrUpdateCustomView(_ref4) {
|
|
|
790
800
|
mcApiUrl,
|
|
791
801
|
organizationId: fetchedCustomView.organizationId,
|
|
792
802
|
data: omit(localCustomEntityData, ['id']),
|
|
793
|
-
customViewId: fetchedCustomView
|
|
803
|
+
customViewId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu2 = fetchedCustomView.customView) === null || _fetchedCustomView$cu2 === void 0 ? void 0 : _fetchedCustomView$cu2.id) || '',
|
|
794
804
|
applicationIdentifier
|
|
795
805
|
});
|
|
796
|
-
console.log(chalk.green(
|
|
797
|
-
console.log(
|
|
806
|
+
console.log(chalk.green("Custom View updated."));
|
|
807
|
+
console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk.gray(customViewLink), "\"."));
|
|
798
808
|
}
|
|
799
809
|
async function run(options) {
|
|
800
810
|
const applicationConfig = await processConfig();
|
|
@@ -803,11 +813,11 @@ async function run(options) {
|
|
|
803
813
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
804
814
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
805
815
|
customViewId = _applicationConfig$en.customViewId;
|
|
806
|
-
console.log(
|
|
816
|
+
console.log("Using Merchant Center environment \"".concat(chalk.green(mcApiUrl), "\"."));
|
|
807
817
|
console.log();
|
|
808
818
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
809
819
|
if (!isSessionValid) {
|
|
810
|
-
throw new Error(
|
|
820
|
+
throw new Error("You don't have a valid session. Please, run the \"mc-scripts login\" command to authenticate yourself.");
|
|
811
821
|
}
|
|
812
822
|
if (isCustomViewData(localCustomEntityData)) {
|
|
813
823
|
createOrUpdateCustomView({
|