@luminix/core 0.0.1-beta.8 → 0.0.1-beta.9
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/contracts/Builder.d.ts +1 -1
- package/dist/contracts/Collection.d.ts +1 -1
- package/dist/core.js +353 -353
- package/dist/facades/App.d.ts +1 -1
- package/dist/facades/Model.d.ts +1 -1
- package/dist/mixins/HasEvents.d.ts +1 -1
- package/dist/types/Model.d.ts +1 -1
- package/package.json +3 -2
package/dist/core.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var je = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var C = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var Fe = (n, e, t) => e in n ? je(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var m = (n, e, t) => Fe(n, typeof e != "symbol" ? e + "" : e, t), j = (n, e, t) => e.has(n) || C("Cannot " + t);
|
|
7
|
+
var h = (n, e, t) => (j(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? C("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), J = (n, e, t, r) => (j(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), D = (n, e, t) => (j(n, e, "access private method"), t);
|
|
8
8
|
import f from "lodash";
|
|
9
9
|
import { produce as R, isDraftable as Pe } from "immer";
|
|
10
|
-
import
|
|
10
|
+
import I, { isAxiosError as ke } from "axios";
|
|
11
11
|
var V, X;
|
|
12
12
|
class Qe extends (X = Error, V = Symbol.toStringTag, X) {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
super(`[Luminix] Facade "${t}" not found`);
|
|
15
|
-
|
|
15
|
+
m(this, V, "FacadeNotFoundException");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
class Le {
|
|
19
19
|
constructor(e) {
|
|
20
|
-
|
|
20
|
+
m(this, "_user");
|
|
21
21
|
this.app = e;
|
|
22
22
|
}
|
|
23
23
|
attempt(e, t = !1, r) {
|
|
@@ -25,15 +25,15 @@ class Le {
|
|
|
25
25
|
i.method = "post", i.action = this.app.make("route").url("login"), i.style.display = "none";
|
|
26
26
|
const s = this.app.make("config").get("auth.csrf");
|
|
27
27
|
if (typeof s == "string") {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const a = document.createElement("input");
|
|
29
|
+
a.type = "hidden", a.name = "_token", a.value = s, i.appendChild(a);
|
|
30
30
|
}
|
|
31
31
|
const u = document.createElement("input");
|
|
32
32
|
u.type = "email", u.name = "email", u.value = e.email, i.appendChild(u);
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
33
|
+
const l = document.createElement("input");
|
|
34
|
+
if (l.type = "password", l.name = "password", l.value = e.password, i.appendChild(l), t) {
|
|
35
|
+
const a = document.createElement("input");
|
|
36
|
+
a.type = "checkbox", a.name = "remember", a.value = "1", a.checked = !0, i.appendChild(a);
|
|
37
37
|
}
|
|
38
38
|
r && i.addEventListener("submit", r), document.body.appendChild(i), i.submit();
|
|
39
39
|
}
|
|
@@ -95,7 +95,7 @@ class Ce {
|
|
|
95
95
|
}
|
|
96
96
|
class S {
|
|
97
97
|
constructor(e) {
|
|
98
|
-
|
|
98
|
+
m(this, "locked", []);
|
|
99
99
|
this.bag = e, Object.freeze(this.bag);
|
|
100
100
|
}
|
|
101
101
|
get(e, t) {
|
|
@@ -192,57 +192,57 @@ class S {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
function A(n) {
|
|
195
|
-
var e, t, r,
|
|
196
|
-
return
|
|
197
|
-
constructor(...
|
|
198
|
-
super(...
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
on(
|
|
205
|
-
if (typeof
|
|
195
|
+
var e, t, r, $e, s;
|
|
196
|
+
return s = class extends (t = n, e = Symbol.toStringTag, t) {
|
|
197
|
+
constructor(...a) {
|
|
198
|
+
super(...a);
|
|
199
|
+
F(this, r);
|
|
200
|
+
m(this, "emitter");
|
|
201
|
+
m(this, e, n.name);
|
|
202
|
+
this.emitter = D(this, r, $e).call(this);
|
|
203
|
+
}
|
|
204
|
+
on(a, d) {
|
|
205
|
+
if (typeof a != "string")
|
|
206
206
|
throw new TypeError("event must be a string");
|
|
207
|
-
if (typeof
|
|
207
|
+
if (typeof d != "function")
|
|
208
208
|
throw new TypeError("callback must be a function");
|
|
209
|
-
return
|
|
209
|
+
return this.emitter.on(a, d);
|
|
210
210
|
}
|
|
211
|
-
once(
|
|
212
|
-
if (typeof
|
|
211
|
+
once(a, d) {
|
|
212
|
+
if (typeof a != "string")
|
|
213
213
|
throw new TypeError("event must be a string");
|
|
214
|
-
if (typeof
|
|
214
|
+
if (typeof d != "function")
|
|
215
215
|
throw new TypeError("callback must be a function");
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const p = this.emitter.on(a, (w) => {
|
|
217
|
+
p(), d(w);
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
emit(
|
|
221
|
-
if (typeof
|
|
220
|
+
emit(a, d = {}) {
|
|
221
|
+
if (typeof a != "string")
|
|
222
222
|
throw new TypeError("event must be a string");
|
|
223
|
-
if (typeof
|
|
223
|
+
if (typeof d != "object")
|
|
224
224
|
throw new TypeError("data must be an object");
|
|
225
|
-
|
|
226
|
-
...
|
|
225
|
+
this.emitter.emit(a, {
|
|
226
|
+
...d,
|
|
227
227
|
source: this
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
}, r = new
|
|
230
|
+
}, r = new WeakSet(), $e = function() {
|
|
231
231
|
return {
|
|
232
|
-
emit(
|
|
233
|
-
for (let
|
|
234
|
-
|
|
232
|
+
emit(a, d) {
|
|
233
|
+
for (let p = 0, w = this.events[a] || [], x = w.length; p < x; p++)
|
|
234
|
+
w[p](d);
|
|
235
235
|
},
|
|
236
236
|
events: {},
|
|
237
|
-
on(
|
|
238
|
-
var
|
|
239
|
-
return ((
|
|
240
|
-
var
|
|
241
|
-
this.events[
|
|
237
|
+
on(a, d) {
|
|
238
|
+
var p;
|
|
239
|
+
return ((p = this.events)[a] || (p[a] = [])).push(d), () => {
|
|
240
|
+
var w;
|
|
241
|
+
this.events[a] = (w = this.events[a]) == null ? void 0 : w.filter((x) => d !== x);
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
|
-
},
|
|
245
|
+
}, s;
|
|
246
246
|
}
|
|
247
247
|
function U(...n) {
|
|
248
248
|
return n.reduce((e, t) => e.flatMap((r) => t.map((i) => [r, i].flat())));
|
|
@@ -251,13 +251,13 @@ function $(n) {
|
|
|
251
251
|
return !(typeof n != "object" || n === null || !Reflect.has(n, "constructor") || Reflect.get(n.constructor, "name") !== "Collection");
|
|
252
252
|
}
|
|
253
253
|
var Y, Z;
|
|
254
|
-
class
|
|
254
|
+
class b extends (Z = Error, Y = Symbol.toStringTag, Z) {
|
|
255
255
|
constructor() {
|
|
256
256
|
super("[Luminix] Method not implemented.");
|
|
257
|
-
|
|
257
|
+
m(this, Y, "MethodNotImplementedException");
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function c(n = [], e =
|
|
260
|
+
function c(n = [], e = P) {
|
|
261
261
|
if (!Array.isArray(n))
|
|
262
262
|
throw new TypeError("collect() expects an array");
|
|
263
263
|
return new (A(e))([...n]);
|
|
@@ -266,62 +266,62 @@ const _ = (n) => {
|
|
|
266
266
|
n.emit("change", {
|
|
267
267
|
items: n.all()
|
|
268
268
|
});
|
|
269
|
-
},
|
|
270
|
-
var z, O,
|
|
271
|
-
class
|
|
269
|
+
}, q = (n, e) => Array.isArray(n) ? n[e] ?? null : n.get(e);
|
|
270
|
+
var z, O, o;
|
|
271
|
+
class P {
|
|
272
272
|
constructor(e = []) {
|
|
273
273
|
// [Symbol.toStringTag] = 'Collection';
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
F(this, o);
|
|
275
|
+
m(this, z, "Collection");
|
|
276
|
+
J(this, o, e);
|
|
277
277
|
}
|
|
278
278
|
get items() {
|
|
279
|
-
return [...
|
|
279
|
+
return [...h(this, o)];
|
|
280
280
|
}
|
|
281
281
|
[(O = Symbol.iterator, z = Symbol.toStringTag, O)]() {
|
|
282
|
-
return
|
|
282
|
+
return h(this, o)[Symbol.iterator]();
|
|
283
283
|
}
|
|
284
284
|
all() {
|
|
285
|
-
return [...
|
|
285
|
+
return [...h(this, o)];
|
|
286
286
|
}
|
|
287
287
|
average(e) {
|
|
288
288
|
return typeof e == "string" ? this.avg(e) : this.avg();
|
|
289
289
|
}
|
|
290
290
|
avg(e) {
|
|
291
|
-
return typeof e == "string" ? this.sum(e) /
|
|
291
|
+
return typeof e == "string" ? this.sum(e) / h(this, o).length : this.sum() / h(this, o).length;
|
|
292
292
|
}
|
|
293
293
|
chunk(e) {
|
|
294
294
|
const t = [];
|
|
295
|
-
for (let r = 0; r <
|
|
296
|
-
t.push(
|
|
295
|
+
for (let r = 0; r < h(this, o).length; r += e)
|
|
296
|
+
t.push(h(this, o).slice(r, r + e));
|
|
297
297
|
return c(t.map((r) => c(r)));
|
|
298
298
|
}
|
|
299
299
|
chunkWhile(e) {
|
|
300
300
|
const t = [];
|
|
301
301
|
let r = c();
|
|
302
|
-
for (let i = 0; i <
|
|
303
|
-
e(
|
|
302
|
+
for (let i = 0; i < h(this, o).length; i++)
|
|
303
|
+
e(h(this, o)[i], i, r) ? r.push(h(this, o)[i]) : (t.push(r), r = c());
|
|
304
304
|
return r.count() > 0 && t.push(r), c(t);
|
|
305
305
|
}
|
|
306
306
|
collapse() {
|
|
307
|
-
return c(
|
|
307
|
+
return c(h(this, o).flat());
|
|
308
308
|
}
|
|
309
309
|
collect() {
|
|
310
|
-
return c(
|
|
310
|
+
return c(h(this, o));
|
|
311
311
|
}
|
|
312
312
|
combine(e) {
|
|
313
313
|
const t = {};
|
|
314
|
-
return
|
|
314
|
+
return h(this, o).forEach((r, i) => {
|
|
315
315
|
if (typeof r != "string")
|
|
316
316
|
throw new TypeError("The `combine` method expects the keys to be strings");
|
|
317
|
-
t[r] =
|
|
317
|
+
t[r] = q(e, i);
|
|
318
318
|
}), t;
|
|
319
319
|
}
|
|
320
320
|
concat(e) {
|
|
321
|
-
return Array.isArray(e) ? c([...
|
|
321
|
+
return Array.isArray(e) ? c([...h(this, o), ...e]) : c([...h(this, o), ...e.all()]);
|
|
322
322
|
}
|
|
323
323
|
contains(e, t) {
|
|
324
|
-
return typeof e == "function" ?
|
|
324
|
+
return typeof e == "function" ? h(this, o).some((r, i) => e(r, i, this)) : h(this, o).some((r) => {
|
|
325
325
|
if (typeof t > "u")
|
|
326
326
|
return r == e;
|
|
327
327
|
if (typeof e != "string")
|
|
@@ -330,10 +330,10 @@ class k {
|
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
containsOneItem() {
|
|
333
|
-
return
|
|
333
|
+
return h(this, o).length === 1;
|
|
334
334
|
}
|
|
335
335
|
containsStrict(e, t) {
|
|
336
|
-
return typeof e == "function" ?
|
|
336
|
+
return typeof e == "function" ? h(this, o).some((r, i) => e(r, i, this)) : h(this, o).some((r) => {
|
|
337
337
|
if (typeof t > "u")
|
|
338
338
|
return r === e;
|
|
339
339
|
if (typeof e != "string")
|
|
@@ -342,13 +342,13 @@ class k {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
count() {
|
|
345
|
-
return
|
|
345
|
+
return h(this, o).length;
|
|
346
346
|
}
|
|
347
347
|
countBy(e) {
|
|
348
|
-
return typeof e == "function" ?
|
|
348
|
+
return typeof e == "function" ? h(this, o).reduce((t, r, i) => {
|
|
349
349
|
const s = e(r, i, this);
|
|
350
350
|
return t[s] = t[s] ? t[s] + 1 : 1, t;
|
|
351
|
-
}, {}) :
|
|
351
|
+
}, {}) : h(this, o).reduce((t, r) => {
|
|
352
352
|
if (!["string", "number"].includes(typeof r))
|
|
353
353
|
throw new TypeError("The countBy method expects the items to be strings or numbers");
|
|
354
354
|
return t[String(r)] = t[String(r)] ? t[String(r)] + 1 : 1, t;
|
|
@@ -356,15 +356,15 @@ class k {
|
|
|
356
356
|
}
|
|
357
357
|
crossJoin(...e) {
|
|
358
358
|
return c(U(
|
|
359
|
-
|
|
359
|
+
h(this, o),
|
|
360
360
|
...e.map((t) => Array.isArray(t) ? t : t.all())
|
|
361
361
|
));
|
|
362
362
|
}
|
|
363
363
|
diff(e) {
|
|
364
|
-
return Array.isArray(e) ? c(
|
|
364
|
+
return Array.isArray(e) ? c(h(this, o).filter((t) => !e.includes(t))) : c(h(this, o).filter((t) => !e.contains(t)));
|
|
365
365
|
}
|
|
366
366
|
doesntContain(e, t) {
|
|
367
|
-
return typeof e == "function" ?
|
|
367
|
+
return typeof e == "function" ? h(this, o).every((r, i) => !e(r, i, this)) : h(this, o).every((r) => {
|
|
368
368
|
if (typeof t > "u")
|
|
369
369
|
return r != e;
|
|
370
370
|
if (typeof e != "string")
|
|
@@ -376,10 +376,10 @@ class k {
|
|
|
376
376
|
console.log(this.toArray());
|
|
377
377
|
}
|
|
378
378
|
duplicates(e) {
|
|
379
|
-
return c(typeof e == "string" ?
|
|
379
|
+
return c(typeof e == "string" ? h(this, o).reduce((t, r, i) => (h(this, o).slice(i + 1).some((s) => s[e] == r[e]) && t.push(r[e]), t), []) : h(this, o).reduce((t, r, i) => (h(this, o).slice(i + 1).some((s) => s == r) && t.push(r), t), []));
|
|
380
380
|
}
|
|
381
381
|
duplicatesStrict(e) {
|
|
382
|
-
return c(typeof e == "string" ?
|
|
382
|
+
return c(typeof e == "string" ? h(this, o).reduce((t, r, i) => (h(this, o).slice(i + 1).some((s) => s[e] === r[e]) && t.push(r[e]), t), []) : h(this, o).reduce((t, r, i) => (h(this, o).slice(i + 1).some((s) => s === r) && t.push(r), t), []));
|
|
383
383
|
}
|
|
384
384
|
each(e) {
|
|
385
385
|
let t = 0;
|
|
@@ -402,22 +402,22 @@ class k {
|
|
|
402
402
|
}
|
|
403
403
|
ensure(e) {
|
|
404
404
|
const t = Array.isArray(e) ? e : [e];
|
|
405
|
-
return
|
|
405
|
+
return h(this, o).forEach((r, i) => {
|
|
406
406
|
if (!t.some((s) => typeof s == "string" ? typeof r === s : r instanceof s))
|
|
407
407
|
throw new TypeError(`The item at index ${i} is not of the expected type`);
|
|
408
408
|
}), this;
|
|
409
409
|
}
|
|
410
410
|
every(e) {
|
|
411
|
-
return
|
|
411
|
+
return h(this, o).every((t, r) => e(t, r, this));
|
|
412
412
|
}
|
|
413
413
|
except(e) {
|
|
414
|
-
return c(
|
|
414
|
+
return c(h(this, o).filter((t, r) => !e.includes(r)));
|
|
415
415
|
}
|
|
416
416
|
filter(e) {
|
|
417
|
-
return c(
|
|
417
|
+
return c(h(this, o).filter((t, r) => typeof e != "function" ? !!t : e(t, r, this)));
|
|
418
418
|
}
|
|
419
419
|
first(e) {
|
|
420
|
-
return typeof e == "function" ?
|
|
420
|
+
return typeof e == "function" ? h(this, o).find((t, r) => e(t, r, this)) ?? null : h(this, o)[0] ?? null;
|
|
421
421
|
}
|
|
422
422
|
firstOrFail(e) {
|
|
423
423
|
const t = this.first(e);
|
|
@@ -431,10 +431,10 @@ class k {
|
|
|
431
431
|
if (typeof t > "u")
|
|
432
432
|
return this.first((i) => !!i[e]);
|
|
433
433
|
if (typeof r > "u")
|
|
434
|
-
return
|
|
434
|
+
return h(this, o).find((i) => i[e] == t) ?? null;
|
|
435
435
|
if (typeof t != "string")
|
|
436
436
|
throw new TypeError("The operator must be a string");
|
|
437
|
-
return r === null ?
|
|
437
|
+
return r === null ? h(this, o).find((i) => i[e] === null) ?? null : h(this, o).find((i) => {
|
|
438
438
|
switch (t) {
|
|
439
439
|
case "=":
|
|
440
440
|
return i[e] == r;
|
|
@@ -454,31 +454,31 @@ class k {
|
|
|
454
454
|
}) ?? null;
|
|
455
455
|
}
|
|
456
456
|
flatMap(e) {
|
|
457
|
-
return c(
|
|
457
|
+
return c(h(this, o).flatMap((t, r) => e(t, r, this)));
|
|
458
458
|
}
|
|
459
459
|
forget(e) {
|
|
460
|
-
return
|
|
460
|
+
return h(this, o).splice(e, 1), _(this), this;
|
|
461
461
|
}
|
|
462
462
|
forPage(e, t) {
|
|
463
|
-
return c(
|
|
463
|
+
return c(h(this, o).slice((e - 1) * t, e * t));
|
|
464
464
|
}
|
|
465
465
|
get(e, t) {
|
|
466
466
|
if (typeof e != "number")
|
|
467
467
|
throw new TypeError("The key must be a number");
|
|
468
|
-
return typeof t > "u" ?
|
|
468
|
+
return typeof t > "u" ? h(this, o)[e] ?? null : typeof t == "function" ? h(this, o)[e] ?? t() : h(this, o)[e] ?? t;
|
|
469
469
|
}
|
|
470
470
|
groupBy(e) {
|
|
471
471
|
const t = Array.isArray(e) ? e : [e];
|
|
472
|
-
return
|
|
473
|
-
const u = t.map((
|
|
474
|
-
if (typeof
|
|
475
|
-
const d =
|
|
472
|
+
return h(this, o).reduce((r, i, s) => {
|
|
473
|
+
const u = t.map((a) => {
|
|
474
|
+
if (typeof a == "function") {
|
|
475
|
+
const d = a(i, s, this);
|
|
476
476
|
return Array.isArray(d) ? d : [d];
|
|
477
477
|
}
|
|
478
|
-
return [String(i[
|
|
478
|
+
return [String(i[a])];
|
|
479
479
|
});
|
|
480
|
-
return U(...u).forEach((
|
|
481
|
-
const d = Array.isArray(
|
|
480
|
+
return U(...u).forEach((a) => {
|
|
481
|
+
const d = Array.isArray(a) ? a.join(".") : a;
|
|
482
482
|
f.set(r, d, [
|
|
483
483
|
...f.get(r, d, []),
|
|
484
484
|
i
|
|
@@ -487,7 +487,7 @@ class k {
|
|
|
487
487
|
}, {});
|
|
488
488
|
}
|
|
489
489
|
has(e) {
|
|
490
|
-
return
|
|
490
|
+
return h(this, o).length > e;
|
|
491
491
|
}
|
|
492
492
|
hasAny(e) {
|
|
493
493
|
return e.some((t) => this.has(t));
|
|
@@ -496,48 +496,48 @@ class k {
|
|
|
496
496
|
if (typeof t > "u") {
|
|
497
497
|
if (typeof e != "string")
|
|
498
498
|
throw new TypeError("The glue must be a string");
|
|
499
|
-
if (!
|
|
499
|
+
if (!h(this, o).every((r) => ["string", "number"].includes(typeof r)))
|
|
500
500
|
throw new TypeError("The items must be strings or numbers");
|
|
501
|
-
return
|
|
501
|
+
return h(this, o).join(e);
|
|
502
502
|
}
|
|
503
503
|
if (typeof e == "function")
|
|
504
|
-
return
|
|
504
|
+
return h(this, o).map((r, i) => e(r, i, this)).join(t);
|
|
505
505
|
if (typeof e != "string")
|
|
506
506
|
throw new TypeError("The key must be a string");
|
|
507
|
-
if (!
|
|
507
|
+
if (!h(this, o).every((r) => typeof r == "object"))
|
|
508
508
|
throw new TypeError("The items must be objects");
|
|
509
|
-
return
|
|
509
|
+
return h(this, o).map((r) => r[e]).join(t);
|
|
510
510
|
}
|
|
511
511
|
intersect(e) {
|
|
512
|
-
return Array.isArray(e) ? c(
|
|
512
|
+
return Array.isArray(e) ? c(h(this, o).filter((t) => e.includes(t))) : c(h(this, o).filter((t) => e.contains(t)));
|
|
513
513
|
}
|
|
514
514
|
isEmpty() {
|
|
515
|
-
return
|
|
515
|
+
return h(this, o).length === 0;
|
|
516
516
|
}
|
|
517
517
|
isNotEmpty() {
|
|
518
518
|
return !this.isEmpty();
|
|
519
519
|
}
|
|
520
520
|
join(e, t) {
|
|
521
|
-
return typeof t > "u" ?
|
|
521
|
+
return typeof t > "u" ? h(this, o).join(e) : h(this, o).slice(0, -1).join(e) + t + h(this, o)[h(this, o).length - 1];
|
|
522
522
|
}
|
|
523
523
|
keyBy(e) {
|
|
524
524
|
if (typeof e == "function")
|
|
525
|
-
return
|
|
525
|
+
return h(this, o).reduce((t, r, i) => (t[e(r, i, this)] = r, t), {});
|
|
526
526
|
if (typeof e != "string")
|
|
527
527
|
throw new TypeError("The key must be a string");
|
|
528
|
-
return
|
|
528
|
+
return h(this, o).reduce((t, r) => (t[String(r[e])] = r, t), {});
|
|
529
529
|
}
|
|
530
530
|
last(e) {
|
|
531
|
-
return typeof e == "function" ?
|
|
531
|
+
return typeof e == "function" ? h(this, o).toReversed().find((t, r) => e(t, r, this)) ?? null : h(this, o)[h(this, o).length - 1] ?? null;
|
|
532
532
|
}
|
|
533
533
|
map(e) {
|
|
534
|
-
return c(
|
|
534
|
+
return c(h(this, o).map((t, r) => e(t, r, this)));
|
|
535
535
|
}
|
|
536
536
|
mapInto(e) {
|
|
537
|
-
return c(
|
|
537
|
+
return c(h(this, o).map((t) => new e(t)));
|
|
538
538
|
}
|
|
539
539
|
mapSpread(e) {
|
|
540
|
-
return c(
|
|
540
|
+
return c(h(this, o).map((t) => {
|
|
541
541
|
if (!Array.isArray(t) && !$(t))
|
|
542
542
|
throw new TypeError("The items in the collection must be arrays or collections");
|
|
543
543
|
const r = Array.isArray(t) ? t : t.all();
|
|
@@ -545,37 +545,37 @@ class k {
|
|
|
545
545
|
}));
|
|
546
546
|
}
|
|
547
547
|
mapToGroups(e) {
|
|
548
|
-
return
|
|
548
|
+
return h(this, o).reduce((t, r, i) => {
|
|
549
549
|
const s = e(r, i, this);
|
|
550
|
-
return Object.entries(s).forEach(([u,
|
|
551
|
-
t[u] = t[u] ?? [], t[u].push(
|
|
550
|
+
return Object.entries(s).forEach(([u, l]) => {
|
|
551
|
+
t[u] = t[u] ?? [], t[u].push(l);
|
|
552
552
|
}), t;
|
|
553
553
|
}, {});
|
|
554
554
|
}
|
|
555
555
|
mapWithKeys(e) {
|
|
556
|
-
return
|
|
556
|
+
return h(this, o).reduce((t, r, i) => {
|
|
557
557
|
const s = e(r, i, this);
|
|
558
|
-
return Object.entries(s).forEach(([u,
|
|
559
|
-
t[u] =
|
|
558
|
+
return Object.entries(s).forEach(([u, l]) => {
|
|
559
|
+
t[u] = l;
|
|
560
560
|
}), t;
|
|
561
561
|
}, {});
|
|
562
562
|
}
|
|
563
563
|
max(e) {
|
|
564
|
-
return typeof e == "string" ?
|
|
564
|
+
return typeof e == "string" ? h(this, o).reduce((t, r) => r[e] > t ? r[e] : t, h(this, o)[0][e]) : h(this, o).reduce((t, r) => r > t ? r : t, h(this, o)[0]);
|
|
565
565
|
}
|
|
566
566
|
median(e) {
|
|
567
567
|
if (typeof e == "string") {
|
|
568
568
|
const i = this.pluck(e).sort(), s = Math.floor(i.count() / 2);
|
|
569
|
-
return i.count() % 2 === 0 ? c([
|
|
569
|
+
return i.count() % 2 === 0 ? c([q(i, s - 1), q(i, s)]).avg() : q(i, s);
|
|
570
570
|
}
|
|
571
|
-
const t =
|
|
571
|
+
const t = h(this, o).toSorted(), r = Math.floor(t.length / 2);
|
|
572
572
|
return t.length % 2 === 0 ? c([t[r - 1], t[r]]).avg() : t[r] ?? null;
|
|
573
573
|
}
|
|
574
574
|
merge(e) {
|
|
575
|
-
return Array.isArray(e) ? c([...
|
|
575
|
+
return Array.isArray(e) ? c([...h(this, o), ...e]) : c([...h(this, o), ...e.all()]);
|
|
576
576
|
}
|
|
577
577
|
min(e) {
|
|
578
|
-
return typeof e == "string" ?
|
|
578
|
+
return typeof e == "string" ? h(this, o).reduce((t, r) => r[e] < t ? r[e] : t, h(this, o)[0][e]) : h(this, o).reduce((t, r) => r < t ? r : t, h(this, o)[0]);
|
|
579
579
|
}
|
|
580
580
|
mode(e) {
|
|
581
581
|
const t = typeof e == "string" ? this.filter((i) => ["number", "string"].includes(typeof i[e])).countBy((i) => i[e]) : this.countBy(), r = Math.max(...Object.values(t));
|
|
@@ -585,10 +585,10 @@ class k {
|
|
|
585
585
|
return this.chunk(e).filter((r) => r.count() > t).map((r) => r.get(t));
|
|
586
586
|
}
|
|
587
587
|
only(e) {
|
|
588
|
-
return c(
|
|
588
|
+
return c(h(this, o).filter((t, r) => e.includes(r)));
|
|
589
589
|
}
|
|
590
590
|
pad(e, t = null) {
|
|
591
|
-
const r =
|
|
591
|
+
const r = h(this, o).slice();
|
|
592
592
|
for (; r.length < Math.abs(e); )
|
|
593
593
|
e > 0 ? r.push(t) : r.unshift(t);
|
|
594
594
|
return c(r);
|
|
@@ -601,7 +601,7 @@ class k {
|
|
|
601
601
|
}
|
|
602
602
|
percentage(e, t = 2) {
|
|
603
603
|
return Math.round(
|
|
604
|
-
100 * (10 ^ t) * this.filter(e).count() /
|
|
604
|
+
100 * (10 ^ t) * this.filter(e).count() / h(this, o).length
|
|
605
605
|
) / (10 ^ t);
|
|
606
606
|
}
|
|
607
607
|
pipe(e) {
|
|
@@ -623,79 +623,79 @@ class k {
|
|
|
623
623
|
return this.map((t) => t[e]);
|
|
624
624
|
}
|
|
625
625
|
pop(e = 1) {
|
|
626
|
-
const t =
|
|
626
|
+
const t = h(this, o).splice(h(this, o).length - e, e);
|
|
627
627
|
return _(this), e === 1 ? t[0] ?? null : c(t);
|
|
628
628
|
}
|
|
629
629
|
prepend(e) {
|
|
630
|
-
const t =
|
|
630
|
+
const t = h(this, o).unshift(e);
|
|
631
631
|
return _(this), t;
|
|
632
632
|
}
|
|
633
633
|
pull(e) {
|
|
634
|
-
const t =
|
|
634
|
+
const t = h(this, o).splice(e, 1)[0] ?? null;
|
|
635
635
|
return _(this), t;
|
|
636
636
|
}
|
|
637
637
|
push(...e) {
|
|
638
|
-
const t =
|
|
638
|
+
const t = h(this, o).push(...e);
|
|
639
639
|
return _(this), t;
|
|
640
640
|
}
|
|
641
641
|
put(e, t) {
|
|
642
|
-
return
|
|
642
|
+
return h(this, o).splice(e, 1, t), _(this), this;
|
|
643
643
|
}
|
|
644
644
|
random(e = 1) {
|
|
645
|
-
if (
|
|
645
|
+
if (h(this, o).length < e)
|
|
646
646
|
throw new Error("The collection has fewer items than the requested amount");
|
|
647
|
-
const t = c(f.sampleSize(
|
|
647
|
+
const t = c(f.sampleSize(h(this, o), e));
|
|
648
648
|
return e === 1 ? t.first() : t;
|
|
649
649
|
}
|
|
650
650
|
reduce(e, t = null) {
|
|
651
|
-
return
|
|
651
|
+
return h(this, o).reduce((r, i, s) => e(r, i, s, this), t);
|
|
652
652
|
}
|
|
653
653
|
reject(e) {
|
|
654
654
|
return this.filter((t, r) => !e(t, r, this));
|
|
655
655
|
}
|
|
656
656
|
replace(e) {
|
|
657
|
-
const t =
|
|
657
|
+
const t = h(this, o).slice();
|
|
658
658
|
return Object.entries(e).forEach(([r, i]) => {
|
|
659
659
|
t[parseInt(r)] = i;
|
|
660
660
|
}), c(t);
|
|
661
661
|
}
|
|
662
662
|
reverse() {
|
|
663
|
-
return c(
|
|
663
|
+
return c(h(this, o).toReversed());
|
|
664
664
|
}
|
|
665
665
|
search(e, t = !1) {
|
|
666
|
-
if (typeof e != "function" ||
|
|
667
|
-
const i =
|
|
666
|
+
if (typeof e != "function" || h(this, o).every((i) => typeof i == "function")) {
|
|
667
|
+
const i = h(this, o).findIndex((s) => t ? s === e : s == e);
|
|
668
668
|
return i === -1 ? !1 : i;
|
|
669
669
|
}
|
|
670
|
-
const r =
|
|
670
|
+
const r = h(this, o).findIndex((i, s) => e(i, s, this));
|
|
671
671
|
return r === -1 ? !1 : r;
|
|
672
672
|
}
|
|
673
673
|
select(e) {
|
|
674
674
|
return this.map((t) => e.reduce((r, i) => (r[i] = t[i], r), {}));
|
|
675
675
|
}
|
|
676
676
|
shift(e = 1) {
|
|
677
|
-
const t =
|
|
677
|
+
const t = h(this, o).splice(0, e);
|
|
678
678
|
return _(this), e === 1 ? t[0] ?? null : c(t);
|
|
679
679
|
}
|
|
680
680
|
shuffle() {
|
|
681
|
-
return c(f.shuffle(
|
|
681
|
+
return c(f.shuffle(h(this, o)));
|
|
682
682
|
}
|
|
683
683
|
skip(e) {
|
|
684
|
-
return c(
|
|
684
|
+
return c(h(this, o).slice(e));
|
|
685
685
|
}
|
|
686
686
|
skipUntil(e) {
|
|
687
|
-
return typeof e == "function" ? this.skip(
|
|
687
|
+
return typeof e == "function" ? this.skip(h(this, o).findIndex((t, r) => e(t, r, this))) : this.skip(h(this, o).findIndex((t) => t == e));
|
|
688
688
|
}
|
|
689
689
|
skipWhile(e) {
|
|
690
|
-
return typeof e == "function" ? this.skip(
|
|
690
|
+
return typeof e == "function" ? this.skip(h(this, o).findIndex((t, r) => !e(t, r, this))) : this.skip(h(this, o).findIndex((t) => t != e));
|
|
691
691
|
}
|
|
692
692
|
slice(e, t) {
|
|
693
|
-
return c(typeof t > "u" ?
|
|
693
|
+
return c(typeof t > "u" ? h(this, o).slice(e) : typeof e > "u" ? h(this, o).slice(0, t) : h(this, o).slice(e, e + t));
|
|
694
694
|
}
|
|
695
695
|
sliding(e, t = 1) {
|
|
696
696
|
const r = [];
|
|
697
|
-
for (let i = 0; i <
|
|
698
|
-
r.push(
|
|
697
|
+
for (let i = 0; i < h(this, o).length && !(i + e > h(this, o).length); i += t)
|
|
698
|
+
r.push(h(this, o).slice(i, i + e));
|
|
699
699
|
return c(r.map((i) => c(i)));
|
|
700
700
|
}
|
|
701
701
|
sole(e, t) {
|
|
@@ -707,30 +707,30 @@ class k {
|
|
|
707
707
|
const r = this.where(e, t);
|
|
708
708
|
return r.count() === 1 ? r.first() : null;
|
|
709
709
|
}
|
|
710
|
-
return
|
|
710
|
+
return h(this, o).length === 1 ? this.first() : null;
|
|
711
711
|
}
|
|
712
712
|
some(...e) {
|
|
713
713
|
return this.contains(...e);
|
|
714
714
|
}
|
|
715
715
|
sort(e) {
|
|
716
|
-
return c(
|
|
716
|
+
return c(h(this, o).toSorted(e));
|
|
717
717
|
}
|
|
718
718
|
sortBy(e, t = "asc") {
|
|
719
719
|
if (typeof e == "function") {
|
|
720
720
|
let r = -1;
|
|
721
|
-
return c(
|
|
721
|
+
return c(h(this, o).toSorted((i, s) => (r++, e(i, r, this) - e(s, r, this))));
|
|
722
722
|
}
|
|
723
723
|
if (Array.isArray(e))
|
|
724
|
-
return e.every((r) => Array.isArray(r)) ? c(
|
|
724
|
+
return e.every((r) => Array.isArray(r)) ? c(h(this, o).toSorted((r, i) => {
|
|
725
725
|
for (const [s, u] of e) {
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
726
|
+
const l = r[s] ?? -1 / 0, a = i[s] ?? -1 / 0;
|
|
727
|
+
if (l > a)
|
|
728
728
|
return u === "asc" ? 1 : -1;
|
|
729
|
-
if (
|
|
729
|
+
if (l < a)
|
|
730
730
|
return u === "asc" ? -1 : 1;
|
|
731
731
|
}
|
|
732
732
|
return 0;
|
|
733
|
-
})) : c(
|
|
733
|
+
})) : c(h(this, o).toSorted((r, i) => {
|
|
734
734
|
for (const s of e) {
|
|
735
735
|
const u = s(r, i);
|
|
736
736
|
if (u !== 0)
|
|
@@ -740,7 +740,7 @@ class k {
|
|
|
740
740
|
}));
|
|
741
741
|
if (typeof e != "string")
|
|
742
742
|
throw new TypeError("The key must be a string");
|
|
743
|
-
return c(
|
|
743
|
+
return c(h(this, o).toSorted((r, i) => {
|
|
744
744
|
const s = r[e] ?? -1 / 0, u = i[e] ?? -1 / 0;
|
|
745
745
|
return s > u ? t === "asc" ? 1 : -1 : s < u ? t === "asc" ? -1 : 1 : 0;
|
|
746
746
|
}));
|
|
@@ -749,17 +749,17 @@ class k {
|
|
|
749
749
|
return this.sort((e, t) => e > t ? -1 : e < t ? 1 : 0);
|
|
750
750
|
}
|
|
751
751
|
splice(e, t, ...r) {
|
|
752
|
-
const i = t === void 0 ?
|
|
752
|
+
const i = t === void 0 ? h(this, o).length : t, s = h(this, o).splice(e, i, ...r);
|
|
753
753
|
return _(this), c(s);
|
|
754
754
|
}
|
|
755
755
|
split(e) {
|
|
756
756
|
const t = [];
|
|
757
757
|
for (let r = 0; r < e; r++) {
|
|
758
|
-
const i =
|
|
758
|
+
const i = h(this, o).slice(
|
|
759
759
|
t.flat().length,
|
|
760
760
|
t.flat().length + Math.min(
|
|
761
|
-
Math.ceil((
|
|
762
|
-
|
|
761
|
+
Math.ceil((h(this, o).length - t.flat().length) / (e - r)),
|
|
762
|
+
h(this, o).length - t.flat().length
|
|
763
763
|
)
|
|
764
764
|
);
|
|
765
765
|
t.push(c(i));
|
|
@@ -767,50 +767,50 @@ class k {
|
|
|
767
767
|
return c(t);
|
|
768
768
|
}
|
|
769
769
|
splitIn(e) {
|
|
770
|
-
const t = Math.ceil(
|
|
770
|
+
const t = Math.ceil(h(this, o).length / e);
|
|
771
771
|
return this.chunk(t);
|
|
772
772
|
}
|
|
773
773
|
sum(e) {
|
|
774
|
-
return typeof e == "string" ?
|
|
774
|
+
return typeof e == "string" ? h(this, o).reduce((t, r) => {
|
|
775
775
|
const i = r[e];
|
|
776
776
|
if (typeof i != "number")
|
|
777
777
|
throw new TypeError("The items must be numbers");
|
|
778
778
|
return t + i;
|
|
779
|
-
}, 0) :
|
|
779
|
+
}, 0) : h(this, o).reduce((t, r) => {
|
|
780
780
|
if (typeof r != "number")
|
|
781
781
|
throw new TypeError("The items must be numbers");
|
|
782
782
|
return t + r;
|
|
783
783
|
}, 0);
|
|
784
784
|
}
|
|
785
785
|
take(e) {
|
|
786
|
-
return c(
|
|
786
|
+
return c(h(this, o).slice(0, e));
|
|
787
787
|
}
|
|
788
788
|
takeUntil(e) {
|
|
789
|
-
return typeof e == "function" ? this.take(
|
|
789
|
+
return typeof e == "function" ? this.take(h(this, o).findIndex((t, r) => e(t, r, this))) : this.take(h(this, o).findIndex((t) => t == e));
|
|
790
790
|
}
|
|
791
791
|
takeWhile(e) {
|
|
792
|
-
return typeof e == "function" ? this.take(
|
|
792
|
+
return typeof e == "function" ? this.take(h(this, o).findIndex((t, r) => !e(t, r, this))) : this.take(h(this, o).findIndex((t) => t != e));
|
|
793
793
|
}
|
|
794
794
|
tap(e) {
|
|
795
795
|
return e(this), this;
|
|
796
796
|
}
|
|
797
797
|
toArray() {
|
|
798
798
|
const e = (t) => typeof t != "object" ? t : Array.isArray(t) ? t.map(e) : t && "toArray" in t && typeof t.toArray == "function" ? t.toArray() : t && "toJson" in t && typeof t.toJson == "function" ? t.toJson() : t;
|
|
799
|
-
return
|
|
799
|
+
return h(this, o).map(e);
|
|
800
800
|
}
|
|
801
801
|
toJson() {
|
|
802
|
-
return JSON.stringify(
|
|
802
|
+
return JSON.stringify(h(this, o));
|
|
803
803
|
}
|
|
804
804
|
transform(e) {
|
|
805
|
-
for (const [t, r] of
|
|
806
|
-
|
|
805
|
+
for (const [t, r] of h(this, o).entries())
|
|
806
|
+
h(this, o).splice(t, 1, e(r, t, this));
|
|
807
807
|
return _(this), this;
|
|
808
808
|
}
|
|
809
809
|
unique(e) {
|
|
810
|
-
return c(typeof e == "string" ?
|
|
810
|
+
return c(typeof e == "string" ? h(this, o).filter((t, r) => !h(this, o).some((i, s) => i[e] == t[e] && s !== r)) : [...new Set(h(this, o))]);
|
|
811
811
|
}
|
|
812
812
|
uniqueStrict(e) {
|
|
813
|
-
return c(typeof e == "string" ?
|
|
813
|
+
return c(typeof e == "string" ? h(this, o).filter((t, r) => !h(this, o).some((i, s) => i[e] === t[e] && s !== r)) : [...new Set(h(this, o))]);
|
|
814
814
|
}
|
|
815
815
|
unless(e, t, r) {
|
|
816
816
|
return e ? typeof r == "function" && r(this) : t(this), this;
|
|
@@ -822,7 +822,7 @@ class k {
|
|
|
822
822
|
return this.whenEmpty(e, t);
|
|
823
823
|
}
|
|
824
824
|
value(e) {
|
|
825
|
-
return
|
|
825
|
+
return h(this, o).length === 0 ? null : h(this, o)[0][e];
|
|
826
826
|
}
|
|
827
827
|
when(e, t, r) {
|
|
828
828
|
return e ? t(this) : typeof r == "function" && r(this), this;
|
|
@@ -835,11 +835,11 @@ class k {
|
|
|
835
835
|
}
|
|
836
836
|
where(e, t, r) {
|
|
837
837
|
if (typeof r > "u")
|
|
838
|
-
return c(
|
|
838
|
+
return c(h(this, o).filter((s) => s[e] == t));
|
|
839
839
|
if (typeof t != "string")
|
|
840
840
|
throw new TypeError("The operator must be a string");
|
|
841
841
|
if (r === null)
|
|
842
|
-
return c(
|
|
842
|
+
return c(h(this, o).filter((s) => s[e] === null));
|
|
843
843
|
const i = {
|
|
844
844
|
"=": (s) => s[e] == r,
|
|
845
845
|
"!=": (s) => s[e] != r,
|
|
@@ -850,15 +850,15 @@ class k {
|
|
|
850
850
|
};
|
|
851
851
|
if (!(t in i))
|
|
852
852
|
throw new Error("Unsupported operator");
|
|
853
|
-
return c(
|
|
853
|
+
return c(h(this, o).filter((s, u) => i[t](s, u, this)));
|
|
854
854
|
}
|
|
855
855
|
whereStrict(e, t, r) {
|
|
856
856
|
if (typeof r > "u")
|
|
857
|
-
return c(
|
|
857
|
+
return c(h(this, o).filter((s) => s[e] === t));
|
|
858
858
|
if (typeof t != "string")
|
|
859
859
|
throw new TypeError("The operator must be a string");
|
|
860
860
|
if (r === null)
|
|
861
|
-
return c(
|
|
861
|
+
return c(h(this, o).filter((s) => s[e] === null));
|
|
862
862
|
const i = {
|
|
863
863
|
"=": (s) => s[e] === r,
|
|
864
864
|
"!=": (s) => s[e] !== r,
|
|
@@ -869,57 +869,57 @@ class k {
|
|
|
869
869
|
};
|
|
870
870
|
if (!(t in i))
|
|
871
871
|
throw new Error("Unsupported operator");
|
|
872
|
-
return c(
|
|
872
|
+
return c(h(this, o).filter((s, u) => i[t](s, u, this)));
|
|
873
873
|
}
|
|
874
874
|
whereBetween(e, [t, r]) {
|
|
875
|
-
return c(
|
|
875
|
+
return c(h(this, o).filter((i) => i[e] >= t && i[e] <= r));
|
|
876
876
|
}
|
|
877
877
|
whereIn(e, t) {
|
|
878
|
-
return c(
|
|
878
|
+
return c(h(this, o).filter((r) => t.includes(r[e])));
|
|
879
879
|
}
|
|
880
880
|
whereInstanceOf(e) {
|
|
881
|
-
return c(
|
|
881
|
+
return c(h(this, o).filter((t) => t instanceof e));
|
|
882
882
|
}
|
|
883
883
|
whereNotBetween(e, [t, r]) {
|
|
884
|
-
return c(
|
|
884
|
+
return c(h(this, o).filter((i) => i[e] < t || i[e] > r));
|
|
885
885
|
}
|
|
886
886
|
whereNotIn(e, t) {
|
|
887
|
-
return c(
|
|
887
|
+
return c(h(this, o).filter((r) => !t.includes(r[e])));
|
|
888
888
|
}
|
|
889
889
|
whereNotNull(e) {
|
|
890
|
-
return c(
|
|
890
|
+
return c(h(this, o).filter((t) => t[e] !== null));
|
|
891
891
|
}
|
|
892
892
|
whereNull(e) {
|
|
893
|
-
return c(
|
|
893
|
+
return c(h(this, o).filter((t) => t[e] === null));
|
|
894
894
|
}
|
|
895
895
|
zip(e) {
|
|
896
896
|
return Array.isArray(e) ? c(
|
|
897
|
-
|
|
897
|
+
h(this, o).map((t, r) => [t, e[r] ?? null])
|
|
898
898
|
) : c(
|
|
899
|
-
|
|
899
|
+
h(this, o).map((t, r) => [t, e.get(r)])
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
902
|
// HasEvents methods
|
|
903
903
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
904
904
|
on(e, t) {
|
|
905
|
-
throw new
|
|
905
|
+
throw new b();
|
|
906
906
|
}
|
|
907
907
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
908
908
|
once(e, t) {
|
|
909
|
-
throw new
|
|
909
|
+
throw new b();
|
|
910
910
|
}
|
|
911
911
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
912
912
|
emit(e, t) {
|
|
913
|
-
throw new
|
|
913
|
+
throw new b();
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
|
|
917
|
-
const
|
|
916
|
+
o = new WeakMap();
|
|
917
|
+
const k = A(P);
|
|
918
918
|
var ee, te;
|
|
919
|
-
class H extends (te =
|
|
919
|
+
class H extends (te = P, ee = Symbol.toStringTag, te) {
|
|
920
920
|
constructor() {
|
|
921
921
|
super(...arguments);
|
|
922
|
-
|
|
922
|
+
m(this, ee, "Collection");
|
|
923
923
|
}
|
|
924
924
|
intersect(t) {
|
|
925
925
|
return this.filter((r) => t.some((i) => i.getKey() === r.getKey()));
|
|
@@ -938,13 +938,13 @@ var re, se;
|
|
|
938
938
|
class Je extends (se = Error, re = Symbol.toStringTag, se) {
|
|
939
939
|
constructor(t) {
|
|
940
940
|
super(`[Luminix] Model "${t}" does not have a primary key`);
|
|
941
|
-
|
|
941
|
+
m(this, re, "ModelWithoutPrimaryKeyException");
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
const De = A(S);
|
|
945
945
|
class Ue {
|
|
946
946
|
constructor(e, t, r = {}) {
|
|
947
|
-
|
|
947
|
+
m(this, "bag");
|
|
948
948
|
this.facades = e, this.abstract = t, this.query = r, this.bag = new De(r), this.bag.on("change", () => {
|
|
949
949
|
this.emit("change", {
|
|
950
950
|
data: this.bag
|
|
@@ -953,15 +953,15 @@ class Ue {
|
|
|
953
953
|
}
|
|
954
954
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
955
955
|
on(e, t) {
|
|
956
|
-
throw new
|
|
956
|
+
throw new b();
|
|
957
957
|
}
|
|
958
958
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
959
959
|
once(e, t) {
|
|
960
|
-
throw new
|
|
960
|
+
throw new b();
|
|
961
961
|
}
|
|
962
962
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
963
963
|
emit(e, t) {
|
|
964
|
-
throw new
|
|
964
|
+
throw new b();
|
|
965
965
|
}
|
|
966
966
|
lock(e) {
|
|
967
967
|
this.bag.lock(e);
|
|
@@ -1039,11 +1039,11 @@ class Ue {
|
|
|
1039
1039
|
params: this.bag.all(),
|
|
1040
1040
|
errorBag: `${this.abstract}.fetch`
|
|
1041
1041
|
}), i = this.facades.model.make(this.abstract), s = c(r.data.map((u) => {
|
|
1042
|
-
const
|
|
1043
|
-
return
|
|
1042
|
+
const l = new i(u);
|
|
1043
|
+
return l.exists = !0, this.facades.model.emit("fetch", {
|
|
1044
1044
|
class: this.abstract,
|
|
1045
|
-
model:
|
|
1046
|
-
}),
|
|
1045
|
+
model: l
|
|
1046
|
+
}), l;
|
|
1047
1047
|
}), H);
|
|
1048
1048
|
if (t) {
|
|
1049
1049
|
const [u] = t.split("?");
|
|
@@ -1058,9 +1058,9 @@ class Ue {
|
|
|
1058
1058
|
},
|
|
1059
1059
|
meta: {
|
|
1060
1060
|
...r.meta,
|
|
1061
|
-
links: r.meta.links.map((
|
|
1062
|
-
...
|
|
1063
|
-
url:
|
|
1061
|
+
links: r.meta.links.map((l) => ({
|
|
1062
|
+
...l,
|
|
1063
|
+
url: l.url && `${u}?${N(t, l.url).toString()}`
|
|
1064
1064
|
}))
|
|
1065
1065
|
}
|
|
1066
1066
|
};
|
|
@@ -1103,10 +1103,10 @@ class Ue {
|
|
|
1103
1103
|
const e = this.facades.config.get("luminix.backend.api.max_per_page", 150), t = await this.limit(e).exec(1), r = t.meta.last_page;
|
|
1104
1104
|
if (r === 1)
|
|
1105
1105
|
return t.data;
|
|
1106
|
-
const i = Array.from({ length: r - 1 }, (
|
|
1107
|
-
i.map((
|
|
1106
|
+
const i = Array.from({ length: r - 1 }, (l, a) => a + 2), s = await Promise.all(
|
|
1107
|
+
i.map((l) => this.limit(e).exec(l))
|
|
1108
1108
|
), u = c(
|
|
1109
|
-
s.reduce((
|
|
1109
|
+
s.reduce((l, a) => (l.push(...a.data), l), t.data).all(),
|
|
1110
1110
|
H
|
|
1111
1111
|
);
|
|
1112
1112
|
return this.emit("success", {
|
|
@@ -1123,37 +1123,37 @@ var ie, ne;
|
|
|
1123
1123
|
class T extends (ne = Error, ie = Symbol.toStringTag, ne) {
|
|
1124
1124
|
constructor(t) {
|
|
1125
1125
|
super(`[Luminix] Expected ${t} to be reducible.`);
|
|
1126
|
-
|
|
1126
|
+
m(this, ie, "NotReducibleException");
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
1129
|
var oe, he;
|
|
1130
1130
|
class M extends (he = TypeError, oe = Symbol.toStringTag, he) {
|
|
1131
1131
|
constructor(t, r = "Model") {
|
|
1132
1132
|
super(`[Luminix] "${t}" expects ${r}`);
|
|
1133
|
-
|
|
1133
|
+
m(this, oe, "NotModelException");
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
1136
|
var ue, ae;
|
|
1137
1137
|
class We extends (ae = Error, ue = Symbol.toStringTag, ae) {
|
|
1138
1138
|
constructor(t, r, i, s) {
|
|
1139
1139
|
super(`[Luminix] Could not determine inverse relation for "${r}" in model "${t}". Please specify a relation in model "${i}" of type ${s} that points back to "${t}".`);
|
|
1140
|
-
|
|
1140
|
+
m(this, ue, "NoInverseRelationException");
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
var le, ce;
|
|
1144
1144
|
class Ge extends (ce = Error, le = Symbol.toStringTag, ce) {
|
|
1145
1145
|
constructor(t) {
|
|
1146
1146
|
super(`[Luminix] Relation "${t}" is not supported`);
|
|
1147
|
-
|
|
1147
|
+
m(this, le, "UnsupportedRelationException");
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function E(n) {
|
|
1151
1151
|
return typeof n == "object" && n !== null && n.__isModel === !0;
|
|
1152
1152
|
}
|
|
1153
|
-
class
|
|
1153
|
+
class K {
|
|
1154
1154
|
constructor(e, t, r, i = null) {
|
|
1155
|
-
|
|
1156
|
-
if (this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !
|
|
1155
|
+
m(this, "unsubscribeQuery", null);
|
|
1156
|
+
if (this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !E(i) && !($(i) && i.every(E)))
|
|
1157
1157
|
throw new M("Relation.constructor()", "Model, Collection<Model> or null");
|
|
1158
1158
|
}
|
|
1159
1159
|
make(e) {
|
|
@@ -1197,9 +1197,9 @@ class j {
|
|
|
1197
1197
|
throw new We(this.parent.getType(), t, this.getRelated().getSchemaName(), r[t].join(" or "));
|
|
1198
1198
|
}
|
|
1199
1199
|
set(e) {
|
|
1200
|
-
if (e !== null && !
|
|
1200
|
+
if (e !== null && !E(e) && !($(e) && e.every(E)))
|
|
1201
1201
|
throw new M("Relation.set()", "Model, Collection<Model> or null");
|
|
1202
|
-
!this.items ||
|
|
1202
|
+
!this.items || E(this.items) ? this.items = e : $(e) && this.items.splice(0, this.items.count(), ...e);
|
|
1203
1203
|
}
|
|
1204
1204
|
getForeignKey() {
|
|
1205
1205
|
return this.meta.foreignKey;
|
|
@@ -1229,7 +1229,7 @@ class j {
|
|
|
1229
1229
|
return this.items;
|
|
1230
1230
|
}
|
|
1231
1231
|
isSingle() {
|
|
1232
|
-
return
|
|
1232
|
+
return E(this.items);
|
|
1233
1233
|
}
|
|
1234
1234
|
isMultiple() {
|
|
1235
1235
|
return $(this.items);
|
|
@@ -1281,7 +1281,7 @@ var de, fe;
|
|
|
1281
1281
|
class Ae extends (fe = Error, de = Symbol.toStringTag, fe) {
|
|
1282
1282
|
constructor(t, r) {
|
|
1283
1283
|
super(`[Luminix] Model "${t}" must be persisted before calling "${r}"`);
|
|
1284
|
-
|
|
1284
|
+
m(this, de, "ModelNotPersistedException");
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
1287
|
function Ve(n, e) {
|
|
@@ -1289,12 +1289,12 @@ function Ve(n, e) {
|
|
|
1289
1289
|
r = Symbol.toStringTag;
|
|
1290
1290
|
class t {
|
|
1291
1291
|
constructor(s = {}) {
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1292
|
+
m(this, "_attributes", new S({}));
|
|
1293
|
+
m(this, "_original", {});
|
|
1294
|
+
m(this, "_relations", {});
|
|
1295
|
+
m(this, "_changedKeys", []);
|
|
1296
|
+
m(this, "exists", !1);
|
|
1297
|
+
m(this, r, f.upperFirst(f.camelCase(e)));
|
|
1298
1298
|
this.makeRelations(), this.makeAttributes(s);
|
|
1299
1299
|
}
|
|
1300
1300
|
cast(s, u) {
|
|
@@ -1308,10 +1308,10 @@ function Ve(n, e) {
|
|
|
1308
1308
|
if (this._relations = {}, !s)
|
|
1309
1309
|
return;
|
|
1310
1310
|
const u = n.make("model").relationMap({}, e);
|
|
1311
|
-
Object.entries(s).forEach(([
|
|
1312
|
-
const { type: d } =
|
|
1313
|
-
this._relations[
|
|
1314
|
-
{ name:
|
|
1311
|
+
Object.entries(s).forEach(([l, a]) => {
|
|
1312
|
+
const { type: d } = a, p = d in u ? u[d] : K;
|
|
1313
|
+
this._relations[l] = new p(
|
|
1314
|
+
{ name: l, ...a },
|
|
1315
1315
|
n.make(),
|
|
1316
1316
|
this,
|
|
1317
1317
|
null
|
|
@@ -1319,12 +1319,12 @@ function Ve(n, e) {
|
|
|
1319
1319
|
});
|
|
1320
1320
|
}
|
|
1321
1321
|
makeAttributes(s) {
|
|
1322
|
-
const { relations: u } = n.make("model").schema(e),
|
|
1323
|
-
if (this.fillable.filter((d) => !(d in
|
|
1324
|
-
|
|
1322
|
+
const { relations: u } = n.make("model").schema(e), l = Object.keys(u || {}), a = f.omit(s, l);
|
|
1323
|
+
if (this.fillable.filter((d) => !(d in a)).forEach((d) => {
|
|
1324
|
+
a[d] = null;
|
|
1325
1325
|
}), u && Object.keys(u).forEach((d) => {
|
|
1326
1326
|
this.relation(f.camelCase(d)).make(s[d]);
|
|
1327
|
-
}), !this.validateJsonObject(
|
|
1327
|
+
}), !this.validateJsonObject(a)) {
|
|
1328
1328
|
if (n.isProduction())
|
|
1329
1329
|
throw new TypeError(`[Luminix] Invalid attributes for model "${e}"`);
|
|
1330
1330
|
n.make("log").warning(`Invalid attributes for model "${e}".
|
|
@@ -1333,7 +1333,7 @@ function Ve(n, e) {
|
|
|
1333
1333
|
abstract: e
|
|
1334
1334
|
});
|
|
1335
1335
|
}
|
|
1336
|
-
this._attributes = new S(
|
|
1336
|
+
this._attributes = new S(a), this._original = a, this._changedKeys = [];
|
|
1337
1337
|
}
|
|
1338
1338
|
makePrimaryKeyReplacer() {
|
|
1339
1339
|
return {
|
|
@@ -1399,11 +1399,11 @@ function Ve(n, e) {
|
|
|
1399
1399
|
});
|
|
1400
1400
|
}
|
|
1401
1401
|
updateChangedKeys(s) {
|
|
1402
|
-
const u = (
|
|
1403
|
-
!this._changedKeys.includes(s) && !u(this._original[s], this._attributes.get(
|
|
1402
|
+
const u = (l, a) => typeof l == "object" && l !== null ? f.isEqual(l, a) : l == a;
|
|
1403
|
+
!this._changedKeys.includes(s) && !u(this._original[s], this._attributes.get(s)) ? this._changedKeys.push(s) : this._changedKeys.includes(s) && u(this._original[s], this._attributes.get(s)) && this._changedKeys.splice(this._changedKeys.indexOf(s), 1);
|
|
1404
1404
|
}
|
|
1405
1405
|
validateJsonObject(s) {
|
|
1406
|
-
return typeof s != "object" || s === null ? !1 : Object.entries(s).every(([, u]) => ["boolean", "number", "string"].includes(typeof u) || u === null || this.validateJsonObject(u) || Array.isArray(u) && u.every((
|
|
1406
|
+
return typeof s != "object" || s === null ? !1 : Object.entries(s).every(([, u]) => ["boolean", "number", "string"].includes(typeof u) || u === null || this.validateJsonObject(u) || Array.isArray(u) && u.every((l) => this.validateJsonObject(l)));
|
|
1407
1407
|
}
|
|
1408
1408
|
get attributes() {
|
|
1409
1409
|
return this._attributes.all();
|
|
@@ -1439,33 +1439,33 @@ function Ve(n, e) {
|
|
|
1439
1439
|
getAttribute(s) {
|
|
1440
1440
|
let u = this._attributes.get(s, null);
|
|
1441
1441
|
s in this.casts && (u = this.cast(u, this.casts[s]));
|
|
1442
|
-
const
|
|
1443
|
-
if (typeof
|
|
1442
|
+
const l = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Get${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1443
|
+
if (typeof l != "function")
|
|
1444
1444
|
throw new T("ModelFacade");
|
|
1445
|
-
return
|
|
1445
|
+
return l.bind(n.make("model"))(u, this);
|
|
1446
1446
|
}
|
|
1447
1447
|
setAttribute(s, u) {
|
|
1448
|
-
const
|
|
1449
|
-
if (typeof
|
|
1448
|
+
const l = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Set${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1449
|
+
if (typeof l != "function")
|
|
1450
1450
|
throw new T("ModelFacade");
|
|
1451
|
-
const
|
|
1451
|
+
const a = l.bind(n.make("model"))(
|
|
1452
1452
|
this.mutate(u, this.casts[s]),
|
|
1453
1453
|
this
|
|
1454
1454
|
);
|
|
1455
|
-
if (!this.validateJsonObject({ [s]:
|
|
1455
|
+
if (!this.validateJsonObject({ [s]: a })) {
|
|
1456
1456
|
if (n.isProduction())
|
|
1457
1457
|
throw new TypeError(`[Luminix] Attribute "${s}" in model "${e}" must be a boolean, number, string or null`);
|
|
1458
1458
|
n.make("log").warning(`Invalid type for attribute "${s}" in model "${e}" after mutation.
|
|
1459
1459
|
This will throw an error in production.`, {
|
|
1460
1460
|
key: s,
|
|
1461
1461
|
value: u,
|
|
1462
|
-
mutated:
|
|
1462
|
+
mutated: a,
|
|
1463
1463
|
cast: this.casts[s],
|
|
1464
1464
|
item: this.toJson()
|
|
1465
1465
|
});
|
|
1466
1466
|
return;
|
|
1467
1467
|
}
|
|
1468
|
-
this._attributes.set(s,
|
|
1468
|
+
this._attributes.set(s, a), this.updateChangedKeys(s), this.dispatchChangeEvent({ [s]: a });
|
|
1469
1469
|
}
|
|
1470
1470
|
getKey() {
|
|
1471
1471
|
return this.getAttribute(this.primaryKey);
|
|
@@ -1474,28 +1474,28 @@ function Ve(n, e) {
|
|
|
1474
1474
|
return this.primaryKey;
|
|
1475
1475
|
}
|
|
1476
1476
|
fill(s) {
|
|
1477
|
-
const u = f.pick(s, this.fillable),
|
|
1477
|
+
const u = f.pick(s, this.fillable), l = Object.entries(u).reduce((a, [d, p]) => {
|
|
1478
1478
|
const w = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Set${f.upperFirst(f.camelCase(d))}Attribute`];
|
|
1479
1479
|
if (typeof w != "function")
|
|
1480
1480
|
throw new T("ModelFacade");
|
|
1481
|
-
return
|
|
1482
|
-
this.mutate(
|
|
1481
|
+
return a[d] = w.bind(n.make("model"))(
|
|
1482
|
+
this.mutate(p, this.casts[d]),
|
|
1483
1483
|
this
|
|
1484
|
-
),
|
|
1484
|
+
), a;
|
|
1485
1485
|
}, {});
|
|
1486
|
-
if (!this.validateJsonObject(
|
|
1486
|
+
if (!this.validateJsonObject(l)) {
|
|
1487
1487
|
if (n.isProduction())
|
|
1488
1488
|
throw new TypeError(`[Luminix] Invalid attributes for model "${e}"`);
|
|
1489
1489
|
n.make("log").warning(`Invalid attributes for model "${e}" after mutation.
|
|
1490
1490
|
This will throw an error in production.`, {
|
|
1491
1491
|
attributes: s,
|
|
1492
|
-
mutatedAttributes:
|
|
1492
|
+
mutatedAttributes: l,
|
|
1493
1493
|
item: this.toJson(),
|
|
1494
1494
|
casts: this.casts
|
|
1495
1495
|
});
|
|
1496
1496
|
return;
|
|
1497
1497
|
}
|
|
1498
|
-
this._attributes.merge(".",
|
|
1498
|
+
this._attributes.merge(".", l), Object.keys(l).forEach((a) => this.updateChangedKeys(a)), this.dispatchChangeEvent(l);
|
|
1499
1499
|
}
|
|
1500
1500
|
dump() {
|
|
1501
1501
|
n.make("log").info({
|
|
@@ -1504,7 +1504,7 @@ function Ve(n, e) {
|
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
1506
|
toJson() {
|
|
1507
|
-
const s = Object.entries(this.relations).reduce((
|
|
1507
|
+
const s = Object.entries(this.relations).reduce((l, [a, d]) => (d.isLoaded() && (d.isSingle() ? l[f.snakeCase(a)] = d.getLoadedItems().toJson() : d.isMultiple() && (l[f.snakeCase(a)] = d.getLoadedItems().map((p) => p.toJson()).all())), l), {}), u = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Json`];
|
|
1508
1508
|
if (typeof u != "function")
|
|
1509
1509
|
throw new T("ModelFacade");
|
|
1510
1510
|
return u.bind(n.make("model"))({
|
|
@@ -1537,32 +1537,32 @@ function Ve(n, e) {
|
|
|
1537
1537
|
try {
|
|
1538
1538
|
const {
|
|
1539
1539
|
additionalPayload: u = {},
|
|
1540
|
-
sendsOnlyModifiedFields:
|
|
1541
|
-
} = s,
|
|
1540
|
+
sendsOnlyModifiedFields: l = !0
|
|
1541
|
+
} = s, a = this.exists, d = a ? [
|
|
1542
1542
|
`luminix.${e}.update`,
|
|
1543
1543
|
this.makePrimaryKeyReplacer()
|
|
1544
|
-
] : `luminix.${e}.store`,
|
|
1544
|
+
] : `luminix.${e}.store`, p = await n.make("route").call(
|
|
1545
1545
|
d,
|
|
1546
1546
|
{
|
|
1547
1547
|
data: {
|
|
1548
1548
|
...f.pick(
|
|
1549
|
-
|
|
1549
|
+
l && a ? this.diff() : this.attributes,
|
|
1550
1550
|
this.fillable
|
|
1551
1551
|
),
|
|
1552
1552
|
...u
|
|
1553
1553
|
},
|
|
1554
|
-
errorBag:
|
|
1554
|
+
errorBag: a ? `${e}[${this.getKey()}].update` : `${e}.store`
|
|
1555
1555
|
}
|
|
1556
1556
|
);
|
|
1557
|
-
if ([200, 201].includes(
|
|
1558
|
-
return this.makeAttributes(
|
|
1559
|
-
throw
|
|
1557
|
+
if ([200, 201].includes(p.status))
|
|
1558
|
+
return this.makeAttributes(p.data), this.exists = !0, this.dispatchSaveEvent(), a ? this.dispatchUpdateEvent(p.data) : this.dispatchCreateEvent(p.data), p;
|
|
1559
|
+
throw p;
|
|
1560
1560
|
} catch (u) {
|
|
1561
1561
|
throw n.make("log").error(u), this.dispatchErrorEvent(u, "save"), u;
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
1564
|
async push() {
|
|
1565
|
-
throw new
|
|
1565
|
+
throw new b();
|
|
1566
1566
|
}
|
|
1567
1567
|
async delete() {
|
|
1568
1568
|
try {
|
|
@@ -1681,12 +1681,12 @@ function Ve(n, e) {
|
|
|
1681
1681
|
return this.query().first();
|
|
1682
1682
|
}
|
|
1683
1683
|
static async create(s) {
|
|
1684
|
-
const u = n.make("model").make(e),
|
|
1685
|
-
return
|
|
1684
|
+
const u = n.make("model").make(e), l = new u();
|
|
1685
|
+
return l.fill(s), await l.save(), l;
|
|
1686
1686
|
}
|
|
1687
1687
|
static async update(s, u) {
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1688
|
+
const l = n.make("model").make(e), a = new l({ id: s });
|
|
1689
|
+
return a.fill(u), a.exists = !0, await a.save(), a;
|
|
1690
1690
|
}
|
|
1691
1691
|
static delete(s) {
|
|
1692
1692
|
if (Array.isArray(s))
|
|
@@ -1723,50 +1723,50 @@ function Ve(n, e) {
|
|
|
1723
1723
|
}
|
|
1724
1724
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1725
1725
|
on(s, u) {
|
|
1726
|
-
throw new
|
|
1726
|
+
throw new b();
|
|
1727
1727
|
}
|
|
1728
1728
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1729
1729
|
once(s, u) {
|
|
1730
|
-
throw new
|
|
1730
|
+
throw new b();
|
|
1731
1731
|
}
|
|
1732
1732
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1733
1733
|
emit(s, u) {
|
|
1734
|
-
throw new
|
|
1734
|
+
throw new b();
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
|
-
return
|
|
1737
|
+
return m(t, "name", f.upperFirst(f.camelCase(e))), A(t);
|
|
1738
1738
|
}
|
|
1739
1739
|
function Xe(n, e, t) {
|
|
1740
1740
|
var r, i;
|
|
1741
1741
|
return class extends (i = t, r = Symbol.toStringTag, i) {
|
|
1742
1742
|
constructor(u = {}) {
|
|
1743
1743
|
super(u);
|
|
1744
|
-
|
|
1744
|
+
m(this, r, f.upperFirst(f.camelCase(e)));
|
|
1745
1745
|
return new Proxy(this, {
|
|
1746
|
-
get: (
|
|
1747
|
-
if (
|
|
1746
|
+
get: (l, a) => {
|
|
1747
|
+
if (a === "__isModel")
|
|
1748
1748
|
return !0;
|
|
1749
|
-
if (
|
|
1750
|
-
return Reflect.get(
|
|
1751
|
-
if (
|
|
1749
|
+
if (a in l)
|
|
1750
|
+
return Reflect.get(l, a);
|
|
1751
|
+
if (a !== f.camelCase(a))
|
|
1752
1752
|
return;
|
|
1753
|
-
const d = f.snakeCase(
|
|
1754
|
-
if (Object.keys(
|
|
1755
|
-
return
|
|
1756
|
-
if (Object.keys(
|
|
1757
|
-
return
|
|
1758
|
-
if (
|
|
1759
|
-
return () =>
|
|
1760
|
-
if (n.model.hasReducer(`model${
|
|
1761
|
-
const
|
|
1762
|
-
if (typeof
|
|
1753
|
+
const d = f.snakeCase(a);
|
|
1754
|
+
if (Object.keys(l.attributes).includes(d))
|
|
1755
|
+
return l.getAttribute(d);
|
|
1756
|
+
if (Object.keys(l.relations).includes(d))
|
|
1757
|
+
return l.relations[d].getLoadedItems();
|
|
1758
|
+
if (a.endsWith("Relation") && Object.keys(l.relations).includes(f.snakeCase(a.slice(0, -8))))
|
|
1759
|
+
return () => l.relation(a.slice(0, -8));
|
|
1760
|
+
if (n.model.hasReducer(`model${l.constructor.name}Get${f.upperFirst(a)}Attribute`)) {
|
|
1761
|
+
const p = n.model[`model${l.constructor.name}Get${f.upperFirst(a)}Attribute`];
|
|
1762
|
+
if (typeof p != "function")
|
|
1763
1763
|
throw new T("ModelFacade");
|
|
1764
|
-
return
|
|
1764
|
+
return p.bind(n.model)(void 0, l);
|
|
1765
1765
|
}
|
|
1766
|
-
return Reflect.get(
|
|
1766
|
+
return Reflect.get(l, a);
|
|
1767
1767
|
},
|
|
1768
|
-
set: (
|
|
1769
|
-
f.snakeCase(
|
|
1768
|
+
set: (l, a, d) => a in l && typeof l[a] != "function" ? Reflect.set(l, a, d) : (l.setAttribute(
|
|
1769
|
+
f.snakeCase(a),
|
|
1770
1770
|
d
|
|
1771
1771
|
), !0)
|
|
1772
1772
|
});
|
|
@@ -1777,19 +1777,19 @@ var me, pe;
|
|
|
1777
1777
|
class Ye extends (pe = Error, me = Symbol.toStringTag, pe) {
|
|
1778
1778
|
constructor(t, r) {
|
|
1779
1779
|
super(`[Luminix] Cannot create reducer '${t}' on '${r}' as it is a reserved property`);
|
|
1780
|
-
|
|
1780
|
+
m(this, me, "ReducerOverrideException");
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
1783
|
function Se(n) {
|
|
1784
1784
|
return class extends n {
|
|
1785
1785
|
constructor(...t) {
|
|
1786
1786
|
super(...t);
|
|
1787
|
-
|
|
1787
|
+
m(this, "reducers", {});
|
|
1788
1788
|
return new Proxy(this, {
|
|
1789
1789
|
get(r, i, s) {
|
|
1790
|
-
return typeof i == "symbol" || i in r ? Reflect.get(r, i, s) : (u, ...
|
|
1791
|
-
const { [i]:
|
|
1792
|
-
return Pe(u) ? R(u, (d) =>
|
|
1790
|
+
return typeof i == "symbol" || i in r ? Reflect.get(r, i, s) : (u, ...l) => {
|
|
1791
|
+
const { [i]: a = c() } = r.reducers;
|
|
1792
|
+
return Pe(u) ? R(u, (d) => a.sortBy("priority").reduce((p, w) => w.callback(p, ...l), d)) : a.sortBy("priority").reduce((d, p) => p.callback(d, ...l), u);
|
|
1793
1793
|
};
|
|
1794
1794
|
}
|
|
1795
1795
|
});
|
|
@@ -1821,19 +1821,19 @@ var ge, ye;
|
|
|
1821
1821
|
class W extends (ye = Error, ge = Symbol.toStringTag, ye) {
|
|
1822
1822
|
constructor(t) {
|
|
1823
1823
|
super(`[Luminix] Model "${t}" not found`);
|
|
1824
|
-
|
|
1824
|
+
m(this, ge, "ModelNotFoundException");
|
|
1825
1825
|
}
|
|
1826
1826
|
}
|
|
1827
1827
|
var we, be;
|
|
1828
1828
|
class B extends (be = TypeError, we = Symbol.toStringTag, be) {
|
|
1829
1829
|
constructor(t, r, i) {
|
|
1830
1830
|
super(`[Luminix] "${t}" expects a related model of type "${r}". Received "${i}" instead.`);
|
|
1831
|
-
|
|
1831
|
+
m(this, we, "ModelInvalidRelatedTypeException");
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
class ve extends
|
|
1834
|
+
class ve extends K {
|
|
1835
1835
|
constructor(e, t, r, i = null) {
|
|
1836
|
-
if (!
|
|
1836
|
+
if (!E(i) && i !== null)
|
|
1837
1837
|
throw new M("BelongsTo.constructor()", "Model or null");
|
|
1838
1838
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1839
1839
|
}
|
|
@@ -1851,7 +1851,7 @@ class ve extends j {
|
|
|
1851
1851
|
return this.query().first();
|
|
1852
1852
|
}
|
|
1853
1853
|
async associate(e) {
|
|
1854
|
-
if (!
|
|
1854
|
+
if (!E(e))
|
|
1855
1855
|
throw new M("BelongsTo.associate()");
|
|
1856
1856
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
1857
1857
|
throw new B("BelongsTo.associate()", this.getRelated().getSchemaName(), e.getType());
|
|
@@ -1867,9 +1867,9 @@ class ve extends j {
|
|
|
1867
1867
|
});
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
|
-
class Ne extends
|
|
1870
|
+
class Ne extends K {
|
|
1871
1871
|
constructor(e, t, r, i = null) {
|
|
1872
|
-
if (i !== null && !(i instanceof
|
|
1872
|
+
if (i !== null && !(i instanceof k && i.every(E)))
|
|
1873
1873
|
throw new M("BelongsToMany.constructor()", "Collection<Model> or null");
|
|
1874
1874
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1875
1875
|
}
|
|
@@ -1972,22 +1972,22 @@ class Ne extends j {
|
|
|
1972
1972
|
this.items ? this.items.splice(0, this.items.count(), ...r) : this.items = r;
|
|
1973
1973
|
}
|
|
1974
1974
|
}
|
|
1975
|
-
class
|
|
1975
|
+
class Q extends K {
|
|
1976
1976
|
query() {
|
|
1977
1977
|
const e = super.query(), t = this.guessInverseRelation();
|
|
1978
1978
|
return e.where(t, this.parent.getKey()), e.lock(`where.${t}`), e;
|
|
1979
1979
|
}
|
|
1980
1980
|
async saveQuietly(e) {
|
|
1981
|
-
if (!
|
|
1981
|
+
if (!E(e))
|
|
1982
1982
|
throw new M("HasOneOrMany.saveQuietly()");
|
|
1983
1983
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
1984
1984
|
throw new B("HasOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), e.getType());
|
|
1985
1985
|
e.setAttribute(this.getForeignKey(), this.parent.getKey()), await e.save();
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
|
-
class Ze extends
|
|
1988
|
+
class Ze extends Q {
|
|
1989
1989
|
constructor(e, t, r, i = null) {
|
|
1990
|
-
if (!
|
|
1990
|
+
if (!E(i) && i !== null)
|
|
1991
1991
|
throw new M("HasOne.constructor()", "Model or null");
|
|
1992
1992
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1993
1993
|
}
|
|
@@ -2004,9 +2004,9 @@ class Ze extends L {
|
|
|
2004
2004
|
await this.saveQuietly(e), this.items = e;
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
|
-
class ze extends
|
|
2007
|
+
class ze extends Q {
|
|
2008
2008
|
constructor(e, t, r, i = null) {
|
|
2009
|
-
if (i !== null && !(i instanceof
|
|
2009
|
+
if (i !== null && !(i instanceof k && i.every(E)))
|
|
2010
2010
|
throw new M("HasMany.constructor()", "Collection<Model> or null");
|
|
2011
2011
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2012
2012
|
}
|
|
@@ -2029,7 +2029,7 @@ class ze extends L {
|
|
|
2029
2029
|
return this.query().find(e);
|
|
2030
2030
|
}
|
|
2031
2031
|
async saveManyQuietly(e) {
|
|
2032
|
-
if (!Array.isArray(e) || !e.every(
|
|
2032
|
+
if (!Array.isArray(e) || !e.every(E))
|
|
2033
2033
|
throw new M("HasMany.saveManyQuietly()", "Model[]");
|
|
2034
2034
|
if (!e.every((t) => t.getType() === this.getRelated().getSchemaName()))
|
|
2035
2035
|
throw new B("HasMany.saveManyQuietly()", this.getRelated().getSchemaName(), e.map((t) => t.getType()).join(", "));
|
|
@@ -2044,7 +2044,7 @@ class ze extends L {
|
|
|
2044
2044
|
await this.saveQuietly(e), this.items === null ? this.items = await this.all() : this.items.push(e);
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
2047
|
-
class Re extends
|
|
2047
|
+
class Re extends Q {
|
|
2048
2048
|
query() {
|
|
2049
2049
|
const e = this.getRelated().query();
|
|
2050
2050
|
e.once("success", (r) => {
|
|
@@ -2054,7 +2054,7 @@ class Re extends L {
|
|
|
2054
2054
|
return e.where(t + "_id", this.parent.getKey()), e.where(t + "_type", this.getRelated().getSchemaName()), e.lock(`where.${t}_id`), e.lock(`where.${t}_type`), e;
|
|
2055
2055
|
}
|
|
2056
2056
|
async saveQuietly(e) {
|
|
2057
|
-
if (!
|
|
2057
|
+
if (!E(e))
|
|
2058
2058
|
throw new M("MorphOneOrMany.saveQuietly()");
|
|
2059
2059
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
2060
2060
|
throw new B("MorphOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), e.getType());
|
|
@@ -2064,7 +2064,7 @@ class Re extends L {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
class Oe extends Re {
|
|
2066
2066
|
constructor(e, t, r, i = null) {
|
|
2067
|
-
if (i !== null && !(i instanceof
|
|
2067
|
+
if (i !== null && !(i instanceof k && i.every(E)))
|
|
2068
2068
|
throw new M("MorphMany.constructor()", "Collection<Model> or null");
|
|
2069
2069
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2070
2070
|
}
|
|
@@ -2087,7 +2087,7 @@ class Oe extends Re {
|
|
|
2087
2087
|
return this.query().find(e);
|
|
2088
2088
|
}
|
|
2089
2089
|
async saveManyQuietly(e) {
|
|
2090
|
-
if (!Array.isArray(e) || !e.every(
|
|
2090
|
+
if (!Array.isArray(e) || !e.every(E))
|
|
2091
2091
|
throw new M("MorphMany.saveManyQuietly()");
|
|
2092
2092
|
if (!e.every((t) => t.getType() === this.getRelated().getSchemaName()))
|
|
2093
2093
|
throw new B("MorphMany.saveManyQuietly()", this.getRelated().getSchemaName(), e.map((t) => t.getType()).join(", "));
|
|
@@ -2104,7 +2104,7 @@ class Oe extends Re {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
class et extends Re {
|
|
2106
2106
|
constructor(e, t, r, i = null) {
|
|
2107
|
-
if (super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !
|
|
2107
|
+
if (super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !E(i))
|
|
2108
2108
|
throw new M("MorphOne.constructor()", "Model or null");
|
|
2109
2109
|
}
|
|
2110
2110
|
isSingle() {
|
|
@@ -2135,7 +2135,7 @@ class tt extends ve {
|
|
|
2135
2135
|
// return super.query();
|
|
2136
2136
|
// }
|
|
2137
2137
|
async associate(e) {
|
|
2138
|
-
if (!
|
|
2138
|
+
if (!E(e))
|
|
2139
2139
|
throw new M("MorphTo.associate()");
|
|
2140
2140
|
return e.exists || await e.save(), this.parent.update({
|
|
2141
2141
|
[this.getName() + "_id"]: e.getKey(),
|
|
@@ -2162,8 +2162,8 @@ var Ee;
|
|
|
2162
2162
|
Ee = Symbol.toStringTag;
|
|
2163
2163
|
class st {
|
|
2164
2164
|
constructor(e) {
|
|
2165
|
-
|
|
2166
|
-
|
|
2165
|
+
m(this, "_models", {});
|
|
2166
|
+
m(this, Ee, "ModelFacade");
|
|
2167
2167
|
this._schema = e;
|
|
2168
2168
|
}
|
|
2169
2169
|
boot(e) {
|
|
@@ -2202,39 +2202,39 @@ class st {
|
|
|
2202
2202
|
}
|
|
2203
2203
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2204
2204
|
on(e, t) {
|
|
2205
|
-
throw new
|
|
2205
|
+
throw new b();
|
|
2206
2206
|
}
|
|
2207
2207
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2208
2208
|
once(e, t) {
|
|
2209
|
-
throw new
|
|
2209
|
+
throw new b();
|
|
2210
2210
|
}
|
|
2211
2211
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2212
2212
|
emit(e, t) {
|
|
2213
|
-
throw new
|
|
2213
|
+
throw new b();
|
|
2214
2214
|
}
|
|
2215
2215
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2216
2216
|
reducer(e, t, r) {
|
|
2217
|
-
throw new
|
|
2217
|
+
throw new b();
|
|
2218
2218
|
}
|
|
2219
2219
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2220
2220
|
removeReducer(e) {
|
|
2221
|
-
throw new
|
|
2221
|
+
throw new b();
|
|
2222
2222
|
}
|
|
2223
2223
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2224
2224
|
getReducer(e) {
|
|
2225
|
-
throw new
|
|
2225
|
+
throw new b();
|
|
2226
2226
|
}
|
|
2227
2227
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2228
2228
|
hasReducer(e) {
|
|
2229
|
-
throw new
|
|
2229
|
+
throw new b();
|
|
2230
2230
|
}
|
|
2231
2231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2232
2232
|
clearReducer(e) {
|
|
2233
|
-
throw new
|
|
2233
|
+
throw new b();
|
|
2234
2234
|
}
|
|
2235
2235
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2236
2236
|
flushReducers() {
|
|
2237
|
-
throw new
|
|
2237
|
+
throw new b();
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
const it = A(Se(st));
|
|
@@ -2242,7 +2242,7 @@ var xe, Me;
|
|
|
2242
2242
|
class nt extends (Me = Error, xe = Symbol.toStringTag, Me) {
|
|
2243
2243
|
constructor() {
|
|
2244
2244
|
super("[Luminix] Embed element not found. Make sure to include the `@luminixEmbed()` directive in your Blade template.");
|
|
2245
|
-
|
|
2245
|
+
m(this, xe, "NoEmbedException");
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
2248
|
const Be = (n, e = "data") => {
|
|
@@ -2253,7 +2253,7 @@ const Be = (n, e = "data") => {
|
|
|
2253
2253
|
}, G = A(S), ot = (n) => ke(n) && n.response !== void 0 && n.response.data !== null && "message" in n.response.data && typeof n.response.data.message == "string" && "errors" in n.response.data && typeof n.response.data.errors == "object" && n.response.data.errors !== null && Object.values(n.response.data.errors).every((e) => Array.isArray(e) && e.every((t) => typeof t == "string")) && n.response.status === 422;
|
|
2254
2254
|
let ht = class {
|
|
2255
2255
|
constructor() {
|
|
2256
|
-
|
|
2256
|
+
m(this, "bags");
|
|
2257
2257
|
const e = {};
|
|
2258
2258
|
document.querySelectorAll('#luminix-embed [id^="luminix-error"]').forEach((r) => {
|
|
2259
2259
|
const s = r.id.replace("luminix-error::", "");
|
|
@@ -2285,7 +2285,7 @@ var _e, Te;
|
|
|
2285
2285
|
class ut extends (Te = Error, _e = Symbol.toStringTag, Te) {
|
|
2286
2286
|
constructor(t) {
|
|
2287
2287
|
super(`[Luminix] Route "${t}" not found`);
|
|
2288
|
-
|
|
2288
|
+
m(this, _e, "RouteNotFoundException");
|
|
2289
2289
|
}
|
|
2290
2290
|
}
|
|
2291
2291
|
class at {
|
|
@@ -2317,12 +2317,12 @@ class at {
|
|
|
2317
2317
|
throw new T("RouteFacade");
|
|
2318
2318
|
return this.appUrl + this.replaceRouteParams(`/${i}`);
|
|
2319
2319
|
}
|
|
2320
|
-
const u = i.match(s),
|
|
2320
|
+
const u = i.match(s), l = u ? u.map((x) => x.slice(1, -1)) : [], a = Object.keys(r), d = l.filter((x) => !a.includes(x)), p = a.filter((x) => !l.includes(x));
|
|
2321
2321
|
if (d.length > 0)
|
|
2322
2322
|
throw new TypeError(`Missing values for parameter(s): ${d.join(", ")}`);
|
|
2323
|
-
if (
|
|
2324
|
-
throw new TypeError(`Unexpected parameters: ${
|
|
2325
|
-
const w =
|
|
2323
|
+
if (p.length > 0)
|
|
2324
|
+
throw new TypeError(`Unexpected parameters: ${p.join(", ")}`);
|
|
2325
|
+
const w = l.reduce((x, g) => x.replace(`{${g}}`, `${r[g]}`), i);
|
|
2326
2326
|
return this.appUrl + `/${w}`;
|
|
2327
2327
|
}
|
|
2328
2328
|
methods(e) {
|
|
@@ -2335,15 +2335,15 @@ class at {
|
|
|
2335
2335
|
async call(e, t = {}) {
|
|
2336
2336
|
if (typeof this.axiosOptions != "function" || typeof this.axiosError != "function")
|
|
2337
2337
|
throw new T("RouteFacade");
|
|
2338
|
-
const [r, i] = this.extractGenerator(e), [, ...s] = this.get(r), u = this.url(i ? [r, i] : r),
|
|
2338
|
+
const [r, i] = this.extractGenerator(e), [, ...s] = this.get(r), u = this.url(i ? [r, i] : r), l = this.axiosOptions(t, r), { method: a = s[0], errorBag: d = "route.call", ...p } = l, { data: w, ...x } = p;
|
|
2339
2339
|
this.error.clear(d);
|
|
2340
2340
|
try {
|
|
2341
|
-
return ["get", "delete"].includes(
|
|
2341
|
+
return ["get", "delete"].includes(a) ? await I[a](u, p) : await I[a](u, w, x);
|
|
2342
2342
|
} catch (g) {
|
|
2343
2343
|
if (ot(g)) {
|
|
2344
2344
|
const { errors: qe } = g.response.data;
|
|
2345
|
-
this.error.set(Object.entries(qe).reduce((
|
|
2346
|
-
} else
|
|
2345
|
+
this.error.set(Object.entries(qe).reduce((L, [Ie, Ke]) => (L[Ie] = Ke.join(" "), L), {}));
|
|
2346
|
+
} else I.isAxiosError(g) && this.error.set(
|
|
2347
2347
|
this.axiosError({ axios: g.message }, {
|
|
2348
2348
|
error: g,
|
|
2349
2349
|
name: r,
|
|
@@ -2362,9 +2362,9 @@ class at {
|
|
|
2362
2362
|
const lt = Se(at);
|
|
2363
2363
|
class ct {
|
|
2364
2364
|
constructor() {
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2365
|
+
m(this, "facades", {});
|
|
2366
|
+
m(this, "booted", !1);
|
|
2367
|
+
m(this, "_plugins", []);
|
|
2368
2368
|
}
|
|
2369
2369
|
make(e = void 0) {
|
|
2370
2370
|
if (!e)
|
|
@@ -2382,32 +2382,32 @@ class ct {
|
|
|
2382
2382
|
return this._plugins;
|
|
2383
2383
|
}
|
|
2384
2384
|
async boot(e = {}) {
|
|
2385
|
-
var
|
|
2385
|
+
var l, a, d, p, w, x;
|
|
2386
2386
|
if (this.booted)
|
|
2387
2387
|
throw new window.Error("[Luminix] App already booted");
|
|
2388
|
-
this.booted = !0, (
|
|
2388
|
+
this.booted = !0, (l = e.app) != null && l.debug && console.log("[Luminix] Booting started..."), this.emit("init", {
|
|
2389
2389
|
register: (g) => {
|
|
2390
2390
|
this._plugins.push(g), typeof g.register == "function" && g.register(this);
|
|
2391
2391
|
}
|
|
2392
2392
|
});
|
|
2393
|
-
const t = (((
|
|
2393
|
+
const t = (((a = e.app) == null ? void 0 : a.url) ?? "") + (((d = e.app) == null ? void 0 : d.bootUrl) ?? "/luminix-api/init");
|
|
2394
2394
|
if (document.getElementById("luminix-data::config")) {
|
|
2395
2395
|
if (document.getElementById("luminix-data::config")) {
|
|
2396
2396
|
const g = Be("config");
|
|
2397
2397
|
g && typeof g == "object" && f.merge(e, g);
|
|
2398
2398
|
}
|
|
2399
2399
|
} else try {
|
|
2400
|
-
const { data: g } = await
|
|
2400
|
+
const { data: g } = await I.get(t);
|
|
2401
2401
|
g && typeof g == "object" && f.merge(e, g);
|
|
2402
2402
|
} catch (g) {
|
|
2403
|
-
(
|
|
2403
|
+
(p = e.app) != null && p.debug && console.error(g);
|
|
2404
2404
|
}
|
|
2405
2405
|
this.bind("log", new Ce(!!((w = e.app) != null && w.debug)));
|
|
2406
2406
|
const { log: r } = this.facades, {
|
|
2407
2407
|
manifest: { routes: i = {}, models: s = {} } = {},
|
|
2408
2408
|
...u
|
|
2409
2409
|
} = e;
|
|
2410
|
-
this.bind("config", new S(u)), this.facades.config.has("auth.user") || this.facades.config.set("auth.user", null), this.facades.config.lock("auth.user"), this.bind("error", new ht()), this.bind("route", new lt(i, this.facades.error, ((
|
|
2410
|
+
this.bind("config", new S(u)), this.facades.config.has("auth.user") || this.facades.config.set("auth.user", null), this.facades.config.lock("auth.user"), this.bind("error", new ht()), this.bind("route", new lt(i, this.facades.error, ((x = e.app) == null ? void 0 : x.url) ?? "")), this.bind("model", new it(s)), this.bind("auth", new Le(this)), this.emit("booting");
|
|
2411
2411
|
for (const g of Object.values(this.facades))
|
|
2412
2412
|
typeof g == "object" && g !== null && "boot" in g && typeof g.boot == "function" && g.boot(this);
|
|
2413
2413
|
for (const g of this._plugins)
|
|
@@ -2497,8 +2497,8 @@ function $t(n, e = !1) {
|
|
|
2497
2497
|
}
|
|
2498
2498
|
class At {
|
|
2499
2499
|
constructor() {
|
|
2500
|
-
|
|
2501
|
-
|
|
2500
|
+
m(this, "name");
|
|
2501
|
+
m(this, "version");
|
|
2502
2502
|
}
|
|
2503
2503
|
register(e) {
|
|
2504
2504
|
}
|
|
@@ -2516,7 +2516,7 @@ export {
|
|
|
2516
2516
|
xt as config,
|
|
2517
2517
|
Mt as error,
|
|
2518
2518
|
$ as isCollection,
|
|
2519
|
-
|
|
2519
|
+
E as isModel,
|
|
2520
2520
|
ot as isValidationError,
|
|
2521
2521
|
_t as log,
|
|
2522
2522
|
Tt as model,
|