@commercetools-frontend/mc-scripts 27.5.3 → 27.5.4
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/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +39 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +39 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +11 -11
- package/dist/{build-BP3m-wjz.cjs.prod.js → build-8b26f739.cjs.prod.js} +23 -23
- package/dist/{build-GEMI3W9m.esm.js → build-928b2a79.esm.js} +7 -7
- package/dist/{build-Dq8dqtsd.cjs.dev.js → build-bace1d99.cjs.dev.js} +23 -23
- package/dist/{build-vite-D67xSRU1.cjs.prod.js → build-vite-73361390.cjs.prod.js} +32 -32
- package/dist/{build-vite-Dxi3rfHf.cjs.dev.js → build-vite-8453739c.cjs.dev.js} +32 -32
- package/dist/{build-vite-CO8mi4hd.esm.js → build-vite-a9c1c374.esm.js} +5 -5
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +4 -2
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +4 -2
- package/dist/commercetools-frontend-mc-scripts.esm.js +2 -2
- package/dist/{compile-html-BVvy3IQD.esm.js → compile-html-025cd493.esm.js} +2 -2
- package/dist/{compile-html-Ds1YojsY.cjs.dev.js → compile-html-50fd05ec.cjs.prod.js} +8 -8
- package/dist/{compile-html-DZlUpFXg.cjs.prod.js → compile-html-f4ac88cc.cjs.dev.js} +8 -8
- package/dist/{config-sync-Cd0sSSrd.cjs.dev.js → config-sync-0a342fb2.cjs.dev.js} +22 -22
- package/dist/{config-sync-D6xLjo9S.cjs.prod.js → config-sync-5b76d50d.cjs.prod.js} +22 -22
- package/dist/{config-sync-Bu7U5gn5.esm.js → config-sync-9ca31a0c.esm.js} +5 -5
- package/dist/{config-sync-ci-Dq7bAqeu.esm.js → config-sync-ci-00065fb7.esm.js} +5 -5
- package/dist/{config-sync-ci-CXgQcemF.cjs.prod.js → config-sync-ci-2dece618.cjs.prod.js} +21 -21
- package/dist/{config-sync-ci-SDsF-Onw.cjs.dev.js → config-sync-ci-8e0e8248.cjs.dev.js} +21 -21
- package/dist/{config-sync-helpers-BLXJp1-D.esm.js → config-sync-helpers-025e7cd1.esm.js} +3 -3
- package/dist/{config-sync-helpers-9kvPwuoy.cjs.prod.js → config-sync-helpers-559dc1bc.cjs.prod.js} +47 -47
- package/dist/{config-sync-helpers-DUK45F_R.cjs.dev.js → config-sync-helpers-de27060d.cjs.dev.js} +47 -47
- package/dist/{create-postcss-config-NN2FAhvH.cjs.dev.js → create-postcss-config-2c000f4a.cjs.dev.js} +3 -3
- package/dist/{create-postcss-config-DAShdAyB.cjs.prod.js → create-postcss-config-6e9892cd.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-CN9_8Usa.esm.js → create-postcss-config-a90f367b.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-CxGehl7I.cjs.prod.js → create-webpack-config-for-development-04c00f96.cjs.prod.js} +25 -25
- package/dist/{create-webpack-config-for-development-hxSNyq2_.cjs.dev.js → create-webpack-config-for-development-ad46a460.cjs.dev.js} +25 -25
- package/dist/{create-webpack-config-for-development-5HpRHV9G.esm.js → create-webpack-config-for-development-ef7241f4.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-CW0DlZBz.cjs.prod.js → create-webpack-config-for-production-4ca9c3ab.cjs.prod.js} +32 -32
- package/dist/{create-webpack-config-for-production-Edp9dzmw.cjs.dev.js → create-webpack-config-for-production-98fab7bd.cjs.dev.js} +32 -32
- package/dist/{create-webpack-config-for-production-BY0UNoNz.esm.js → create-webpack-config-for-production-f2acb70a.esm.js} +5 -5
- package/dist/{credentials-storage-B79bb0Ns.esm.js → credentials-storage-67deadc3.esm.js} +1 -1
- package/dist/{credentials-storage-C3TlK0a8.cjs.prod.js → credentials-storage-ea1c16dc.cjs.prod.js} +10 -10
- package/dist/{credentials-storage-B0tDCH7i.cjs.dev.js → credentials-storage-fd195144.cjs.dev.js} +10 -10
- package/dist/{deployment-previews-set-C2OPIfy-.esm.js → deployment-previews-set-2e214cad.esm.js} +4 -4
- package/dist/{deployment-previews-set-BuHX8wKo.cjs.dev.js → deployment-previews-set-6be4f485.cjs.dev.js} +22 -22
- package/dist/{deployment-previews-set-nvkAPwYw.cjs.prod.js → deployment-previews-set-f3b39e78.cjs.prod.js} +22 -22
- package/dist/{does-file-exist-DrcZIPe6.cjs.dev.js → does-file-exist-be53305d.cjs.prod.js} +2 -2
- package/dist/{does-file-exist-DrcZIPe6.cjs.prod.js → does-file-exist-eb86baca.cjs.dev.js} +2 -2
- package/dist/{graphql-requests-D0rtMo7K.cjs.prod.js → graphql-requests-0b5eaa25.cjs.prod.js} +9 -9
- package/dist/{graphql-requests-DCLX_2y0.esm.js → graphql-requests-16093ecf.esm.js} +4 -4
- package/dist/{graphql-requests-BeUd4g3v.cjs.dev.js → graphql-requests-70911fc7.cjs.dev.js} +9 -9
- package/dist/{i18n-message-complilation-CdVhuyWk.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +3 -3
- package/dist/{i18n-message-complilation-CdVhuyWk.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +3 -3
- package/dist/{login-DZVfG3Jq.esm.js → login-1380c820.esm.js} +3 -3
- package/dist/{login-DKzmRa46.cjs.dev.js → login-70150e58.cjs.prod.js} +60 -42
- package/dist/{login-BagHOLO1.cjs.prod.js → login-78c2e9f1.cjs.dev.js} +60 -42
- package/dist/{optimizations-Cjrg77Gu.esm.js → optimizations-54382f7b.esm.js} +1 -1
- package/dist/{optimizations-CEaq4axa.cjs.dev.js → optimizations-56be74d6.cjs.dev.js} +8 -8
- package/dist/{optimizations-CEaq4axa.cjs.prod.js → optimizations-da5a0cfa.cjs.prod.js} +8 -8
- package/dist/package-2a1686e0.cjs.dev.js +167 -0
- package/dist/package-88ff3f97.cjs.prod.js +167 -0
- package/dist/package-f3268967.esm.js +165 -0
- package/dist/{paths-Cg5Vq6RE.esm.js → paths-39f22b8b.esm.js} +1 -1
- package/dist/{paths-DtvtCG0U.cjs.prod.js → paths-7768b440.cjs.prod.js} +5 -5
- package/dist/{paths-B0WM5jb9.cjs.dev.js → paths-b76fc753.cjs.dev.js} +5 -5
- package/dist/{serve-fXDv4-Pm.esm.js → serve-22475fec.esm.js} +2 -2
- package/dist/{serve-BxRJOSeR.cjs.dev.js → serve-3837602d.cjs.prod.js} +13 -13
- package/dist/{serve-BwNRk6vi.cjs.prod.js → serve-b1c12985.cjs.dev.js} +13 -13
- package/dist/{start-suUcoYml.esm.js → start-3e667920.esm.js} +7 -7
- package/dist/{start-OjGog63p.cjs.dev.js → start-79dcb1ca.cjs.dev.js} +17 -17
- package/dist/{start-CQgQhNhU.cjs.prod.js → start-e8e107a8.cjs.prod.js} +17 -17
- package/dist/{start-vite-CeaoWKrT.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +14 -14
- package/dist/{start-vite-Bf9UIg63.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +14 -14
- package/dist/{start-vite-BOrX5xsW.esm.js → start-vite-7d1161e8.esm.js} +3 -3
- package/dist/{vite-plugin-svgr-CRRIY_Py.cjs.prod.js → vite-plugin-svgr-4034a834.cjs.prod.js} +24 -6
- package/dist/{vite-plugin-svgr-CRRIY_Py.cjs.dev.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +24 -6
- package/package.json +8 -8
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +4 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +4 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +10 -8
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +10 -8
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +8 -8
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
- package/dist/package-B1Y3_DDl.cjs.dev.js +0 -17
- package/dist/package-BiK3ergJ.esm.js +0 -15
- package/dist/package-DxhqRLHb.cjs.prod.js +0 -12
- /package/dist/{does-file-exist-C7l6j7NP.esm.js → does-file-exist-32618334.esm.js} +0 -0
- /package/dist/{i18n-message-complilation-BRZ7ffQI.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +0 -0
- /package/dist/{vendors-to-transpile-DLHlk7c-.cjs.dev.js → vendors-to-transpile-04a49d40.cjs.prod.js} +0 -0
- /package/dist/{vendors-to-transpile-DLHlk7c-.cjs.prod.js → vendors-to-transpile-6ab4ea06.cjs.dev.js} +0 -0
- /package/dist/{vendors-to-transpile-uu9TNPDO.esm.js → vendors-to-transpile-7dc84a72.esm.js} +0 -0
- /package/dist/{vite-plugin-svgr-B1JerYlQ.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +0 -0
|
@@ -5,12 +5,12 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
7
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
8
|
-
var configSyncHelpers = require('./config-sync-helpers-
|
|
9
|
-
var graphqlRequests = require('./graphql-requests-
|
|
8
|
+
var configSyncHelpers = require('./config-sync-helpers-de27060d.cjs.dev.js');
|
|
9
|
+
var graphqlRequests = require('./graphql-requests-70911fc7.cjs.dev.js');
|
|
10
10
|
var _Date$now = require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
11
11
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
12
12
|
var jwtDecode = require('jwt-decode');
|
|
13
|
-
var credentialsStorage = require('./credentials-storage-
|
|
13
|
+
var credentialsStorage = require('./credentials-storage-fd195144.cjs.dev.js');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
15
15
|
require('lodash/omit');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -31,15 +31,15 @@ require('graphql');
|
|
|
31
31
|
require('graphql-request');
|
|
32
32
|
require('@commercetools-frontend/constants');
|
|
33
33
|
require('@commercetools/http-user-agent');
|
|
34
|
-
require('./package-
|
|
34
|
+
require('./package-2a1686e0.cjs.dev.js');
|
|
35
35
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
36
36
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
37
37
|
require('node:fs');
|
|
38
38
|
require('node:os');
|
|
39
39
|
require('node:path');
|
|
40
|
-
require('./does-file-exist-
|
|
40
|
+
require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
41
41
|
|
|
42
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
43
43
|
|
|
44
44
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
45
45
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -68,8 +68,8 @@ async function authenticateForCI(_ref) {
|
|
|
68
68
|
const envToken = process.env[ENV_VARS$1.TOKEN];
|
|
69
69
|
if (envToken) {
|
|
70
70
|
try {
|
|
71
|
-
const decodedToken = jwtDecode__default
|
|
72
|
-
const now = Math.floor(_Date$now__default
|
|
71
|
+
const decodedToken = jwtDecode__default["default"](envToken);
|
|
72
|
+
const now = Math.floor(_Date$now__default["default"]() / 1000);
|
|
73
73
|
if (decodedToken.exp <= now) {
|
|
74
74
|
throw new Error('The provided MC_ACCESS_TOKEN has expired');
|
|
75
75
|
}
|
|
@@ -84,7 +84,7 @@ async function authenticateForCI(_ref) {
|
|
|
84
84
|
};
|
|
85
85
|
} catch (error) {
|
|
86
86
|
var _context;
|
|
87
|
-
if (error instanceof Error && _includesInstanceProperty__default
|
|
87
|
+
if (error instanceof Error && _includesInstanceProperty__default["default"](_context = error.message).call(_context, 'expired')) {
|
|
88
88
|
throw error;
|
|
89
89
|
}
|
|
90
90
|
throw new Error('The provided MC_ACCESS_TOKEN is invalid');
|
|
@@ -95,7 +95,7 @@ async function authenticateForCI(_ref) {
|
|
|
95
95
|
if (credentialsStorage$1.isSessionValid(mcApiUrl)) {
|
|
96
96
|
const token = credentialsStorage$1.getToken(mcApiUrl);
|
|
97
97
|
if (token) {
|
|
98
|
-
const decodedToken = jwtDecode__default
|
|
98
|
+
const decodedToken = jwtDecode__default["default"](token);
|
|
99
99
|
return {
|
|
100
100
|
token,
|
|
101
101
|
expiresAt: decodedToken.exp
|
|
@@ -131,7 +131,7 @@ async function resolveOrganization(_ref) {
|
|
|
131
131
|
const organizationName = process.env[ENV_VARS.ORGANIZATION_NAME];
|
|
132
132
|
if (organizationId) {
|
|
133
133
|
var _context;
|
|
134
|
-
const matchingOrg = _findInstanceProperty__default
|
|
134
|
+
const matchingOrg = _findInstanceProperty__default["default"](_context = userOrganizations.results).call(_context, org => org.id === organizationId);
|
|
135
135
|
if (!matchingOrg) {
|
|
136
136
|
throw new Error(`Organization with ID "${organizationId}" (from ${ENV_VARS.ORGANIZATION_ID}) not found or you don't have admin access to it.`);
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ async function resolveOrganization(_ref) {
|
|
|
142
142
|
}
|
|
143
143
|
if (organizationName) {
|
|
144
144
|
var _context2;
|
|
145
|
-
const matchingOrg = _findInstanceProperty__default
|
|
145
|
+
const matchingOrg = _findInstanceProperty__default["default"](_context2 = userOrganizations.results).call(_context2, org => org.name === organizationName);
|
|
146
146
|
if (!matchingOrg) {
|
|
147
147
|
throw new Error(`Organization with name "${organizationName}" (from ${ENV_VARS.ORGANIZATION_NAME}) not found or you don't have admin access to it.`);
|
|
148
148
|
}
|
|
@@ -156,7 +156,7 @@ async function resolveOrganization(_ref) {
|
|
|
156
156
|
if (userOrganizations.total === 1) {
|
|
157
157
|
const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
|
|
158
158
|
organization = _userOrganizations$re[0];
|
|
159
|
-
console.log(`Using organization "${chalk__default
|
|
159
|
+
console.log(`Using organization "${chalk__default["default"].green(organization.name)}" (only one available).`);
|
|
160
160
|
return {
|
|
161
161
|
id: organization.id,
|
|
162
162
|
name: organization.name
|
|
@@ -164,7 +164,7 @@ async function resolveOrganization(_ref) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// Multiple organizations and none specified - error in CI mode
|
|
167
|
-
const orgNames = _mapInstanceProperty__default
|
|
167
|
+
const orgNames = _mapInstanceProperty__default["default"](_context3 = userOrganizations.results).call(_context3, org => ` - "${org.name}" (ID: ${org.id})`).join('\n');
|
|
168
168
|
throw new Error(`Multiple organizations found. Please specify one using ${ENV_VARS.ORGANIZATION_ID} or ${ENV_VARS.ORGANIZATION_NAME} environment variable:\n${orgNames}`);
|
|
169
169
|
}
|
|
170
170
|
async function handleCustomApplication(_ref2) {
|
|
@@ -197,8 +197,8 @@ async function handleCustomApplication(_ref2) {
|
|
|
197
197
|
|
|
198
198
|
// Check for changes
|
|
199
199
|
if (!status.configDiff) {
|
|
200
|
-
console.log(chalk__default
|
|
201
|
-
console.log(`URL: ${chalk__default
|
|
200
|
+
console.log(chalk__default["default"].green('Custom Application is up-to-date.'));
|
|
201
|
+
console.log(`URL: ${chalk__default["default"].gray(status.link)}`);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
console.log('Changes detected:');
|
|
@@ -245,8 +245,8 @@ async function handleCustomView(_ref3) {
|
|
|
245
245
|
|
|
246
246
|
// Check for changes
|
|
247
247
|
if (!status.configDiff) {
|
|
248
|
-
console.log(chalk__default
|
|
249
|
-
console.log(`URL: ${chalk__default
|
|
248
|
+
console.log(chalk__default["default"].green('Custom View is up-to-date.'));
|
|
249
|
+
console.log(`URL: ${chalk__default["default"].gray(status.link)}`);
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
console.log('Changes detected:');
|
|
@@ -268,7 +268,7 @@ async function run(options) {
|
|
|
268
268
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
269
269
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
270
270
|
customViewId = _applicationConfig$en.customViewId;
|
|
271
|
-
console.log(`Environment: ${chalk__default
|
|
271
|
+
console.log(`Environment: ${chalk__default["default"].green(mcApiUrl)}`);
|
|
272
272
|
|
|
273
273
|
// Authenticate for CI
|
|
274
274
|
console.log('Authenticating...');
|
|
@@ -276,7 +276,7 @@ async function run(options) {
|
|
|
276
276
|
await authenticateForCI({
|
|
277
277
|
mcApiUrl
|
|
278
278
|
});
|
|
279
|
-
console.log(chalk__default
|
|
279
|
+
console.log(chalk__default["default"].green('Authentication successful.'));
|
|
280
280
|
} catch (error) {
|
|
281
281
|
if (error instanceof Error) {
|
|
282
282
|
throw new Error(`Authentication failed: ${error.message}`);
|
|
@@ -302,4 +302,4 @@ async function run(options) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
exports
|
|
305
|
+
exports["default"] = run;
|
|
@@ -16,10 +16,10 @@ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
16
16
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
17
17
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
18
18
|
import { sanitizeSvg } from '@commercetools-frontend/application-config';
|
|
19
|
-
import {
|
|
19
|
+
import { c as createCustomApplication, u as updateCustomApplication, a as createCustomView, b as updateCustomView, d as fetchCustomApplication, e as fetchCustomView } from './graphql-requests-16093ecf.esm.js';
|
|
20
20
|
|
|
21
21
|
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; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(t),
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context0 = ownKeys(Object(t))).call(_context0, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
23
|
|
|
24
24
|
// Since not all terminal supports colors, to make things more consistent for testing purposes,
|
|
25
25
|
// during tests the color used is appended before the string instead of coloring it.
|
|
@@ -700,4 +700,4 @@ async function checkCustomViewStatus(_ref7) {
|
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
-
export {
|
|
703
|
+
export { performUpdateCustomApplication as a, checkCustomViewStatus as b, checkCustomApplicationStatus as c, performCreateCustomView as d, performUpdateCustomView as e, isCustomViewData as i, performCreateCustomApplication as p };
|
package/dist/{config-sync-helpers-9kvPwuoy.cjs.prod.js → config-sync-helpers-559dc1bc.cjs.prod.js}
RENAMED
|
@@ -18,9 +18,9 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
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-0b5eaa25.cjs.prod.js');
|
|
22
22
|
|
|
23
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
24
24
|
|
|
25
25
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
26
26
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
@@ -39,19 +39,19 @@ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInsta
|
|
|
39
39
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
40
40
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
41
41
|
|
|
42
|
-
function ownKeys(e, r) { var t = _Object$keys__default
|
|
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
|
|
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 _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context0 = ownKeys(Object(t))).call(_context0, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
44
44
|
const red = str => {
|
|
45
|
-
return chalk__default
|
|
45
|
+
return chalk__default["default"].red(str);
|
|
46
46
|
};
|
|
47
47
|
const green = str => {
|
|
48
|
-
return chalk__default
|
|
48
|
+
return chalk__default["default"].green(str);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// Two spaces are used for indentation.
|
|
52
52
|
const indent = indentLevel => {
|
|
53
53
|
var _context;
|
|
54
|
-
return _repeatInstanceProperty__default
|
|
54
|
+
return _repeatInstanceProperty__default["default"](_context = ' ').call(_context, indentLevel);
|
|
55
55
|
};
|
|
56
56
|
const getStringDiff = _ref => {
|
|
57
57
|
let previousValue = _ref.previousValue,
|
|
@@ -78,9 +78,9 @@ const getArrayDiff = _ref2 => {
|
|
|
78
78
|
label = _ref2.label,
|
|
79
79
|
_ref2$indentLevel = _ref2.indentLevel,
|
|
80
80
|
indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
|
|
81
|
-
const oldArraySet = new _Set__default
|
|
81
|
+
const oldArraySet = new _Set__default["default"](previousValue);
|
|
82
82
|
const arrayDiff = [];
|
|
83
|
-
((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty__default
|
|
83
|
+
((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty__default["default"](_context3 = Function.call).call(_context3, _forEachInstanceProperty__default["default"](_context2), _context2))?.(item => {
|
|
84
84
|
if (oldArraySet.has(item)) {
|
|
85
85
|
oldArraySet.delete(item);
|
|
86
86
|
} else {
|
|
@@ -91,7 +91,7 @@ const getArrayDiff = _ref2 => {
|
|
|
91
91
|
}));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
_forEachInstanceProperty__default
|
|
94
|
+
_forEachInstanceProperty__default["default"](oldArraySet).call(oldArraySet, item => {
|
|
95
95
|
arrayDiff.push(getStringDiff({
|
|
96
96
|
previousValue: item,
|
|
97
97
|
label,
|
|
@@ -105,7 +105,7 @@ const getPermissionsDiff = _ref3 => {
|
|
|
105
105
|
let previousValue = _ref3.previousValue,
|
|
106
106
|
nextValue = _ref3.nextValue;
|
|
107
107
|
const permissionDiff = ['permissions changed'];
|
|
108
|
-
const mappedOldPermissions = _reduceInstanceProperty__default
|
|
108
|
+
const mappedOldPermissions = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousPermission, _ref4) => {
|
|
109
109
|
let name = _ref4.name,
|
|
110
110
|
oAuthScopes = _ref4.oAuthScopes;
|
|
111
111
|
return _objectSpread(_objectSpread({}, previousPermission), {}, {
|
|
@@ -113,7 +113,7 @@ const getPermissionsDiff = _ref3 => {
|
|
|
113
113
|
});
|
|
114
114
|
}, {});
|
|
115
115
|
const indentLevel = 1;
|
|
116
|
-
_forEachInstanceProperty__default
|
|
116
|
+
_forEachInstanceProperty__default["default"](nextValue).call(nextValue, newPermission => {
|
|
117
117
|
const currentDiff = [`${indent(indentLevel)}"${newPermission.name}" changed`];
|
|
118
118
|
// if the permission name is not in the old config, it means it is a new addition.
|
|
119
119
|
if (!mappedOldPermissions[newPermission.name]) {
|
|
@@ -130,11 +130,11 @@ const getPermissionsDiff = _ref3 => {
|
|
|
130
130
|
}));
|
|
131
131
|
delete mappedOldPermissions[newPermission.name];
|
|
132
132
|
}
|
|
133
|
-
_filterInstanceProperty__default
|
|
133
|
+
_filterInstanceProperty__default["default"](currentDiff).call(currentDiff, Boolean).length > 1 && permissionDiff.push(currentDiff.join('\n'));
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
// if there are old permissions left, it means they were deleted in the new Permissions.
|
|
137
|
-
_forEachInstanceProperty__default
|
|
137
|
+
_forEachInstanceProperty__default["default"](_context4 = _Object$keys__default["default"](mappedOldPermissions)).call(_context4, oldPermissionName => {
|
|
138
138
|
permissionDiff.push(`${indent(indentLevel)}"${red(oldPermissionName)}" was removed`);
|
|
139
139
|
});
|
|
140
140
|
if (permissionDiff.length > 1) return permissionDiff.join('\n');
|
|
@@ -149,14 +149,14 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
149
149
|
_ref5$indentLevel = _ref5.indentLevel,
|
|
150
150
|
indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
|
|
151
151
|
const labelAllLocalesDiff = [`${indent(indentLevel - 1)}labelAllLocales changed`];
|
|
152
|
-
const mappedOldLabelAllLocales = _reduceInstanceProperty__default
|
|
152
|
+
const mappedOldLabelAllLocales = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
|
|
153
153
|
let locale = _ref6.locale,
|
|
154
154
|
value = _ref6.value;
|
|
155
155
|
return _objectSpread(_objectSpread({}, previousLabelAllLocale), {}, {
|
|
156
156
|
[locale]: value
|
|
157
157
|
});
|
|
158
158
|
}, {});
|
|
159
|
-
_forEachInstanceProperty__default
|
|
159
|
+
_forEachInstanceProperty__default["default"](nextValue).call(nextValue, newLabelAllLocale => {
|
|
160
160
|
if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
|
|
161
161
|
const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
|
|
162
162
|
if (oldLocaleValue !== newLabelAllLocale.value) {
|
|
@@ -174,7 +174,7 @@ const getLabelAllLocalesDiff = _ref5 => {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
|
-
_forEachInstanceProperty__default
|
|
177
|
+
_forEachInstanceProperty__default["default"](_context5 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context5, key => {
|
|
178
178
|
const localeDiff = getStringDiff({
|
|
179
179
|
previousValue: key,
|
|
180
180
|
label: 'locale',
|
|
@@ -195,7 +195,7 @@ const getTypeSettingsDiff = _ref7 => {
|
|
|
195
195
|
const nonNullableNextValue = nextValue || {};
|
|
196
196
|
const indentLevel = 1;
|
|
197
197
|
const typeSettingsDiff = [`${indent(indentLevel - 1)}type settings changed`];
|
|
198
|
-
_forEachInstanceProperty__default
|
|
198
|
+
_forEachInstanceProperty__default["default"](_context6 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context6, key => {
|
|
199
199
|
const typeSettingDiff = getStringDiff({
|
|
200
200
|
previousValue: nonNullablePreviousValue[key],
|
|
201
201
|
nextValue: nonNullableNextValue[key],
|
|
@@ -256,7 +256,7 @@ const getMainMenuLinkDiff = _ref9 => {
|
|
|
256
256
|
if (menuLabelsDiff) {
|
|
257
257
|
mainMenuLinkDiff.push(menuLabelsDiff);
|
|
258
258
|
}
|
|
259
|
-
const filteredMainMenuLinkDiff = _filterInstanceProperty__default
|
|
259
|
+
const filteredMainMenuLinkDiff = _filterInstanceProperty__default["default"](mainMenuLinkDiff).call(mainMenuLinkDiff, Boolean);
|
|
260
260
|
if (filteredMainMenuLinkDiff.length > 1) return filteredMainMenuLinkDiff.join('\n');
|
|
261
261
|
return null;
|
|
262
262
|
};
|
|
@@ -265,10 +265,10 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
265
265
|
let previousValue = _ref0.previousValue,
|
|
266
266
|
nextValue = _ref0.nextValue;
|
|
267
267
|
const submenuLinksDiff = ['submenuLink changed'];
|
|
268
|
-
const mappedSubmenuLinks = _reduceInstanceProperty__default
|
|
268
|
+
const mappedSubmenuLinks = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousSubmenuLink, currentSubmenuLink) => _objectSpread(_objectSpread({}, previousSubmenuLink), {}, {
|
|
269
269
|
[currentSubmenuLink.uriPath]: currentSubmenuLink
|
|
270
270
|
}), {});
|
|
271
|
-
const getOrder = value => _mapInstanceProperty__default
|
|
271
|
+
const getOrder = value => _mapInstanceProperty__default["default"](value).call(value, link => link.uriPath).join(', ');
|
|
272
272
|
const previousOrder = getOrder(previousValue);
|
|
273
273
|
const newOrder = getOrder(nextValue);
|
|
274
274
|
if (previousOrder !== newOrder) {
|
|
@@ -276,12 +276,12 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
276
276
|
submenuLinksDiff.push(`${indent(2)}previous order: [${previousOrder}]`);
|
|
277
277
|
submenuLinksDiff.push(`${indent(2)}new order: [${newOrder}]`);
|
|
278
278
|
}
|
|
279
|
-
_forEachInstanceProperty__default
|
|
279
|
+
_forEachInstanceProperty__default["default"](nextValue).call(nextValue, newSubmenuLink => {
|
|
280
280
|
const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
|
|
281
281
|
if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
|
|
282
282
|
var _context7;
|
|
283
283
|
const submenuLinkDiff = [`${indent(1)}menu link "${newSubmenuLink.uriPath}" changed`];
|
|
284
|
-
_forEachInstanceProperty__default
|
|
284
|
+
_forEachInstanceProperty__default["default"](_context7 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context7, key => {
|
|
285
285
|
switch (key) {
|
|
286
286
|
case 'defaultLabel':
|
|
287
287
|
{
|
|
@@ -325,7 +325,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
325
325
|
}
|
|
326
326
|
});
|
|
327
327
|
delete mappedSubmenuLinks[newSubmenuLink.uriPath];
|
|
328
|
-
const filteredSubmenuLinksDiff = _filterInstanceProperty__default
|
|
328
|
+
const filteredSubmenuLinksDiff = _filterInstanceProperty__default["default"](submenuLinkDiff).call(submenuLinkDiff, Boolean);
|
|
329
329
|
if (filteredSubmenuLinksDiff.length > 1) {
|
|
330
330
|
submenuLinksDiff.push(filteredSubmenuLinksDiff.join('\n'));
|
|
331
331
|
}
|
|
@@ -340,7 +340,7 @@ const getSubmenuLinksDiff = _ref0 => {
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
|
-
_forEachInstanceProperty__default
|
|
343
|
+
_forEachInstanceProperty__default["default"](_context8 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context8, key => {
|
|
344
344
|
const linksDiff = getStringDiff({
|
|
345
345
|
previousValue: key,
|
|
346
346
|
label: 'menu link',
|
|
@@ -530,12 +530,12 @@ async function performCreateCustomApplication(_ref2) {
|
|
|
530
530
|
localCustomEntityData = _ref2.localCustomEntityData,
|
|
531
531
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
532
532
|
dryRun = _ref2.dryRun;
|
|
533
|
-
console.log(`Creating Custom Application in organization "${chalk__default
|
|
534
|
-
const data = omit__default
|
|
533
|
+
console.log(`Creating Custom Application in organization "${chalk__default["default"].green(organizationName)}"...`);
|
|
534
|
+
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
535
535
|
if (dryRun) {
|
|
536
536
|
console.log();
|
|
537
537
|
console.log('Dry run - would create Custom Application with:');
|
|
538
|
-
console.log(chalk__default
|
|
538
|
+
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
541
|
const createdCustomApplication = await graphqlRequests.createCustomApplication({
|
|
@@ -552,10 +552,10 @@ async function performCreateCustomApplication(_ref2) {
|
|
|
552
552
|
organizationId,
|
|
553
553
|
customEntityId: createdCustomApplication.id
|
|
554
554
|
});
|
|
555
|
-
console.log(chalk__default
|
|
556
|
-
console.log(`ID: ${chalk__default
|
|
555
|
+
console.log(chalk__default["default"].green('Custom Application created successfully.'));
|
|
556
|
+
console.log(`ID: ${chalk__default["default"].cyan(createdCustomApplication.id)}`);
|
|
557
557
|
console.log(`Please update the "env.production.applicationId" field in your local Custom Application config file with the ID above.`);
|
|
558
|
-
console.log(`URL: ${chalk__default
|
|
558
|
+
console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
|
|
559
559
|
return createdCustomApplication.id;
|
|
560
560
|
}
|
|
561
561
|
async function performUpdateCustomApplication(_ref3) {
|
|
@@ -565,11 +565,11 @@ async function performUpdateCustomApplication(_ref3) {
|
|
|
565
565
|
localCustomEntityData = _ref3.localCustomEntityData,
|
|
566
566
|
applicationIdentifier = _ref3.applicationIdentifier,
|
|
567
567
|
dryRun = _ref3.dryRun;
|
|
568
|
-
const data = omit__default
|
|
568
|
+
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
569
569
|
if (dryRun) {
|
|
570
570
|
console.log();
|
|
571
|
-
console.log(`Dry run - would update Custom Application "${chalk__default
|
|
572
|
-
console.log(chalk__default
|
|
571
|
+
console.log(`Dry run - would update Custom Application "${chalk__default["default"].green(data.entryPointUriPath)}" with:`);
|
|
572
|
+
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
575
|
console.log('Updating Custom Application...');
|
|
@@ -585,8 +585,8 @@ async function performUpdateCustomApplication(_ref3) {
|
|
|
585
585
|
organizationId,
|
|
586
586
|
customEntityId: applicationId
|
|
587
587
|
});
|
|
588
|
-
console.log(chalk__default
|
|
589
|
-
console.log(`URL: ${chalk__default
|
|
588
|
+
console.log(chalk__default["default"].green('Custom Application updated successfully.'));
|
|
589
|
+
console.log(`URL: ${chalk__default["default"].gray(customAppLink)}`);
|
|
590
590
|
}
|
|
591
591
|
async function performCreateCustomView(_ref4) {
|
|
592
592
|
let mcApiUrl = _ref4.mcApiUrl,
|
|
@@ -595,12 +595,12 @@ async function performCreateCustomView(_ref4) {
|
|
|
595
595
|
localCustomEntityData = _ref4.localCustomEntityData,
|
|
596
596
|
applicationIdentifier = _ref4.applicationIdentifier,
|
|
597
597
|
dryRun = _ref4.dryRun;
|
|
598
|
-
console.log(`Creating Custom View in organization "${chalk__default
|
|
599
|
-
const data = omit__default
|
|
598
|
+
console.log(`Creating Custom View in organization "${chalk__default["default"].green(organizationName)}"...`);
|
|
599
|
+
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
600
600
|
if (dryRun) {
|
|
601
601
|
console.log();
|
|
602
602
|
console.log('Dry run - would create Custom View with:');
|
|
603
|
-
console.log(chalk__default
|
|
603
|
+
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
604
604
|
return null;
|
|
605
605
|
}
|
|
606
606
|
const createdCustomView = await graphqlRequests.createCustomView({
|
|
@@ -618,10 +618,10 @@ async function performCreateCustomView(_ref4) {
|
|
|
618
618
|
customEntityId: createdCustomView.id,
|
|
619
619
|
isCustomView: true
|
|
620
620
|
});
|
|
621
|
-
console.log(chalk__default
|
|
622
|
-
console.log(`ID: ${chalk__default
|
|
621
|
+
console.log(chalk__default["default"].green('Custom View created successfully.'));
|
|
622
|
+
console.log(`ID: ${chalk__default["default"].cyan(createdCustomView.id)}`);
|
|
623
623
|
console.log(`Please update the "env.production.customViewId" field in your local Custom View config file with the ID above.`);
|
|
624
|
-
console.log(`URL: ${chalk__default
|
|
624
|
+
console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
|
|
625
625
|
return createdCustomView.id;
|
|
626
626
|
}
|
|
627
627
|
async function performUpdateCustomView(_ref5) {
|
|
@@ -631,11 +631,11 @@ async function performUpdateCustomView(_ref5) {
|
|
|
631
631
|
localCustomEntityData = _ref5.localCustomEntityData,
|
|
632
632
|
applicationIdentifier = _ref5.applicationIdentifier,
|
|
633
633
|
dryRun = _ref5.dryRun;
|
|
634
|
-
const data = omit__default
|
|
634
|
+
const data = omit__default["default"](localCustomEntityData, ['id']);
|
|
635
635
|
if (dryRun) {
|
|
636
636
|
console.log();
|
|
637
|
-
console.log(`Dry run - would update Custom View "${chalk__default
|
|
638
|
-
console.log(chalk__default
|
|
637
|
+
console.log(`Dry run - would update Custom View "${chalk__default["default"].green(data.defaultLabel)}" with:`);
|
|
638
|
+
console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
console.log('Updating Custom View...');
|
|
@@ -652,8 +652,8 @@ async function performUpdateCustomView(_ref5) {
|
|
|
652
652
|
customEntityId: customViewId,
|
|
653
653
|
isCustomView: true
|
|
654
654
|
});
|
|
655
|
-
console.log(chalk__default
|
|
656
|
-
console.log(`URL: ${chalk__default
|
|
655
|
+
console.log(chalk__default["default"].green('Custom View updated successfully.'));
|
|
656
|
+
console.log(`URL: ${chalk__default["default"].gray(customViewLink)}`);
|
|
657
657
|
}
|
|
658
658
|
async function checkCustomApplicationStatus(_ref6) {
|
|
659
659
|
let mcApiUrl = _ref6.mcApiUrl,
|