@luminix/core 0.1.0-beta.0 → 0.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/README.md +0 -28
- package/dist/core.js +385 -380
- package/package.json +2 -2
- package/types/extensions.d.ts +10 -0
- package/types/facades/App.d.ts +0 -4
- package/types/facades/Route.d.ts +3 -2
- package/types/index.d.ts +5 -3
- package/types/providers/LuminixServiceProvider.d.ts +1 -2
- package/types/services/RouteService.d.ts +1 -1
- package/types/support/model.d.ts +1 -0
- package/types/types/App.d.ts +4 -4
- package/types/types/Builder.d.ts +2 -2
- package/types/types/Relation.d.ts +1 -2
- package/types/types/Route.d.ts +6 -5
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -39
- package/index.html +0 -13
- package/jest.config.js +0 -15
- package/tsconfig.json +0 -25
- package/vite.config.js +0 -20
package/dist/core.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { reader as
|
|
5
|
-
class
|
|
1
|
+
var ce = Object.defineProperty;
|
|
2
|
+
var de = (n, t, e) => t in n ? ce(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var p = (n, t, e) => de(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { reader as pe, PropertyBag as R, EventSource as q, Collection as x, Query as T, Obj as m, Str as y, Reducible as ne, isValidationError as ge, Macroable as oe, Client as ye, ServiceProvider as me, MakeFacade as E, Application as fe, Response as we } from "@luminix/support";
|
|
5
|
+
class ve {
|
|
6
6
|
constructor(t, e, i) {
|
|
7
|
-
|
|
7
|
+
p(this, "_user");
|
|
8
8
|
this.config = t, this.model = e, this.route = i;
|
|
9
9
|
}
|
|
10
10
|
attempt(t, e = !1, i) {
|
|
@@ -12,15 +12,15 @@ class me {
|
|
|
12
12
|
s.method = "post", s.action = this.route.url("login"), s.style.display = "none";
|
|
13
13
|
const c = this.config.get("auth.csrf");
|
|
14
14
|
if (typeof c == "string") {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const u = document.createElement("input");
|
|
16
|
+
u.type = "hidden", u.name = "_token", u.value = c, s.appendChild(u);
|
|
17
17
|
}
|
|
18
18
|
const g = document.createElement("input");
|
|
19
19
|
g.type = "email", g.name = "email", g.value = t.email, s.appendChild(g);
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
|
|
20
|
+
const l = document.createElement("input");
|
|
21
|
+
if (l.type = "password", l.name = "password", l.value = t.password, s.appendChild(l), e) {
|
|
22
|
+
const u = document.createElement("input");
|
|
23
|
+
u.type = "checkbox", u.name = "remember", u.value = "1", u.checked = !0, s.appendChild(u);
|
|
24
24
|
}
|
|
25
25
|
i && s.addEventListener("submit", i), document.body.appendChild(s), s.submit();
|
|
26
26
|
}
|
|
@@ -51,19 +51,19 @@ class me {
|
|
|
51
51
|
return ((t = this.user()) == null ? void 0 : t.getKey()) || null;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class be {
|
|
55
55
|
constructor() {
|
|
56
|
-
|
|
56
|
+
p(this, "bags");
|
|
57
57
|
const t = {};
|
|
58
58
|
document.querySelectorAll('#luminix-embed [id^="luminix-error"]').forEach((i) => {
|
|
59
59
|
const c = i.id.replace("luminix-error::", "");
|
|
60
|
-
t[c] =
|
|
60
|
+
t[c] = pe(c, "error");
|
|
61
61
|
}), this.bags = {
|
|
62
|
-
default: new
|
|
62
|
+
default: new R(t)
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
bag(t = "default") {
|
|
66
|
-
return this.bags[t] || (this.bags[t] = new
|
|
66
|
+
return this.bags[t] || (this.bags[t] = new R({})), this.bags[t];
|
|
67
67
|
}
|
|
68
68
|
add(t, e, i = "default") {
|
|
69
69
|
this.bag(i).set(t, e);
|
|
@@ -81,7 +81,7 @@ class fe {
|
|
|
81
81
|
this.bag(t).set(".", {});
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class xe {
|
|
85
85
|
constructor(t) {
|
|
86
86
|
this._debug = t;
|
|
87
87
|
}
|
|
@@ -110,18 +110,18 @@ class we {
|
|
|
110
110
|
this._debug && console.debug(...t);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
var
|
|
114
|
-
class
|
|
113
|
+
var O, B;
|
|
114
|
+
class Me extends (B = Error, O = Symbol.toStringTag, B) {
|
|
115
115
|
constructor(e) {
|
|
116
116
|
super(`[Luminix] Model "${e}" does not have a primary key`);
|
|
117
|
-
|
|
117
|
+
p(this, O, "ModelWithoutPrimaryKeyException");
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class Ee extends q {
|
|
121
121
|
constructor(e, i, s = {}) {
|
|
122
122
|
super();
|
|
123
|
-
|
|
124
|
-
this.services = e, this.abstract = i, this.query = s, this.bag = new
|
|
123
|
+
p(this, "bag");
|
|
124
|
+
this.services = e, this.abstract = i, this.query = s, this.bag = new R(s), this.bag.on("change", () => {
|
|
125
125
|
this.emit("change", {
|
|
126
126
|
data: this.bag,
|
|
127
127
|
source: this
|
|
@@ -203,31 +203,31 @@ class be extends q {
|
|
|
203
203
|
});
|
|
204
204
|
const s = await this.services.route.call(
|
|
205
205
|
`luminix.${this.abstract}.index`,
|
|
206
|
-
(
|
|
207
|
-
), c = this.services.model.make(this.abstract), g = new
|
|
208
|
-
const
|
|
209
|
-
return
|
|
206
|
+
(l) => l.withQueryParameters(this.bag.all())
|
|
207
|
+
), c = this.services.model.make(this.abstract), g = new x(s.json("data").map((l) => {
|
|
208
|
+
const u = new c(l);
|
|
209
|
+
return u.exists = !0, this.services.model.emit("fetch", {
|
|
210
210
|
class: this.abstract,
|
|
211
|
-
model:
|
|
211
|
+
model: u,
|
|
212
212
|
source: this.services.model
|
|
213
|
-
}),
|
|
213
|
+
}), u;
|
|
214
214
|
}));
|
|
215
215
|
if (i) {
|
|
216
|
-
const [
|
|
216
|
+
const [l] = i.split("?");
|
|
217
217
|
return {
|
|
218
218
|
...s.json(),
|
|
219
219
|
data: g,
|
|
220
220
|
links: {
|
|
221
|
-
first: `${
|
|
222
|
-
last: `${
|
|
223
|
-
next: s.json("links").next && `${
|
|
224
|
-
prev: s.json("links").prev && `${
|
|
221
|
+
first: `${l}?${T.merge(i, s.json("links").first).toString()}`,
|
|
222
|
+
last: `${l}?${T.merge(i, s.json("links").last).toString()}`,
|
|
223
|
+
next: s.json("links").next && `${l}?${T.merge(i, s.json("links").next ?? "").toString()}`,
|
|
224
|
+
prev: s.json("links").prev && `${l}?${T.merge(i, s.json("links").prev ?? "").toString()}`
|
|
225
225
|
},
|
|
226
226
|
meta: {
|
|
227
227
|
...s.json("meta"),
|
|
228
|
-
links: s.json("meta").links.map((
|
|
229
|
-
...
|
|
230
|
-
url:
|
|
228
|
+
links: s.json("meta").links.map((u) => ({
|
|
229
|
+
...u,
|
|
230
|
+
url: u.url && `${l}?${T.merge(i, u.url).toString()}`
|
|
231
231
|
}))
|
|
232
232
|
}
|
|
233
233
|
};
|
|
@@ -262,7 +262,7 @@ class be extends q {
|
|
|
262
262
|
async find(e) {
|
|
263
263
|
const i = this.services.model.schema(this.abstract).primaryKey;
|
|
264
264
|
if (!i)
|
|
265
|
-
throw new
|
|
265
|
+
throw new Me(this.abstract);
|
|
266
266
|
const s = await this.where(i, e).limit(1).exec(1);
|
|
267
267
|
return this.emit("success", {
|
|
268
268
|
response: s,
|
|
@@ -274,49 +274,49 @@ class be extends q {
|
|
|
274
274
|
const e = this.services.config.get("luminix.backend.api.max_per_page", 150), i = await this.limit(e).exec(1), s = i.meta.last_page;
|
|
275
275
|
if (s === 1)
|
|
276
276
|
return i.data;
|
|
277
|
-
const c = Array.from({ length: s - 1 }, (
|
|
278
|
-
c.map((
|
|
279
|
-
),
|
|
280
|
-
g.reduce((
|
|
277
|
+
const c = Array.from({ length: s - 1 }, (u, r) => r + 2), g = await Promise.all(
|
|
278
|
+
c.map((u) => this.limit(e).exec(u))
|
|
279
|
+
), l = new x(
|
|
280
|
+
g.reduce((u, r) => (u.push(...r.data), u), i.data).all()
|
|
281
281
|
);
|
|
282
282
|
return this.emit("success", {
|
|
283
283
|
response: {
|
|
284
284
|
...i,
|
|
285
|
-
data:
|
|
285
|
+
data: l
|
|
286
286
|
},
|
|
287
|
-
items:
|
|
287
|
+
items: l,
|
|
288
288
|
source: this
|
|
289
|
-
}),
|
|
289
|
+
}), l;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
var
|
|
293
|
-
class w extends (
|
|
292
|
+
var C, I;
|
|
293
|
+
class w extends (I = TypeError, C = Symbol.toStringTag, I) {
|
|
294
294
|
constructor(e, i = "Model") {
|
|
295
295
|
super(`[Luminix] "${e}" expects ${i}`);
|
|
296
|
-
|
|
296
|
+
p(this, C, "NotModelException");
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
var
|
|
300
|
-
class
|
|
299
|
+
var P, Q;
|
|
300
|
+
class $e extends (Q = Error, P = Symbol.toStringTag, Q) {
|
|
301
301
|
constructor(e, i, s, c) {
|
|
302
302
|
super(`[Luminix] Could not determine inverse relation for "${i}" in model "${e}". Please specify a relation in model "${s}" of type ${c} that points back to "${e}".`);
|
|
303
|
-
|
|
303
|
+
p(this, P, "NoInverseRelationException");
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
var
|
|
307
|
-
class
|
|
306
|
+
var D, H;
|
|
307
|
+
class _e extends (H = Error, D = Symbol.toStringTag, H) {
|
|
308
308
|
constructor(e) {
|
|
309
309
|
super(`[Luminix] Relation "${e}" is not supported`);
|
|
310
|
-
|
|
310
|
+
p(this, D, "UnsupportedRelationException");
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
return typeof
|
|
313
|
+
function f(n) {
|
|
314
|
+
return typeof n == "object" && n !== null && n.__isModel === !0;
|
|
315
315
|
}
|
|
316
316
|
class N {
|
|
317
317
|
constructor(t, e, i, s = null) {
|
|
318
|
-
|
|
319
|
-
if (this.services = t, this.meta = e, this.parent = i, this.items = s, s !== null && !m(s) && !(s instanceof
|
|
318
|
+
p(this, "unsubscribeQuery", null);
|
|
319
|
+
if (this.services = t, this.meta = e, this.parent = i, this.items = s, s !== null && !m.isModel(s) && !(s instanceof x && s.every(f)))
|
|
320
320
|
throw new w("Relation.constructor()", "Model, Collection<Model> or null");
|
|
321
321
|
}
|
|
322
322
|
make(t) {
|
|
@@ -333,7 +333,7 @@ class N {
|
|
|
333
333
|
if (this.isMultiple()) {
|
|
334
334
|
if (!Array.isArray(t))
|
|
335
335
|
throw new TypeError("Relation.make() expects an array");
|
|
336
|
-
this.set(new
|
|
336
|
+
this.set(new x(t.map((i) => new e(i))));
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
guessInverseRelation() {
|
|
@@ -348,18 +348,18 @@ class N {
|
|
|
348
348
|
MorphToMany: ["MorphToMany"]
|
|
349
349
|
}, this.parent, e, this.getRelated());
|
|
350
350
|
if (!(e in i))
|
|
351
|
-
throw new
|
|
351
|
+
throw new _e(e);
|
|
352
352
|
for (const s in t) {
|
|
353
353
|
const c = t[s];
|
|
354
354
|
if ((c.model === this.parent.getType() || ["MorphOne", "MorphMany"].includes(e)) && i[e].includes(c.type))
|
|
355
355
|
return s;
|
|
356
356
|
}
|
|
357
|
-
throw new
|
|
357
|
+
throw new $e(this.parent.getType(), e, this.getRelated().getSchemaName(), i[e].join(" or "));
|
|
358
358
|
}
|
|
359
359
|
set(t) {
|
|
360
|
-
if (t !== null && !
|
|
360
|
+
if (t !== null && !f(t) && !(t instanceof x && t.every(f)))
|
|
361
361
|
throw new w("Relation.set()", "Model, Collection<Model> or null");
|
|
362
|
-
!this.items ||
|
|
362
|
+
!this.items || f(this.items) ? this.items = t : t instanceof x && this.items.splice(0, this.items.count(), ...t);
|
|
363
363
|
}
|
|
364
364
|
getForeignKey() {
|
|
365
365
|
return this.meta.foreignKey;
|
|
@@ -389,10 +389,10 @@ class N {
|
|
|
389
389
|
return this.items;
|
|
390
390
|
}
|
|
391
391
|
isSingle() {
|
|
392
|
-
return
|
|
392
|
+
return f(this.items);
|
|
393
393
|
}
|
|
394
394
|
isMultiple() {
|
|
395
|
-
return this.items instanceof
|
|
395
|
+
return this.items instanceof x;
|
|
396
396
|
}
|
|
397
397
|
getParent() {
|
|
398
398
|
return this.parent;
|
|
@@ -437,70 +437,70 @@ class N {
|
|
|
437
437
|
// return this.query().find(id);
|
|
438
438
|
// }
|
|
439
439
|
}
|
|
440
|
-
var
|
|
441
|
-
class
|
|
440
|
+
var L, J;
|
|
441
|
+
class $ extends (J = Error, L = Symbol.toStringTag, J) {
|
|
442
442
|
constructor(e) {
|
|
443
443
|
super(`[Luminix] Expected ${e} to be reducible.`);
|
|
444
|
-
|
|
444
|
+
p(this, L, "NotReducibleException");
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
var
|
|
448
|
-
class
|
|
447
|
+
var U, F;
|
|
448
|
+
class Se extends (F = Error, U = Symbol.toStringTag, F) {
|
|
449
449
|
constructor() {
|
|
450
450
|
super("[Luminix] Method not implemented.");
|
|
451
|
-
|
|
451
|
+
p(this, U, "MethodNotImplementedException");
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
var
|
|
455
|
-
class
|
|
454
|
+
var G, V;
|
|
455
|
+
class ae extends (V = Error, G = Symbol.toStringTag, V) {
|
|
456
456
|
constructor(e, i) {
|
|
457
457
|
super(`[Luminix] Model "${e}" must be persisted before calling "${i}"`);
|
|
458
|
-
|
|
458
|
+
p(this, G, "ModelNotPersistedException");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
var c, g,
|
|
463
|
-
return
|
|
461
|
+
function Te(n, t, e, i, s) {
|
|
462
|
+
var c, g, l;
|
|
463
|
+
return l = class extends (g = q, c = Symbol.toStringTag, g) {
|
|
464
464
|
constructor(r = {}) {
|
|
465
465
|
super();
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
466
|
+
p(this, "_attributes", new R({}));
|
|
467
|
+
p(this, "_original", {});
|
|
468
|
+
p(this, "_relations", {});
|
|
469
|
+
p(this, "_changedKeys", []);
|
|
470
|
+
p(this, "exists", !1);
|
|
471
|
+
p(this, "wasRecentlyCreated", !1);
|
|
472
|
+
p(this, c, y.studly(s));
|
|
473
473
|
this.makeRelations(), this.makeAttributes(r);
|
|
474
474
|
}
|
|
475
|
-
cast(r,
|
|
476
|
-
return r == null || !
|
|
475
|
+
cast(r, o) {
|
|
476
|
+
return r == null || !o ? r : ["boolean", "bool"].includes(o) ? !!r : ["date", "datetime", "immutable_date", "immutable_datetime"].includes(o) && typeof r == "string" ? new Date(r) : ["float", "double", "integer", "int"].includes(o) || o.startsWith("decimal:") ? Number(r) : r;
|
|
477
477
|
}
|
|
478
|
-
mutate(r,
|
|
479
|
-
return r == null || !
|
|
478
|
+
mutate(r, o) {
|
|
479
|
+
return r == null || !o ? r : ["boolean", "bool"].includes(o) ? !!r : ["date", "datetime", "immutable_date", "immutable_datetime"].includes(o) && r instanceof Date ? r.toISOString() : ["float", "double", "integer", "int"].includes(o) || o.startsWith("decimal:") ? Number(r) : r;
|
|
480
480
|
}
|
|
481
481
|
makeRelations() {
|
|
482
482
|
const { relations: r } = e.schema(s);
|
|
483
483
|
if (this._relations = {}, !r)
|
|
484
484
|
return;
|
|
485
|
-
const
|
|
486
|
-
Object.entries(r).forEach(([
|
|
487
|
-
const { type:
|
|
488
|
-
this._relations[
|
|
485
|
+
const o = e.getRelationConstructors(s);
|
|
486
|
+
Object.entries(r).forEach(([a, h]) => {
|
|
487
|
+
const { type: d } = h, v = d in o ? o[d] : N;
|
|
488
|
+
this._relations[a] = new v(
|
|
489
489
|
{ model: e, route: i },
|
|
490
|
-
{ name:
|
|
490
|
+
{ name: a, ...h },
|
|
491
491
|
this,
|
|
492
492
|
null
|
|
493
493
|
);
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
makeAttributes(r) {
|
|
497
|
-
const { relations:
|
|
498
|
-
if (this.fillable.filter((
|
|
499
|
-
|
|
500
|
-
}),
|
|
501
|
-
this.relation(y.camel(
|
|
502
|
-
}), !this.validateJsonObject(
|
|
503
|
-
if (
|
|
497
|
+
const { relations: o } = e.schema(s), a = Object.keys(o || {}), h = m.omit(r, ...a);
|
|
498
|
+
if (this.fillable.filter((d) => !(d in h)).forEach((d) => {
|
|
499
|
+
h[d] = null;
|
|
500
|
+
}), o && Object.keys(o).forEach((d) => {
|
|
501
|
+
this.relation(y.camel(d)).make(r[d]);
|
|
502
|
+
}), !this.validateJsonObject(h)) {
|
|
503
|
+
if (n.get("app.env", "production") === "production")
|
|
504
504
|
throw new TypeError(`[Luminix] Invalid attributes for model "${s}"`);
|
|
505
505
|
t.warning(`Invalid attributes for model "${s}".
|
|
506
506
|
This will throw an error in production.`, {
|
|
@@ -508,7 +508,7 @@ function $e(o, t, e, i, s) {
|
|
|
508
508
|
abstract: s
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
this._attributes.set(".",
|
|
511
|
+
this._attributes.set(".", h), this._original = h, this._changedKeys.splice(0, this._changedKeys.length);
|
|
512
512
|
}
|
|
513
513
|
makePrimaryKeyReplacer() {
|
|
514
514
|
return {
|
|
@@ -573,25 +573,25 @@ function $e(o, t, e, i, s) {
|
|
|
573
573
|
source: e
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
|
-
dispatchErrorEvent(r,
|
|
576
|
+
dispatchErrorEvent(r, o) {
|
|
577
577
|
this.emit("error", {
|
|
578
578
|
error: r,
|
|
579
|
-
operation:
|
|
579
|
+
operation: o,
|
|
580
580
|
source: this
|
|
581
581
|
}), e.emit("error", {
|
|
582
582
|
class: s,
|
|
583
583
|
model: this,
|
|
584
584
|
source: e,
|
|
585
585
|
error: r,
|
|
586
|
-
operation:
|
|
586
|
+
operation: o
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
updateChangedKeys(r) {
|
|
590
|
-
const
|
|
591
|
-
!this._changedKeys.includes(r) && !
|
|
590
|
+
const o = (a, h) => typeof a == "object" && a !== null ? m.isEqual(a, h) : a == h;
|
|
591
|
+
!this._changedKeys.includes(r) && !o(m.get(this._original, r), this._attributes.get(r)) ? this._changedKeys.push(r) : this._changedKeys.includes(r) && o(m.get(this._original, r), this._attributes.get(r)) && this._changedKeys.splice(this._changedKeys.indexOf(r), 1);
|
|
592
592
|
}
|
|
593
593
|
validateJsonObject(r) {
|
|
594
|
-
return typeof r != "object" || r === null ? !1 : Object.entries(r).every(([,
|
|
594
|
+
return typeof r != "object" || r === null ? !1 : Object.entries(r).every(([, o]) => ["boolean", "number", "string"].includes(typeof o) || o === null || this.validateJsonObject(o) || Array.isArray(o) && o.every((a) => this.validateJsonObject(a)));
|
|
595
595
|
}
|
|
596
596
|
get attributes() {
|
|
597
597
|
return this._attributes.all();
|
|
@@ -625,35 +625,35 @@ function $e(o, t, e, i, s) {
|
|
|
625
625
|
return this._changedKeys.length > 0;
|
|
626
626
|
}
|
|
627
627
|
getAttribute(r) {
|
|
628
|
-
let
|
|
629
|
-
r in this.casts && (
|
|
630
|
-
const
|
|
631
|
-
if (typeof
|
|
632
|
-
throw new
|
|
633
|
-
return
|
|
634
|
-
}
|
|
635
|
-
setAttribute(r,
|
|
636
|
-
const
|
|
637
|
-
if (typeof
|
|
638
|
-
throw new
|
|
639
|
-
const
|
|
640
|
-
this.mutate(
|
|
628
|
+
let o = this._attributes.get(r, null);
|
|
629
|
+
r in this.casts && (o = this.cast(o, this.casts[r]));
|
|
630
|
+
const a = e[`model${y.studly(s)}Get${y.studly(r)}Attribute`];
|
|
631
|
+
if (typeof a != "function")
|
|
632
|
+
throw new $("ModelFacade");
|
|
633
|
+
return a.bind(e)(o, this);
|
|
634
|
+
}
|
|
635
|
+
setAttribute(r, o) {
|
|
636
|
+
const a = e[`model${y.studly(s)}Set${y.studly(r)}Attribute`];
|
|
637
|
+
if (typeof a != "function")
|
|
638
|
+
throw new $("ModelFacade");
|
|
639
|
+
const h = a.bind(e)(
|
|
640
|
+
this.mutate(o, this.casts[r]),
|
|
641
641
|
this
|
|
642
642
|
);
|
|
643
|
-
if (!this.validateJsonObject({ [r]:
|
|
644
|
-
if (
|
|
643
|
+
if (!this.validateJsonObject({ [r]: h })) {
|
|
644
|
+
if (n.get("app.env", "production") === "production")
|
|
645
645
|
throw new TypeError(`[Luminix] Attribute "${r}" in model "${s}" must be a boolean, number, string or null`);
|
|
646
646
|
t.warning(`Invalid type for attribute "${r}" in model "${s}" after mutation.
|
|
647
647
|
This will throw an error in production.`, {
|
|
648
648
|
key: r,
|
|
649
|
-
value:
|
|
650
|
-
mutated:
|
|
649
|
+
value: o,
|
|
650
|
+
mutated: h,
|
|
651
651
|
cast: this.casts[r],
|
|
652
652
|
item: this.toJson()
|
|
653
653
|
});
|
|
654
654
|
return;
|
|
655
655
|
}
|
|
656
|
-
this._attributes.set(r,
|
|
656
|
+
this._attributes.set(r, h), this.updateChangedKeys(r), this.dispatchChangeEvent({ [r]: h });
|
|
657
657
|
}
|
|
658
658
|
getKey() {
|
|
659
659
|
return this.getAttribute(this.primaryKey);
|
|
@@ -662,28 +662,28 @@ function $e(o, t, e, i, s) {
|
|
|
662
662
|
return this.primaryKey;
|
|
663
663
|
}
|
|
664
664
|
fill(r) {
|
|
665
|
-
const
|
|
666
|
-
const
|
|
667
|
-
if (typeof
|
|
668
|
-
throw new
|
|
669
|
-
return
|
|
670
|
-
this.mutate(
|
|
665
|
+
const o = m.pick(r, ...this.fillable), a = Object.entries(o).reduce((h, [d, v]) => {
|
|
666
|
+
const b = e[`model${y.studly(s)}Set${y.studly(d)}Attribute`];
|
|
667
|
+
if (typeof b != "function")
|
|
668
|
+
throw new $("ModelFacade");
|
|
669
|
+
return h[d] = b.bind(e)(
|
|
670
|
+
this.mutate(v, this.casts[d]),
|
|
671
671
|
this
|
|
672
|
-
),
|
|
672
|
+
), h;
|
|
673
673
|
}, {});
|
|
674
|
-
if (!this.validateJsonObject(
|
|
675
|
-
if (
|
|
674
|
+
if (!this.validateJsonObject(a)) {
|
|
675
|
+
if (n.get("app.env", "production") === "production")
|
|
676
676
|
throw new TypeError(`[Luminix] Invalid attributes for model "${s}"`);
|
|
677
677
|
t.warning(`Invalid attributes for model "${s}" after mutation.
|
|
678
678
|
This will throw an error in production.`, {
|
|
679
679
|
attributes: r,
|
|
680
|
-
mutatedAttributes:
|
|
680
|
+
mutatedAttributes: a,
|
|
681
681
|
item: this.toJson(),
|
|
682
682
|
casts: this.casts
|
|
683
683
|
});
|
|
684
684
|
return;
|
|
685
685
|
}
|
|
686
|
-
this._attributes.merge(".",
|
|
686
|
+
this._attributes.merge(".", a), Object.keys(a).forEach((h) => this.updateChangedKeys(h)), this.dispatchChangeEvent(a);
|
|
687
687
|
}
|
|
688
688
|
dump() {
|
|
689
689
|
t.info({
|
|
@@ -692,16 +692,16 @@ function $e(o, t, e, i, s) {
|
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
toJson() {
|
|
695
|
-
const r = Object.entries(this.relations).reduce((
|
|
696
|
-
if (typeof
|
|
697
|
-
throw new
|
|
698
|
-
return
|
|
695
|
+
const r = Object.entries(this.relations).reduce((a, [h, d]) => (d.isLoaded() && (d.isSingle() ? a[y.snake(h)] = d.getLoadedItems().toJson() : d.isMultiple() && (a[y.snake(h)] = d.getLoadedItems().map((v) => v.toJson()).all())), a), {}), o = e[`model${y.studly(s)}Json`];
|
|
696
|
+
if (typeof o != "function")
|
|
697
|
+
throw new $("ModelFacade");
|
|
698
|
+
return o.bind(e)({
|
|
699
699
|
...this.attributes,
|
|
700
700
|
...r
|
|
701
701
|
}, this);
|
|
702
702
|
}
|
|
703
703
|
diff() {
|
|
704
|
-
return this._changedKeys.reduce((r,
|
|
704
|
+
return this._changedKeys.reduce((r, o) => (r[o] = this._attributes.get(o), r), {});
|
|
705
705
|
}
|
|
706
706
|
getType() {
|
|
707
707
|
return s;
|
|
@@ -741,48 +741,51 @@ function $e(o, t, e, i, s) {
|
|
|
741
741
|
const { labeledBy: r } = e.schema(s);
|
|
742
742
|
return this.getAttribute(r);
|
|
743
743
|
}
|
|
744
|
-
async refresh() {
|
|
744
|
+
async refresh(r) {
|
|
745
745
|
if (!this.exists)
|
|
746
|
-
throw new
|
|
747
|
-
const
|
|
748
|
-
this.getRouteForRefresh()
|
|
749
|
-
|
|
746
|
+
throw new ae(s, "refresh");
|
|
747
|
+
const o = await i.call(
|
|
748
|
+
this.getRouteForRefresh(),
|
|
749
|
+
r,
|
|
750
|
+
this.getErrorBag("fetch")
|
|
750
751
|
);
|
|
751
|
-
this.makeAttributes(
|
|
752
|
+
this.makeAttributes(o.json());
|
|
752
753
|
}
|
|
753
|
-
async save(r = {}) {
|
|
754
|
+
async save(r = {}, o) {
|
|
754
755
|
try {
|
|
755
756
|
const {
|
|
756
|
-
additionalPayload:
|
|
757
|
-
sendsOnlyModifiedFields:
|
|
758
|
-
} = r,
|
|
759
|
-
...
|
|
760
|
-
|
|
757
|
+
additionalPayload: a = {},
|
|
758
|
+
sendsOnlyModifiedFields: h = !0
|
|
759
|
+
} = r, d = this.exists, v = {
|
|
760
|
+
...m.pick(
|
|
761
|
+
h && d ? this.diff() : this.attributes,
|
|
761
762
|
...this.fillable
|
|
762
763
|
),
|
|
763
|
-
...
|
|
764
|
+
...a
|
|
764
765
|
};
|
|
765
|
-
if (
|
|
766
|
+
if (m.isEmpty(v))
|
|
766
767
|
return;
|
|
767
|
-
const
|
|
768
|
+
const b = await i.call(
|
|
768
769
|
this.getRouteForSave(),
|
|
769
|
-
(
|
|
770
|
+
(k) => o ? o(k.withData(v)) : k.withData(v),
|
|
771
|
+
this.getErrorBag(d ? "update" : "store")
|
|
770
772
|
);
|
|
771
|
-
if (
|
|
772
|
-
return this.makeAttributes(
|
|
773
|
-
throw
|
|
774
|
-
} catch (
|
|
775
|
-
throw this.dispatchErrorEvent(
|
|
773
|
+
if (b.successful())
|
|
774
|
+
return this.makeAttributes(b.json()), this.exists = !0, this.dispatchSaveEvent(), d ? this.dispatchUpdateEvent(b.json()) : (this.wasRecentlyCreated = !0, this.dispatchCreateEvent(b.json())), b;
|
|
775
|
+
throw b;
|
|
776
|
+
} catch (a) {
|
|
777
|
+
throw this.dispatchErrorEvent(a, "save"), a;
|
|
776
778
|
}
|
|
777
779
|
}
|
|
778
780
|
async push() {
|
|
779
|
-
throw new
|
|
781
|
+
throw new Se();
|
|
780
782
|
}
|
|
781
783
|
async delete() {
|
|
782
784
|
try {
|
|
783
785
|
const r = await i.call(
|
|
784
|
-
this.getRouteForDelete()
|
|
785
|
-
|
|
786
|
+
this.getRouteForDelete(),
|
|
787
|
+
void 0,
|
|
788
|
+
this.getErrorBag("delete")
|
|
786
789
|
);
|
|
787
790
|
if (r.noContent())
|
|
788
791
|
return this.dispatchDeleteEvent(), r;
|
|
@@ -791,30 +794,28 @@ function $e(o, t, e, i, s) {
|
|
|
791
794
|
throw this.dispatchErrorEvent(r, "delete"), r;
|
|
792
795
|
}
|
|
793
796
|
}
|
|
794
|
-
async update(r) {
|
|
797
|
+
async update(r, o) {
|
|
795
798
|
try {
|
|
796
|
-
const
|
|
799
|
+
const a = await i.call(
|
|
797
800
|
this.getRouteForUpdate(),
|
|
798
|
-
(
|
|
801
|
+
(h) => o ? o(h.withData(r)) : h.withData(r),
|
|
802
|
+
this.getErrorBag("update")
|
|
799
803
|
);
|
|
800
|
-
if (
|
|
801
|
-
this.makeAttributes(
|
|
804
|
+
if (a.ok()) {
|
|
805
|
+
this.makeAttributes(a.json()), this.dispatchUpdateEvent(a.json());
|
|
802
806
|
return;
|
|
803
807
|
}
|
|
804
|
-
throw
|
|
805
|
-
} catch (
|
|
806
|
-
throw this.dispatchErrorEvent(
|
|
808
|
+
throw a;
|
|
809
|
+
} catch (a) {
|
|
810
|
+
throw this.dispatchErrorEvent(a, "save"), a;
|
|
807
811
|
}
|
|
808
812
|
}
|
|
809
813
|
async forceDelete() {
|
|
810
814
|
try {
|
|
811
815
|
const r = await i.call(
|
|
812
816
|
this.getRouteForDelete(),
|
|
813
|
-
(
|
|
814
|
-
|
|
815
|
-
// params: { force: true },
|
|
816
|
-
// errorBag: this.getErrorBag('forceDelete'),
|
|
817
|
-
// }
|
|
817
|
+
(o) => o.withQueryParameters({ force: !0 }),
|
|
818
|
+
this.getErrorBag("forceDelete")
|
|
818
819
|
);
|
|
819
820
|
if (r.noContent())
|
|
820
821
|
return this.dispatchDeleteEvent(!0), r;
|
|
@@ -827,7 +828,8 @@ function $e(o, t, e, i, s) {
|
|
|
827
828
|
try {
|
|
828
829
|
const r = await i.call(
|
|
829
830
|
this.getRouteForUpdate(),
|
|
830
|
-
(
|
|
831
|
+
(o) => o.withQueryParameters({ restore: !0 }),
|
|
832
|
+
this.getErrorBag("restore")
|
|
831
833
|
);
|
|
832
834
|
if (r.ok())
|
|
833
835
|
return this.dispatchRestoreEvent(), r;
|
|
@@ -843,8 +845,8 @@ function $e(o, t, e, i, s) {
|
|
|
843
845
|
return e.schema(s);
|
|
844
846
|
}
|
|
845
847
|
static query() {
|
|
846
|
-
return new
|
|
847
|
-
{ config:
|
|
848
|
+
return new Ee(
|
|
849
|
+
{ config: n, route: i, model: e },
|
|
848
850
|
s
|
|
849
851
|
);
|
|
850
852
|
}
|
|
@@ -857,14 +859,14 @@ function $e(o, t, e, i, s) {
|
|
|
857
859
|
static whereNotNull(r) {
|
|
858
860
|
return this.query().whereNotNull(r);
|
|
859
861
|
}
|
|
860
|
-
static whereBetween(r,
|
|
861
|
-
return this.query().whereBetween(r,
|
|
862
|
+
static whereBetween(r, o) {
|
|
863
|
+
return this.query().whereBetween(r, o);
|
|
862
864
|
}
|
|
863
|
-
static whereNotBetween(r,
|
|
864
|
-
return this.query().whereNotBetween(r,
|
|
865
|
+
static whereNotBetween(r, o) {
|
|
866
|
+
return this.query().whereNotBetween(r, o);
|
|
865
867
|
}
|
|
866
|
-
static orderBy(r,
|
|
867
|
-
return this.query().orderBy(r,
|
|
868
|
+
static orderBy(r, o = "asc") {
|
|
869
|
+
return this.query().orderBy(r, o);
|
|
868
870
|
}
|
|
869
871
|
static searchBy(r) {
|
|
870
872
|
return this.query().searchBy(r);
|
|
@@ -875,8 +877,8 @@ function $e(o, t, e, i, s) {
|
|
|
875
877
|
static limit(r) {
|
|
876
878
|
return this.query().limit(r);
|
|
877
879
|
}
|
|
878
|
-
static get(r = 1,
|
|
879
|
-
return this.query().get(r,
|
|
880
|
+
static get(r = 1, o) {
|
|
881
|
+
return this.query().get(r, o);
|
|
880
882
|
}
|
|
881
883
|
static find(r) {
|
|
882
884
|
return this.query().find(r);
|
|
@@ -885,39 +887,42 @@ function $e(o, t, e, i, s) {
|
|
|
885
887
|
return this.query().first();
|
|
886
888
|
}
|
|
887
889
|
static async create(r) {
|
|
888
|
-
const
|
|
889
|
-
return
|
|
890
|
+
const o = e.make(s), a = new o();
|
|
891
|
+
return a.fill(r), await a.save(), a;
|
|
890
892
|
}
|
|
891
|
-
static async update(r,
|
|
892
|
-
const
|
|
893
|
-
return
|
|
893
|
+
static async update(r, o) {
|
|
894
|
+
const a = e.make(s), h = new a({ id: r });
|
|
895
|
+
return h.fill(o), h.exists = !0, await h.save(), h;
|
|
894
896
|
}
|
|
895
897
|
static delete(r) {
|
|
896
898
|
if (Array.isArray(r))
|
|
897
899
|
return i.call(
|
|
898
900
|
`luminix.${s}.destroyMany`,
|
|
899
|
-
(
|
|
901
|
+
(h) => h.withQueryParameters({ ids: r }),
|
|
902
|
+
`${s}.deleteMany`
|
|
900
903
|
);
|
|
901
|
-
const
|
|
902
|
-
return new
|
|
904
|
+
const o = e.make(s);
|
|
905
|
+
return new o({ id: r }).delete();
|
|
903
906
|
}
|
|
904
907
|
static async restore(r) {
|
|
905
908
|
if (Array.isArray(r))
|
|
906
909
|
return i.call(
|
|
907
910
|
`luminix.${s}.restoreMany`,
|
|
908
|
-
(
|
|
911
|
+
(h) => h.withData({ ids: r }),
|
|
912
|
+
`${s}.restoreMany`
|
|
909
913
|
);
|
|
910
|
-
const
|
|
911
|
-
return new
|
|
914
|
+
const o = e.make(s);
|
|
915
|
+
return new o({ id: r }).restore();
|
|
912
916
|
}
|
|
913
917
|
static forceDelete(r) {
|
|
914
918
|
if (Array.isArray(r))
|
|
915
919
|
return i.call(
|
|
916
920
|
`luminix.${s}.destroyMany`,
|
|
917
|
-
(
|
|
921
|
+
(h) => h.withQueryParameters({ ids: r, force: !0 }),
|
|
922
|
+
`${s}.forceDeleteMany`
|
|
918
923
|
);
|
|
919
|
-
const
|
|
920
|
-
return new
|
|
924
|
+
const o = e.make(s);
|
|
925
|
+
return new o({ id: r }).forceDelete();
|
|
921
926
|
}
|
|
922
927
|
static singular() {
|
|
923
928
|
return e.schema(s).displayName.singular;
|
|
@@ -925,59 +930,59 @@ function $e(o, t, e, i, s) {
|
|
|
925
930
|
static plural() {
|
|
926
931
|
return e.schema(s).displayName.plural;
|
|
927
932
|
}
|
|
928
|
-
},
|
|
933
|
+
}, p(l, "name", y.studly(s)), l;
|
|
929
934
|
}
|
|
930
|
-
function
|
|
935
|
+
function Re(n, t, e) {
|
|
931
936
|
var i, s;
|
|
932
937
|
return class extends (s = e, i = Symbol.toStringTag, s) {
|
|
933
938
|
constructor(g = {}) {
|
|
934
939
|
super(g);
|
|
935
|
-
|
|
940
|
+
p(this, i, y.studly(t));
|
|
936
941
|
return new Proxy(this, {
|
|
937
|
-
get: (
|
|
938
|
-
if (
|
|
942
|
+
get: (l, u) => {
|
|
943
|
+
if (u === "__isModel")
|
|
939
944
|
return !0;
|
|
940
|
-
if (Reflect.has(
|
|
941
|
-
return Reflect.get(
|
|
942
|
-
if (Object.keys(
|
|
943
|
-
return
|
|
944
|
-
if (Object.keys(
|
|
945
|
-
return
|
|
946
|
-
if (
|
|
947
|
-
return () =>
|
|
948
|
-
if (
|
|
949
|
-
const r =
|
|
945
|
+
if (Reflect.has(l, u))
|
|
946
|
+
return Reflect.get(l, u);
|
|
947
|
+
if (Object.keys(l.attributes).includes(u))
|
|
948
|
+
return l.getAttribute(u);
|
|
949
|
+
if (Object.keys(l.relations).includes(u))
|
|
950
|
+
return l.relations[u].getLoadedItems();
|
|
951
|
+
if (u.endsWith("Relation") && Object.keys(l.relations).includes(y.snake(u.slice(0, -8))))
|
|
952
|
+
return () => l.relation(u.slice(0, -8));
|
|
953
|
+
if (n.hasReducer(`model${y.studly(l.getType())}Get${y.studly(u)}Attribute`)) {
|
|
954
|
+
const r = n[`model${y.studly(l.getType())}Get${y.studly(u)}Attribute`];
|
|
950
955
|
if (typeof r != "function")
|
|
951
|
-
throw new
|
|
952
|
-
return r.bind(
|
|
956
|
+
throw new $("ModelFacade");
|
|
957
|
+
return r.bind(n)(void 0, l);
|
|
953
958
|
}
|
|
954
|
-
return Reflect.get(
|
|
959
|
+
return Reflect.get(l, u);
|
|
955
960
|
},
|
|
956
|
-
set: (
|
|
957
|
-
y.snake(
|
|
961
|
+
set: (l, u, r) => u in l && typeof l[u] != "function" ? Reflect.set(l, u, r) : (l.setAttribute(
|
|
962
|
+
y.snake(u),
|
|
958
963
|
r
|
|
959
964
|
), !0)
|
|
960
965
|
});
|
|
961
966
|
}
|
|
962
967
|
};
|
|
963
968
|
}
|
|
964
|
-
var
|
|
965
|
-
class
|
|
969
|
+
var W, z;
|
|
970
|
+
class j extends (z = Error, W = Symbol.toStringTag, z) {
|
|
966
971
|
constructor(e) {
|
|
967
972
|
super(`[Luminix] Model "${e}" not found`);
|
|
968
|
-
|
|
973
|
+
p(this, W, "ModelNotFoundException");
|
|
969
974
|
}
|
|
970
975
|
}
|
|
971
|
-
var
|
|
972
|
-
class A extends (
|
|
976
|
+
var X, Y;
|
|
977
|
+
class A extends (Y = TypeError, X = Symbol.toStringTag, Y) {
|
|
973
978
|
constructor(e, i, s) {
|
|
974
979
|
super(`[Luminix] "${e}" expects a related model of type "${i}". Received "${s}" instead.`);
|
|
975
|
-
|
|
980
|
+
p(this, X, "ModelInvalidRelatedTypeException");
|
|
976
981
|
}
|
|
977
982
|
}
|
|
978
|
-
class
|
|
983
|
+
class ue extends N {
|
|
979
984
|
constructor(t, e, i, s = null) {
|
|
980
|
-
if (!m(s) && s !== null)
|
|
985
|
+
if (!m.isModel(s) && s !== null)
|
|
981
986
|
throw new w("BelongsTo.constructor()", "Model or null");
|
|
982
987
|
super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s;
|
|
983
988
|
}
|
|
@@ -995,12 +1000,12 @@ class ne extends N {
|
|
|
995
1000
|
return this.query().first();
|
|
996
1001
|
}
|
|
997
1002
|
async associate(t) {
|
|
998
|
-
if (!m(t))
|
|
1003
|
+
if (!m.isModel(t))
|
|
999
1004
|
throw new w("BelongsTo.associate()");
|
|
1000
1005
|
if (t.getType() !== this.getRelated().getSchemaName())
|
|
1001
1006
|
throw new A("BelongsTo.associate()", this.getRelated().getSchemaName(), t.getType());
|
|
1002
1007
|
if (!t.exists)
|
|
1003
|
-
throw new
|
|
1008
|
+
throw new ae(this.getRelated().getSchemaName(), "save");
|
|
1004
1009
|
return this.parent.update({
|
|
1005
1010
|
[this.getForeignKey()]: t.getKey()
|
|
1006
1011
|
});
|
|
@@ -1011,9 +1016,9 @@ class ne extends N {
|
|
|
1011
1016
|
});
|
|
1012
1017
|
}
|
|
1013
1018
|
}
|
|
1014
|
-
class
|
|
1019
|
+
class he extends N {
|
|
1015
1020
|
constructor(t, e, i, s = null) {
|
|
1016
|
-
if (s !== null && !(s instanceof
|
|
1021
|
+
if (s !== null && !(s instanceof x && s.every(f)))
|
|
1017
1022
|
throw new w("BelongsToMany.constructor()", "Collection<Model> or null");
|
|
1018
1023
|
super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s;
|
|
1019
1024
|
}
|
|
@@ -1113,16 +1118,16 @@ class K extends N {
|
|
|
1113
1118
|
return t.where(e, this.parent.getKey()), t.lock(`where.${e}`), t;
|
|
1114
1119
|
}
|
|
1115
1120
|
async saveQuietly(t) {
|
|
1116
|
-
if (!
|
|
1121
|
+
if (!f(t))
|
|
1117
1122
|
throw new w("HasOneOrMany.saveQuietly()");
|
|
1118
1123
|
if (t.getType() !== this.getRelated().getSchemaName())
|
|
1119
1124
|
throw new A("HasOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), t.getType());
|
|
1120
1125
|
t.setAttribute(this.getForeignKey(), this.parent.getKey()), await t.save();
|
|
1121
1126
|
}
|
|
1122
1127
|
}
|
|
1123
|
-
class
|
|
1128
|
+
class Ae extends K {
|
|
1124
1129
|
constructor(t, e, i, s = null) {
|
|
1125
|
-
if (!
|
|
1130
|
+
if (!f(s) && s !== null)
|
|
1126
1131
|
throw new w("HasOne.constructor()", "Model or null");
|
|
1127
1132
|
super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s;
|
|
1128
1133
|
}
|
|
@@ -1139,9 +1144,9 @@ class Re extends K {
|
|
|
1139
1144
|
await this.saveQuietly(t), this.items = t;
|
|
1140
1145
|
}
|
|
1141
1146
|
}
|
|
1142
|
-
class
|
|
1147
|
+
class Ne extends K {
|
|
1143
1148
|
constructor(t, e, i, s = null) {
|
|
1144
|
-
if (s !== null && !(s instanceof
|
|
1149
|
+
if (s !== null && !(s instanceof x && s.every(f)))
|
|
1145
1150
|
throw new w("HasMany.constructor()", "Collection<Model> or null");
|
|
1146
1151
|
super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s;
|
|
1147
1152
|
}
|
|
@@ -1164,7 +1169,7 @@ class Se extends K {
|
|
|
1164
1169
|
return this.query().find(t);
|
|
1165
1170
|
}
|
|
1166
1171
|
async saveManyQuietly(t) {
|
|
1167
|
-
if (!Array.isArray(t) || !t.every(
|
|
1172
|
+
if (!Array.isArray(t) || !t.every(f))
|
|
1168
1173
|
throw new w("HasMany.saveManyQuietly()", "Model[]");
|
|
1169
1174
|
if (!t.every((e) => e.getType() === this.getRelated().getSchemaName()))
|
|
1170
1175
|
throw new A("HasMany.saveManyQuietly()", this.getRelated().getSchemaName(), t.map((e) => e.getType()).join(", "));
|
|
@@ -1179,7 +1184,7 @@ class Se extends K {
|
|
|
1179
1184
|
await this.saveQuietly(t), this.items === null ? this.items = await this.all() : this.items.push(t);
|
|
1180
1185
|
}
|
|
1181
1186
|
}
|
|
1182
|
-
class
|
|
1187
|
+
class le extends K {
|
|
1183
1188
|
query() {
|
|
1184
1189
|
const t = this.getRelated().query();
|
|
1185
1190
|
t.once("success", (i) => {
|
|
@@ -1189,7 +1194,7 @@ class ae extends K {
|
|
|
1189
1194
|
return t.where(e + "_id", this.parent.getKey()), t.where(e + "_type", this.getRelated().getSchemaName()), t.lock(`where.${e}_id`), t.lock(`where.${e}_type`), t;
|
|
1190
1195
|
}
|
|
1191
1196
|
async saveQuietly(t) {
|
|
1192
|
-
if (!
|
|
1197
|
+
if (!f(t))
|
|
1193
1198
|
throw new w("MorphOneOrMany.saveQuietly()");
|
|
1194
1199
|
if (t.getType() !== this.getRelated().getSchemaName())
|
|
1195
1200
|
throw new A("MorphOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), t.getType());
|
|
@@ -1197,9 +1202,9 @@ class ae extends K {
|
|
|
1197
1202
|
t.setAttribute(e + "_id", this.parent.getKey()), t.setAttribute(e + "_type", this.parent.getType()), await t.save();
|
|
1198
1203
|
}
|
|
1199
1204
|
}
|
|
1200
|
-
class
|
|
1205
|
+
class qe extends le {
|
|
1201
1206
|
constructor(t, e, i, s = null) {
|
|
1202
|
-
if (s !== null && !(s instanceof
|
|
1207
|
+
if (s !== null && !(s instanceof x && s.every(f)))
|
|
1203
1208
|
throw new w("MorphMany.constructor()", "Collection<Model> or null");
|
|
1204
1209
|
super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s;
|
|
1205
1210
|
}
|
|
@@ -1222,7 +1227,7 @@ class Te extends ae {
|
|
|
1222
1227
|
return this.query().find(t);
|
|
1223
1228
|
}
|
|
1224
1229
|
async saveManyQuietly(t) {
|
|
1225
|
-
if (!Array.isArray(t) || !t.every(
|
|
1230
|
+
if (!Array.isArray(t) || !t.every(f))
|
|
1226
1231
|
throw new w("MorphMany.saveManyQuietly()");
|
|
1227
1232
|
if (!t.every((e) => e.getType() === this.getRelated().getSchemaName()))
|
|
1228
1233
|
throw new A("MorphMany.saveManyQuietly()", this.getRelated().getSchemaName(), t.map((e) => e.getType()).join(", "));
|
|
@@ -1237,9 +1242,9 @@ class Te extends ae {
|
|
|
1237
1242
|
this.items ? this.items.splice(0, this.items.count(), ...e) : this.items = e;
|
|
1238
1243
|
}
|
|
1239
1244
|
}
|
|
1240
|
-
class
|
|
1245
|
+
class Ke extends le {
|
|
1241
1246
|
constructor(t, e, i, s = null) {
|
|
1242
|
-
if (super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s, s !== null && !
|
|
1247
|
+
if (super(t, e, i, s), this.services = t, this.meta = e, this.parent = i, this.items = s, s !== null && !f(s))
|
|
1243
1248
|
throw new w("MorphOne.constructor()", "Model or null");
|
|
1244
1249
|
}
|
|
1245
1250
|
isSingle() {
|
|
@@ -1255,7 +1260,7 @@ class Ae extends ae {
|
|
|
1255
1260
|
await this.saveQuietly(t), this.items = t;
|
|
1256
1261
|
}
|
|
1257
1262
|
}
|
|
1258
|
-
class
|
|
1263
|
+
class ke extends ue {
|
|
1259
1264
|
getRelated() {
|
|
1260
1265
|
return this.services.model.make(
|
|
1261
1266
|
this.parent.getAttribute(this.getName() + "_type")
|
|
@@ -1270,7 +1275,7 @@ class Ne extends ne {
|
|
|
1270
1275
|
// return super.query();
|
|
1271
1276
|
// }
|
|
1272
1277
|
async associate(t) {
|
|
1273
|
-
if (!
|
|
1278
|
+
if (!f(t))
|
|
1274
1279
|
throw new w("MorphTo.associate()");
|
|
1275
1280
|
return t.exists || await t.save(), this.parent.update({
|
|
1276
1281
|
[this.getName() + "_id"]: t.getKey(),
|
|
@@ -1284,24 +1289,24 @@ class Ne extends ne {
|
|
|
1284
1289
|
});
|
|
1285
1290
|
}
|
|
1286
1291
|
}
|
|
1287
|
-
class
|
|
1292
|
+
class je extends he {
|
|
1288
1293
|
query() {
|
|
1289
1294
|
const t = super.query(), e = this.guessInverseRelation();
|
|
1290
1295
|
return t.where(e + "_id", this.parent.getKey()), t.where(e + "_type", this.parent.getType()), t.lock(`where.${e}_id`), t.lock(`where.${e}_type`), t;
|
|
1291
1296
|
}
|
|
1292
1297
|
}
|
|
1293
|
-
var
|
|
1294
|
-
class
|
|
1298
|
+
var Z, ee;
|
|
1299
|
+
class Oe extends (ee = q, Z = Symbol.toStringTag, ee) {
|
|
1295
1300
|
constructor(e) {
|
|
1296
1301
|
super();
|
|
1297
|
-
|
|
1298
|
-
|
|
1302
|
+
p(this, "_models", {});
|
|
1303
|
+
p(this, Z, "ModelService");
|
|
1299
1304
|
this._schema = e;
|
|
1300
1305
|
}
|
|
1301
1306
|
boot(e) {
|
|
1302
1307
|
this._schema && Object.keys(this._schema).forEach((i) => {
|
|
1303
1308
|
const s = this[`model${y.studly(i)}`], c = this.model(
|
|
1304
|
-
|
|
1309
|
+
Te(
|
|
1305
1310
|
e.make("config"),
|
|
1306
1311
|
e.make("log"),
|
|
1307
1312
|
e.make("model"),
|
|
@@ -1310,44 +1315,44 @@ class Ke extends (Z = q, Y = Symbol.toStringTag, Z) {
|
|
|
1310
1315
|
),
|
|
1311
1316
|
i
|
|
1312
1317
|
), g = s(c);
|
|
1313
|
-
this._models[i] =
|
|
1318
|
+
this._models[i] = Re(e.make("model"), i, g);
|
|
1314
1319
|
});
|
|
1315
1320
|
}
|
|
1316
1321
|
schema(e) {
|
|
1317
1322
|
if (!this._schema || e && !this._schema[e])
|
|
1318
|
-
throw new
|
|
1323
|
+
throw new j(e || "undefined");
|
|
1319
1324
|
return e ? this._schema[e] : this._schema;
|
|
1320
1325
|
}
|
|
1321
1326
|
make(e) {
|
|
1322
1327
|
if (e && !this._models[e])
|
|
1323
|
-
throw new
|
|
1328
|
+
throw new j(e);
|
|
1324
1329
|
return e ? this._models[e] : this._models;
|
|
1325
1330
|
}
|
|
1326
1331
|
getRelationConstructors(e) {
|
|
1327
1332
|
return this.relationMap({
|
|
1328
|
-
BelongsTo:
|
|
1329
|
-
BelongsToMany:
|
|
1330
|
-
HasOne:
|
|
1331
|
-
HasMany:
|
|
1332
|
-
MorphMany:
|
|
1333
|
-
MorphOne:
|
|
1334
|
-
MorphTo:
|
|
1335
|
-
MorphToMany:
|
|
1333
|
+
BelongsTo: ue,
|
|
1334
|
+
BelongsToMany: he,
|
|
1335
|
+
HasOne: Ae,
|
|
1336
|
+
HasMany: Ne,
|
|
1337
|
+
MorphMany: qe,
|
|
1338
|
+
MorphOne: Ke,
|
|
1339
|
+
MorphTo: ke,
|
|
1340
|
+
MorphToMany: je
|
|
1336
1341
|
}, e);
|
|
1337
1342
|
}
|
|
1338
1343
|
toString() {
|
|
1339
1344
|
return "model";
|
|
1340
1345
|
}
|
|
1341
1346
|
}
|
|
1342
|
-
const
|
|
1343
|
-
var
|
|
1344
|
-
class
|
|
1347
|
+
const Be = ne(Oe);
|
|
1348
|
+
var te, se;
|
|
1349
|
+
class Ce extends (se = Error, te = Symbol.toStringTag, se) {
|
|
1345
1350
|
constructor(e) {
|
|
1346
1351
|
super(`[Luminix] Route "${e}" not found`);
|
|
1347
|
-
|
|
1352
|
+
p(this, te, "RouteNotFoundException");
|
|
1348
1353
|
}
|
|
1349
1354
|
}
|
|
1350
|
-
class
|
|
1355
|
+
class Ie {
|
|
1351
1356
|
constructor(t, e, i, s = "") {
|
|
1352
1357
|
this.routes = t, this.error = e, this.http = i, this.appUrl = s;
|
|
1353
1358
|
}
|
|
@@ -1366,62 +1371,62 @@ class Oe {
|
|
|
1366
1371
|
}
|
|
1367
1372
|
get(t) {
|
|
1368
1373
|
if (!this.exists(t))
|
|
1369
|
-
throw new
|
|
1370
|
-
return
|
|
1374
|
+
throw new Ce(t);
|
|
1375
|
+
return m.get(this.routes, t);
|
|
1371
1376
|
}
|
|
1372
1377
|
url(t) {
|
|
1373
1378
|
const [e, i] = this.extractGenerator(t), s = this.get(e)[0].replace(/^\/|\/$/g, ""), c = /{([^}]+)}/g;
|
|
1374
1379
|
if (i === !1) {
|
|
1375
1380
|
if (typeof this.replaceRouteParams != "function")
|
|
1376
|
-
throw new
|
|
1381
|
+
throw new $("RouteFacade");
|
|
1377
1382
|
return this.appUrl + this.replaceRouteParams(`/${s}`);
|
|
1378
1383
|
}
|
|
1379
|
-
const g = s.match(c),
|
|
1384
|
+
const g = s.match(c), l = g ? g.map((h) => h.slice(1, -1)) : [], u = Object.keys(i), r = l.filter((h) => !u.includes(h)), o = u.filter((h) => !l.includes(h));
|
|
1380
1385
|
if (r.length > 0)
|
|
1381
1386
|
throw new TypeError(`Missing values for parameter(s): ${r.join(", ")}`);
|
|
1382
|
-
if (
|
|
1383
|
-
throw new TypeError(`Unexpected parameters: ${
|
|
1384
|
-
const
|
|
1385
|
-
return this.appUrl + `/${
|
|
1387
|
+
if (o.length > 0)
|
|
1388
|
+
throw new TypeError(`Unexpected parameters: ${o.join(", ")}`);
|
|
1389
|
+
const a = l.reduce((h, d) => h.replace(`{${d}}`, `${i[d]}`), s);
|
|
1390
|
+
return this.appUrl + `/${a}`;
|
|
1386
1391
|
}
|
|
1387
1392
|
methods(t) {
|
|
1388
1393
|
const [e] = this.extractGenerator(t);
|
|
1389
1394
|
return this.get(e).slice(1);
|
|
1390
1395
|
}
|
|
1391
1396
|
exists(t) {
|
|
1392
|
-
return
|
|
1397
|
+
return m.has(this.routes, t) && this.isRouteTuple(m.get(this.routes, t));
|
|
1393
1398
|
}
|
|
1394
1399
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1395
|
-
async call(t, e = (
|
|
1400
|
+
async call(t, e = (s) => s, i = "default") {
|
|
1396
1401
|
if (typeof this.clientOptions != "function" || typeof this.clientError != "function")
|
|
1397
|
-
throw new
|
|
1398
|
-
const [
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
this.error.clear(
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1404
|
-
const
|
|
1405
|
-
this.error.set(Object.entries(
|
|
1406
|
-
} else
|
|
1407
|
-
this.clientError({ axios:
|
|
1408
|
-
response:
|
|
1409
|
-
name:
|
|
1410
|
-
replace:
|
|
1411
|
-
client:
|
|
1402
|
+
throw new $("RouteFacade");
|
|
1403
|
+
const [s, c] = this.extractGenerator(t), [, ...g] = this.get(s), l = this.url(c ? [s, c] : s), u = e(this.http()), r = this.clientOptions({}, s);
|
|
1404
|
+
m.isEmpty(r) || u.withOptions(r);
|
|
1405
|
+
const o = g[0] ?? r.method;
|
|
1406
|
+
this.error.clear(i);
|
|
1407
|
+
const a = await u[o](l);
|
|
1408
|
+
if (ge(a)) {
|
|
1409
|
+
const h = a.json("errors");
|
|
1410
|
+
this.error.set(Object.entries(h).reduce((d, [v, b]) => (d[v] = b.join(" "), d), {}), i);
|
|
1411
|
+
} else a.failed() && this.error.set(
|
|
1412
|
+
this.clientError({ axios: a.json("message") }, {
|
|
1413
|
+
response: a,
|
|
1414
|
+
name: s,
|
|
1415
|
+
replace: c,
|
|
1416
|
+
client: u
|
|
1412
1417
|
}),
|
|
1413
|
-
|
|
1418
|
+
i
|
|
1414
1419
|
);
|
|
1415
|
-
return
|
|
1420
|
+
return a;
|
|
1416
1421
|
}
|
|
1417
1422
|
toString() {
|
|
1418
1423
|
return "route";
|
|
1419
1424
|
}
|
|
1420
1425
|
}
|
|
1421
|
-
const
|
|
1422
|
-
class
|
|
1426
|
+
const Pe = ne(Ie);
|
|
1427
|
+
class Qe {
|
|
1423
1428
|
getClient() {
|
|
1424
|
-
return new
|
|
1429
|
+
return new ye();
|
|
1425
1430
|
}
|
|
1426
1431
|
baseUrl(t) {
|
|
1427
1432
|
return this.getClient().baseUrl(t);
|
|
@@ -1474,42 +1479,40 @@ class Ce {
|
|
|
1474
1479
|
return this.getClient().delete(t, e);
|
|
1475
1480
|
}
|
|
1476
1481
|
}
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1482
|
+
const De = oe(Qe);
|
|
1483
|
+
var re, ie;
|
|
1484
|
+
class He extends (ie = me, re = Symbol.toStringTag, ie) {
|
|
1479
1485
|
constructor() {
|
|
1480
1486
|
super(...arguments);
|
|
1481
|
-
|
|
1487
|
+
p(this, re, "LuminixServiceProvider");
|
|
1482
1488
|
}
|
|
1483
1489
|
register() {
|
|
1484
|
-
this.registerServices(), this.registerMacros(), this.
|
|
1490
|
+
this.registerServices(), this.registerMacros(), this.app.on("ready", () => {
|
|
1485
1491
|
this.app.dump("[Luminix] App boot completed");
|
|
1486
1492
|
});
|
|
1487
1493
|
}
|
|
1488
1494
|
boot() {
|
|
1489
1495
|
this.app.make("model").boot(this.app);
|
|
1490
1496
|
}
|
|
1491
|
-
flush() {
|
|
1492
|
-
this.flushReady && (this.flushReady(), delete this.flushReady);
|
|
1493
|
-
}
|
|
1494
1497
|
registerServices() {
|
|
1495
|
-
this.app.singleton("auth", () => new
|
|
1498
|
+
this.app.singleton("auth", () => new ve(
|
|
1496
1499
|
this.app.make("config"),
|
|
1497
1500
|
this.app.make("model"),
|
|
1498
1501
|
this.app.make("route")
|
|
1499
1502
|
)), this.app.singleton("config", () => {
|
|
1500
|
-
const e = new
|
|
1503
|
+
const e = new R(m.omit(this.app.configuration, "manifest"));
|
|
1501
1504
|
return e.has("auth.user") || e.set("auth.user", null), e.lock("auth.user"), e;
|
|
1502
|
-
}), this.app.singleton("error", () => new
|
|
1505
|
+
}), this.app.singleton("error", () => new be()), this.app.singleton("http", () => new De()), this.app.singleton("log", () => {
|
|
1503
1506
|
var e;
|
|
1504
|
-
return new
|
|
1507
|
+
return new xe(((e = this.app.configuration.app) == null ? void 0 : e.debug) ?? !1);
|
|
1505
1508
|
}), this.app.singleton("model", () => {
|
|
1506
1509
|
var e;
|
|
1507
|
-
return new
|
|
1510
|
+
return new Be(
|
|
1508
1511
|
((e = this.app.configuration.manifest) == null ? void 0 : e.models) ?? {}
|
|
1509
1512
|
);
|
|
1510
1513
|
}), this.app.singleton("route", () => {
|
|
1511
1514
|
var e, i;
|
|
1512
|
-
return new
|
|
1515
|
+
return new Pe(
|
|
1513
1516
|
((e = this.app.configuration.manifest) == null ? void 0 : e.routes) ?? {},
|
|
1514
1517
|
this.app.make("error"),
|
|
1515
1518
|
() => this.app.make("http"),
|
|
@@ -1518,95 +1521,97 @@ class Qe extends pe {
|
|
|
1518
1521
|
});
|
|
1519
1522
|
}
|
|
1520
1523
|
registerMacros() {
|
|
1521
|
-
this.app.macro("environment", (...e) => e.length > 0 ? e.includes(this.app.make("config").get("app.env", "production")) : this.app.make("config").get("app.env", "production")), this.app.macro("getLocale", () => this.app.make("config").get("app.locale", "en")), this.app.macro("hasDebugModeEnabled", () => this.app.make("config").get("app.debug", !1)), this.app.macro("isLocal", () => this.app.make("config").get("app.env", "production") === "local"), this.app.macro("isProduction", () => this.app.make("config").get("app.env", "production") === "production")
|
|
1524
|
+
this.app.macro("environment", (...e) => e.length > 0 ? e.includes(this.app.make("config").get("app.env", "production")) : this.app.make("config").get("app.env", "production")), this.app.macro("getLocale", () => this.app.make("config").get("app.locale", "en")), this.app.macro("hasDebugModeEnabled", () => this.app.make("config").get("app.debug", !1)), this.app.macro("isLocal", () => this.app.make("config").get("app.env", "production") === "local"), this.app.macro("isProduction", () => this.app.make("config").get("app.env", "production") === "production"), m.macro("isModel", function(e) {
|
|
1525
|
+
return typeof e == "object" && e !== null && e.__isModel === !0;
|
|
1526
|
+
});
|
|
1522
1527
|
}
|
|
1523
1528
|
}
|
|
1524
|
-
let
|
|
1525
|
-
class
|
|
1529
|
+
let S;
|
|
1530
|
+
class Le {
|
|
1526
1531
|
getFacadeAccessor() {
|
|
1527
|
-
return
|
|
1528
|
-
|
|
1529
|
-
])),
|
|
1532
|
+
return S || (S = new (oe(fe))([
|
|
1533
|
+
He
|
|
1534
|
+
])), S;
|
|
1530
1535
|
}
|
|
1531
1536
|
down() {
|
|
1532
|
-
|
|
1537
|
+
S && (S.flush(), S = void 0);
|
|
1533
1538
|
}
|
|
1534
1539
|
}
|
|
1535
|
-
const
|
|
1536
|
-
function
|
|
1537
|
-
return typeof
|
|
1540
|
+
const M = E(Le);
|
|
1541
|
+
function _(n = void 0) {
|
|
1542
|
+
return typeof n != "string" ? M : M.make(n);
|
|
1538
1543
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1544
|
+
function Ze() {
|
|
1545
|
+
return _("auth");
|
|
1541
1546
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return new
|
|
1547
|
+
function et(n) {
|
|
1548
|
+
return new x(n);
|
|
1544
1549
|
}
|
|
1545
|
-
function
|
|
1546
|
-
const e =
|
|
1547
|
-
return typeof
|
|
1550
|
+
function tt(n, t) {
|
|
1551
|
+
const e = _("config");
|
|
1552
|
+
return typeof n > "u" ? e : e.get(n, t);
|
|
1548
1553
|
}
|
|
1549
|
-
function
|
|
1550
|
-
return
|
|
1554
|
+
function st(n, t = "default") {
|
|
1555
|
+
return n ? _().make("error").get(n, t) : _().make("error");
|
|
1551
1556
|
}
|
|
1552
|
-
function
|
|
1553
|
-
const t =
|
|
1554
|
-
return
|
|
1557
|
+
function rt(...n) {
|
|
1558
|
+
const t = _("log");
|
|
1559
|
+
return n.length ? t.debug(...n) : t;
|
|
1555
1560
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const t =
|
|
1558
|
-
return
|
|
1561
|
+
function it(n) {
|
|
1562
|
+
const t = _("model");
|
|
1563
|
+
return n ? t.make(n) : t;
|
|
1559
1564
|
}
|
|
1560
|
-
function
|
|
1561
|
-
const e =
|
|
1562
|
-
return
|
|
1565
|
+
function nt(n, t = !1) {
|
|
1566
|
+
const e = _("route");
|
|
1567
|
+
return n ? t ? e.url([n, t]) : e.url(n) : e;
|
|
1563
1568
|
}
|
|
1564
|
-
class
|
|
1569
|
+
class Je {
|
|
1565
1570
|
getFacadeAccessor() {
|
|
1566
1571
|
return "auth";
|
|
1567
1572
|
}
|
|
1568
1573
|
}
|
|
1569
|
-
const
|
|
1570
|
-
class
|
|
1574
|
+
const ot = E(Je, M);
|
|
1575
|
+
class Ue {
|
|
1571
1576
|
getFacadeAccessor() {
|
|
1572
1577
|
return "config";
|
|
1573
1578
|
}
|
|
1574
1579
|
}
|
|
1575
|
-
const
|
|
1576
|
-
class
|
|
1580
|
+
const at = E(Ue, M), ut = (n) => n instanceof we && n.unprocessableEntity() && typeof n.json("message") == "string" && typeof n.json("errors") == "object" && n.json("errors") !== null && Object.values(n.json("errors")).every((t) => Array.isArray(t) && t.every((e) => typeof e == "string"));
|
|
1581
|
+
class Fe {
|
|
1577
1582
|
getFacadeAccessor() {
|
|
1578
1583
|
return "error";
|
|
1579
1584
|
}
|
|
1580
1585
|
}
|
|
1581
|
-
const
|
|
1582
|
-
class
|
|
1586
|
+
const ht = E(Fe, M);
|
|
1587
|
+
class Ge {
|
|
1583
1588
|
getFacadeAccessor() {
|
|
1584
1589
|
return "http";
|
|
1585
1590
|
}
|
|
1586
1591
|
}
|
|
1587
|
-
const
|
|
1588
|
-
class
|
|
1592
|
+
const lt = E(Ge, M);
|
|
1593
|
+
class Ve {
|
|
1589
1594
|
getFacadeAccessor() {
|
|
1590
1595
|
return "log";
|
|
1591
1596
|
}
|
|
1592
1597
|
}
|
|
1593
|
-
const
|
|
1594
|
-
class
|
|
1598
|
+
const ct = E(Ve, M);
|
|
1599
|
+
class We {
|
|
1595
1600
|
getFacadeAccessor() {
|
|
1596
1601
|
return "model";
|
|
1597
1602
|
}
|
|
1598
1603
|
}
|
|
1599
|
-
const
|
|
1600
|
-
class
|
|
1604
|
+
const dt = E(We, M);
|
|
1605
|
+
class ze {
|
|
1601
1606
|
getFacadeAccessor() {
|
|
1602
1607
|
return "route";
|
|
1603
1608
|
}
|
|
1604
1609
|
}
|
|
1605
|
-
const
|
|
1606
|
-
class
|
|
1610
|
+
const pt = E(ze, M);
|
|
1611
|
+
class gt {
|
|
1607
1612
|
constructor() {
|
|
1608
|
-
|
|
1609
|
-
|
|
1613
|
+
p(this, "name");
|
|
1614
|
+
p(this, "version");
|
|
1610
1615
|
}
|
|
1611
1616
|
register(t) {
|
|
1612
1617
|
}
|
|
@@ -1614,23 +1619,23 @@ class ct {
|
|
|
1614
1619
|
}
|
|
1615
1620
|
}
|
|
1616
1621
|
export {
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1622
|
+
M as App,
|
|
1623
|
+
ot as Auth,
|
|
1624
|
+
at as Config,
|
|
1625
|
+
ht as Error,
|
|
1626
|
+
lt as Http,
|
|
1627
|
+
ct as Log,
|
|
1628
|
+
dt as Model,
|
|
1629
|
+
gt as Plugin,
|
|
1630
|
+
pt as Route,
|
|
1631
|
+
_ as app,
|
|
1632
|
+
Ze as auth,
|
|
1633
|
+
et as collect,
|
|
1634
|
+
tt as config,
|
|
1635
|
+
st as error,
|
|
1636
|
+
f as isModel,
|
|
1637
|
+
ut as isValidationError,
|
|
1638
|
+
rt as log,
|
|
1639
|
+
it as model,
|
|
1640
|
+
nt as route
|
|
1636
1641
|
};
|