@hostlink/light 3.4.0 → 3.5.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 -2
- package/dist/createClient.d.ts +0 -2
- package/dist/index.d.ts +0 -3
- package/dist/light.js +409 -547
- package/dist/light.umd.cjs +1 -1
- package/dist/webauthn.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/drive.d.ts +0 -130
- package/dist/file.d.ts +0 -32
- package/dist/folder.d.ts +0 -20
package/dist/light.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsonToGraphQLQuery as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { jsonToGraphQLQuery as x, VariableType as j } from "json-to-graphql-query";
|
|
2
|
+
import W from "collect.js";
|
|
3
|
+
import ht from "axios";
|
|
4
|
+
function z(t) {
|
|
5
5
|
if (t === null || typeof t != "object")
|
|
6
6
|
return !1;
|
|
7
7
|
const e = Object.getPrototypeOf(t);
|
|
8
8
|
return e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.iterator in t ? !1 : Symbol.toStringTag in t ? Object.prototype.toString.call(t) === "[object Module]" : !0;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
10
|
+
function H(t, e, r = ".", s) {
|
|
11
|
+
if (!z(e))
|
|
12
|
+
return H(t, {}, r, s);
|
|
13
13
|
const n = Object.assign({}, e);
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
14
|
+
for (const f in t) {
|
|
15
|
+
if (f === "__proto__" || f === "constructor")
|
|
16
16
|
continue;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
n[
|
|
21
|
-
(r ? `${r}.` : "") +
|
|
17
|
+
const c = t[f];
|
|
18
|
+
c != null && (s && s(n, f, c, r) || (Array.isArray(c) && Array.isArray(n[f]) ? n[f] = [...c, ...n[f]] : z(c) && z(n[f]) ? n[f] = H(
|
|
19
|
+
c,
|
|
20
|
+
n[f],
|
|
21
|
+
(r ? `${r}.` : "") + f.toString(),
|
|
22
22
|
s
|
|
23
|
-
) : n[
|
|
23
|
+
) : n[f] = c));
|
|
24
24
|
}
|
|
25
25
|
return n;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function ft(t) {
|
|
28
28
|
return (...e) => (
|
|
29
29
|
// eslint-disable-next-line unicorn/no-array-reduce
|
|
30
|
-
e.reduce((r, s) =>
|
|
30
|
+
e.reduce((r, s) => H(r, s, "", t), {})
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
33
|
+
const E = ft();
|
|
34
|
+
let R = null;
|
|
35
|
+
const pt = (t) => {
|
|
36
|
+
R = t;
|
|
37
|
+
}, I = () => {
|
|
38
|
+
if (!R)
|
|
39
39
|
throw new Error("Api client not initialized. Call setApiClient() first.");
|
|
40
|
-
return
|
|
41
|
-
},
|
|
42
|
-
function
|
|
40
|
+
return R;
|
|
41
|
+
}, ne = () => R;
|
|
42
|
+
function T(t) {
|
|
43
43
|
for (let e = 0; e < t.length; e++)
|
|
44
44
|
if (t[e] instanceof File)
|
|
45
45
|
return !0;
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function K(t) {
|
|
49
49
|
for (let e in t)
|
|
50
|
-
if (t[e] instanceof File || t[e] instanceof Array &&
|
|
50
|
+
if (t[e] instanceof File || t[e] instanceof Array && T(t[e]))
|
|
51
51
|
return !0;
|
|
52
52
|
return !1;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function gt(t) {
|
|
55
55
|
t = "<~" + t + "~>";
|
|
56
|
-
var e, r, s, n,
|
|
57
|
-
for (t.slice(0, 2) === "<~" && t.slice(-2), t = t.slice(2, -2).replace(/\s/g, "").replace("z", "!!!!!"), e = "uuuuu".slice(t.length % 5 || 5), t += e, s = [], n = 0,
|
|
58
|
-
return (function(
|
|
59
|
-
for (var i = o; i > 0; i--)
|
|
60
|
-
})(s, e.length),
|
|
56
|
+
var e, r, s, n, f, c = String, p = 255;
|
|
57
|
+
for (t.slice(0, 2) === "<~" && t.slice(-2), t = t.slice(2, -2).replace(/\s/g, "").replace("z", "!!!!!"), e = "uuuuu".slice(t.length % 5 || 5), t += e, s = [], n = 0, f = t.length; f > n; n += 5) r = 52200625 * (t.charCodeAt(n) - 33) + 614125 * (t.charCodeAt(n + 1) - 33) + 7225 * (t.charCodeAt(n + 2) - 33) + 85 * (t.charCodeAt(n + 3) - 33) + (t.charCodeAt(n + 4) - 33), s.push(p & r >> 24, p & r >> 16, p & r >> 8, p & r);
|
|
58
|
+
return (function(h, o) {
|
|
59
|
+
for (var i = o; i > 0; i--) h.pop();
|
|
60
|
+
})(s, e.length), c.fromCharCode.apply(c, s);
|
|
61
61
|
}
|
|
62
62
|
const tt = (t = "") => {
|
|
63
63
|
const e = t, r = (s = "application/octet-stream") => {
|
|
64
64
|
const n = new Uint8Array(e.length);
|
|
65
|
-
for (let
|
|
66
|
-
n[
|
|
67
|
-
const
|
|
68
|
-
return URL.createObjectURL(
|
|
65
|
+
for (let p = 0; p < e.length; p++)
|
|
66
|
+
n[p] = e.charCodeAt(p);
|
|
67
|
+
const f = new Blob([n], { type: s });
|
|
68
|
+
return URL.createObjectURL(f);
|
|
69
69
|
};
|
|
70
70
|
return {
|
|
71
71
|
getContent: () => e,
|
|
@@ -78,54 +78,54 @@ const tt = (t = "") => {
|
|
|
78
78
|
window.open(r(s), "_blank");
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
},
|
|
81
|
+
}, oe = (t) => tt(atob(t)), ie = (t) => tt(gt(t));
|
|
82
82
|
function et(t, e, r, s, n) {
|
|
83
83
|
if (!(!t || typeof t != "object"))
|
|
84
|
-
for (let
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
if ("__args" in
|
|
88
|
-
const
|
|
89
|
-
Object.entries(
|
|
90
|
-
if (i instanceof Array &&
|
|
91
|
-
|
|
84
|
+
for (let f in t) {
|
|
85
|
+
const c = t[f];
|
|
86
|
+
if (c && typeof c == "object") {
|
|
87
|
+
if ("__args" in c) {
|
|
88
|
+
const p = c.__args, h = {};
|
|
89
|
+
Object.entries(p).forEach(([o, i]) => {
|
|
90
|
+
if (i instanceof Array && T(i)) {
|
|
91
|
+
h[o] = new j(o);
|
|
92
92
|
let a = 0;
|
|
93
|
-
i.forEach((
|
|
94
|
-
|
|
93
|
+
i.forEach((l) => {
|
|
94
|
+
l instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + o + "." + a), s.append(n.current.toString(), l), n.current++, a++);
|
|
95
95
|
}), e[o] = "[Upload!]!";
|
|
96
|
-
} else i instanceof File ? (
|
|
97
|
-
if (
|
|
98
|
-
|
|
96
|
+
} else i instanceof File ? (h[o] = new j(o), r[n.current] = ["variables." + o], s.append(n.current.toString(), i), e[o] = "Upload!", n.current++) : i instanceof Object && K(i) ? (h[o] = {}, Object.entries(i).forEach(([a, l]) => {
|
|
97
|
+
if (l instanceof Array && T(l)) {
|
|
98
|
+
h[o][a] = new j(a);
|
|
99
99
|
let m = 0;
|
|
100
|
-
|
|
100
|
+
l.forEach((d) => {
|
|
101
101
|
d instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + a + "." + m), s.append(n.current.toString(), d), n.current++, m++);
|
|
102
102
|
}), e[a] = "[Upload!]!";
|
|
103
|
-
} else
|
|
104
|
-
})) : i != null && (
|
|
105
|
-
}),
|
|
103
|
+
} else l instanceof File ? (h[o][a] = new j(a), r[n.current] = ["variables." + a], s.append(n.current.toString(), l), e[a] = "Upload!", n.current++) : h[o][a] = l;
|
|
104
|
+
})) : i != null && (h[o] = i);
|
|
105
|
+
}), c.__args = h;
|
|
106
106
|
}
|
|
107
|
-
et(
|
|
107
|
+
et(c, e, r, s, n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
const rt = (t) => async (e) => {
|
|
112
112
|
const r = e, s = new FormData();
|
|
113
113
|
let n = !1;
|
|
114
|
-
const
|
|
115
|
-
et(r,
|
|
116
|
-
let
|
|
117
|
-
const i =
|
|
118
|
-
if (n ? (s.append("map", JSON.stringify(
|
|
114
|
+
const f = {}, c = {};
|
|
115
|
+
et(r, f, c, s, { current: 0 }), n = Object.keys(f).length > 0, n && (r.__variables = f);
|
|
116
|
+
let h = null;
|
|
117
|
+
const i = x({ query: r });
|
|
118
|
+
if (n ? (s.append("map", JSON.stringify(c)), s.append("operations", JSON.stringify({
|
|
119
119
|
query: i
|
|
120
|
-
})),
|
|
120
|
+
})), h = await t.post("", s)) : h = await t.post("", {
|
|
121
121
|
query: i
|
|
122
|
-
}),
|
|
123
|
-
throw new Error(
|
|
124
|
-
return
|
|
125
|
-
},
|
|
126
|
-
function
|
|
127
|
-
let s, n = [],
|
|
128
|
-
const
|
|
122
|
+
}), h.data.errors)
|
|
123
|
+
throw new Error(h.data.errors[0].message);
|
|
124
|
+
return h.data.data;
|
|
125
|
+
}, O = async (t) => rt(I().axios)(t);
|
|
126
|
+
function G(t, e, r = O) {
|
|
127
|
+
let s, n = [], f, c;
|
|
128
|
+
const p = (o) => !o || typeof o != "object" ? !1 : Object.values(o).some((i) => i && typeof i == "object" && Object.keys(i).some((a) => a.startsWith("_"))), h = () => n.length === 0 ? (n.unshift({}), n[0]) : (p(n[0]) && n.unshift({}), n[0]);
|
|
129
129
|
return {
|
|
130
130
|
first() {
|
|
131
131
|
return this.fetchFirst();
|
|
@@ -139,29 +139,29 @@ function L(t, e, r = F) {
|
|
|
139
139
|
},
|
|
140
140
|
async fetchWithMeta() {
|
|
141
141
|
let i = await r(this.toQuery(!0));
|
|
142
|
-
if (
|
|
143
|
-
const a =
|
|
144
|
-
for (const
|
|
145
|
-
i = i[
|
|
142
|
+
if (c) {
|
|
143
|
+
const a = c.split(".");
|
|
144
|
+
for (const l of a)
|
|
145
|
+
i = i[l];
|
|
146
146
|
return i;
|
|
147
147
|
}
|
|
148
148
|
return i[`list${t}`];
|
|
149
149
|
},
|
|
150
150
|
async fetch() {
|
|
151
151
|
let i = await r(this.toQuery());
|
|
152
|
-
if (
|
|
153
|
-
const a =
|
|
154
|
-
for (const
|
|
155
|
-
i = i[
|
|
152
|
+
if (c) {
|
|
153
|
+
const a = c.split(".");
|
|
154
|
+
for (const l of a)
|
|
155
|
+
i = i[l];
|
|
156
156
|
return i.data;
|
|
157
157
|
}
|
|
158
158
|
return i[`list${t}`].data;
|
|
159
159
|
},
|
|
160
160
|
dataPath(o) {
|
|
161
|
-
return o && typeof o == "string" && (
|
|
161
|
+
return o && typeof o == "string" && (c = o), this;
|
|
162
162
|
},
|
|
163
163
|
sort(o) {
|
|
164
|
-
return o && typeof o == "string" && (
|
|
164
|
+
return o && typeof o == "string" && (f = o), this;
|
|
165
165
|
},
|
|
166
166
|
filters(o) {
|
|
167
167
|
return o && typeof o == "object" && (n = [o]), this;
|
|
@@ -170,8 +170,8 @@ function L(t, e, r = F) {
|
|
|
170
170
|
// where('key', value) -> exact match
|
|
171
171
|
// where('key', '>', value) -> operator-based (>, <, >=, <=, !=, in, contains)
|
|
172
172
|
where(o, i, a) {
|
|
173
|
-
const
|
|
174
|
-
const
|
|
173
|
+
const l = (m, d, b) => {
|
|
174
|
+
const k = {
|
|
175
175
|
">": "_gt",
|
|
176
176
|
"<": "_lt",
|
|
177
177
|
">=": "_gte",
|
|
@@ -180,12 +180,12 @@ function L(t, e, r = F) {
|
|
|
180
180
|
in: "_in",
|
|
181
181
|
contains: "_contains"
|
|
182
182
|
}[d];
|
|
183
|
-
|
|
183
|
+
k && n.push({ [m]: { [k]: b } });
|
|
184
184
|
};
|
|
185
185
|
if (a !== void 0)
|
|
186
|
-
|
|
186
|
+
l(o, String(i), a);
|
|
187
187
|
else {
|
|
188
|
-
const m =
|
|
188
|
+
const m = h(), d = E(m, { [o]: i });
|
|
189
189
|
n[0] = d;
|
|
190
190
|
}
|
|
191
191
|
return this;
|
|
@@ -194,8 +194,8 @@ function L(t, e, r = F) {
|
|
|
194
194
|
// If the same field is used multiple times, it merges them into an array
|
|
195
195
|
whereContains(o, i) {
|
|
196
196
|
if (o && typeof o == "string") {
|
|
197
|
-
const a =
|
|
198
|
-
a[o] ? Array.isArray(a[o]) ? a[o].push(
|
|
197
|
+
const a = h(), l = { _contains: i };
|
|
198
|
+
a[o] ? Array.isArray(a[o]) ? a[o].push(l) : a[o] = [a[o], l] : a[o] = [l], n[0] = a;
|
|
199
199
|
}
|
|
200
200
|
return this;
|
|
201
201
|
},
|
|
@@ -204,33 +204,33 @@ function L(t, e, r = F) {
|
|
|
204
204
|
// If the same field is used multiple times, it merges them into an array
|
|
205
205
|
whereIn(o, i) {
|
|
206
206
|
if (o && typeof o == "string" && Array.isArray(i)) {
|
|
207
|
-
const a =
|
|
208
|
-
a[o] ? Array.isArray(a[o]) ? a[o].push(
|
|
207
|
+
const a = h(), l = { _in: i };
|
|
208
|
+
a[o] ? Array.isArray(a[o]) ? a[o].push(l) : a[o] = [a[o], l] : a[o] = [l], n[0] = a;
|
|
209
209
|
}
|
|
210
210
|
return this;
|
|
211
211
|
},
|
|
212
212
|
// whereBetween adds a _between filter for a specific field
|
|
213
213
|
whereBetween(o, i, a) {
|
|
214
214
|
if (o && typeof o == "string") {
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const l = h(), m = { _between: [i, a] };
|
|
216
|
+
l[o] ? Array.isArray(l[o]) ? l[o].push(m) : l[o] = [l[o], m] : l[o] = m, n[0] = l;
|
|
217
217
|
}
|
|
218
218
|
return this;
|
|
219
219
|
},
|
|
220
220
|
// limit sets paging/limit for the data selection
|
|
221
221
|
limit(o) {
|
|
222
|
-
return typeof o == "number" && Number.isFinite(o) && (s =
|
|
222
|
+
return typeof o == "number" && Number.isFinite(o) && (s = E(s || {}, { limit: o })), this;
|
|
223
223
|
},
|
|
224
224
|
// offset sets the starting index for the data selection
|
|
225
225
|
offset(o) {
|
|
226
|
-
return typeof o == "number" && Number.isFinite(o) && (s =
|
|
226
|
+
return typeof o == "number" && Number.isFinite(o) && (s = E(s || {}, { offset: o })), this;
|
|
227
227
|
},
|
|
228
228
|
toQuery(o = !1) {
|
|
229
229
|
let i;
|
|
230
|
-
const a = n.length > 0 && Object.keys(n[0] || {}).length > 0,
|
|
231
|
-
a && m ? i = n : m ? i = n.slice(
|
|
232
|
-
const d =
|
|
233
|
-
|
|
230
|
+
const a = n.length > 0 && Object.keys(n[0] || {}).length > 0, l = a ? 1 : 0, m = n.length > l;
|
|
231
|
+
a && m ? i = n : m ? i = n.slice(l) : a && (i = n[0]);
|
|
232
|
+
const d = E(
|
|
233
|
+
f ? { sort: f } : {},
|
|
234
234
|
i ? { filters: i } : {}
|
|
235
235
|
), b = {
|
|
236
236
|
data: {
|
|
@@ -241,14 +241,14 @@ function L(t, e, r = F) {
|
|
|
241
241
|
total: !0,
|
|
242
242
|
key: !0,
|
|
243
243
|
name: !0
|
|
244
|
-
}),
|
|
245
|
-
const
|
|
246
|
-
let
|
|
247
|
-
for (let
|
|
248
|
-
|
|
249
|
-
[
|
|
244
|
+
}), c) {
|
|
245
|
+
const P = c.split(".");
|
|
246
|
+
let k = b;
|
|
247
|
+
for (let U = P.length - 1; U >= 0; U--)
|
|
248
|
+
k = {
|
|
249
|
+
[P[U]]: k
|
|
250
250
|
};
|
|
251
|
-
return
|
|
251
|
+
return k;
|
|
252
252
|
}
|
|
253
253
|
return {
|
|
254
254
|
[`list${t}`]: b
|
|
@@ -256,7 +256,7 @@ function L(t, e, r = F) {
|
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const dt = "list", _t = [
|
|
260
260
|
"flatMap",
|
|
261
261
|
"chunk",
|
|
262
262
|
"shuffle",
|
|
@@ -282,7 +282,7 @@ const wt = "list", bt = [
|
|
|
282
282
|
"slice",
|
|
283
283
|
"tap",
|
|
284
284
|
"sort"
|
|
285
|
-
],
|
|
285
|
+
], yt = [
|
|
286
286
|
"avg",
|
|
287
287
|
"count",
|
|
288
288
|
"countBy",
|
|
@@ -353,14 +353,14 @@ w.prototype.clone = function() {
|
|
|
353
353
|
const t = Object.create(this);
|
|
354
354
|
return t.steps = JSON.parse(JSON.stringify(this.steps)), t.filters = JSON.parse(JSON.stringify(this.filters)), t.fields = JSON.parse(JSON.stringify(this.fields)), t;
|
|
355
355
|
};
|
|
356
|
-
|
|
356
|
+
W().macro("whereContains", function(t, e) {
|
|
357
357
|
return this.filter((r) => r[t].toLowerCase().includes(e.toLowerCase()));
|
|
358
358
|
});
|
|
359
359
|
w.prototype.fetchData = async function() {
|
|
360
360
|
try {
|
|
361
361
|
if (this._batchData) {
|
|
362
|
-
const
|
|
363
|
-
return this.meta =
|
|
362
|
+
const p = this._batchData;
|
|
363
|
+
return this.meta = p.meta, W(p.data);
|
|
364
364
|
}
|
|
365
365
|
let t = {
|
|
366
366
|
meta: {
|
|
@@ -372,17 +372,17 @@ w.prototype.fetchData = async function() {
|
|
|
372
372
|
t.__args = this.buildArgs(), t.data = this.fields, this.already_limit && (t.data.__args = t.data.__args || {}, t.data.__args.limit = this.limit), this.already_offset && (t.data.__args = t.data.__args || {}, t.data.__args.offset = this.offset);
|
|
373
373
|
const e = this.data_path.split(".");
|
|
374
374
|
let r = {}, s = r, n = e[e.length - 1];
|
|
375
|
-
for (const
|
|
376
|
-
if (
|
|
377
|
-
s[
|
|
375
|
+
for (const p of e) {
|
|
376
|
+
if (p === n) {
|
|
377
|
+
s[p] = t;
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
|
-
s[
|
|
380
|
+
s[p] = {}, s = s[p];
|
|
381
381
|
}
|
|
382
|
-
let
|
|
383
|
-
for (const
|
|
384
|
-
|
|
385
|
-
return this.meta =
|
|
382
|
+
let c = await (this._queryFn || O)(r);
|
|
383
|
+
for (const p of e)
|
|
384
|
+
c = c[p];
|
|
385
|
+
return this.meta = c.meta, W(c.data);
|
|
386
386
|
} catch (t) {
|
|
387
387
|
throw console.error("Error fetching collection data:", t), t;
|
|
388
388
|
}
|
|
@@ -396,12 +396,12 @@ w.prototype.processData = async function() {
|
|
|
396
396
|
w.prototype.all = async function() {
|
|
397
397
|
return (await this.processData()).all();
|
|
398
398
|
};
|
|
399
|
-
for (const t of
|
|
399
|
+
for (const t of _t)
|
|
400
400
|
w.prototype[t] = function(...e) {
|
|
401
401
|
const r = this.clone();
|
|
402
402
|
return r.steps.push({ type: t, args: e }), r;
|
|
403
403
|
};
|
|
404
|
-
for (const t of
|
|
404
|
+
for (const t of yt)
|
|
405
405
|
w.prototype[t] = async function(...e) {
|
|
406
406
|
return (await this.clone().processData())[t](...e);
|
|
407
407
|
};
|
|
@@ -486,29 +486,29 @@ w.prototype.take = function(t) {
|
|
|
486
486
|
w.prototype.splice = function(t, e) {
|
|
487
487
|
return this.steps.push({ type: "splice", args: [t, e] }), this.offset = t, this.limit = e, this.already_limit = !0, this.already_offset = !0, this;
|
|
488
488
|
};
|
|
489
|
-
const st = (t, e, r =
|
|
489
|
+
const st = (t, e, r = O) => {
|
|
490
490
|
const s = new w(e);
|
|
491
|
-
return s._queryFn = r, s.data_path =
|
|
491
|
+
return s._queryFn = r, s.data_path = dt + t, s;
|
|
492
492
|
}, nt = (t, e = {}, r = {}) => {
|
|
493
|
-
const s = r.mutation || g, n = r.createList ||
|
|
494
|
-
let
|
|
495
|
-
const
|
|
493
|
+
const s = r.mutation || g, n = r.createList || G, f = r.createCollection || st, c = e;
|
|
494
|
+
let p = "list" + t;
|
|
495
|
+
const h = (o) => c[o] ? c[o] : null;
|
|
496
496
|
return {
|
|
497
|
-
field:
|
|
498
|
-
$fields:
|
|
497
|
+
field: h,
|
|
498
|
+
$fields: c,
|
|
499
499
|
setDataPath(o) {
|
|
500
|
-
return
|
|
500
|
+
return p = o, p;
|
|
501
501
|
},
|
|
502
502
|
getDataPath() {
|
|
503
|
-
return
|
|
503
|
+
return p;
|
|
504
504
|
},
|
|
505
505
|
gqlFields(o) {
|
|
506
506
|
let i = {};
|
|
507
507
|
for (const a of o)
|
|
508
508
|
if (typeof a == "string") {
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
} else typeof a == "object" && (i =
|
|
509
|
+
const l = h(a);
|
|
510
|
+
l && (i = E(i, l.gqlField ? typeof l.gqlField == "string" ? { [l.gqlField]: !0 } : l.gqlField : { [l.name || a]: !0 }));
|
|
511
|
+
} else typeof a == "object" && (i = E(i, a));
|
|
512
512
|
return i;
|
|
513
513
|
},
|
|
514
514
|
update(o, i) {
|
|
@@ -535,111 +535,111 @@ const st = (t, e, r = F) => {
|
|
|
535
535
|
fields(o) {
|
|
536
536
|
let i = [];
|
|
537
537
|
for (let a of o) {
|
|
538
|
-
const
|
|
539
|
-
|
|
538
|
+
const l = h(a);
|
|
539
|
+
l && i.push(l);
|
|
540
540
|
}
|
|
541
541
|
return i;
|
|
542
542
|
},
|
|
543
543
|
async get(o, i) {
|
|
544
|
-
const a =
|
|
545
|
-
for (const [
|
|
546
|
-
a.where(
|
|
544
|
+
const a = f(t, Kt(i));
|
|
545
|
+
for (const [l, m] of Object.entries(o))
|
|
546
|
+
a.where(l, "==", m);
|
|
547
547
|
return await a.first();
|
|
548
548
|
},
|
|
549
549
|
list(o) {
|
|
550
550
|
let i = o;
|
|
551
551
|
const a = {};
|
|
552
552
|
Object.entries(o).forEach(([d]) => {
|
|
553
|
-
|
|
553
|
+
c[d] && (a[d] = c[d], c[d].gqlField && (delete i[d], i = E(i, c[d].gqlField)), c[d].gql && (delete i[d], i = E(i, c[d].gql)));
|
|
554
554
|
});
|
|
555
|
-
const
|
|
555
|
+
const l = n(t, i).dataPath(p), m = l.fetch.bind(l);
|
|
556
556
|
return {
|
|
557
|
-
...
|
|
557
|
+
...l,
|
|
558
558
|
async fetch() {
|
|
559
559
|
return (await m()).map((b) => {
|
|
560
|
-
const
|
|
561
|
-
return Object.entries(a).forEach(([
|
|
562
|
-
|
|
563
|
-
}),
|
|
560
|
+
const P = { ...b };
|
|
561
|
+
return Object.entries(a).forEach(([k, U]) => {
|
|
562
|
+
U.field && typeof U.field == "function" && (P[k] = U.field(b[k], b));
|
|
563
|
+
}), P;
|
|
564
564
|
});
|
|
565
565
|
},
|
|
566
566
|
async fetchFirst() {
|
|
567
|
-
const b = await
|
|
567
|
+
const b = await l.fetchFirst.bind(l)();
|
|
568
568
|
if (!b) return b;
|
|
569
|
-
const
|
|
570
|
-
return Object.entries(a).forEach(([
|
|
571
|
-
|
|
572
|
-
}),
|
|
569
|
+
const P = { ...b };
|
|
570
|
+
return Object.entries(a).forEach(([k, U]) => {
|
|
571
|
+
U.field && typeof U.field == "function" && (P[k] = U.field(b[k], b));
|
|
572
|
+
}), P;
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
},
|
|
577
|
+
}, D = {}, ot = (t, e) => {
|
|
578
578
|
const r = nt(t, e);
|
|
579
|
-
return
|
|
580
|
-
},
|
|
581
|
-
Object.keys(
|
|
582
|
-
},
|
|
579
|
+
return D[t] = r, r;
|
|
580
|
+
}, $ = (t) => D[t] ? D[t] : ot(t, {}), ae = (t) => !!D[t], ce = () => Object.keys(D), le = () => {
|
|
581
|
+
Object.keys(D).forEach((t) => delete D[t]);
|
|
582
|
+
}, ue = (t) => {
|
|
583
583
|
Object.entries(t).forEach(([e, r]) => {
|
|
584
584
|
ot(e, r);
|
|
585
585
|
});
|
|
586
|
-
},
|
|
586
|
+
}, he = () => O({
|
|
587
587
|
app: {
|
|
588
588
|
permissions: !0
|
|
589
589
|
}
|
|
590
590
|
}).then((t) => t.app.permissions), Y = (t, e) => {
|
|
591
591
|
const r = async () => {
|
|
592
|
-
const { app:
|
|
592
|
+
const { app: c } = await t({
|
|
593
593
|
app: {
|
|
594
594
|
auth: {
|
|
595
595
|
webAuthnRequestOptions: !0
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
}),
|
|
599
|
-
return await navigator.credentials.get({ publicKey:
|
|
598
|
+
}), p = c.auth.webAuthnRequestOptions, h = PublicKeyCredential.parseRequestOptionsFromJSON(p);
|
|
599
|
+
return await navigator.credentials.get({ publicKey: h });
|
|
600
600
|
}, s = async () => {
|
|
601
|
-
const { app:
|
|
601
|
+
const { app: c } = await t({
|
|
602
602
|
app: {
|
|
603
603
|
auth: {
|
|
604
604
|
webAuthnCreationOptions: !0
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
}),
|
|
608
|
-
return await navigator.credentials.create({ publicKey:
|
|
607
|
+
}), p = PublicKeyCredential.parseCreationOptionsFromJSON(c.auth.webAuthnCreationOptions);
|
|
608
|
+
return await navigator.credentials.create({ publicKey: p });
|
|
609
609
|
};
|
|
610
610
|
return { assertion: r, attestation: s, login: async () => {
|
|
611
|
-
const
|
|
611
|
+
const c = await r();
|
|
612
612
|
return await e({
|
|
613
613
|
webAuthnAssertion: {
|
|
614
614
|
__args: {
|
|
615
|
-
assertion:
|
|
615
|
+
assertion: c.toJSON()
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
}).then((
|
|
618
|
+
}).then((p) => p.webAuthnAssertion);
|
|
619
619
|
}, register: async () => {
|
|
620
|
-
const
|
|
620
|
+
const c = await s();
|
|
621
621
|
return await e({
|
|
622
622
|
webAuthnRegister: {
|
|
623
623
|
__args: {
|
|
624
|
-
registration:
|
|
624
|
+
registration: c.toJSON()
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
}).then((
|
|
627
|
+
}).then((p) => p.webAuthnRegister);
|
|
628
628
|
} };
|
|
629
|
-
},
|
|
629
|
+
}, J = Y((t) => O(t), (t) => g(t)), wt = J.assertion, bt = J.attestation, mt = J.login, At = J.register, Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
630
630
|
__proto__: null,
|
|
631
|
-
assertion:
|
|
632
|
-
attestation:
|
|
631
|
+
assertion: wt,
|
|
632
|
+
attestation: bt,
|
|
633
633
|
createWebAuthn: Y,
|
|
634
|
-
login:
|
|
635
|
-
register:
|
|
636
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
637
|
-
getCurrentUser: (r =
|
|
638
|
-
login: (r, s, n = "") => e({ login: { __args: { username: r, password: s, code: n } } }).then((
|
|
634
|
+
login: mt,
|
|
635
|
+
register: At
|
|
636
|
+
}, Symbol.toStringTag, { value: "Module" })), kt = (t, e) => ({
|
|
637
|
+
getCurrentUser: (r = Q) => t({ my: r }).then((s) => s.my),
|
|
638
|
+
login: (r, s, n = "") => e({ login: { __args: { username: r, password: s, code: n } } }).then((f) => f.login),
|
|
639
639
|
logout: () => e({ logout: !0 }).then((r) => r.logout),
|
|
640
|
-
changeExpiredPassword: (r, s, n) => e({ changeExpiredPassword: { __args: { username: r, old_password: s, new_password: n } } }).then((
|
|
640
|
+
changeExpiredPassword: (r, s, n) => e({ changeExpiredPassword: { __args: { username: r, old_password: s, new_password: n } } }).then((f) => f.changeExpiredPassword),
|
|
641
641
|
updatePassword: (r, s) => e({ changeUserPassword: { __args: { old_password: r, new_password: s } } }).then((n) => n.changeUserPassword),
|
|
642
|
-
resetPassword: (r, s, n) => e({ resetPassword: { __args: { jwt: r, password: s, code: n } } }).then((
|
|
642
|
+
resetPassword: (r, s, n) => e({ resetPassword: { __args: { jwt: r, password: s, code: n } } }).then((f) => f.resetPassword),
|
|
643
643
|
forgetPassword: (r, s) => e({ forgetPassword: { __args: { username: r, email: s } } }).then((n) => n.forgetPassword),
|
|
644
644
|
verifyCode: (r, s) => e({ forgetPasswordVerifyCode: { __args: { jwt: r, code: s } } }).then((n) => n.forgetPasswordVerifyCode),
|
|
645
645
|
grantedRights: (r) => t({
|
|
@@ -664,7 +664,7 @@ const st = (t, e, r = F) => {
|
|
|
664
664
|
login: (r) => e({ lightAuthLoginMicrosoft: { __args: { access_token: r } } }).then((s) => s.lightAuthLoginMicrosoft),
|
|
665
665
|
register: (r) => e({ lightAuthRegisterMicrosoft: { __args: { account_id: r } } }).then((s) => s.lightAuthRegisterMicrosoft)
|
|
666
666
|
}
|
|
667
|
-
}),
|
|
667
|
+
}), Ot = (t = Q) => O({ my: t }).then((e) => e.my), Pt = (t, e, r = "") => g({ login: { __args: { username: t, password: e, code: r } } }).then((s) => s.login), Ut = () => g({ logout: !0 }).then((t) => t.logout), Ct = (t, e, r) => g({ changeExpiredPassword: { __args: { username: t, old_password: e, new_password: r } } }).then((s) => s.changeExpiredPassword), St = (t, e) => g({ changeUserPassword: { __args: { old_password: t, new_password: e } } }).then((r) => r.changeUserPassword), jt = (t, e, r) => g({ resetPassword: { __args: { jwt: t, password: e, code: r } } }).then((s) => s.resetPassword), Et = (t, e) => g({ forgetPassword: { __args: { username: t, email: e } } }).then((r) => r.forgetPassword), Mt = (t, e) => g({ forgetPasswordVerifyCode: { __args: { jwt: t, code: e } } }).then((r) => r.forgetPasswordVerifyCode), Dt = (t) => O({
|
|
668
668
|
my: {
|
|
669
669
|
granted: {
|
|
670
670
|
__args: {
|
|
@@ -672,7 +672,7 @@ const st = (t, e, r = F) => {
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
}).then((e) => e.my.granted),
|
|
675
|
+
}).then((e) => e.my.granted), qt = (t) => O({
|
|
676
676
|
my: {
|
|
677
677
|
grantedRights: {
|
|
678
678
|
__args: {
|
|
@@ -680,9 +680,9 @@ const st = (t, e, r = F) => {
|
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
}).then((e) => e.my.grantedRights),
|
|
684
|
-
getCurrentUser:
|
|
685
|
-
webAuthn:
|
|
683
|
+
}).then((e) => e.my.grantedRights), fe = {
|
|
684
|
+
getCurrentUser: Ot,
|
|
685
|
+
webAuthn: Ft,
|
|
686
686
|
google: {
|
|
687
687
|
unlink: () => g({ lightAuthUnlinkGoogle: !0 }).then((t) => t.lightAuthUnlinkGoogle),
|
|
688
688
|
login: (t) => g({ lightAuthLoginGoogle: { __args: { credential: t } } }).then((e) => e.lightAuthLoginGoogle),
|
|
@@ -698,166 +698,35 @@ const st = (t, e, r = F) => {
|
|
|
698
698
|
login: (t) => g({ lightAuthLoginMicrosoft: { __args: { access_token: t } } }).then((e) => e.lightAuthLoginMicrosoft),
|
|
699
699
|
register: (t) => g({ lightAuthRegisterMicrosoft: { __args: { account_id: t } } }).then((e) => e.lightAuthRegisterMicrosoft)
|
|
700
700
|
},
|
|
701
|
-
login:
|
|
702
|
-
logout:
|
|
703
|
-
changeExpiredPassword:
|
|
704
|
-
updatePassword:
|
|
705
|
-
resetPassword:
|
|
706
|
-
forgetPassword:
|
|
707
|
-
verifyCode:
|
|
708
|
-
grantedRights:
|
|
709
|
-
isGranted:
|
|
710
|
-
},
|
|
711
|
-
name: !0,
|
|
712
|
-
path: !0,
|
|
713
|
-
size: !0,
|
|
714
|
-
mime: !0,
|
|
715
|
-
url: !0
|
|
716
|
-
}, we = (t, e, r = it) => F({
|
|
717
|
-
app: {
|
|
718
|
-
drive: {
|
|
719
|
-
__args: { index: t },
|
|
720
|
-
files: {
|
|
721
|
-
__args: { path: e },
|
|
722
|
-
...r
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
}).then((s) => s.app.drive.files), be = (t, e) => F({
|
|
727
|
-
app: {
|
|
728
|
-
drive: {
|
|
729
|
-
__args: {
|
|
730
|
-
index: t
|
|
731
|
-
},
|
|
732
|
-
file: {
|
|
733
|
-
__args: {
|
|
734
|
-
path: e
|
|
735
|
-
},
|
|
736
|
-
base64Content: !0
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}).then((r) => r.app.drive?.file?.base64Content), Bt = (t, e = F, r = g) => ({
|
|
741
|
-
list: (s, n = it) => e({ app: { drive: { __args: { index: t }, files: { __args: { path: s }, ...n } } } }).then((c) => c.app.drive.files),
|
|
742
|
-
get: (s, n = {
|
|
743
|
-
name: !0,
|
|
744
|
-
path: !0,
|
|
745
|
-
size: !0,
|
|
746
|
-
mime: !0,
|
|
747
|
-
url: !0
|
|
748
|
-
}) => e({
|
|
749
|
-
app: {
|
|
750
|
-
drive: {
|
|
751
|
-
__args: {
|
|
752
|
-
index: t
|
|
753
|
-
},
|
|
754
|
-
file: {
|
|
755
|
-
__args: {
|
|
756
|
-
path: s
|
|
757
|
-
},
|
|
758
|
-
...n
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}).then((c) => c.app.drive.file),
|
|
763
|
-
readFileAsBase64(s) {
|
|
764
|
-
return e({ app: { drive: { __args: { index: t }, file: { __args: { path: s }, base64Content: !0 } } } }).then((n) => n.app.drive?.file?.base64Content);
|
|
765
|
-
},
|
|
766
|
-
read: async (s) => {
|
|
767
|
-
let n = await e({
|
|
768
|
-
app: {
|
|
769
|
-
drive: {
|
|
770
|
-
__args: {
|
|
771
|
-
index: t
|
|
772
|
-
},
|
|
773
|
-
file: {
|
|
774
|
-
__args: {
|
|
775
|
-
path: s
|
|
776
|
-
},
|
|
777
|
-
base64Content: !0
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
|
-
if (!n.app.drive.file || !n.app.drive.file.base64Content)
|
|
783
|
-
throw new Error(`File not found or cannot read content: ${s}`);
|
|
784
|
-
return typeof window < "u" && window.atob ? window.atob(n.app.drive.file.base64Content) : n.app.drive.file.base64Content;
|
|
785
|
-
},
|
|
786
|
-
write: (s, n) => r({ lightDriveWriteFile: { __args: { index: t, path: s, content: n } } }).then((c) => c.lightDriveWriteFile),
|
|
787
|
-
delete: (s) => r({ lightDriveDeleteFile: { __args: { index: t, path: s } } }).then((n) => n.lightDriveDeleteFile),
|
|
788
|
-
rename: (s, n) => r({ lightDriveRenameFile: { __args: { index: t, path: s, name: n } } }).then((c) => c.lightDriveRenameFile),
|
|
789
|
-
move: (s, n) => r({ lightDriveMoveFile: { __args: { index: t, source: s, destination: n } } }).then((c) => c.lightDriveMoveFile)
|
|
790
|
-
}), at = {
|
|
791
|
-
name: !0,
|
|
792
|
-
path: !0
|
|
793
|
-
}, me = (t, e, r = at) => F({
|
|
794
|
-
app: {
|
|
795
|
-
drive: {
|
|
796
|
-
__args: { index: t },
|
|
797
|
-
folders: {
|
|
798
|
-
__args: { path: e },
|
|
799
|
-
...r
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}).then((s) => s.app.drive.folders), qt = (t, e = F, r = g) => ({
|
|
804
|
-
list: (s, n = at) => e({ app: { drive: { __args: { index: t }, folders: { __args: { path: s }, ...n } } } }).then((c) => c.app.drive.folders),
|
|
805
|
-
create: (s) => r({ lightDriveCreateFolder: { __args: { index: t, path: s } } }).then((n) => n.lightDriveCreateFolder),
|
|
806
|
-
delete: (s) => r({ lightDriveDeleteFolder: { __args: { index: t, path: s } } }).then((n) => n.lightDriveDeleteFolder),
|
|
807
|
-
rename: (s, n) => r({ lightDriveRenameFolder: { __args: { index: t, path: s, name: n } } }).then((c) => c.lightDriveRenameFolder)
|
|
808
|
-
}), Fe = () => F({
|
|
809
|
-
app: {
|
|
810
|
-
drives: {
|
|
811
|
-
index: !0,
|
|
812
|
-
name: !0
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
}).then((t) => t.app.drives), Ae = (t) => lt(F, g)(t), lt = (t, e) => (r) => {
|
|
816
|
-
const s = Bt(r, t, e), n = qt(r, t, e);
|
|
817
|
-
return {
|
|
818
|
-
folders: n,
|
|
819
|
-
files: s,
|
|
820
|
-
listFiles: s.list,
|
|
821
|
-
getFile: s.get,
|
|
822
|
-
readFile: s.read,
|
|
823
|
-
writeFile: s.write,
|
|
824
|
-
deleteFile: s.delete,
|
|
825
|
-
renameFile: s.rename,
|
|
826
|
-
moveFile: s.move,
|
|
827
|
-
listFolders: n.list,
|
|
828
|
-
createFolder: n.create,
|
|
829
|
-
deleteFolder: n.delete,
|
|
830
|
-
renameFolder: n.rename,
|
|
831
|
-
uploadTempFile: (c) => e({
|
|
832
|
-
lightDriveUploadTempFile: {
|
|
833
|
-
__args: { index: r, file: c },
|
|
834
|
-
name: !0,
|
|
835
|
-
path: !0,
|
|
836
|
-
size: !0,
|
|
837
|
-
mime: !0
|
|
838
|
-
}
|
|
839
|
-
}).then((l) => l.lightDriveUploadTempFile)
|
|
840
|
-
};
|
|
841
|
-
}, J = {
|
|
701
|
+
login: Pt,
|
|
702
|
+
logout: Ut,
|
|
703
|
+
changeExpiredPassword: Ct,
|
|
704
|
+
updatePassword: St,
|
|
705
|
+
resetPassword: jt,
|
|
706
|
+
forgetPassword: Et,
|
|
707
|
+
verifyCode: Mt,
|
|
708
|
+
grantedRights: qt,
|
|
709
|
+
isGranted: Dt
|
|
710
|
+
}, Q = {
|
|
842
711
|
user_id: !0,
|
|
843
712
|
username: !0,
|
|
844
713
|
first_name: !0,
|
|
845
714
|
last_name: !0,
|
|
846
715
|
status: !0
|
|
847
|
-
},
|
|
716
|
+
}, pe = (t) => g({
|
|
848
717
|
addUser: {
|
|
849
718
|
__args: t
|
|
850
719
|
}
|
|
851
|
-
}).then((e) => e.addUser),
|
|
720
|
+
}).then((e) => e.addUser), ge = (t) => g({
|
|
852
721
|
deleteUser: {
|
|
853
722
|
__args: { id: t }
|
|
854
723
|
}
|
|
855
|
-
}).then((e) => e.deleteUser),
|
|
724
|
+
}).then((e) => e.deleteUser), de = (t = Q) => G("Users", t).dataPath("app.listUser").fetch(), _e = (t, e) => g({
|
|
856
725
|
updateUser: {
|
|
857
726
|
__args: { id: t, data: e }
|
|
858
727
|
}
|
|
859
|
-
}).then((r) => r.updateUser),
|
|
860
|
-
list: (r =
|
|
728
|
+
}).then((r) => r.updateUser), Nt = (t, e) => ({
|
|
729
|
+
list: (r = Q) => e("Users", r).dataPath("app.listUser").fetch(),
|
|
861
730
|
create: (r) => t({
|
|
862
731
|
addUser: { __args: r }
|
|
863
732
|
}).then((s) => s.addUser),
|
|
@@ -867,7 +736,7 @@ const st = (t, e, r = F) => {
|
|
|
867
736
|
update: (r, s) => t({
|
|
868
737
|
updateUser: { __args: { id: r, data: s } }
|
|
869
738
|
}).then((n) => n.updateUser)
|
|
870
|
-
}),
|
|
739
|
+
}), it = (t) => (e) => t({
|
|
871
740
|
app: {
|
|
872
741
|
listConfig: {
|
|
873
742
|
__args: {
|
|
@@ -881,13 +750,13 @@ const st = (t, e, r = F) => {
|
|
|
881
750
|
}
|
|
882
751
|
}
|
|
883
752
|
}
|
|
884
|
-
}).then((r) => r.app.listConfig.data[0]?.value),
|
|
753
|
+
}).then((r) => r.app.listConfig.data[0]?.value), ye = it(O), at = {
|
|
885
754
|
name: !0
|
|
886
|
-
},
|
|
755
|
+
}, we = (t = at) => O({
|
|
887
756
|
app: {
|
|
888
757
|
roles: t
|
|
889
758
|
}
|
|
890
|
-
}).then((e) => e.app.roles),
|
|
759
|
+
}).then((e) => e.app.roles), be = (t, e) => g({
|
|
891
760
|
addRole: {
|
|
892
761
|
__args: {
|
|
893
762
|
data: {
|
|
@@ -896,12 +765,12 @@ const st = (t, e, r = F) => {
|
|
|
896
765
|
}
|
|
897
766
|
}
|
|
898
767
|
}
|
|
899
|
-
}).then((r) => r.addRole),
|
|
768
|
+
}).then((r) => r.addRole), me = (t) => g({
|
|
900
769
|
deleteRole: {
|
|
901
770
|
__args: { name: t }
|
|
902
771
|
}
|
|
903
|
-
}).then((e) => e.deleteRole),
|
|
904
|
-
list: (r =
|
|
772
|
+
}).then((e) => e.deleteRole), Tt = (t, e) => ({
|
|
773
|
+
list: (r = at) => t({
|
|
905
774
|
app: { roles: r }
|
|
906
775
|
}).then((s) => s.app.roles),
|
|
907
776
|
create: (r, s) => e({
|
|
@@ -911,96 +780,96 @@ const st = (t, e, r = F) => {
|
|
|
911
780
|
deleteRole: { __args: { name: r } }
|
|
912
781
|
}).then((s) => s.deleteRole)
|
|
913
782
|
});
|
|
914
|
-
function
|
|
783
|
+
function X(t) {
|
|
915
784
|
if (Array.isArray(t))
|
|
916
|
-
return t.map((e) =>
|
|
785
|
+
return t.map((e) => X(e)).filter((e) => e !== void 0);
|
|
917
786
|
if (t !== null && typeof t == "object") {
|
|
918
787
|
const e = Object.getPrototypeOf(t);
|
|
919
788
|
if (e === Object.prototype || e === null)
|
|
920
789
|
return Object.fromEntries(
|
|
921
|
-
Object.entries(t).filter(([, r]) => r !== void 0).map(([r, s]) => [r,
|
|
790
|
+
Object.entries(t).filter(([, r]) => r !== void 0).map(([r, s]) => [r, X(s)])
|
|
922
791
|
);
|
|
923
792
|
}
|
|
924
793
|
return t;
|
|
925
794
|
}
|
|
926
|
-
function
|
|
795
|
+
function ct(t, e, r, s, n) {
|
|
927
796
|
if (!(!t || typeof t != "object"))
|
|
928
|
-
for (let
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
931
|
-
if ("__args" in
|
|
932
|
-
const
|
|
933
|
-
Object.entries(
|
|
934
|
-
if (i instanceof Array &&
|
|
935
|
-
|
|
797
|
+
for (let f in t) {
|
|
798
|
+
const c = t[f];
|
|
799
|
+
if (c && typeof c == "object") {
|
|
800
|
+
if ("__args" in c) {
|
|
801
|
+
const p = X(c.__args), h = {};
|
|
802
|
+
Object.entries(p).forEach(([o, i]) => {
|
|
803
|
+
if (i instanceof Array && T(i)) {
|
|
804
|
+
h[o] = new j(o);
|
|
936
805
|
let a = 0;
|
|
937
|
-
i.forEach((
|
|
938
|
-
|
|
806
|
+
i.forEach((l) => {
|
|
807
|
+
l instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + o + "." + a), s.append(n.current.toString(), l), n.current++, a++);
|
|
939
808
|
}), e[o] = "[Upload!]!";
|
|
940
|
-
} else i instanceof File ? (
|
|
941
|
-
if (
|
|
942
|
-
|
|
809
|
+
} else i instanceof File ? (h[o] = new j(o), r[n.current] = ["variables." + o], s.append(n.current.toString(), i), e[o] = "Upload!", n.current++) : i instanceof Object && K(i) ? (h[o] = {}, Object.entries(i).forEach(([a, l]) => {
|
|
810
|
+
if (l instanceof Array && T(l)) {
|
|
811
|
+
h[o][a] = new j(a);
|
|
943
812
|
let m = 0;
|
|
944
|
-
|
|
813
|
+
l.forEach((d) => {
|
|
945
814
|
d instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + a + "." + m), s.append(n.current.toString(), d), n.current++, m++);
|
|
946
815
|
}), e[a] = "[Upload!]!";
|
|
947
|
-
} else
|
|
948
|
-
})) : i != null && (
|
|
949
|
-
}),
|
|
816
|
+
} else l instanceof File ? (h[o][a] = new j(a), r[n.current] = ["variables." + a], s.append(n.current.toString(), l), e[a] = "Upload!", n.current++) : h[o][a] = l;
|
|
817
|
+
})) : i != null && (h[o] = i);
|
|
818
|
+
}), c.__args = h;
|
|
950
819
|
}
|
|
951
|
-
|
|
820
|
+
ct(c, e, r, s, n);
|
|
952
821
|
}
|
|
953
822
|
}
|
|
954
823
|
}
|
|
955
|
-
const
|
|
824
|
+
const lt = (t) => async (e) => {
|
|
956
825
|
const r = e, s = new FormData();
|
|
957
826
|
let n = !1;
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
let
|
|
961
|
-
const i =
|
|
962
|
-
if (n ? (s.append("map", JSON.stringify(
|
|
827
|
+
const f = {}, c = {};
|
|
828
|
+
ct(r, f, c, s, { current: 0 }), n = Object.keys(f).length > 0, n && (r.__variables = f);
|
|
829
|
+
let h = null;
|
|
830
|
+
const i = x({ mutation: r });
|
|
831
|
+
if (n ? (s.append("map", JSON.stringify(c)), s.append("operations", JSON.stringify({
|
|
963
832
|
query: i
|
|
964
|
-
})),
|
|
833
|
+
})), h = await t.post("", s)) : h = await t.post("", {
|
|
965
834
|
query: i
|
|
966
|
-
}),
|
|
967
|
-
throw new Error(
|
|
968
|
-
return
|
|
969
|
-
}, g = async (t) =>
|
|
835
|
+
}), h.data.errors)
|
|
836
|
+
throw new Error(h.data.errors[0].message);
|
|
837
|
+
return h.data.data;
|
|
838
|
+
}, g = async (t) => lt(I().axios)(t), Ae = (t, e, r) => g({ sendMail: { __args: { email: t, subject: e, message: r } } }).then((s) => s.sendMail), Bt = (t) => ({
|
|
970
839
|
send: (e, r, s) => t({ sendMail: { __args: { email: e, subject: r, message: s } } }).then((n) => n.sendMail)
|
|
971
|
-
}),
|
|
840
|
+
}), Lt = (t) => g({
|
|
972
841
|
lightFSCreateFolder: {
|
|
973
842
|
__args: { location: t }
|
|
974
843
|
}
|
|
975
|
-
}).then((e) => e.lightFSCreateFolder),
|
|
844
|
+
}).then((e) => e.lightFSCreateFolder), Rt = (t) => g({
|
|
976
845
|
lightFSDeleteFolder: {
|
|
977
846
|
__args: { location: t }
|
|
978
847
|
}
|
|
979
|
-
}).then((e) => e.lightFSDeleteFolder),
|
|
848
|
+
}).then((e) => e.lightFSDeleteFolder), Gt = (t, e) => g({
|
|
980
849
|
lightFSRenameFolder: {
|
|
981
850
|
__args: { location: t, newName: e }
|
|
982
851
|
}
|
|
983
|
-
}).then((r) => r.lightFSRenameFolder),
|
|
852
|
+
}).then((r) => r.lightFSRenameFolder), Jt = (t, e) => g({
|
|
984
853
|
lightFSRenameFile: {
|
|
985
854
|
__args: { location: t, newName: e }
|
|
986
855
|
}
|
|
987
|
-
}).then((r) => r.lightFSRenameFile),
|
|
856
|
+
}).then((r) => r.lightFSRenameFile), Qt = (t, e) => g({
|
|
988
857
|
lightFSWriteFile: {
|
|
989
858
|
__args: { location: t, content: e }
|
|
990
859
|
}
|
|
991
|
-
}).then((r) => r.lightFSWriteFile),
|
|
860
|
+
}).then((r) => r.lightFSWriteFile), zt = (t, e, r = !1) => g({
|
|
992
861
|
lightFSUploadFile: {
|
|
993
862
|
__args: { location: t, file: e, rename: r }
|
|
994
863
|
}
|
|
995
|
-
}).then((s) => s.lightFSUploadFile),
|
|
864
|
+
}).then((s) => s.lightFSUploadFile), $t = (t) => g({
|
|
996
865
|
lightFSDeleteFile: {
|
|
997
866
|
__args: { location: t }
|
|
998
867
|
}
|
|
999
|
-
}).then((e) => e.lightFSDeleteFile),
|
|
868
|
+
}).then((e) => e.lightFSDeleteFile), Wt = (t, e) => g({
|
|
1000
869
|
lightFSMove: {
|
|
1001
870
|
__args: { from: t, to: e }
|
|
1002
871
|
}
|
|
1003
|
-
}).then((r) => r.lightFSMove),
|
|
872
|
+
}).then((r) => r.lightFSMove), Ht = (t) => O({
|
|
1004
873
|
app: {
|
|
1005
874
|
fs: {
|
|
1006
875
|
exists: {
|
|
@@ -1008,9 +877,9 @@ const pt = (t) => async (e) => {
|
|
|
1008
877
|
}
|
|
1009
878
|
}
|
|
1010
879
|
}
|
|
1011
|
-
}).then((e) => e.app.fs.exists),
|
|
880
|
+
}).then((e) => e.app.fs.exists), Xt = (t, e) => {
|
|
1012
881
|
const r = {};
|
|
1013
|
-
return t && (r.search = t), e && (r.label = e),
|
|
882
|
+
return t && (r.search = t), e && (r.label = e), O({
|
|
1014
883
|
app: {
|
|
1015
884
|
fs: {
|
|
1016
885
|
find: {
|
|
@@ -1032,7 +901,7 @@ const pt = (t) => async (e) => {
|
|
|
1032
901
|
}
|
|
1033
902
|
}
|
|
1034
903
|
}).then((s) => s.app.fs.find);
|
|
1035
|
-
},
|
|
904
|
+
}, vt = (t) => O({
|
|
1036
905
|
app: {
|
|
1037
906
|
fs: {
|
|
1038
907
|
node: {
|
|
@@ -1062,7 +931,7 @@ const pt = (t) => async (e) => {
|
|
|
1062
931
|
}
|
|
1063
932
|
}
|
|
1064
933
|
}
|
|
1065
|
-
}).then((r) => r.app.fs.node),
|
|
934
|
+
}).then((r) => r.app.fs.node), Yt = (t, e = "text") => O({
|
|
1066
935
|
app: {
|
|
1067
936
|
fs: {
|
|
1068
937
|
node: {
|
|
@@ -1079,7 +948,7 @@ const pt = (t) => async (e) => {
|
|
|
1079
948
|
}).then((r) => {
|
|
1080
949
|
const s = r.app.fs.node;
|
|
1081
950
|
return s?.__typename === "File" ? e === "text" ? s.content : s.base64Content : null;
|
|
1082
|
-
}),
|
|
951
|
+
}), Zt = (t, e) => g({
|
|
1083
952
|
lightFSUploadBase64: {
|
|
1084
953
|
__args: { location: t, base64: e },
|
|
1085
954
|
__typename: !0,
|
|
@@ -1093,11 +962,11 @@ const pt = (t) => async (e) => {
|
|
|
1093
962
|
lastModified: !0
|
|
1094
963
|
}]
|
|
1095
964
|
}
|
|
1096
|
-
}).then((r) => r.lightFSUploadBase64),
|
|
965
|
+
}).then((r) => r.lightFSUploadBase64), Vt = (t) => g({
|
|
1097
966
|
lightFSDuplicateFile: {
|
|
1098
967
|
__args: { location: t }
|
|
1099
968
|
}
|
|
1100
|
-
}).then((e) => e.lightFSDuplicateFile),
|
|
969
|
+
}).then((e) => e.lightFSDuplicateFile), xt = (t, e) => g({
|
|
1101
970
|
lightFSUploadTempFile: {
|
|
1102
971
|
__args: { location: t, file: e },
|
|
1103
972
|
name: !0,
|
|
@@ -1106,9 +975,9 @@ const pt = (t) => async (e) => {
|
|
|
1106
975
|
size: !0,
|
|
1107
976
|
mimeType: !0
|
|
1108
977
|
}
|
|
1109
|
-
}).then((r) => r.lightFSUploadTempFile),
|
|
978
|
+
}).then((r) => r.lightFSUploadTempFile), It = (t, e, r) => {
|
|
1110
979
|
const s = { location: t };
|
|
1111
|
-
return e && (s.type = e), r && (s.search = r),
|
|
980
|
+
return e && (s.type = e), r && (s.search = r), O({
|
|
1112
981
|
app: {
|
|
1113
982
|
fs: {
|
|
1114
983
|
listFiles: {
|
|
@@ -1124,28 +993,28 @@ const pt = (t) => async (e) => {
|
|
|
1124
993
|
}
|
|
1125
994
|
}
|
|
1126
995
|
}).then((n) => n.app.fs.listFiles);
|
|
1127
|
-
},
|
|
996
|
+
}, Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1128
997
|
__proto__: null,
|
|
1129
|
-
createFolder:
|
|
1130
|
-
deleteFile:
|
|
1131
|
-
deleteFolder:
|
|
1132
|
-
duplicateFile:
|
|
1133
|
-
exists:
|
|
1134
|
-
find:
|
|
1135
|
-
list:
|
|
1136
|
-
listFiles:
|
|
1137
|
-
move:
|
|
1138
|
-
readFile:
|
|
1139
|
-
renameFile:
|
|
1140
|
-
renameFolder:
|
|
1141
|
-
uploadBase64:
|
|
1142
|
-
uploadFile:
|
|
1143
|
-
uploadTempFile:
|
|
1144
|
-
writeFile:
|
|
1145
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
998
|
+
createFolder: Lt,
|
|
999
|
+
deleteFile: $t,
|
|
1000
|
+
deleteFolder: Rt,
|
|
1001
|
+
duplicateFile: Vt,
|
|
1002
|
+
exists: Ht,
|
|
1003
|
+
find: Xt,
|
|
1004
|
+
list: vt,
|
|
1005
|
+
listFiles: It,
|
|
1006
|
+
move: Wt,
|
|
1007
|
+
readFile: Yt,
|
|
1008
|
+
renameFile: Jt,
|
|
1009
|
+
renameFolder: Gt,
|
|
1010
|
+
uploadBase64: Zt,
|
|
1011
|
+
uploadFile: zt,
|
|
1012
|
+
uploadTempFile: xt,
|
|
1013
|
+
writeFile: Qt
|
|
1014
|
+
}, Symbol.toStringTag, { value: "Module" })), v = (t) => {
|
|
1146
1015
|
let e = {};
|
|
1147
1016
|
return typeof t == "string" ? (e[t] = !0, e) : t instanceof Array ? (t.forEach((r) => {
|
|
1148
|
-
Object.entries(
|
|
1017
|
+
Object.entries(v(r)).forEach(([s, n]) => {
|
|
1149
1018
|
e[s] = n;
|
|
1150
1019
|
});
|
|
1151
1020
|
}), e) : (Object.entries(t).forEach(([r, s]) => {
|
|
@@ -1157,87 +1026,87 @@ const pt = (t) => async (e) => {
|
|
|
1157
1026
|
e[r] = s;
|
|
1158
1027
|
return;
|
|
1159
1028
|
}
|
|
1160
|
-
e[r] =
|
|
1029
|
+
e[r] = v(s);
|
|
1161
1030
|
}), e);
|
|
1162
|
-
},
|
|
1031
|
+
}, Kt = (t) => v(t), ke = (t) => {
|
|
1163
1032
|
const e = typeof window > "u";
|
|
1164
|
-
let r = [], s = null, n = null,
|
|
1165
|
-
const
|
|
1033
|
+
let r = [], s = null, n = null, f = null, c = null;
|
|
1034
|
+
const p = /* @__PURE__ */ new Set(), h = ht.create({
|
|
1166
1035
|
baseURL: t,
|
|
1167
1036
|
withCredentials: !0
|
|
1168
|
-
}), o = async () => s && !
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1171
|
-
|
|
1037
|
+
}), o = async () => s && !te(s) || !n ? s : (f ??= n().then((u) => (s = u, u)).finally(() => {
|
|
1038
|
+
f = null;
|
|
1039
|
+
}), f);
|
|
1040
|
+
h.interceptors.request.use(async (u) => {
|
|
1172
1041
|
const _ = await o();
|
|
1173
|
-
return _ && (
|
|
1042
|
+
return _ && (u.headers.Authorization = `Bearer ${_}`), u;
|
|
1174
1043
|
});
|
|
1175
1044
|
let i = !1, a = [];
|
|
1176
|
-
const
|
|
1045
|
+
const l = (u, _ = null) => {
|
|
1177
1046
|
a.forEach((y) => {
|
|
1178
|
-
|
|
1047
|
+
u ? y.reject(u) : y.resolve(_);
|
|
1179
1048
|
}), a = [];
|
|
1180
1049
|
};
|
|
1181
|
-
|
|
1182
|
-
(
|
|
1183
|
-
const _ =
|
|
1050
|
+
h.interceptors.response.use(
|
|
1051
|
+
(u) => {
|
|
1052
|
+
const _ = u.data.errors;
|
|
1184
1053
|
if (_ && _.some((y) => y.extensions?.code === "TOKEN_EXPIRED")) {
|
|
1185
|
-
const y =
|
|
1186
|
-
return y._lightTokenRetried ?
|
|
1187
|
-
a.push({ resolve: A, reject:
|
|
1188
|
-
}).then(() =>
|
|
1054
|
+
const y = u.config;
|
|
1055
|
+
return y._lightTokenRetried ? u : (y._lightTokenRetried = !0, n && (s = null), i ? new Promise((A, F) => {
|
|
1056
|
+
a.push({ resolve: A, reject: F });
|
|
1057
|
+
}).then(() => h(y)).catch((A) => Promise.reject(A)) : (i = !0, m().then(() => (i = !1, l(null), h(y))).catch((A) => (i = !1, l(A), Promise.reject(A)))));
|
|
1189
1058
|
}
|
|
1190
|
-
return
|
|
1059
|
+
return u;
|
|
1191
1060
|
},
|
|
1192
|
-
(
|
|
1061
|
+
(u) => Promise.reject(u)
|
|
1193
1062
|
);
|
|
1194
1063
|
function m() {
|
|
1195
1064
|
return n ? o().then(() => {
|
|
1196
|
-
}) :
|
|
1065
|
+
}) : h.post("/refresh_token");
|
|
1197
1066
|
}
|
|
1198
|
-
e && (
|
|
1199
|
-
if (
|
|
1200
|
-
const _ =
|
|
1067
|
+
e && (h.interceptors.request.use((u) => (u.withCredentials = !0, r.length > 0 && (u.headers.Cookie = r.join("; ")), u)), h.interceptors.response.use((u) => {
|
|
1068
|
+
if (u.headers["set-cookie"]) {
|
|
1069
|
+
const _ = u.headers["set-cookie"].map((A) => A.split(";")[0]), y = /* @__PURE__ */ new Map();
|
|
1201
1070
|
r.forEach((A) => {
|
|
1202
|
-
const
|
|
1203
|
-
y.set(
|
|
1071
|
+
const F = A.split("=")[0];
|
|
1072
|
+
y.set(F, A);
|
|
1204
1073
|
}), _.forEach((A) => {
|
|
1205
|
-
const
|
|
1206
|
-
y.set(
|
|
1074
|
+
const F = A.split("=")[0];
|
|
1075
|
+
y.set(F, A);
|
|
1207
1076
|
}), r = Array.from(y.values());
|
|
1208
1077
|
}
|
|
1209
|
-
return
|
|
1078
|
+
return u;
|
|
1210
1079
|
}));
|
|
1211
|
-
const d = rt(
|
|
1212
|
-
const _ =
|
|
1080
|
+
const d = rt(h), b = lt(h), P = (u, _) => G(u, _, d), k = (u, _) => st(u, _, d), U = (u) => {
|
|
1081
|
+
const _ = $(u), y = nt(u, _.$fields, {
|
|
1213
1082
|
mutation: b,
|
|
1214
|
-
createList:
|
|
1215
|
-
createCollection:
|
|
1083
|
+
createList: P,
|
|
1084
|
+
createCollection: k
|
|
1216
1085
|
});
|
|
1217
1086
|
return y.setDataPath(_.getDataPath()), y;
|
|
1218
|
-
},
|
|
1219
|
-
const y = await
|
|
1087
|
+
}, C = kt(d, b), Z = () => p.forEach((u) => u()), N = (u) => (async (..._) => {
|
|
1088
|
+
const y = await u(..._);
|
|
1220
1089
|
return Z(), y;
|
|
1221
|
-
}),
|
|
1222
|
-
...
|
|
1223
|
-
login:
|
|
1090
|
+
}), ut = {
|
|
1091
|
+
...C,
|
|
1092
|
+
login: N(C.login),
|
|
1224
1093
|
logout: (async () => {
|
|
1225
1094
|
try {
|
|
1226
|
-
return await
|
|
1095
|
+
return await C.logout();
|
|
1227
1096
|
} finally {
|
|
1228
1097
|
Z();
|
|
1229
1098
|
}
|
|
1230
1099
|
}),
|
|
1231
|
-
google: { ...
|
|
1232
|
-
facebook: { ...
|
|
1233
|
-
microsoft: { ...
|
|
1234
|
-
webAuthn: { ...
|
|
1100
|
+
google: { ...C.google, login: N(C.google.login) },
|
|
1101
|
+
facebook: { ...C.facebook, login: N(C.facebook.login) },
|
|
1102
|
+
microsoft: { ...C.microsoft, login: N(C.microsoft.login) },
|
|
1103
|
+
webAuthn: { ...C.webAuthn, login: N(C.webAuthn.login) }
|
|
1235
1104
|
}, V = {
|
|
1236
|
-
post:
|
|
1105
|
+
post: h.post.bind(h),
|
|
1237
1106
|
baseURL: t,
|
|
1238
|
-
axios:
|
|
1239
|
-
setAccessToken(
|
|
1240
|
-
s =
|
|
1107
|
+
axios: h,
|
|
1108
|
+
setAccessToken(u) {
|
|
1109
|
+
s = u;
|
|
1241
1110
|
},
|
|
1242
1111
|
getAccessToken() {
|
|
1243
1112
|
return s;
|
|
@@ -1245,139 +1114,132 @@ const pt = (t) => async (e) => {
|
|
|
1245
1114
|
clearAccessToken() {
|
|
1246
1115
|
s = null;
|
|
1247
1116
|
},
|
|
1248
|
-
setAccessTokenProvider(
|
|
1249
|
-
|
|
1117
|
+
setAccessTokenProvider(u) {
|
|
1118
|
+
c?.(), c = null, n = u, s = null, f = null;
|
|
1250
1119
|
},
|
|
1251
|
-
onAuthChange(
|
|
1252
|
-
return
|
|
1120
|
+
onAuthChange(u) {
|
|
1121
|
+
return p.add(u), () => p.delete(u);
|
|
1253
1122
|
},
|
|
1254
|
-
useAudience(
|
|
1255
|
-
|
|
1123
|
+
useAudience(u, _) {
|
|
1124
|
+
c?.(), n = async () => (await u.mutation({
|
|
1256
1125
|
createAudienceAccessToken: {
|
|
1257
1126
|
__args: { audience: _ }
|
|
1258
1127
|
}
|
|
1259
|
-
})).createAudienceAccessToken, s = null,
|
|
1260
|
-
s = null,
|
|
1128
|
+
})).createAudienceAccessToken, s = null, f = null, c = u.onAuthChange(() => {
|
|
1129
|
+
s = null, f = null;
|
|
1261
1130
|
});
|
|
1262
1131
|
},
|
|
1263
|
-
auth:
|
|
1132
|
+
auth: ut,
|
|
1264
1133
|
mutation: b,
|
|
1265
1134
|
query: d,
|
|
1266
|
-
config:
|
|
1267
|
-
mail:
|
|
1268
|
-
users:
|
|
1269
|
-
model(
|
|
1270
|
-
return
|
|
1135
|
+
config: it(d),
|
|
1136
|
+
mail: Bt(b),
|
|
1137
|
+
users: Nt(b, P),
|
|
1138
|
+
model(u) {
|
|
1139
|
+
return U(u);
|
|
1271
1140
|
},
|
|
1272
|
-
roles:
|
|
1273
|
-
collect: (
|
|
1274
|
-
const y =
|
|
1275
|
-
return y.data_path =
|
|
1141
|
+
roles: Tt(d, b),
|
|
1142
|
+
collect: (u, _) => {
|
|
1143
|
+
const y = k(u, _);
|
|
1144
|
+
return y.data_path = $(u).getDataPath(), y;
|
|
1276
1145
|
},
|
|
1277
|
-
list: (
|
|
1146
|
+
list: (u, _) => P(u, _).dataPath($(u).getDataPath()),
|
|
1278
1147
|
/**
|
|
1279
1148
|
* @deprecated Use `fs.*` from `filesystem` instead.
|
|
1280
1149
|
*/
|
|
1281
|
-
|
|
1282
|
-
async collects(h) {
|
|
1150
|
+
async collects(u) {
|
|
1283
1151
|
const _ = {}, y = {};
|
|
1284
|
-
for (const
|
|
1285
|
-
const
|
|
1286
|
-
y[
|
|
1287
|
-
const
|
|
1288
|
-
let
|
|
1289
|
-
for (const
|
|
1290
|
-
if (
|
|
1291
|
-
|
|
1152
|
+
for (const F in u) {
|
|
1153
|
+
const M = u[F].getQueryPayload();
|
|
1154
|
+
y[F] = M.data_path, _[F] = {};
|
|
1155
|
+
const q = M.data_path.split(".");
|
|
1156
|
+
let B = q[q.length - 1], S = _[F];
|
|
1157
|
+
for (const L of q) {
|
|
1158
|
+
if (L === B) {
|
|
1159
|
+
S[L] = M.query;
|
|
1292
1160
|
break;
|
|
1293
1161
|
}
|
|
1294
|
-
|
|
1162
|
+
S[L] = S[L] || {};
|
|
1295
1163
|
}
|
|
1296
|
-
_[
|
|
1164
|
+
_[F].__aliasFor = q[0];
|
|
1297
1165
|
}
|
|
1298
1166
|
const A = await d(_);
|
|
1299
|
-
for (const
|
|
1300
|
-
const
|
|
1301
|
-
let
|
|
1302
|
-
for (const
|
|
1303
|
-
if (
|
|
1304
|
-
|
|
1167
|
+
for (const F in u) {
|
|
1168
|
+
const M = y[F].split(".");
|
|
1169
|
+
let q = M[M.length - 1], B = A[F];
|
|
1170
|
+
for (const S of M) {
|
|
1171
|
+
if (S === q) {
|
|
1172
|
+
u[F]._batchData = A[F][S];
|
|
1305
1173
|
break;
|
|
1306
1174
|
}
|
|
1307
|
-
|
|
1175
|
+
B[S] = B[S] || {};
|
|
1308
1176
|
}
|
|
1309
1177
|
}
|
|
1310
|
-
return
|
|
1178
|
+
return u;
|
|
1311
1179
|
}
|
|
1312
1180
|
};
|
|
1313
|
-
return
|
|
1181
|
+
return pt(V), V;
|
|
1314
1182
|
};
|
|
1315
|
-
function
|
|
1183
|
+
function te(t, e = 30) {
|
|
1316
1184
|
try {
|
|
1317
1185
|
const r = t.split(".")[1];
|
|
1318
1186
|
if (!r) return !0;
|
|
1319
|
-
const s = r.replace(/-/g, "+").replace(/_/g, "/"), n = s.padEnd(Math.ceil(s.length / 4) * 4, "="),
|
|
1320
|
-
return typeof
|
|
1187
|
+
const s = r.replace(/-/g, "+").replace(/_/g, "/"), n = s.padEnd(Math.ceil(s.length / 4) * 4, "="), f = JSON.parse(globalThis.atob(n));
|
|
1188
|
+
return typeof f.exp == "number" ? f.exp <= Math.floor(Date.now() / 1e3) + e : !1;
|
|
1321
1189
|
} catch {
|
|
1322
1190
|
return !0;
|
|
1323
1191
|
}
|
|
1324
1192
|
}
|
|
1325
|
-
const
|
|
1193
|
+
const Oe = G;
|
|
1326
1194
|
export {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1195
|
+
T as arrayHasFile,
|
|
1196
|
+
fe as auth,
|
|
1197
|
+
Ct as changeExpiredPassword,
|
|
1198
|
+
le as clearModels,
|
|
1199
|
+
kt as createAuth,
|
|
1200
|
+
ke as createClient,
|
|
1333
1201
|
st as createCollection,
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
he as createFileFromBase85,
|
|
1202
|
+
it as createConfig,
|
|
1203
|
+
oe as createFileFromBase64,
|
|
1204
|
+
ie as createFileFromBase85,
|
|
1338
1205
|
tt as createFileFromString,
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1206
|
+
G as createList,
|
|
1207
|
+
Bt as createMail,
|
|
1208
|
+
be as createRole,
|
|
1209
|
+
Tt as createRoles,
|
|
1210
|
+
pe as createUser,
|
|
1211
|
+
Nt as createUsers,
|
|
1212
|
+
Q as defaultUserFields,
|
|
1346
1213
|
ot as defineModel,
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
we as
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
De as listRoles,
|
|
1368
|
-
Oe as listUsers,
|
|
1369
|
-
Dt as login,
|
|
1370
|
-
St as logout,
|
|
1214
|
+
ue as defineModels,
|
|
1215
|
+
me as deleteRole,
|
|
1216
|
+
ge as deleteUser,
|
|
1217
|
+
Et as forgetPassword,
|
|
1218
|
+
Fe as fs,
|
|
1219
|
+
I as getApiClient,
|
|
1220
|
+
ne as getApiClientOptional,
|
|
1221
|
+
ye as getConfig,
|
|
1222
|
+
Ot as getCurrentUser,
|
|
1223
|
+
qt as getGrantedRights,
|
|
1224
|
+
$ as getModel,
|
|
1225
|
+
ae as hasModel,
|
|
1226
|
+
Dt as isGranted,
|
|
1227
|
+
Oe as list,
|
|
1228
|
+
ce as listModels,
|
|
1229
|
+
he as listPermissions,
|
|
1230
|
+
we as listRoles,
|
|
1231
|
+
de as listUsers,
|
|
1232
|
+
Pt as login,
|
|
1233
|
+
Ut as logout,
|
|
1371
1234
|
g as mutation,
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
Ot as webAuthn
|
|
1235
|
+
K as objectHasFile,
|
|
1236
|
+
O as query,
|
|
1237
|
+
jt as resetPassword,
|
|
1238
|
+
Ae as sendMail,
|
|
1239
|
+
pt as setApiClient,
|
|
1240
|
+
Kt as toQuery,
|
|
1241
|
+
St as updatePassword,
|
|
1242
|
+
_e as updateUser,
|
|
1243
|
+
Mt as verifyCode,
|
|
1244
|
+
Ft as webAuthn
|
|
1383
1245
|
};
|