rest-client-vue 1.2.0-b3 → 1.2.1-a

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.
@@ -1,18 +1,18 @@
1
1
  var Ee = Object.defineProperty;
2
- var Ce = (h, i, g) => i in h ? Ee(h, i, { enumerable: !0, configurable: !0, writable: !0, value: g }) : h[i] = g;
3
- var oe = (h, i, g) => (Ce(h, typeof i != "symbol" ? i + "" : i, g), g), Te = (h, i, g) => {
4
- if (!i.has(h))
5
- throw TypeError("Cannot " + g);
2
+ var Ce = (h, r, R) => r in h ? Ee(h, r, { enumerable: !0, configurable: !0, writable: !0, value: R }) : h[r] = R;
3
+ var ae = (h, r, R) => (Ce(h, typeof r != "symbol" ? r + "" : r, R), R), Te = (h, r, R) => {
4
+ if (!r.has(h))
5
+ throw TypeError("Cannot " + R);
6
6
  };
7
- var Q = (h, i, g) => (Te(h, i, "read from private field"), g ? g.call(h) : i.get(h)), Se = (h, i, g) => {
8
- if (i.has(h))
7
+ var Q = (h, r, R) => (Te(h, r, "read from private field"), R ? R.call(h) : r.get(h)), Se = (h, r, R) => {
8
+ if (r.has(h))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
- i instanceof WeakSet ? i.add(h) : i.set(h, g);
10
+ r instanceof WeakSet ? r.add(h) : r.set(h, R);
11
11
  };
12
- import o from "lodash";
12
+ import a from "lodash";
13
13
  import { v4 as H } from "uuid";
14
- import { ref as I, toRef as se, computed as R, watch as $, nextTick as Le } from "vue";
15
- import x from "axios";
14
+ import { ref as I, toRef as se, computed as g, watch as $, nextTick as Le } from "vue";
15
+ import L from "axios";
16
16
  import pe from "jsog";
17
17
  import X from "json-stringify-deterministic";
18
18
  import { defineStore as me } from "pinia";
@@ -21,52 +21,52 @@ const ye = {
21
21
  useVueLogger: !1
22
22
  };
23
23
  class Be extends Error {
24
- constructor(g, U = void 0, e = void 0) {
25
- super(g);
26
- oe(this, "context");
27
- oe(this, "innerError");
28
- this.context = U, this.innerError = e;
24
+ constructor(R, w = void 0, e = void 0) {
25
+ super(R);
26
+ ae(this, "context");
27
+ ae(this, "innerError");
28
+ this.context = w, this.innerError = e;
29
29
  }
30
30
  }
31
- var O;
31
+ var _;
32
32
  class Ie {
33
33
  constructor() {
34
- Se(this, O, {});
34
+ Se(this, _, {});
35
35
  }
36
36
  clearAllStores() {
37
- for (const i in Q(this, O))
38
- Q(this, O)[i].clear();
37
+ for (const r in Q(this, _))
38
+ Q(this, _)[r].clear();
39
39
  }
40
- destroyStore(i) {
41
- Q(this, O)[i] && (Q(this, O)[i].$dispose(), delete Q(this, O)[i]);
40
+ destroyStore(r) {
41
+ Q(this, _)[r] && (Q(this, _)[r].$dispose(), delete Q(this, _)[r]);
42
42
  }
43
- getStore(i) {
44
- return Q(this, O)[i];
43
+ getStore(r) {
44
+ return Q(this, _)[r];
45
45
  }
46
- registerStore(i, g) {
47
- Q(this, O)[i] = g;
46
+ registerStore(r, R) {
47
+ Q(this, _)[r] = R;
48
48
  }
49
49
  }
50
- O = new WeakMap();
51
- function v(h, i) {
52
- return o.get(h, (i == null ? void 0 : i.idProperty) || "_id");
50
+ _ = new WeakMap();
51
+ function v(h, r) {
52
+ return a.get(h, (r == null ? void 0 : r.idProperty) || "_id");
53
53
  }
54
- function $e(h, i) {
55
- const g = o.map(
56
- i,
57
- (U, e) => U != null ? `${encodeURIComponent(e)}=${encodeURIComponent(U)}` : null
58
- ).filter((U) => U != null).join("&");
59
- if (g.length > 0) {
60
- const U = h.indexOf("?");
61
- return U == h.length - 1 ? `${h}${g}` : U >= 0 ? `${h}&${g}` : `${h}?${g}`;
54
+ function $e(h, r) {
55
+ const R = a.map(
56
+ r,
57
+ (w, e) => w != null ? `${encodeURIComponent(e)}=${encodeURIComponent(w)}` : null
58
+ ).filter((w) => w != null).join("&");
59
+ if (R.length > 0) {
60
+ const w = h.indexOf("?");
61
+ return w == h.length - 1 ? `${h}${R}` : w >= 0 ? `${h}&${R}` : `${h}?${R}`;
62
62
  } else
63
63
  return h;
64
64
  }
65
- function xe(h, i) {
66
- var g;
67
- return h && ((g = i.filter) != null && g.resourceIds) && !i.order ? i.filter.resourceIds.map((U) => h.find((e) => v(e, i) == U)).filter((U) => U != null) : h;
65
+ function xe(h, r) {
66
+ var R;
67
+ return h && ((R = r.filter) != null && R.resourceIds) && !r.order ? r.filter.resourceIds.map((w) => h.find((e) => v(e, r) == w)).filter((w) => w != null) : h;
68
68
  }
69
- const Ue = {
69
+ const we = {
70
70
  detail: {
71
71
  allowMultiple: !0,
72
72
  autoEdit: !1,
@@ -80,9 +80,6 @@ const Ue = {
80
80
  query: null,
81
81
  resourceIds: null
82
82
  },
83
- hooks: {
84
- beforeLoadResources: null
85
- },
86
83
  idProperty: "_id",
87
84
  limit: 5e3,
88
85
  limitTransientDataToLocalCollection: !0,
@@ -102,25 +99,24 @@ const Ue = {
102
99
  selection: [],
103
100
  detailSelection: [],
104
101
  invalidResources: [],
105
- transientData: {},
106
- _isBeforeLoad: !0
107
- }, ae = {
102
+ transientData: {}
103
+ }, oe = {
108
104
  editingDetailSelection: !1,
109
105
  batchSaveAttempted: !1,
110
106
  editors: [],
111
107
  listNavigators: {}
112
- }, Pe = (h, i) => {
113
- i = o.merge({}, Ue, i);
114
- const g = me(h, {
108
+ }, Pe = (h, r) => {
109
+ r = a.merge({}, we, r);
110
+ const R = me(h, {
115
111
  state: () => ({
116
- idProperty: i.idProperty,
117
- filter: i.filter,
118
- order: i.order || null,
119
- propertiesToExclude: i.propertiesToExclude || null,
120
- referencePathsToExpand: i.referencePathsToExpand || null,
121
- restCollectionUrl: i.restCollectionUrl,
112
+ idProperty: r.idProperty,
113
+ filter: r.filter,
114
+ order: r.order || null,
115
+ propertiesToExclude: r.propertiesToExclude || null,
116
+ referencePathsToExpand: r.referencePathsToExpand || null,
117
+ restCollectionUrl: r.restCollectionUrl,
122
118
  ...Y,
123
- ...ae
119
+ ...oe
124
120
  }),
125
121
  getters: {
126
122
  /**
@@ -130,14 +126,14 @@ const Ue = {
130
126
  */
131
127
  fixedQueryParams: (e) => {
132
128
  var l, u, c, d;
133
- const r = {};
134
- (l = e.filter) != null && l.namedFilter && (r.namedFilter = e.filter.namedFilter);
129
+ const i = {};
130
+ (l = e.filter) != null && l.namedFilter && (i.namedFilter = e.filter.namedFilter);
135
131
  const t = [];
136
132
  if ((u = e.filter) != null && u.resourceIds && t.push({ l: { path: e.idProperty }, r: { constant: e.filter.resourceIds }, operator: "in" }), (c = e.filter) != null && c.query && t.push((d = e.filter) == null ? void 0 : d.query), t.length > 0) {
137
133
  const m = t.length == 1 ? t[0] : { and: t };
138
- r.q = X(m);
134
+ i.q = X(m);
139
135
  }
140
- return e.order && (r.o = X(e.order)), e.propertiesToExclude && (r.ex = X(e.propertiesToExclude)), e.referencePathsToExpand && (r.r = X(e.referencePathsToExpand)), r;
136
+ return e.order && (i.o = X(e.order)), e.propertiesToExclude && (i.ex = X(e.propertiesToExclude)), e.referencePathsToExpand && (i.r = X(e.referencePathsToExpand)), i;
141
137
  }
142
138
  },
143
139
  actions: {
@@ -152,8 +148,8 @@ const Ue = {
152
148
  reset() {
153
149
  for (const e in Y)
154
150
  this[e] = Y[e];
155
- for (const e in ae)
156
- this[e] = ae[e];
151
+ for (const e in oe)
152
+ this[e] = oe[e];
157
153
  },
158
154
  /**
159
155
  * Reset the store to its initial state, but retain transient data if appropriate.
@@ -162,7 +158,7 @@ const Ue = {
162
158
  * Transient data are retained if options.limitTransientDataToLocalCollection is false.
163
159
  */
164
160
  resetRetainingTransientData() {
165
- if (i.limitTransientDataToLocalCollection)
161
+ if (r.limitTransientDataToLocalCollection)
166
162
  this.reset();
167
163
  else {
168
164
  const e = this.transientData;
@@ -193,7 +189,7 @@ const Ue = {
193
189
  * @param filter The new filter.
194
190
  */
195
191
  setFilter(e) {
196
- o.isEqual(e, this.filter) || (this.filter = e, this.status = "NotLoaded", this.resources = [], this.remoteCollectionSize = null, this.selection = [], this.detailSelection = [], this.invalidResources = [], this.editingDetailSelection = !1);
192
+ a.isEqual(e, this.filter) || (this.filter = e, this.status = "NotLoaded", this.resources = [], this.remoteCollectionSize = null, this.selection = [], this.detailSelection = [], this.invalidResources = [], this.editingDetailSelection = !1);
197
193
  },
198
194
  /**
199
195
  * Set the filter query.
@@ -205,10 +201,10 @@ const Ue = {
205
201
  * need to be reloaded.
206
202
  */
207
203
  async setQuery(e) {
208
- var r, t;
209
- if (!o.isEqual(e, (r = this.filter) == null ? void 0 : r.query) && (e != null || ((t = this.filter) == null ? void 0 : t.query) != null)) {
210
- const l = o.cloneDeep(this.filter) || {};
211
- e !== null ? l.query = e : o.unset(l, "query");
204
+ var i, t;
205
+ if (!a.isEqual(e, (i = this.filter) == null ? void 0 : i.query) && (e != null || ((t = this.filter) == null ? void 0 : t.query) != null)) {
206
+ const l = a.cloneDeep(this.filter) || {};
207
+ e !== null ? l.query = e : a.unset(l, "query");
212
208
  const u = this.status;
213
209
  this.setFilter(l), u != "NotLoaded" && await this.loadResources();
214
210
  }
@@ -223,11 +219,11 @@ const Ue = {
223
219
  * need to be reloaded.
224
220
  */
225
221
  async setFilterResourceIds(e) {
226
- if (!o.isEqual(e, o.get(this.filter, "resourceIds"))) {
227
- const r = o.cloneDeep(this.filter) || {};
228
- e != null ? r.resourceIds = e : o.unset(r, "resourceIds");
222
+ if (!a.isEqual(e, a.get(this.filter, "resourceIds"))) {
223
+ const i = a.cloneDeep(this.filter) || {};
224
+ e != null ? i.resourceIds = e : a.unset(i, "resourceIds");
229
225
  const t = this.status;
230
- this.setFilter(r), t != "NotLoaded" && await this.loadResources();
226
+ this.setFilter(i), t != "NotLoaded" && await this.loadResources();
231
227
  }
232
228
  },
233
229
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -263,7 +259,7 @@ const Ue = {
263
259
  * Transient data are retained if options.limitTransientDataToLocalCollection is false.
264
260
  */
265
261
  clearRetainingTransientData() {
266
- if (i.limitTransientDataToLocalCollection)
262
+ if (r.limitTransientDataToLocalCollection)
267
263
  this.reset();
268
264
  else {
269
265
  const e = this.transientData;
@@ -288,8 +284,8 @@ const Ue = {
288
284
  */
289
285
  async loadResources(e = {}) {
290
286
  this.resetRetainingTransientData();
291
- const r = H();
292
- this._loadId = r, await this._loadResources(0, r, e);
287
+ const i = H();
288
+ this._loadId = i, await this._loadResources(0, i, e);
293
289
  },
294
290
  /**
295
291
  * Load the collection, optionally starting at some offset.
@@ -304,40 +300,30 @@ const Ue = {
304
300
  * be written to the store's state property named loadId.
305
301
  * @param loadOptions Pagination options that may override the defaults.
306
302
  */
307
- async _loadResources(e, r, t) {
308
- var P, A, N, _, k;
303
+ async _loadResources(e, i, t) {
304
+ var x, A, N, O, k;
309
305
  const l = e == 0;
310
- if (this.status = l ? "Loading" : "LoadingMore", this._isBeforeLoad && i.hooks.beforeLoadResources) {
311
- const E = i.hooks.beforeLoadResources();
312
- if (o.isArray(E)) {
313
- this.resources = E, this.status = "Loaded";
314
- return;
315
- } else if (E === !1) {
316
- this.status = "Failed";
317
- return;
318
- }
319
- }
320
- if (this._isBeforeLoad = !1, this._loadOffset = e, ((P = this.filter) == null ? void 0 : P.query) === !1) {
306
+ if (this.status = l ? "Loading" : "LoadingMore", this._loadOffset = e, ((x = this.filter) == null ? void 0 : x.query) === !1) {
321
307
  this.resources = [], this.remoteCollectionSize = 0;
322
308
  return;
323
309
  }
324
- const u = this.fixedQueryParams, c = o.cloneDeep(u), d = l ? (A = this.filter) != null && A.resourceIds && !this.order ? null : t.firstPageSize || ((N = i.loading) == null ? void 0 : N.firstPageSize) || t.pageSize || ((_ = i.loading) == null ? void 0 : _.pageSize) || null : t.pageSize || ((k = i.loading) == null ? void 0 : k.pageSize) || null, m = d != null || i.limit != null ? o.min(o.filter([d, i.limit], (E) => E != null)) : void 0;
310
+ const u = this.fixedQueryParams, c = a.cloneDeep(u), d = l ? (A = this.filter) != null && A.resourceIds && !this.order ? null : t.firstPageSize || ((N = r.loading) == null ? void 0 : N.firstPageSize) || t.pageSize || ((O = r.loading) == null ? void 0 : O.pageSize) || null : t.pageSize || ((k = r.loading) == null ? void 0 : k.pageSize) || null, m = d != null || r.limit != null ? a.min(a.filter([d, r.limit], (P) => P != null)) : void 0;
325
311
  m != null ? (c.offset = e, c.limit = m) : e != 0 && (c.offset = e);
326
- const w = $e(i.restCollectionUrl, c);
312
+ const D = $e(r.restCollectionUrl, c);
327
313
  try {
328
- const E = await x.get(w), y = this.fixedQueryParams;
329
- if (r != this._loadId || e != this._loadOffset || !o.isEqual(u, y))
330
- console.log(`Discarding resources fetched by obsolete query from ${i.restCollectionUrl}.`);
314
+ const P = await L.get(D), y = this.fixedQueryParams;
315
+ if (i != this._loadId || e != this._loadOffset || !a.isEqual(u, y))
316
+ console.log(`Discarding resources fetched by obsolete query from ${r.restCollectionUrl}.`);
331
317
  else {
332
- const S = pe.decode(o.get(E, "data.data", [])), L = (l ? 0 : this.resources.length) + S.length, C = m == null || S.length < m || i.limit && L >= i.limit;
318
+ const S = pe.decode(a.get(P, "data.data", [])), T = (l ? 0 : this.resources.length) + S.length, E = m == null || S.length < m || r.limit && T >= r.limit;
333
319
  console.log(
334
- `Loaded ${S.length}${l ? "" : " more"} resources from ${i.restCollectionUrl}`
320
+ `Loaded ${S.length}${l ? "" : " more"} resources from ${r.restCollectionUrl}`
335
321
  ), l && (this.resources = []);
336
- const D = [...this.resources, ...S.map((W) => Object.freeze(W))];
337
- this.resources = xe(D, this), o.get(E, "data.totalCollectionSize") ? this.remoteCollectionSize = o.get(E, "data.totalCollectionSize") : this.remoteCollectionSize = null, this.status = C ? "Loaded" : "LoadingMore", C || this._loadResources(this.resources.length, r, t);
322
+ const U = [...this.resources, ...S.map((W) => Object.freeze(W))];
323
+ this.resources = xe(U, this), a.get(P, "data.totalCollectionSize") ? this.remoteCollectionSize = a.get(P, "data.totalCollectionSize") : this.remoteCollectionSize = null, this.status = E ? "Loaded" : "LoadingMore", E || this._loadResources(this.resources.length, i, t);
338
324
  }
339
- } catch (E) {
340
- console.log(`Error while loading resources (URL="${w}"):`, E), this.clearRetainingTransientData(), this.status = "Failed";
325
+ } catch (P) {
326
+ console.log(`Error while loading resources (URL="${D}"):`, P), this.clearRetainingTransientData(), this.status = "Failed";
341
327
  }
342
328
  },
343
329
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -353,13 +339,13 @@ const Ue = {
353
339
  * @return true if the record does not exist in the remote collection, false if it does or if an error occurred.
354
340
  */
355
341
  async checkForDeletedResource(e) {
356
- let r;
342
+ let i;
357
343
  try {
358
- r = await x.get(`${i.restCollectionUrl}/${e}`);
344
+ i = await L.get(`${r.restCollectionUrl}/${e}`);
359
345
  } catch (t) {
360
- x.isAxiosError(t) && (r = t.response);
346
+ L.isAxiosError(t) && (i = t.response);
361
347
  }
362
- return r && r.status == 404 ? (this.recordDeletion(e), !0) : !1;
348
+ return i && i.status == 404 ? (this.recordDeletion(e), !0) : !1;
363
349
  },
364
350
  /**
365
351
  * Record a deletion, removing the deleted resource from the local collection.
@@ -371,10 +357,10 @@ const Ue = {
371
357
  * @param resourceId The ID of the resource that has been deleted.
372
358
  */
373
359
  recordDeletion(e) {
374
- var r;
360
+ var i;
375
361
  if (["Loaded", "LoadingMore"].includes(this.status)) {
376
362
  let t = this.resources.findIndex((l) => v(l, this) == e);
377
- t >= 0 && this.resources.splice(t, 1), t = this.selection.findIndex((l) => v(l, this) == e), t >= 0 && this.selection.splice(t, 1), t = this.detailSelection.findIndex((l) => v(l, this) == e), t >= 0 && (this.detailSelection.splice(t, 1), this.detailSelection.length == 0 && (this.editingDetailSelection = ((r = i.detail) == null ? void 0 : r.autoEdit) || !1)), i.limitTransientDataToLocalCollection && delete this.transientData[e];
363
+ t >= 0 && this.resources.splice(t, 1), t = this.selection.findIndex((l) => v(l, this) == e), t >= 0 && this.selection.splice(t, 1), t = this.detailSelection.findIndex((l) => v(l, this) == e), t >= 0 && (this.detailSelection.splice(t, 1), this.detailSelection.length == 0 && (this.editingDetailSelection = ((i = r.detail) == null ? void 0 : i.autoEdit) || !1)), r.limitTransientDataToLocalCollection && delete this.transientData[e];
378
364
  }
379
365
  },
380
366
  /**
@@ -392,11 +378,11 @@ const Ue = {
392
378
  * @param resource The item that has been inserted.
393
379
  * @param TODO
394
380
  */
395
- recordInsertion(e, { insertAtBeginning: r, transientData: t } = {}) {
381
+ recordInsertion(e, { insertAtBeginning: i, transientData: t } = {}) {
396
382
  var l;
397
383
  if (["Loaded", "LoadingMore"].includes(this.status)) {
398
384
  const u = Object.freeze(e);
399
- r ? this.resources.unshift(u) : this.resources.push(u), (l = i.detail) != null && l.autoFromSingleInsertion && (this.detailSelection.length == 0 || this.detailSelection.length == 1 && v(this.detailSelection[0], this) == null) && (this.detailSelection = [u], this.editingDetailSelection = i.detail.autoEdit);
385
+ i ? this.resources.unshift(u) : this.resources.push(u), (l = r.detail) != null && l.autoFromSingleInsertion && (this.detailSelection.length == 0 || this.detailSelection.length == 1 && v(this.detailSelection[0], this) == null) && (this.detailSelection = [u], this.editingDetailSelection = r.detail.autoEdit);
400
386
  const c = v(e, this);
401
387
  c && (t === void 0 ? delete this.transientData[c] : this.transientData[c] = t);
402
388
  }
@@ -416,11 +402,11 @@ const Ue = {
416
402
  * @param resource The item that has been updated.
417
403
  */
418
404
  recordUpdate(e) {
419
- const r = v(e, this);
420
- if (r && ["Loaded", "LoadingMore"].includes(this.status)) {
405
+ const i = v(e, this);
406
+ if (i && ["Loaded", "LoadingMore"].includes(this.status)) {
421
407
  const t = Object.freeze(e);
422
- let l = this.resources.findIndex((u) => v(u, this) == r);
423
- l >= 0 && (this.resources[l] = t), l = this.selection.findIndex((u) => v(u, this) == r), l >= 0 && (this.selection[l] = t), l = this.detailSelection.findIndex((u) => v(u, this) == r), l >= 0 && (this.detailSelection[l] = t);
408
+ let l = this.resources.findIndex((u) => v(u, this) == i);
409
+ l >= 0 && (this.resources[l] = t), l = this.selection.findIndex((u) => v(u, this) == i), l >= 0 && (this.selection[l] = t), l = this.detailSelection.findIndex((u) => v(u, this) == i), l >= 0 && (this.detailSelection[l] = t);
424
410
  }
425
411
  },
426
412
  /**
@@ -437,12 +423,12 @@ const Ue = {
437
423
  */
438
424
  async refreshResource(e) {
439
425
  if (e) {
440
- const r = {};
441
- this.referencePathsToExpand && (r.r = X(this.referencePathsToExpand));
442
- const t = o.map(
443
- r,
426
+ const i = {};
427
+ this.referencePathsToExpand && (i.r = X(this.referencePathsToExpand));
428
+ const t = a.map(
429
+ i,
444
430
  (c, d) => c != null ? `${encodeURIComponent(d)}=${encodeURIComponent(c)}` : null
445
- ).filter((c) => c != null).join("&"), l = o.isEmpty(t) ? `${i.restCollectionUrl}/${e}` : `${i.restCollectionUrl}/${e}?${t}`, u = await x.get(l);
431
+ ).filter((c) => c != null).join("&"), l = a.isEmpty(t) ? `${r.restCollectionUrl}/${e}` : `${r.restCollectionUrl}/${e}?${t}`, u = await L.get(l);
446
432
  if (u.status == 200) {
447
433
  const c = u.data;
448
434
  return this.recordUpdate(c), c;
@@ -459,7 +445,7 @@ const Ue = {
459
445
  * @param resourceDefaults Initial properties of the new resource.
460
446
  */
461
447
  addResource(e = {}) {
462
- this.detailSelection = [o.omit(o.merge({}, e), this.idProperty)], this.editingDetailSelection = !0;
448
+ this.detailSelection = [a.omit(a.merge({}, e), this.idProperty)], this.editingDetailSelection = !0;
463
449
  },
464
450
  /**
465
451
  * Delete one resource.
@@ -469,9 +455,9 @@ const Ue = {
469
455
  * @param resourceId The ID of the resource to delete.
470
456
  */
471
457
  async deleteResource(e) {
472
- if ((await x.delete(`${i.restCollectionUrl}/${e}`)).status == 200 && ["Loaded", "LoadingMore"].includes(this.status)) {
458
+ if ((await L.delete(`${r.restCollectionUrl}/${e}`)).status == 200 && ["Loaded", "LoadingMore"].includes(this.status)) {
473
459
  let t = this.resources.findIndex((l) => v(l, this) == e);
474
- t >= 0 && this.resources.splice(t, 1), t = this.selection.findIndex((l) => v(l, this) == e), t >= 0 && this.selection.splice(t, 1), t = this.detailSelection.findIndex((l) => v(l, this) == e), t >= 0 && (this.detailSelection.splice(t, 1), this.detailSelection.length == 0 && (this.editingDetailSelection = i.detail.autoEdit)), i.limitTransientDataToLocalCollection && delete this.transientData[e];
460
+ t >= 0 && this.resources.splice(t, 1), t = this.selection.findIndex((l) => v(l, this) == e), t >= 0 && this.selection.splice(t, 1), t = this.detailSelection.findIndex((l) => v(l, this) == e), t >= 0 && (this.detailSelection.splice(t, 1), this.detailSelection.length == 0 && (this.editingDetailSelection = r.detail.autoEdit)), r.limitTransientDataToLocalCollection && delete this.transientData[e];
475
461
  }
476
462
  },
477
463
  /**
@@ -486,9 +472,9 @@ const Ue = {
486
472
  * the operation failed.
487
473
  */
488
474
  async saveResource(e) {
489
- const r = v(e, this), t = r == null, l = await x({
475
+ const i = v(e, this), t = i == null, l = await L({
490
476
  method: t ? "post" : "put",
491
- url: t ? i.restCollectionUrl : `${i.restCollectionUrl}/${r}`,
477
+ url: t ? r.restCollectionUrl : `${r.restCollectionUrl}/${i}`,
492
478
  data: e
493
479
  });
494
480
  if (l.status == 200) {
@@ -508,39 +494,64 @@ const Ue = {
508
494
  * @returns An array of refreshed local resources, one for each remote resource whose save operation succeeded.
509
495
  */
510
496
  async saveResources(e) {
511
- const r = await x({
497
+ const i = await L({
512
498
  method: "put",
513
- url: i.restCollectionUrl,
499
+ url: r.restCollectionUrl,
514
500
  data: e
515
501
  });
516
- if (r.status == 200) {
517
- const t = r.data || [], l = [];
502
+ if (i.status == 200) {
503
+ const t = i.data || [], l = [];
518
504
  for (const [u, c] of t.entries()) {
519
- const d = v(e[u], this) == null, m = v(c, this), w = m ? await this.refreshResource(m) : null;
520
- d && this.recordInsertion(w || c), l.push(w || Object.freeze(c));
505
+ const d = v(e[u], this) == null, m = v(c, this), D = m ? await this.refreshResource(m) : null;
506
+ d && this.recordInsertion(D || c), l.push(D || Object.freeze(c));
521
507
  }
522
508
  return l;
523
509
  }
524
510
  return [];
525
511
  },
526
512
  /**
527
- * Perform an update on one or more resources of the remote collection, then mirror the changes in the local collection.
513
+ * Perform an update of a resource of the remote collection, then mirror the changes in the local collection.
514
+ *
515
+ * After writing changes, {@link refreshResource} is called to ensure that the local resource (which is also the
516
+ * return value) has the same object-graph characteristics as the rest of the local collection.
517
+ *
518
+ * @param partialResource The partial resource to merge.
519
+ * @returns The refreshed local resource after the change has been persisted to the remote collection, or null if
520
+ * the operation failed.
521
+ */
522
+ async updateResource(e) {
523
+ const i = v(e, this);
524
+ if (!i)
525
+ throw "To update a REST collection resource, the resource must have an ID.";
526
+ const t = await L({
527
+ method: "patch",
528
+ url: `${r.restCollectionUrl}/${i}`,
529
+ data: e
530
+ });
531
+ if (t.status == 200) {
532
+ const l = t.data, u = v(l, this);
533
+ return (u ? await this.refreshResource(u) : null) || l;
534
+ }
535
+ return null;
536
+ },
537
+ /**
538
+ * Perform an update of multiple resource of the remote collection, then mirror the changes in the local collection.
528
539
  *
529
540
  * After writing changes, {@link refreshResource} is called to ensure that the local resource (which is also the
530
541
  * return value) has the same object-graph characteristics as the rest of the local collection.
531
542
  *
532
- * @param resourcePropertyUpdates The list of update operations to perform, each having ID, property path, value, and update method.
543
+ * @param partialResources The partial resources to merge.
533
544
  * @returns The refreshed local resource after the change has been persisted to the remote collection, or null if
534
545
  * the operation failed.
535
546
  */
536
547
  async updateResources(e) {
537
- const r = await x({
548
+ const i = await L({
538
549
  method: "patch",
539
- url: i.restCollectionUrl,
550
+ url: `${r.restCollectionUrl}`,
540
551
  data: e
541
552
  });
542
- if (r.status == 200) {
543
- const t = r.data || [], l = [];
553
+ if (i.status == 200) {
554
+ const t = i.data || [], l = [];
544
555
  for (const u of t) {
545
556
  const c = v(u, this), d = c ? await this.refreshResource(c) : null;
546
557
  l.push(d || Object.freeze(u));
@@ -564,7 +575,7 @@ const Ue = {
564
575
  * @param resourceIds The IDs of all local resources that failed validation.
565
576
  */
566
577
  setInvalidResourceIds(e) {
567
- o.isEqual(e, this.invalidResources.map((r) => v(r, this))) || (this.invalidResources = e.map((r) => this.resources.find((t) => v(t, this) == r)).filter((r) => r != null));
578
+ a.isEqual(e, this.invalidResources.map((i) => v(i, this))) || (this.invalidResources = e.map((i) => this.resources.find((t) => v(t, this) == i)).filter((i) => i != null));
568
579
  },
569
580
  /**
570
581
  * Set transient data.
@@ -574,8 +585,8 @@ const Ue = {
574
585
  * the transient data for each resource ID in the keys of transientData.
575
586
  */
576
587
  setTransientDataForResources(e) {
577
- const { transientData: r, merge: t = !0 } = e;
578
- t ? o.merge(this.transientData, r) : o.assign(this.transientData, r);
588
+ const { transientData: i, merge: t = !0 } = e;
589
+ t ? a.merge(this.transientData, i) : a.assign(this.transientData, i);
579
590
  },
580
591
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
581
592
  // Actions: Managing selections
@@ -592,8 +603,8 @@ const Ue = {
592
603
  * @param resourceIds The IDs of resources to remove from the selection.
593
604
  */
594
605
  deselectResources(e) {
595
- const r = this.selection.map((t) => v(t, this)).filter((t) => t != null && !e.includes(t));
596
- this.setSelection(r);
606
+ const i = this.selection.map((t) => v(t, this)).filter((t) => t != null && !e.includes(t));
607
+ this.setSelection(i);
597
608
  },
598
609
  /**
599
610
  * Add to or replace the selection.
@@ -603,14 +614,14 @@ const Ue = {
603
614
  * @param edit If not undefined, sets the editing mode of the new selection. If undefined, the editing mode will
604
615
  * be left as is, or set to true if options.detail.autoEdit is true.
605
616
  */
606
- selectResources(e, r) {
607
- const { addToSelection: t, edit: l } = r || {}, u = this.selection.map((d) => v(d, this));
617
+ selectResources(e, i) {
618
+ const { addToSelection: t, edit: l } = i || {}, u = this.selection.map((d) => v(d, this));
608
619
  let c = e;
609
620
  if (t) {
610
- const d = o.difference(e, u);
621
+ const d = a.difference(e, u);
611
622
  d.length > 0 && (c = u.concat(d).filter((m) => m != null));
612
623
  }
613
- o.isEqual(u, c) || this.setSelection(c, l);
624
+ a.isEqual(u, c) || this.setSelection(c, l);
614
625
  },
615
626
  /**
616
627
  * Set a new selection.
@@ -619,34 +630,34 @@ const Ue = {
619
630
  * @param edit If not undefined, sets the editing mode of the new selection. If undefined, the editing mode will
620
631
  * be left as is, or set to true if options.detail.autoEdit is true.
621
632
  */
622
- setSelection(e, r) {
623
- if (!o.isEqual(e, this.selection.map((t) => v(t, this)))) {
633
+ setSelection(e, i) {
634
+ if (!a.isEqual(e, this.selection.map((t) => v(t, this)))) {
624
635
  let t = !0;
625
636
  if (this.editors.length > 0) {
626
- if (i.detail.autoFromSingleSelection && this.selection.length == 1)
637
+ if (r.detail.autoFromSingleSelection && this.selection.length == 1)
627
638
  t = !1;
628
- else if (i.detail.autoFromMultipleSelection && i.detail.allowMultiple && this.selection.length > 1)
639
+ else if (r.detail.autoFromMultipleSelection && r.detail.allowMultiple && this.selection.length > 1)
629
640
  t = !1;
630
- else if (i.detail.constrainToSelection) {
641
+ else if (r.detail.constrainToSelection) {
631
642
  const l = this.selection.map((d) => v(d, this)), c = this.detailSelection.map((d) => v(d, this)).filter((d) => l.includes(d));
632
643
  this.detailSelection.filter((d) => !c.includes(v(d, this))).length > 0 && (t = !1);
633
644
  }
634
645
  }
635
646
  if (!t)
636
647
  return;
637
- if (this.selection = e.map((l) => this.resources.find((u) => v(u, this) == l)).filter((l) => l != null), i.detail.autoFromSingleSelection && this.selection.length == 1) {
648
+ if (this.selection = e.map((l) => this.resources.find((u) => v(u, this) == l)).filter((l) => l != null), r.detail.autoFromSingleSelection && this.selection.length == 1) {
638
649
  const l = this.selection[0];
639
650
  (this.detailSelection.length != 1 || v(this.detailSelection[0], this) != v(l, this)) && (this.detailSelection = [l]);
640
- } else if (i.detail.autoFromMultipleSelection && i.detail.allowMultiple && this.selection.length > 1)
641
- o.isEqual(
651
+ } else if (r.detail.autoFromMultipleSelection && r.detail.allowMultiple && this.selection.length > 1)
652
+ a.isEqual(
642
653
  this.selection.map((l) => v(l, this)),
643
654
  this.detailSelection.map((l) => v(l, this))
644
- ) || (this.detailSelection = o.clone(this.selection));
645
- else if (i.detail.constrainToSelection) {
655
+ ) || (this.detailSelection = a.clone(this.selection));
656
+ else if (r.detail.constrainToSelection) {
646
657
  const l = this.selection.map((d) => v(d, this)), u = this.detailSelection.map((d) => v(d, this)), c = u.filter((d) => l.includes(d));
647
- o.isEqual(c, u) || (this.detailSelection = this.detailSelection.filter((d) => c.includes(v(d, this))));
658
+ a.isEqual(c, u) || (this.detailSelection = this.detailSelection.filter((d) => c.includes(v(d, this))));
648
659
  }
649
- this.detailSelection.length == 0 ? this.editingDetailSelection = !1 : this.editingDetailSelection = r !== void 0 ? r : this.editingDetailSelection || i.detail.autoEdit;
660
+ this.detailSelection.length == 0 ? this.editingDetailSelection = !1 : this.editingDetailSelection = i !== void 0 ? i : this.editingDetailSelection || r.detail.autoEdit;
650
661
  }
651
662
  },
652
663
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -670,9 +681,9 @@ const Ue = {
670
681
  * or set to true if options.detail.autoEdit is true.
671
682
  */
672
683
  showSelectionAsDetail(e) {
673
- if (this.selection.length <= 1 || i.detail.allowMultiple) {
674
- const r = this.selection.map((l) => v(l, this)), t = this.detailSelection.map((l) => v(l, this));
675
- o.isEqual(r, t) || (this.detailSelection = o.clone(this.selection)), this.detailSelection.length == 0 ? this.editingDetailSelection = !1 : this.editingDetailSelection = e !== void 0 ? e : this.editingDetailSelection || i.detail.autoEdit;
684
+ if (this.selection.length <= 1 || r.detail.allowMultiple) {
685
+ const i = this.selection.map((l) => v(l, this)), t = this.detailSelection.map((l) => v(l, this));
686
+ a.isEqual(i, t) || (this.detailSelection = a.clone(this.selection)), this.detailSelection.length == 0 ? this.editingDetailSelection = !1 : this.editingDetailSelection = e !== void 0 ? e : this.editingDetailSelection || r.detail.autoEdit;
676
687
  }
677
688
  },
678
689
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -684,7 +695,7 @@ const Ue = {
684
695
  * @param editor The editor to deregister.
685
696
  */
686
697
  deregisterEditor(e) {
687
- o.remove(this.editors, (r) => r == e);
698
+ a.remove(this.editors, (i) => i == e);
688
699
  },
689
700
  /**
690
701
  * Register an editor.
@@ -704,8 +715,8 @@ const Ue = {
704
715
  * @param listNavigator The list navigator. If defined, the named list navigator will only be deleted if it equals
705
716
  * this parameter.
706
717
  */
707
- deregisterListNavigator({ name: e, listNavigator: r }) {
708
- (r == null || this.listNavigators[e] == r) && delete this.listNavigators[e];
718
+ deregisterListNavigator({ name: e, listNavigator: i }) {
719
+ (i == null || this.listNavigators[e] == i) && delete this.listNavigators[e];
709
720
  },
710
721
  /**
711
722
  * Register a list navigator.
@@ -719,162 +730,162 @@ const Ue = {
719
730
  * @param name The name under which to register the list navigator.
720
731
  * @param listNavigator The list navigator.
721
732
  */
722
- registerListNavigator({ name: e, listNavigator: r }) {
723
- this.listNavigators[e] != r && (this.listNavigators[e] = r);
733
+ registerListNavigator({ name: e, listNavigator: i }) {
734
+ this.listNavigators[e] != i && (this.listNavigators[e] = i);
724
735
  }
725
736
  }
726
737
  });
727
738
  return (() => {
728
- const e = (r, t) => {
729
- const l = g(r, t);
739
+ const e = (i, t) => {
740
+ const l = R(i, t);
730
741
  return ie.registerStore(l.$id, l), l;
731
742
  };
732
- return e.$id = g.$id, e;
743
+ return e.$id = R.$id, e;
733
744
  })();
734
745
  }, ie = new Ie(), Qe = (h = {}) => {
735
746
  var ue, de, he, fe;
736
747
  const {
737
- collectionId: i,
738
- draftBatchId: g,
739
- enabled: U,
748
+ collectionId: r,
749
+ draftBatchId: R,
750
+ enabled: w,
740
751
  resourceType: e,
741
- options: r
742
- } = h, t = I(void 0), l = I(i), u = I(g), c = I(U ?? !0), d = I([se(e)]), m = I(r), w = R(() => u.value), P = I(c.value), A = I(H()), N = I((de = (ue = m.value) == null ? void 0 : ue.filter) == null ? void 0 : de.resourceIds), _ = I((fe = (he = m.value) == null ? void 0 : he.filter) == null ? void 0 : fe.query), k = R(
752
+ options: i
753
+ } = h, t = I(void 0), l = I(r), u = I(R), c = I(w ?? !0), d = I([se(e)]), m = I(i), D = g(() => u.value), x = I(c.value), A = I(H()), N = I((de = (ue = m.value) == null ? void 0 : ue.filter) == null ? void 0 : de.resourceIds), O = I((fe = (he = m.value) == null ? void 0 : he.filter) == null ? void 0 : fe.query), k = g(
743
754
  () => u.value == null && l.value != null && ie.getStore(l.value) != null
744
- ), E = I(k.value), y = R(() => C("status", "Uninitialized"));
755
+ ), P = I(k.value), y = g(() => E("status", "Uninitialized"));
745
756
  function S(s) {
746
757
  if (t.value)
747
758
  return s(t.value);
748
759
  }
749
- async function L(s) {
760
+ async function T(s) {
750
761
  if (t.value)
751
762
  return await s(t.value);
752
763
  }
753
- function C(s, n) {
764
+ function E(s, o) {
754
765
  if (t.value)
755
766
  return t.value[s];
756
- if (n !== void 0)
757
- return n;
767
+ if (o !== void 0)
768
+ return o;
758
769
  throw "Attempted to use a REST collection store that has not been created, with no default value.";
759
770
  }
760
- const D = (s = {}) => {
761
- var te, ve, ge, Re;
771
+ const U = (s = {}) => {
772
+ var te, ve, Re, ge;
762
773
  const {
763
- collectionId: n,
764
- draftBatchId: T,
774
+ collectionId: o,
775
+ draftBatchId: C,
765
776
  enabled: F,
766
777
  resourceType: le,
767
778
  options: ee
768
779
  } = s;
769
- l.value = n, u.value = T, c.value = F ?? !0, d.value = [se(le)], ee != null && (m.value = ee, N.value = (ve = (te = m.value) == null ? void 0 : te.filter) == null ? void 0 : ve.resourceIds, _.value = (Re = (ge = m.value) == null ? void 0 : ge.filter) == null ? void 0 : Re.query), A.value = H(), W(c.value);
780
+ l.value = o, u.value = C, c.value = F ?? !0, d.value = [se(le)], ee != null && (m.value = ee, N.value = (ve = (te = m.value) == null ? void 0 : te.filter) == null ? void 0 : ve.resourceIds, O.value = (ge = (Re = m.value) == null ? void 0 : Re.filter) == null ? void 0 : ge.query), A.value = H(), W(c.value);
770
781
  }, W = async (s) => {
771
- s != P.value && (P.value = s, s && (K(), z()));
782
+ s != x.value && (x.value = s, s && (K(), z()));
772
783
  }, re = async (s) => {
773
- N.value = s, await L(async (n) => await n.setFilterResourceIds(N.value || null));
784
+ N.value = s, await T(async (o) => await o.setFilterResourceIds(N.value || null));
774
785
  }, J = async (s) => {
775
- if (_.value = s, y.value != "Uninitialized") {
776
- const n = s, T = R(() => o.isFunction(n) ? p.value ? n(p.value) : null : n);
777
- await L((F) => F.setQuery(T.value || null));
786
+ if (O.value = s, y.value != "Uninitialized") {
787
+ const o = s, C = g(() => a.isFunction(o) ? p.value ? o(p.value) : null : o);
788
+ await T((F) => F.setQuery(C.value || null));
778
789
  }
779
790
  }, K = () => {
780
- m.value = o.merge({}, m.value || {}, {
781
- filter: { resourceIds: N.value, query: _.value }
791
+ m.value = a.merge({}, m.value || {}, {
792
+ filter: { resourceIds: N.value, query: O.value }
782
793
  });
783
- }, p = R(
794
+ }, p = g(
784
795
  () => d.value[0].value || void 0
785
796
  ), B = function(s) {
786
- const n = o.get(s, "filter.query"), T = o.get(s, "propertiesToExclude"), F = o.get(s, "referencePathsToExpand"), le = o.isFunction(n) ? n(p.value) : n, ee = p.value ? o.isFunction(T) ? T(p.value) : T || [] : [], te = p.value ? o.isFunction(F) ? F(p.value) : F || [] : [];
797
+ const o = a.get(s, "filter.query"), C = a.get(s, "propertiesToExclude"), F = a.get(s, "referencePathsToExpand"), le = a.isFunction(o) ? o(p.value) : o, ee = p.value ? a.isFunction(C) ? C(p.value) : C || [] : [], te = p.value ? a.isFunction(F) ? F(p.value) : F || [] : [];
787
798
  return {
788
- ...o.cloneDeep(s || {}),
799
+ ...a.cloneDeep(s || {}),
789
800
  filter: {
790
- ...o.cloneDeep((s == null ? void 0 : s.filter) || {}),
801
+ ...a.cloneDeep((s == null ? void 0 : s.filter) || {}),
791
802
  query: le
792
803
  },
793
804
  propertiesToExclude: ee,
794
805
  referencePathsToExpand: te
795
806
  };
796
- }, q = R(() => B(m.value)), j = R(() => {
807
+ }, q = g(() => B(m.value)), j = g(() => {
797
808
  if (q.value.restCollectionUrl !== void 0)
798
809
  return q.value.restCollectionUrl;
799
- if (!E.value)
800
- return !p.value || !p.value.collectionName ? null : w.value ? `${V.config.apiBaseUrl}/draft-batches/${w.value}/${p.value.collectionName}` : `${V.config.apiBaseUrl}/${p.value.collectionName}`;
801
- }), a = R(() => {
810
+ if (!P.value)
811
+ return !p.value || !p.value.collectionName ? null : D.value ? `${V.config.apiBaseUrl}/draft-batches/${D.value}/${p.value.collectionName}` : `${V.config.apiBaseUrl}/${p.value.collectionName}`;
812
+ }), n = g(() => {
802
813
  var s;
803
814
  if (p.value)
804
- return o.mergeWith(
805
- o.cloneDeep(Ue),
815
+ return a.mergeWith(
816
+ a.cloneDeep(we),
806
817
  q.value,
807
818
  {
808
819
  idProperty: (s = p.value) == null ? void 0 : s.idProperty,
809
820
  restCollectionUrl: j.value || ""
810
821
  },
811
- (n, T) => {
812
- if (o.isArray(T) && T.length == 0 && (n == null || o.isArray(n)))
813
- return T;
822
+ (o, C) => {
823
+ if (a.isArray(C) && C.length == 0 && (o == null || a.isArray(o)))
824
+ return C;
814
825
  }
815
826
  );
816
- }), f = I(0), b = R(
827
+ }), f = I(0), b = g(
817
828
  () => {
818
829
  var s;
819
- return f.value, l.value || p.value && ((s = p.value) == null ? void 0 : s.collectionName) && (w.value ? `draftBatches/${w.value}/${p.value.collectionName}/${A.value}` : `${p.value.collectionName}/${A.value}`) || null;
830
+ return f.value, l.value || p.value && ((s = p.value) == null ? void 0 : s.collectionName) && (D.value ? `draftBatches/${D.value}/${p.value.collectionName}/${A.value}` : `${p.value.collectionName}/${A.value}`) || null;
820
831
  }
821
832
  ), z = () => {
822
- if (P.value) {
833
+ if (x.value) {
823
834
  let s = !1;
824
- return p.value && b.value && (t.value = ie.getStore(b.value), t.value ? s = !1 : a.value && (E.value = !1, t.value = Pe(b.value, a.value)(), s = !0)), s;
835
+ return p.value && b.value && (t.value = ie.getStore(b.value), t.value ? s = !1 : n.value && (P.value = !1, t.value = Pe(b.value, n.value)(), s = !0)), s;
825
836
  } else
826
837
  return !1;
827
838
  }, G = () => {
828
839
  b.value && l.value == b.value ? (t.value = void 0, z()) : (t.value = void 0, f.value = f.value + 1, z());
829
840
  };
830
- $(w, (s, n) => {
831
- o.isEqual(s, n) || G();
832
- }), $(P, (s, n) => {
833
- s != n && (s ? z() : t.value = void 0);
834
- }), $(p, (s, n) => {
835
- s && !n ? z() : !s && n || o.isEqual(s, n) || G();
836
- }), $(a, (s, n) => {
837
- o.isEqual(s, n) || G();
841
+ $(D, (s, o) => {
842
+ a.isEqual(s, o) || G();
843
+ }), $(x, (s, o) => {
844
+ s != o && (s ? z() : t.value = void 0);
845
+ }), $(p, (s, o) => {
846
+ s && !o ? z() : !s && o || a.isEqual(s, o) || G();
847
+ }), $(n, (s, o) => {
848
+ a.isEqual(s, o) || G();
838
849
  }), $(k, () => {
839
- k.value || (E.value = !1);
840
- }), $(b, () => z()), $(j, (s, n) => {
841
- o.isEqual(s, n) || G();
850
+ k.value || (P.value = !1);
851
+ }), $(b, () => z()), $(j, (s, o) => {
852
+ a.isEqual(s, o) || G();
842
853
  });
843
- const M = [], we = function(s) {
854
+ const M = [], De = function(s) {
844
855
  y.value != "Uninitialized" ? Le(s) : M.push(s);
845
856
  };
846
- return $(y, (s, n) => {
847
- if (s != "Uninitialized" && n == "Uninitialized") {
848
- const T = o.clone(M);
857
+ return $(y, (s, o) => {
858
+ if (s != "Uninitialized" && o == "Uninitialized") {
859
+ const C = a.clone(M);
849
860
  M.splice(0, M.length);
850
- for (const F of T)
861
+ for (const F of C)
851
862
  F();
852
863
  }
853
864
  }), z(), {
854
865
  // Configuration
855
866
  collectionId: b,
856
- draftBatchId: w,
867
+ draftBatchId: D,
857
868
  resourceType: p,
858
- restCollectionUrl: R(() => C("restCollectionUrl", null)),
869
+ restCollectionUrl: g(() => E("restCollectionUrl", null)),
859
870
  // Status
860
- enabled: P,
871
+ enabled: x,
861
872
  status: y,
862
- batchSaveAttempted: R(() => C("batchSaveAttempted", !1)),
863
- listNavigators: R(() => C("listNavigators", !1)),
873
+ batchSaveAttempted: g(() => E("batchSaveAttempted", !1)),
874
+ listNavigators: g(() => E("listNavigators", !1)),
864
875
  // Resources loaded from the REST API
865
- invalidResources: R(() => C("invalidResources", [])),
866
- resources: R(() => y.value != "Uninitialized" ? (L((s) => s.ensureCollectionLoaded()), C("resources", [])) : []),
867
- remoteCollectionSize: R(() => C("remoteCollectionSize", null)),
876
+ invalidResources: g(() => E("invalidResources", [])),
877
+ resources: g(() => y.value != "Uninitialized" ? (T((s) => s.ensureCollectionLoaded()), E("resources", [])) : []),
878
+ remoteCollectionSize: g(() => E("remoteCollectionSize", null)),
868
879
  // Transient data
869
- transientData: R(() => C("transientData", [])),
880
+ transientData: g(() => E("transientData", [])),
870
881
  // Selection and detail selection
871
- detailSelection: R(() => C("detailSelection", [])),
872
- editingDetailSelection: R(() => C("editingDetailSelection", !1)),
873
- selection: R(() => C("selection", [])),
882
+ detailSelection: g(() => E("detailSelection", [])),
883
+ editingDetailSelection: g(() => E("editingDetailSelection", !1)),
884
+ selection: g(() => E("selection", [])),
874
885
  // Methods: Configuration
875
- reconfigureCollection: D,
886
+ reconfigureCollection: U,
876
887
  setEditingDetailSelection: (s) => S(
877
- (n) => n.setEditingDetailSelection(s)
888
+ (o) => o.setEditingDetailSelection(s)
878
889
  ),
879
890
  setEnabled: W,
880
891
  setFilterResourceIds: re,
@@ -882,77 +893,78 @@ const Ue = {
882
893
  // Methods: Status
883
894
  ensureStore: z,
884
895
  // TODO Rename
885
- setBatchSaveAttempted: (s) => S((n) => n.setBatchSaveAttempted(s)),
896
+ setBatchSaveAttempted: (s) => S((o) => o.setBatchSaveAttempted(s)),
886
897
  // Local collection management
887
898
  clear: () => S((s) => s.clear()),
888
- ensureCollectionLoaded: async () => await L(async (s) => s.ensureCollectionLoaded()),
889
- loadResources: async () => await L(async (s) => await s.loadResources()),
899
+ ensureCollectionLoaded: async () => await T(async (s) => s.ensureCollectionLoaded()),
900
+ loadResources: async () => await T(async (s) => await s.loadResources()),
890
901
  // Methods: Recording changes to the collection
891
- addResource: (s) => S((n) => n.addResource(s)),
892
- checkForDeletedResource: async (s) => await L(async (n) => await n.checkForDeletedResource(s)) == !0,
893
- recordDeletion: (s) => S((n) => n.recordDeletion(s)),
894
- recordInsertion: (s, { insertAtBeginning: n = !1, transientData: T = void 0 } = {}) => S((F) => F.recordInsertion(s, { insertAtBeginning: n, transientData: T })),
895
- recordUpdate: (s) => S((n) => n.recordUpdate(s)),
896
- refreshResource: async (s) => await L(
897
- async (n) => await n.refreshResource(s)
902
+ addResource: (s) => S((o) => o.addResource(s)),
903
+ checkForDeletedResource: async (s) => await T(async (o) => await o.checkForDeletedResource(s)) == !0,
904
+ recordDeletion: (s) => S((o) => o.recordDeletion(s)),
905
+ recordInsertion: (s, { insertAtBeginning: o = !1, transientData: C = void 0 } = {}) => S((F) => F.recordInsertion(s, { insertAtBeginning: o, transientData: C })),
906
+ recordUpdate: (s) => S((o) => o.recordUpdate(s)),
907
+ refreshResource: async (s) => await T(
908
+ async (o) => await o.refreshResource(s)
898
909
  ),
899
910
  // Methods: Modifying the collection
900
- deleteResource: async (s) => await L(
901
- async (n) => await n.deleteResource(s)
911
+ deleteResource: async (s) => await T(
912
+ async (o) => await o.deleteResource(s)
902
913
  ),
903
- saveResource: async (s) => await L(async (n) => await n.saveResource(s)),
904
- saveResources: async (s) => await L(async (n) => await n.saveResources(s)),
905
- updateResources: async (s) => await L(async (n) => await n.updateResources(s)),
914
+ saveResource: async (s) => await T(async (o) => await o.saveResource(s)),
915
+ saveResources: async (s) => await T(async (o) => await o.saveResources(s)),
916
+ updateResource: async (s) => await T(async (o) => await o.updateResource(s)),
917
+ updateResources: async (s) => await T(async (o) => await o.updateResources(s)),
906
918
  // Methods: Transient data
907
919
  clearTransientData: () => S((s) => s.clearTransientData()),
908
- setInvalidResourceIds: (s) => S((n) => n.setInvalidResourceIds(s)),
920
+ setInvalidResourceIds: (s) => S((o) => o.setInvalidResourceIds(s)),
909
921
  setTransientDataForResources: (s) => S(
910
- (n) => n.setTransientDataForResources(s)
922
+ (o) => o.setTransientDataForResources(s)
911
923
  ),
912
924
  // Methods: Selection and detail selection
913
925
  clearSelection: () => S((s) => s.clearSelection()),
914
- deselectResources: (s) => S((n) => n.deselectResources(s)),
915
- selectResources: (s, n) => S(
916
- (T) => T.selectResources(s, n)
926
+ deselectResources: (s) => S((o) => o.deselectResources(s)),
927
+ selectResources: (s, o) => S(
928
+ (C) => C.selectResources(s, o)
917
929
  ),
918
930
  // Methods: Managing the detail view
919
931
  hideDetail: () => S((s) => s.hideDetail()),
920
932
  // Methods: Editors
921
- deregisterEditor: (s) => S((n) => n.deregisterEditor(s)),
922
- registerEditor: (s) => S((n) => n.registerEditor(s)),
933
+ deregisterEditor: (s) => S((o) => o.deregisterEditor(s)),
934
+ registerEditor: (s) => S((o) => o.registerEditor(s)),
923
935
  // Methods: List navigators
924
- deregisterListNavigator: (s) => S((n) => n.deregisterListNavigator(s)),
925
- registerListNavigator: (s) => S((n) => n.registerListNavigator(s)),
936
+ deregisterListNavigator: (s) => S((o) => o.deregisterListNavigator(s)),
937
+ registerListNavigator: (s) => S((o) => o.registerListNavigator(s)),
926
938
  // Callbacks
927
- onItemsStoreReady: we
939
+ onItemsStoreReady: De
928
940
  };
929
941
  }, je = () => {
930
942
  ie.clearAllStores();
931
943
  };
932
- function ne(h, i) {
933
- return o.get(h, (i == null ? void 0 : i.idProperty) || "_id");
944
+ function ne(h, r) {
945
+ return a.get(h, (r == null ? void 0 : r.idProperty) || "_id");
934
946
  }
935
- const De = {
947
+ const Ue = {
936
948
  idProperty: "_id"
937
949
  }, Z = {
938
950
  resource: null,
939
951
  status: "NotLoaded"
940
- }, qe = (h, i) => {
941
- i = o.merge({}, De, i);
942
- const g = me(h, {
952
+ }, qe = (h, r) => {
953
+ r = a.merge({}, Ue, r);
954
+ const R = me(h, {
943
955
  state: () => ({
944
- idProperty: i.idProperty,
945
- resourceId: i.resourceId || null,
946
- resourceUrl: i.resourceUrl || null,
947
- referencePathsToExpand: i.referencePathsToExpand || null,
956
+ idProperty: r.idProperty,
957
+ resourceId: r.resourceId || null,
958
+ resourceUrl: r.resourceUrl || null,
959
+ referencePathsToExpand: r.referencePathsToExpand || null,
948
960
  ...Z
949
961
  }),
950
962
  getters: {
951
- currentResourceUrl: (e) => e.resourceUrl || (i.restCollectionUrl && e.resourceId ? `${i.restCollectionUrl}/${e.resourceId}` : null) || i.restCollectionUrl || null,
963
+ currentResourceUrl: (e) => e.resourceUrl || (r.restCollectionUrl && e.resourceId ? `${r.restCollectionUrl}/${e.resourceId}` : null) || r.restCollectionUrl || null,
952
964
  /** Get the REST query parameters that can be determined from the options. */
953
965
  fixedQueryParams: (e) => {
954
- const r = {};
955
- return e.referencePathsToExpand && (r.r = X(e.referencePathsToExpand)), r;
966
+ const i = {};
967
+ return e.referencePathsToExpand && (i.r = X(e.referencePathsToExpand)), i;
956
968
  }
957
969
  },
958
970
  actions: {
@@ -969,12 +981,12 @@ const De = {
969
981
  this[e] = Z[e];
970
982
  },
971
983
  async setResourceId(e) {
972
- const r = this.currentResourceUrl;
973
- this.resourceId = e, !o.isEqual(this.currentResourceUrl, r) && this.status != "NotLoaded" && await this.loadResource();
984
+ const i = this.currentResourceUrl;
985
+ this.resourceId = e, !a.isEqual(this.currentResourceUrl, i) && this.status != "NotLoaded" && await this.loadResource();
974
986
  },
975
987
  async setResourceUrl(e) {
976
- const r = this.currentResourceUrl;
977
- this.resourceUrl = e, !o.isEqual(this.currentResourceUrl, r) && this.status != "NotLoaded" && await this.loadResource();
988
+ const i = this.currentResourceUrl;
989
+ this.resourceUrl = e, !a.isEqual(this.currentResourceUrl, i) && this.status != "NotLoaded" && await this.loadResource();
978
990
  },
979
991
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
980
992
  // Actions: Loading and unloading the collection
@@ -1006,13 +1018,13 @@ const De = {
1006
1018
  const e = H();
1007
1019
  if (this._loadId = e, this.currentResourceUrl) {
1008
1020
  this.status = "Loading";
1009
- const r = this.fixedQueryParams, t = o.cloneDeep(r), l = o.map(
1021
+ const i = this.fixedQueryParams, t = a.cloneDeep(i), l = a.map(
1010
1022
  t,
1011
1023
  (c, d) => c != null ? `${encodeURIComponent(d)}=${encodeURIComponent(c)}` : null
1012
- ).filter((c) => c != null).join("&"), u = o.isEmpty(l) ? this.currentResourceUrl : `${this.currentResourceUrl}?${l}`;
1024
+ ).filter((c) => c != null).join("&"), u = a.isEmpty(l) ? this.currentResourceUrl : `${this.currentResourceUrl}?${l}`;
1013
1025
  try {
1014
- const c = await x.get(u), d = this.fixedQueryParams;
1015
- e != this._loadId || !o.isEqual(r, d) ? console.log(`Discarding resource fetched by obsolete query from ${u}.`) : (this.resource = pe.decode(o.get(c, "data", {})), this.status = "Loaded");
1026
+ const c = await L.get(u), d = this.fixedQueryParams;
1027
+ e != this._loadId || !a.isEqual(i, d) ? console.log(`Discarding resource fetched by obsolete query from ${u}.`) : (this.resource = pe.decode(a.get(c, "data", {})), this.status = "Loaded");
1016
1028
  } catch (c) {
1017
1029
  console.log(`Error while loading resource (URL="${u}")`, c), this.reset(), this.status = "Failed";
1018
1030
  }
@@ -1034,9 +1046,9 @@ const De = {
1034
1046
  if (this.currentResourceUrl) {
1035
1047
  let e;
1036
1048
  try {
1037
- e = await x.get(this.currentResourceUrl);
1038
- } catch (r) {
1039
- x.isAxiosError(r) && (e = r.response);
1049
+ e = await L.get(this.currentResourceUrl);
1050
+ } catch (i) {
1051
+ L.isAxiosError(i) && (e = i.response);
1040
1052
  }
1041
1053
  return e && e.status == 404 ? (this.recordDeletion(), !0) : !1;
1042
1054
  } else
@@ -1107,7 +1119,7 @@ const De = {
1107
1119
  */
1108
1120
  async deleteResource() {
1109
1121
  if (this.currentResourceUrl)
1110
- (await x.delete(this.currentResourceUrl)).status == 200 && this.recordDeletion();
1122
+ (await L.delete(this.currentResourceUrl)).status == 200 && this.recordDeletion();
1111
1123
  else
1112
1124
  throw "Cannot delete a resource because its URL, or its ID and collection URL, are unknown.";
1113
1125
  },
@@ -1123,12 +1135,12 @@ const De = {
1123
1135
  * the operation failed.
1124
1136
  */
1125
1137
  async saveResource(e) {
1126
- const r = ne(e, this), t = r == null;
1127
- if (!r)
1138
+ const i = ne(e, this), t = i == null;
1139
+ if (!i)
1128
1140
  throw "The REST resource store cannot create new resources on the server.";
1129
1141
  if (!this.currentResourceUrl)
1130
1142
  throw "Cannot save a resource because its URL, or its ID and collection URL, are unknown.";
1131
- const l = await x({
1143
+ const l = await L({
1132
1144
  method: t ? "post" : "put",
1133
1145
  url: this.currentResourceUrl,
1134
1146
  data: e
@@ -1140,25 +1152,25 @@ const De = {
1140
1152
  return null;
1141
1153
  },
1142
1154
  /**
1143
- * Partial update of the remote resource, then mirror the change locally.
1155
+ * Update only the specified properties of the remote resource, then mirror the change locally.
1144
1156
  *
1145
1157
  * After writing changes, {@link refreshResource} is called to ensure that the local resource (which is also the
1146
1158
  * return value) has the same object-graph characteristics as the rest of the local collection.
1147
1159
  *
1148
- * @param resourcePropertyUpdates A list of property paths, values, and update methods to apply .
1160
+ * @param partialResource The partial resource to merge.
1149
1161
  * @returns The refreshed local resource after the change has been persisted to the remote collection, or null if
1150
1162
  * the operation failed.
1151
1163
  */
1152
1164
  async updateResource(e) {
1153
1165
  if (!this.currentResourceUrl)
1154
1166
  throw "Cannot save a resource because its URL, or its ID and collection URL, are unknown.";
1155
- const r = await x({
1167
+ const i = await L({
1156
1168
  method: "patch",
1157
1169
  url: this.currentResourceUrl,
1158
1170
  data: e
1159
1171
  });
1160
- if (r.status == 200) {
1161
- const t = r.data;
1172
+ if (i.status == 200) {
1173
+ const t = i.data;
1162
1174
  return await this.refreshResource() || Object.freeze(t);
1163
1175
  }
1164
1176
  return null;
@@ -1167,15 +1179,15 @@ const De = {
1167
1179
  // Actions: Custom API endpoints
1168
1180
  // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1169
1181
  async makeCustomApiRequest(e) {
1170
- const { method: r, subpath: t, url: l, data: u } = e;
1182
+ const { method: i, subpath: t, url: l, data: u } = e;
1171
1183
  let c = l;
1172
1184
  if (!c)
1173
1185
  if (this.currentResourceUrl)
1174
1186
  c = `${this.currentResourceUrl}/${t}`;
1175
1187
  else
1176
1188
  throw "Cannot make a custom API request for a resource because its URL, or its ID and collection URL, are unknown.";
1177
- const d = await x({
1178
- method: r || "get",
1189
+ const d = await L({
1190
+ method: i || "get",
1179
1191
  url: c,
1180
1192
  data: u
1181
1193
  });
@@ -1184,144 +1196,144 @@ const De = {
1184
1196
  }
1185
1197
  });
1186
1198
  return (() => {
1187
- const e = (r, t) => {
1188
- const l = g(r, t);
1199
+ const e = (i, t) => {
1200
+ const l = R(i, t);
1189
1201
  return ce.registerStore(l.$id, l), l;
1190
1202
  };
1191
- return e.$id = g.$id, e;
1203
+ return e.$id = R.$id, e;
1192
1204
  })();
1193
1205
  }, ce = new Ie(), Me = (h = {}) => {
1194
1206
  const {
1195
- resourceClientId: i,
1196
- draftBatchId: g,
1197
- enabled: U,
1207
+ resourceClientId: r,
1208
+ draftBatchId: R,
1209
+ enabled: w,
1198
1210
  resourceType: e,
1199
- options: r
1200
- } = h, t = I(void 0), l = I(i), u = I(g), c = I(U ?? !0), d = I([se(e)]), m = I(r), w = R(() => u.value), P = I(c.value), A = I(H()), N = R(
1211
+ options: i
1212
+ } = h, t = I(void 0), l = I(r), u = I(R), c = I(w ?? !0), d = I([se(e)]), m = I(i), D = g(() => u.value), x = I(c.value), A = I(H()), N = g(
1201
1213
  () => u.value == null && l.value != null && ce.getStore(l.value) != null
1202
- ), _ = I(N.value), k = R(() => S("status", "Uninitialized"));
1203
- function E(a) {
1214
+ ), O = I(N.value), k = g(() => S("status", "Uninitialized"));
1215
+ function P(n) {
1204
1216
  if (t.value)
1205
- return a(t.value);
1217
+ return n(t.value);
1206
1218
  }
1207
- async function y(a) {
1219
+ async function y(n) {
1208
1220
  if (t.value)
1209
- return await a(t.value);
1221
+ return await n(t.value);
1210
1222
  }
1211
- function S(a, f) {
1223
+ function S(n, f) {
1212
1224
  if (t.value)
1213
- return t.value[a];
1225
+ return t.value[n];
1214
1226
  if (f !== void 0)
1215
1227
  return f;
1216
1228
  throw "Attempted to use a REST resource store that has not been created, with no default value.";
1217
1229
  }
1218
- const L = (a = {}) => {
1230
+ const T = (n = {}) => {
1219
1231
  const {
1220
1232
  resourceClientId: f,
1221
1233
  draftBatchId: b,
1222
1234
  enabled: z,
1223
1235
  resourceType: G,
1224
1236
  options: M
1225
- } = a;
1226
- l.value = f, u.value = b, c.value = z ?? !0, d.value = [se(G)], M != null && (m.value = M), A.value = H(), C(c.value);
1227
- }, C = async (a) => {
1228
- a != P.value && (P.value = a, a && q());
1229
- }, D = R(
1237
+ } = n;
1238
+ l.value = f, u.value = b, c.value = z ?? !0, d.value = [se(G)], M != null && (m.value = M), A.value = H(), E(c.value);
1239
+ }, E = async (n) => {
1240
+ n != x.value && (x.value = n, n && q());
1241
+ }, U = g(
1230
1242
  () => d.value[0].value || void 0
1231
- ), W = function(a) {
1232
- const f = o.get(a, "referencePathsToExpand"), b = D.value ? o.isFunction(f) ? f(D.value) : f || [] : [];
1243
+ ), W = function(n) {
1244
+ const f = a.get(n, "referencePathsToExpand"), b = U.value ? a.isFunction(f) ? f(U.value) : f || [] : [];
1233
1245
  return {
1234
- ...o.cloneDeep(a || {}),
1246
+ ...a.cloneDeep(n || {}),
1235
1247
  referencePathsToExpand: b
1236
1248
  };
1237
- }, re = R(() => W(m.value)), J = R(() => {
1238
- if (!D.value)
1249
+ }, re = g(() => W(m.value)), J = g(() => {
1250
+ if (!U.value)
1239
1251
  return null;
1240
- if (!_.value)
1241
- return !D.value || !D.value.collectionName ? null : w.value ? `${V.config.apiBaseUrl}/draft-batches/${w.value}/${D.value.collectionName}` : `${V.config.apiBaseUrl}/${D.value.collectionName}`;
1242
- }), K = R(() => {
1243
- if (D.value && J.value)
1244
- return o.mergeWith(
1245
- o.cloneDeep(De),
1252
+ if (!O.value)
1253
+ return !U.value || !U.value.collectionName ? null : D.value ? `${V.config.apiBaseUrl}/draft-batches/${D.value}/${U.value.collectionName}` : `${V.config.apiBaseUrl}/${U.value.collectionName}`;
1254
+ }), K = g(() => {
1255
+ if (U.value && J.value)
1256
+ return a.mergeWith(
1257
+ a.cloneDeep(Ue),
1246
1258
  re.value,
1247
1259
  {
1248
- idProperty: D.value.idProperty,
1260
+ idProperty: U.value.idProperty,
1249
1261
  restCollectionUrl: J.value
1250
1262
  },
1251
- (a, f) => {
1252
- if (o.isArray(f) && f.length == 0 && (a == null || o.isArray(a)))
1263
+ (n, f) => {
1264
+ if (a.isArray(f) && f.length == 0 && (n == null || a.isArray(n)))
1253
1265
  return f;
1254
1266
  }
1255
1267
  );
1256
- }), p = I(0), B = R(
1268
+ }), p = I(0), B = g(
1257
1269
  () => {
1258
- var a;
1259
- return p.value, l.value || D.value && ((a = D.value) == null ? void 0 : a.collectionName) && (w.value ? `draftBatches/${w.value}/${D.value.collectionName}/${A.value}` : `${D.value.collectionName}/${A.value}`) || null;
1270
+ var n;
1271
+ return p.value, l.value || U.value && ((n = U.value) == null ? void 0 : n.collectionName) && (D.value ? `draftBatches/${D.value}/${U.value.collectionName}/${A.value}` : `${U.value.collectionName}/${A.value}`) || null;
1260
1272
  }
1261
1273
  ), q = () => {
1262
- if (P.value) {
1263
- let a = !1;
1264
- return D.value && B.value && (t.value = ce.getStore(B.value), t.value ? a = !1 : K.value && (_.value = !1, t.value = qe(B.value, K.value)(), a = !0)), a;
1274
+ if (x.value) {
1275
+ let n = !1;
1276
+ return U.value && B.value && (t.value = ce.getStore(B.value), t.value ? n = !1 : K.value && (O.value = !1, t.value = qe(B.value, K.value)(), n = !0)), n;
1265
1277
  } else
1266
1278
  return !1;
1267
1279
  }, j = () => {
1268
1280
  B.value && l.value == B.value ? (t.value = void 0, q()) : (t.value = void 0, p.value = p.value + 1, q());
1269
1281
  };
1270
- return $(w, (a, f) => {
1271
- o.isEqual(a, f) || j();
1272
- }), $(P, (a, f) => {
1273
- a != f && (a ? q() : t.value = void 0);
1274
- }), $(D, (a, f) => {
1275
- a && !f ? q() : !a && f || o.isEqual(a, f) || j();
1276
- }), $(K, (a, f) => {
1277
- o.isEqual(a, f) || j();
1282
+ return $(D, (n, f) => {
1283
+ a.isEqual(n, f) || j();
1284
+ }), $(x, (n, f) => {
1285
+ n != f && (n ? q() : t.value = void 0);
1286
+ }), $(U, (n, f) => {
1287
+ n && !f ? q() : !n && f || a.isEqual(n, f) || j();
1288
+ }), $(K, (n, f) => {
1289
+ a.isEqual(n, f) || j();
1278
1290
  }), $(N, () => {
1279
- N.value || (_.value = !1);
1280
- }), $(B, () => q()), $(J, (a, f) => {
1281
- o.isEqual(a, f) || j();
1291
+ N.value || (O.value = !1);
1292
+ }), $(B, () => q()), $(J, (n, f) => {
1293
+ a.isEqual(n, f) || j();
1282
1294
  }), q(), {
1283
1295
  // Configuration
1284
1296
  resourceClientId: B,
1285
- draftBatchId: w,
1286
- enabled: P,
1287
- resourceType: D,
1297
+ draftBatchId: D,
1298
+ enabled: x,
1299
+ resourceType: U,
1288
1300
  // Status
1289
1301
  status: k,
1290
1302
  // Resources loaded from the REST API
1291
- resource: R(() => k.value != "Uninitialized" ? (y((a) => a.ensureResourceLoaded()), S("resource", [])) : []),
1292
- resourceId: R(() => S("resourceId", null)),
1293
- resourceUrl: R(() => S("resourceUrl", null)),
1303
+ resource: g(() => k.value != "Uninitialized" ? (y((n) => n.ensureResourceLoaded()), S("resource", [])) : []),
1304
+ resourceId: g(() => S("resourceId", null)),
1305
+ resourceUrl: g(() => S("resourceUrl", null)),
1294
1306
  // Methods: Configuration
1295
- reconfigureClient: L,
1296
- setEnabled: C,
1297
- setResourceId: async (a) => await y(async (f) => await f.setResourceId(a)),
1298
- setResourceUrl: async (a) => await y(async (f) => await f.setResourceUrl(a)),
1307
+ reconfigureClient: T,
1308
+ setEnabled: E,
1309
+ setResourceId: async (n) => await y(async (f) => await f.setResourceId(n)),
1310
+ setResourceUrl: async (n) => await y(async (f) => await f.setResourceUrl(n)),
1299
1311
  // Methods: Status
1300
1312
  ensureStore: q,
1301
1313
  // Methods: Resource management
1302
- clear: () => E((a) => a.clear()),
1303
- ensureResourceLoaded: async () => await y(async (a) => a.ensureResourceLoaded()),
1304
- loadResource: async () => await y(async (a) => await a.loadResource()),
1314
+ clear: () => P((n) => n.clear()),
1315
+ ensureResourceLoaded: async () => await y(async (n) => n.ensureResourceLoaded()),
1316
+ loadResource: async () => await y(async (n) => await n.loadResource()),
1305
1317
  // Methods: Recording changes to the resource
1306
- checkForDeletedResource: async () => await y(async (a) => await a.checkForDeletedResource()) == !0,
1307
- recordDeletion: () => y((a) => a.recordDeletion()),
1308
- recordInsertion: (a) => y((f) => f.recordInsertion(a)),
1309
- recordUpdate: (a) => y((f) => f.recordUpdate(a)),
1310
- refreshResource: async () => await y(async (a) => await a.refreshResource()),
1318
+ checkForDeletedResource: async () => await y(async (n) => await n.checkForDeletedResource()) == !0,
1319
+ recordDeletion: () => y((n) => n.recordDeletion()),
1320
+ recordInsertion: (n) => y((f) => f.recordInsertion(n)),
1321
+ recordUpdate: (n) => y((f) => f.recordUpdate(n)),
1322
+ refreshResource: async () => await y(async (n) => await n.refreshResource()),
1311
1323
  // Methods: Modifying the resource
1312
- deleteResource: async () => await y(async (a) => await a.deleteResource()),
1313
- saveResource: async (a) => await y(async (f) => await f.saveResource(a)),
1314
- updateResource: async (a) => await y(async (f) => await f.updateResource(a)),
1324
+ deleteResource: async () => await y(async (n) => await n.deleteResource()),
1325
+ saveResource: async (n) => await y(async (f) => await f.saveResource(n)),
1326
+ updateResource: async (n) => await y(async (f) => await f.updateResource(n)),
1315
1327
  // Methods: Custom API endpoints
1316
- makeCustomApiRequest: async (a) => await y(
1317
- async (f) => await f.makeCustomApiRequest(a)
1328
+ makeCustomApiRequest: async (n) => await y(
1329
+ async (f) => await f.makeCustomApiRequest(n)
1318
1330
  )
1319
1331
  };
1320
1332
  }, V = {
1321
1333
  config: { ...ye }
1322
1334
  };
1323
1335
  function We(h) {
1324
- V.config = o.merge({}, ye, h);
1336
+ V.config = a.merge({}, ye, h);
1325
1337
  }
1326
1338
  export {
1327
1339
  Be as ApiClientError,