@luminix/core 0.0.1-beta.4 → 0.0.1-beta.6
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 +4 -0
- package/dist/core.js +420 -398
- package/dist/facades/App.d.ts +7 -0
- package/dist/mixins/BaseModel.d.ts +2 -2
- package/dist/types/App.d.ts +7 -0
- package/dist/types/Builder.d.ts +4 -0
- package/package.json +1 -1
- package/graph.png +0 -0
package/dist/core.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var J = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var o = (n, e, t) => (F(n, e, "read from private field"), t ? t.call(n) : e.get(n)), q = (n, e, t) => e.has(n) ?
|
|
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 p = (n, e, t) => Fe(n, typeof e != "symbol" ? e + "" : e, t), F = (n, e, t) => e.has(n) || J("Cannot " + t);
|
|
7
|
+
var o = (n, e, t) => (F(n, e, "read from private field"), t ? t.call(n) : e.get(n)), q = (n, e, t) => e.has(n) ? J("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), P = (n, e, t, r) => (F(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), D = (n, e, t) => (F(n, e, "access private method"), t);
|
|
8
8
|
import f from "lodash";
|
|
9
|
-
import { produce as
|
|
10
|
-
import K, { isAxiosError as
|
|
11
|
-
var
|
|
12
|
-
class
|
|
9
|
+
import { produce as R, isDraftable as Pe } from "immer";
|
|
10
|
+
import K, { isAxiosError as ke } from "axios";
|
|
11
|
+
var V, X;
|
|
12
|
+
class Qe extends (X = Error, V = Symbol.toStringTag, X) {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
super(`[Luminix] Facade "${t}" not found`);
|
|
15
|
-
|
|
15
|
+
p(this, V, "FacadeNotFoundException");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class Le {
|
|
19
19
|
constructor(e) {
|
|
20
|
-
|
|
20
|
+
p(this, "_user");
|
|
21
21
|
this.app = e;
|
|
22
22
|
}
|
|
23
23
|
attempt(e, t = !1, r) {
|
|
@@ -64,7 +64,7 @@ class De {
|
|
|
64
64
|
return ((e = this.user()) == null ? void 0 : e.getKey()) || null;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class Ce {
|
|
68
68
|
constructor(e) {
|
|
69
69
|
this._debug = e;
|
|
70
70
|
}
|
|
@@ -93,9 +93,9 @@ class He {
|
|
|
93
93
|
this._debug && console.debug(...e);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class S {
|
|
97
97
|
constructor(e) {
|
|
98
|
-
|
|
98
|
+
p(this, "locked", []);
|
|
99
99
|
this.bag = e, Object.freeze(this.bag);
|
|
100
100
|
}
|
|
101
101
|
get(e, t) {
|
|
@@ -111,14 +111,14 @@ class A {
|
|
|
111
111
|
throw new Error("Cannot set the root path when there are locked paths");
|
|
112
112
|
if (typeof t != "object" || t === null)
|
|
113
113
|
throw new TypeError("Value must be an object");
|
|
114
|
-
this.bag =
|
|
114
|
+
this.bag = R(this.bag, () => t), this.emit("change", {
|
|
115
115
|
path: e,
|
|
116
116
|
value: t,
|
|
117
117
|
type: "set"
|
|
118
118
|
});
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
this.bag =
|
|
121
|
+
this.bag = R(this.bag, (r) => {
|
|
122
122
|
f.set(r, e, t);
|
|
123
123
|
}), this.emit("change", {
|
|
124
124
|
path: e,
|
|
@@ -132,7 +132,7 @@ class A {
|
|
|
132
132
|
if (e === ".") {
|
|
133
133
|
if (this.locked.some((i) => f.has(t, i)))
|
|
134
134
|
throw new Error(`Cannot merge a path "${e}" that would override a locked path`);
|
|
135
|
-
this.bag =
|
|
135
|
+
this.bag = R(this.bag, (i) => ({
|
|
136
136
|
...i,
|
|
137
137
|
...t
|
|
138
138
|
})), this.emit("change", {
|
|
@@ -158,7 +158,7 @@ class A {
|
|
|
158
158
|
delete(e) {
|
|
159
159
|
if (this.locked.some((t) => e.startsWith(t)))
|
|
160
160
|
throw new Error(`Cannot delete a locked path "${e}"`);
|
|
161
|
-
this.bag =
|
|
161
|
+
this.bag = R(this.bag, (t) => {
|
|
162
162
|
f.unset(t, e);
|
|
163
163
|
}), this.emit("change", {
|
|
164
164
|
path: e,
|
|
@@ -172,7 +172,7 @@ class A {
|
|
|
172
172
|
this.locked.push(e);
|
|
173
173
|
}
|
|
174
174
|
clone() {
|
|
175
|
-
return new
|
|
175
|
+
return new S(this.bag);
|
|
176
176
|
}
|
|
177
177
|
all() {
|
|
178
178
|
return this.bag;
|
|
@@ -191,94 +191,94 @@ class A {
|
|
|
191
191
|
emit(e, t) {
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
var e, t, r, i,
|
|
194
|
+
function A(n) {
|
|
195
|
+
var e, t, r, i, $e, u;
|
|
196
196
|
return u = class extends (t = n, e = Symbol.toStringTag, t) {
|
|
197
197
|
constructor(...d) {
|
|
198
198
|
super(...d);
|
|
199
199
|
q(this, i);
|
|
200
200
|
q(this, r);
|
|
201
|
-
|
|
202
|
-
P(this, r, D(this, i,
|
|
201
|
+
p(this, e, n.name);
|
|
202
|
+
P(this, r, D(this, i, $e).call(this));
|
|
203
203
|
}
|
|
204
|
-
on(d,
|
|
204
|
+
on(d, m) {
|
|
205
205
|
if (typeof d != "string")
|
|
206
206
|
throw new TypeError("event must be a string");
|
|
207
|
-
if (typeof
|
|
207
|
+
if (typeof m != "function")
|
|
208
208
|
throw new TypeError("callback must be a function");
|
|
209
|
-
return o(this, r).on(d,
|
|
209
|
+
return o(this, r).on(d, m);
|
|
210
210
|
}
|
|
211
|
-
once(d,
|
|
211
|
+
once(d, m) {
|
|
212
212
|
if (typeof d != "string")
|
|
213
213
|
throw new TypeError("event must be a string");
|
|
214
|
-
if (typeof
|
|
214
|
+
if (typeof m != "function")
|
|
215
215
|
throw new TypeError("callback must be a function");
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const w = o(this, r).on(d, (b) => {
|
|
217
|
+
w(), m(b);
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
emit(d,
|
|
220
|
+
emit(d, m = {}) {
|
|
221
221
|
if (typeof d != "string")
|
|
222
222
|
throw new TypeError("event must be a string");
|
|
223
|
-
if (typeof
|
|
223
|
+
if (typeof m != "object")
|
|
224
224
|
throw new TypeError("data must be an object");
|
|
225
225
|
o(this, r).emit(d, {
|
|
226
|
-
...
|
|
226
|
+
...m,
|
|
227
227
|
source: this
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
}, r = new WeakMap(), i = new WeakSet(),
|
|
230
|
+
}, r = new WeakMap(), i = new WeakSet(), $e = function() {
|
|
231
231
|
return {
|
|
232
|
-
emit(d,
|
|
233
|
-
for (let
|
|
234
|
-
|
|
232
|
+
emit(d, m) {
|
|
233
|
+
for (let w = 0, b = this.events[d] || [], g = b.length; w < g; w++)
|
|
234
|
+
b[w](m);
|
|
235
235
|
},
|
|
236
236
|
events: {},
|
|
237
|
-
on(d,
|
|
238
|
-
var
|
|
239
|
-
return ((
|
|
240
|
-
var
|
|
241
|
-
this.events[d] = (
|
|
237
|
+
on(d, m) {
|
|
238
|
+
var w;
|
|
239
|
+
return ((w = this.events)[d] || (w[d] = [])).push(m), () => {
|
|
240
|
+
var b;
|
|
241
|
+
this.events[d] = (b = this.events[d]) == null ? void 0 : b.filter((g) => m !== g);
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
245
|
}, u;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function U(...n) {
|
|
248
248
|
return n.reduce((e, t) => e.flatMap((r) => t.map((i) => [r, i].flat())));
|
|
249
249
|
}
|
|
250
250
|
function $(n) {
|
|
251
251
|
return !(typeof n != "object" || n === null || !Reflect.has(n, "constructor") || Reflect.get(n.constructor, "name") !== "Collection");
|
|
252
252
|
}
|
|
253
|
-
var
|
|
254
|
-
class
|
|
253
|
+
var Y, Z;
|
|
254
|
+
class E extends (Z = Error, Y = Symbol.toStringTag, Z) {
|
|
255
255
|
constructor() {
|
|
256
256
|
super("[Luminix] Method not implemented.");
|
|
257
|
-
|
|
257
|
+
p(this, Y, "MethodNotImplementedException");
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function c(n = [], e =
|
|
260
|
+
function c(n = [], e = k) {
|
|
261
261
|
if (!Array.isArray(n))
|
|
262
262
|
throw new TypeError("collect() expects an array");
|
|
263
|
-
return new (
|
|
263
|
+
return new (A(e))([...n]);
|
|
264
264
|
}
|
|
265
|
-
const
|
|
265
|
+
const _ = (n) => {
|
|
266
266
|
n.emit("change", {
|
|
267
267
|
items: n.all()
|
|
268
268
|
});
|
|
269
269
|
}, I = (n, e) => Array.isArray(n) ? n[e] ?? null : n.get(e);
|
|
270
|
-
var
|
|
271
|
-
class
|
|
270
|
+
var z, O, h;
|
|
271
|
+
class k {
|
|
272
272
|
constructor(e = []) {
|
|
273
273
|
// [Symbol.toStringTag] = 'Collection';
|
|
274
274
|
q(this, h);
|
|
275
|
-
|
|
275
|
+
p(this, z, "Collection");
|
|
276
276
|
P(this, h, e);
|
|
277
277
|
}
|
|
278
278
|
get items() {
|
|
279
279
|
return [...o(this, h)];
|
|
280
280
|
}
|
|
281
|
-
[(
|
|
281
|
+
[(O = Symbol.iterator, z = Symbol.toStringTag, O)]() {
|
|
282
282
|
return o(this, h)[Symbol.iterator]();
|
|
283
283
|
}
|
|
284
284
|
all() {
|
|
@@ -355,7 +355,7 @@ class Q {
|
|
|
355
355
|
}, {});
|
|
356
356
|
}
|
|
357
357
|
crossJoin(...e) {
|
|
358
|
-
return c(
|
|
358
|
+
return c(U(
|
|
359
359
|
o(this, h),
|
|
360
360
|
...e.map((t) => Array.isArray(t) ? t : t.all())
|
|
361
361
|
));
|
|
@@ -457,7 +457,7 @@ class Q {
|
|
|
457
457
|
return c(o(this, h).flatMap((t, r) => e(t, r, this)));
|
|
458
458
|
}
|
|
459
459
|
forget(e) {
|
|
460
|
-
return o(this, h).splice(e, 1),
|
|
460
|
+
return o(this, h).splice(e, 1), _(this), this;
|
|
461
461
|
}
|
|
462
462
|
forPage(e, t) {
|
|
463
463
|
return c(o(this, h).slice((e - 1) * t, e * t));
|
|
@@ -477,7 +477,7 @@ class Q {
|
|
|
477
477
|
}
|
|
478
478
|
return [String(i[l])];
|
|
479
479
|
});
|
|
480
|
-
return
|
|
480
|
+
return U(...u).forEach((l) => {
|
|
481
481
|
const d = Array.isArray(l) ? l.join(".") : l;
|
|
482
482
|
f.set(r, d, [
|
|
483
483
|
...f.get(r, d, []),
|
|
@@ -624,22 +624,22 @@ class Q {
|
|
|
624
624
|
}
|
|
625
625
|
pop(e = 1) {
|
|
626
626
|
const t = o(this, h).splice(o(this, h).length - e, e);
|
|
627
|
-
return
|
|
627
|
+
return _(this), e === 1 ? t[0] ?? null : c(t);
|
|
628
628
|
}
|
|
629
629
|
prepend(e) {
|
|
630
630
|
const t = o(this, h).unshift(e);
|
|
631
|
-
return
|
|
631
|
+
return _(this), t;
|
|
632
632
|
}
|
|
633
633
|
pull(e) {
|
|
634
634
|
const t = o(this, h).splice(e, 1)[0] ?? null;
|
|
635
|
-
return
|
|
635
|
+
return _(this), t;
|
|
636
636
|
}
|
|
637
637
|
push(...e) {
|
|
638
638
|
const t = o(this, h).push(...e);
|
|
639
|
-
return
|
|
639
|
+
return _(this), t;
|
|
640
640
|
}
|
|
641
641
|
put(e, t) {
|
|
642
|
-
return o(this, h).splice(e, 1, t),
|
|
642
|
+
return o(this, h).splice(e, 1, t), _(this), this;
|
|
643
643
|
}
|
|
644
644
|
random(e = 1) {
|
|
645
645
|
if (o(this, h).length < e)
|
|
@@ -675,7 +675,7 @@ class Q {
|
|
|
675
675
|
}
|
|
676
676
|
shift(e = 1) {
|
|
677
677
|
const t = o(this, h).splice(0, e);
|
|
678
|
-
return
|
|
678
|
+
return _(this), e === 1 ? t[0] ?? null : c(t);
|
|
679
679
|
}
|
|
680
680
|
shuffle() {
|
|
681
681
|
return c(f.shuffle(o(this, h)));
|
|
@@ -750,7 +750,7 @@ class Q {
|
|
|
750
750
|
}
|
|
751
751
|
splice(e, t, ...r) {
|
|
752
752
|
const i = t === void 0 ? o(this, h).length : t, s = o(this, h).splice(e, i, ...r);
|
|
753
|
-
return
|
|
753
|
+
return _(this), c(s);
|
|
754
754
|
}
|
|
755
755
|
split(e) {
|
|
756
756
|
const t = [];
|
|
@@ -804,7 +804,7 @@ class Q {
|
|
|
804
804
|
transform(e) {
|
|
805
805
|
for (const [t, r] of o(this, h).entries())
|
|
806
806
|
o(this, h).splice(t, 1, e(r, t, this));
|
|
807
|
-
return
|
|
807
|
+
return _(this), this;
|
|
808
808
|
}
|
|
809
809
|
unique(e) {
|
|
810
810
|
return c(typeof e == "string" ? o(this, h).filter((t, r) => !o(this, h).some((i, s) => i[e] == t[e] && s !== r)) : [...new Set(o(this, h))]);
|
|
@@ -902,30 +902,30 @@ class Q {
|
|
|
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 E();
|
|
906
906
|
}
|
|
907
907
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
908
908
|
once(e, t) {
|
|
909
|
-
throw new
|
|
909
|
+
throw new E();
|
|
910
910
|
}
|
|
911
911
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
912
912
|
emit(e, t) {
|
|
913
|
-
throw new
|
|
913
|
+
throw new E();
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
h = new WeakMap();
|
|
917
|
-
const
|
|
917
|
+
const Q = A(k);
|
|
918
918
|
var ee, te;
|
|
919
|
-
class
|
|
919
|
+
class H extends (te = k, ee = Symbol.toStringTag, te) {
|
|
920
920
|
constructor() {
|
|
921
921
|
super(...arguments);
|
|
922
|
-
|
|
922
|
+
p(this, ee, "Collection");
|
|
923
923
|
}
|
|
924
924
|
intersect(t) {
|
|
925
925
|
return this.filter((r) => t.some((i) => i.getKey() === r.getKey()));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
const
|
|
928
|
+
const N = (...n) => {
|
|
929
929
|
const e = new URLSearchParams();
|
|
930
930
|
return n.forEach((t) => {
|
|
931
931
|
const [, ...r] = t.split("?");
|
|
@@ -935,17 +935,17 @@ const R = (...n) => {
|
|
|
935
935
|
}), e;
|
|
936
936
|
};
|
|
937
937
|
var re, se;
|
|
938
|
-
class
|
|
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
|
+
p(this, re, "ModelWithoutPrimaryKeyException");
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
|
-
const
|
|
945
|
-
class
|
|
944
|
+
const De = A(S);
|
|
945
|
+
class Ue {
|
|
946
946
|
constructor(e, t, r = {}) {
|
|
947
|
-
|
|
948
|
-
this.facades = e, this.abstract = t, this.query = r, this.bag = new
|
|
947
|
+
p(this, "bag");
|
|
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
|
|
951
951
|
});
|
|
@@ -953,15 +953,15 @@ class Ve {
|
|
|
953
953
|
}
|
|
954
954
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
955
955
|
on(e, t) {
|
|
956
|
-
throw new
|
|
956
|
+
throw new E();
|
|
957
957
|
}
|
|
958
958
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
959
959
|
once(e, t) {
|
|
960
|
-
throw new
|
|
960
|
+
throw new E();
|
|
961
961
|
}
|
|
962
962
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
963
963
|
emit(e, t) {
|
|
964
|
-
throw new
|
|
964
|
+
throw new E();
|
|
965
965
|
}
|
|
966
966
|
lock(e) {
|
|
967
967
|
this.bag.lock(e);
|
|
@@ -998,6 +998,21 @@ class Ve {
|
|
|
998
998
|
}[t] || f.upperFirst(f.camelCase(t));
|
|
999
999
|
return this.bag.set(`where.${f.camelCase(e)}${s}`, r), this;
|
|
1000
1000
|
}
|
|
1001
|
+
with(e) {
|
|
1002
|
+
const t = this.bag.get("with", []);
|
|
1003
|
+
return (Array.isArray(e) ? e : [e]).forEach((i) => {
|
|
1004
|
+
t.includes(i) || t.push(i);
|
|
1005
|
+
}), this.bag.set("with", t), this;
|
|
1006
|
+
}
|
|
1007
|
+
withOnly(e) {
|
|
1008
|
+
return this.bag.set("with", Array.isArray(e) ? e : [e]), this;
|
|
1009
|
+
}
|
|
1010
|
+
without(e) {
|
|
1011
|
+
const t = this.bag.get("with", []);
|
|
1012
|
+
return (Array.isArray(e) ? e : [e]).forEach((i) => {
|
|
1013
|
+
t.includes(i) && t.splice(t.indexOf(i), 1);
|
|
1014
|
+
}), this.bag.set("with", t), this;
|
|
1015
|
+
}
|
|
1001
1016
|
orderBy(e, t = "asc") {
|
|
1002
1017
|
return this.bag.set("order_by", `${e}:${t}`), this;
|
|
1003
1018
|
}
|
|
@@ -1010,6 +1025,11 @@ class Ve {
|
|
|
1010
1025
|
unset(e) {
|
|
1011
1026
|
return this.bag.delete(e), this;
|
|
1012
1027
|
}
|
|
1028
|
+
include(e) {
|
|
1029
|
+
for (const [t, r] of e.entries())
|
|
1030
|
+
this.bag.set(t, r);
|
|
1031
|
+
return this;
|
|
1032
|
+
}
|
|
1013
1033
|
async exec(e = 1, t) {
|
|
1014
1034
|
try {
|
|
1015
1035
|
this.bag.set("page", e), this.emit("submit", {
|
|
@@ -1024,23 +1044,23 @@ class Ve {
|
|
|
1024
1044
|
class: this.abstract,
|
|
1025
1045
|
model: a
|
|
1026
1046
|
}), a;
|
|
1027
|
-
}),
|
|
1047
|
+
}), H);
|
|
1028
1048
|
if (t) {
|
|
1029
1049
|
const [u] = t.split("?");
|
|
1030
1050
|
return {
|
|
1031
1051
|
...r,
|
|
1032
1052
|
data: s,
|
|
1033
1053
|
links: {
|
|
1034
|
-
first: `${u}?${
|
|
1035
|
-
last: `${u}?${
|
|
1036
|
-
next: r.links.next && `${u}?${
|
|
1037
|
-
prev: r.links.prev && `${u}?${
|
|
1054
|
+
first: `${u}?${N(t, r.links.first).toString()}`,
|
|
1055
|
+
last: `${u}?${N(t, r.links.last).toString()}`,
|
|
1056
|
+
next: r.links.next && `${u}?${N(t, r.links.next).toString()}`,
|
|
1057
|
+
prev: r.links.prev && `${u}?${N(t, r.links.prev).toString()}`
|
|
1038
1058
|
},
|
|
1039
1059
|
meta: {
|
|
1040
1060
|
...r.meta,
|
|
1041
1061
|
links: r.meta.links.map((a) => ({
|
|
1042
1062
|
...a,
|
|
1043
|
-
url: a.url && `${u}?${
|
|
1063
|
+
url: a.url && `${u}?${N(t, a.url).toString()}`
|
|
1044
1064
|
}))
|
|
1045
1065
|
}
|
|
1046
1066
|
};
|
|
@@ -1072,7 +1092,7 @@ class Ve {
|
|
|
1072
1092
|
async find(e) {
|
|
1073
1093
|
const t = this.facades.model.schema(this.abstract).primaryKey;
|
|
1074
1094
|
if (!t)
|
|
1075
|
-
throw new
|
|
1095
|
+
throw new Je(this.abstract);
|
|
1076
1096
|
const r = await this.where(t, e).limit(1).exec(1);
|
|
1077
1097
|
return this.emit("success", {
|
|
1078
1098
|
response: r,
|
|
@@ -1087,7 +1107,7 @@ class Ve {
|
|
|
1087
1107
|
i.map((a) => this.limit(e).exec(a))
|
|
1088
1108
|
), u = c(
|
|
1089
1109
|
s.reduce((a, l) => (a.push(...l.data), a), t.data).all(),
|
|
1090
|
-
|
|
1110
|
+
H
|
|
1091
1111
|
);
|
|
1092
1112
|
return this.emit("success", {
|
|
1093
1113
|
response: {
|
|
@@ -1098,43 +1118,43 @@ class Ve {
|
|
|
1098
1118
|
}), u;
|
|
1099
1119
|
}
|
|
1100
1120
|
}
|
|
1101
|
-
const
|
|
1121
|
+
const He = A(Ue);
|
|
1102
1122
|
var ie, ne;
|
|
1103
|
-
class
|
|
1123
|
+
class T extends (ne = Error, ie = Symbol.toStringTag, ne) {
|
|
1104
1124
|
constructor(t) {
|
|
1105
1125
|
super(`[Luminix] Expected ${t} to be reducible.`);
|
|
1106
|
-
|
|
1126
|
+
p(this, ie, "NotReducibleException");
|
|
1107
1127
|
}
|
|
1108
1128
|
}
|
|
1109
1129
|
var oe, he;
|
|
1110
|
-
class
|
|
1130
|
+
class M extends (he = TypeError, oe = Symbol.toStringTag, he) {
|
|
1111
1131
|
constructor(t, r = "Model") {
|
|
1112
1132
|
super(`[Luminix] "${t}" expects ${r}`);
|
|
1113
|
-
|
|
1133
|
+
p(this, oe, "NotModelException");
|
|
1114
1134
|
}
|
|
1115
1135
|
}
|
|
1116
1136
|
var ue, ae;
|
|
1117
|
-
class
|
|
1137
|
+
class We extends (ae = Error, ue = Symbol.toStringTag, ae) {
|
|
1118
1138
|
constructor(t, r, i, s) {
|
|
1119
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}".`);
|
|
1120
|
-
|
|
1140
|
+
p(this, ue, "NoInverseRelationException");
|
|
1121
1141
|
}
|
|
1122
1142
|
}
|
|
1123
1143
|
var le, ce;
|
|
1124
|
-
class
|
|
1144
|
+
class Ge extends (ce = Error, le = Symbol.toStringTag, ce) {
|
|
1125
1145
|
constructor(t) {
|
|
1126
1146
|
super(`[Luminix] Relation "${t}" is not supported`);
|
|
1127
|
-
|
|
1147
|
+
p(this, le, "UnsupportedRelationException");
|
|
1128
1148
|
}
|
|
1129
1149
|
}
|
|
1130
|
-
function
|
|
1150
|
+
function x(n) {
|
|
1131
1151
|
return typeof n == "object" && n !== null && n.__isModel === !0;
|
|
1132
1152
|
}
|
|
1133
1153
|
class j {
|
|
1134
1154
|
constructor(e, t, r, i = null) {
|
|
1135
|
-
|
|
1136
|
-
if (this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !
|
|
1137
|
-
throw new
|
|
1155
|
+
p(this, "unsubscribeQuery", null);
|
|
1156
|
+
if (this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !x(i) && !($(i) && i.every(x)))
|
|
1157
|
+
throw new M("Relation.constructor()", "Model, Collection<Model> or null");
|
|
1138
1158
|
}
|
|
1139
1159
|
make(e) {
|
|
1140
1160
|
const t = this.getRelated();
|
|
@@ -1156,7 +1176,7 @@ class j {
|
|
|
1156
1176
|
guessInverseRelation() {
|
|
1157
1177
|
const { relations: e } = this.getRelated().getSchema();
|
|
1158
1178
|
if (typeof this.facades.model.guessInverseRelation != "function")
|
|
1159
|
-
throw new
|
|
1179
|
+
throw new T("ModelFacade");
|
|
1160
1180
|
const t = this.getType(), r = this.facades.model.guessInverseRelation({
|
|
1161
1181
|
HasOne: ["BelongsTo"],
|
|
1162
1182
|
HasMany: ["BelongsTo"],
|
|
@@ -1168,18 +1188,18 @@ class j {
|
|
|
1168
1188
|
MorphToMany: ["MorphToMany"]
|
|
1169
1189
|
}, this.parent, t, this.getRelated());
|
|
1170
1190
|
if (!(t in r))
|
|
1171
|
-
throw new
|
|
1191
|
+
throw new Ge(t);
|
|
1172
1192
|
for (const i in e) {
|
|
1173
1193
|
const s = e[i];
|
|
1174
1194
|
if ((s.model === this.parent.getType() || ["MorphOne", "MorphMany"].includes(t)) && r[t].includes(s.type))
|
|
1175
1195
|
return i;
|
|
1176
1196
|
}
|
|
1177
|
-
throw new
|
|
1197
|
+
throw new We(this.parent.getType(), t, this.getRelated().getSchemaName(), r[t].join(" or "));
|
|
1178
1198
|
}
|
|
1179
1199
|
set(e) {
|
|
1180
|
-
if (e !== null && !
|
|
1181
|
-
throw new
|
|
1182
|
-
!this.items ||
|
|
1200
|
+
if (e !== null && !x(e) && !($(e) && e.every(x)))
|
|
1201
|
+
throw new M("Relation.set()", "Model, Collection<Model> or null");
|
|
1202
|
+
!this.items || x(this.items) ? this.items = e : $(e) && this.items.splice(0, this.items.count(), ...e);
|
|
1183
1203
|
}
|
|
1184
1204
|
getForeignKey() {
|
|
1185
1205
|
return this.meta.foreignKey;
|
|
@@ -1209,7 +1229,7 @@ class j {
|
|
|
1209
1229
|
return this.items;
|
|
1210
1230
|
}
|
|
1211
1231
|
isSingle() {
|
|
1212
|
-
return
|
|
1232
|
+
return x(this.items);
|
|
1213
1233
|
}
|
|
1214
1234
|
isMultiple() {
|
|
1215
1235
|
return $(this.items);
|
|
@@ -1258,30 +1278,23 @@ class j {
|
|
|
1258
1278
|
// }
|
|
1259
1279
|
}
|
|
1260
1280
|
var de, fe;
|
|
1261
|
-
class
|
|
1262
|
-
constructor(t, r) {
|
|
1263
|
-
super(`[Luminix] Attribute "${r}" in model "${t}" is not fillable`);
|
|
1264
|
-
g(this, de, "AttributeNotFillableException");
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
var pe, me;
|
|
1268
|
-
class Re extends (me = Error, pe = Symbol.toStringTag, me) {
|
|
1281
|
+
class Ae extends (fe = Error, de = Symbol.toStringTag, fe) {
|
|
1269
1282
|
constructor(t, r) {
|
|
1270
1283
|
super(`[Luminix] Model "${t}" must be persisted before calling "${r}"`);
|
|
1271
|
-
|
|
1284
|
+
p(this, de, "ModelNotPersistedException");
|
|
1272
1285
|
}
|
|
1273
1286
|
}
|
|
1274
|
-
function
|
|
1287
|
+
function Ve(n, e) {
|
|
1275
1288
|
var r;
|
|
1276
1289
|
r = Symbol.toStringTag;
|
|
1277
1290
|
class t {
|
|
1278
1291
|
constructor(s = {}) {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1292
|
+
p(this, "_attributes", new S({}));
|
|
1293
|
+
p(this, "_original", {});
|
|
1294
|
+
p(this, "_relations", {});
|
|
1295
|
+
p(this, "_changedKeys", []);
|
|
1296
|
+
p(this, "exists", !1);
|
|
1297
|
+
p(this, r, f.upperFirst(f.camelCase(e)));
|
|
1285
1298
|
this.makeRelations(), this.makeAttributes(s);
|
|
1286
1299
|
}
|
|
1287
1300
|
cast(s, u) {
|
|
@@ -1291,38 +1304,36 @@ function ze(n, e) {
|
|
|
1291
1304
|
return s == null || !u ? s : ["boolean", "bool"].includes(u) ? !!s : ["date", "datetime", "immutable_date", "immutable_datetime"].includes(u) && s instanceof Date ? s.toISOString() : ["float", "double", "integer", "int"].includes(u) || u.startsWith("decimal:") ? Number(s) : s;
|
|
1292
1305
|
}
|
|
1293
1306
|
makeRelations() {
|
|
1294
|
-
const { relations: s } = n.model.schema(e);
|
|
1307
|
+
const { relations: s } = n.make("model").schema(e);
|
|
1295
1308
|
if (this._relations = {}, !s)
|
|
1296
1309
|
return;
|
|
1297
|
-
|
|
1298
|
-
throw new _("ModelFacade");
|
|
1299
|
-
const u = n.model.relationMap({}, e);
|
|
1310
|
+
const u = n.make("model").relationMap({}, e);
|
|
1300
1311
|
Object.entries(s).forEach(([a, l]) => {
|
|
1301
|
-
const { type: d } = l,
|
|
1302
|
-
this._relations[a] = new
|
|
1312
|
+
const { type: d } = l, m = d in u ? u[d] : j;
|
|
1313
|
+
this._relations[a] = new m(
|
|
1303
1314
|
{ name: a, ...l },
|
|
1304
|
-
n,
|
|
1315
|
+
n.make(),
|
|
1305
1316
|
this,
|
|
1306
1317
|
null
|
|
1307
1318
|
);
|
|
1308
1319
|
});
|
|
1309
1320
|
}
|
|
1310
1321
|
makeAttributes(s) {
|
|
1311
|
-
const { relations: u } = n.model.schema(e), a = Object.keys(u || {}), l = f.omit(s, a);
|
|
1322
|
+
const { relations: u } = n.make("model").schema(e), a = Object.keys(u || {}), l = f.omit(s, a);
|
|
1312
1323
|
if (this.fillable.filter((d) => !(d in l)).forEach((d) => {
|
|
1313
1324
|
l[d] = null;
|
|
1314
1325
|
}), u && Object.keys(u).forEach((d) => {
|
|
1315
1326
|
this.relation(f.camelCase(d)).make(s[d]);
|
|
1316
1327
|
}), !this.validateJsonObject(l)) {
|
|
1317
|
-
if (n.
|
|
1328
|
+
if (n.isProduction())
|
|
1318
1329
|
throw new TypeError(`[Luminix] Invalid attributes for model "${e}"`);
|
|
1319
|
-
n.log.warning(`Invalid attributes for model "${e}".
|
|
1330
|
+
n.make("log").warning(`Invalid attributes for model "${e}".
|
|
1320
1331
|
This will throw an error in production.`, {
|
|
1321
1332
|
attributes: s,
|
|
1322
1333
|
abstract: e
|
|
1323
1334
|
});
|
|
1324
1335
|
}
|
|
1325
|
-
this._attributes = new
|
|
1336
|
+
this._attributes = new S(l), this._original = l, this._changedKeys = [];
|
|
1326
1337
|
}
|
|
1327
1338
|
makePrimaryKeyReplacer() {
|
|
1328
1339
|
return {
|
|
@@ -1337,7 +1348,7 @@ function ze(n, e) {
|
|
|
1337
1348
|
dispatchCreateEvent(s) {
|
|
1338
1349
|
this.emit("create", {
|
|
1339
1350
|
value: s
|
|
1340
|
-
}), n.model.emit("create", {
|
|
1351
|
+
}), n.make("model").emit("create", {
|
|
1341
1352
|
class: e,
|
|
1342
1353
|
model: this
|
|
1343
1354
|
});
|
|
@@ -1345,7 +1356,7 @@ function ze(n, e) {
|
|
|
1345
1356
|
dispatchUpdateEvent(s) {
|
|
1346
1357
|
this.emit("update", {
|
|
1347
1358
|
value: s
|
|
1348
|
-
}), n.model.emit("update", {
|
|
1359
|
+
}), n.make("model").emit("update", {
|
|
1349
1360
|
class: e,
|
|
1350
1361
|
model: this
|
|
1351
1362
|
});
|
|
@@ -1353,7 +1364,7 @@ function ze(n, e) {
|
|
|
1353
1364
|
dispatchSaveEvent() {
|
|
1354
1365
|
this.emit("save", {
|
|
1355
1366
|
value: this.diff()
|
|
1356
|
-
}), n.model.emit("save", {
|
|
1367
|
+
}), n.make("model").emit("save", {
|
|
1357
1368
|
class: e,
|
|
1358
1369
|
model: this
|
|
1359
1370
|
});
|
|
@@ -1362,7 +1373,7 @@ function ze(n, e) {
|
|
|
1362
1373
|
this.emit("delete", {
|
|
1363
1374
|
force: s,
|
|
1364
1375
|
[this.getKeyName()]: this.getKey()
|
|
1365
|
-
}), n.model.emit("delete", {
|
|
1376
|
+
}), n.make("model").emit("delete", {
|
|
1366
1377
|
class: e,
|
|
1367
1378
|
model: this,
|
|
1368
1379
|
force: s
|
|
@@ -1371,7 +1382,7 @@ function ze(n, e) {
|
|
|
1371
1382
|
dispatchRestoreEvent() {
|
|
1372
1383
|
this.emit("restore", {
|
|
1373
1384
|
value: this.attributes
|
|
1374
|
-
}), n.model.emit("restore", {
|
|
1385
|
+
}), n.make("model").emit("restore", {
|
|
1375
1386
|
class: e,
|
|
1376
1387
|
model: this
|
|
1377
1388
|
});
|
|
@@ -1380,7 +1391,7 @@ function ze(n, e) {
|
|
|
1380
1391
|
this.emit("error", {
|
|
1381
1392
|
error: s,
|
|
1382
1393
|
operation: u
|
|
1383
|
-
}), n.model.emit("error", {
|
|
1394
|
+
}), n.make("model").emit("error", {
|
|
1384
1395
|
class: e,
|
|
1385
1396
|
model: this,
|
|
1386
1397
|
error: s,
|
|
@@ -1404,20 +1415,20 @@ function ze(n, e) {
|
|
|
1404
1415
|
return this._relations;
|
|
1405
1416
|
}
|
|
1406
1417
|
get fillable() {
|
|
1407
|
-
return n.model.schema(e).fillable;
|
|
1418
|
+
return n.make("model").schema(e).fillable;
|
|
1408
1419
|
}
|
|
1409
1420
|
get primaryKey() {
|
|
1410
|
-
return n.model.schema(e).primaryKey;
|
|
1421
|
+
return n.make("model").schema(e).primaryKey;
|
|
1411
1422
|
}
|
|
1412
1423
|
get timestamps() {
|
|
1413
|
-
return n.model.schema(e).timestamps;
|
|
1424
|
+
return n.make("model").schema(e).timestamps;
|
|
1414
1425
|
}
|
|
1415
1426
|
// get softDeletes() {
|
|
1416
|
-
// return
|
|
1427
|
+
// return app.make('model').schema(abstract).softDeletes;
|
|
1417
1428
|
// }
|
|
1418
1429
|
get casts() {
|
|
1419
1430
|
return {
|
|
1420
|
-
...n.model.schema(e).casts,
|
|
1431
|
+
...n.make("model").schema(e).casts,
|
|
1421
1432
|
...this.timestamps ? { created_at: "datetime", updated_at: "datetime" } : {}
|
|
1422
1433
|
// ...this.softDeletes ? { deleted_at: 'datetime' } : {},
|
|
1423
1434
|
};
|
|
@@ -1428,30 +1439,23 @@ function ze(n, e) {
|
|
|
1428
1439
|
getAttribute(s) {
|
|
1429
1440
|
let u = this._attributes.get(s, null);
|
|
1430
1441
|
s in this.casts && (u = this.cast(u, this.casts[s]));
|
|
1431
|
-
const a = n.model[`model${f.upperFirst(f.camelCase(e))}Get${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1442
|
+
const a = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Get${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1432
1443
|
if (typeof a != "function")
|
|
1433
|
-
throw new
|
|
1434
|
-
return a.bind(n.model)(u, this);
|
|
1444
|
+
throw new T("ModelFacade");
|
|
1445
|
+
return a.bind(n.make("model"))(u, this);
|
|
1435
1446
|
}
|
|
1436
1447
|
setAttribute(s, u) {
|
|
1437
|
-
|
|
1438
|
-
if (n.config.get("app.env", "production") === "production")
|
|
1439
|
-
throw new Ne(e, s);
|
|
1440
|
-
n.log.warning(`[Luminix] Trying to set a non-fillable attribute "${s}" in model "${e}".
|
|
1441
|
-
This will throw an error in production.`);
|
|
1442
|
-
return;
|
|
1443
|
-
}
|
|
1444
|
-
const a = n.model[`model${f.upperFirst(f.camelCase(e))}Set${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1448
|
+
const a = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Set${f.upperFirst(f.camelCase(s))}Attribute`];
|
|
1445
1449
|
if (typeof a != "function")
|
|
1446
|
-
throw new
|
|
1447
|
-
const l = a.bind(n.model)(
|
|
1450
|
+
throw new T("ModelFacade");
|
|
1451
|
+
const l = a.bind(n.make("model"))(
|
|
1448
1452
|
this.mutate(u, this.casts[s]),
|
|
1449
1453
|
this
|
|
1450
1454
|
);
|
|
1451
1455
|
if (!this.validateJsonObject({ [s]: l })) {
|
|
1452
|
-
if (n.
|
|
1456
|
+
if (n.isProduction())
|
|
1453
1457
|
throw new TypeError(`[Luminix] Attribute "${s}" in model "${e}" must be a boolean, number, string or null`);
|
|
1454
|
-
n.log.warning(`Invalid type for attribute "${s}" in model "${e}" after mutation.
|
|
1458
|
+
n.make("log").warning(`Invalid type for attribute "${s}" in model "${e}" after mutation.
|
|
1455
1459
|
This will throw an error in production.`, {
|
|
1456
1460
|
key: s,
|
|
1457
1461
|
value: u,
|
|
@@ -1470,19 +1474,19 @@ function ze(n, e) {
|
|
|
1470
1474
|
return this.primaryKey;
|
|
1471
1475
|
}
|
|
1472
1476
|
fill(s) {
|
|
1473
|
-
const u = f.pick(s, this.fillable), a = Object.entries(u).reduce((l, [d,
|
|
1474
|
-
const
|
|
1475
|
-
if (typeof
|
|
1476
|
-
throw new
|
|
1477
|
-
return l[d] =
|
|
1478
|
-
this.mutate(
|
|
1477
|
+
const u = f.pick(s, this.fillable), a = Object.entries(u).reduce((l, [d, m]) => {
|
|
1478
|
+
const w = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Set${f.upperFirst(f.camelCase(d))}Attribute`];
|
|
1479
|
+
if (typeof w != "function")
|
|
1480
|
+
throw new T("ModelFacade");
|
|
1481
|
+
return l[d] = w.bind(n.make("model"))(
|
|
1482
|
+
this.mutate(m, this.casts[d]),
|
|
1479
1483
|
this
|
|
1480
1484
|
), l;
|
|
1481
1485
|
}, {});
|
|
1482
1486
|
if (!this.validateJsonObject(a)) {
|
|
1483
|
-
if (n.
|
|
1487
|
+
if (n.isProduction())
|
|
1484
1488
|
throw new TypeError(`[Luminix] Invalid attributes for model "${e}"`);
|
|
1485
|
-
n.log.warning(`Invalid attributes for model "${e}" after mutation.
|
|
1489
|
+
n.make("log").warning(`Invalid attributes for model "${e}" after mutation.
|
|
1486
1490
|
This will throw an error in production.`, {
|
|
1487
1491
|
attributes: s,
|
|
1488
1492
|
mutatedAttributes: a,
|
|
@@ -1494,16 +1498,16 @@ function ze(n, e) {
|
|
|
1494
1498
|
this._attributes.merge(".", a), Object.keys(a).forEach((l) => this.updateChangedKeys(l)), this.dispatchChangeEvent(a);
|
|
1495
1499
|
}
|
|
1496
1500
|
dump() {
|
|
1497
|
-
n.log.info({
|
|
1501
|
+
n.make("log").info({
|
|
1498
1502
|
...this.toJson(),
|
|
1499
1503
|
[Symbol.toStringTag]: f.upperFirst(f.camelCase(e))
|
|
1500
1504
|
});
|
|
1501
1505
|
}
|
|
1502
1506
|
toJson() {
|
|
1503
|
-
const s = Object.entries(this.relations).reduce((a, [l, d]) => (d.isLoaded() && (d.isSingle() ? a[f.snakeCase(l)] = d.getLoadedItems().toJson() : d.isMultiple() && (a[f.snakeCase(l)] = d.getLoadedItems().map((
|
|
1507
|
+
const s = Object.entries(this.relations).reduce((a, [l, d]) => (d.isLoaded() && (d.isSingle() ? a[f.snakeCase(l)] = d.getLoadedItems().toJson() : d.isMultiple() && (a[f.snakeCase(l)] = d.getLoadedItems().map((m) => m.toJson()).all())), a), {}), u = n.make("model")[`model${f.upperFirst(f.camelCase(e))}Json`];
|
|
1504
1508
|
if (typeof u != "function")
|
|
1505
|
-
throw new
|
|
1506
|
-
return u.bind(n.model)({
|
|
1509
|
+
throw new T("ModelFacade");
|
|
1510
|
+
return u.bind(n.make("model"))({
|
|
1507
1511
|
...this.attributes,
|
|
1508
1512
|
...s
|
|
1509
1513
|
}, this);
|
|
@@ -1520,8 +1524,8 @@ function ze(n, e) {
|
|
|
1520
1524
|
}
|
|
1521
1525
|
async refresh() {
|
|
1522
1526
|
if (!this.exists)
|
|
1523
|
-
throw new
|
|
1524
|
-
const { data: s } = await n.route.call([
|
|
1527
|
+
throw new Ae(e, "refresh");
|
|
1528
|
+
const { data: s } = await n.make("route").call([
|
|
1525
1529
|
`luminix.${e}.show`,
|
|
1526
1530
|
this.makePrimaryKeyReplacer()
|
|
1527
1531
|
], {
|
|
@@ -1537,7 +1541,7 @@ function ze(n, e) {
|
|
|
1537
1541
|
} = s, l = this.exists, d = l ? [
|
|
1538
1542
|
`luminix.${e}.update`,
|
|
1539
1543
|
this.makePrimaryKeyReplacer()
|
|
1540
|
-
] : `luminix.${e}.store`,
|
|
1544
|
+
] : `luminix.${e}.store`, m = await n.make("route").call(
|
|
1541
1545
|
d,
|
|
1542
1546
|
{
|
|
1543
1547
|
data: {
|
|
@@ -1550,19 +1554,19 @@ function ze(n, e) {
|
|
|
1550
1554
|
errorBag: l ? `${e}[${this.getKey()}].update` : `${e}.store`
|
|
1551
1555
|
}
|
|
1552
1556
|
);
|
|
1553
|
-
if ([200, 201].includes(
|
|
1554
|
-
return this.makeAttributes(
|
|
1555
|
-
throw
|
|
1557
|
+
if ([200, 201].includes(m.status))
|
|
1558
|
+
return this.makeAttributes(m.data), this.exists = !0, this.dispatchSaveEvent(), l ? this.dispatchUpdateEvent(m.data) : this.dispatchCreateEvent(m.data), m;
|
|
1559
|
+
throw m;
|
|
1556
1560
|
} catch (u) {
|
|
1557
|
-
throw n.log.error(u), this.dispatchErrorEvent(u, "save"), u;
|
|
1561
|
+
throw n.make("log").error(u), this.dispatchErrorEvent(u, "save"), u;
|
|
1558
1562
|
}
|
|
1559
1563
|
}
|
|
1560
1564
|
async push() {
|
|
1561
|
-
throw new
|
|
1565
|
+
throw new E();
|
|
1562
1566
|
}
|
|
1563
1567
|
async delete() {
|
|
1564
1568
|
try {
|
|
1565
|
-
const s = await n.route.call([
|
|
1569
|
+
const s = await n.make("route").call([
|
|
1566
1570
|
`luminix.${e}.destroy`,
|
|
1567
1571
|
this.makePrimaryKeyReplacer()
|
|
1568
1572
|
], {
|
|
@@ -1572,12 +1576,12 @@ function ze(n, e) {
|
|
|
1572
1576
|
return this.dispatchDeleteEvent(), s;
|
|
1573
1577
|
throw s;
|
|
1574
1578
|
} catch (s) {
|
|
1575
|
-
throw n.log.error(s), this.dispatchErrorEvent(s, "delete"), s;
|
|
1579
|
+
throw n.make("log").error(s), this.dispatchErrorEvent(s, "delete"), s;
|
|
1576
1580
|
}
|
|
1577
1581
|
}
|
|
1578
1582
|
async update(s) {
|
|
1579
1583
|
try {
|
|
1580
|
-
const u = await n.route.call([
|
|
1584
|
+
const u = await n.make("route").call([
|
|
1581
1585
|
`luminix.${e}.update`,
|
|
1582
1586
|
this.makePrimaryKeyReplacer()
|
|
1583
1587
|
], {
|
|
@@ -1590,12 +1594,12 @@ function ze(n, e) {
|
|
|
1590
1594
|
}
|
|
1591
1595
|
throw u;
|
|
1592
1596
|
} catch (u) {
|
|
1593
|
-
throw n.log.error(u), this.dispatchErrorEvent(u, "save"), u;
|
|
1597
|
+
throw n.make("log").error(u), this.dispatchErrorEvent(u, "save"), u;
|
|
1594
1598
|
}
|
|
1595
1599
|
}
|
|
1596
1600
|
async forceDelete() {
|
|
1597
1601
|
try {
|
|
1598
|
-
const s = await n.route.call(
|
|
1602
|
+
const s = await n.make("route").call(
|
|
1599
1603
|
[
|
|
1600
1604
|
`luminix.${e}.destroy`,
|
|
1601
1605
|
this.makePrimaryKeyReplacer()
|
|
@@ -1609,12 +1613,12 @@ function ze(n, e) {
|
|
|
1609
1613
|
return this.dispatchDeleteEvent(!0), s;
|
|
1610
1614
|
throw s;
|
|
1611
1615
|
} catch (s) {
|
|
1612
|
-
throw n.log.error(s), this.dispatchErrorEvent(s, "forceDelete"), s;
|
|
1616
|
+
throw n.make("log").error(s), this.dispatchErrorEvent(s, "forceDelete"), s;
|
|
1613
1617
|
}
|
|
1614
1618
|
}
|
|
1615
1619
|
async restore() {
|
|
1616
1620
|
try {
|
|
1617
|
-
const s = await n.route.call(
|
|
1621
|
+
const s = await n.make("route").call(
|
|
1618
1622
|
[
|
|
1619
1623
|
`luminix.${e}.update`,
|
|
1620
1624
|
this.makePrimaryKeyReplacer()
|
|
@@ -1628,17 +1632,17 @@ function ze(n, e) {
|
|
|
1628
1632
|
return this.dispatchRestoreEvent(), s;
|
|
1629
1633
|
throw s;
|
|
1630
1634
|
} catch (s) {
|
|
1631
|
-
throw n.log.error(s), this.dispatchErrorEvent(s, "restore"), s;
|
|
1635
|
+
throw n.make("log").error(s), this.dispatchErrorEvent(s, "restore"), s;
|
|
1632
1636
|
}
|
|
1633
1637
|
}
|
|
1634
1638
|
static getSchemaName() {
|
|
1635
1639
|
return e;
|
|
1636
1640
|
}
|
|
1637
1641
|
static getSchema() {
|
|
1638
|
-
return n.model.schema(e);
|
|
1642
|
+
return n.make("model").schema(e);
|
|
1639
1643
|
}
|
|
1640
1644
|
static query() {
|
|
1641
|
-
return new
|
|
1645
|
+
return new He(n.make(), e);
|
|
1642
1646
|
}
|
|
1643
1647
|
static where(...s) {
|
|
1644
1648
|
return this.query().where(...s);
|
|
@@ -1677,130 +1681,122 @@ function ze(n, e) {
|
|
|
1677
1681
|
return this.query().first();
|
|
1678
1682
|
}
|
|
1679
1683
|
static async create(s) {
|
|
1680
|
-
const u = n.model.make(e), a = new u();
|
|
1684
|
+
const u = n.make("model").make(e), a = new u();
|
|
1681
1685
|
return a.fill(s), await a.save(), a;
|
|
1682
1686
|
}
|
|
1683
1687
|
static async update(s, u) {
|
|
1684
|
-
const a = n.model.make(e), l = new a({ id: s });
|
|
1688
|
+
const a = n.make("model").make(e), l = new a({ id: s });
|
|
1685
1689
|
return l.fill(u), l.exists = !0, await l.save(), l;
|
|
1686
1690
|
}
|
|
1687
1691
|
static delete(s) {
|
|
1688
1692
|
if (Array.isArray(s))
|
|
1689
|
-
return n.route.call(`luminix.${e}.destroyMany`, {
|
|
1693
|
+
return n.make("route").call(`luminix.${e}.destroyMany`, {
|
|
1690
1694
|
params: { ids: s },
|
|
1691
1695
|
errorBag: `${e}.deleteMany`
|
|
1692
1696
|
});
|
|
1693
|
-
const u = n.model.make(e);
|
|
1697
|
+
const u = n.make("model").make(e);
|
|
1694
1698
|
return new u({ id: s }).delete();
|
|
1695
1699
|
}
|
|
1696
1700
|
static async restore(s) {
|
|
1697
1701
|
if (Array.isArray(s))
|
|
1698
|
-
return n.route.call(`luminix.${e}.restoreMany`, {
|
|
1702
|
+
return n.make("route").call(`luminix.${e}.restoreMany`, {
|
|
1699
1703
|
data: { ids: s },
|
|
1700
1704
|
errorBag: `${e}.restoreMany`
|
|
1701
1705
|
});
|
|
1702
|
-
const u = n.model.make(e);
|
|
1706
|
+
const u = n.make("model").make(e);
|
|
1703
1707
|
return new u({ id: s }).restore();
|
|
1704
1708
|
}
|
|
1705
1709
|
static forceDelete(s) {
|
|
1706
1710
|
if (Array.isArray(s))
|
|
1707
|
-
return n.route.call(`luminix.${e}.destroyMany`, {
|
|
1711
|
+
return n.make("route").call(`luminix.${e}.destroyMany`, {
|
|
1708
1712
|
params: { ids: s, force: !0 },
|
|
1709
1713
|
errorBag: `${e}.forceDeleteMany`
|
|
1710
1714
|
});
|
|
1711
|
-
const u = n.model.make(e);
|
|
1715
|
+
const u = n.make("model").make(e);
|
|
1712
1716
|
return new u({ id: s }).forceDelete();
|
|
1713
1717
|
}
|
|
1714
1718
|
static singular() {
|
|
1715
|
-
return n.model.schema(e).displayName.singular;
|
|
1719
|
+
return n.make("model").schema(e).displayName.singular;
|
|
1716
1720
|
}
|
|
1717
1721
|
static plural() {
|
|
1718
|
-
return n.model.schema(e).displayName.plural;
|
|
1722
|
+
return n.make("model").schema(e).displayName.plural;
|
|
1719
1723
|
}
|
|
1720
1724
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1721
1725
|
on(s, u) {
|
|
1722
|
-
throw new
|
|
1726
|
+
throw new E();
|
|
1723
1727
|
}
|
|
1724
1728
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1725
1729
|
once(s, u) {
|
|
1726
|
-
throw new
|
|
1730
|
+
throw new E();
|
|
1727
1731
|
}
|
|
1728
1732
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1729
1733
|
emit(s, u) {
|
|
1730
|
-
throw new
|
|
1734
|
+
throw new E();
|
|
1731
1735
|
}
|
|
1732
1736
|
}
|
|
1733
|
-
return
|
|
1737
|
+
return p(t, "name", f.upperFirst(f.camelCase(e))), A(t);
|
|
1734
1738
|
}
|
|
1735
|
-
function
|
|
1739
|
+
function Xe(n, e, t) {
|
|
1736
1740
|
var r, i;
|
|
1737
1741
|
return class extends (i = t, r = Symbol.toStringTag, i) {
|
|
1738
1742
|
constructor(u = {}) {
|
|
1739
1743
|
super(u);
|
|
1740
|
-
|
|
1744
|
+
p(this, r, f.upperFirst(f.camelCase(e)));
|
|
1741
1745
|
return new Proxy(this, {
|
|
1742
1746
|
get: (a, l) => {
|
|
1743
1747
|
if (l === "__isModel")
|
|
1744
1748
|
return !0;
|
|
1745
|
-
if (l in a)
|
|
1746
|
-
|
|
1747
|
-
return typeof p == "function" ? p.bind(a) : p;
|
|
1748
|
-
}
|
|
1749
|
+
if (l in a)
|
|
1750
|
+
return Reflect.get(a, l);
|
|
1749
1751
|
if (l !== f.camelCase(l))
|
|
1750
1752
|
return;
|
|
1751
1753
|
const d = f.snakeCase(l);
|
|
1754
|
+
if (Object.keys(a.attributes).includes(d))
|
|
1755
|
+
return a.getAttribute(d);
|
|
1752
1756
|
if (Object.keys(a.relations).includes(d))
|
|
1753
1757
|
return a.relations[d].getLoadedItems();
|
|
1754
1758
|
if (l.endsWith("Relation") && Object.keys(a.relations).includes(f.snakeCase(l.slice(0, -8))))
|
|
1755
1759
|
return () => a.relation(l.slice(0, -8));
|
|
1756
|
-
if (Object.keys(a.attributes).includes(d))
|
|
1757
|
-
return a.getAttribute(d);
|
|
1758
1760
|
if (n.model.hasReducer(`model${a.constructor.name}Get${f.upperFirst(l)}Attribute`)) {
|
|
1759
|
-
const
|
|
1760
|
-
if (typeof
|
|
1761
|
-
throw new
|
|
1762
|
-
return
|
|
1761
|
+
const m = n.model[`model${a.constructor.name}Get${f.upperFirst(l)}Attribute`];
|
|
1762
|
+
if (typeof m != "function")
|
|
1763
|
+
throw new T("ModelFacade");
|
|
1764
|
+
return m.bind(n.model)(void 0, a);
|
|
1763
1765
|
}
|
|
1764
1766
|
return Reflect.get(a, l);
|
|
1765
1767
|
},
|
|
1766
|
-
set: (a, l, d) =>
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
return a.setAttribute(
|
|
1771
|
-
f.snakeCase(l),
|
|
1772
|
-
d
|
|
1773
|
-
), !0;
|
|
1774
|
-
throw new Ne(e, f.snakeCase(l));
|
|
1775
|
-
}
|
|
1768
|
+
set: (a, l, d) => l in a && typeof a[l] != "function" ? Reflect.set(a, l, d) : (a.setAttribute(
|
|
1769
|
+
f.snakeCase(l),
|
|
1770
|
+
d
|
|
1771
|
+
), !0)
|
|
1776
1772
|
});
|
|
1777
1773
|
}
|
|
1778
1774
|
};
|
|
1779
1775
|
}
|
|
1780
|
-
var
|
|
1781
|
-
class
|
|
1776
|
+
var me, pe;
|
|
1777
|
+
class Ye extends (pe = Error, me = Symbol.toStringTag, pe) {
|
|
1782
1778
|
constructor(t, r) {
|
|
1783
1779
|
super(`[Luminix] Cannot create reducer '${t}' on '${r}' as it is a reserved property`);
|
|
1784
|
-
|
|
1780
|
+
p(this, me, "ReducerOverrideException");
|
|
1785
1781
|
}
|
|
1786
1782
|
}
|
|
1787
|
-
function
|
|
1783
|
+
function Se(n) {
|
|
1788
1784
|
return class extends n {
|
|
1789
1785
|
constructor(...t) {
|
|
1790
1786
|
super(...t);
|
|
1791
|
-
|
|
1787
|
+
p(this, "reducers", {});
|
|
1792
1788
|
return new Proxy(this, {
|
|
1793
1789
|
get(r, i, s) {
|
|
1794
1790
|
return typeof i == "symbol" || i in r ? Reflect.get(r, i, s) : (u, ...a) => {
|
|
1795
1791
|
const { [i]: l = c() } = r.reducers;
|
|
1796
|
-
return
|
|
1792
|
+
return Pe(u) ? R(u, (d) => l.sortBy("priority").reduce((m, w) => w.callback(m, ...a), d)) : l.sortBy("priority").reduce((d, m) => m.callback(d, ...a), u);
|
|
1797
1793
|
};
|
|
1798
1794
|
}
|
|
1799
1795
|
});
|
|
1800
1796
|
}
|
|
1801
1797
|
reducer(t, r, i = 10) {
|
|
1802
1798
|
if (t in this)
|
|
1803
|
-
throw new
|
|
1799
|
+
throw new Ye(t, this);
|
|
1804
1800
|
return this.reducers[t] || (this.reducers[t] = c()), this.reducers[t].push({ callback: r, priority: i }), () => this.removeReducer(t, r);
|
|
1805
1801
|
}
|
|
1806
1802
|
removeReducer(t, r) {
|
|
@@ -1821,24 +1817,24 @@ function ve(n) {
|
|
|
1821
1817
|
}
|
|
1822
1818
|
};
|
|
1823
1819
|
}
|
|
1824
|
-
var
|
|
1825
|
-
class
|
|
1820
|
+
var ge, ye;
|
|
1821
|
+
class W extends (ye = Error, ge = Symbol.toStringTag, ye) {
|
|
1826
1822
|
constructor(t) {
|
|
1827
1823
|
super(`[Luminix] Model "${t}" not found`);
|
|
1828
|
-
|
|
1824
|
+
p(this, ge, "ModelNotFoundException");
|
|
1829
1825
|
}
|
|
1830
1826
|
}
|
|
1831
|
-
var
|
|
1832
|
-
class B extends (
|
|
1827
|
+
var we, be;
|
|
1828
|
+
class B extends (be = TypeError, we = Symbol.toStringTag, be) {
|
|
1833
1829
|
constructor(t, r, i) {
|
|
1834
1830
|
super(`[Luminix] "${t}" expects a related model of type "${r}". Received "${i}" instead.`);
|
|
1835
|
-
|
|
1831
|
+
p(this, we, "ModelInvalidRelatedTypeException");
|
|
1836
1832
|
}
|
|
1837
1833
|
}
|
|
1838
|
-
class
|
|
1834
|
+
class ve extends j {
|
|
1839
1835
|
constructor(e, t, r, i = null) {
|
|
1840
|
-
if (!
|
|
1841
|
-
throw new
|
|
1836
|
+
if (!x(i) && i !== null)
|
|
1837
|
+
throw new M("BelongsTo.constructor()", "Model or null");
|
|
1842
1838
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1843
1839
|
}
|
|
1844
1840
|
isSingle() {
|
|
@@ -1855,12 +1851,12 @@ class Be extends j {
|
|
|
1855
1851
|
return this.query().first();
|
|
1856
1852
|
}
|
|
1857
1853
|
async associate(e) {
|
|
1858
|
-
if (!
|
|
1859
|
-
throw new
|
|
1854
|
+
if (!x(e))
|
|
1855
|
+
throw new M("BelongsTo.associate()");
|
|
1860
1856
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
1861
1857
|
throw new B("BelongsTo.associate()", this.getRelated().getSchemaName(), e.getType());
|
|
1862
1858
|
if (!e.exists)
|
|
1863
|
-
throw new
|
|
1859
|
+
throw new Ae(this.getRelated().getSchemaName(), "save");
|
|
1864
1860
|
return this.parent.update({
|
|
1865
1861
|
[this.getForeignKey()]: e.getKey()
|
|
1866
1862
|
});
|
|
@@ -1871,10 +1867,10 @@ class Be extends j {
|
|
|
1871
1867
|
});
|
|
1872
1868
|
}
|
|
1873
1869
|
}
|
|
1874
|
-
class
|
|
1870
|
+
class Ne extends j {
|
|
1875
1871
|
constructor(e, t, r, i = null) {
|
|
1876
|
-
if (i !== null && !(i instanceof
|
|
1877
|
-
throw new
|
|
1872
|
+
if (i !== null && !(i instanceof Q && i.every(x)))
|
|
1873
|
+
throw new M("BelongsToMany.constructor()", "Collection<Model> or null");
|
|
1878
1874
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1879
1875
|
}
|
|
1880
1876
|
isSingle() {
|
|
@@ -1982,17 +1978,17 @@ class L extends j {
|
|
|
1982
1978
|
return e.where(t, this.parent.getKey()), e.lock(`where.${t}`), e;
|
|
1983
1979
|
}
|
|
1984
1980
|
async saveQuietly(e) {
|
|
1985
|
-
if (!
|
|
1986
|
-
throw new
|
|
1981
|
+
if (!x(e))
|
|
1982
|
+
throw new M("HasOneOrMany.saveQuietly()");
|
|
1987
1983
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
1988
1984
|
throw new B("HasOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), e.getType());
|
|
1989
1985
|
e.setAttribute(this.getForeignKey(), this.parent.getKey()), await e.save();
|
|
1990
1986
|
}
|
|
1991
1987
|
}
|
|
1992
|
-
class
|
|
1988
|
+
class Ze extends L {
|
|
1993
1989
|
constructor(e, t, r, i = null) {
|
|
1994
|
-
if (!
|
|
1995
|
-
throw new
|
|
1990
|
+
if (!x(i) && i !== null)
|
|
1991
|
+
throw new M("HasOne.constructor()", "Model or null");
|
|
1996
1992
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1997
1993
|
}
|
|
1998
1994
|
isSingle() {
|
|
@@ -2008,10 +2004,10 @@ class et extends L {
|
|
|
2008
2004
|
await this.saveQuietly(e), this.items = e;
|
|
2009
2005
|
}
|
|
2010
2006
|
}
|
|
2011
|
-
class
|
|
2007
|
+
class ze extends L {
|
|
2012
2008
|
constructor(e, t, r, i = null) {
|
|
2013
|
-
if (i !== null && !(i instanceof
|
|
2014
|
-
throw new
|
|
2009
|
+
if (i !== null && !(i instanceof Q && i.every(x)))
|
|
2010
|
+
throw new M("HasMany.constructor()", "Collection<Model> or null");
|
|
2015
2011
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2016
2012
|
}
|
|
2017
2013
|
isSingle() {
|
|
@@ -2033,8 +2029,8 @@ class tt extends L {
|
|
|
2033
2029
|
return this.query().find(e);
|
|
2034
2030
|
}
|
|
2035
2031
|
async saveManyQuietly(e) {
|
|
2036
|
-
if (!Array.isArray(e) || !e.every(
|
|
2037
|
-
throw new
|
|
2032
|
+
if (!Array.isArray(e) || !e.every(x))
|
|
2033
|
+
throw new M("HasMany.saveManyQuietly()", "Model[]");
|
|
2038
2034
|
if (!e.every((t) => t.getType() === this.getRelated().getSchemaName()))
|
|
2039
2035
|
throw new B("HasMany.saveManyQuietly()", this.getRelated().getSchemaName(), e.map((t) => t.getType()).join(", "));
|
|
2040
2036
|
await Promise.all(e.map((t) => (t.setAttribute(this.getForeignKey(), this.parent.getKey()), t.save())));
|
|
@@ -2048,7 +2044,7 @@ class tt extends L {
|
|
|
2048
2044
|
await this.saveQuietly(e), this.items === null ? this.items = await this.all() : this.items.push(e);
|
|
2049
2045
|
}
|
|
2050
2046
|
}
|
|
2051
|
-
class
|
|
2047
|
+
class Re extends L {
|
|
2052
2048
|
query() {
|
|
2053
2049
|
const e = this.getRelated().query();
|
|
2054
2050
|
e.once("success", (r) => {
|
|
@@ -2058,18 +2054,18 @@ class Ie extends L {
|
|
|
2058
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;
|
|
2059
2055
|
}
|
|
2060
2056
|
async saveQuietly(e) {
|
|
2061
|
-
if (!
|
|
2062
|
-
throw new
|
|
2057
|
+
if (!x(e))
|
|
2058
|
+
throw new M("MorphOneOrMany.saveQuietly()");
|
|
2063
2059
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
2064
2060
|
throw new B("MorphOneOrMany.saveQuietly()", this.getRelated().getSchemaName(), e.getType());
|
|
2065
2061
|
const t = this.guessInverseRelation();
|
|
2066
2062
|
e.setAttribute(t + "_id", this.parent.getKey()), e.setAttribute(t + "_type", this.parent.getType()), await e.save();
|
|
2067
2063
|
}
|
|
2068
2064
|
}
|
|
2069
|
-
class
|
|
2065
|
+
class Oe extends Re {
|
|
2070
2066
|
constructor(e, t, r, i = null) {
|
|
2071
|
-
if (i !== null && !(i instanceof
|
|
2072
|
-
throw new
|
|
2067
|
+
if (i !== null && !(i instanceof Q && i.every(x)))
|
|
2068
|
+
throw new M("MorphMany.constructor()", "Collection<Model> or null");
|
|
2073
2069
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2074
2070
|
}
|
|
2075
2071
|
isSingle() {
|
|
@@ -2091,8 +2087,8 @@ class rt extends Ie {
|
|
|
2091
2087
|
return this.query().find(e);
|
|
2092
2088
|
}
|
|
2093
2089
|
async saveManyQuietly(e) {
|
|
2094
|
-
if (!Array.isArray(e) || !e.every(
|
|
2095
|
-
throw new
|
|
2090
|
+
if (!Array.isArray(e) || !e.every(x))
|
|
2091
|
+
throw new M("MorphMany.saveManyQuietly()");
|
|
2096
2092
|
if (!e.every((t) => t.getType() === this.getRelated().getSchemaName()))
|
|
2097
2093
|
throw new B("MorphMany.saveManyQuietly()", this.getRelated().getSchemaName(), e.map((t) => t.getType()).join(", "));
|
|
2098
2094
|
await Promise.all(e.map((t) => (t.setAttribute(this.getName() + "_id", this.parent.getKey()), t.setAttribute(this.getName() + "_type", this.parent.getType()), t.save())));
|
|
@@ -2106,10 +2102,10 @@ class rt extends Ie {
|
|
|
2106
2102
|
this.items ? this.items.splice(0, this.items.count(), ...t) : this.items = t;
|
|
2107
2103
|
}
|
|
2108
2104
|
}
|
|
2109
|
-
class
|
|
2105
|
+
class et extends Re {
|
|
2110
2106
|
constructor(e, t, r, i = null) {
|
|
2111
|
-
if (super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !
|
|
2112
|
-
throw new
|
|
2107
|
+
if (super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i, i !== null && !x(i))
|
|
2108
|
+
throw new M("MorphOne.constructor()", "Model or null");
|
|
2113
2109
|
}
|
|
2114
2110
|
isSingle() {
|
|
2115
2111
|
return !0;
|
|
@@ -2124,7 +2120,7 @@ class st extends Ie {
|
|
|
2124
2120
|
await this.saveQuietly(e), this.items = e;
|
|
2125
2121
|
}
|
|
2126
2122
|
}
|
|
2127
|
-
class
|
|
2123
|
+
class tt extends ve {
|
|
2128
2124
|
getRelated() {
|
|
2129
2125
|
return this.facades.model.make(
|
|
2130
2126
|
this.parent.getAttribute(this.getName() + "_type")
|
|
@@ -2139,8 +2135,8 @@ class it extends Be {
|
|
|
2139
2135
|
// return super.query();
|
|
2140
2136
|
// }
|
|
2141
2137
|
async associate(e) {
|
|
2142
|
-
if (!
|
|
2143
|
-
throw new
|
|
2138
|
+
if (!x(e))
|
|
2139
|
+
throw new M("MorphTo.associate()");
|
|
2144
2140
|
return e.exists || await e.save(), this.parent.update({
|
|
2145
2141
|
[this.getName() + "_id"]: e.getKey(),
|
|
2146
2142
|
[this.getName() + "_type"]: e.getType()
|
|
@@ -2153,7 +2149,7 @@ class it extends Be {
|
|
|
2153
2149
|
});
|
|
2154
2150
|
}
|
|
2155
2151
|
}
|
|
2156
|
-
class
|
|
2152
|
+
class rt extends Ne {
|
|
2157
2153
|
constructor(e, t, r, i = null) {
|
|
2158
2154
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2159
2155
|
}
|
|
@@ -2162,43 +2158,43 @@ class nt extends qe {
|
|
|
2162
2158
|
return e.where(t + "_id", this.parent.getKey()), e.where(t + "_type", this.parent.getType()), e.lock(`where.${t}_id`), e.lock(`where.${t}_type`), e;
|
|
2163
2159
|
}
|
|
2164
2160
|
}
|
|
2165
|
-
var
|
|
2166
|
-
|
|
2167
|
-
class
|
|
2161
|
+
var Ee;
|
|
2162
|
+
Ee = Symbol.toStringTag;
|
|
2163
|
+
class st {
|
|
2168
2164
|
constructor(e) {
|
|
2169
|
-
|
|
2170
|
-
|
|
2165
|
+
p(this, "_models", {});
|
|
2166
|
+
p(this, Ee, "ModelFacade");
|
|
2171
2167
|
this._schema = e;
|
|
2172
2168
|
}
|
|
2173
2169
|
boot(e) {
|
|
2174
2170
|
this._schema && (Object.keys(this._schema).forEach((t) => {
|
|
2175
2171
|
const r = this[`model${f.upperFirst(f.camelCase(t))}`];
|
|
2176
2172
|
if (typeof this.model != "function" || typeof r != "function")
|
|
2177
|
-
throw new
|
|
2173
|
+
throw new T("ModelFacade");
|
|
2178
2174
|
const i = this.model(
|
|
2179
|
-
|
|
2175
|
+
Ve(e, t),
|
|
2180
2176
|
t
|
|
2181
2177
|
), s = r(i);
|
|
2182
|
-
this._models[t] =
|
|
2178
|
+
this._models[t] = Xe(e.make(), t, s);
|
|
2183
2179
|
}), this.reducer("relationMap", () => ({
|
|
2184
|
-
BelongsTo:
|
|
2185
|
-
BelongsToMany:
|
|
2186
|
-
HasOne:
|
|
2187
|
-
HasMany:
|
|
2188
|
-
MorphMany:
|
|
2189
|
-
MorphOne:
|
|
2190
|
-
MorphTo:
|
|
2191
|
-
MorphToMany:
|
|
2180
|
+
BelongsTo: ve,
|
|
2181
|
+
BelongsToMany: Ne,
|
|
2182
|
+
HasOne: Ze,
|
|
2183
|
+
HasMany: ze,
|
|
2184
|
+
MorphMany: Oe,
|
|
2185
|
+
MorphOne: et,
|
|
2186
|
+
MorphTo: tt,
|
|
2187
|
+
MorphToMany: rt
|
|
2192
2188
|
}), 0));
|
|
2193
2189
|
}
|
|
2194
2190
|
schema(e) {
|
|
2195
2191
|
if (!this._schema || e && !this._schema[e])
|
|
2196
|
-
throw new
|
|
2192
|
+
throw new W(e || "undefined");
|
|
2197
2193
|
return e ? this._schema[e] : this._schema;
|
|
2198
2194
|
}
|
|
2199
2195
|
make(e) {
|
|
2200
2196
|
if (e && !this._models[e])
|
|
2201
|
-
throw new
|
|
2197
|
+
throw new W(e);
|
|
2202
2198
|
return e ? this._models[e] : this._models;
|
|
2203
2199
|
}
|
|
2204
2200
|
toString() {
|
|
@@ -2206,68 +2202,68 @@ class ot {
|
|
|
2206
2202
|
}
|
|
2207
2203
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2208
2204
|
on(e, t) {
|
|
2209
|
-
throw new
|
|
2205
|
+
throw new E();
|
|
2210
2206
|
}
|
|
2211
2207
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2212
2208
|
once(e, t) {
|
|
2213
|
-
throw new
|
|
2209
|
+
throw new E();
|
|
2214
2210
|
}
|
|
2215
2211
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2216
2212
|
emit(e, t) {
|
|
2217
|
-
throw new
|
|
2213
|
+
throw new E();
|
|
2218
2214
|
}
|
|
2219
2215
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2220
2216
|
reducer(e, t, r) {
|
|
2221
|
-
throw new
|
|
2217
|
+
throw new E();
|
|
2222
2218
|
}
|
|
2223
2219
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2224
2220
|
removeReducer(e) {
|
|
2225
|
-
throw new
|
|
2221
|
+
throw new E();
|
|
2226
2222
|
}
|
|
2227
2223
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2228
2224
|
getReducer(e) {
|
|
2229
|
-
throw new
|
|
2225
|
+
throw new E();
|
|
2230
2226
|
}
|
|
2231
2227
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2232
2228
|
hasReducer(e) {
|
|
2233
|
-
throw new
|
|
2229
|
+
throw new E();
|
|
2234
2230
|
}
|
|
2235
2231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2236
2232
|
clearReducer(e) {
|
|
2237
|
-
throw new
|
|
2233
|
+
throw new E();
|
|
2238
2234
|
}
|
|
2239
2235
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2240
2236
|
flushReducers() {
|
|
2241
|
-
throw new
|
|
2237
|
+
throw new E();
|
|
2242
2238
|
}
|
|
2243
2239
|
}
|
|
2244
|
-
const
|
|
2245
|
-
var
|
|
2246
|
-
class
|
|
2240
|
+
const it = A(Se(st));
|
|
2241
|
+
var xe, Me;
|
|
2242
|
+
class nt extends (Me = Error, xe = Symbol.toStringTag, Me) {
|
|
2247
2243
|
constructor() {
|
|
2248
2244
|
super("[Luminix] Embed element not found. Make sure to include the `@luminixEmbed()` directive in your Blade template.");
|
|
2249
|
-
|
|
2245
|
+
p(this, xe, "NoEmbedException");
|
|
2250
2246
|
}
|
|
2251
2247
|
}
|
|
2252
|
-
const
|
|
2248
|
+
const Be = (n, e = "data") => {
|
|
2253
2249
|
if (!document.querySelector("#luminix-embed"))
|
|
2254
|
-
throw new
|
|
2250
|
+
throw new nt();
|
|
2255
2251
|
const t = document.getElementById(`luminix-${e}::` + n);
|
|
2256
2252
|
return t ? t.dataset.json && t.dataset.value ? JSON.parse(t.dataset.value) : t.dataset.value : null;
|
|
2257
|
-
},
|
|
2258
|
-
let
|
|
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
|
+
let ht = class {
|
|
2259
2255
|
constructor() {
|
|
2260
|
-
|
|
2256
|
+
p(this, "bags");
|
|
2261
2257
|
const e = {};
|
|
2262
2258
|
document.querySelectorAll('#luminix-embed [id^="luminix-error"]').forEach((r) => {
|
|
2263
2259
|
const s = r.id.replace("luminix-error::", "");
|
|
2264
|
-
e[s] =
|
|
2260
|
+
e[s] = Be(s, "error");
|
|
2265
2261
|
}), this.bags = {
|
|
2266
|
-
default: new
|
|
2262
|
+
default: new G(e)
|
|
2267
2263
|
};
|
|
2268
2264
|
}
|
|
2269
2265
|
bag(e = "default") {
|
|
2270
|
-
return this.bags[e] || (this.bags[e] = new
|
|
2266
|
+
return this.bags[e] || (this.bags[e] = new G({})), this.bags[e];
|
|
2271
2267
|
}
|
|
2272
2268
|
add(e, t, r = "default") {
|
|
2273
2269
|
this.bag(r).set(e, t);
|
|
@@ -2285,14 +2281,14 @@ let lt = class {
|
|
|
2285
2281
|
this.bag(e).set(".", {});
|
|
2286
2282
|
}
|
|
2287
2283
|
};
|
|
2288
|
-
var
|
|
2289
|
-
class
|
|
2284
|
+
var _e, Te;
|
|
2285
|
+
class ut extends (Te = Error, _e = Symbol.toStringTag, Te) {
|
|
2290
2286
|
constructor(t) {
|
|
2291
2287
|
super(`[Luminix] Route "${t}" not found`);
|
|
2292
|
-
|
|
2288
|
+
p(this, _e, "RouteNotFoundException");
|
|
2293
2289
|
}
|
|
2294
2290
|
}
|
|
2295
|
-
class
|
|
2291
|
+
class at {
|
|
2296
2292
|
constructor(e, t, r = "") {
|
|
2297
2293
|
this.routes = e, this.error = t, this.appUrl = r;
|
|
2298
2294
|
}
|
|
@@ -2311,23 +2307,23 @@ class dt {
|
|
|
2311
2307
|
}
|
|
2312
2308
|
get(e) {
|
|
2313
2309
|
if (!this.exists(e))
|
|
2314
|
-
throw new
|
|
2310
|
+
throw new ut(e);
|
|
2315
2311
|
return f.get(this.routes, e);
|
|
2316
2312
|
}
|
|
2317
2313
|
url(e) {
|
|
2318
2314
|
const [t, r] = this.extractGenerator(e), i = this.get(t)[0].replace(/^\/|\/$/g, ""), s = /{([^}]+)}/g;
|
|
2319
2315
|
if (r === !1) {
|
|
2320
2316
|
if (typeof this.replaceRouteParams != "function")
|
|
2321
|
-
throw new
|
|
2317
|
+
throw new T("RouteFacade");
|
|
2322
2318
|
return this.appUrl + this.replaceRouteParams(`/${i}`);
|
|
2323
2319
|
}
|
|
2324
|
-
const u = i.match(s), a = u ? u.map((
|
|
2320
|
+
const u = i.match(s), a = u ? u.map((b) => b.slice(1, -1)) : [], l = Object.keys(r), d = a.filter((b) => !l.includes(b)), m = l.filter((b) => !a.includes(b));
|
|
2325
2321
|
if (d.length > 0)
|
|
2326
2322
|
throw new TypeError(`Missing values for parameter(s): ${d.join(", ")}`);
|
|
2327
|
-
if (
|
|
2328
|
-
throw new TypeError(`Unexpected parameters: ${
|
|
2329
|
-
const
|
|
2330
|
-
return this.appUrl + `/${
|
|
2323
|
+
if (m.length > 0)
|
|
2324
|
+
throw new TypeError(`Unexpected parameters: ${m.join(", ")}`);
|
|
2325
|
+
const w = a.reduce((b, g) => b.replace(`{${g}}`, `${r[g]}`), i);
|
|
2326
|
+
return this.appUrl + `/${w}`;
|
|
2331
2327
|
}
|
|
2332
2328
|
methods(e) {
|
|
2333
2329
|
const [t] = this.extractGenerator(e);
|
|
@@ -2338,37 +2334,37 @@ class dt {
|
|
|
2338
2334
|
}
|
|
2339
2335
|
async call(e, t = {}) {
|
|
2340
2336
|
if (typeof this.axiosOptions != "function" || typeof this.axiosError != "function")
|
|
2341
|
-
throw new
|
|
2342
|
-
const [r, i] = this.extractGenerator(e), [, ...s] = this.get(r), u = this.url(i ? [r, i] : r), a = this.axiosOptions(t, r), { method: l = s[0], errorBag: d = "route.call", ...
|
|
2337
|
+
throw new T("RouteFacade");
|
|
2338
|
+
const [r, i] = this.extractGenerator(e), [, ...s] = this.get(r), u = this.url(i ? [r, i] : r), a = this.axiosOptions(t, r), { method: l = s[0], errorBag: d = "route.call", ...m } = a, { data: w, ...b } = m;
|
|
2343
2339
|
this.error.clear(d);
|
|
2344
2340
|
try {
|
|
2345
|
-
return ["get", "delete"].includes(l) ? await K[l](u,
|
|
2346
|
-
} catch (
|
|
2347
|
-
if (
|
|
2348
|
-
const { errors:
|
|
2349
|
-
this.error.set(Object.entries(
|
|
2350
|
-
} else K.isAxiosError(
|
|
2351
|
-
this.axiosError({ axios:
|
|
2352
|
-
error:
|
|
2341
|
+
return ["get", "delete"].includes(l) ? await K[l](u, m) : await K[l](u, w, b);
|
|
2342
|
+
} catch (g) {
|
|
2343
|
+
if (ot(g)) {
|
|
2344
|
+
const { errors: qe } = g.response.data;
|
|
2345
|
+
this.error.set(Object.entries(qe).reduce((C, [Ie, Ke]) => (C[Ie] = Ke.join(" "), C), {}));
|
|
2346
|
+
} else K.isAxiosError(g) && this.error.set(
|
|
2347
|
+
this.axiosError({ axios: g.message }, {
|
|
2348
|
+
error: g,
|
|
2353
2349
|
name: r,
|
|
2354
2350
|
replace: i,
|
|
2355
2351
|
config: t
|
|
2356
2352
|
}),
|
|
2357
2353
|
d
|
|
2358
2354
|
);
|
|
2359
|
-
throw
|
|
2355
|
+
throw g;
|
|
2360
2356
|
}
|
|
2361
2357
|
}
|
|
2362
2358
|
toString() {
|
|
2363
2359
|
return "route";
|
|
2364
2360
|
}
|
|
2365
2361
|
}
|
|
2366
|
-
const
|
|
2367
|
-
class
|
|
2362
|
+
const lt = Se(at);
|
|
2363
|
+
class ct {
|
|
2368
2364
|
constructor() {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2365
|
+
p(this, "facades", {});
|
|
2366
|
+
p(this, "booted", !1);
|
|
2367
|
+
p(this, "_plugins", []);
|
|
2372
2368
|
}
|
|
2373
2369
|
make(e = void 0) {
|
|
2374
2370
|
if (!e)
|
|
@@ -2386,32 +2382,36 @@ class pt {
|
|
|
2386
2382
|
return this._plugins;
|
|
2387
2383
|
}
|
|
2388
2384
|
async boot(e = {}) {
|
|
2389
|
-
var a, l, d,
|
|
2385
|
+
var a, l, d, m, w, b;
|
|
2390
2386
|
if (this.booted)
|
|
2391
2387
|
throw new window.Error("[Luminix] App already booted");
|
|
2392
2388
|
this.booted = !0, (a = e.app) != null && a.debug && console.log("[Luminix] Booting started..."), this.emit("init", {
|
|
2393
|
-
register: (
|
|
2394
|
-
this._plugins.push(
|
|
2389
|
+
register: (g) => {
|
|
2390
|
+
this._plugins.push(g), typeof g.register == "function" && g.register(this);
|
|
2395
2391
|
}
|
|
2396
2392
|
});
|
|
2397
2393
|
const t = (((l = e.app) == null ? void 0 : l.url) ?? "") + (((d = e.app) == null ? void 0 : d.bootUrl) ?? "/luminix-api/init");
|
|
2398
|
-
if (
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2394
|
+
if (document.getElementById("luminix-data::config")) {
|
|
2395
|
+
if (document.getElementById("luminix-data::config")) {
|
|
2396
|
+
const g = Be("config");
|
|
2397
|
+
g && typeof g == "object" && f.merge(e, g);
|
|
2398
|
+
}
|
|
2399
|
+
} else try {
|
|
2400
|
+
const { data: g } = await K.get(t);
|
|
2401
|
+
g && typeof g == "object" && f.merge(e, g);
|
|
2402
|
+
} catch (g) {
|
|
2403
|
+
(m = e.app) != null && m.debug && console.error(g);
|
|
2404
|
+
}
|
|
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
|
|
2411
|
-
for (const
|
|
2412
|
-
typeof
|
|
2413
|
-
for (const
|
|
2414
|
-
typeof
|
|
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, ((b = e.app) == null ? void 0 : b.url) ?? "")), this.bind("model", new it(s)), this.bind("auth", new Le(this)), this.emit("booting");
|
|
2411
|
+
for (const g of Object.values(this.facades))
|
|
2412
|
+
typeof g == "object" && g !== null && "boot" in g && typeof g.boot == "function" && g.boot(this);
|
|
2413
|
+
for (const g of this._plugins)
|
|
2414
|
+
typeof g.boot == "function" && g.boot(this.facades);
|
|
2415
2415
|
return r.info("[Luminix] App boot completed", {
|
|
2416
2416
|
config: this.facades.config.all(),
|
|
2417
2417
|
plugins: this._plugins,
|
|
@@ -2421,6 +2421,23 @@ class pt {
|
|
|
2421
2421
|
}
|
|
2422
2422
|
}), this.emit("booted"), this.facades;
|
|
2423
2423
|
}
|
|
2424
|
+
environment(...e) {
|
|
2425
|
+
return e.length > 0 ? e.includes(this.facades.config.get("app.env", "production")) : this.facades.config.get("app.env", "production");
|
|
2426
|
+
}
|
|
2427
|
+
getPlugin(e) {
|
|
2428
|
+
for (const t of this._plugins)
|
|
2429
|
+
if (t instanceof e)
|
|
2430
|
+
return t;
|
|
2431
|
+
}
|
|
2432
|
+
hasDebugModeEnabled() {
|
|
2433
|
+
return this.facades.config.get("app.debug", !1);
|
|
2434
|
+
}
|
|
2435
|
+
isLocal() {
|
|
2436
|
+
return this.facades.config.get("app.env", "production") === "local";
|
|
2437
|
+
}
|
|
2438
|
+
isProduction() {
|
|
2439
|
+
return this.facades.config.get("app.env", "production") === "production";
|
|
2440
|
+
}
|
|
2424
2441
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2425
2442
|
on(e, t) {
|
|
2426
2443
|
throw new window.Error("Method not implemented.");
|
|
@@ -2434,49 +2451,54 @@ class pt {
|
|
|
2434
2451
|
throw new window.Error("Method not implemented.");
|
|
2435
2452
|
}
|
|
2436
2453
|
}
|
|
2437
|
-
const
|
|
2438
|
-
let
|
|
2439
|
-
function
|
|
2440
|
-
if (
|
|
2454
|
+
const dt = A(ct);
|
|
2455
|
+
let y;
|
|
2456
|
+
function v(n = void 0) {
|
|
2457
|
+
if (y || (y = new dt()), typeof n != "string")
|
|
2441
2458
|
return {
|
|
2442
|
-
boot:
|
|
2443
|
-
make:
|
|
2444
|
-
plugins:
|
|
2445
|
-
on:
|
|
2459
|
+
boot: y.boot.bind(y),
|
|
2460
|
+
make: y.make.bind(y),
|
|
2461
|
+
plugins: y.plugins.bind(y),
|
|
2462
|
+
on: y.once.bind(y),
|
|
2463
|
+
environment: y.environment.bind(y),
|
|
2464
|
+
getPlugin: y.getPlugin.bind(y),
|
|
2465
|
+
hasDebugModeEnabled: y.hasDebugModeEnabled.bind(y),
|
|
2466
|
+
isLocal: y.isLocal.bind(y),
|
|
2467
|
+
isProduction: y.isProduction.bind(y)
|
|
2446
2468
|
};
|
|
2447
|
-
if (!
|
|
2448
|
-
throw new
|
|
2449
|
-
return
|
|
2469
|
+
if (!y.has(n))
|
|
2470
|
+
throw new Qe(n);
|
|
2471
|
+
return y.make(n);
|
|
2450
2472
|
}
|
|
2451
|
-
function
|
|
2452
|
-
return
|
|
2473
|
+
function bt() {
|
|
2474
|
+
return v("auth");
|
|
2453
2475
|
}
|
|
2454
|
-
function
|
|
2476
|
+
function Et(n) {
|
|
2455
2477
|
return c(n);
|
|
2456
2478
|
}
|
|
2457
|
-
function
|
|
2458
|
-
const t =
|
|
2479
|
+
function xt(n, e) {
|
|
2480
|
+
const t = v("config");
|
|
2459
2481
|
return typeof n > "u" ? t : t.get(n, e);
|
|
2460
2482
|
}
|
|
2461
|
-
function
|
|
2462
|
-
return n ?
|
|
2483
|
+
function Mt(n, e = "default") {
|
|
2484
|
+
return n ? v().make("error").get(n, e) : v().make("error");
|
|
2463
2485
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const e =
|
|
2486
|
+
function _t(...n) {
|
|
2487
|
+
const e = v("log");
|
|
2466
2488
|
return n.length ? e.debug(...n) : e;
|
|
2467
2489
|
}
|
|
2468
|
-
function
|
|
2469
|
-
const e =
|
|
2490
|
+
function Tt(n) {
|
|
2491
|
+
const e = v("model");
|
|
2470
2492
|
return n ? e.make(n) : e;
|
|
2471
2493
|
}
|
|
2472
|
-
function
|
|
2473
|
-
const t =
|
|
2494
|
+
function $t(n, e = !1) {
|
|
2495
|
+
const t = v("route");
|
|
2474
2496
|
return n ? e ? t.url([n, e]) : t.url(n) : t;
|
|
2475
2497
|
}
|
|
2476
|
-
class
|
|
2498
|
+
class At {
|
|
2477
2499
|
constructor() {
|
|
2478
|
-
|
|
2479
|
-
|
|
2500
|
+
p(this, "name");
|
|
2501
|
+
p(this, "version");
|
|
2480
2502
|
}
|
|
2481
2503
|
register(e) {
|
|
2482
2504
|
}
|
|
@@ -2484,19 +2506,19 @@ class Rt {
|
|
|
2484
2506
|
}
|
|
2485
2507
|
}
|
|
2486
2508
|
export {
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2509
|
+
A as HasEvents,
|
|
2510
|
+
At as Plugin,
|
|
2511
|
+
S as PropertyBag,
|
|
2512
|
+
Se as Reducible,
|
|
2513
|
+
v as app,
|
|
2514
|
+
bt as auth,
|
|
2515
|
+
Et as collect,
|
|
2516
|
+
xt as config,
|
|
2517
|
+
Mt as error,
|
|
2496
2518
|
$ as isCollection,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2519
|
+
x as isModel,
|
|
2520
|
+
ot as isValidationError,
|
|
2521
|
+
_t as log,
|
|
2522
|
+
Tt as model,
|
|
2523
|
+
$t as route
|
|
2502
2524
|
};
|