@opengeoweb/api 12.1.2 → 12.3.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.
package/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { useAuthenticationContext } from '@opengeoweb/authentication';
2
2
  export * from '@opengeoweb/authentication';
3
3
  import { useQuery } from '@tanstack/react-query';
4
+ import { omit } from 'lodash';
4
5
  import { HttpResponse, delay } from 'msw';
5
6
 
6
7
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
@@ -46,9 +47,9 @@ function _regeneratorRuntime() {
46
47
  function define(t, e, r) {
47
48
  return Object.defineProperty(t, e, {
48
49
  value: r,
49
- enumerable: !0,
50
- configurable: !0,
51
- writable: !0
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true
52
53
  }), t[e];
53
54
  }
54
55
  try {
@@ -141,7 +142,7 @@ function _regeneratorRuntime() {
141
142
  if ("throw" === i) throw a;
142
143
  return {
143
144
  value: t,
144
- done: !0
145
+ done: true
145
146
  };
146
147
  }
147
148
  for (n.method = i, n.arg = a;;) {
@@ -192,7 +193,7 @@ function _regeneratorRuntime() {
192
193
  function Context(t) {
193
194
  this.tryEntries = [{
194
195
  tryLoc: "root"
195
- }], t.forEach(pushTryEntry, this), this.reset(!0);
196
+ }], t.forEach(pushTryEntry, this), this.reset(true);
196
197
  }
197
198
  function values(e) {
198
199
  if (e || "" === e) {
@@ -202,8 +203,8 @@ function _regeneratorRuntime() {
202
203
  if (!isNaN(e.length)) {
203
204
  var o = -1,
204
205
  i = function next() {
205
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
206
- return next.value = t, next.done = !0, next;
206
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
207
+ return next.value = t, next.done = true, next;
207
208
  };
208
209
  return i.next = i;
209
210
  }
@@ -212,10 +213,10 @@ function _regeneratorRuntime() {
212
213
  }
213
214
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
214
215
  value: GeneratorFunctionPrototype,
215
- configurable: !0
216
+ configurable: true
216
217
  }), o(GeneratorFunctionPrototype, "constructor", {
217
218
  value: GeneratorFunction,
218
- configurable: !0
219
+ configurable: true
219
220
  }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
220
221
  var e = "function" == typeof t && t.constructor;
221
222
  return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
@@ -244,17 +245,17 @@ function _regeneratorRuntime() {
244
245
  return r.reverse(), function next() {
245
246
  for (; r.length;) {
246
247
  var t = r.pop();
247
- if (t in e) return next.value = t, next.done = !1, next;
248
+ if (t in e) return next.value = t, next.done = false, next;
248
249
  }
249
- return next.done = !0, next;
250
+ return next.done = true, next;
250
251
  };
251
252
  }, e.values = values, Context.prototype = {
252
253
  constructor: Context,
253
254
  reset: function (e) {
254
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
255
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
255
256
  },
256
257
  stop: function () {
257
- this.done = !0;
258
+ this.done = true;
258
259
  var t = this.tryEntries[0].completion;
259
260
  if ("throw" === t.type) throw t.arg;
260
261
  return this.rval;
@@ -273,10 +274,10 @@ function _regeneratorRuntime() {
273
274
  var c = n.call(i, "catchLoc"),
274
275
  u = n.call(i, "finallyLoc");
275
276
  if (c && u) {
276
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
277
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
277
278
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
278
279
  } else if (c) {
279
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
280
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
280
281
  } else {
281
282
  if (!u) throw Error("try statement without catch or finally");
282
283
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
@@ -331,11 +332,11 @@ function _regeneratorRuntime() {
331
332
  }
332
333
 
333
334
  var getHeaders = function getHeaders(auth) {
334
- return {
335
+ return omit({
335
336
  'Content-Type': 'application/json',
336
- Authorization: "Bearer " + auth.token,
337
+ Authorization: "Bearer " + (auth == null ? void 0 : auth.token),
337
338
  Accept: 'application/json'
338
- };
339
+ }, auth ? [] : ['Authorization']);
339
340
  };
340
341
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
341
342
  var handleResponse = function handleResponse(response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/api",
3
- "version": "12.1.2",
3
+ "version": "12.3.0",
4
4
  "description": "GeoWeb API library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,9 +8,10 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/authentication": "12.1.2",
12
- "@opengeoweb/store": "12.1.2",
13
- "@tanstack/react-query": "^5.52.1"
11
+ "@opengeoweb/authentication": "12.3.0",
12
+ "@opengeoweb/store": "12.3.0",
13
+ "lodash": "^4.17.21",
14
+ "@tanstack/react-query": "^5.69.2"
14
15
  },
15
16
  "module": "./index.esm.js",
16
17
  "type": "module",
package/src/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MutationOptions, QueryClient, UseQueryResult } from '@tanstack/react-query';
2
2
  import { Credentials } from '@opengeoweb/authentication';
3
- export declare const getHeaders: (auth: Credentials) => HeadersInit;
3
+ export declare const getHeaders: (auth?: Credentials) => HeadersInit;
4
4
  export declare const handleResponse: (response: Response) => Promise<any>;
5
5
  export declare const useAuthQuery: <T>(queryKey: string[], queryFn: (auth: Credentials) => Promise<T>, disabled?: boolean, refetchInterval?: number | false) => UseQueryResult<T>;
6
6
  export declare const optimisticUpdate: <U extends {