@opengeoweb/api 9.19.0 → 9.20.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.
Files changed (2) hide show
  1. package/index.esm.js +120 -106
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import axios from 'axios';
3
3
  import { useIsMounted, useDebounce } from '@opengeoweb/shared';
4
+ import { jsx } from 'react/jsx-runtime';
4
5
 
5
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
7
 
@@ -130,7 +131,9 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
130
131
  source: 'https://github.com/zloirock/core-js'
131
132
  });
132
133
 
133
- var store$2 = sharedStore.exports;
134
+ var sharedStoreExports = sharedStore.exports;
135
+
136
+ var store$2 = sharedStoreExports;
134
137
 
135
138
  var shared$4 = function (key, value) {
136
139
  return store$2[key] || (store$2[key] = value || {});
@@ -788,7 +791,7 @@ var global$h = global$p;
788
791
  var isObject$9 = isObject$e;
789
792
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
790
793
  var hasOwn$c = hasOwnProperty_1;
791
- var shared$1 = sharedStore.exports;
794
+ var shared$1 = sharedStoreExports;
792
795
  var sharedKey$1 = sharedKey$3;
793
796
  var hiddenKeys$1 = hiddenKeys$4;
794
797
 
@@ -917,7 +920,7 @@ var functionName = {
917
920
 
918
921
  var uncurryThis$l = functionUncurryThis;
919
922
  var isCallable$i = isCallable$p;
920
- var store = sharedStore.exports;
923
+ var store = sharedStoreExports;
921
924
 
922
925
  var functionToString = uncurryThis$l(Function.toString);
923
926
 
@@ -985,9 +988,11 @@ Function.prototype.toString = makeBuiltIn$2(function toString() {
985
988
  return isCallable$h(this) && getInternalState$3(this).source || inspectSource$2(this);
986
989
  }, 'toString');
987
990
 
991
+ var makeBuiltInExports = makeBuiltIn$3.exports;
992
+
988
993
  var isCallable$g = isCallable$p;
989
994
  var definePropertyModule$1 = objectDefineProperty;
990
- var makeBuiltIn$1 = makeBuiltIn$3.exports;
995
+ var makeBuiltIn$1 = makeBuiltInExports;
991
996
  var defineGlobalProperty$1 = defineGlobalProperty$3;
992
997
 
993
998
  var defineBuiltIn$c = function (O, key, value, options) {
@@ -1797,6 +1802,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1797
1802
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1798
1803
  PERFORMANCE OF THIS SOFTWARE.
1799
1804
  ***************************************************************************** */
1805
+ /* global Reflect, Promise, SuppressedError, Symbol */
1806
+
1800
1807
 
1801
1808
  function __rest(s, e) {
1802
1809
  var t = {};
@@ -1881,6 +1888,73 @@ const useApi = (apiCall, params, callbacks) => {
1881
1888
  };
1882
1889
  };
1883
1890
 
1891
+ var DESCRIPTORS$a = descriptors;
1892
+ var uncurryThis$e = functionUncurryThis;
1893
+ var call$c = functionCall;
1894
+ var fails$f = fails$s;
1895
+ var objectKeys = objectKeys$2;
1896
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1897
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1898
+ var toObject$3 = toObject$6;
1899
+ var IndexedObject$1 = indexedObject;
1900
+
1901
+ // eslint-disable-next-line es/no-object-assign -- safe
1902
+ var $assign = Object.assign;
1903
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1904
+ var defineProperty$4 = Object.defineProperty;
1905
+ var concat$1 = uncurryThis$e([].concat);
1906
+
1907
+ // `Object.assign` method
1908
+ // https://tc39.es/ecma262/#sec-object.assign
1909
+ var objectAssign = !$assign || fails$f(function () {
1910
+ // should have correct order of operations (Edge bug)
1911
+ if (DESCRIPTORS$a && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1912
+ enumerable: true,
1913
+ get: function () {
1914
+ defineProperty$4(this, 'b', {
1915
+ value: 3,
1916
+ enumerable: false
1917
+ });
1918
+ }
1919
+ }), { b: 2 })).b !== 1) return true;
1920
+ // should work with symbols and should have deterministic property order (V8 bug)
1921
+ var A = {};
1922
+ var B = {};
1923
+ // eslint-disable-next-line es/no-symbol -- safe
1924
+ var symbol = Symbol('assign detection');
1925
+ var alphabet = 'abcdefghijklmnopqrst';
1926
+ A[symbol] = 7;
1927
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1928
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1929
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1930
+ var T = toObject$3(target);
1931
+ var argumentsLength = arguments.length;
1932
+ var index = 1;
1933
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1934
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1935
+ while (argumentsLength > index) {
1936
+ var S = IndexedObject$1(arguments[index++]);
1937
+ var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1938
+ var length = keys.length;
1939
+ var j = 0;
1940
+ var key;
1941
+ while (length > j) {
1942
+ key = keys[j++];
1943
+ if (!DESCRIPTORS$a || call$c(propertyIsEnumerable, S, key)) T[key] = S[key];
1944
+ }
1945
+ } return T;
1946
+ } : $assign;
1947
+
1948
+ var $$g = _export;
1949
+ var assign = objectAssign;
1950
+
1951
+ // `Object.assign` method
1952
+ // https://tc39.es/ecma262/#sec-object.assign
1953
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1954
+ $$g({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1955
+ assign: assign
1956
+ });
1957
+
1884
1958
  const ApiContext = /*#__PURE__*/React.createContext({
1885
1959
  api: null
1886
1960
  });
@@ -1915,18 +1989,20 @@ const ApiProvider = _a => {
1915
1989
  const contextValue = React.useMemo(() => ({
1916
1990
  api
1917
1991
  }), [api]);
1918
- return /*#__PURE__*/React.createElement(ApiContext.Provider, {
1992
+ return jsx(ApiContext.Provider, Object.assign({
1919
1993
  value: contextValue
1920
- }, children);
1994
+ }, {
1995
+ children: children
1996
+ }));
1921
1997
  };
1922
1998
  function useApiContext() {
1923
1999
  return React.useContext(ApiContext);
1924
2000
  }
1925
2001
 
1926
- var defineProperty$4 = objectDefineProperty.f;
2002
+ var defineProperty$3 = objectDefineProperty.f;
1927
2003
 
1928
2004
  var proxyAccessor$1 = function (Target, Source, key) {
1929
- key in Target || defineProperty$4(Target, key, {
2005
+ key in Target || defineProperty$3(Target, key, {
1930
2006
  configurable: true,
1931
2007
  get: function () { return Source[key]; },
1932
2008
  set: function (it) { Source[key] = it; }
@@ -1969,10 +2045,10 @@ var installErrorCause$1 = function (O, options) {
1969
2045
  }
1970
2046
  };
1971
2047
 
1972
- var uncurryThis$e = functionUncurryThis;
2048
+ var uncurryThis$d = functionUncurryThis;
1973
2049
 
1974
2050
  var $Error = Error;
1975
- var replace$4 = uncurryThis$e(''.replace);
2051
+ var replace$4 = uncurryThis$d(''.replace);
1976
2052
 
1977
2053
  var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
1978
2054
  // eslint-disable-next-line redos/no-vulnerable -- safe
@@ -1985,10 +2061,10 @@ var errorStackClear = function (stack, dropEntries) {
1985
2061
  } return stack;
1986
2062
  };
1987
2063
 
1988
- var fails$f = fails$s;
2064
+ var fails$e = fails$s;
1989
2065
  var createPropertyDescriptor$3 = createPropertyDescriptor$7;
1990
2066
 
1991
- var errorStackInstallable = !fails$f(function () {
2067
+ var errorStackInstallable = !fails$e(function () {
1992
2068
  var error = new Error('a');
1993
2069
  if (!('stack' in error)) return true;
1994
2070
  // eslint-disable-next-line es/no-object-defineproperty -- safe
@@ -2021,7 +2097,7 @@ var inheritIfRequired$1 = inheritIfRequired$2;
2021
2097
  var normalizeStringArgument$3 = normalizeStringArgument$4;
2022
2098
  var installErrorCause = installErrorCause$1;
2023
2099
  var installErrorStack = errorStackInstall;
2024
- var DESCRIPTORS$a = descriptors;
2100
+ var DESCRIPTORS$9 = descriptors;
2025
2101
 
2026
2102
  var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
2027
2103
  var STACK_TRACE_LIMIT = 'stackTraceLimit';
@@ -2056,7 +2132,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
2056
2132
  if (ERROR_NAME !== 'Error') {
2057
2133
  if (setPrototypeOf$1) setPrototypeOf$1(WrappedError, BaseError);
2058
2134
  else copyConstructorProperties(WrappedError, BaseError, { name: true });
2059
- } else if (DESCRIPTORS$a && STACK_TRACE_LIMIT in OriginalError) {
2135
+ } else if (DESCRIPTORS$9 && STACK_TRACE_LIMIT in OriginalError) {
2060
2136
  proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
2061
2137
  proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
2062
2138
  }
@@ -2075,7 +2151,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
2075
2151
  };
2076
2152
 
2077
2153
  /* eslint-disable no-unused-vars -- required for functions `.length` */
2078
- var $$g = _export;
2154
+ var $$f = _export;
2079
2155
  var global$e = global$p;
2080
2156
  var apply$2 = functionApply;
2081
2157
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
@@ -2089,14 +2165,14 @@ var FORCED$3 = new Error('e', { cause: 7 }).cause !== 7;
2089
2165
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
2090
2166
  var O = {};
2091
2167
  O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$3);
2092
- $$g({ global: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2168
+ $$f({ global: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2093
2169
  };
2094
2170
 
2095
2171
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
2096
2172
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
2097
2173
  var O = {};
2098
2174
  O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$3);
2099
- $$g({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2175
+ $$f({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2100
2176
  }
2101
2177
  };
2102
2178
 
@@ -2132,20 +2208,20 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
2132
2208
  return function RuntimeError(message) { return apply$2(init, this, arguments); };
2133
2209
  });
2134
2210
 
2135
- var $$f = _export;
2211
+ var $$e = _export;
2136
2212
  var $includes = arrayIncludes.includes;
2137
- var fails$e = fails$s;
2213
+ var fails$d = fails$s;
2138
2214
  var addToUnscopables = addToUnscopables$2;
2139
2215
 
2140
2216
  // FF99+ bug
2141
- var BROKEN_ON_SPARSE = fails$e(function () {
2217
+ var BROKEN_ON_SPARSE = fails$d(function () {
2142
2218
  // eslint-disable-next-line es/no-array-prototype-includes -- detection
2143
2219
  return !Array(1).includes();
2144
2220
  });
2145
2221
 
2146
2222
  // `Array.prototype.includes` method
2147
2223
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2148
- $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2224
+ $$e({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2149
2225
  includes: function includes(el /* , fromIndex = 0 */) {
2150
2226
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2151
2227
  }
@@ -2154,7 +2230,7 @@ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2154
2230
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2155
2231
  addToUnscopables('includes');
2156
2232
 
2157
- var DESCRIPTORS$9 = descriptors;
2233
+ var DESCRIPTORS$8 = descriptors;
2158
2234
  var isArray = isArray$2;
2159
2235
 
2160
2236
  var $TypeError$a = TypeError;
@@ -2162,7 +2238,7 @@ var $TypeError$a = TypeError;
2162
2238
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
2163
2239
 
2164
2240
  // Safari < 13 does not throw an error in this case
2165
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$9 && !function () {
2241
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$8 && !function () {
2166
2242
  // makes no sense without proper strict mode support
2167
2243
  if (this !== undefined) return true;
2168
2244
  try {
@@ -2189,14 +2265,14 @@ var doesNotExceedSafeInteger$1 = function (it) {
2189
2265
  return it;
2190
2266
  };
2191
2267
 
2192
- var $$e = _export;
2193
- var toObject$3 = toObject$6;
2268
+ var $$d = _export;
2269
+ var toObject$2 = toObject$6;
2194
2270
  var lengthOfArrayLike$2 = lengthOfArrayLike$4;
2195
2271
  var setArrayLength = arraySetLength;
2196
2272
  var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
2197
- var fails$d = fails$s;
2273
+ var fails$c = fails$s;
2198
2274
 
2199
- var INCORRECT_TO_LENGTH = fails$d(function () {
2275
+ var INCORRECT_TO_LENGTH = fails$c(function () {
2200
2276
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
2201
2277
  });
2202
2278
 
@@ -2215,10 +2291,10 @@ var FORCED$2 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
2215
2291
 
2216
2292
  // `Array.prototype.push` method
2217
2293
  // https://tc39.es/ecma262/#sec-array.prototype.push
2218
- $$e({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
2294
+ $$d({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
2219
2295
  // eslint-disable-next-line no-unused-vars -- required for `.length`
2220
2296
  push: function push(item) {
2221
- var O = toObject$3(this);
2297
+ var O = toObject$2(this);
2222
2298
  var len = lengthOfArrayLike$2(O);
2223
2299
  var argCount = arguments.length;
2224
2300
  doesNotExceedSafeInteger(len + argCount);
@@ -2232,8 +2308,8 @@ $$e({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
2232
2308
  });
2233
2309
 
2234
2310
  var aCallable$6 = aCallable$9;
2235
- var toObject$2 = toObject$6;
2236
- var IndexedObject$1 = indexedObject;
2311
+ var toObject$1 = toObject$6;
2312
+ var IndexedObject = indexedObject;
2237
2313
  var lengthOfArrayLike$1 = lengthOfArrayLike$4;
2238
2314
 
2239
2315
  var $TypeError$8 = TypeError;
@@ -2243,8 +2319,8 @@ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
2243
2319
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
2244
2320
  var createMethod$1 = function (IS_RIGHT) {
2245
2321
  return function (that, callbackfn, argumentsLength, memo) {
2246
- var O = toObject$2(that);
2247
- var self = IndexedObject$1(O);
2322
+ var O = toObject$1(that);
2323
+ var self = IndexedObject(O);
2248
2324
  var length = lengthOfArrayLike$1(O);
2249
2325
  aCallable$6(callbackfn);
2250
2326
  if (length === 0 && argumentsLength < 2) throw new $TypeError$8(REDUCE_EMPTY);
@@ -2277,11 +2353,11 @@ var arrayReduce = {
2277
2353
  right: createMethod$1(true)
2278
2354
  };
2279
2355
 
2280
- var fails$c = fails$s;
2356
+ var fails$b = fails$s;
2281
2357
 
2282
2358
  var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2283
2359
  var method = [][METHOD_NAME];
2284
- return !!method && fails$c(function () {
2360
+ return !!method && fails$b(function () {
2285
2361
  // eslint-disable-next-line no-useless-call -- required for testing
2286
2362
  method.call(null, argument || function () { return 1; }, 1);
2287
2363
  });
@@ -2292,7 +2368,7 @@ var classof$5 = classofRaw$2;
2292
2368
 
2293
2369
  var engineIsNode = classof$5(global$d.process) === 'process';
2294
2370
 
2295
- var $$d = _export;
2371
+ var $$c = _export;
2296
2372
  var $reduce = arrayReduce.left;
2297
2373
  var arrayMethodIsStrict = arrayMethodIsStrict$1;
2298
2374
  var CHROME_VERSION = engineV8Version;
@@ -2305,81 +2381,14 @@ var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
2305
2381
 
2306
2382
  // `Array.prototype.reduce` method
2307
2383
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
2308
- $$d({ target: 'Array', proto: true, forced: FORCED$1 }, {
2384
+ $$c({ target: 'Array', proto: true, forced: FORCED$1 }, {
2309
2385
  reduce: function reduce(callbackfn /* , initialValue */) {
2310
2386
  var length = arguments.length;
2311
2387
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2312
2388
  }
2313
2389
  });
2314
2390
 
2315
- var DESCRIPTORS$8 = descriptors;
2316
- var uncurryThis$d = functionUncurryThis;
2317
- var call$c = functionCall;
2318
- var fails$b = fails$s;
2319
- var objectKeys = objectKeys$2;
2320
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2321
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2322
- var toObject$1 = toObject$6;
2323
- var IndexedObject = indexedObject;
2324
-
2325
- // eslint-disable-next-line es/no-object-assign -- safe
2326
- var $assign = Object.assign;
2327
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2328
- var defineProperty$3 = Object.defineProperty;
2329
- var concat$1 = uncurryThis$d([].concat);
2330
-
2331
- // `Object.assign` method
2332
- // https://tc39.es/ecma262/#sec-object.assign
2333
- var objectAssign = !$assign || fails$b(function () {
2334
- // should have correct order of operations (Edge bug)
2335
- if (DESCRIPTORS$8 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
2336
- enumerable: true,
2337
- get: function () {
2338
- defineProperty$3(this, 'b', {
2339
- value: 3,
2340
- enumerable: false
2341
- });
2342
- }
2343
- }), { b: 2 })).b !== 1) return true;
2344
- // should work with symbols and should have deterministic property order (V8 bug)
2345
- var A = {};
2346
- var B = {};
2347
- // eslint-disable-next-line es/no-symbol -- safe
2348
- var symbol = Symbol('assign detection');
2349
- var alphabet = 'abcdefghijklmnopqrst';
2350
- A[symbol] = 7;
2351
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2352
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
2353
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2354
- var T = toObject$1(target);
2355
- var argumentsLength = arguments.length;
2356
- var index = 1;
2357
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2358
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
2359
- while (argumentsLength > index) {
2360
- var S = IndexedObject(arguments[index++]);
2361
- var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2362
- var length = keys.length;
2363
- var j = 0;
2364
- var key;
2365
- while (length > j) {
2366
- key = keys[j++];
2367
- if (!DESCRIPTORS$8 || call$c(propertyIsEnumerable, S, key)) T[key] = S[key];
2368
- }
2369
- } return T;
2370
- } : $assign;
2371
-
2372
- var $$c = _export;
2373
- var assign = objectAssign;
2374
-
2375
- // `Object.assign` method
2376
- // https://tc39.es/ecma262/#sec-object.assign
2377
- // eslint-disable-next-line es/no-object-assign -- required for testing
2378
- $$c({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2379
- assign: assign
2380
- });
2381
-
2382
- var makeBuiltIn = makeBuiltIn$3.exports;
2391
+ var makeBuiltIn = makeBuiltInExports;
2383
2392
  var defineProperty$2 = objectDefineProperty;
2384
2393
 
2385
2394
  var defineBuiltInAccessor$4 = function (target, name, descriptor) {
@@ -5166,8 +5175,9 @@ const createApiInstance = ({
5166
5175
  });
5167
5176
  // Response interceptor for API calls done AFTER the request is made.
5168
5177
  axiosInstance.interceptors.response.use(response => response, error => __awaiter(void 0, void 0, void 0, function* () {
5178
+ var _a;
5169
5179
  const originalRequest = error.config;
5170
- if (error.response && error.response.status && (error.response.status === 401 || error.response.status === 403) && !originalRequest.inRetry) {
5180
+ if (error.response && error.response.status && error.response.status === 401 && !originalRequest.inRetry) {
5171
5181
  originalRequest.inRetry = true;
5172
5182
  yield refreshAccessTokenAndSetAuthContext({
5173
5183
  auth,
@@ -5180,6 +5190,10 @@ const createApiInstance = ({
5180
5190
  },
5181
5191
  timeout: _timeout3
5182
5192
  });
5193
+ // Update the headers of the original request with the refreshed access token
5194
+ if ((_a = originalRequest.headers) === null || _a === void 0 ? void 0 : _a.Authorization) {
5195
+ originalRequest.headers.Authorization = `Bearer ${auth === null || auth === void 0 ? void 0 : auth.token}`;
5196
+ }
5183
5197
  return axiosInstance(originalRequest);
5184
5198
  }
5185
5199
  return Promise.reject(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/api",
3
- "version": "9.19.0",
3
+ "version": "9.20.1",
4
4
  "description": "GeoWeb API library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -17,4 +17,4 @@
17
17
  "module": "./index.esm.js",
18
18
  "type": "module",
19
19
  "main": "./index.esm.js"
20
- }
20
+ }