@commercetools-frontend/application-shell-connectors 21.11.0 → 21.13.1
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/dist/commercetools-frontend-application-shell-connectors.cjs.dev.js +49 -47
- package/dist/commercetools-frontend-application-shell-connectors.cjs.prod.js +49 -47
- package/dist/commercetools-frontend-application-shell-connectors.esm.js +47 -46
- package/dist/declarations/src/components/application-context/application-context.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/types/generated/settings.d.ts +108 -84
- package/dist/declarations/src/utils/get-mc-api-url/get-mc-api-url.d.ts +1 -3
- package/package.json +3 -3
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
6
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
5
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
8
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
9
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -17,10 +19,8 @@ var moment = require('moment-timezone');
|
|
|
17
19
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
18
20
|
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
19
21
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
20
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
21
22
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
22
23
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
23
|
-
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
24
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
25
|
var warning = require('tiny-warning');
|
|
26
26
|
var react$1 = require('@apollo/client/react');
|
|
@@ -29,6 +29,8 @@ var sentry = require('@commercetools-frontend/sentry');
|
|
|
29
29
|
|
|
30
30
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
31
31
|
|
|
32
|
+
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
33
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
32
34
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
33
35
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
34
36
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -40,14 +42,53 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
40
42
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
41
43
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
42
44
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
43
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
44
45
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
45
46
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
46
|
-
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
47
47
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
48
48
|
|
|
49
49
|
// NOTE: This string will be replaced on build time with the package version.
|
|
50
|
-
var version = "21.
|
|
50
|
+
var version = "21.13.1";
|
|
51
|
+
|
|
52
|
+
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
53
|
+
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
54
|
+
|
|
55
|
+
var getMcOriginTld = function getMcOriginTld(host) {
|
|
56
|
+
if (host.match(mcPreviewHostnameRegex)) {
|
|
57
|
+
return host.replace(mcPreviewHostnameRegex, '$1');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return host.replace(mcHostnameRegex, '$3');
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(origin) {
|
|
64
|
+
var _context;
|
|
65
|
+
|
|
66
|
+
var url = new _URL__default["default"](origin);
|
|
67
|
+
var originTld = getMcOriginTld(url.host);
|
|
68
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var parseAsBoolean = function parseAsBoolean(value) {
|
|
72
|
+
return value === true || value === 'true';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function getMcApiUrl() {
|
|
76
|
+
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.app;
|
|
77
|
+
var origin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.origin;
|
|
78
|
+
var isServedByProxy = parseAsBoolean(environment.servedByProxy);
|
|
79
|
+
/**
|
|
80
|
+
* Prefer using the origin URL for the MC API based on the origin value
|
|
81
|
+
* of the browser's `window.location`.
|
|
82
|
+
* This ensures that the application always uses the correct URL associated
|
|
83
|
+
* with that environment, instead of relying on the config value.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
if (isServedByProxy) {
|
|
87
|
+
return getMcApiUrlFromOrigin(origin);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return environment.mcApiUrl;
|
|
91
|
+
}
|
|
51
92
|
|
|
52
93
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
53
94
|
var getDisplayName = function getDisplayName(Component) {
|
|
@@ -202,45 +243,6 @@ var normalizeAllAppliedDataFences = function normalizeAllAppliedDataFences(allAp
|
|
|
202
243
|
return null;
|
|
203
244
|
};
|
|
204
245
|
|
|
205
|
-
var removeMcPrefix = function removeMcPrefix(host) {
|
|
206
|
-
return host.replace(/^mc(-(\d){4,})?\.(.*)$/, '$3');
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* NOTE:
|
|
210
|
-
* Given the Merchant Center or Custom Application runs behind the proxy
|
|
211
|
-
* then the `mcApiUrl` should be build using the origin on the window.
|
|
212
|
-
*
|
|
213
|
-
* This allows the Merchant Center (or any Custom Appliction) to automatically
|
|
214
|
-
* use an `mcApiUrl` which matches the respective url of the deployment.
|
|
215
|
-
*
|
|
216
|
-
* This is particularily useful with the new and old hostnames for the Merchant Center.
|
|
217
|
-
* When using the origin, it will be made sure that the authorization cookie will
|
|
218
|
-
* always be sent as the appropriate API url is used.
|
|
219
|
-
*
|
|
220
|
-
* 1. MC: mc.commercetools.com with API: mc-api.europe-west1.gcp.commercetools.com
|
|
221
|
-
* -> Will not work as urls differ
|
|
222
|
-
* 2. MC: mc.europe-west1.gcp.commercetools.com with API: mc-api.commercetools.com
|
|
223
|
-
* -> Will not work as urls differ
|
|
224
|
-
*
|
|
225
|
-
* Using the origin ensures that urls always match with the cookie sent. Otherwise,
|
|
226
|
-
* the application shell will rightfully redirect to the logout page.
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(partialWindow) {
|
|
231
|
-
var _context;
|
|
232
|
-
|
|
233
|
-
var url = new _URL__default["default"](partialWindow.origin);
|
|
234
|
-
var originTld = removeMcPrefix(url.host);
|
|
235
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
function getMcApiUrl(environment, partialWindow) {
|
|
239
|
-
var isServedByProxy = environment.servedByProxy;
|
|
240
|
-
if (isServedByProxy && partialWindow.origin) return getMcApiUrlFromOrigin(partialWindow);
|
|
241
|
-
return environment.mcApiUrl;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
246
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
245
247
|
|
|
246
248
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
@@ -264,11 +266,10 @@ var mapUserToApplicationContextUser = function mapUserToApplicationContextUser(u
|
|
|
264
266
|
};
|
|
265
267
|
}; // Adjust certain fields which depend e.g. on the origin
|
|
266
268
|
|
|
267
|
-
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment) {
|
|
268
|
-
var partialWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
|
269
|
+
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment, origin) {
|
|
269
270
|
return _objectSpread$1(_objectSpread$1({}, environment), {}, {
|
|
270
271
|
// NOTE: The `mcApiUrl` depends on `servedByProxy`
|
|
271
|
-
mcApiUrl: getMcApiUrl(environment,
|
|
272
|
+
mcApiUrl: getMcApiUrl(environment, origin)
|
|
272
273
|
});
|
|
273
274
|
}; // Expose only certain fields as some of them are only meant to
|
|
274
275
|
// be used internally in the AppShell
|
|
@@ -456,6 +457,7 @@ exports.ApplicationContextProvider = ApplicationContextProvider;
|
|
|
456
457
|
exports.Context = Context$1;
|
|
457
458
|
exports.GetProjectExtensionImageRegex = GetProjectExtensionImageRegex;
|
|
458
459
|
exports.ProjectExtensionProviderForImageRegex = ProjectExtensionProviderForImageRegex;
|
|
460
|
+
exports.getMcApiUrl = getMcApiUrl;
|
|
459
461
|
exports.normalizeAllAppliedActionRights = normalizeAllAppliedActionRights;
|
|
460
462
|
exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
|
|
461
463
|
exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
6
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
5
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
8
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
9
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -17,10 +19,8 @@ var moment = require('moment-timezone');
|
|
|
17
19
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
18
20
|
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
19
21
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
20
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
21
22
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
22
23
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
23
|
-
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
24
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
25
|
require('tiny-warning');
|
|
26
26
|
var react$1 = require('@apollo/client/react');
|
|
@@ -29,6 +29,8 @@ var sentry = require('@commercetools-frontend/sentry');
|
|
|
29
29
|
|
|
30
30
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
31
31
|
|
|
32
|
+
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
33
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
32
34
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
33
35
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
34
36
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -39,13 +41,52 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
39
41
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
42
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
41
43
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
42
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
43
44
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
44
45
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
45
|
-
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
46
46
|
|
|
47
47
|
// NOTE: This string will be replaced on build time with the package version.
|
|
48
|
-
var version = "21.
|
|
48
|
+
var version = "21.13.1";
|
|
49
|
+
|
|
50
|
+
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
51
|
+
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
52
|
+
|
|
53
|
+
var getMcOriginTld = function getMcOriginTld(host) {
|
|
54
|
+
if (host.match(mcPreviewHostnameRegex)) {
|
|
55
|
+
return host.replace(mcPreviewHostnameRegex, '$1');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return host.replace(mcHostnameRegex, '$3');
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(origin) {
|
|
62
|
+
var _context;
|
|
63
|
+
|
|
64
|
+
var url = new _URL__default["default"](origin);
|
|
65
|
+
var originTld = getMcOriginTld(url.host);
|
|
66
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var parseAsBoolean = function parseAsBoolean(value) {
|
|
70
|
+
return value === true || value === 'true';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
function getMcApiUrl() {
|
|
74
|
+
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.app;
|
|
75
|
+
var origin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.origin;
|
|
76
|
+
var isServedByProxy = parseAsBoolean(environment.servedByProxy);
|
|
77
|
+
/**
|
|
78
|
+
* Prefer using the origin URL for the MC API based on the origin value
|
|
79
|
+
* of the browser's `window.location`.
|
|
80
|
+
* This ensures that the application always uses the correct URL associated
|
|
81
|
+
* with that environment, instead of relying on the config value.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
if (isServedByProxy) {
|
|
85
|
+
return getMcApiUrlFromOrigin(origin);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return environment.mcApiUrl;
|
|
89
|
+
}
|
|
49
90
|
|
|
50
91
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
51
92
|
var getDisplayName = function getDisplayName(Component) {
|
|
@@ -200,45 +241,6 @@ var normalizeAllAppliedDataFences = function normalizeAllAppliedDataFences(allAp
|
|
|
200
241
|
return null;
|
|
201
242
|
};
|
|
202
243
|
|
|
203
|
-
var removeMcPrefix = function removeMcPrefix(host) {
|
|
204
|
-
return host.replace(/^mc(-(\d){4,})?\.(.*)$/, '$3');
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* NOTE:
|
|
208
|
-
* Given the Merchant Center or Custom Application runs behind the proxy
|
|
209
|
-
* then the `mcApiUrl` should be build using the origin on the window.
|
|
210
|
-
*
|
|
211
|
-
* This allows the Merchant Center (or any Custom Appliction) to automatically
|
|
212
|
-
* use an `mcApiUrl` which matches the respective url of the deployment.
|
|
213
|
-
*
|
|
214
|
-
* This is particularily useful with the new and old hostnames for the Merchant Center.
|
|
215
|
-
* When using the origin, it will be made sure that the authorization cookie will
|
|
216
|
-
* always be sent as the appropriate API url is used.
|
|
217
|
-
*
|
|
218
|
-
* 1. MC: mc.commercetools.com with API: mc-api.europe-west1.gcp.commercetools.com
|
|
219
|
-
* -> Will not work as urls differ
|
|
220
|
-
* 2. MC: mc.europe-west1.gcp.commercetools.com with API: mc-api.commercetools.com
|
|
221
|
-
* -> Will not work as urls differ
|
|
222
|
-
*
|
|
223
|
-
* Using the origin ensures that urls always match with the cookie sent. Otherwise,
|
|
224
|
-
* the application shell will rightfully redirect to the logout page.
|
|
225
|
-
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(partialWindow) {
|
|
229
|
-
var _context;
|
|
230
|
-
|
|
231
|
-
var url = new _URL__default["default"](partialWindow.origin);
|
|
232
|
-
var originTld = removeMcPrefix(url.host);
|
|
233
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
function getMcApiUrl(environment, partialWindow) {
|
|
237
|
-
var isServedByProxy = environment.servedByProxy;
|
|
238
|
-
if (isServedByProxy && partialWindow.origin) return getMcApiUrlFromOrigin(partialWindow);
|
|
239
|
-
return environment.mcApiUrl;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
244
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
243
245
|
|
|
244
246
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
@@ -262,11 +264,10 @@ var mapUserToApplicationContextUser = function mapUserToApplicationContextUser(u
|
|
|
262
264
|
};
|
|
263
265
|
}; // Adjust certain fields which depend e.g. on the origin
|
|
264
266
|
|
|
265
|
-
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment) {
|
|
266
|
-
var partialWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
|
267
|
+
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment, origin) {
|
|
267
268
|
return _objectSpread$1(_objectSpread$1({}, environment), {}, {
|
|
268
269
|
// NOTE: The `mcApiUrl` depends on `servedByProxy`
|
|
269
|
-
mcApiUrl: getMcApiUrl(environment,
|
|
270
|
+
mcApiUrl: getMcApiUrl(environment, origin)
|
|
270
271
|
});
|
|
271
272
|
}; // Expose only certain fields as some of them are only meant to
|
|
272
273
|
// be used internally in the AppShell
|
|
@@ -443,6 +444,7 @@ exports.ApplicationContextProvider = ApplicationContextProvider;
|
|
|
443
444
|
exports.Context = Context$1;
|
|
444
445
|
exports.GetProjectExtensionImageRegex = GetProjectExtensionImageRegex;
|
|
445
446
|
exports.ProjectExtensionProviderForImageRegex = ProjectExtensionProviderForImageRegex;
|
|
447
|
+
exports.getMcApiUrl = getMcApiUrl;
|
|
446
448
|
exports.normalizeAllAppliedActionRights = normalizeAllAppliedActionRights;
|
|
447
449
|
exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
|
|
448
450
|
exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _URL from '@babel/runtime-corejs3/core-js-stable/url';
|
|
2
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
1
3
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
2
4
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
3
5
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -13,10 +15,8 @@ import moment from 'moment-timezone';
|
|
|
13
15
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
14
16
|
import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
|
|
15
17
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
16
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
17
18
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
18
19
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
19
|
-
import _URL from '@babel/runtime-corejs3/core-js-stable/url';
|
|
20
20
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
21
21
|
import warning from 'tiny-warning';
|
|
22
22
|
import { useQuery } from '@apollo/client/react';
|
|
@@ -24,7 +24,48 @@ import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
|
24
24
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
25
25
|
|
|
26
26
|
// NOTE: This string will be replaced on build time with the package version.
|
|
27
|
-
var version = "21.
|
|
27
|
+
var version = "21.13.1";
|
|
28
|
+
|
|
29
|
+
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
30
|
+
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
31
|
+
|
|
32
|
+
var getMcOriginTld = function getMcOriginTld(host) {
|
|
33
|
+
if (host.match(mcPreviewHostnameRegex)) {
|
|
34
|
+
return host.replace(mcPreviewHostnameRegex, '$1');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return host.replace(mcHostnameRegex, '$3');
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(origin) {
|
|
41
|
+
var _context;
|
|
42
|
+
|
|
43
|
+
var url = new _URL(origin);
|
|
44
|
+
var originTld = getMcOriginTld(url.host);
|
|
45
|
+
return _concatInstanceProperty(_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var parseAsBoolean = function parseAsBoolean(value) {
|
|
49
|
+
return value === true || value === 'true';
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
function getMcApiUrl() {
|
|
53
|
+
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.app;
|
|
54
|
+
var origin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.origin;
|
|
55
|
+
var isServedByProxy = parseAsBoolean(environment.servedByProxy);
|
|
56
|
+
/**
|
|
57
|
+
* Prefer using the origin URL for the MC API based on the origin value
|
|
58
|
+
* of the browser's `window.location`.
|
|
59
|
+
* This ensures that the application always uses the correct URL associated
|
|
60
|
+
* with that environment, instead of relying on the config value.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
if (isServedByProxy) {
|
|
64
|
+
return getMcApiUrlFromOrigin(origin);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return environment.mcApiUrl;
|
|
68
|
+
}
|
|
28
69
|
|
|
29
70
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
30
71
|
var getDisplayName = function getDisplayName(Component) {
|
|
@@ -179,45 +220,6 @@ var normalizeAllAppliedDataFences = function normalizeAllAppliedDataFences(allAp
|
|
|
179
220
|
return null;
|
|
180
221
|
};
|
|
181
222
|
|
|
182
|
-
var removeMcPrefix = function removeMcPrefix(host) {
|
|
183
|
-
return host.replace(/^mc(-(\d){4,})?\.(.*)$/, '$3');
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* NOTE:
|
|
187
|
-
* Given the Merchant Center or Custom Application runs behind the proxy
|
|
188
|
-
* then the `mcApiUrl` should be build using the origin on the window.
|
|
189
|
-
*
|
|
190
|
-
* This allows the Merchant Center (or any Custom Appliction) to automatically
|
|
191
|
-
* use an `mcApiUrl` which matches the respective url of the deployment.
|
|
192
|
-
*
|
|
193
|
-
* This is particularily useful with the new and old hostnames for the Merchant Center.
|
|
194
|
-
* When using the origin, it will be made sure that the authorization cookie will
|
|
195
|
-
* always be sent as the appropriate API url is used.
|
|
196
|
-
*
|
|
197
|
-
* 1. MC: mc.commercetools.com with API: mc-api.europe-west1.gcp.commercetools.com
|
|
198
|
-
* -> Will not work as urls differ
|
|
199
|
-
* 2. MC: mc.europe-west1.gcp.commercetools.com with API: mc-api.commercetools.com
|
|
200
|
-
* -> Will not work as urls differ
|
|
201
|
-
*
|
|
202
|
-
* Using the origin ensures that urls always match with the cookie sent. Otherwise,
|
|
203
|
-
* the application shell will rightfully redirect to the logout page.
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var getMcApiUrlFromOrigin = function getMcApiUrlFromOrigin(partialWindow) {
|
|
208
|
-
var _context;
|
|
209
|
-
|
|
210
|
-
var url = new _URL(partialWindow.origin);
|
|
211
|
-
var originTld = removeMcPrefix(url.host);
|
|
212
|
-
return _concatInstanceProperty(_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
function getMcApiUrl(environment, partialWindow) {
|
|
216
|
-
var isServedByProxy = environment.servedByProxy;
|
|
217
|
-
if (isServedByProxy && partialWindow.origin) return getMcApiUrlFromOrigin(partialWindow);
|
|
218
|
-
return environment.mcApiUrl;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
223
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
222
224
|
|
|
223
225
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -241,11 +243,10 @@ var mapUserToApplicationContextUser = function mapUserToApplicationContextUser(u
|
|
|
241
243
|
};
|
|
242
244
|
}; // Adjust certain fields which depend e.g. on the origin
|
|
243
245
|
|
|
244
|
-
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment) {
|
|
245
|
-
var partialWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
|
246
|
+
var mapEnvironmentToApplicationContextEnvironment = function mapEnvironmentToApplicationContextEnvironment(environment, origin) {
|
|
246
247
|
return _objectSpread$1(_objectSpread$1({}, environment), {}, {
|
|
247
248
|
// NOTE: The `mcApiUrl` depends on `servedByProxy`
|
|
248
|
-
mcApiUrl: getMcApiUrl(environment,
|
|
249
|
+
mcApiUrl: getMcApiUrl(environment, origin)
|
|
249
250
|
});
|
|
250
251
|
}; // Expose only certain fields as some of them are only meant to
|
|
251
252
|
// be used internally in the AppShell
|
|
@@ -428,4 +429,4 @@ function withProjectExtensionImageRegex() {
|
|
|
428
429
|
};
|
|
429
430
|
} // Exports
|
|
430
431
|
|
|
431
|
-
export { ApplicationContext, ApplicationContextProvider, Context$1 as Context, GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, useApplicationContext, useProjectExtensionImageRegex, version, withApplicationContext, withProjectExtensionImageRegex };
|
|
432
|
+
export { ApplicationContext, ApplicationContextProvider, Context$1 as Context, GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, getMcApiUrl, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, useApplicationContext, useProjectExtensionImageRegex, version, withApplicationContext, withProjectExtensionImageRegex };
|
|
@@ -72,7 +72,7 @@ export declare const mapEnvironmentToApplicationContextEnvironment: <AdditionalE
|
|
|
72
72
|
oidc?: import("@commercetools-frontend/constants").ApplicationOidcForDevelopmentConfig | undefined;
|
|
73
73
|
menuLinks?: import("@commercetools-frontend/constants").ApplicationMenuLinksForDevelopmentConfig | undefined;
|
|
74
74
|
} | undefined;
|
|
75
|
-
},
|
|
75
|
+
}, origin?: string) => AdditionalEnvironmentProperties & {
|
|
76
76
|
mcApiUrl: string;
|
|
77
77
|
applicationId: string;
|
|
78
78
|
applicationName: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as version } from './version';
|
|
2
2
|
export * from './export-types';
|
|
3
|
+
export { default as getMcApiUrl } from './utils/get-mc-api-url';
|
|
3
4
|
export { Context, ApplicationContext, ApplicationContextProvider, withApplicationContext, useApplicationContext, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, } from './components/application-context';
|
|
4
5
|
export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, } from './components/project-extension-image-regex';
|
|
@@ -149,18 +149,6 @@ export declare enum TBestSellingLimit {
|
|
|
149
149
|
Five = "FIVE",
|
|
150
150
|
Ten = "TEN"
|
|
151
151
|
}
|
|
152
|
-
export declare type TCartDiscountsListView = {
|
|
153
|
-
__typename?: 'CartDiscountsListView';
|
|
154
|
-
createdAt: Scalars['DateTime'];
|
|
155
|
-
id: Scalars['ID'];
|
|
156
|
-
projectKey: Scalars['String'];
|
|
157
|
-
updatedAt: Scalars['DateTime'];
|
|
158
|
-
userId: Scalars['String'];
|
|
159
|
-
visibleColumns: Array<Scalars['String']>;
|
|
160
|
-
};
|
|
161
|
-
export declare type TCartDiscountsListViewInput = {
|
|
162
|
-
visibleColumns: Array<Scalars['String']>;
|
|
163
|
-
};
|
|
164
152
|
export declare enum TCategoryRecommendationSearchProperty {
|
|
165
153
|
Attribute = "Attribute",
|
|
166
154
|
MachineLearning = "MachineLearning",
|
|
@@ -402,18 +390,6 @@ export declare enum TDateFilterType {
|
|
|
402
390
|
Week = "WEEK",
|
|
403
391
|
Year = "YEAR"
|
|
404
392
|
}
|
|
405
|
-
export declare type TDiscountCodesListView = {
|
|
406
|
-
__typename?: 'DiscountCodesListView';
|
|
407
|
-
createdAt: Scalars['DateTime'];
|
|
408
|
-
id: Scalars['ID'];
|
|
409
|
-
projectKey: Scalars['String'];
|
|
410
|
-
updatedAt: Scalars['DateTime'];
|
|
411
|
-
userId: Scalars['String'];
|
|
412
|
-
visibleColumns: Array<Scalars['String']>;
|
|
413
|
-
};
|
|
414
|
-
export declare type TDiscountCodesListViewInput = {
|
|
415
|
-
visibleColumns: Array<Scalars['String']>;
|
|
416
|
-
};
|
|
417
393
|
export declare enum TDiscountType {
|
|
418
394
|
CartDiscount = "CartDiscount",
|
|
419
395
|
DiscountCode = "DiscountCode",
|
|
@@ -616,6 +592,7 @@ export declare type TLayoutCard_NameAllLocalesArgs = {
|
|
|
616
592
|
export declare type TLayoutCardInput = {
|
|
617
593
|
averageOrderValueConfiguration?: InputMaybe<TAverageOrderValueConfigurationInput>;
|
|
618
594
|
height: Scalars['Int'];
|
|
595
|
+
id?: InputMaybe<Scalars['ID']>;
|
|
619
596
|
key: TMetricCardType;
|
|
620
597
|
maxHeight?: InputMaybe<Scalars['Int']>;
|
|
621
598
|
maxWidth?: InputMaybe<Scalars['Int']>;
|
|
@@ -938,16 +915,13 @@ export declare type TMutation = {
|
|
|
938
915
|
activateProjectExtensionApplication?: Maybe<TProjectExtension>;
|
|
939
916
|
changeCustomApplicationStatus?: Maybe<TRestrictedCustomApplicationForOrganization>;
|
|
940
917
|
createCartDiscountsCustomView: TDiscountsCustomView;
|
|
941
|
-
createCartDiscountsListView?: Maybe<TCartDiscountsListView>;
|
|
942
918
|
createCustomApplication?: Maybe<TRestrictedCustomApplicationForOrganization>;
|
|
943
919
|
createCustomersListView: TCustomersListView;
|
|
944
920
|
createDashboardView: TDashboardView;
|
|
945
921
|
createDiscountCodesCustomView: TDiscountsCustomView;
|
|
946
|
-
createDiscountCodesListView?: Maybe<TDiscountCodesListView>;
|
|
947
922
|
createOrdersListView: TOrdersListView;
|
|
948
923
|
createPimSearchListView: TPimSearchListView;
|
|
949
924
|
createProductDiscountsCustomView: TDiscountsCustomView;
|
|
950
|
-
createProductDiscountsListView?: Maybe<TProductDiscountsListView>;
|
|
951
925
|
createProductTypeAttributesView: TProductTypeAttributesView;
|
|
952
926
|
createVariantPricesListView?: Maybe<TVariantPricesListView>;
|
|
953
927
|
deactivateCartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
@@ -974,10 +948,23 @@ export declare type TMutation = {
|
|
|
974
948
|
deleteProjectExtensionApplication?: Maybe<TProjectExtension>;
|
|
975
949
|
installCustomApplication?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
976
950
|
migrateCustomersListViews?: Maybe<TMigrationResult>;
|
|
951
|
+
migrateDashboardViews?: Maybe<TMigrationResult>;
|
|
952
|
+
migrateDiscountsListViews?: Maybe<TMigrationResult>;
|
|
977
953
|
migrateOrdersListViews?: Maybe<TMigrationResult>;
|
|
954
|
+
migrateOrganizationExtensionsOidcSsoConfig: TMigrationResult;
|
|
955
|
+
migratePimSearchListViews?: Maybe<TMigrationResult>;
|
|
956
|
+
migrateProductTypeAttributesViews?: Maybe<TMigrationResult>;
|
|
978
957
|
migrateProjectExtensions: TMigrationResult;
|
|
979
|
-
|
|
980
|
-
|
|
958
|
+
migrateRuleBuilderQuickSelectionValues?: Maybe<TMigrationResult>;
|
|
959
|
+
migrateVariantPricesListViews?: Maybe<TMigrationResult>;
|
|
960
|
+
revertCustomersListViewsMigration: TReversionResult;
|
|
961
|
+
revertDashboardViewsMigration: TReversionResult;
|
|
962
|
+
revertDiscountsListViewsMigration: TReversionResult;
|
|
963
|
+
revertOrdersListViewsMigration: TReversionResult;
|
|
964
|
+
revertPimSearchListViewsMigration: TReversionResult;
|
|
965
|
+
revertProductTypeAttributesViewsMigration: TReversionResult;
|
|
966
|
+
revertRuleBuilderQuickSelectionValuesMigration: TReversionResult;
|
|
967
|
+
revertVariantPricesListViewsMigration: TReversionResult;
|
|
981
968
|
sendLinkToVerifyCustomApplicationsMaintainerContactEmail?: Maybe<TCustomApplicationsMaintainerContactEmailVerificationRequest>;
|
|
982
969
|
setCustomApplicationsMaintainerContactInformation?: Maybe<TOrganizationExtension>;
|
|
983
970
|
setOrganizationExtensionOidcSsoConfig?: Maybe<TOrganizationExtension>;
|
|
@@ -986,17 +973,14 @@ export declare type TMutation = {
|
|
|
986
973
|
setProjectExtensionOrderStatesVisibility?: Maybe<TProjectExtension>;
|
|
987
974
|
uninstallCustomApplication?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
988
975
|
updateCartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
989
|
-
updateCartDiscountsListView?: Maybe<TCartDiscountsListView>;
|
|
990
976
|
updateCustomApplication?: Maybe<TRestrictedCustomApplicationForOrganization>;
|
|
991
977
|
updateCustomApplicationProjectsInstallation?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
992
978
|
updateCustomersListView?: Maybe<TCustomersListView>;
|
|
993
979
|
updateDashboardView?: Maybe<TDashboardView>;
|
|
994
980
|
updateDiscountCodesCustomView?: Maybe<TDiscountsCustomView>;
|
|
995
|
-
updateDiscountCodesListView?: Maybe<TDiscountCodesListView>;
|
|
996
981
|
updateOrdersListView?: Maybe<TOrdersListView>;
|
|
997
982
|
updatePimSearchListView?: Maybe<TPimSearchListView>;
|
|
998
983
|
updateProductDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
999
|
-
updateProductDiscountsListView?: Maybe<TProductDiscountsListView>;
|
|
1000
984
|
updateProductTypeAttributesView: TProductTypeAttributesView;
|
|
1001
985
|
updateProjectExtensionApplication?: Maybe<TProjectExtension>;
|
|
1002
986
|
updateRuleBuilderQuickSelectionValues?: Maybe<TRuleBuilderQuickSelectionValues>;
|
|
@@ -1043,9 +1027,6 @@ export declare type TMutation_ChangeCustomApplicationStatusArgs = {
|
|
|
1043
1027
|
export declare type TMutation_CreateCartDiscountsCustomViewArgs = {
|
|
1044
1028
|
data: TDiscountsCustomViewInput;
|
|
1045
1029
|
};
|
|
1046
|
-
export declare type TMutation_CreateCartDiscountsListViewArgs = {
|
|
1047
|
-
data: TCartDiscountsListViewInput;
|
|
1048
|
-
};
|
|
1049
1030
|
export declare type TMutation_CreateCustomApplicationArgs = {
|
|
1050
1031
|
data: TCustomApplicationDraftDataInput;
|
|
1051
1032
|
organizationId: Scalars['String'];
|
|
@@ -1059,9 +1040,6 @@ export declare type TMutation_CreateDashboardViewArgs = {
|
|
|
1059
1040
|
export declare type TMutation_CreateDiscountCodesCustomViewArgs = {
|
|
1060
1041
|
data: TDiscountsCustomViewInput;
|
|
1061
1042
|
};
|
|
1062
|
-
export declare type TMutation_CreateDiscountCodesListViewArgs = {
|
|
1063
|
-
data: TDiscountCodesListViewInput;
|
|
1064
|
-
};
|
|
1065
1043
|
export declare type TMutation_CreateOrdersListViewArgs = {
|
|
1066
1044
|
data: TOrdersListViewInput;
|
|
1067
1045
|
};
|
|
@@ -1071,9 +1049,6 @@ export declare type TMutation_CreatePimSearchListViewArgs = {
|
|
|
1071
1049
|
export declare type TMutation_CreateProductDiscountsCustomViewArgs = {
|
|
1072
1050
|
data: TDiscountsCustomViewInput;
|
|
1073
1051
|
};
|
|
1074
|
-
export declare type TMutation_CreateProductDiscountsListViewArgs = {
|
|
1075
|
-
data: TProductDiscountsListViewInput;
|
|
1076
|
-
};
|
|
1077
1052
|
export declare type TMutation_CreateProductTypeAttributesViewArgs = {
|
|
1078
1053
|
data: TProductTypeAttributesViewInput;
|
|
1079
1054
|
};
|
|
@@ -1147,19 +1122,94 @@ export declare type TMutation_InstallCustomApplicationArgs = {
|
|
|
1147
1122
|
projectKeys?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
|
|
1148
1123
|
};
|
|
1149
1124
|
export declare type TMutation_MigrateCustomersListViewsArgs = {
|
|
1125
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1126
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1127
|
+
userEmail: Scalars['String'];
|
|
1128
|
+
};
|
|
1129
|
+
export declare type TMutation_MigrateDashboardViewsArgs = {
|
|
1130
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1150
1131
|
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1132
|
+
userEmail: Scalars['String'];
|
|
1133
|
+
};
|
|
1134
|
+
export declare type TMutation_MigrateDiscountsListViewsArgs = {
|
|
1135
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1136
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1137
|
+
userEmail: Scalars['String'];
|
|
1151
1138
|
};
|
|
1152
1139
|
export declare type TMutation_MigrateOrdersListViewsArgs = {
|
|
1140
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1141
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1142
|
+
userEmail: Scalars['String'];
|
|
1143
|
+
};
|
|
1144
|
+
export declare type TMutation_MigrateOrganizationExtensionsOidcSsoConfigArgs = {
|
|
1145
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1153
1146
|
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1147
|
+
userEmail: Scalars['String'];
|
|
1148
|
+
};
|
|
1149
|
+
export declare type TMutation_MigratePimSearchListViewsArgs = {
|
|
1150
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1151
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1152
|
+
userEmail: Scalars['String'];
|
|
1153
|
+
};
|
|
1154
|
+
export declare type TMutation_MigrateProductTypeAttributesViewsArgs = {
|
|
1155
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1156
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1157
|
+
userEmail: Scalars['String'];
|
|
1154
1158
|
};
|
|
1155
1159
|
export declare type TMutation_MigrateProjectExtensionsArgs = {
|
|
1160
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1156
1161
|
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1162
|
+
userEmail: Scalars['String'];
|
|
1163
|
+
};
|
|
1164
|
+
export declare type TMutation_MigrateRuleBuilderQuickSelectionValuesArgs = {
|
|
1165
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1166
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1167
|
+
userEmail: Scalars['String'];
|
|
1168
|
+
};
|
|
1169
|
+
export declare type TMutation_MigrateVariantPricesListViewsArgs = {
|
|
1170
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1171
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1172
|
+
userEmail: Scalars['String'];
|
|
1157
1173
|
};
|
|
1158
1174
|
export declare type TMutation_RevertCustomersListViewsMigrationArgs = {
|
|
1175
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1159
1176
|
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1177
|
+
userEmail: Scalars['String'];
|
|
1178
|
+
};
|
|
1179
|
+
export declare type TMutation_RevertDashboardViewsMigrationArgs = {
|
|
1180
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1181
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1182
|
+
userEmail: Scalars['String'];
|
|
1183
|
+
};
|
|
1184
|
+
export declare type TMutation_RevertDiscountsListViewsMigrationArgs = {
|
|
1185
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1186
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1187
|
+
userEmail: Scalars['String'];
|
|
1160
1188
|
};
|
|
1161
1189
|
export declare type TMutation_RevertOrdersListViewsMigrationArgs = {
|
|
1190
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1191
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1192
|
+
userEmail: Scalars['String'];
|
|
1193
|
+
};
|
|
1194
|
+
export declare type TMutation_RevertPimSearchListViewsMigrationArgs = {
|
|
1195
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1196
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1197
|
+
userEmail: Scalars['String'];
|
|
1198
|
+
};
|
|
1199
|
+
export declare type TMutation_RevertProductTypeAttributesViewsMigrationArgs = {
|
|
1200
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1201
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1202
|
+
userEmail: Scalars['String'];
|
|
1203
|
+
};
|
|
1204
|
+
export declare type TMutation_RevertRuleBuilderQuickSelectionValuesMigrationArgs = {
|
|
1205
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1162
1206
|
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1207
|
+
userEmail: Scalars['String'];
|
|
1208
|
+
};
|
|
1209
|
+
export declare type TMutation_RevertVariantPricesListViewsMigrationArgs = {
|
|
1210
|
+
dryRun?: InputMaybe<Scalars['Boolean']>;
|
|
1211
|
+
projectKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
1212
|
+
userEmail: Scalars['String'];
|
|
1163
1213
|
};
|
|
1164
1214
|
export declare type TMutation_SendLinkToVerifyCustomApplicationsMaintainerContactEmailArgs = {
|
|
1165
1215
|
organizationId: Scalars['String'];
|
|
@@ -1189,10 +1239,6 @@ export declare type TMutation_UpdateCartDiscountsCustomViewArgs = {
|
|
|
1189
1239
|
data: TDiscountsCustomViewInput;
|
|
1190
1240
|
id: Scalars['ID'];
|
|
1191
1241
|
};
|
|
1192
|
-
export declare type TMutation_UpdateCartDiscountsListViewArgs = {
|
|
1193
|
-
data: TCartDiscountsListViewInput;
|
|
1194
|
-
id: Scalars['ID'];
|
|
1195
|
-
};
|
|
1196
1242
|
export declare type TMutation_UpdateCustomApplicationArgs = {
|
|
1197
1243
|
applicationId: Scalars['ID'];
|
|
1198
1244
|
data: TCustomApplicationDraftDataInput;
|
|
@@ -1215,10 +1261,6 @@ export declare type TMutation_UpdateDiscountCodesCustomViewArgs = {
|
|
|
1215
1261
|
data: TDiscountsCustomViewInput;
|
|
1216
1262
|
id: Scalars['ID'];
|
|
1217
1263
|
};
|
|
1218
|
-
export declare type TMutation_UpdateDiscountCodesListViewArgs = {
|
|
1219
|
-
data: TDiscountCodesListViewInput;
|
|
1220
|
-
id: Scalars['ID'];
|
|
1221
|
-
};
|
|
1222
1264
|
export declare type TMutation_UpdateOrdersListViewArgs = {
|
|
1223
1265
|
data: TOrdersListViewInput;
|
|
1224
1266
|
id: Scalars['ID'];
|
|
@@ -1231,10 +1273,6 @@ export declare type TMutation_UpdateProductDiscountsCustomViewArgs = {
|
|
|
1231
1273
|
data: TDiscountsCustomViewInput;
|
|
1232
1274
|
id: Scalars['ID'];
|
|
1233
1275
|
};
|
|
1234
|
-
export declare type TMutation_UpdateProductDiscountsListViewArgs = {
|
|
1235
|
-
data: TProductDiscountsListViewInput;
|
|
1236
|
-
id: Scalars['ID'];
|
|
1237
|
-
};
|
|
1238
1276
|
export declare type TMutation_UpdateProductTypeAttributesViewArgs = {
|
|
1239
1277
|
data: TProductTypeAttributesViewUpdateInput;
|
|
1240
1278
|
id: Scalars['ID'];
|
|
@@ -1664,18 +1702,6 @@ export declare type TPimSearchListViewInput = {
|
|
|
1664
1702
|
export declare type TPimSearchListViewTableInput = {
|
|
1665
1703
|
visibleColumns: Array<Scalars['String']>;
|
|
1666
1704
|
};
|
|
1667
|
-
export declare type TProductDiscountsListView = {
|
|
1668
|
-
__typename?: 'ProductDiscountsListView';
|
|
1669
|
-
createdAt: Scalars['DateTime'];
|
|
1670
|
-
id: Scalars['ID'];
|
|
1671
|
-
projectKey: Scalars['String'];
|
|
1672
|
-
updatedAt: Scalars['DateTime'];
|
|
1673
|
-
userId: Scalars['String'];
|
|
1674
|
-
visibleColumns: Array<Scalars['String']>;
|
|
1675
|
-
};
|
|
1676
|
-
export declare type TProductDiscountsListViewInput = {
|
|
1677
|
-
visibleColumns: Array<Scalars['String']>;
|
|
1678
|
-
};
|
|
1679
1705
|
export declare type TProductTypeAttributesView = {
|
|
1680
1706
|
__typename?: 'ProductTypeAttributesView';
|
|
1681
1707
|
createdAt: Scalars['DateTime'];
|
|
@@ -1754,7 +1780,6 @@ export declare type TQuery = {
|
|
|
1754
1780
|
allProjectExtensions: Array<TProjectExtension>;
|
|
1755
1781
|
cartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
1756
1782
|
cartDiscountsCustomViews: Array<Maybe<TDiscountsCustomView>>;
|
|
1757
|
-
cartDiscountsListView?: Maybe<TCartDiscountsListView>;
|
|
1758
1783
|
customApplication?: Maybe<TCustomApplication>;
|
|
1759
1784
|
customersListView?: Maybe<TCustomersListView>;
|
|
1760
1785
|
customersListViews: Array<Maybe<TCustomersListView>>;
|
|
@@ -1762,7 +1787,6 @@ export declare type TQuery = {
|
|
|
1762
1787
|
dashboardViews: Array<Maybe<TDashboardView>>;
|
|
1763
1788
|
discountCodesCustomView?: Maybe<TDiscountsCustomView>;
|
|
1764
1789
|
discountCodesCustomViews: Array<Maybe<TDiscountsCustomView>>;
|
|
1765
|
-
discountCodesListView?: Maybe<TDiscountCodesListView>;
|
|
1766
1790
|
globalOrganizationExtension?: Maybe<TOrganizationExtension>;
|
|
1767
1791
|
legacyCustomApplication?: Maybe<TLegacyCustomApplication>;
|
|
1768
1792
|
legacyCustomApplicationsMigrationReport: Array<TLegacyCustomApplicationsMigrationReport>;
|
|
@@ -1775,7 +1799,6 @@ export declare type TQuery = {
|
|
|
1775
1799
|
pimSearchListViews: Array<Maybe<TPimSearchListView>>;
|
|
1776
1800
|
productDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
1777
1801
|
productDiscountsCustomViews: Array<Maybe<TDiscountsCustomView>>;
|
|
1778
|
-
productDiscountsListView?: Maybe<TProductDiscountsListView>;
|
|
1779
1802
|
productTypeAttributesView?: Maybe<TProductTypeAttributesView>;
|
|
1780
1803
|
productTypeAttributesViews?: Maybe<Array<Maybe<TProductTypeAttributesView>>>;
|
|
1781
1804
|
projectExtension?: Maybe<TProjectExtension>;
|
|
@@ -1954,9 +1977,10 @@ export declare type TRestrictedCustomApplicationInstallationForProject = {
|
|
|
1954
1977
|
installInAllProjects: Scalars['Boolean'];
|
|
1955
1978
|
updatedAt: Scalars['DateTime'];
|
|
1956
1979
|
};
|
|
1957
|
-
export declare type
|
|
1958
|
-
__typename?: '
|
|
1980
|
+
export declare type TReversionResult = {
|
|
1981
|
+
__typename?: 'ReversionResult';
|
|
1959
1982
|
revertedIds?: Maybe<Array<Scalars['ID']>>;
|
|
1983
|
+
skipped?: Maybe<Scalars['Int']>;
|
|
1960
1984
|
};
|
|
1961
1985
|
export declare type TRuleBuilderQuickSelectCreatefunctionsInput = {
|
|
1962
1986
|
set?: InputMaybe<Array<Scalars['String']>>;
|
|
@@ -2369,10 +2393,10 @@ export declare type TFetchProjectExtensionsNavbarQuery = {
|
|
|
2369
2393
|
__typename?: 'RestrictedCustomApplicationForProject';
|
|
2370
2394
|
id: string;
|
|
2371
2395
|
entryPointUriPath: string;
|
|
2372
|
-
|
|
2396
|
+
icon: string;
|
|
2397
|
+
mainMenuLink: {
|
|
2373
2398
|
__typename?: 'CustomApplicationMenuLink';
|
|
2374
2399
|
id: string;
|
|
2375
|
-
icon: string;
|
|
2376
2400
|
permissions: Array<string>;
|
|
2377
2401
|
defaultLabel: string;
|
|
2378
2402
|
labelAllLocales: Array<{
|
|
@@ -2380,19 +2404,19 @@ export declare type TFetchProjectExtensionsNavbarQuery = {
|
|
|
2380
2404
|
locale: string;
|
|
2381
2405
|
value: string;
|
|
2382
2406
|
}>;
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2407
|
+
};
|
|
2408
|
+
submenuLinks: Array<{
|
|
2409
|
+
__typename?: 'CustomApplicationSubmenuLink';
|
|
2410
|
+
id: string;
|
|
2411
|
+
uriPath: string;
|
|
2412
|
+
permissions: Array<string>;
|
|
2413
|
+
defaultLabel: string;
|
|
2414
|
+
labelAllLocales: Array<{
|
|
2415
|
+
__typename?: 'LocalizedField';
|
|
2416
|
+
locale: string;
|
|
2417
|
+
value: string;
|
|
2394
2418
|
}>;
|
|
2395
|
-
}
|
|
2419
|
+
}>;
|
|
2396
2420
|
};
|
|
2397
2421
|
}> | null;
|
|
2398
2422
|
} | null;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { ApplicationWindow } from '@commercetools-frontend/constants';
|
|
2
|
-
declare
|
|
3
|
-
declare type TPartialWindow = Pick<Window, 'origin'>;
|
|
4
|
-
declare function getMcApiUrl(environment: TApplicationContextEnvironment, partialWindow: TPartialWindow): string;
|
|
2
|
+
declare function getMcApiUrl(environment?: ApplicationWindow['app'], origin?: string): string;
|
|
5
3
|
export default getMcApiUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-shell-connectors",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.13.1",
|
|
4
4
|
"description": "Contains complementary tools for @commercetools-frontend/application-shell",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.18.6",
|
|
25
25
|
"@babel/runtime-corejs3": "^7.18.6",
|
|
26
|
-
"@commercetools-frontend/constants": "21.
|
|
27
|
-
"@commercetools-frontend/sentry": "21.
|
|
26
|
+
"@commercetools-frontend/constants": "21.13.1",
|
|
27
|
+
"@commercetools-frontend/sentry": "21.13.1",
|
|
28
28
|
"@emotion/react": "11.9.3",
|
|
29
29
|
"@types/lodash": "^4.14.182",
|
|
30
30
|
"@types/prop-types": "^15.7.5",
|