@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.
Files changed (76) hide show
  1. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
  2. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
  3. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
  4. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +14 -13
  5. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +14 -13
  6. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +14 -13
  7. package/dist/{build-f737874d.cjs.dev.js → build-0a5986d1.cjs.dev.js} +7 -7
  8. package/dist/{build-85028596.esm.js → build-dbcd0936.esm.js} +7 -7
  9. package/dist/{build-136a1b89.cjs.prod.js → build-ec10df64.cjs.prod.js} +7 -7
  10. package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-16b1a575.cjs.dev.js} +8 -9
  11. package/dist/{build-vite-85211835.esm.js → build-vite-59e1f185.esm.js} +8 -9
  12. package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-5d317720.cjs.prod.js} +8 -9
  13. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
  14. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
  15. package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
  16. package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
  17. package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
  18. package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
  19. package/dist/{config-sync-c2f0d0d2.cjs.prod.js → config-sync-ce05c66c.cjs.prod.js} +70 -78
  20. package/dist/{config-sync-a6d29e7e.cjs.dev.js → config-sync-dbb43993.cjs.dev.js} +72 -80
  21. package/dist/{config-sync-ca738e38.esm.js → config-sync-e7f53a98.esm.js} +71 -79
  22. package/dist/{create-postcss-config-2a12c11b.esm.js → create-postcss-config-0a86560d.esm.js} +1 -1
  23. package/dist/{create-postcss-config-7ea95e6f.cjs.dev.js → create-postcss-config-381b636b.cjs.dev.js} +1 -1
  24. package/dist/{create-postcss-config-43a47b87.cjs.prod.js → create-postcss-config-91c09596.cjs.prod.js} +1 -1
  25. package/dist/{create-webpack-config-for-development-01784333.cjs.prod.js → create-webpack-config-for-development-37677a49.cjs.prod.js} +6 -6
  26. package/dist/{create-webpack-config-for-development-09988fe4.cjs.dev.js → create-webpack-config-for-development-488742b2.cjs.dev.js} +6 -6
  27. package/dist/{create-webpack-config-for-development-ca57ea56.esm.js → create-webpack-config-for-development-df3f7f7f.esm.js} +6 -6
  28. package/dist/{create-webpack-config-for-production-d1699ee5.cjs.dev.js → create-webpack-config-for-production-46d817cc.cjs.dev.js} +7 -7
  29. package/dist/{create-webpack-config-for-production-58d046e9.cjs.prod.js → create-webpack-config-for-production-aad64e2a.cjs.prod.js} +7 -7
  30. package/dist/{create-webpack-config-for-production-7b4166fc.esm.js → create-webpack-config-for-production-e22f78d2.esm.js} +7 -7
  31. package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-0b89aa0e.cjs.prod.js} +1 -1
  32. package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-4464313c.esm.js} +1 -1
  33. package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-cbb5c559.cjs.dev.js} +1 -1
  34. package/dist/{deployment-previews-set-6baa8fc7.cjs.dev.js → deployment-previews-set-4edd48db.cjs.dev.js} +22 -28
  35. package/dist/{deployment-previews-set-86ea8608.cjs.prod.js → deployment-previews-set-636fb1a3.cjs.prod.js} +22 -28
  36. package/dist/{deployment-previews-set-8b33d390.esm.js → deployment-previews-set-bbef95d2.esm.js} +22 -27
  37. package/dist/{graphql-requests-73d961d9.cjs.dev.js → graphql-requests-0a6eeb3a.cjs.prod.js} +5 -8
  38. package/dist/{graphql-requests-b6ca7894.esm.js → graphql-requests-14074b2b.esm.js} +5 -8
  39. package/dist/{graphql-requests-4ff022ec.cjs.prod.js → graphql-requests-23f7ddb1.cjs.dev.js} +5 -8
  40. package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
  41. package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
  42. package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
  43. package/dist/{login-5c212340.esm.js → login-1b222f33.esm.js} +27 -30
  44. package/dist/{login-b4e3433c.cjs.prod.js → login-54ebae96.cjs.prod.js} +28 -31
  45. package/dist/{login-856475d9.cjs.dev.js → login-a6fd5fbf.cjs.dev.js} +28 -31
  46. package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
  47. package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
  48. package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
  49. package/dist/{package-85c56dad.esm.js → package-a34835d9.esm.js} +9 -11
  50. package/dist/{package-36c179b4.cjs.prod.js → package-d8b1f4c0.cjs.dev.js} +9 -11
  51. package/dist/{package-483f057b.cjs.dev.js → package-e1f7242c.cjs.prod.js} +9 -11
  52. package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
  53. package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
  54. package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
  55. package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
  56. package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
  57. package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
  58. package/dist/{start-33cc9cbb.cjs.prod.js → start-0be8a294.cjs.prod.js} +8 -9
  59. package/dist/{start-e28d1fec.cjs.dev.js → start-37ec4a7e.cjs.dev.js} +8 -9
  60. package/dist/{start-654d09ae.esm.js → start-890895df.esm.js} +8 -9
  61. package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
  62. package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
  63. package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
  64. package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
  65. package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
  66. package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
  67. package/package.json +9 -11
  68. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  69. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  70. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  71. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
  72. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
  73. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
  74. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
  75. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
  76. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
@@ -29,10 +29,10 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
29
29
  var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
30
30
  var fs = require('fs');
31
31
  var path = require('path');
32
- var createPostcssConfig = require('./create-postcss-config-7ea95e6f.cjs.dev.js');
32
+ var createPostcssConfig = require('./create-postcss-config-381b636b.cjs.dev.js');
33
33
  var hasJsxRuntime = require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
34
- var optimizations = require('./optimizations-ebbeaf88.cjs.dev.js');
35
- var paths = require('./paths-ec3e3a7d.cjs.dev.js');
34
+ var optimizations = require('./optimizations-7789145e.cjs.dev.js');
35
+ var paths = require('./paths-b76fc753.cjs.dev.js');
36
36
  var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
37
37
 
38
38
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -109,7 +109,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
109
109
  fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
110
110
  } catch (error) {
111
111
  // eslint-disable-next-line no-console
112
- console.warn("[FinalStatsWriterPlugin] The dist folder could not be found at ".concat(this.config.outputPath, ". Check the console for errors during the webpack compilation."));
112
+ console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
113
113
  }
114
114
  }
115
115
  }]);
@@ -230,7 +230,7 @@ function createWebpackConfigForProduction() {
230
230
  // https://github.com/facebook/create-react-app/issues/290
231
231
  // `web` extension prefixes have been added for better support
232
232
  // for React Native Web.
233
- extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => ".".concat(ext)),
233
+ extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
234
234
  // NOTE: this is meant to be a temporary list of fallback/polyfills for certain
235
235
  // nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
236
236
  // however now it's not the case anymore.
@@ -360,9 +360,9 @@ function createWebpackConfigForProduction() {
360
360
  name: 'prefixIds',
361
361
  params: {
362
362
  delim: '',
363
- prefix: (_, info) => "svg".concat(crypto__default["default"].createHash('shake256', {
363
+ prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
364
364
  outputLength: 6
365
- }).update(info.path || '').digest('hex'))
365
+ }).update(info.path || '').digest('hex')}`
366
366
  }
367
367
  }]
368
368
  }
@@ -29,10 +29,10 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
29
29
  var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
30
30
  var fs = require('fs');
31
31
  var path = require('path');
32
- var createPostcssConfig = require('./create-postcss-config-43a47b87.cjs.prod.js');
32
+ var createPostcssConfig = require('./create-postcss-config-91c09596.cjs.prod.js');
33
33
  var hasJsxRuntime = require('./has-jsx-runtime-c3202df5.cjs.prod.js');
34
- var optimizations = require('./optimizations-ea21b802.cjs.prod.js');
35
- var paths = require('./paths-af1a725a.cjs.prod.js');
34
+ var optimizations = require('./optimizations-fb93514f.cjs.prod.js');
35
+ var paths = require('./paths-7768b440.cjs.prod.js');
36
36
  var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
37
37
 
38
38
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -109,7 +109,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
109
109
  fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
110
110
  } catch (error) {
111
111
  // eslint-disable-next-line no-console
112
- console.warn("[FinalStatsWriterPlugin] The dist folder could not be found at ".concat(this.config.outputPath, ". Check the console for errors during the webpack compilation."));
112
+ console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
113
113
  }
114
114
  }
115
115
  }]);
@@ -230,7 +230,7 @@ function createWebpackConfigForProduction() {
230
230
  // https://github.com/facebook/create-react-app/issues/290
231
231
  // `web` extension prefixes have been added for better support
232
232
  // for React Native Web.
233
- extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => ".".concat(ext)),
233
+ extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
234
234
  // NOTE: this is meant to be a temporary list of fallback/polyfills for certain
235
235
  // nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
236
236
  // however now it's not the case anymore.
@@ -360,9 +360,9 @@ function createWebpackConfigForProduction() {
360
360
  name: 'prefixIds',
361
361
  params: {
362
362
  delim: '',
363
- prefix: (_, info) => "svg".concat(crypto__default["default"].createHash('shake256', {
363
+ prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
364
364
  outputLength: 6
365
- }).update(info.path || '').digest('hex'))
365
+ }).update(info.path || '').digest('hex')}`
366
366
  }
367
367
  }]
368
368
  }
@@ -27,10 +27,10 @@ import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
27
27
  import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
28
28
  import fs from 'fs';
29
29
  import path from 'path';
30
- import { c as createPostcssConfig } from './create-postcss-config-2a12c11b.esm.js';
30
+ import { c as createPostcssConfig } from './create-postcss-config-0a86560d.esm.js';
31
31
  import { h as hasJsxRuntime } from './has-jsx-runtime-e3ecb09b.esm.js';
32
- import { g as getWepbackCacheGroups } from './optimizations-ea71a24a.esm.js';
33
- import { p as paths } from './paths-7bf7e88e.esm.js';
32
+ import { g as getWepbackCacheGroups } from './optimizations-bf991634.esm.js';
33
+ import { p as paths } from './paths-39f22b8b.esm.js';
34
34
  import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
35
35
 
36
36
  let FinalStatsWriterPlugin = /*#__PURE__*/function () {
@@ -79,7 +79,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
79
79
  fs.writeFileSync(path.join(this.config.outputPath, 'stats.json'), _JSON$stringify(finalStats, null, 2));
80
80
  } catch (error) {
81
81
  // eslint-disable-next-line no-console
82
- console.warn("[FinalStatsWriterPlugin] The dist folder could not be found at ".concat(this.config.outputPath, ". Check the console for errors during the webpack compilation."));
82
+ console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
83
83
  }
84
84
  }
85
85
  }]);
@@ -200,7 +200,7 @@ function createWebpackConfigForProduction() {
200
200
  // https://github.com/facebook/create-react-app/issues/290
201
201
  // `web` extension prefixes have been added for better support
202
202
  // for React Native Web.
203
- extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => ".".concat(ext)),
203
+ extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
204
204
  // NOTE: this is meant to be a temporary list of fallback/polyfills for certain
205
205
  // nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
206
206
  // however now it's not the case anymore.
@@ -330,9 +330,9 @@ function createWebpackConfigForProduction() {
330
330
  name: 'prefixIds',
331
331
  params: {
332
332
  delim: '',
333
- prefix: (_, info) => "svg".concat(crypto.createHash('shake256', {
333
+ prefix: (_, info) => `svg${crypto.createHash('shake256', {
334
334
  outputLength: 6
335
- }).update(info.path || '').digest('hex'))
335
+ }).update(info.path || '').digest('hex')}`
336
336
  }
337
337
  }]
338
338
  }
@@ -22,7 +22,7 @@ let CredentialsStorage = /*#__PURE__*/function () {
22
22
  _classCallCheck(this, CredentialsStorage);
23
23
  this.credentialsFilePath = void 0;
24
24
  const homedir = os__default["default"].homedir();
25
- const credentialsFolderPath = path__default["default"].join(homedir, ".commercetools");
25
+ const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
26
26
  this.credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
27
27
 
28
28
  // Ensure the credentials file is present
@@ -12,7 +12,7 @@ let CredentialsStorage = /*#__PURE__*/function () {
12
12
  _classCallCheck(this, CredentialsStorage);
13
13
  this.credentialsFilePath = void 0;
14
14
  const homedir = os.homedir();
15
- const credentialsFolderPath = path.join(homedir, ".commercetools");
15
+ const credentialsFolderPath = path.join(homedir, `.commercetools`);
16
16
  this.credentialsFilePath = path.join(credentialsFolderPath, 'mc-credentials.json');
17
17
 
18
18
  // Ensure the credentials file is present
@@ -22,7 +22,7 @@ let CredentialsStorage = /*#__PURE__*/function () {
22
22
  _classCallCheck(this, CredentialsStorage);
23
23
  this.credentialsFilePath = void 0;
24
24
  const homedir = os__default["default"].homedir();
25
- const credentialsFolderPath = path__default["default"].join(homedir, ".commercetools");
25
+ const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
26
26
  this.credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
27
27
 
28
28
  // Ensure the credentials file is present
@@ -2,14 +2,13 @@
2
2
 
3
3
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
4
4
  var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
5
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
6
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
7
6
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
8
7
  var chalk = require('chalk');
9
8
  var prompts = require('prompts');
10
9
  var applicationConfig = require('@commercetools-frontend/application-config');
11
- var credentialsStorage$1 = require('./credentials-storage-de220814.cjs.dev.js');
12
- var graphqlRequests = require('./graphql-requests-73d961d9.cjs.dev.js');
10
+ var credentialsStorage$1 = require('./credentials-storage-cbb5c559.cjs.dev.js');
11
+ var graphqlRequests = require('./graphql-requests-23f7ddb1.cjs.dev.js');
13
12
  require('@babel/runtime-corejs3/helpers/classCallCheck');
14
13
  require('@babel/runtime-corejs3/helpers/createClass');
15
14
  require('@babel/runtime-corejs3/core-js-stable/json/stringify');
@@ -31,13 +30,12 @@ require('graphql');
31
30
  require('graphql-request');
32
31
  require('@commercetools-frontend/constants');
33
32
  require('@commercetools/http-user-agent');
34
- require('./package-483f057b.cjs.dev.js');
33
+ require('./package-d8b1f4c0.cjs.dev.js');
35
34
 
36
35
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
37
36
 
38
37
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
39
38
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
40
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
41
39
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
42
40
  var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
43
41
  var chalk__default = /*#__PURE__*/_interopDefault(chalk);
@@ -57,25 +55,24 @@ const validateUrl = function () {
57
55
  const validateAlias = function () {
58
56
  let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
59
57
  try {
60
- new _URL__default["default"]("https://".concat(alias, ".commercetools.com/"));
58
+ new _URL__default["default"](`https://${alias}.commercetools.com/`);
61
59
  return true;
62
60
  } catch (error) {
63
61
  return false;
64
62
  }
65
63
  };
66
64
  const getMcUrlLink = _ref => {
67
- var _context2, _context3, _context4;
68
65
  let mcApiUrl = _ref.mcApiUrl,
69
66
  organizationId = _ref.organizationId,
70
67
  customEntityId = _ref.customEntityId,
71
68
  isCustomView = _ref.isCustomView;
72
69
  const mcUrl = mcApiUrl.replace('mc-api', 'mc');
73
- const customEntityLink = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = "".concat(mcUrl, "/account/organizations/")).call(_context4, organizationId, "/custom-")).call(_context3, isCustomView ? 'views' : 'applications', "/owned/")).call(_context2, customEntityId, "/deployment-previews");
70
+ const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}/deployment-previews`;
74
71
  return customEntityLink;
75
72
  };
76
73
  const isCustomViewData = data => data.entryPointUriPath === undefined;
77
74
  async function setDeploymentPreview(_ref2) {
78
- var _context6;
75
+ var _context3;
79
76
  let mcApiUrl = _ref2.mcApiUrl,
80
77
  applicationId = _ref2.applicationId,
81
78
  applicationIdentifier = _ref2.applicationIdentifier,
@@ -96,28 +93,28 @@ async function setDeploymentPreview(_ref2) {
96
93
  applicationIdentifier
97
94
  });
98
95
  if (!fetchedCustomApplication) {
99
- throw new Error("The Custom Application \"".concat(applicationIdentifier, "\" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews."));
96
+ throw new Error(`The Custom Application "${applicationIdentifier}" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews.`);
100
97
  }
101
98
  let deploymentAlias = options.alias;
102
99
  // If the alias was not provided as an argument to the script, let's ask for it.
103
100
  if (!deploymentAlias) {
104
- var _context5;
101
+ var _context2;
105
102
  const _await$prompts = await prompts__default["default"]({
106
103
  type: 'text',
107
104
  name: 'alias',
108
- message: _filterInstanceProperty__default["default"](_context5 = ["Enter the alias for the deployment preview", options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
105
+ message: _filterInstanceProperty__default["default"](_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
109
106
  validate: value => validateAlias(value)
110
107
  }),
111
108
  alias = _await$prompts.alias;
112
109
  deploymentAlias = alias;
113
110
  }
114
- const existingDeploymentPreview = _findInstanceProperty__default["default"](_context6 = fetchedCustomApplication.application.deployments).call(_context6, deployment => deployment.alias === deploymentAlias);
111
+ const existingDeploymentPreview = _findInstanceProperty__default["default"](_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
115
112
  if (!options.alias && !options.url && existingDeploymentPreview) {
116
- var _context7;
113
+ var _context4;
117
114
  const _await$prompts2 = await prompts__default["default"]({
118
115
  type: 'confirm',
119
116
  name: 'aliasOverrideConfirmation',
120
- message: _filterInstanceProperty__default["default"](_context7 = ["The alias \"".concat(chalk__default["default"].green(deploymentAlias), "\" already exists. Do you want to proceed and update the URL?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context7, Boolean).join('\n'),
117
+ message: _filterInstanceProperty__default["default"](_context4 = [`The alias "${chalk__default["default"].green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
121
118
  initial: false
122
119
  }),
123
120
  aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
@@ -128,20 +125,19 @@ async function setDeploymentPreview(_ref2) {
128
125
  }
129
126
  let deploymentUrl = options.url;
130
127
  if (!deploymentUrl) {
131
- var _context8;
128
+ var _context5;
132
129
  const _await$prompts3 = await prompts__default["default"]({
133
130
  type: 'text',
134
131
  name: 'url',
135
- message: _filterInstanceProperty__default["default"](_context8 = ["Enter the URL for the deployment preview", options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context8, Boolean).join('\n'),
132
+ message: _filterInstanceProperty__default["default"](_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
136
133
  validate: value => validateUrl(value)
137
134
  }),
138
135
  url = _await$prompts3.url;
139
136
  deploymentUrl = url;
140
137
  }
141
138
  if (options.dryRun) {
142
- var _context9, _context0;
143
- const message = existingDeploymentPreview ? _concatInstanceProperty__default["default"](_context9 = "The existing deployment preview with alias \"".concat(deploymentAlias, "\" would have been updated with this url: \"")).call(_context9, deploymentUrl, "\".") : _concatInstanceProperty__default["default"](_context0 = "A new deployment preview with alias \"".concat(deploymentAlias, "\" would have been created with this url: \"")).call(_context0, deploymentUrl, "\".");
144
- console.log("\n".concat(message, "\n"));
139
+ const message = existingDeploymentPreview ? `The existing deployment preview with alias "${deploymentAlias}" would have been updated with this url: "${deploymentUrl}".` : `A new deployment preview with alias "${deploymentAlias}" would have been created with this url: "${deploymentUrl}".`;
140
+ console.log(`\n${message}\n`);
145
141
  return;
146
142
  }
147
143
  const mcDeploymentPreviewsLink = getMcUrlLink({
@@ -151,7 +147,6 @@ async function setDeploymentPreview(_ref2) {
151
147
  isCustomView
152
148
  });
153
149
  if (existingDeploymentPreview) {
154
- var _context1;
155
150
  await graphqlRequests.updateCustomApplicationDeploymentPreview({
156
151
  mcApiUrl,
157
152
  organizationId: fetchedCustomApplication.organizationId,
@@ -161,10 +156,9 @@ async function setDeploymentPreview(_ref2) {
161
156
  url: deploymentUrl
162
157
  }
163
158
  });
164
- console.log(chalk__default["default"].green(_concatInstanceProperty__default["default"](_context1 = "Deployment preview with alias \"".concat(deploymentAlias, "\" updated successfully with URL \"")).call(_context1, deploymentUrl, "\".")));
165
- console.log(chalk__default["default"].green("You can access the deployment previews at: ".concat(mcDeploymentPreviewsLink)));
159
+ console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
160
+ console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
166
161
  } else {
167
- var _context10;
168
162
  await graphqlRequests.createCustomApplicationDeploymentPreview({
169
163
  mcApiUrl,
170
164
  organizationId: fetchedCustomApplication.organizationId,
@@ -175,8 +169,8 @@ async function setDeploymentPreview(_ref2) {
175
169
  url: deploymentUrl
176
170
  }
177
171
  });
178
- console.log(chalk__default["default"].green(_concatInstanceProperty__default["default"](_context10 = "Deployment preview with alias \"".concat(deploymentAlias, "\" created successfully with URL \"")).call(_context10, deploymentUrl, "\".")));
179
- console.log(chalk__default["default"].green("You can access the deployment previews at: ".concat(mcDeploymentPreviewsLink)));
172
+ console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
173
+ console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
180
174
  }
181
175
  }
182
176
  async function run(options) {
@@ -186,11 +180,11 @@ async function run(options) {
186
180
  mcApiUrl = _applicationConfig$en.mcApiUrl,
187
181
  applicationIdentifier = _applicationConfig$en.applicationIdentifier;
188
182
  const isCustomView = isCustomViewData(localCustomEntityData);
189
- console.log("Using Merchant Center environment \"".concat(chalk__default["default"].green(mcApiUrl), "\"."));
183
+ console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
190
184
  console.log();
191
185
  const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
192
186
  if (!isSessionValid) {
193
- throw new Error("You don't have a valid session. Please, run the \"mc-scripts login\" command to authenticate yourself.");
187
+ throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
194
188
  }
195
189
  if (isCustomView) {
196
190
  throw new Error('Deployments previews are not supported for Custom Views.');
@@ -2,14 +2,13 @@
2
2
 
3
3
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
4
4
  var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
5
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
6
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
7
6
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
8
7
  var chalk = require('chalk');
9
8
  var prompts = require('prompts');
10
9
  var applicationConfig = require('@commercetools-frontend/application-config');
11
- var credentialsStorage$1 = require('./credentials-storage-381abf27.cjs.prod.js');
12
- var graphqlRequests = require('./graphql-requests-4ff022ec.cjs.prod.js');
10
+ var credentialsStorage$1 = require('./credentials-storage-0b89aa0e.cjs.prod.js');
11
+ var graphqlRequests = require('./graphql-requests-0a6eeb3a.cjs.prod.js');
13
12
  require('@babel/runtime-corejs3/helpers/classCallCheck');
14
13
  require('@babel/runtime-corejs3/helpers/createClass');
15
14
  require('@babel/runtime-corejs3/core-js-stable/json/stringify');
@@ -31,13 +30,12 @@ require('graphql');
31
30
  require('graphql-request');
32
31
  require('@commercetools-frontend/constants');
33
32
  require('@commercetools/http-user-agent');
34
- require('./package-36c179b4.cjs.prod.js');
33
+ require('./package-e1f7242c.cjs.prod.js');
35
34
 
36
35
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
37
36
 
38
37
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
39
38
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
40
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
41
39
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
42
40
  var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
43
41
  var chalk__default = /*#__PURE__*/_interopDefault(chalk);
@@ -57,25 +55,24 @@ const validateUrl = function () {
57
55
  const validateAlias = function () {
58
56
  let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
59
57
  try {
60
- new _URL__default["default"]("https://".concat(alias, ".commercetools.com/"));
58
+ new _URL__default["default"](`https://${alias}.commercetools.com/`);
61
59
  return true;
62
60
  } catch (error) {
63
61
  return false;
64
62
  }
65
63
  };
66
64
  const getMcUrlLink = _ref => {
67
- var _context2, _context3, _context4;
68
65
  let mcApiUrl = _ref.mcApiUrl,
69
66
  organizationId = _ref.organizationId,
70
67
  customEntityId = _ref.customEntityId,
71
68
  isCustomView = _ref.isCustomView;
72
69
  const mcUrl = mcApiUrl.replace('mc-api', 'mc');
73
- const customEntityLink = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = "".concat(mcUrl, "/account/organizations/")).call(_context4, organizationId, "/custom-")).call(_context3, isCustomView ? 'views' : 'applications', "/owned/")).call(_context2, customEntityId, "/deployment-previews");
70
+ const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}/deployment-previews`;
74
71
  return customEntityLink;
75
72
  };
76
73
  const isCustomViewData = data => data.entryPointUriPath === undefined;
77
74
  async function setDeploymentPreview(_ref2) {
78
- var _context6;
75
+ var _context3;
79
76
  let mcApiUrl = _ref2.mcApiUrl,
80
77
  applicationId = _ref2.applicationId,
81
78
  applicationIdentifier = _ref2.applicationIdentifier,
@@ -96,28 +93,28 @@ async function setDeploymentPreview(_ref2) {
96
93
  applicationIdentifier
97
94
  });
98
95
  if (!fetchedCustomApplication) {
99
- throw new Error("The Custom Application \"".concat(applicationIdentifier, "\" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews."));
96
+ throw new Error(`The Custom Application "${applicationIdentifier}" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews.`);
100
97
  }
101
98
  let deploymentAlias = options.alias;
102
99
  // If the alias was not provided as an argument to the script, let's ask for it.
103
100
  if (!deploymentAlias) {
104
- var _context5;
101
+ var _context2;
105
102
  const _await$prompts = await prompts__default["default"]({
106
103
  type: 'text',
107
104
  name: 'alias',
108
- message: _filterInstanceProperty__default["default"](_context5 = ["Enter the alias for the deployment preview", options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
105
+ message: _filterInstanceProperty__default["default"](_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
109
106
  validate: value => validateAlias(value)
110
107
  }),
111
108
  alias = _await$prompts.alias;
112
109
  deploymentAlias = alias;
113
110
  }
114
- const existingDeploymentPreview = _findInstanceProperty__default["default"](_context6 = fetchedCustomApplication.application.deployments).call(_context6, deployment => deployment.alias === deploymentAlias);
111
+ const existingDeploymentPreview = _findInstanceProperty__default["default"](_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
115
112
  if (!options.alias && !options.url && existingDeploymentPreview) {
116
- var _context7;
113
+ var _context4;
117
114
  const _await$prompts2 = await prompts__default["default"]({
118
115
  type: 'confirm',
119
116
  name: 'aliasOverrideConfirmation',
120
- message: _filterInstanceProperty__default["default"](_context7 = ["The alias \"".concat(chalk__default["default"].green(deploymentAlias), "\" already exists. Do you want to proceed and update the URL?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context7, Boolean).join('\n'),
117
+ message: _filterInstanceProperty__default["default"](_context4 = [`The alias "${chalk__default["default"].green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
121
118
  initial: false
122
119
  }),
123
120
  aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
@@ -128,20 +125,19 @@ async function setDeploymentPreview(_ref2) {
128
125
  }
129
126
  let deploymentUrl = options.url;
130
127
  if (!deploymentUrl) {
131
- var _context8;
128
+ var _context5;
132
129
  const _await$prompts3 = await prompts__default["default"]({
133
130
  type: 'text',
134
131
  name: 'url',
135
- message: _filterInstanceProperty__default["default"](_context8 = ["Enter the URL for the deployment preview", options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context8, Boolean).join('\n'),
132
+ message: _filterInstanceProperty__default["default"](_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
136
133
  validate: value => validateUrl(value)
137
134
  }),
138
135
  url = _await$prompts3.url;
139
136
  deploymentUrl = url;
140
137
  }
141
138
  if (options.dryRun) {
142
- var _context9, _context0;
143
- const message = existingDeploymentPreview ? _concatInstanceProperty__default["default"](_context9 = "The existing deployment preview with alias \"".concat(deploymentAlias, "\" would have been updated with this url: \"")).call(_context9, deploymentUrl, "\".") : _concatInstanceProperty__default["default"](_context0 = "A new deployment preview with alias \"".concat(deploymentAlias, "\" would have been created with this url: \"")).call(_context0, deploymentUrl, "\".");
144
- console.log("\n".concat(message, "\n"));
139
+ const message = existingDeploymentPreview ? `The existing deployment preview with alias "${deploymentAlias}" would have been updated with this url: "${deploymentUrl}".` : `A new deployment preview with alias "${deploymentAlias}" would have been created with this url: "${deploymentUrl}".`;
140
+ console.log(`\n${message}\n`);
145
141
  return;
146
142
  }
147
143
  const mcDeploymentPreviewsLink = getMcUrlLink({
@@ -151,7 +147,6 @@ async function setDeploymentPreview(_ref2) {
151
147
  isCustomView
152
148
  });
153
149
  if (existingDeploymentPreview) {
154
- var _context1;
155
150
  await graphqlRequests.updateCustomApplicationDeploymentPreview({
156
151
  mcApiUrl,
157
152
  organizationId: fetchedCustomApplication.organizationId,
@@ -161,10 +156,9 @@ async function setDeploymentPreview(_ref2) {
161
156
  url: deploymentUrl
162
157
  }
163
158
  });
164
- console.log(chalk__default["default"].green(_concatInstanceProperty__default["default"](_context1 = "Deployment preview with alias \"".concat(deploymentAlias, "\" updated successfully with URL \"")).call(_context1, deploymentUrl, "\".")));
165
- console.log(chalk__default["default"].green("You can access the deployment previews at: ".concat(mcDeploymentPreviewsLink)));
159
+ console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
160
+ console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
166
161
  } else {
167
- var _context10;
168
162
  await graphqlRequests.createCustomApplicationDeploymentPreview({
169
163
  mcApiUrl,
170
164
  organizationId: fetchedCustomApplication.organizationId,
@@ -175,8 +169,8 @@ async function setDeploymentPreview(_ref2) {
175
169
  url: deploymentUrl
176
170
  }
177
171
  });
178
- console.log(chalk__default["default"].green(_concatInstanceProperty__default["default"](_context10 = "Deployment preview with alias \"".concat(deploymentAlias, "\" created successfully with URL \"")).call(_context10, deploymentUrl, "\".")));
179
- console.log(chalk__default["default"].green("You can access the deployment previews at: ".concat(mcDeploymentPreviewsLink)));
172
+ console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
173
+ console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
180
174
  }
181
175
  }
182
176
  async function run(options) {
@@ -186,11 +180,11 @@ async function run(options) {
186
180
  mcApiUrl = _applicationConfig$en.mcApiUrl,
187
181
  applicationIdentifier = _applicationConfig$en.applicationIdentifier;
188
182
  const isCustomView = isCustomViewData(localCustomEntityData);
189
- console.log("Using Merchant Center environment \"".concat(chalk__default["default"].green(mcApiUrl), "\"."));
183
+ console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
190
184
  console.log();
191
185
  const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
192
186
  if (!isSessionValid) {
193
- throw new Error("You don't have a valid session. Please, run the \"mc-scripts login\" command to authenticate yourself.");
187
+ throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
194
188
  }
195
189
  if (isCustomView) {
196
190
  throw new Error('Deployments previews are not supported for Custom Views.');