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