@commercetools-frontend/application-shell-connectors 22.8.4 → 22.9.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 +618 -36
- package/dist/commercetools-frontend-application-shell-connectors.cjs.prod.js +612 -36
- package/dist/commercetools-frontend-application-shell-connectors.esm.js +590 -37
- package/dist/declarations/src/apollo-links/error-link.d.ts +2 -0
- package/dist/declarations/src/apollo-links/header-link.d.ts +3 -0
- package/dist/declarations/src/apollo-links/index.d.ts +4 -0
- package/dist/declarations/src/apollo-links/token-retry-link.d.ts +3 -0
- package/dist/declarations/src/apollo-links/utils.d.ts +10 -0
- package/dist/declarations/src/configure-apollo.d.ts +7 -0
- package/dist/declarations/src/export-types.d.ts +9 -0
- package/dist/declarations/src/hooks/apollo-hooks/apollo-hooks.d.ts +13 -0
- package/dist/declarations/src/hooks/apollo-hooks/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +6 -1
- package/dist/declarations/src/types/generated/settings.d.ts +223 -29
- package/dist/declarations/src/utils/apollo-client-runtime-cache.d.ts +4 -0
- package/dist/declarations/src/utils/apollo-context.d.ts +15 -0
- package/dist/declarations/src/utils/get-correlation-id/get-correlation-id.d.ts +3 -0
- package/dist/declarations/src/utils/get-correlation-id/index.d.ts +1 -0
- package/dist/declarations/src/utils/http-client.d.ts +31 -0
- package/dist/declarations/src/utils/index.d.ts +7 -0
- package/dist/declarations/src/utils/logger.d.ts +10 -0
- package/dist/declarations/src/utils/oidc-storage.d.ts +11 -0
- package/dist/declarations/src/utils/select-project-key-from-url/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-project-key-from-url/select-project-key-from-url.d.ts +1 -0
- package/dist/declarations/src/utils/select-team-id-from-storage/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-team-id-from-storage/select-team-id-from-storage.d.ts +1 -0
- package/dist/declarations/src/utils/select-user-id/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-user-id/select-user-id.d.ts +1 -0
- package/package.json +13 -4
|
@@ -2,8 +2,6 @@
|
|
|
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');
|
|
7
5
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
6
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
9
7
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -17,6 +15,8 @@ var _pt = require('prop-types');
|
|
|
17
15
|
var react = require('react');
|
|
18
16
|
var moment = require('moment-timezone');
|
|
19
17
|
var sentry = require('@commercetools-frontend/sentry');
|
|
18
|
+
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
19
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
20
20
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
21
21
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
22
22
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
@@ -25,11 +25,32 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
25
25
|
var react$1 = require('@apollo/client/react');
|
|
26
26
|
var warning = require('tiny-warning');
|
|
27
27
|
var constants = require('@commercetools-frontend/constants');
|
|
28
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
29
|
+
var client = require('@apollo/client');
|
|
30
|
+
var loggerLink = require('apollo-link-logger');
|
|
31
|
+
var error = require('@apollo/client/link/error');
|
|
32
|
+
var history = require('@commercetools-frontend/browser-history');
|
|
33
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
34
|
+
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
35
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
36
|
+
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
37
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
38
|
+
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
39
|
+
var omitEmpty = require('omit-empty-es');
|
|
40
|
+
var uuid = require('uuid');
|
|
41
|
+
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
42
|
+
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
43
|
+
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
44
|
+
var _assertThisInitialized = require('@babel/runtime-corejs3/helpers/assertThisInitialized');
|
|
45
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
46
|
+
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
47
|
+
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
48
|
+
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
49
|
+
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
50
|
+
var retry = require('@apollo/client/link/retry');
|
|
28
51
|
|
|
29
52
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
30
53
|
|
|
31
|
-
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
32
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
33
54
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
34
55
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
35
56
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -40,13 +61,38 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
40
61
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
41
62
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
42
63
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
64
|
+
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
65
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
43
66
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
44
67
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
45
68
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
46
69
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
70
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
71
|
+
var loggerLink__default = /*#__PURE__*/_interopDefault(loggerLink);
|
|
72
|
+
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
73
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
74
|
+
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
75
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
76
|
+
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
77
|
+
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
78
|
+
var createHttpUserAgent__default = /*#__PURE__*/_interopDefault(createHttpUserAgent);
|
|
79
|
+
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
80
|
+
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
81
|
+
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
47
82
|
|
|
48
83
|
// NOTE: This string will be replaced on build time with the package version.
|
|
49
|
-
var version = "22.
|
|
84
|
+
var version = "22.9.1";
|
|
85
|
+
|
|
86
|
+
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
87
|
+
const getDisplayName = Component => {
|
|
88
|
+
if (typeof Component === 'string') {
|
|
89
|
+
return Component;
|
|
90
|
+
}
|
|
91
|
+
if (!Component) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
return Component.displayName || Component.name || 'Component';
|
|
95
|
+
};
|
|
50
96
|
|
|
51
97
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
52
98
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -80,19 +126,8 @@ function getMcApiUrl() {
|
|
|
80
126
|
return environment.mcApiUrl;
|
|
81
127
|
}
|
|
82
128
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (typeof Component === 'string') {
|
|
86
|
-
return Component;
|
|
87
|
-
}
|
|
88
|
-
if (!Component) {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
return Component.displayName || Component.name || 'Component';
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
95
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
129
|
+
function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
130
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
96
131
|
// Menu visibilities
|
|
97
132
|
|
|
98
133
|
// Permissions
|
|
@@ -125,7 +160,7 @@ const normalizeAllAppliedPermissions = allAppliedPermissions => {
|
|
|
125
160
|
}
|
|
126
161
|
return _reduceInstanceProperty__default["default"](allAppliedPermissions).call(allAppliedPermissions, (transformedAllApplied, allApplied) => {
|
|
127
162
|
if (!allApplied) return transformedAllApplied;
|
|
128
|
-
return _objectSpread$
|
|
163
|
+
return _objectSpread$6(_objectSpread$6({}, transformedAllApplied), {}, {
|
|
129
164
|
[allApplied.name]: allApplied.value
|
|
130
165
|
});
|
|
131
166
|
}, {});
|
|
@@ -136,7 +171,7 @@ const normalizeAllAppliedMenuVisibilities = allAppliedMenuVisibilities => {
|
|
|
136
171
|
}
|
|
137
172
|
return _reduceInstanceProperty__default["default"](allAppliedMenuVisibilities).call(allAppliedMenuVisibilities, (transformedAllApplied, allApplied) => {
|
|
138
173
|
if (!allApplied) return transformedAllApplied;
|
|
139
|
-
return _objectSpread$
|
|
174
|
+
return _objectSpread$6(_objectSpread$6({}, transformedAllApplied), {}, {
|
|
140
175
|
[allApplied.name]: allApplied.value
|
|
141
176
|
});
|
|
142
177
|
}, {});
|
|
@@ -148,8 +183,8 @@ const normalizeAllAppliedActionRights = allAppliedActionRights => {
|
|
|
148
183
|
return _reduceInstanceProperty__default["default"](allAppliedActionRights).call(allAppliedActionRights, (transformedAllApplied, allApplied) => {
|
|
149
184
|
if (!allApplied) return transformedAllApplied;
|
|
150
185
|
const previousAllAppliedGroup = transformedAllApplied[allApplied.group];
|
|
151
|
-
return _objectSpread$
|
|
152
|
-
[allApplied.group]: _objectSpread$
|
|
186
|
+
return _objectSpread$6(_objectSpread$6({}, transformedAllApplied), {}, {
|
|
187
|
+
[allApplied.group]: _objectSpread$6(_objectSpread$6({}, previousAllAppliedGroup), {}, {
|
|
153
188
|
[allApplied.name]: allApplied.value
|
|
154
189
|
})
|
|
155
190
|
});
|
|
@@ -160,7 +195,7 @@ const normalizeAppliedDataFencesForStoresByResourceType = dataFences => {
|
|
|
160
195
|
const groupedByResourceType = _reduceInstanceProperty__default["default"](dataFences).call(dataFences, (previousGroupsOfSameType, appliedDataFence) => {
|
|
161
196
|
if (!appliedDataFence) return previousGroupsOfSameType;
|
|
162
197
|
const previousGroup = previousGroupsOfSameType[appliedDataFence.group];
|
|
163
|
-
return _objectSpread$
|
|
198
|
+
return _objectSpread$6(_objectSpread$6({}, previousGroupsOfSameType), {}, {
|
|
164
199
|
[appliedDataFence.group]: [...(previousGroup || []), appliedDataFence]
|
|
165
200
|
});
|
|
166
201
|
}, {});
|
|
@@ -172,13 +207,13 @@ const normalizeAppliedDataFencesForStoresByResourceType = dataFences => {
|
|
|
172
207
|
const dataFenceByName = nextDataFenceValues[dataFence.name] || {
|
|
173
208
|
values: []
|
|
174
209
|
};
|
|
175
|
-
return _objectSpread$
|
|
176
|
-
[dataFence.name]: _objectSpread$
|
|
210
|
+
return _objectSpread$6(_objectSpread$6({}, nextDataFenceValues), {}, {
|
|
211
|
+
[dataFence.name]: _objectSpread$6(_objectSpread$6({}, dataFenceByName), {}, {
|
|
177
212
|
values: [..._valuesInstanceProperty__default["default"](dataFenceByName), dataFence.value]
|
|
178
213
|
})
|
|
179
214
|
});
|
|
180
215
|
}, {});
|
|
181
|
-
return _objectSpread$
|
|
216
|
+
return _objectSpread$6(_objectSpread$6({}, previousGroupedByResourceType), {}, {
|
|
182
217
|
[resourceType]: groupByDataFenceName
|
|
183
218
|
});
|
|
184
219
|
}, {});
|
|
@@ -222,19 +257,19 @@ const normalizeAllAppliedDataFences = allAppliedDataFences => {
|
|
|
222
257
|
const groupedByType = _reduceInstanceProperty__default["default"](allAppliedDataFences).call(allAppliedDataFences, (previousGroupsOfSameType, appliedDataFence) => {
|
|
223
258
|
if (!appliedDataFence) return previousGroupsOfSameType;
|
|
224
259
|
const previousGroup = previousGroupsOfSameType[appliedDataFence.type];
|
|
225
|
-
return _objectSpread$
|
|
260
|
+
return _objectSpread$6(_objectSpread$6({}, previousGroupsOfSameType), {}, {
|
|
226
261
|
[appliedDataFence.type]: [...(previousGroup || []), appliedDataFence]
|
|
227
262
|
});
|
|
228
263
|
}, {});
|
|
229
|
-
const normalizedDataFences = _objectSpread$
|
|
264
|
+
const normalizedDataFences = _objectSpread$6({}, 'store' in groupedByType ? {
|
|
230
265
|
store: normalizeAppliedDataFencesForStoresByResourceType(groupedByType.store)
|
|
231
266
|
} : {});
|
|
232
267
|
if (_Object$keys__default["default"](normalizedDataFences).length > 0) return normalizedDataFences;
|
|
233
268
|
return null;
|
|
234
269
|
};
|
|
235
270
|
|
|
236
|
-
function ownKeys$
|
|
237
|
-
function _objectSpread$
|
|
271
|
+
function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
272
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
238
273
|
const Context$2 = /*#__PURE__*/react.createContext({});
|
|
239
274
|
const defaultTimeZone = moment__default["default"].tz.guess() || 'Etc/UTC';
|
|
240
275
|
|
|
@@ -268,7 +303,7 @@ const mapUserToApplicationContextUser = user => {
|
|
|
268
303
|
}
|
|
269
304
|
});
|
|
270
305
|
}
|
|
271
|
-
applicationContextUser.idTokenUserInfo = _objectSpread$
|
|
306
|
+
applicationContextUser.idTokenUserInfo = _objectSpread$5(_objectSpread$5({}, user.idTokenUserInfo), {}, {
|
|
272
307
|
additionalClaims
|
|
273
308
|
});
|
|
274
309
|
}
|
|
@@ -276,7 +311,7 @@ const mapUserToApplicationContextUser = user => {
|
|
|
276
311
|
};
|
|
277
312
|
|
|
278
313
|
// Adjust certain fields which depend e.g. on the origin
|
|
279
|
-
const mapEnvironmentToApplicationContextEnvironment = (environment, origin) => _objectSpread$
|
|
314
|
+
const mapEnvironmentToApplicationContextEnvironment = (environment, origin) => _objectSpread$5(_objectSpread$5({}, environment), {}, {
|
|
280
315
|
// NOTE: The `mcApiUrl` depends on `servedByProxy`
|
|
281
316
|
mcApiUrl: getMcApiUrl(environment, origin)
|
|
282
317
|
});
|
|
@@ -336,7 +371,7 @@ function withApplicationContext(mapApplicationContextToProps) {
|
|
|
336
371
|
const mappedProps = mapApplicationContextToProps ? mapApplicationContextToProps(applicationContext) : {
|
|
337
372
|
applicationContext
|
|
338
373
|
};
|
|
339
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
374
|
+
return jsxRuntime.jsx(Component, _objectSpread$5(_objectSpread$5({}, props), mappedProps));
|
|
340
375
|
}
|
|
341
376
|
});
|
|
342
377
|
WrappedComponent.displayName = "withApplicationContext(".concat(getDisplayName(Component), ")");
|
|
@@ -399,8 +434,8 @@ function useCustomViewContextHook(selector) {
|
|
|
399
434
|
// See related issue: https://github.com/babel/babel/issues/8361
|
|
400
435
|
const useCustomViewContext = useCustomViewContextHook;
|
|
401
436
|
|
|
402
|
-
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
403
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
437
|
+
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
438
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
404
439
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
405
440
|
const useWarning = (condition, message) => {
|
|
406
441
|
react.useEffect(() => {
|
|
@@ -460,7 +495,7 @@ function withProjectExtensionImageRegex() {
|
|
|
460
495
|
useWarning(false, "@commercetools-frontend/application-shell-connectors: It is not recommended to use the 'withProjectExtensionImageRegex' high order component anymore. Please use the 'useProjectExtensionImageRegex' hook instead.");
|
|
461
496
|
const imageregexContext = useProjectExtensionImageRegex();
|
|
462
497
|
return jsxRuntime.jsx(GetProjectExtensionImageRegex, {
|
|
463
|
-
render: () => jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
498
|
+
render: () => jsxRuntime.jsx(Component, _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
464
499
|
[propKey]: imageregexContext
|
|
465
500
|
}))
|
|
466
501
|
});
|
|
@@ -470,19 +505,566 @@ function withProjectExtensionImageRegex() {
|
|
|
470
505
|
};
|
|
471
506
|
}
|
|
472
507
|
|
|
508
|
+
function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
509
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
510
|
+
const getSkipTokenRetry = context => {
|
|
511
|
+
const skipTokenRetry = Boolean(context.skipTokenRetry);
|
|
512
|
+
return skipTokenRetry;
|
|
513
|
+
};
|
|
514
|
+
const forwardTokenRetryHeader = headers => _objectSpread$3(_objectSpread$3({}, headers), {}, {
|
|
515
|
+
[constants.SUPPORTED_HEADERS.X_TOKEN_RETRY]: 'true'
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// This link retries requests to the CTP API that have been rejected
|
|
519
|
+
// because of an invalid/expired oauth token.
|
|
520
|
+
// To do so, we resend the request with the header "X-Force-Token: true"
|
|
521
|
+
// so that the MC BE can issue a new token.
|
|
522
|
+
// NOTE: the retry is not meant to work for the MC access token.
|
|
523
|
+
const getDoesGraphQLTargetSupportTokenRetry = context => {
|
|
524
|
+
var _context$headers, _context$headers2, _context;
|
|
525
|
+
const graphQLTarget = ((_context$headers = context.headers) === null || _context$headers === void 0 ? void 0 : _context$headers[constants.SUPPORTED_HEADERS.X_GRAPHQL_TARGET]) || ((_context$headers2 = context.headers) === null || _context$headers2 === void 0 ? void 0 : _context$headers2[constants.SUPPORTED_HEADERS.X_GRAPHQL_TARGET.toLowerCase()]);
|
|
526
|
+
return Boolean(graphQLTarget && _includesInstanceProperty__default["default"](_context = [constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM, constants.GRAPHQL_TARGETS.ADMINISTRATION_SERVICE, constants.GRAPHQL_TARGETS.SETTINGS_SERVICE, constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND]).call(_context, graphQLTarget));
|
|
527
|
+
};
|
|
528
|
+
const isHttpError = error => error.statusCode !== undefined || error.statusCode !== undefined;
|
|
529
|
+
const isGraphQLError = error => _Array$isArray__default["default"](error) && _someInstanceProperty__default["default"](error).call(error, err => err.message !== undefined || err.extensions !== undefined);
|
|
530
|
+
|
|
531
|
+
// Checks response from GraphQL in order to scan 401 errors and redirect the
|
|
532
|
+
// user to the login page resetting the store and showing the proper message
|
|
533
|
+
const errorLink = error.onError(_ref => {
|
|
534
|
+
let graphQLErrors = _ref.graphQLErrors,
|
|
535
|
+
networkError = _ref.networkError,
|
|
536
|
+
operation = _ref.operation,
|
|
537
|
+
forward = _ref.forward;
|
|
538
|
+
if (networkError && isHttpError(networkError) && networkError.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
539
|
+
history__default["default"].push("/logout?reason=".concat(constants.LOGOUT_REASONS.UNAUTHORIZED));
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// In case of graphql errors, we want to retry unauthenticated requests by
|
|
544
|
+
// forcing our API to fetch a new token, using the `X-Force-Token` header.
|
|
545
|
+
// https://www.apollographql.com/docs/link/links/error/#retrying-failed-requests
|
|
546
|
+
// We need to do this as the `token-retry-link` only works for network errors.
|
|
547
|
+
// https://www.apollographql.com/docs/link/links/retry/
|
|
548
|
+
if (graphQLErrors && isGraphQLError(graphQLErrors)) {
|
|
549
|
+
const context = operation.getContext();
|
|
550
|
+
for (const err of graphQLErrors) {
|
|
551
|
+
var _err$extensions;
|
|
552
|
+
const isNonAuthenticatedViaExtensionCode = (err === null || err === void 0 || (_err$extensions = err.extensions) === null || _err$extensions === void 0 ? void 0 : _err$extensions.code) === 'UNAUTHENTICATED';
|
|
553
|
+
/**
|
|
554
|
+
* NOTE:
|
|
555
|
+
* Not not all GraphQL APIs expose an `extensions` field in
|
|
556
|
+
* each error. For those we have to use the `message`
|
|
557
|
+
* property until they introduced support for the `extensions`
|
|
558
|
+
* field.
|
|
559
|
+
*/
|
|
560
|
+
const isNonAuthenticatedViaCode = (err === null || err === void 0 ? void 0 : err.message) === 'invalid_token';
|
|
561
|
+
if ((isNonAuthenticatedViaExtensionCode || isNonAuthenticatedViaCode) && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
562
|
+
operation.setContext(_ref2 => {
|
|
563
|
+
let headers = _ref2.headers;
|
|
564
|
+
return {
|
|
565
|
+
headers: forwardTokenRetryHeader(headers)
|
|
566
|
+
};
|
|
567
|
+
});
|
|
568
|
+
// retry the request, returning the new observable
|
|
569
|
+
return forward(operation);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return;
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// Attempt to load the `teamId` from sessionStorage
|
|
577
|
+
function selectTeamIdFromStorage() {
|
|
578
|
+
var _window$app$__DEVELOP;
|
|
579
|
+
return window.sessionStorage.getItem(constants.STORAGE_KEYS.ACTIVE_TEAM_ID) || ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP === void 0 || (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) === null || _window$app$__DEVELOP === void 0 ? void 0 : _window$app$__DEVELOP.teamId);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const staticUrlPathsInPositionOfProjectKey = ['login', 'logout', 'account'];
|
|
583
|
+
|
|
584
|
+
// Attempt to extract the `:projectKey` from the URL.
|
|
585
|
+
// If the value matches one of the values in the list above,
|
|
586
|
+
// return `undefined` as we're not within a project context.
|
|
587
|
+
function selectProjectKeyFromUrl() {
|
|
588
|
+
let locationPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.pathname;
|
|
589
|
+
let possibleProjectKey = '';
|
|
590
|
+
const pathParts = locationPath.split('/');
|
|
591
|
+
if (pathParts[1] === 'custom-views') {
|
|
592
|
+
// Custom Views paths: /custom-views/:customViewId/projects/:projectKey
|
|
593
|
+
possibleProjectKey = pathParts[4];
|
|
594
|
+
} else {
|
|
595
|
+
// Application paths: /:projectKey/:applicationId
|
|
596
|
+
possibleProjectKey = pathParts[1];
|
|
597
|
+
}
|
|
598
|
+
return _includesInstanceProperty__default["default"](staticUrlPathsInPositionOfProjectKey).call(staticUrlPathsInPositionOfProjectKey, possibleProjectKey) ? undefined : possibleProjectKey;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// Keep an in-memory reference to the apollo client that would be initialized
|
|
602
|
+
// by the application. This is useful to retrieve on runtime the reference
|
|
603
|
+
// to the apollo client in other static modules.
|
|
604
|
+
let cachedApolloClient;
|
|
605
|
+
const setCachedApolloClient = apolloClient => {
|
|
606
|
+
cachedApolloClient = apolloClient;
|
|
607
|
+
};
|
|
608
|
+
const getCachedApolloClient = () => cachedApolloClient;
|
|
609
|
+
|
|
610
|
+
var FetchUserId = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchUserId" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 46, source: { body: "query FetchUserId {\n user: me {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
611
|
+
function selectUserId() {
|
|
612
|
+
const apolloClient = getCachedApolloClient();
|
|
613
|
+
if (!apolloClient) {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
try {
|
|
617
|
+
const queryResult = apolloClient.readQuery({
|
|
618
|
+
query: FetchUserId
|
|
619
|
+
});
|
|
620
|
+
if (queryResult && queryResult.user) {
|
|
621
|
+
return queryResult.user.id;
|
|
622
|
+
}
|
|
623
|
+
} catch (e) {
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
const VALID_ID_PART_FORMAT = /^[\w-/]+$/;
|
|
630
|
+
const skipMalformedPart = part => part && VALID_ID_PART_FORMAT.test(part);
|
|
631
|
+
function getCorrelationId() {
|
|
632
|
+
var _context;
|
|
633
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
634
|
+
userId = _ref.userId;
|
|
635
|
+
return _filterInstanceProperty__default["default"](_context = ['mc', selectProjectKeyFromUrl(), userId, uuid.v4()]).call(_context, skipMalformedPart).join('/');
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const createApolloContextForProxyForwardTo = proxyForwardTocontext => ({
|
|
639
|
+
// Send the request to the forward-to endpoint.
|
|
640
|
+
uri: "".concat(getMcApiUrl(), "/proxy/forward-to"),
|
|
641
|
+
// Custom properties to be used by the "header-link".
|
|
642
|
+
forwardToConfig: proxyForwardTocontext,
|
|
643
|
+
skipGraphQlTargetCheck: true
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
/* eslint-disable no-console */
|
|
647
|
+
|
|
648
|
+
const isLoggerEnabled = () => {
|
|
649
|
+
if (process.env.DEBUG === 'true') return true;
|
|
650
|
+
if (process.env.NODE_ENV === 'development') return true;
|
|
651
|
+
const queryParams = new _URL__default["default"](window.location.href);
|
|
652
|
+
if (process.env.NODE_ENV === 'production' && queryParams.searchParams.get('debug') === 'true') return true;
|
|
653
|
+
return false;
|
|
654
|
+
};
|
|
655
|
+
const logger = {
|
|
656
|
+
groupCollapsed: function () {
|
|
657
|
+
return isLoggerEnabled() && console.groupCollapsed(...arguments);
|
|
658
|
+
},
|
|
659
|
+
groupEnd: () => isLoggerEnabled() && console.groupEnd(),
|
|
660
|
+
info: function () {
|
|
661
|
+
return isLoggerEnabled() && console.info(...arguments);
|
|
662
|
+
},
|
|
663
|
+
log: function () {
|
|
664
|
+
return isLoggerEnabled() && console.log(...arguments);
|
|
665
|
+
},
|
|
666
|
+
error: function () {
|
|
667
|
+
return isLoggerEnabled() && console.error(...arguments);
|
|
668
|
+
},
|
|
669
|
+
warn: function () {
|
|
670
|
+
return isLoggerEnabled() && console.warn(...arguments);
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
const getSessionToken = () => window.sessionStorage.getItem(constants.STORAGE_KEYS.SESSION_TOKEN);
|
|
675
|
+
const setActiveSession = sessionToken => {
|
|
676
|
+
if (!sessionToken) return;
|
|
677
|
+
window.sessionStorage.setItem(constants.STORAGE_KEYS.SESSION_TOKEN, sessionToken !== null && sessionToken !== void 0 ? sessionToken : '');
|
|
678
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.LOGIN_STRATEGY, constants.LOGIN_STRATEGY_OIDC);
|
|
679
|
+
// Remove flag for original workflow
|
|
680
|
+
window.localStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
681
|
+
};
|
|
682
|
+
const clearSession = () => {
|
|
683
|
+
window.sessionStorage.removeItem(constants.STORAGE_KEYS.SESSION_TOKEN);
|
|
684
|
+
window.sessionStorage.removeItem(constants.STORAGE_KEYS.SESSION_SCOPE);
|
|
685
|
+
window.sessionStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
686
|
+
};
|
|
687
|
+
const getActiveProjectKey = () => window.localStorage.getItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
688
|
+
const removeActiveProjectKey = () => {
|
|
689
|
+
window.localStorage.removeItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
690
|
+
};
|
|
691
|
+
const setActiveProjectKey = projectKey => {
|
|
692
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY, projectKey);
|
|
693
|
+
};
|
|
694
|
+
const getSessionScope = () => window.sessionStorage.getItem(constants.STORAGE_KEYS.SESSION_SCOPE);
|
|
695
|
+
const setSessionScope = scope => {
|
|
696
|
+
window.sessionStorage.setItem(constants.STORAGE_KEYS.SESSION_SCOPE, scope);
|
|
697
|
+
};
|
|
698
|
+
const getSessionState = stateId => {
|
|
699
|
+
var _context;
|
|
700
|
+
const sessionStateKey = _concatInstanceProperty__default["default"](_context = "".concat(constants.STORAGE_KEYS.NONCE, "_")).call(_context, stateId);
|
|
701
|
+
const unparsedSessionState = window.sessionStorage.getItem(sessionStateKey);
|
|
702
|
+
if (unparsedSessionState) {
|
|
703
|
+
try {
|
|
704
|
+
const parsedSessionState = JSON.parse(unparsedSessionState);
|
|
705
|
+
window.sessionStorage.removeItem(sessionStateKey);
|
|
706
|
+
return parsedSessionState;
|
|
707
|
+
} catch (error) {
|
|
708
|
+
window.sessionStorage.removeItem(sessionStateKey);
|
|
709
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
710
|
+
var _context2;
|
|
711
|
+
// eslint-disable-next-line no-console
|
|
712
|
+
console.warn(_concatInstanceProperty__default["default"](_context2 = "Cannot parse session state for \"".concat(sessionStateKey, "\".\n")).call(_context2, unparsedSessionState));
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
};
|
|
718
|
+
const setSessionState = (stateId, state) => {
|
|
719
|
+
var _context3;
|
|
720
|
+
const sessionStateKey = _concatInstanceProperty__default["default"](_context3 = "".concat(constants.STORAGE_KEYS.NONCE, "_")).call(_context3, stateId);
|
|
721
|
+
window.sessionStorage.setItem(sessionStateKey, _JSON$stringify__default["default"](state));
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
var oidcStorage = /*#__PURE__*/Object.freeze({
|
|
725
|
+
__proto__: null,
|
|
726
|
+
getSessionToken: getSessionToken,
|
|
727
|
+
setActiveSession: setActiveSession,
|
|
728
|
+
clearSession: clearSession,
|
|
729
|
+
getSessionState: getSessionState,
|
|
730
|
+
setSessionState: setSessionState,
|
|
731
|
+
getActiveProjectKey: getActiveProjectKey,
|
|
732
|
+
setActiveProjectKey: setActiveProjectKey,
|
|
733
|
+
removeActiveProjectKey: removeActiveProjectKey,
|
|
734
|
+
getSessionScope: getSessionScope,
|
|
735
|
+
setSessionScope: setSessionScope
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
739
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
740
|
+
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
741
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$2(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
742
|
+
const defaultUserAgent = createHttpUserAgent__default["default"]({
|
|
743
|
+
name: 'unknown-http-client',
|
|
744
|
+
libraryName: window.app.applicationName
|
|
745
|
+
});
|
|
746
|
+
const defaultForwardToVersion = 'v2';
|
|
747
|
+
const defaultForwardToAudiencePolicy = 'forward-url-full-path';
|
|
748
|
+
function buildApiUrl(endpoint) {
|
|
749
|
+
var _context;
|
|
750
|
+
const apiUrl = getMcApiUrl().replace(/\/$/, '');
|
|
751
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(apiUrl)).call(_context, endpoint);
|
|
752
|
+
}
|
|
753
|
+
const getAppliedForwardToHeaders = forwardToConfig => {
|
|
754
|
+
var _context2, _forwardToConfig$head, _forwardToConfig$vers, _forwardToConfig$audi;
|
|
755
|
+
if (!forwardToConfig) {
|
|
756
|
+
return {};
|
|
757
|
+
}
|
|
758
|
+
if (!forwardToConfig.uri) {
|
|
759
|
+
throw new Error("Missing required \"uri\" option.");
|
|
760
|
+
}
|
|
761
|
+
const exchangeTokenClaims = [];
|
|
762
|
+
if (forwardToConfig.includeUserPermissions) {
|
|
763
|
+
exchangeTokenClaims.push('permissions');
|
|
764
|
+
}
|
|
765
|
+
return _objectSpread$2(_objectSpread$2({}, _reduceInstanceProperty__default["default"](_context2 = _Object$entries__default["default"]((_forwardToConfig$head = forwardToConfig.headers) !== null && _forwardToConfig$head !== void 0 ? _forwardToConfig$head : {})).call(_context2, (customForwardHeaders, _ref) => {
|
|
766
|
+
let _ref2 = _slicedToArray(_ref, 2),
|
|
767
|
+
headerName = _ref2[0],
|
|
768
|
+
headerValue = _ref2[1];
|
|
769
|
+
return _objectSpread$2(_objectSpread$2({}, customForwardHeaders), {}, {
|
|
770
|
+
// Prefix headers so that the MC API can allow and forward them.
|
|
771
|
+
["x-forward-header-".concat(headerName)]: headerValue
|
|
772
|
+
});
|
|
773
|
+
}, {})), {}, {
|
|
774
|
+
[constants.SUPPORTED_HEADERS.ACCEPT_VERSION]: (_forwardToConfig$vers = forwardToConfig.version) !== null && _forwardToConfig$vers !== void 0 ? _forwardToConfig$vers : defaultForwardToVersion,
|
|
775
|
+
[constants.SUPPORTED_HEADERS.X_FORWARD_TO]: forwardToConfig.uri,
|
|
776
|
+
[constants.SUPPORTED_HEADERS.X_FORWARD_TO_AUDIENCE_POLICY]: (_forwardToConfig$audi = forwardToConfig.audiencePolicy) !== null && _forwardToConfig$audi !== void 0 ? _forwardToConfig$audi : defaultForwardToAudiencePolicy,
|
|
777
|
+
[constants.SUPPORTED_HEADERS.X_FORWARD_TO_CLAIMS]: exchangeTokenClaims.join(' ')
|
|
778
|
+
});
|
|
779
|
+
};
|
|
780
|
+
function createHttpClientOptions() {
|
|
781
|
+
var _config$projectKey;
|
|
782
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
783
|
+
const sessionToken = getSessionToken();
|
|
784
|
+
const projectKey = (_config$projectKey = config.projectKey) !== null && _config$projectKey !== void 0 ? _config$projectKey : selectProjectKeyFromUrl();
|
|
785
|
+
const userId = selectUserId();
|
|
786
|
+
const userAgent = (config === null || config === void 0 ? void 0 : config.userAgent) || defaultUserAgent;
|
|
787
|
+
return {
|
|
788
|
+
credentials: 'include',
|
|
789
|
+
headers: omitEmpty__default["default"](_objectSpread$2(_objectSpread$2({}, config.headers), {}, {
|
|
790
|
+
// Required headers
|
|
791
|
+
[constants.SUPPORTED_HEADERS.ACCEPT]: 'application/json',
|
|
792
|
+
[constants.SUPPORTED_HEADERS.AUTHORIZATION]: sessionToken ? "Bearer ".concat(sessionToken) : undefined,
|
|
793
|
+
[constants.SUPPORTED_HEADERS.X_APPLICATION_ID]: window.app.applicationIdentifier,
|
|
794
|
+
[constants.SUPPORTED_HEADERS.X_CUSTOM_VIEW_ID]: window.app.customViewId,
|
|
795
|
+
[constants.SUPPORTED_HEADERS.X_CORRELATION_ID]: getCorrelationId({
|
|
796
|
+
userId
|
|
797
|
+
}),
|
|
798
|
+
[constants.SUPPORTED_HEADERS.X_PROJECT_KEY]: projectKey,
|
|
799
|
+
[constants.SUPPORTED_HEADERS.X_USER_AGENT]: userAgent
|
|
800
|
+
}, getAppliedForwardToHeaders(config.forwardToConfig)))
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
let RenewTokenError = /*#__PURE__*/function (_Error) {
|
|
804
|
+
_inherits(RenewTokenError, _Error);
|
|
805
|
+
var _super = _createSuper(RenewTokenError);
|
|
806
|
+
function RenewTokenError(message) {
|
|
807
|
+
var _this;
|
|
808
|
+
_classCallCheck(this, RenewTokenError);
|
|
809
|
+
_this = _super.call(this, message);
|
|
810
|
+
_Object$defineProperty__default["default"](_assertThisInitialized(_this), 'name', {
|
|
811
|
+
value: 'RenewTokenError'
|
|
812
|
+
});
|
|
813
|
+
return _this;
|
|
814
|
+
}
|
|
815
|
+
return _createClass(RenewTokenError);
|
|
816
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
817
|
+
async function executeHttpClientRequest(fetcher) {
|
|
818
|
+
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
819
|
+
// Wrapper function to be called again (once) on retry.
|
|
820
|
+
async function sendRequest() {
|
|
821
|
+
let _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
822
|
+
shouldRenewToken = _ref3.shouldRenewToken;
|
|
823
|
+
const requestOptions = createHttpClientOptions(config);
|
|
824
|
+
const response = await fetcher(_objectSpread$2(_objectSpread$2({}, requestOptions), {}, {
|
|
825
|
+
headers: omitEmpty__default["default"](_objectSpread$2(_objectSpread$2({}, requestOptions.headers), {}, {
|
|
826
|
+
// Passing this header forces a token renewal.
|
|
827
|
+
[constants.SUPPORTED_HEADERS.X_TOKEN_RETRY]: shouldRenewToken
|
|
828
|
+
}))
|
|
829
|
+
}));
|
|
830
|
+
if (response.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
831
|
+
throw new RenewTokenError("Unauthorized response, attempting retry.");
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// In case a new session token is returned from the server, save it.
|
|
835
|
+
const refreshedSessionToken = response.getHeader('x-refreshed-session-token');
|
|
836
|
+
if (refreshedSessionToken) {
|
|
837
|
+
setActiveSession(refreshedSessionToken);
|
|
838
|
+
}
|
|
839
|
+
return response.data;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// Attempt to send the request.
|
|
843
|
+
return sendRequest().catch(error => {
|
|
844
|
+
if (error instanceof RenewTokenError) {
|
|
845
|
+
// Retry the request and ask to renew the token.
|
|
846
|
+
return sendRequest({
|
|
847
|
+
shouldRenewToken: true
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
throw error;
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
855
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
856
|
+
const userAgent = createHttpUserAgent__default["default"]({
|
|
857
|
+
name: 'apollo-client',
|
|
858
|
+
// version: apolloVersion,
|
|
859
|
+
libraryName: [window.app.applicationName, 'application-shell'].join('/'),
|
|
860
|
+
libraryVersion: version,
|
|
861
|
+
contactUrl: 'https://git.io/fjuyC',
|
|
862
|
+
// points to the appkit repo issues
|
|
863
|
+
contactEmail: 'support@commercetools.com'
|
|
864
|
+
});
|
|
865
|
+
const isKnownGraphQlTarget = target => {
|
|
866
|
+
var _context;
|
|
867
|
+
return target ? _includesInstanceProperty__default["default"](_context = _Object$values__default["default"](constants.GRAPHQL_TARGETS)).call(_context, target) : false;
|
|
868
|
+
};
|
|
869
|
+
const extractSessionTokenFromResponse = context => {
|
|
870
|
+
var _context$response, _context$restResponse;
|
|
871
|
+
const refreshedSessionToken = (_context$response = context.response) === null || _context$response === void 0 || (_context$response = _context$response.headers) === null || _context$response === void 0 ? void 0 : _context$response.get('x-refreshed-session-token');
|
|
872
|
+
if (refreshedSessionToken) {
|
|
873
|
+
return refreshedSessionToken !== null && refreshedSessionToken !== void 0 ? refreshedSessionToken : null;
|
|
874
|
+
}
|
|
875
|
+
const restResponseWithRefreshTokenHeader = (_context$restResponse = context.restResponses) === null || _context$restResponse === void 0 ? void 0 : _findInstanceProperty__default["default"](_context$restResponse).call(_context$restResponse, response => {
|
|
876
|
+
var _response$headers;
|
|
877
|
+
return (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.has('x-refreshed-session-token');
|
|
878
|
+
});
|
|
879
|
+
if (restResponseWithRefreshTokenHeader) {
|
|
880
|
+
var _restResponseWithRefr;
|
|
881
|
+
return (_restResponseWithRefr = restResponseWithRefreshTokenHeader.headers.get('x-refreshed-session-token')) !== null && _restResponseWithRefr !== void 0 ? _restResponseWithRefr : null;
|
|
882
|
+
}
|
|
883
|
+
return null;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
/* eslint-disable import/prefer-default-export */
|
|
887
|
+
// Use a middleware to update the request headers with the correct params.
|
|
888
|
+
const headerLink = new client.ApolloLink((operation, forward) => {
|
|
889
|
+
var _context2, _context3;
|
|
890
|
+
const apolloContext = operation.getContext();
|
|
891
|
+
const variables = operation.variables;
|
|
892
|
+
const graphQlTarget = apolloContext.target || variables.target;
|
|
893
|
+
if (!apolloContext.skipGraphQlTargetCheck && !isKnownGraphQlTarget(graphQlTarget)) throw new Error(_concatInstanceProperty__default["default"](_context2 = "GraphQL target \"".concat(graphQlTarget, "\" is missing (or is not supported) in operation \"")).call(_context2, operation.operationName, "\""));
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* NOTE:
|
|
897
|
+
* The project key is read from the url in a project related application context.
|
|
898
|
+
* This holds for most applications like `application-categories`, `application-discounts` etc.
|
|
899
|
+
* However, the `application-account` does not run with the project key being part of the url.
|
|
900
|
+
* As a result we allow passing the project key as a variable on the operation allowing
|
|
901
|
+
* it to be the fallback.
|
|
902
|
+
*/
|
|
903
|
+
const projectKey = apolloContext.projectKey || variables.projectKey || selectProjectKeyFromUrl();
|
|
904
|
+
const teamId = apolloContext.teamId || variables.teamId || selectTeamIdFromStorage();
|
|
905
|
+
const featureFlag = apolloContext.featureFlag || variables.featureFlag;
|
|
906
|
+
operation.setContext(createHttpClientOptions({
|
|
907
|
+
userAgent,
|
|
908
|
+
headers: omitEmpty__default["default"](_objectSpread$1(_objectSpread$1({}, apolloContext.headers), {}, {
|
|
909
|
+
// Required headers for GraphQL API.
|
|
910
|
+
[constants.SUPPORTED_HEADERS.X_GRAPHQL_TARGET]: graphQlTarget,
|
|
911
|
+
// For logging/debugging purposes.
|
|
912
|
+
[constants.SUPPORTED_HEADERS.X_GRAPHQL_OPERATION_NAME]: operation.operationName,
|
|
913
|
+
// Experimental features, use with caution.
|
|
914
|
+
[constants.SUPPORTED_HEADERS.X_TEAM_ID]: teamId,
|
|
915
|
+
[constants.SUPPORTED_HEADERS.X_FEATURE_FLAG]: featureFlag
|
|
916
|
+
})),
|
|
917
|
+
forwardToConfig: apolloContext.forwardToConfig,
|
|
918
|
+
projectKey
|
|
919
|
+
}));
|
|
920
|
+
return _mapInstanceProperty__default["default"](_context3 = forward(operation)).call(_context3, response => {
|
|
921
|
+
const context = operation.getContext();
|
|
922
|
+
const refreshedSessionToken = extractSessionTokenFromResponse(context);
|
|
923
|
+
if (refreshedSessionToken) {
|
|
924
|
+
setActiveSession(refreshedSessionToken);
|
|
925
|
+
}
|
|
926
|
+
return response;
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
const tokenRetryLink = new retry.RetryLink({
|
|
931
|
+
attempts: (count, operation, error) => {
|
|
932
|
+
const context = operation.getContext();
|
|
933
|
+
if ((error === null || error === void 0 ? void 0 : error.statusCode) === constants.STATUS_CODES.UNAUTHORIZED && count === 1 && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
934
|
+
operation.setContext(_ref => {
|
|
935
|
+
let headers = _ref.headers;
|
|
936
|
+
return {
|
|
937
|
+
headers: forwardTokenRetryHeader(headers)
|
|
938
|
+
};
|
|
939
|
+
});
|
|
940
|
+
return true;
|
|
941
|
+
}
|
|
942
|
+
return false;
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
947
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
948
|
+
const httpLink = client.createHttpLink({
|
|
949
|
+
uri: "".concat(getMcApiUrl(), "/graphql"),
|
|
950
|
+
fetch
|
|
951
|
+
});
|
|
952
|
+
const createApolloLink = function () {
|
|
953
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
954
|
+
return (
|
|
955
|
+
// The order of links is IMPORTANT!
|
|
956
|
+
// In the request-phase they are executed top to bottom.
|
|
957
|
+
// In the response/phase they are executed bottom to top.
|
|
958
|
+
// The `httpLink` is terminating so it must be last, while `tokenRetryLink` and `errorLink`
|
|
959
|
+
// wrap the links the their right.
|
|
960
|
+
client.from([headerLink,
|
|
961
|
+
// See https://www.apollographql.com/docs/react/api/link/apollo-link-rest/#link-order
|
|
962
|
+
// State & context links should happen before (to the left of) `restLink`.
|
|
963
|
+
...(options.restLink ? [options.restLink] : []),
|
|
964
|
+
// Must be before `tokenRetryLink`.
|
|
965
|
+
errorLink,
|
|
966
|
+
// Avoid logging queries in test environment
|
|
967
|
+
...(isLoggerEnabled() ? [loggerLink__default["default"]] : []),
|
|
968
|
+
// Must be after `errorLink`.
|
|
969
|
+
tokenRetryLink,
|
|
970
|
+
// Must be last.
|
|
971
|
+
httpLink])
|
|
972
|
+
);
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
// This custom merge function allows to merge two arrays of objects.
|
|
976
|
+
// The incoming list is what we need to update to, but we still need
|
|
977
|
+
// to ensure that existing cache elements are not removed but updated.
|
|
978
|
+
// This is usually the case when elements get removed.
|
|
979
|
+
const mergeArraysObjects = function () {
|
|
980
|
+
let existing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
981
|
+
let incoming = arguments.length > 1 ? arguments[1] : undefined;
|
|
982
|
+
let _ref = arguments.length > 2 ? arguments[2] : undefined,
|
|
983
|
+
mergeObjects = _ref.mergeObjects;
|
|
984
|
+
return _reduceInstanceProperty__default["default"](incoming).call(incoming, (mergedElements, elem) => {
|
|
985
|
+
const existingElem = _findInstanceProperty__default["default"](existing).call(existing, el => el.__ref === elem.__ref);
|
|
986
|
+
if (existingElem) {
|
|
987
|
+
const updatedElem = mergeObjects(existingElem, elem);
|
|
988
|
+
if (updatedElem) {
|
|
989
|
+
return [...mergedElements, updatedElem];
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return [...mergedElements, elem];
|
|
993
|
+
}, []);
|
|
994
|
+
};
|
|
995
|
+
const createApolloClient = function () {
|
|
996
|
+
var _options$cache, _customCacheConfig$ty;
|
|
997
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
998
|
+
const customCacheConfig = (_options$cache = options === null || options === void 0 ? void 0 : options.cache) !== null && _options$cache !== void 0 ? _options$cache : {};
|
|
999
|
+
return new client.ApolloClient({
|
|
1000
|
+
link: createApolloLink(options),
|
|
1001
|
+
// https://www.apollographql.com/docs/react/caching/cache-configuration/
|
|
1002
|
+
cache: new client.InMemoryCache(_objectSpread(_objectSpread({}, customCacheConfig), {}, {
|
|
1003
|
+
// https://www.apollographql.com/docs/react/caching/cache-configuration/#generating-unique-identifiers
|
|
1004
|
+
typePolicies: _objectSpread({
|
|
1005
|
+
// CTP types with `key` as identifier
|
|
1006
|
+
Project: {
|
|
1007
|
+
keyFields: ['key']
|
|
1008
|
+
},
|
|
1009
|
+
Store: {
|
|
1010
|
+
keyFields: ['key']
|
|
1011
|
+
},
|
|
1012
|
+
// Internal apps menu links representations
|
|
1013
|
+
ApplicationsMenu: {
|
|
1014
|
+
fields: {
|
|
1015
|
+
appBar: {
|
|
1016
|
+
merge: mergeArraysObjects
|
|
1017
|
+
},
|
|
1018
|
+
navBar: {
|
|
1019
|
+
merge: mergeArraysObjects
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}, (_customCacheConfig$ty = customCacheConfig.typePolicies) !== null && _customCacheConfig$ty !== void 0 ? _customCacheConfig$ty : {})
|
|
1024
|
+
}))
|
|
1025
|
+
});
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
function useMcQuery(query, options) {
|
|
1029
|
+
return react$1.useQuery(query, options);
|
|
1030
|
+
}
|
|
1031
|
+
function useMcLazyQuery(query, options) {
|
|
1032
|
+
return react$1.useLazyQuery(query, options);
|
|
1033
|
+
}
|
|
1034
|
+
function useMcMutation(mutation, options) {
|
|
1035
|
+
return react$1.useMutation(mutation, options);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
473
1038
|
exports.ApplicationContext = ApplicationContext;
|
|
474
1039
|
exports.ApplicationContextProvider = ApplicationContextProvider;
|
|
475
1040
|
exports.Context = Context$2;
|
|
476
1041
|
exports.CustomViewContextProvider = CustomViewContextProvider;
|
|
477
1042
|
exports.GetProjectExtensionImageRegex = GetProjectExtensionImageRegex;
|
|
478
1043
|
exports.ProjectExtensionProviderForImageRegex = ProjectExtensionProviderForImageRegex;
|
|
1044
|
+
exports.buildApiUrl = buildApiUrl;
|
|
1045
|
+
exports.createApolloClient = createApolloClient;
|
|
1046
|
+
exports.createApolloContextForProxyForwardTo = createApolloContextForProxyForwardTo;
|
|
1047
|
+
exports.createHttpClientOptions = createHttpClientOptions;
|
|
1048
|
+
exports.executeHttpClientRequest = executeHttpClientRequest;
|
|
1049
|
+
exports.getCachedApolloClient = getCachedApolloClient;
|
|
1050
|
+
exports.getCorrelationId = getCorrelationId;
|
|
479
1051
|
exports.getMcApiUrl = getMcApiUrl;
|
|
1052
|
+
exports.isLoggerEnabled = isLoggerEnabled;
|
|
1053
|
+
exports.logger = logger;
|
|
480
1054
|
exports.normalizeAllAppliedActionRights = normalizeAllAppliedActionRights;
|
|
481
1055
|
exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
|
|
482
1056
|
exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
|
|
483
1057
|
exports.normalizeAllAppliedPermissions = normalizeAllAppliedPermissions;
|
|
1058
|
+
exports.oidcStorage = oidcStorage;
|
|
1059
|
+
exports.selectProjectKeyFromUrl = selectProjectKeyFromUrl;
|
|
1060
|
+
exports.selectTeamIdFromStorage = selectTeamIdFromStorage;
|
|
1061
|
+
exports.selectUserId = selectUserId;
|
|
1062
|
+
exports.setCachedApolloClient = setCachedApolloClient;
|
|
484
1063
|
exports.useApplicationContext = useApplicationContext;
|
|
485
1064
|
exports.useCustomViewContext = useCustomViewContext;
|
|
1065
|
+
exports.useMcLazyQuery = useMcLazyQuery;
|
|
1066
|
+
exports.useMcMutation = useMcMutation;
|
|
1067
|
+
exports.useMcQuery = useMcQuery;
|
|
486
1068
|
exports.useProjectExtensionImageRegex = useProjectExtensionImageRegex;
|
|
487
1069
|
exports.version = version;
|
|
488
1070
|
exports.withApplicationContext = withApplicationContext;
|