@luminix/core 0.0.1-beta.14 → 0.0.1-beta.16
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/core.js +62 -67
- package/dist/facades/App.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/types/App.d.ts +1 -0
- package/dist/types/Model.d.ts +0 -2
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var Ke = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var C = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var je = (n, e, t) => e in n ? Ke(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
-
var m = (n, e, t) => je(n, typeof e != "symbol" ? e + "" : e, t), K = (n, e, t) => e.has(n) ||
|
|
7
|
-
var h = (n, e, t) => (K(n, e, "read from private field"), t ? t.call(n) : e.get(n)), j = (n, e, t) => e.has(n) ?
|
|
6
|
+
var m = (n, e, t) => je(n, typeof e != "symbol" ? e + "" : e, t), K = (n, e, t) => e.has(n) || C("Cannot " + t);
|
|
7
|
+
var h = (n, e, t) => (K(n, e, "read from private field"), t ? t.call(n) : e.get(n)), j = (n, e, t) => e.has(n) ? C("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), D = (n, e, t, r) => (K(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), U = (n, e, t) => (K(n, e, "access private method"), t);
|
|
8
8
|
import d from "lodash";
|
|
9
9
|
import { produce as N, isDraftable as Pe } from "immer";
|
|
10
|
-
import I, { isAxiosError as
|
|
10
|
+
import I, { isAxiosError as Le } from "axios";
|
|
11
11
|
var V, X;
|
|
12
|
-
class
|
|
12
|
+
class ke extends (X = Error, V = Symbol.toStringTag, X) {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
super(`[Luminix] Facade "${t}" not found`);
|
|
15
15
|
m(this, V, "FacadeNotFoundException");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class Qe {
|
|
19
19
|
constructor(e) {
|
|
20
20
|
m(this, "_user");
|
|
21
21
|
this.app = e;
|
|
@@ -64,7 +64,7 @@ class Ce {
|
|
|
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,7 +93,7 @@ class Le {
|
|
|
93
93
|
this._debug && console.debug(...e);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class R {
|
|
97
97
|
constructor(e) {
|
|
98
98
|
m(this, "locked", []);
|
|
99
99
|
this.bag = e, Object.freeze(this.bag);
|
|
@@ -172,7 +172,7 @@ class A {
|
|
|
172
172
|
this.locked.push(e);
|
|
173
173
|
}
|
|
174
174
|
clone() {
|
|
175
|
-
return new
|
|
175
|
+
return new R(this.bag);
|
|
176
176
|
}
|
|
177
177
|
all() {
|
|
178
178
|
return this.bag;
|
|
@@ -191,7 +191,7 @@ class A {
|
|
|
191
191
|
emit(e, t) {
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function S(n) {
|
|
195
195
|
var e, t, r, $e, s;
|
|
196
196
|
return s = class extends (t = n, e = Symbol.toStringTag, t) {
|
|
197
197
|
constructor(...a) {
|
|
@@ -260,7 +260,7 @@ class b extends (Z = Error, Y = Symbol.toStringTag, Z) {
|
|
|
260
260
|
function c(n = [], e = P) {
|
|
261
261
|
if (!Array.isArray(n))
|
|
262
262
|
throw new TypeError("collect() expects an array");
|
|
263
|
-
return new (
|
|
263
|
+
return new (S(e))([...n]);
|
|
264
264
|
}
|
|
265
265
|
const _ = (n) => {
|
|
266
266
|
n.emit("change", {
|
|
@@ -808,11 +808,13 @@ class P {
|
|
|
808
808
|
}
|
|
809
809
|
unique(e) {
|
|
810
810
|
return c(
|
|
811
|
-
typeof e == "string" ? [...new Set(h(this, o).map((t) => t[e]))].map((t) => h(this, o).find((r) => r[e]
|
|
811
|
+
typeof e == "string" ? [...new Set(h(this, o).map((t) => t[e]))].map((t) => h(this, o).find((r) => r[e] == t)) : [...new Set(h(this, o))]
|
|
812
812
|
);
|
|
813
813
|
}
|
|
814
814
|
uniqueStrict(e) {
|
|
815
|
-
return c(
|
|
815
|
+
return c(
|
|
816
|
+
typeof e == "string" ? [...new Set(h(this, o).map((t) => t[e]))].map((t) => h(this, o).find((r) => r[e] === t)) : [...new Set(h(this, o))]
|
|
817
|
+
);
|
|
816
818
|
}
|
|
817
819
|
unless(e, t, r) {
|
|
818
820
|
return e ? typeof r == "function" && r(this) : t(this), this;
|
|
@@ -916,7 +918,7 @@ class P {
|
|
|
916
918
|
}
|
|
917
919
|
}
|
|
918
920
|
o = new WeakMap();
|
|
919
|
-
const
|
|
921
|
+
const L = S(P);
|
|
920
922
|
var ee, te;
|
|
921
923
|
class H extends (te = P, ee = Symbol.toStringTag, te) {
|
|
922
924
|
constructor() {
|
|
@@ -943,7 +945,7 @@ class De extends (se = Error, re = Symbol.toStringTag, se) {
|
|
|
943
945
|
m(this, re, "ModelWithoutPrimaryKeyException");
|
|
944
946
|
}
|
|
945
947
|
}
|
|
946
|
-
const Ue = R
|
|
948
|
+
const Ue = S(R);
|
|
947
949
|
class Je {
|
|
948
950
|
constructor(e, t, r = {}) {
|
|
949
951
|
m(this, "bag");
|
|
@@ -1120,7 +1122,7 @@ class Je {
|
|
|
1120
1122
|
}), u;
|
|
1121
1123
|
}
|
|
1122
1124
|
}
|
|
1123
|
-
const He =
|
|
1125
|
+
const He = S(Je);
|
|
1124
1126
|
var ie, ne;
|
|
1125
1127
|
class T extends (ne = Error, ie = Symbol.toStringTag, ne) {
|
|
1126
1128
|
constructor(t) {
|
|
@@ -1280,7 +1282,7 @@ class F {
|
|
|
1280
1282
|
// }
|
|
1281
1283
|
}
|
|
1282
1284
|
var de, fe;
|
|
1283
|
-
class
|
|
1285
|
+
class Se extends (fe = Error, de = Symbol.toStringTag, fe) {
|
|
1284
1286
|
constructor(t, r) {
|
|
1285
1287
|
super(`[Luminix] Model "${t}" must be persisted before calling "${r}"`);
|
|
1286
1288
|
m(this, de, "ModelNotPersistedException");
|
|
@@ -1291,7 +1293,7 @@ function Ve(n, e) {
|
|
|
1291
1293
|
r = Symbol.toStringTag;
|
|
1292
1294
|
class t {
|
|
1293
1295
|
constructor(s = {}) {
|
|
1294
|
-
m(this, "_attributes", new
|
|
1296
|
+
m(this, "_attributes", new R({}));
|
|
1295
1297
|
m(this, "_original", {});
|
|
1296
1298
|
m(this, "_relations", {});
|
|
1297
1299
|
m(this, "_changedKeys", []);
|
|
@@ -1546,18 +1548,6 @@ function Ve(n, e) {
|
|
|
1546
1548
|
this.makePrimaryKeyReplacer()
|
|
1547
1549
|
];
|
|
1548
1550
|
}
|
|
1549
|
-
getRouteForRestore() {
|
|
1550
|
-
return [
|
|
1551
|
-
`luminix.${e}.restore`,
|
|
1552
|
-
this.makePrimaryKeyReplacer()
|
|
1553
|
-
];
|
|
1554
|
-
}
|
|
1555
|
-
getRouteForForceDelete() {
|
|
1556
|
-
return [
|
|
1557
|
-
`luminix.${e}.forceDelete`,
|
|
1558
|
-
this.makePrimaryKeyReplacer()
|
|
1559
|
-
];
|
|
1560
|
-
}
|
|
1561
1551
|
getRouteForRefresh() {
|
|
1562
1552
|
return [
|
|
1563
1553
|
`luminix.${e}.show`,
|
|
@@ -1570,7 +1560,7 @@ function Ve(n, e) {
|
|
|
1570
1560
|
}
|
|
1571
1561
|
async refresh() {
|
|
1572
1562
|
if (!this.exists)
|
|
1573
|
-
throw new
|
|
1563
|
+
throw new Se(e, "refresh");
|
|
1574
1564
|
const { data: s } = await n.make("route").call(
|
|
1575
1565
|
this.getRouteForRefresh(),
|
|
1576
1566
|
{ errorBag: this.getErrorBag("fetch") }
|
|
@@ -1642,7 +1632,7 @@ function Ve(n, e) {
|
|
|
1642
1632
|
async forceDelete() {
|
|
1643
1633
|
try {
|
|
1644
1634
|
const s = await n.make("route").call(
|
|
1645
|
-
this.
|
|
1635
|
+
this.getRouteForDelete(),
|
|
1646
1636
|
{
|
|
1647
1637
|
params: { force: !0 },
|
|
1648
1638
|
errorBag: this.getErrorBag("forceDelete")
|
|
@@ -1658,7 +1648,7 @@ function Ve(n, e) {
|
|
|
1658
1648
|
async restore() {
|
|
1659
1649
|
try {
|
|
1660
1650
|
const s = await n.make("route").call(
|
|
1661
|
-
this.
|
|
1651
|
+
this.getRouteForUpdate(),
|
|
1662
1652
|
{
|
|
1663
1653
|
params: { restore: !0 },
|
|
1664
1654
|
errorBag: this.getErrorBag("restore")
|
|
@@ -1770,7 +1760,7 @@ function Ve(n, e) {
|
|
|
1770
1760
|
throw new b();
|
|
1771
1761
|
}
|
|
1772
1762
|
}
|
|
1773
|
-
return m(t, "name", d.upperFirst(d.camelCase(e))),
|
|
1763
|
+
return m(t, "name", d.upperFirst(d.camelCase(e))), S(t);
|
|
1774
1764
|
}
|
|
1775
1765
|
function Xe(n, e, t) {
|
|
1776
1766
|
var r, i;
|
|
@@ -1816,7 +1806,7 @@ class Ye extends (pe = Error, me = Symbol.toStringTag, pe) {
|
|
|
1816
1806
|
m(this, me, "ReducerOverrideException");
|
|
1817
1807
|
}
|
|
1818
1808
|
}
|
|
1819
|
-
function
|
|
1809
|
+
function Ae(n) {
|
|
1820
1810
|
return class extends n {
|
|
1821
1811
|
constructor(...t) {
|
|
1822
1812
|
super(...t);
|
|
@@ -1867,7 +1857,7 @@ class B extends (be = TypeError, we = Symbol.toStringTag, be) {
|
|
|
1867
1857
|
m(this, we, "ModelInvalidRelatedTypeException");
|
|
1868
1858
|
}
|
|
1869
1859
|
}
|
|
1870
|
-
class
|
|
1860
|
+
class Re extends F {
|
|
1871
1861
|
constructor(e, t, r, i = null) {
|
|
1872
1862
|
if (!E(i) && i !== null)
|
|
1873
1863
|
throw new M("BelongsTo.constructor()", "Model or null");
|
|
@@ -1892,7 +1882,7 @@ class Ae extends F {
|
|
|
1892
1882
|
if (e.getType() !== this.getRelated().getSchemaName())
|
|
1893
1883
|
throw new B("BelongsTo.associate()", this.getRelated().getSchemaName(), e.getType());
|
|
1894
1884
|
if (!e.exists)
|
|
1895
|
-
throw new
|
|
1885
|
+
throw new Se(this.getRelated().getSchemaName(), "save");
|
|
1896
1886
|
return this.parent.update({
|
|
1897
1887
|
[this.getForeignKey()]: e.getKey()
|
|
1898
1888
|
});
|
|
@@ -1905,7 +1895,7 @@ class Ae extends F {
|
|
|
1905
1895
|
}
|
|
1906
1896
|
class ve extends F {
|
|
1907
1897
|
constructor(e, t, r, i = null) {
|
|
1908
|
-
if (i !== null && !(i instanceof
|
|
1898
|
+
if (i !== null && !(i instanceof L && i.every(E)))
|
|
1909
1899
|
throw new M("BelongsToMany.constructor()", "Collection<Model> or null");
|
|
1910
1900
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
1911
1901
|
}
|
|
@@ -2008,7 +1998,7 @@ class ve extends F {
|
|
|
2008
1998
|
this.items ? this.items.splice(0, this.items.count(), ...r) : this.items = r;
|
|
2009
1999
|
}
|
|
2010
2000
|
}
|
|
2011
|
-
class
|
|
2001
|
+
class k extends F {
|
|
2012
2002
|
query() {
|
|
2013
2003
|
const e = super.query(), t = this.guessInverseRelation();
|
|
2014
2004
|
return e.where(t, this.parent.getKey()), e.lock(`where.${t}`), e;
|
|
@@ -2021,7 +2011,7 @@ class Q extends F {
|
|
|
2021
2011
|
e.setAttribute(this.getForeignKey(), this.parent.getKey()), await e.save();
|
|
2022
2012
|
}
|
|
2023
2013
|
}
|
|
2024
|
-
class Ze extends
|
|
2014
|
+
class Ze extends k {
|
|
2025
2015
|
constructor(e, t, r, i = null) {
|
|
2026
2016
|
if (!E(i) && i !== null)
|
|
2027
2017
|
throw new M("HasOne.constructor()", "Model or null");
|
|
@@ -2040,9 +2030,9 @@ class Ze extends Q {
|
|
|
2040
2030
|
await this.saveQuietly(e), this.items = e;
|
|
2041
2031
|
}
|
|
2042
2032
|
}
|
|
2043
|
-
class ze extends
|
|
2033
|
+
class ze extends k {
|
|
2044
2034
|
constructor(e, t, r, i = null) {
|
|
2045
|
-
if (i !== null && !(i instanceof
|
|
2035
|
+
if (i !== null && !(i instanceof L && i.every(E)))
|
|
2046
2036
|
throw new M("HasMany.constructor()", "Collection<Model> or null");
|
|
2047
2037
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2048
2038
|
}
|
|
@@ -2080,7 +2070,7 @@ class ze extends Q {
|
|
|
2080
2070
|
await this.saveQuietly(e), this.items === null ? this.items = await this.all() : this.items.push(e);
|
|
2081
2071
|
}
|
|
2082
2072
|
}
|
|
2083
|
-
class Ne extends
|
|
2073
|
+
class Ne extends k {
|
|
2084
2074
|
query() {
|
|
2085
2075
|
const e = this.getRelated().query();
|
|
2086
2076
|
e.once("success", (r) => {
|
|
@@ -2100,7 +2090,7 @@ class Ne extends Q {
|
|
|
2100
2090
|
}
|
|
2101
2091
|
class Oe extends Ne {
|
|
2102
2092
|
constructor(e, t, r, i = null) {
|
|
2103
|
-
if (i !== null && !(i instanceof
|
|
2093
|
+
if (i !== null && !(i instanceof L && i.every(E)))
|
|
2104
2094
|
throw new M("MorphMany.constructor()", "Collection<Model> or null");
|
|
2105
2095
|
super(e, t, r, i), this.meta = e, this.facades = t, this.parent = r, this.items = i;
|
|
2106
2096
|
}
|
|
@@ -2156,7 +2146,7 @@ class et extends Ne {
|
|
|
2156
2146
|
await this.saveQuietly(e), this.items = e;
|
|
2157
2147
|
}
|
|
2158
2148
|
}
|
|
2159
|
-
class tt extends
|
|
2149
|
+
class tt extends Re {
|
|
2160
2150
|
getRelated() {
|
|
2161
2151
|
return this.facades.model.make(
|
|
2162
2152
|
this.parent.getAttribute(this.getName() + "_type")
|
|
@@ -2213,7 +2203,7 @@ class st {
|
|
|
2213
2203
|
), s = r(i);
|
|
2214
2204
|
this._models[t] = Xe(e.make(), t, s);
|
|
2215
2205
|
}), this.reducer("relationMap", () => ({
|
|
2216
|
-
BelongsTo:
|
|
2206
|
+
BelongsTo: Re,
|
|
2217
2207
|
BelongsToMany: ve,
|
|
2218
2208
|
HasOne: Ze,
|
|
2219
2209
|
HasMany: ze,
|
|
@@ -2273,7 +2263,7 @@ class st {
|
|
|
2273
2263
|
throw new b();
|
|
2274
2264
|
}
|
|
2275
2265
|
}
|
|
2276
|
-
const it =
|
|
2266
|
+
const it = S(Ae(st));
|
|
2277
2267
|
var xe, Me;
|
|
2278
2268
|
class nt extends (Me = Error, xe = Symbol.toStringTag, Me) {
|
|
2279
2269
|
constructor() {
|
|
@@ -2286,7 +2276,7 @@ const Be = (n, e = "data") => {
|
|
|
2286
2276
|
throw new nt();
|
|
2287
2277
|
const t = document.getElementById(`luminix-${e}::` + n);
|
|
2288
2278
|
return t ? t.dataset.json && t.dataset.value ? JSON.parse(t.dataset.value) : t.dataset.value : null;
|
|
2289
|
-
}, G = R
|
|
2279
|
+
}, G = S(R), ot = (n) => Le(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;
|
|
2290
2280
|
let ht = class {
|
|
2291
2281
|
constructor() {
|
|
2292
2282
|
m(this, "bags");
|
|
@@ -2378,7 +2368,7 @@ class at {
|
|
|
2378
2368
|
} catch (g) {
|
|
2379
2369
|
if (ot(g)) {
|
|
2380
2370
|
const { errors: qe } = g.response.data;
|
|
2381
|
-
this.error.set(Object.entries(qe).reduce((
|
|
2371
|
+
this.error.set(Object.entries(qe).reduce((Q, [Ie, Fe]) => (Q[Ie] = Fe.join(" "), Q), {}), f);
|
|
2382
2372
|
} else I.isAxiosError(g) && this.error.set(
|
|
2383
2373
|
this.axiosError({ axios: g.message }, {
|
|
2384
2374
|
error: g,
|
|
@@ -2395,7 +2385,7 @@ class at {
|
|
|
2395
2385
|
return "route";
|
|
2396
2386
|
}
|
|
2397
2387
|
}
|
|
2398
|
-
const lt =
|
|
2388
|
+
const lt = Ae(at);
|
|
2399
2389
|
class ct {
|
|
2400
2390
|
constructor() {
|
|
2401
2391
|
m(this, "facades", {});
|
|
@@ -2438,12 +2428,12 @@ class ct {
|
|
|
2438
2428
|
} catch (g) {
|
|
2439
2429
|
(p = e.app) != null && p.debug && console.error(g);
|
|
2440
2430
|
}
|
|
2441
|
-
this.bind("log", new
|
|
2431
|
+
this.bind("log", new Ce(!!((w = e.app) != null && w.debug)));
|
|
2442
2432
|
const { log: r } = this.facades, {
|
|
2443
2433
|
manifest: { routes: i = {}, models: s = {} } = {},
|
|
2444
2434
|
...u
|
|
2445
2435
|
} = e;
|
|
2446
|
-
this.bind("config", new
|
|
2436
|
+
this.bind("config", new R(u)), this.facades.config.has("auth.user") || this.facades.config.set("auth.user", null), this.facades.config.lock("auth.user"), this.bind("error", new ht()), this.bind("route", new lt(i, this.facades.error, ((x = e.app) == null ? void 0 : x.url) ?? "")), this.bind("model", new it(s)), this.bind("auth", new Qe(this)), this.emit("booting");
|
|
2447
2437
|
for (const g of Object.values(this.facades))
|
|
2448
2438
|
typeof g == "object" && g !== null && "boot" in g && typeof g.boot == "function" && g.boot(this);
|
|
2449
2439
|
for (const g of this._plugins)
|
|
@@ -2460,6 +2450,9 @@ class ct {
|
|
|
2460
2450
|
environment(...e) {
|
|
2461
2451
|
return e.length > 0 ? e.includes(this.facades.config.get("app.env", "production")) : this.facades.config.get("app.env", "production");
|
|
2462
2452
|
}
|
|
2453
|
+
getLocale() {
|
|
2454
|
+
return this.facades.config.get("app.locale", "en");
|
|
2455
|
+
}
|
|
2463
2456
|
getPlugin(e) {
|
|
2464
2457
|
for (const t of this._plugins)
|
|
2465
2458
|
if (t instanceof e)
|
|
@@ -2487,9 +2480,9 @@ class ct {
|
|
|
2487
2480
|
throw new window.Error("Method not implemented.");
|
|
2488
2481
|
}
|
|
2489
2482
|
}
|
|
2490
|
-
const dt =
|
|
2483
|
+
const dt = S(ct);
|
|
2491
2484
|
let y;
|
|
2492
|
-
function
|
|
2485
|
+
function A(n = void 0) {
|
|
2493
2486
|
if (y || (y = new dt()), typeof n != "string")
|
|
2494
2487
|
return {
|
|
2495
2488
|
boot: y.boot.bind(y),
|
|
@@ -2497,41 +2490,42 @@ function S(n = void 0) {
|
|
|
2497
2490
|
plugins: y.plugins.bind(y),
|
|
2498
2491
|
on: y.once.bind(y),
|
|
2499
2492
|
environment: y.environment.bind(y),
|
|
2493
|
+
getLocale: y.getLocale.bind(y),
|
|
2500
2494
|
getPlugin: y.getPlugin.bind(y),
|
|
2501
2495
|
hasDebugModeEnabled: y.hasDebugModeEnabled.bind(y),
|
|
2502
2496
|
isLocal: y.isLocal.bind(y),
|
|
2503
2497
|
isProduction: y.isProduction.bind(y)
|
|
2504
2498
|
};
|
|
2505
2499
|
if (!y.has(n))
|
|
2506
|
-
throw new
|
|
2500
|
+
throw new ke(n);
|
|
2507
2501
|
return y.make(n);
|
|
2508
2502
|
}
|
|
2509
2503
|
function bt() {
|
|
2510
|
-
return
|
|
2504
|
+
return A("auth");
|
|
2511
2505
|
}
|
|
2512
2506
|
function Et(n) {
|
|
2513
2507
|
return c(n);
|
|
2514
2508
|
}
|
|
2515
2509
|
function xt(n, e) {
|
|
2516
|
-
const t =
|
|
2510
|
+
const t = A("config");
|
|
2517
2511
|
return typeof n > "u" ? t : t.get(n, e);
|
|
2518
2512
|
}
|
|
2519
2513
|
function Mt(n, e = "default") {
|
|
2520
|
-
return n ?
|
|
2514
|
+
return n ? A().make("error").get(n, e) : A().make("error");
|
|
2521
2515
|
}
|
|
2522
2516
|
function _t(...n) {
|
|
2523
|
-
const e =
|
|
2517
|
+
const e = A("log");
|
|
2524
2518
|
return n.length ? e.debug(...n) : e;
|
|
2525
2519
|
}
|
|
2526
2520
|
function Tt(n) {
|
|
2527
|
-
const e =
|
|
2521
|
+
const e = A("model");
|
|
2528
2522
|
return n ? e.make(n) : e;
|
|
2529
2523
|
}
|
|
2530
2524
|
function $t(n, e = !1) {
|
|
2531
|
-
const t =
|
|
2525
|
+
const t = A("route");
|
|
2532
2526
|
return n ? e ? t.url([n, e]) : t.url(n) : t;
|
|
2533
2527
|
}
|
|
2534
|
-
class
|
|
2528
|
+
class St {
|
|
2535
2529
|
constructor() {
|
|
2536
2530
|
m(this, "name");
|
|
2537
2531
|
m(this, "version");
|
|
@@ -2542,11 +2536,12 @@ class Rt {
|
|
|
2542
2536
|
}
|
|
2543
2537
|
}
|
|
2544
2538
|
export {
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2539
|
+
dt as App,
|
|
2540
|
+
S as HasEvents,
|
|
2541
|
+
St as Plugin,
|
|
2542
|
+
R as PropertyBag,
|
|
2543
|
+
Ae as Reducible,
|
|
2544
|
+
A as app,
|
|
2550
2545
|
bt as auth,
|
|
2551
2546
|
Et as collect,
|
|
2552
2547
|
xt as config,
|
package/dist/facades/App.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare class App implements AppFacade {
|
|
|
16
16
|
boot(configObject?: AppConfiguration): Promise<AppFacades>;
|
|
17
17
|
environment(): string;
|
|
18
18
|
environment(...environments: string[]): boolean;
|
|
19
|
+
getLocale(): string;
|
|
19
20
|
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
20
21
|
hasDebugModeEnabled(): boolean;
|
|
21
22
|
isLocal(): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { default as error } from './helpers/error';
|
|
|
6
6
|
import { default as log } from './helpers/log';
|
|
7
7
|
import { default as model } from './helpers/model';
|
|
8
8
|
import { default as route } from './helpers/route';
|
|
9
|
+
import { default as App } from './facades/App';
|
|
9
10
|
import { isValidationError } from './facades/Error';
|
|
10
11
|
import { default as Plugin } from './contracts/Plugin';
|
|
11
12
|
import { default as PropertyBag } from './contracts/PropertyBag';
|
|
@@ -14,7 +15,7 @@ import { isCollection } from './support/collection';
|
|
|
14
15
|
import { Reducible } from './mixins/Reducible';
|
|
15
16
|
import { HasEvents } from './mixins/HasEvents';
|
|
16
17
|
|
|
17
|
-
export { app, auth, collect, config, error, log, model, route, isCollection, isValidationError, isModel, Plugin, PropertyBag, Reducible, HasEvents, };
|
|
18
|
+
export { app, App, auth, collect, config, error, log, model, route, isCollection, isValidationError, isModel, Plugin, PropertyBag, Reducible, HasEvents, };
|
|
18
19
|
export type { AppFacade } from './types/App';
|
|
19
20
|
export type { AuthFacade } from './types/Auth';
|
|
20
21
|
export type { LogFacade } from './types/Log';
|
package/dist/types/App.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export type AppExternal = {
|
|
|
52
52
|
environment(): string;
|
|
53
53
|
environment(...environments: string[]): boolean;
|
|
54
54
|
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
55
|
+
getLocale(): string;
|
|
55
56
|
hasDebugModeEnabled(): boolean;
|
|
56
57
|
isLocal(): boolean;
|
|
57
58
|
isProduction(): boolean;
|
package/dist/types/Model.d.ts
CHANGED
|
@@ -64,8 +64,6 @@ export declare class BaseModel implements EventSource<ModelEvents> {
|
|
|
64
64
|
getRouteForSave(): RouteGenerator;
|
|
65
65
|
getRouteForUpdate(): RouteGenerator;
|
|
66
66
|
getRouteForDelete(): RouteGenerator;
|
|
67
|
-
getRouteForRestore(): RouteGenerator;
|
|
68
|
-
getRouteForForceDelete(): RouteGenerator;
|
|
69
67
|
getRouteForRefresh(): RouteGenerator;
|
|
70
68
|
static getSchemaName(): string;
|
|
71
69
|
static getSchema(): ModelSchemaAttributes;
|