@commercetools-frontend/application-shell-connectors 22.37.0 → 22.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,7 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
24
24
|
var react$1 = require('@apollo/client/react');
|
|
25
25
|
var warning = require('tiny-warning');
|
|
26
26
|
var constants = require('@commercetools-frontend/constants');
|
|
27
|
+
var _URLSearchParams = require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
27
28
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
28
29
|
var client = require('@apollo/client');
|
|
29
30
|
var loggerLink = require('apollo-link-logger');
|
|
@@ -65,6 +66,7 @@ var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInsta
|
|
|
65
66
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
66
67
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
67
68
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
69
|
+
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
68
70
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
69
71
|
var loggerLink__default = /*#__PURE__*/_interopDefault(loggerLink);
|
|
70
72
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
@@ -79,7 +81,7 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
|
|
|
79
81
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
80
82
|
|
|
81
83
|
// NOTE: This string will be replaced on build time with the package version.
|
|
82
|
-
var version = "22.
|
|
84
|
+
var version = "22.38.0";
|
|
83
85
|
|
|
84
86
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
85
87
|
const getDisplayName = Component => {
|
|
@@ -939,11 +941,24 @@ const tokenRetryLink = new retry.RetryLink({
|
|
|
939
941
|
|
|
940
942
|
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; }
|
|
941
943
|
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; }
|
|
944
|
+
// Inspired by https://www.apollographql.com/docs/react/api/link/apollo-link-http#dynamic-uri
|
|
945
|
+
const customFetch = (uri, options) => {
|
|
946
|
+
const searchParams = new _URLSearchParams__default["default"]();
|
|
947
|
+
// We attempt to read the GraphQL `operationName` to append it as a query parameter.
|
|
948
|
+
// This is only useful for debugging purposes (network tab) and does not have any functional implication.
|
|
949
|
+
if (options?.body) try {
|
|
950
|
+
const parsed = JSON.parse(options.body);
|
|
951
|
+
searchParams.set('op', parsed.operationName);
|
|
952
|
+
} catch {
|
|
953
|
+
// noop
|
|
954
|
+
}
|
|
955
|
+
return fetch(searchParams.size > 0 ? `${uri}?${searchParams.toString()}` : uri, options);
|
|
956
|
+
};
|
|
942
957
|
const createApolloLink = function () {
|
|
943
958
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
944
959
|
const httpLink = client.createHttpLink({
|
|
945
960
|
uri: `${getMcApiUrl()}/graphql`,
|
|
946
|
-
fetch
|
|
961
|
+
fetch: customFetch
|
|
947
962
|
});
|
|
948
963
|
|
|
949
964
|
// The order of links is IMPORTANT!
|
|
@@ -24,6 +24,7 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
24
24
|
var react$1 = require('@apollo/client/react');
|
|
25
25
|
require('tiny-warning');
|
|
26
26
|
var constants = require('@commercetools-frontend/constants');
|
|
27
|
+
var _URLSearchParams = require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
27
28
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
28
29
|
var client = require('@apollo/client');
|
|
29
30
|
var loggerLink = require('apollo-link-logger');
|
|
@@ -63,6 +64,7 @@ var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
|
63
64
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
64
65
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
65
66
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
67
|
+
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
66
68
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
67
69
|
var loggerLink__default = /*#__PURE__*/_interopDefault(loggerLink);
|
|
68
70
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
@@ -77,7 +79,7 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
|
|
|
77
79
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
78
80
|
|
|
79
81
|
// NOTE: This string will be replaced on build time with the package version.
|
|
80
|
-
var version = "22.
|
|
82
|
+
var version = "22.38.0";
|
|
81
83
|
|
|
82
84
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
83
85
|
const getDisplayName = Component => {
|
|
@@ -917,11 +919,24 @@ const tokenRetryLink = new retry.RetryLink({
|
|
|
917
919
|
|
|
918
920
|
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; }
|
|
919
921
|
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; }
|
|
922
|
+
// Inspired by https://www.apollographql.com/docs/react/api/link/apollo-link-http#dynamic-uri
|
|
923
|
+
const customFetch = (uri, options) => {
|
|
924
|
+
const searchParams = new _URLSearchParams__default["default"]();
|
|
925
|
+
// We attempt to read the GraphQL `operationName` to append it as a query parameter.
|
|
926
|
+
// This is only useful for debugging purposes (network tab) and does not have any functional implication.
|
|
927
|
+
if (options?.body) try {
|
|
928
|
+
const parsed = JSON.parse(options.body);
|
|
929
|
+
searchParams.set('op', parsed.operationName);
|
|
930
|
+
} catch {
|
|
931
|
+
// noop
|
|
932
|
+
}
|
|
933
|
+
return fetch(searchParams.size > 0 ? `${uri}?${searchParams.toString()}` : uri, options);
|
|
934
|
+
};
|
|
920
935
|
const createApolloLink = function () {
|
|
921
936
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
922
937
|
const httpLink = client.createHttpLink({
|
|
923
938
|
uri: `${getMcApiUrl()}/graphql`,
|
|
924
|
-
fetch
|
|
939
|
+
fetch: customFetch
|
|
925
940
|
});
|
|
926
941
|
|
|
927
942
|
// The order of links is IMPORTANT!
|
|
@@ -20,6 +20,7 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
20
20
|
import { useQuery, useLazyQuery, useMutation } from '@apollo/client/react';
|
|
21
21
|
import warning from 'tiny-warning';
|
|
22
22
|
import { GRAPHQL_TARGETS, SUPPORTED_HEADERS, STATUS_CODES, LOGOUT_REASONS, STORAGE_KEYS, LOGIN_STRATEGY_OIDC } from '@commercetools-frontend/constants';
|
|
23
|
+
import _URLSearchParams from '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
23
24
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
24
25
|
import { ApolloLink, ApolloClient, InMemoryCache, createHttpLink, from } from '@apollo/client';
|
|
25
26
|
import loggerLink from 'apollo-link-logger';
|
|
@@ -45,7 +46,7 @@ import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringif
|
|
|
45
46
|
import { RetryLink } from '@apollo/client/link/retry';
|
|
46
47
|
|
|
47
48
|
// NOTE: This string will be replaced on build time with the package version.
|
|
48
|
-
var version = "22.
|
|
49
|
+
var version = "22.38.0";
|
|
49
50
|
|
|
50
51
|
// From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
|
|
51
52
|
const getDisplayName = Component => {
|
|
@@ -905,11 +906,24 @@ const tokenRetryLink = new RetryLink({
|
|
|
905
906
|
|
|
906
907
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
907
908
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
909
|
+
// Inspired by https://www.apollographql.com/docs/react/api/link/apollo-link-http#dynamic-uri
|
|
910
|
+
const customFetch = (uri, options) => {
|
|
911
|
+
const searchParams = new _URLSearchParams();
|
|
912
|
+
// We attempt to read the GraphQL `operationName` to append it as a query parameter.
|
|
913
|
+
// This is only useful for debugging purposes (network tab) and does not have any functional implication.
|
|
914
|
+
if (options?.body) try {
|
|
915
|
+
const parsed = JSON.parse(options.body);
|
|
916
|
+
searchParams.set('op', parsed.operationName);
|
|
917
|
+
} catch {
|
|
918
|
+
// noop
|
|
919
|
+
}
|
|
920
|
+
return fetch(searchParams.size > 0 ? `${uri}?${searchParams.toString()}` : uri, options);
|
|
921
|
+
};
|
|
908
922
|
const createApolloLink = function () {
|
|
909
923
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
910
924
|
const httpLink = createHttpLink({
|
|
911
925
|
uri: `${getMcApiUrl()}/graphql`,
|
|
912
|
-
fetch
|
|
926
|
+
fetch: customFetch
|
|
913
927
|
});
|
|
914
928
|
|
|
915
929
|
// The order of links is IMPORTANT!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-shell-connectors",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.38.0",
|
|
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": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.22.15",
|
|
39
39
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
40
|
-
"@commercetools-frontend/application-config": "22.
|
|
41
|
-
"@commercetools-frontend/browser-history": "22.
|
|
42
|
-
"@commercetools-frontend/constants": "22.
|
|
43
|
-
"@commercetools-frontend/sentry": "22.
|
|
40
|
+
"@commercetools-frontend/application-config": "22.38.0",
|
|
41
|
+
"@commercetools-frontend/browser-history": "22.38.0",
|
|
42
|
+
"@commercetools-frontend/constants": "22.38.0",
|
|
43
|
+
"@commercetools-frontend/sentry": "22.38.0",
|
|
44
44
|
"@commercetools/http-user-agent": "3.0.0",
|
|
45
45
|
"@emotion/react": "^11.11.4",
|
|
46
46
|
"@types/lodash": "^4.14.198",
|
|
47
47
|
"@types/prop-types": "^15.7.5",
|
|
48
|
-
"@types/react": "^17.0.
|
|
48
|
+
"@types/react": "^17.0.83",
|
|
49
49
|
"apollo-link-logger": "2.0.1",
|
|
50
50
|
"graphql": "16.8.2",
|
|
51
51
|
"lodash": "4.17.21",
|