@commercetools-frontend/mc-scripts 25.0.0 → 25.2.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 (84) 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 +28 -14
  5. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +28 -14
  6. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +28 -14
  7. package/dist/{build-50f29fb0.cjs.prod.js → build-182a099c.cjs.prod.js} +7 -7
  8. package/dist/{build-0b4c6b04.esm.js → build-220a1658.esm.js} +7 -7
  9. package/dist/{build-1baf8a00.cjs.dev.js → build-519d246d.cjs.dev.js} +7 -7
  10. package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-837e7c94.cjs.dev.js} +64 -43
  11. package/dist/{build-vite-85211835.esm.js → build-vite-8cae71a0.esm.js} +61 -24
  12. package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-b007241b.cjs.prod.js} +64 -43
  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-0b96d430.esm.js +255 -0
  20. package/dist/config-sync-b3072939.cjs.prod.js +265 -0
  21. package/dist/config-sync-ci-4a09aa00.cjs.prod.js +305 -0
  22. package/dist/config-sync-ci-85e3fec2.esm.js +294 -0
  23. package/dist/config-sync-ci-eadb8bfc.cjs.dev.js +305 -0
  24. package/dist/config-sync-f8fca39f.cjs.dev.js +265 -0
  25. package/dist/{config-sync-87ba9f28.cjs.prod.js → config-sync-helpers-11fc328f.cjs.prod.js} +193 -326
  26. package/dist/{config-sync-27ca0c93.cjs.dev.js → config-sync-helpers-dab59ed9.cjs.dev.js} +195 -328
  27. package/dist/{config-sync-ff4b1e5b.esm.js → config-sync-helpers-fe6ea729.esm.js} +186 -323
  28. package/dist/{create-postcss-config-34bab342.cjs.prod.js → create-postcss-config-56b74a34.cjs.prod.js} +1 -1
  29. package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-78879a12.cjs.dev.js} +1 -1
  30. package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-95f9bf62.esm.js} +1 -1
  31. package/dist/{create-webpack-config-for-development-fe0945ce.cjs.prod.js → create-webpack-config-for-development-3eb1b365.cjs.prod.js} +7 -7
  32. package/dist/{create-webpack-config-for-development-2ac1d86f.cjs.dev.js → create-webpack-config-for-development-62b89920.cjs.dev.js} +7 -7
  33. package/dist/{create-webpack-config-for-development-be2722d6.esm.js → create-webpack-config-for-development-a28736fa.esm.js} +7 -7
  34. package/dist/{create-webpack-config-for-production-66c77849.esm.js → create-webpack-config-for-production-21ea561f.esm.js} +8 -8
  35. package/dist/{create-webpack-config-for-production-2200e554.cjs.prod.js → create-webpack-config-for-production-3b6599db.cjs.prod.js} +8 -8
  36. package/dist/{create-webpack-config-for-production-d2c41a9d.cjs.dev.js → create-webpack-config-for-production-e5ed8805.cjs.dev.js} +8 -8
  37. package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-6d592cd6.cjs.prod.js} +21 -3
  38. package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-c4c5980e.cjs.dev.js} +21 -3
  39. package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-fcc77fb6.esm.js} +21 -3
  40. package/dist/declarations/src/types.d.ts +4 -0
  41. package/dist/{deployment-previews-set-7f9fbfe5.esm.js → deployment-previews-set-7d49e7df.esm.js} +22 -27
  42. package/dist/{deployment-previews-set-3697be5e.cjs.dev.js → deployment-previews-set-8d6a1e99.cjs.dev.js} +22 -28
  43. package/dist/{deployment-previews-set-e92403f7.cjs.prod.js → deployment-previews-set-f8ce3db7.cjs.prod.js} +22 -28
  44. package/dist/{graphql-requests-bab5fcc3.cjs.dev.js → graphql-requests-b57fca4c.cjs.prod.js} +5 -8
  45. package/dist/{graphql-requests-d8bc2292.esm.js → graphql-requests-d2fa2ca7.esm.js} +6 -9
  46. package/dist/{graphql-requests-8ef89149.cjs.prod.js → graphql-requests-da194989.cjs.dev.js} +5 -8
  47. package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
  48. package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
  49. package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
  50. package/dist/{login-5fd67aac.cjs.prod.js → login-9774c9cc.cjs.prod.js} +154 -38
  51. package/dist/login-abb38213.esm.js +337 -0
  52. package/dist/{login-9fac9eee.cjs.dev.js → login-f4550251.cjs.dev.js} +154 -38
  53. package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
  54. package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
  55. package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
  56. package/dist/{package-ff04bcf7.cjs.dev.js → package-0eebca1b.cjs.dev.js} +21 -11
  57. package/dist/{package-4bdd2ccf.esm.js → package-9e6910b8.esm.js} +21 -11
  58. package/dist/{package-428d5001.cjs.prod.js → package-b9298ce3.cjs.prod.js} +21 -11
  59. package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
  60. package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
  61. package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
  62. package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
  63. package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
  64. package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
  65. package/dist/{start-643a55bb.esm.js → start-109f9462.esm.js} +8 -9
  66. package/dist/{start-47ea5e04.cjs.dev.js → start-7765f44c.cjs.dev.js} +8 -9
  67. package/dist/{start-84cdf12b.cjs.prod.js → start-e014127c.cjs.prod.js} +8 -9
  68. package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
  69. package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
  70. package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
  71. package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
  72. package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
  73. package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
  74. package/package.json +21 -11
  75. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  76. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  77. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  78. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
  79. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
  80. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
  81. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
  82. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
  83. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
  84. package/dist/login-9ee43381.esm.js +0 -223
@@ -1,14 +1,6 @@
1
- import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
2
- import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
3
- import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
4
- import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
5
- import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
6
1
  import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
7
2
  import chalk from 'chalk';
8
3
  import omit from 'lodash/omit';
9
- import prompts from 'prompts';
10
- import { sanitizeSvg, processConfig } from '@commercetools-frontend/application-config';
11
- import { C as CredentialsStorage } from './credentials-storage-7285d7b4.esm.js';
12
4
  import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
13
5
  import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
14
6
  import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
@@ -18,35 +10,26 @@ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
18
10
  import _repeatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/repeat';
19
11
  import _Set from '@babel/runtime-corejs3/core-js-stable/set';
20
12
  import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
13
+ import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
21
14
  import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
15
+ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
22
16
  import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
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-d8bc2292.esm.js';
24
- import '@babel/runtime-corejs3/helpers/classCallCheck';
25
- import '@babel/runtime-corejs3/helpers/createClass';
26
- import '@babel/runtime-corejs3/core-js-stable/date/now';
27
- import 'node:fs';
28
- import 'node:os';
29
- import 'node:path';
30
- import './does-file-exist-32618334.esm.js';
31
- import '@babel/runtime-corejs3/core-js-stable/instance/some';
32
- import 'graphql';
33
- import 'graphql-request';
34
- import '@commercetools-frontend/constants';
35
- import '@commercetools/http-user-agent';
36
- import './package-4bdd2ccf.esm.js';
17
+ import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
18
+ import { sanitizeSvg } from '@commercetools-frontend/application-config';
19
+ import { c as createCustomApplication, u as updateCustomApplication, a as createCustomView, b as updateCustomView, d as fetchCustomApplication, e as fetchCustomView } from './graphql-requests-d2fa2ca7.esm.js';
37
20
 
38
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; }
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; }
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; }
40
23
 
41
24
  // Since not all terminal supports colors, to make things more consistent for testing purposes,
42
25
  // during tests the color used is appended before the string instead of coloring it.
43
26
  const isTest = process.env.NODE_ENV === 'test';
44
27
  const red = str => {
45
- if (isTest) return "<color-red>".concat(str, "</color-red>");
28
+ if (isTest) return `<color-red>${str}</color-red>`;
46
29
  return chalk.red(str);
47
30
  };
48
31
  const green = str => {
49
- if (isTest) return "<color-green>".concat(str, "</color-green>");
32
+ if (isTest) return `<color-green>${str}</color-green>`;
50
33
  return chalk.green(str);
51
34
  };
52
35
 
@@ -62,21 +45,19 @@ const getStringDiff = _ref => {
62
45
  _ref$indentLevel = _ref.indentLevel,
63
46
  indentLevel = _ref$indentLevel === void 0 ? 0 : _ref$indentLevel;
64
47
  if (!previousValue && nextValue) {
65
- var _context2, _context3;
66
- return _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "".concat(indent(indentLevel))).call(_context3, label, " added: ")).call(_context2, green(nextValue));
48
+ return `${indent(indentLevel)}${label} added: ${green(nextValue)}`;
67
49
  }
68
50
  if (previousValue && !nextValue) {
69
- var _context4, _context5;
70
- return _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = "".concat(indent(indentLevel))).call(_context5, label, " removed: ")).call(_context4, red(previousValue));
51
+ return `${indent(indentLevel)}${label} removed: ${red(previousValue)}`;
71
52
  }
72
53
  if (previousValue && nextValue && previousValue !== nextValue) {
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));
54
+ return `${indent(indentLevel)}${label} changed: ${red(previousValue)} => ${green(nextValue)}`;
75
55
  }
76
56
  return null;
77
57
  };
78
58
  // NOTE: this assumes that the array values are scalar values (not objects).
79
59
  const getArrayDiff = _ref2 => {
60
+ var _context2, _context3;
80
61
  let previousValue = _ref2.previousValue,
81
62
  nextValue = _ref2.nextValue,
82
63
  label = _ref2.label,
@@ -84,7 +65,7 @@ const getArrayDiff = _ref2 => {
84
65
  indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
85
66
  const oldArraySet = new _Set(previousValue);
86
67
  const arrayDiff = [];
87
- nextValue === null || nextValue === void 0 || _forEachInstanceProperty(nextValue).call(nextValue, item => {
68
+ ((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty(_context3 = Function.call).call(_context3, _forEachInstanceProperty(_context2), _context2))?.(item => {
88
69
  if (oldArraySet.has(item)) {
89
70
  oldArraySet.delete(item);
90
71
  } else {
@@ -105,7 +86,7 @@ const getArrayDiff = _ref2 => {
105
86
  return arrayDiff.join('\n');
106
87
  };
107
88
  const getPermissionsDiff = _ref3 => {
108
- var _context1;
89
+ var _context4;
109
90
  let previousValue = _ref3.previousValue,
110
91
  nextValue = _ref3.nextValue;
111
92
  const permissionDiff = ['permissions changed'];
@@ -118,12 +99,10 @@ const getPermissionsDiff = _ref3 => {
118
99
  }, {});
119
100
  const indentLevel = 1;
120
101
  _forEachInstanceProperty(nextValue).call(nextValue, newPermission => {
121
- var _context9;
122
- const currentDiff = [_concatInstanceProperty(_context9 = "".concat(indent(indentLevel), "\"")).call(_context9, newPermission.name, "\" changed")];
102
+ const currentDiff = [`${indent(indentLevel)}"${newPermission.name}" changed`];
123
103
  // if the permission name is not in the old config, it means it is a new addition.
124
104
  if (!mappedOldPermissions[newPermission.name]) {
125
- var _context0;
126
- permissionDiff.push(_concatInstanceProperty(_context0 = "".concat(indent(indentLevel), "\"")).call(_context0, green(newPermission.name), "\" was added"));
105
+ permissionDiff.push(`${indent(indentLevel)}"${green(newPermission.name)}" was added`);
127
106
  }
128
107
 
129
108
  // if permission name is in the old config, now we check if there was a change
@@ -140,22 +119,21 @@ const getPermissionsDiff = _ref3 => {
140
119
  });
141
120
 
142
121
  // if there are old permissions left, it means they were deleted in the new Permissions.
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"));
122
+ _forEachInstanceProperty(_context4 = _Object$keys(mappedOldPermissions)).call(_context4, oldPermissionName => {
123
+ permissionDiff.push(`${indent(indentLevel)}"${red(oldPermissionName)}" was removed`);
146
124
  });
147
125
  if (permissionDiff.length > 1) return permissionDiff.join('\n');
148
126
  return null;
149
127
  };
150
128
  const getLabelAllLocalesDiff = _ref5 => {
151
- var _context14;
129
+ var _context5;
152
130
  let _ref5$previousValue = _ref5.previousValue,
153
131
  previousValue = _ref5$previousValue === void 0 ? [] : _ref5$previousValue,
154
132
  _ref5$nextValue = _ref5.nextValue,
155
133
  nextValue = _ref5$nextValue === void 0 ? [] : _ref5$nextValue,
156
134
  _ref5$indentLevel = _ref5.indentLevel,
157
135
  indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
158
- const labelAllLocalesDiff = ["".concat(indent(indentLevel - 1), "labelAllLocales changed")];
136
+ const labelAllLocalesDiff = [`${indent(indentLevel - 1)}labelAllLocales changed`];
159
137
  const mappedOldLabelAllLocales = _reduceInstanceProperty(previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
160
138
  let locale = _ref6.locale,
161
139
  value = _ref6.value;
@@ -167,8 +145,7 @@ const getLabelAllLocalesDiff = _ref5 => {
167
145
  if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
168
146
  const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
169
147
  if (oldLocaleValue !== newLabelAllLocale.value) {
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)));
148
+ labelAllLocalesDiff.push(`${indent(indentLevel)}locale "${newLabelAllLocale.locale}" changed: ${red(oldLocaleValue)} => ${green(newLabelAllLocale.value)}`);
172
149
  }
173
150
  delete mappedOldLabelAllLocales[newLabelAllLocale.locale];
174
151
  } else {
@@ -182,7 +159,7 @@ const getLabelAllLocalesDiff = _ref5 => {
182
159
  }
183
160
  }
184
161
  });
185
- _forEachInstanceProperty(_context14 = _Object$keys(mappedOldLabelAllLocales)).call(_context14, key => {
162
+ _forEachInstanceProperty(_context5 = _Object$keys(mappedOldLabelAllLocales)).call(_context5, key => {
186
163
  const localeDiff = getStringDiff({
187
164
  previousValue: key,
188
165
  label: 'locale',
@@ -196,14 +173,14 @@ const getLabelAllLocalesDiff = _ref5 => {
196
173
  return null;
197
174
  };
198
175
  const getTypeSettingsDiff = _ref7 => {
199
- var _context15;
176
+ var _context6;
200
177
  let previousValue = _ref7.previousValue,
201
178
  nextValue = _ref7.nextValue;
202
179
  const nonNullablePreviousValue = previousValue || {};
203
180
  const nonNullableNextValue = nextValue || {};
204
181
  const indentLevel = 1;
205
- const typeSettingsDiff = ["".concat(indent(indentLevel - 1), "type settings changed")];
206
- _forEachInstanceProperty(_context15 = _Object$keys(nonNullablePreviousValue)).call(_context15, key => {
182
+ const typeSettingsDiff = [`${indent(indentLevel - 1)}type settings changed`];
183
+ _forEachInstanceProperty(_context6 = _Object$keys(nonNullablePreviousValue)).call(_context6, key => {
207
184
  const typeSettingDiff = getStringDiff({
208
185
  previousValue: nonNullablePreviousValue[key],
209
186
  nextValue: nonNullableNextValue[key],
@@ -253,7 +230,7 @@ const getMainMenuLinkDiff = _ref9 => {
253
230
  indentLevel: 2
254
231
  });
255
232
  if (mainMenuLinkPermissionsDiff.length > 0) {
256
- mainMenuLinkDiff.push("".concat(indent(1), "permissions changed"));
233
+ mainMenuLinkDiff.push(`${indent(1)}permissions changed`);
257
234
  mainMenuLinkDiff.push(mainMenuLinkPermissionsDiff);
258
235
  }
259
236
  const menuLabelsDiff = getLabelAllLocalesDiff({
@@ -269,7 +246,7 @@ const getMainMenuLinkDiff = _ref9 => {
269
246
  return null;
270
247
  };
271
248
  const getSubmenuLinksDiff = _ref0 => {
272
- var _context20;
249
+ var _context8;
273
250
  let previousValue = _ref0.previousValue,
274
251
  nextValue = _ref0.nextValue;
275
252
  const submenuLinksDiff = ['submenuLink changed'];
@@ -280,17 +257,16 @@ const getSubmenuLinksDiff = _ref0 => {
280
257
  const previousOrder = getOrder(previousValue);
281
258
  const newOrder = getOrder(nextValue);
282
259
  if (previousOrder !== newOrder) {
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, "]"));
260
+ submenuLinksDiff.push(`${indent(1)}submenu order changed`);
261
+ submenuLinksDiff.push(`${indent(2)}previous order: [${previousOrder}]`);
262
+ submenuLinksDiff.push(`${indent(2)}new order: [${newOrder}]`);
287
263
  }
288
264
  _forEachInstanceProperty(nextValue).call(nextValue, newSubmenuLink => {
289
265
  const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
290
266
  if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
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 => {
267
+ var _context7;
268
+ const submenuLinkDiff = [`${indent(1)}menu link "${newSubmenuLink.uriPath}" changed`];
269
+ _forEachInstanceProperty(_context7 = _Object$keys(mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context7, key => {
294
270
  switch (key) {
295
271
  case 'defaultLabel':
296
272
  {
@@ -314,7 +290,7 @@ const getSubmenuLinksDiff = _ref0 => {
314
290
  indentLevel: 3
315
291
  });
316
292
  if (submenuLinkPermissionsDiff.length > 0) {
317
- submenuLinkDiff.push("".concat(indent(2), "permissions changed"));
293
+ submenuLinkDiff.push(`${indent(2)}permissions changed`);
318
294
  submenuLinkDiff.push(submenuLinkPermissionsDiff);
319
295
  }
320
296
  break;
@@ -349,7 +325,7 @@ const getSubmenuLinksDiff = _ref0 => {
349
325
  }
350
326
  }
351
327
  });
352
- _forEachInstanceProperty(_context20 = _Object$keys(mappedSubmenuLinks)).call(_context20, key => {
328
+ _forEachInstanceProperty(_context8 = _Object$keys(mappedSubmenuLinks)).call(_context8, key => {
353
329
  const linksDiff = getStringDiff({
354
330
  previousValue: key,
355
331
  label: 'menu link',
@@ -522,319 +498,206 @@ const getCustomViewConfigDiff = (oldConfig, newConfig) => {
522
498
  return diff.join('\n');
523
499
  };
524
500
 
525
- const credentialsStorage = new CredentialsStorage();
526
501
  const getMcUrlLink = _ref => {
527
- var _context, _context2, _context3;
528
502
  let mcApiUrl = _ref.mcApiUrl,
529
503
  organizationId = _ref.organizationId,
530
504
  customEntityId = _ref.customEntityId,
531
505
  isCustomView = _ref.isCustomView;
532
506
  const mcUrl = mcApiUrl.replace('mc-api', 'mc');
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);
507
+ const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}`;
534
508
  return customEntityLink;
535
509
  };
536
510
  const isCustomViewData = data => data.entryPointUriPath === undefined;
537
- async function createOrUpdateCustomApplication(_ref2) {
538
- var _context6;
511
+ async function performCreateCustomApplication(_ref2) {
539
512
  let mcApiUrl = _ref2.mcApiUrl,
513
+ organizationId = _ref2.organizationId,
514
+ organizationName = _ref2.organizationName,
540
515
  localCustomEntityData = _ref2.localCustomEntityData,
541
516
  applicationIdentifier = _ref2.applicationIdentifier,
542
- options = _ref2.options;
543
- const fetchedCustomApplication = await fetchCustomApplication({
517
+ dryRun = _ref2.dryRun;
518
+ console.log(`Creating Custom Application in organization "${chalk.green(organizationName)}"...`);
519
+ const data = omit(localCustomEntityData, ['id']);
520
+ if (dryRun) {
521
+ console.log();
522
+ console.log('Dry run - would create Custom Application with:');
523
+ console.log(chalk.gray(_JSON$stringify(data, null, 2)));
524
+ return null;
525
+ }
526
+ const createdCustomApplication = await createCustomApplication({
544
527
  mcApiUrl,
545
- entryPointUriPath: localCustomEntityData.entryPointUriPath,
528
+ organizationId,
529
+ data,
546
530
  applicationIdentifier
547
531
  });
548
- if (!fetchedCustomApplication) {
549
- var _context5;
550
- const userOrganizations = await fetchUserOrganizations({
551
- mcApiUrl,
552
- applicationIdentifier
553
- });
554
- let organizationId, organizationName;
555
- if (userOrganizations.total === 0) {
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.");
557
- }
558
- if (userOrganizations.total === 1) {
559
- const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
560
- organization = _userOrganizations$re[0];
561
- organizationId = organization.id;
562
- organizationName = organization.name;
563
- } else {
564
- var _context4;
565
- const organizationChoices = _mapInstanceProperty(_context4 = userOrganizations.results).call(_context4, organization => ({
566
- title: organization.name,
567
- value: organization.id
568
- }));
569
- const _await$prompts = await prompts({
570
- type: 'select',
571
- name: 'organizationId',
572
- message: 'Select an Organization',
573
- choices: organizationChoices,
574
- initial: 0
575
- }),
576
- selectedOrganizationId = _await$prompts.organizationId;
577
- if (!selectedOrganizationId) {
578
- throw new Error("No Organization selected, aborting.");
579
- }
580
- organizationId = selectedOrganizationId;
581
- organizationName = _findInstanceProperty(organizationChoices).call(organizationChoices, _ref3 => {
582
- let value = _ref3.value;
583
- return value === organizationId;
584
- }).title;
585
- }
586
- const _await$prompts2 = await prompts({
587
- type: 'text',
588
- name: 'confirmation',
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'),
590
- initial: 'yes'
591
- }),
592
- confirmation = _await$prompts2.confirmation;
593
- if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
594
- console.log(chalk.red('Aborted.'));
595
- return;
596
- }
597
- const data = omit(localCustomEntityData, ['id']);
598
- if (options.dryRun) {
599
- console.log();
600
- console.log("The following payload would be used to create a new Custom Application.");
601
- console.log();
602
- console.log(chalk.gray(_JSON$stringify(data, null, 2)));
603
- return;
604
- }
605
- const createdCustomApplication = await createCustomApplication({
606
- mcApiUrl,
607
- organizationId,
608
- data,
609
- applicationIdentifier
610
- });
611
-
612
- // This check is technically not necessary, as the `graphql-request` client
613
- // throws an error in case of GraphQL errors.
614
- // However, the generated TypeScript data related to the GraphQL query has the
615
- // field typed as optional, thus having an extra check for type correctness.
616
- if (!createdCustomApplication) {
617
- throw new Error('Failed to create the Custom Application.');
618
- }
619
- const customAppLink = getMcUrlLink({
620
- mcApiUrl,
621
- organizationId,
622
- customEntityId: createdCustomApplication.id
623
- });
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), "\"."));
626
- return;
532
+ if (!createdCustomApplication) {
533
+ throw new Error('Failed to create the Custom Application.');
627
534
  }
628
535
  const customAppLink = getMcUrlLink({
629
536
  mcApiUrl,
630
- organizationId: fetchedCustomApplication.organizationId,
631
- customEntityId: fetchedCustomApplication.application.id
632
- });
633
- const configDiff = getCustomApplicationConfigDiff(fetchedCustomApplication.application, localCustomEntityData);
634
- if (!configDiff) {
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), "\"."));
637
- return;
638
- }
639
- console.log('Changes detected:');
640
- console.log(configDiff);
641
- console.log();
642
- const _await$prompts3 = await prompts({
643
- type: 'text',
644
- name: 'confirmation',
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'),
646
- initial: 'yes'
647
- }),
648
- confirmation = _await$prompts3.confirmation;
649
- if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
650
- console.log(chalk.red('Aborted.'));
651
- return;
652
- }
537
+ organizationId,
538
+ customEntityId: createdCustomApplication.id
539
+ });
540
+ console.log(chalk.green('Custom Application created successfully.'));
541
+ console.log(`ID: ${chalk.cyan(createdCustomApplication.id)}`);
542
+ console.log(`Please update the "env.production.applicationId" field in your local Custom Application config file with the ID above.`);
543
+ console.log(`URL: ${chalk.gray(customAppLink)}`);
544
+ return createdCustomApplication.id;
545
+ }
546
+ async function performUpdateCustomApplication(_ref3) {
547
+ let mcApiUrl = _ref3.mcApiUrl,
548
+ organizationId = _ref3.organizationId,
549
+ applicationId = _ref3.applicationId,
550
+ localCustomEntityData = _ref3.localCustomEntityData,
551
+ applicationIdentifier = _ref3.applicationIdentifier,
552
+ dryRun = _ref3.dryRun;
653
553
  const data = omit(localCustomEntityData, ['id']);
654
- if (options.dryRun) {
655
- console.log();
656
- console.log("The following payload would be used to update the Custom Application \"".concat(chalk.green(data.entryPointUriPath), "\"."));
554
+ if (dryRun) {
657
555
  console.log();
556
+ console.log(`Dry run - would update Custom Application "${chalk.green(data.entryPointUriPath)}" with:`);
658
557
  console.log(chalk.gray(_JSON$stringify(data, null, 2)));
659
558
  return;
660
559
  }
560
+ console.log('Updating Custom Application...');
661
561
  await updateCustomApplication({
662
562
  mcApiUrl,
663
- organizationId: fetchedCustomApplication.organizationId,
664
- data: omit(localCustomEntityData, ['id']),
665
- applicationId: fetchedCustomApplication.application.id,
563
+ organizationId,
564
+ data,
565
+ applicationId,
666
566
  applicationIdentifier
667
567
  });
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), "\"."));
568
+ const customAppLink = getMcUrlLink({
569
+ mcApiUrl,
570
+ organizationId,
571
+ customEntityId: applicationId
572
+ });
573
+ console.log(chalk.green('Custom Application updated successfully.'));
574
+ console.log(`URL: ${chalk.gray(customAppLink)}`);
670
575
  }
671
- async function createOrUpdateCustomView(_ref4) {
672
- var _fetchedCustomView$cu, _context9, _fetchedCustomView$cu2;
576
+ async function performCreateCustomView(_ref4) {
673
577
  let mcApiUrl = _ref4.mcApiUrl,
578
+ organizationId = _ref4.organizationId,
579
+ organizationName = _ref4.organizationName,
674
580
  localCustomEntityData = _ref4.localCustomEntityData,
675
- customViewId = _ref4.customViewId,
676
- options = _ref4.options,
677
- applicationIdentifier = _ref4.applicationIdentifier;
678
- const fetchedCustomView = await fetchCustomView({
581
+ applicationIdentifier = _ref4.applicationIdentifier,
582
+ dryRun = _ref4.dryRun;
583
+ console.log(`Creating Custom View in organization "${chalk.green(organizationName)}"...`);
584
+ const data = omit(localCustomEntityData, ['id']);
585
+ if (dryRun) {
586
+ console.log();
587
+ console.log('Dry run - would create Custom View with:');
588
+ console.log(chalk.gray(_JSON$stringify(data, null, 2)));
589
+ return null;
590
+ }
591
+ const createdCustomView = await createCustomView({
679
592
  mcApiUrl,
680
- customViewId,
593
+ organizationId,
594
+ data,
681
595
  applicationIdentifier
682
596
  });
683
- if (!fetchedCustomView) {
684
- var _context8;
685
- const userOrganizations = await fetchUserOrganizations({
686
- mcApiUrl,
687
- customViewId,
688
- applicationIdentifier
689
- });
690
- let organizationId, organizationName;
691
- if (userOrganizations.total === 0) {
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.");
693
- }
694
- if (userOrganizations.total === 1) {
695
- const _userOrganizations$re2 = _slicedToArray(userOrganizations.results, 1),
696
- organization = _userOrganizations$re2[0];
697
- organizationId = organization.id;
698
- organizationName = organization.name;
699
- } else {
700
- var _context7;
701
- const organizationChoices = _mapInstanceProperty(_context7 = userOrganizations.results).call(_context7, organization => ({
702
- title: organization.name,
703
- value: organization.id
704
- }));
705
- const _await$prompts4 = await prompts({
706
- type: 'select',
707
- name: 'organizationId',
708
- message: 'Select an Organization',
709
- choices: organizationChoices,
710
- initial: 0
711
- }),
712
- selectedOrganizationId = _await$prompts4.organizationId;
713
- if (!selectedOrganizationId) {
714
- throw new Error("No Organization selected, aborting.");
715
- }
716
- organizationId = selectedOrganizationId;
717
- organizationName = _findInstanceProperty(organizationChoices).call(organizationChoices, _ref5 => {
718
- let value = _ref5.value;
719
- return value === organizationId;
720
- }).title;
721
- }
722
- const _await$prompts5 = await prompts({
723
- type: 'text',
724
- name: 'confirmation',
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'),
726
- initial: 'yes'
727
- }),
728
- confirmation = _await$prompts5.confirmation;
729
- if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
730
- console.log(chalk.red('Aborted.'));
731
- return;
732
- }
733
- const data = omit(localCustomEntityData, ['id']);
734
- if (options.dryRun) {
735
- console.log();
736
- console.log("The following payload would be used to create a new Custom View.");
737
- console.log();
738
- console.log(chalk.gray(_JSON$stringify(data, null, 2)));
739
- return;
740
- }
741
- const createdCustomView = await createCustomView({
742
- mcApiUrl,
743
- organizationId,
744
- data,
745
- applicationIdentifier
746
- });
747
-
748
- // This check is technically not necessary, as the `graphql-request` client
749
- // throws an error in case of GraphQL errors.
750
- // However, the generated TypeScript data related to the GraphQL query has the
751
- // field typed as optional, thus having an extra check for type correctness.
752
- if (!createdCustomView) {
753
- throw new Error('Failed to create the Custom View.');
754
- }
755
- const customViewLink = getMcUrlLink({
756
- mcApiUrl,
757
- organizationId,
758
- customEntityId: createdCustomView.id,
759
- isCustomView: true
760
- });
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), "\"."));
763
- return;
597
+ if (!createdCustomView) {
598
+ throw new Error('Failed to create the Custom View.');
764
599
  }
765
600
  const customViewLink = getMcUrlLink({
766
601
  mcApiUrl,
767
- organizationId: fetchedCustomView.organizationId,
768
- customEntityId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu = fetchedCustomView.customView) === null || _fetchedCustomView$cu === void 0 ? void 0 : _fetchedCustomView$cu.id) || '',
602
+ organizationId,
603
+ customEntityId: createdCustomView.id,
769
604
  isCustomView: true
770
605
  });
771
- const configDiff = getCustomViewConfigDiff(fetchedCustomView.customView, localCustomEntityData);
772
- if (!configDiff) {
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), "\"."));
775
- return;
776
- }
777
- console.log('Changes detected:');
778
- console.log(configDiff);
779
- console.log();
780
- const _await$prompts6 = await prompts({
781
- type: 'text',
782
- name: 'confirmation',
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'),
784
- initial: 'yes'
785
- }),
786
- confirmation = _await$prompts6.confirmation;
787
- if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
788
- console.log(chalk.red('Aborted.'));
789
- return;
790
- }
606
+ console.log(chalk.green('Custom View created successfully.'));
607
+ console.log(`ID: ${chalk.cyan(createdCustomView.id)}`);
608
+ console.log(`Please update the "env.production.customViewId" field in your local Custom View config file with the ID above.`);
609
+ console.log(`URL: ${chalk.gray(customViewLink)}`);
610
+ return createdCustomView.id;
611
+ }
612
+ async function performUpdateCustomView(_ref5) {
613
+ let mcApiUrl = _ref5.mcApiUrl,
614
+ organizationId = _ref5.organizationId,
615
+ customViewId = _ref5.customViewId,
616
+ localCustomEntityData = _ref5.localCustomEntityData,
617
+ applicationIdentifier = _ref5.applicationIdentifier,
618
+ dryRun = _ref5.dryRun;
791
619
  const data = omit(localCustomEntityData, ['id']);
792
- if (options.dryRun) {
793
- console.log();
794
- console.log("The following payload would be used to update the Custom View \"".concat(chalk.green(data.defaultLabel), "\"."));
620
+ if (dryRun) {
795
621
  console.log();
622
+ console.log(`Dry run - would update Custom View "${chalk.green(data.defaultLabel)}" with:`);
796
623
  console.log(chalk.gray(_JSON$stringify(data, null, 2)));
797
624
  return;
798
625
  }
626
+ console.log('Updating Custom View...');
799
627
  await updateCustomView({
800
628
  mcApiUrl,
801
- organizationId: fetchedCustomView.organizationId,
802
- data: omit(localCustomEntityData, ['id']),
803
- customViewId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu2 = fetchedCustomView.customView) === null || _fetchedCustomView$cu2 === void 0 ? void 0 : _fetchedCustomView$cu2.id) || '',
629
+ organizationId,
630
+ data,
631
+ customViewId,
804
632
  applicationIdentifier
805
633
  });
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), "\"."));
634
+ const customViewLink = getMcUrlLink({
635
+ mcApiUrl,
636
+ organizationId,
637
+ customEntityId: customViewId,
638
+ isCustomView: true
639
+ });
640
+ console.log(chalk.green('Custom View updated successfully.'));
641
+ console.log(`URL: ${chalk.gray(customViewLink)}`);
808
642
  }
809
- async function run(options) {
810
- const applicationConfig = await processConfig();
811
- const localCustomEntityData = applicationConfig.data;
812
- const _applicationConfig$en = applicationConfig.env,
813
- mcApiUrl = _applicationConfig$en.mcApiUrl,
814
- applicationIdentifier = _applicationConfig$en.applicationIdentifier,
815
- customViewId = _applicationConfig$en.customViewId;
816
- console.log("Using Merchant Center environment \"".concat(chalk.green(mcApiUrl), "\"."));
817
- console.log();
818
- const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
819
- if (!isSessionValid) {
820
- throw new Error("You don't have a valid session. Please, run the \"mc-scripts login\" command to authenticate yourself.");
643
+ async function checkCustomApplicationStatus(_ref6) {
644
+ let mcApiUrl = _ref6.mcApiUrl,
645
+ entryPointUriPath = _ref6.entryPointUriPath,
646
+ applicationIdentifier = _ref6.applicationIdentifier,
647
+ localCustomEntityData = _ref6.localCustomEntityData;
648
+ const fetchedCustomApplication = await fetchCustomApplication({
649
+ mcApiUrl,
650
+ entryPointUriPath,
651
+ applicationIdentifier
652
+ });
653
+ if (!fetchedCustomApplication) {
654
+ return {
655
+ exists: false
656
+ };
821
657
  }
822
- if (isCustomViewData(localCustomEntityData)) {
823
- createOrUpdateCustomView({
824
- mcApiUrl,
825
- localCustomEntityData,
826
- applicationIdentifier,
827
- customViewId: customViewId || localCustomEntityData.id,
828
- options
829
- });
830
- } else {
831
- createOrUpdateCustomApplication({
832
- mcApiUrl,
833
- localCustomEntityData,
834
- applicationIdentifier,
835
- options
836
- });
658
+ const configDiff = getCustomApplicationConfigDiff(fetchedCustomApplication.application, localCustomEntityData);
659
+ const customAppLink = getMcUrlLink({
660
+ mcApiUrl,
661
+ organizationId: fetchedCustomApplication.organizationId,
662
+ customEntityId: fetchedCustomApplication.application.id
663
+ });
664
+ return {
665
+ exists: true,
666
+ organizationId: fetchedCustomApplication.organizationId,
667
+ applicationId: fetchedCustomApplication.application.id,
668
+ configDiff,
669
+ link: customAppLink
670
+ };
671
+ }
672
+ async function checkCustomViewStatus(_ref7) {
673
+ let mcApiUrl = _ref7.mcApiUrl,
674
+ customViewId = _ref7.customViewId,
675
+ applicationIdentifier = _ref7.applicationIdentifier,
676
+ localCustomEntityData = _ref7.localCustomEntityData;
677
+ const fetchedCustomView = await fetchCustomView({
678
+ mcApiUrl,
679
+ customViewId,
680
+ applicationIdentifier
681
+ });
682
+ if (!fetchedCustomView) {
683
+ return {
684
+ exists: false
685
+ };
837
686
  }
687
+ const configDiff = getCustomViewConfigDiff(fetchedCustomView.customView, localCustomEntityData);
688
+ const customViewLink = getMcUrlLink({
689
+ mcApiUrl,
690
+ organizationId: fetchedCustomView.organizationId,
691
+ customEntityId: fetchedCustomView?.customView?.id || '',
692
+ isCustomView: true
693
+ });
694
+ return {
695
+ exists: true,
696
+ organizationId: fetchedCustomView.organizationId,
697
+ customViewId: fetchedCustomView?.customView?.id || '',
698
+ configDiff,
699
+ link: customViewLink
700
+ };
838
701
  }
839
702
 
840
- export { run as default };
703
+ export { performUpdateCustomApplication as a, checkCustomViewStatus as b, checkCustomApplicationStatus as c, performCreateCustomView as d, performUpdateCustomView as e, isCustomViewData as i, performCreateCustomApplication as p };