@hostlink/light 3.3.2 → 3.4.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 +32 -1
- package/dist/createClient.d.ts +7 -0
- package/dist/light.js +464 -405
- package/dist/light.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/light.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsonToGraphQLQuery as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { jsonToGraphQLQuery as I, VariableType as S } from "json-to-graphql-query";
|
|
2
|
+
import Q from "collect.js";
|
|
3
|
+
import gt from "axios";
|
|
4
|
+
function $(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 W(t, e, r = ".", s) {
|
|
11
|
+
if (!$(e))
|
|
12
|
+
return W(t, {}, r, s);
|
|
13
13
|
const n = Object.assign({}, e);
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
14
|
+
for (const c in t) {
|
|
15
|
+
if (c === "__proto__" || c === "constructor")
|
|
16
16
|
continue;
|
|
17
|
-
const l = t[
|
|
18
|
-
l != null && (s && s(n,
|
|
17
|
+
const l = t[c];
|
|
18
|
+
l != null && (s && s(n, c, l, r) || (Array.isArray(l) && Array.isArray(n[c]) ? n[c] = [...l, ...n[c]] : $(l) && $(n[c]) ? n[c] = W(
|
|
19
19
|
l,
|
|
20
|
-
n[
|
|
21
|
-
(r ? `${r}.` : "") +
|
|
20
|
+
n[c],
|
|
21
|
+
(r ? `${r}.` : "") + c.toString(),
|
|
22
22
|
s
|
|
23
|
-
) : n[
|
|
23
|
+
) : n[c] = l));
|
|
24
24
|
}
|
|
25
25
|
return n;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function dt(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) => W(r, s, "", t), {})
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
33
|
+
const j = dt();
|
|
34
|
+
let q = null;
|
|
35
|
+
const _t = (t) => {
|
|
36
|
+
q = t;
|
|
37
|
+
}, K = () => {
|
|
38
|
+
if (!q)
|
|
39
39
|
throw new Error("Api client not initialized. Call setApiClient() first.");
|
|
40
|
-
return
|
|
41
|
-
},
|
|
42
|
-
function
|
|
40
|
+
return q;
|
|
41
|
+
}, ce = () => q;
|
|
42
|
+
function N(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 x(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 && N(t[e]))
|
|
51
51
|
return !0;
|
|
52
52
|
return !1;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function yt(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,
|
|
56
|
+
var e, r, s, n, c, l = String, f = 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, c = t.length; c > 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(f & r >> 24, f & r >> 16, f & r >> 8, f & r);
|
|
58
58
|
return (function(p, o) {
|
|
59
59
|
for (var i = o; i > 0; i--) p.pop();
|
|
60
60
|
})(s, e.length), l.fromCharCode.apply(l, s);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const tt = (t = "") => {
|
|
63
63
|
const e = t, r = (s = "application/octet-stream") => {
|
|
64
64
|
const n = new Uint8Array(e.length);
|
|
65
65
|
for (let f = 0; f < e.length; f++)
|
|
66
66
|
n[f] = e.charCodeAt(f);
|
|
67
|
-
const
|
|
68
|
-
return URL.createObjectURL(
|
|
67
|
+
const c = new Blob([n], { type: s });
|
|
68
|
+
return URL.createObjectURL(c);
|
|
69
69
|
};
|
|
70
70
|
return {
|
|
71
71
|
getContent: () => e,
|
|
@@ -78,43 +78,43 @@ const H = (t = "") => {
|
|
|
78
78
|
window.open(r(s), "_blank");
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
},
|
|
82
|
-
function
|
|
81
|
+
}, ue = (t) => tt(atob(t)), he = (t) => tt(yt(t));
|
|
82
|
+
function et(t, e, r, s, n) {
|
|
83
83
|
if (!(!t || typeof t != "object"))
|
|
84
|
-
for (let
|
|
85
|
-
const l = t[
|
|
84
|
+
for (let c in t) {
|
|
85
|
+
const l = t[c];
|
|
86
86
|
if (l && typeof l == "object") {
|
|
87
87
|
if ("__args" in l) {
|
|
88
88
|
const f = l.__args, p = {};
|
|
89
89
|
Object.entries(f).forEach(([o, i]) => {
|
|
90
|
-
if (i instanceof Array &&
|
|
91
|
-
p[o] = new
|
|
90
|
+
if (i instanceof Array && N(i)) {
|
|
91
|
+
p[o] = new S(o);
|
|
92
92
|
let a = 0;
|
|
93
|
-
i.forEach((
|
|
94
|
-
|
|
93
|
+
i.forEach((u) => {
|
|
94
|
+
u instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + o + "." + a), s.append(n.current.toString(), u), n.current++, a++);
|
|
95
95
|
}), e[o] = "[Upload!]!";
|
|
96
|
-
} else i instanceof File ? (p[o] = new
|
|
97
|
-
if (
|
|
98
|
-
p[o][a] = new
|
|
96
|
+
} else i instanceof File ? (p[o] = new S(o), r[n.current] = ["variables." + o], s.append(n.current.toString(), i), e[o] = "Upload!", n.current++) : i instanceof Object && x(i) ? (p[o] = {}, Object.entries(i).forEach(([a, u]) => {
|
|
97
|
+
if (u instanceof Array && N(u)) {
|
|
98
|
+
p[o][a] = new S(a);
|
|
99
99
|
let m = 0;
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
u.forEach((d) => {
|
|
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
|
|
103
|
+
} else u instanceof File ? (p[o][a] = new S(a), r[n.current] = ["variables." + a], s.append(n.current.toString(), u), e[a] = "Upload!", n.current++) : p[o][a] = u;
|
|
104
104
|
})) : i != null && (p[o] = i);
|
|
105
105
|
}), l.__args = p;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
et(l, e, r, s, n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const rt = (t) => async (e) => {
|
|
112
112
|
const r = e, s = new FormData();
|
|
113
113
|
let n = !1;
|
|
114
|
-
const
|
|
115
|
-
|
|
114
|
+
const c = {}, l = {};
|
|
115
|
+
et(r, c, l, s, { current: 0 }), n = Object.keys(c).length > 0, n && (r.__variables = c);
|
|
116
116
|
let p = null;
|
|
117
|
-
const i =
|
|
117
|
+
const i = I({ query: r });
|
|
118
118
|
if (n ? (s.append("map", JSON.stringify(l)), s.append("operations", JSON.stringify({
|
|
119
119
|
query: i
|
|
120
120
|
})), p = await t.post("", s)) : p = await t.post("", {
|
|
@@ -122,9 +122,9 @@ const Y = (t) => async (e) => {
|
|
|
122
122
|
}), p.data.errors)
|
|
123
123
|
throw new Error(p.data.errors[0].message);
|
|
124
124
|
return p.data.data;
|
|
125
|
-
}, F = async (t) =>
|
|
126
|
-
function
|
|
127
|
-
let s, n = [],
|
|
125
|
+
}, F = async (t) => rt(K().axios)(t);
|
|
126
|
+
function L(t, e, r = F) {
|
|
127
|
+
let s, n = [], c, l;
|
|
128
128
|
const f = (o) => !o || typeof o != "object" ? !1 : Object.values(o).some((i) => i && typeof i == "object" && Object.keys(i).some((a) => a.startsWith("_"))), p = () => n.length === 0 ? (n.unshift({}), n[0]) : (f(n[0]) && n.unshift({}), n[0]);
|
|
129
129
|
return {
|
|
130
130
|
first() {
|
|
@@ -141,8 +141,8 @@ function v(t, e, r = F) {
|
|
|
141
141
|
let i = await r(this.toQuery(!0));
|
|
142
142
|
if (l) {
|
|
143
143
|
const a = l.split(".");
|
|
144
|
-
for (const
|
|
145
|
-
i = i[
|
|
144
|
+
for (const u of a)
|
|
145
|
+
i = i[u];
|
|
146
146
|
return i;
|
|
147
147
|
}
|
|
148
148
|
return i[`list${t}`];
|
|
@@ -151,8 +151,8 @@ function v(t, e, r = F) {
|
|
|
151
151
|
let i = await r(this.toQuery());
|
|
152
152
|
if (l) {
|
|
153
153
|
const a = l.split(".");
|
|
154
|
-
for (const
|
|
155
|
-
i = i[
|
|
154
|
+
for (const u of a)
|
|
155
|
+
i = i[u];
|
|
156
156
|
return i.data;
|
|
157
157
|
}
|
|
158
158
|
return i[`list${t}`].data;
|
|
@@ -161,7 +161,7 @@ function v(t, e, r = F) {
|
|
|
161
161
|
return o && typeof o == "string" && (l = o), this;
|
|
162
162
|
},
|
|
163
163
|
sort(o) {
|
|
164
|
-
return o && typeof o == "string" && (
|
|
164
|
+
return o && typeof o == "string" && (c = o), this;
|
|
165
165
|
},
|
|
166
166
|
filters(o) {
|
|
167
167
|
return o && typeof o == "object" && (n = [o]), this;
|
|
@@ -170,8 +170,8 @@ function v(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 u = (m, d, b) => {
|
|
174
|
+
const C = {
|
|
175
175
|
">": "_gt",
|
|
176
176
|
"<": "_lt",
|
|
177
177
|
">=": "_gte",
|
|
@@ -179,14 +179,14 @@ function v(t, e, r = F) {
|
|
|
179
179
|
"!=": "_ne",
|
|
180
180
|
in: "_in",
|
|
181
181
|
contains: "_contains"
|
|
182
|
-
}[
|
|
183
|
-
|
|
182
|
+
}[d];
|
|
183
|
+
C && n.push({ [m]: { [C]: b } });
|
|
184
184
|
};
|
|
185
185
|
if (a !== void 0)
|
|
186
|
-
|
|
186
|
+
u(o, String(i), a);
|
|
187
187
|
else {
|
|
188
|
-
const m = p(),
|
|
189
|
-
n[0] =
|
|
188
|
+
const m = p(), d = j(m, { [o]: i });
|
|
189
|
+
n[0] = d;
|
|
190
190
|
}
|
|
191
191
|
return this;
|
|
192
192
|
},
|
|
@@ -194,8 +194,8 @@ function v(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 = p(),
|
|
198
|
-
a[o] ? Array.isArray(a[o]) ? a[o].push(
|
|
197
|
+
const a = p(), u = { _contains: i };
|
|
198
|
+
a[o] ? Array.isArray(a[o]) ? a[o].push(u) : a[o] = [a[o], u] : a[o] = [u], n[0] = a;
|
|
199
199
|
}
|
|
200
200
|
return this;
|
|
201
201
|
},
|
|
@@ -204,59 +204,59 @@ function v(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 = p(),
|
|
208
|
-
a[o] ? Array.isArray(a[o]) ? a[o].push(
|
|
207
|
+
const a = p(), u = { _in: i };
|
|
208
|
+
a[o] ? Array.isArray(a[o]) ? a[o].push(u) : a[o] = [a[o], u] : a[o] = [u], 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 u = p(), m = { _between: [i, a] };
|
|
216
|
+
u[o] ? Array.isArray(u[o]) ? u[o].push(m) : u[o] = [u[o], m] : u[o] = m, n[0] = u;
|
|
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 = j(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 = j(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
|
|
233
|
-
|
|
230
|
+
const a = n.length > 0 && Object.keys(n[0] || {}).length > 0, u = a ? 1 : 0, m = n.length > u;
|
|
231
|
+
a && m ? i = n : m ? i = n.slice(u) : a && (i = n[0]);
|
|
232
|
+
const d = j(
|
|
233
|
+
c ? { sort: c } : {},
|
|
234
234
|
i ? { filters: i } : {}
|
|
235
|
-
),
|
|
235
|
+
), b = {
|
|
236
236
|
data: {
|
|
237
237
|
...e
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
|
-
if (s && (
|
|
240
|
+
if (s && (b.data.__args = s), Object.keys(d).length > 0 && (b.__args = d), o && (b.meta = {
|
|
241
241
|
total: !0,
|
|
242
242
|
key: !0,
|
|
243
243
|
name: !0
|
|
244
244
|
}), l) {
|
|
245
|
-
const
|
|
246
|
-
let
|
|
247
|
-
for (let
|
|
248
|
-
|
|
249
|
-
[
|
|
245
|
+
const O = l.split(".");
|
|
246
|
+
let C = b;
|
|
247
|
+
for (let P = O.length - 1; P >= 0; P--)
|
|
248
|
+
C = {
|
|
249
|
+
[O[P]]: C
|
|
250
250
|
};
|
|
251
|
-
return
|
|
251
|
+
return C;
|
|
252
252
|
}
|
|
253
253
|
return {
|
|
254
|
-
[`list${t}`]:
|
|
254
|
+
[`list${t}`]: b
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const wt = "list", bt = [
|
|
260
260
|
"flatMap",
|
|
261
261
|
"chunk",
|
|
262
262
|
"shuffle",
|
|
@@ -282,7 +282,7 @@ const ct = "list", ht = [
|
|
|
282
282
|
"slice",
|
|
283
283
|
"tap",
|
|
284
284
|
"sort"
|
|
285
|
-
],
|
|
285
|
+
], mt = [
|
|
286
286
|
"avg",
|
|
287
287
|
"count",
|
|
288
288
|
"countBy",
|
|
@@ -310,7 +310,7 @@ const ct = "list", ht = [
|
|
|
310
310
|
"implode",
|
|
311
311
|
"partition"
|
|
312
312
|
];
|
|
313
|
-
class
|
|
313
|
+
class w {
|
|
314
314
|
_batchData = null;
|
|
315
315
|
data_path = "";
|
|
316
316
|
filters;
|
|
@@ -327,7 +327,7 @@ class b {
|
|
|
327
327
|
this.filters = {}, this.steps = [], this.fields = e;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
w.prototype.getQueryPayload = function() {
|
|
331
331
|
let t = {
|
|
332
332
|
meta: {
|
|
333
333
|
total: !0,
|
|
@@ -341,26 +341,26 @@ b.prototype.getQueryPayload = function() {
|
|
|
341
341
|
steps: this.steps
|
|
342
342
|
};
|
|
343
343
|
};
|
|
344
|
-
|
|
344
|
+
w.prototype.dataPath = function(t) {
|
|
345
345
|
const e = this.clone();
|
|
346
346
|
return e.data_path = t, e;
|
|
347
347
|
};
|
|
348
|
-
|
|
348
|
+
w.prototype.buildArgs = function() {
|
|
349
349
|
let t = {};
|
|
350
350
|
return Object.keys(this.filters).length > 0 && (t.filters = this.filters), this._sort && (t.sort = this._sort, this._sortDesc && (t.sort += ":desc")), t;
|
|
351
351
|
};
|
|
352
|
-
|
|
352
|
+
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
|
+
Q().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
362
|
const f = this._batchData;
|
|
363
|
-
return this.meta = f.meta,
|
|
363
|
+
return this.meta = f.meta, Q(f.data);
|
|
364
364
|
}
|
|
365
365
|
let t = {
|
|
366
366
|
meta: {
|
|
@@ -382,37 +382,37 @@ b.prototype.fetchData = async function() {
|
|
|
382
382
|
let l = await (this._queryFn || F)(r);
|
|
383
383
|
for (const f of e)
|
|
384
384
|
l = l[f];
|
|
385
|
-
return this.meta = l.meta,
|
|
385
|
+
return this.meta = l.meta, Q(l.data);
|
|
386
386
|
} catch (t) {
|
|
387
387
|
throw console.error("Error fetching collection data:", t), t;
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
|
|
390
|
+
w.prototype.processData = async function() {
|
|
391
391
|
let t = await this.fetchData();
|
|
392
392
|
for (const e of this.steps)
|
|
393
393
|
t = t[e.type](...e.args);
|
|
394
394
|
return t;
|
|
395
395
|
};
|
|
396
|
-
|
|
396
|
+
w.prototype.all = async function() {
|
|
397
397
|
return (await this.processData()).all();
|
|
398
398
|
};
|
|
399
|
-
for (const t of
|
|
400
|
-
|
|
399
|
+
for (const t of bt)
|
|
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
|
|
405
|
-
|
|
404
|
+
for (const t of mt)
|
|
405
|
+
w.prototype[t] = async function(...e) {
|
|
406
406
|
return (await this.clone().processData())[t](...e);
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
w.prototype.average = w.prototype.avg;
|
|
409
|
+
w.prototype.first = async function() {
|
|
410
410
|
return this.take(1), (await this.processData()).first();
|
|
411
411
|
};
|
|
412
|
-
|
|
412
|
+
w.prototype._handleBatchData = function(t, e) {
|
|
413
413
|
return this._batchData ? (this.steps.push({ type: t, args: e }), this) : null;
|
|
414
414
|
};
|
|
415
|
-
|
|
415
|
+
w.prototype.where = function(...t) {
|
|
416
416
|
const e = this._handleBatchData("where", t);
|
|
417
417
|
if (e) return e;
|
|
418
418
|
if (t.length === 2)
|
|
@@ -444,53 +444,53 @@ b.prototype.where = function(...t) {
|
|
|
444
444
|
}
|
|
445
445
|
return this;
|
|
446
446
|
};
|
|
447
|
-
|
|
447
|
+
w.prototype.whereContains = function(t, e) {
|
|
448
448
|
const r = this._handleBatchData("whereContains", [t, e]);
|
|
449
449
|
return r || (this.filters[t] = { contains: e }, this);
|
|
450
450
|
};
|
|
451
|
-
|
|
451
|
+
w.prototype.forPage = function(t, e) {
|
|
452
452
|
return t = Math.max(1, t), this.already_limit ? (this.steps.push({ type: "forPage", args: [t, e] }), this) : (this.limit = e, this.offset = (t - 1) * e, this.already_limit = !0, this.already_offset = !0, this);
|
|
453
453
|
};
|
|
454
|
-
|
|
454
|
+
w.prototype.whereIn = function(t, e) {
|
|
455
455
|
const r = this._handleBatchData("whereIn", [t, e]);
|
|
456
456
|
return r || (this.filters[t] = { in: e }, this);
|
|
457
457
|
};
|
|
458
|
-
|
|
458
|
+
w.prototype.whereNotIn = function(t, e) {
|
|
459
459
|
const r = this._handleBatchData("whereNotIn", [t, e]);
|
|
460
460
|
return r || (this.filters[t] = { nin: e }, this);
|
|
461
461
|
};
|
|
462
|
-
|
|
462
|
+
w.prototype.whereNotBetween = function(t, e) {
|
|
463
463
|
const r = this._handleBatchData("whereNotBetween", [t, e]);
|
|
464
464
|
return r || (this.filters[t] = { notBetween: e }, this);
|
|
465
465
|
};
|
|
466
|
-
|
|
466
|
+
w.prototype.whereBetween = function(t, e) {
|
|
467
467
|
const r = this._handleBatchData("whereBetween", [t, e]);
|
|
468
468
|
return r || (this.filters[t] = { between: e }, this);
|
|
469
469
|
};
|
|
470
|
-
|
|
470
|
+
w.prototype.sortBy = function(t) {
|
|
471
471
|
return this.steps.push({ type: "sortBy", args: [t] }), typeof t == "string" && (this._sort = t), this;
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
w.prototype.sortByDesc = function(t) {
|
|
474
474
|
return this.steps.push({ type: "sortByDesc", args: [t] }), typeof t == "string" && (this._sort = t, this._sortDesc = !0), this;
|
|
475
475
|
};
|
|
476
|
-
|
|
476
|
+
w.prototype.skip = function(t) {
|
|
477
477
|
if (t < 0)
|
|
478
478
|
throw new Error("Offset must be non-negative");
|
|
479
479
|
return this.already_offset && this.steps.push({ type: "skip", args: [t] }), this.offset = t, this.already_offset = !0, this;
|
|
480
480
|
};
|
|
481
|
-
|
|
481
|
+
w.prototype.take = function(t) {
|
|
482
482
|
if (t < 0)
|
|
483
483
|
throw new Error("Length must be non-negative");
|
|
484
484
|
return this.already_limit ? (this.steps.push({ type: "take", args: [t] }), this) : (this.limit = t, this.already_limit = !0, this);
|
|
485
485
|
};
|
|
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
|
|
490
|
-
const s = new
|
|
491
|
-
return s._queryFn = r, s.data_path =
|
|
492
|
-
},
|
|
493
|
-
const s = r.mutation || g, n = r.createList ||
|
|
489
|
+
const st = (t, e, r = F) => {
|
|
490
|
+
const s = new w(e);
|
|
491
|
+
return s._queryFn = r, s.data_path = wt + t, s;
|
|
492
|
+
}, nt = (t, e = {}, r = {}) => {
|
|
493
|
+
const s = r.mutation || g, n = r.createList || L, c = r.createCollection || st, l = e;
|
|
494
494
|
let f = "list" + t;
|
|
495
495
|
const p = (o) => l[o] ? l[o] : null;
|
|
496
496
|
return {
|
|
@@ -506,9 +506,9 @@ const Z = (t, e, r = F) => {
|
|
|
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 u = p(a);
|
|
510
|
+
u && (i = j(i, u.gqlField ? typeof u.gqlField == "string" ? { [u.gqlField]: !0 } : u.gqlField : { [u.name || a]: !0 }));
|
|
511
|
+
} else typeof a == "object" && (i = j(i, a));
|
|
512
512
|
return i;
|
|
513
513
|
},
|
|
514
514
|
update(o, i) {
|
|
@@ -535,59 +535,59 @@ const Z = (t, e, r = F) => {
|
|
|
535
535
|
fields(o) {
|
|
536
536
|
let i = [];
|
|
537
537
|
for (let a of o) {
|
|
538
|
-
const
|
|
539
|
-
|
|
538
|
+
const u = p(a);
|
|
539
|
+
u && i.push(u);
|
|
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 = c(t, ne(i));
|
|
545
|
+
for (const [u, m] of Object.entries(o))
|
|
546
|
+
a.where(u, "==", m);
|
|
547
547
|
return await a.first();
|
|
548
548
|
},
|
|
549
549
|
list(o) {
|
|
550
550
|
let i = o;
|
|
551
551
|
const a = {};
|
|
552
|
-
Object.entries(o).forEach(([
|
|
553
|
-
l[
|
|
552
|
+
Object.entries(o).forEach(([d]) => {
|
|
553
|
+
l[d] && (a[d] = l[d], l[d].gqlField && (delete i[d], i = j(i, l[d].gqlField)), l[d].gql && (delete i[d], i = j(i, l[d].gql)));
|
|
554
554
|
});
|
|
555
|
-
const
|
|
555
|
+
const u = n(t, i).dataPath(f), m = u.fetch.bind(u);
|
|
556
556
|
return {
|
|
557
|
-
...
|
|
557
|
+
...u,
|
|
558
558
|
async fetch() {
|
|
559
|
-
return (await m()).map((
|
|
560
|
-
const
|
|
561
|
-
return Object.entries(a).forEach(([
|
|
562
|
-
|
|
563
|
-
}),
|
|
559
|
+
return (await m()).map((b) => {
|
|
560
|
+
const O = { ...b };
|
|
561
|
+
return Object.entries(a).forEach(([C, P]) => {
|
|
562
|
+
P.field && typeof P.field == "function" && (O[C] = P.field(b[C], b));
|
|
563
|
+
}), O;
|
|
564
564
|
});
|
|
565
565
|
},
|
|
566
566
|
async fetchFirst() {
|
|
567
|
-
const
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
return Object.entries(a).forEach(([
|
|
571
|
-
|
|
572
|
-
}),
|
|
567
|
+
const b = await u.fetchFirst.bind(u)();
|
|
568
|
+
if (!b) return b;
|
|
569
|
+
const O = { ...b };
|
|
570
|
+
return Object.entries(a).forEach(([C, P]) => {
|
|
571
|
+
P.field && typeof P.field == "function" && (O[C] = P.field(b[C], b));
|
|
572
|
+
}), O;
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
},
|
|
578
|
-
const r =
|
|
579
|
-
return
|
|
580
|
-
},
|
|
581
|
-
Object.keys(
|
|
582
|
-
},
|
|
577
|
+
}, E = {}, ot = (t, e) => {
|
|
578
|
+
const r = nt(t, e);
|
|
579
|
+
return E[t] = r, r;
|
|
580
|
+
}, z = (t) => E[t] ? E[t] : ot(t, {}), pe = (t) => !!E[t], fe = () => Object.keys(E), ge = () => {
|
|
581
|
+
Object.keys(E).forEach((t) => delete E[t]);
|
|
582
|
+
}, de = (t) => {
|
|
583
583
|
Object.entries(t).forEach(([e, r]) => {
|
|
584
|
-
|
|
584
|
+
ot(e, r);
|
|
585
585
|
});
|
|
586
|
-
},
|
|
586
|
+
}, _e = () => F({
|
|
587
587
|
app: {
|
|
588
588
|
permissions: !0
|
|
589
589
|
}
|
|
590
|
-
}).then((t) => t.app.permissions),
|
|
590
|
+
}).then((t) => t.app.permissions), Y = (t, e) => {
|
|
591
591
|
const r = async () => {
|
|
592
592
|
const { app: l } = await t({
|
|
593
593
|
app: {
|
|
@@ -626,20 +626,20 @@ const Z = (t, e, r = F) => {
|
|
|
626
626
|
}
|
|
627
627
|
}).then((f) => f.webAuthnRegister);
|
|
628
628
|
} };
|
|
629
|
-
},
|
|
629
|
+
}, G = Y(F, g), Ft = G.assertion, At = G.attestation, kt = G.login, Ct = G.register, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
630
630
|
__proto__: null,
|
|
631
|
-
assertion:
|
|
632
|
-
attestation:
|
|
633
|
-
createWebAuthn:
|
|
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((
|
|
631
|
+
assertion: Ft,
|
|
632
|
+
attestation: At,
|
|
633
|
+
createWebAuthn: Y,
|
|
634
|
+
login: kt,
|
|
635
|
+
register: Ct
|
|
636
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = (t, e) => ({
|
|
637
|
+
getCurrentUser: (r = J) => t({ my: r }).then((s) => s.my),
|
|
638
|
+
login: (r, s, n = "") => e({ login: { __args: { username: r, password: s, code: n } } }).then((c) => c.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((c) => c.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((c) => c.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({
|
|
@@ -648,7 +648,7 @@ const Z = (t, e, r = F) => {
|
|
|
648
648
|
isGranted: (r) => t({
|
|
649
649
|
my: { granted: { __args: { right: r } } }
|
|
650
650
|
}).then((s) => s.my.granted),
|
|
651
|
-
webAuthn:
|
|
651
|
+
webAuthn: Y(t, e),
|
|
652
652
|
google: {
|
|
653
653
|
unlink: () => e({ lightAuthUnlinkGoogle: !0 }).then((r) => r.lightAuthUnlinkGoogle),
|
|
654
654
|
login: (r) => e({ lightAuthLoginGoogle: { __args: { credential: r } } }).then((s) => s.lightAuthLoginGoogle),
|
|
@@ -664,7 +664,7 @@ const Z = (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
|
+
}), Ut = (t = J) => F({ my: t }).then((e) => e.my), Dt = (t, e, r = "") => g({ login: { __args: { username: t, password: e, code: r } } }).then((s) => s.login), St = () => g({ logout: !0 }).then((t) => t.logout), jt = (t, e, r) => g({ changeExpiredPassword: { __args: { username: t, old_password: e, new_password: r } } }).then((s) => s.changeExpiredPassword), vt = (t, e) => g({ changeUserPassword: { __args: { old_password: t, new_password: e } } }).then((r) => r.changeUserPassword), Et = (t, e, r) => g({ resetPassword: { __args: { jwt: t, password: e, code: r } } }).then((s) => s.resetPassword), Mt = (t, e) => g({ forgetPassword: { __args: { username: t, email: e } } }).then((r) => r.forgetPassword), Tt = (t, e) => g({ forgetPasswordVerifyCode: { __args: { jwt: t, code: e } } }).then((r) => r.forgetPasswordVerifyCode), Nt = (t) => F({
|
|
668
668
|
my: {
|
|
669
669
|
granted: {
|
|
670
670
|
__args: {
|
|
@@ -672,7 +672,7 @@ const Z = (t, e, r = F) => {
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
}).then((e) => e.my.granted),
|
|
675
|
+
}).then((e) => e.my.granted), Rt = (t) => F({
|
|
676
676
|
my: {
|
|
677
677
|
grantedRights: {
|
|
678
678
|
__args: {
|
|
@@ -680,9 +680,9 @@ const Z = (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), ye = {
|
|
684
|
+
getCurrentUser: Ut,
|
|
685
|
+
webAuthn: Ot,
|
|
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,22 +698,22 @@ const Z = (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
|
-
},
|
|
701
|
+
login: Dt,
|
|
702
|
+
logout: St,
|
|
703
|
+
changeExpiredPassword: jt,
|
|
704
|
+
updatePassword: vt,
|
|
705
|
+
resetPassword: Et,
|
|
706
|
+
forgetPassword: Mt,
|
|
707
|
+
verifyCode: Tt,
|
|
708
|
+
grantedRights: Rt,
|
|
709
|
+
isGranted: Nt
|
|
710
|
+
}, it = {
|
|
711
711
|
name: !0,
|
|
712
712
|
path: !0,
|
|
713
713
|
size: !0,
|
|
714
714
|
mime: !0,
|
|
715
715
|
url: !0
|
|
716
|
-
},
|
|
716
|
+
}, we = (t, e, r = it) => F({
|
|
717
717
|
app: {
|
|
718
718
|
drive: {
|
|
719
719
|
__args: { index: t },
|
|
@@ -723,7 +723,7 @@ const Z = (t, e, r = F) => {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
}).then((s) => s.app.drive.files),
|
|
726
|
+
}).then((s) => s.app.drive.files), be = (t, e) => F({
|
|
727
727
|
app: {
|
|
728
728
|
drive: {
|
|
729
729
|
__args: {
|
|
@@ -737,8 +737,8 @@ const Z = (t, e, r = F) => {
|
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
}).then((r) => r.app.drive?.file?.base64Content),
|
|
741
|
-
list: (s, n =
|
|
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
742
|
get: (s, n = {
|
|
743
743
|
name: !0,
|
|
744
744
|
path: !0,
|
|
@@ -759,7 +759,7 @@ const Z = (t, e, r = F) => {
|
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
}).then((
|
|
762
|
+
}).then((c) => c.app.drive.file),
|
|
763
763
|
readFileAsBase64(s) {
|
|
764
764
|
return e({ app: { drive: { __args: { index: t }, file: { __args: { path: s }, base64Content: !0 } } } }).then((n) => n.app.drive?.file?.base64Content);
|
|
765
765
|
},
|
|
@@ -783,14 +783,14 @@ const Z = (t, e, r = F) => {
|
|
|
783
783
|
throw new Error(`File not found or cannot read content: ${s}`);
|
|
784
784
|
return typeof window < "u" && window.atob ? window.atob(n.app.drive.file.base64Content) : n.app.drive.file.base64Content;
|
|
785
785
|
},
|
|
786
|
-
write: (s, n) => r({ lightDriveWriteFile: { __args: { index: t, path: s, content: n } } }).then((
|
|
786
|
+
write: (s, n) => r({ lightDriveWriteFile: { __args: { index: t, path: s, content: n } } }).then((c) => c.lightDriveWriteFile),
|
|
787
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((
|
|
789
|
-
move: (s, n) => r({ lightDriveMoveFile: { __args: { index: t, source: s, destination: n } } }).then((
|
|
790
|
-
}),
|
|
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
791
|
name: !0,
|
|
792
792
|
path: !0
|
|
793
|
-
},
|
|
793
|
+
}, me = (t, e, r = at) => F({
|
|
794
794
|
app: {
|
|
795
795
|
drive: {
|
|
796
796
|
__args: { index: t },
|
|
@@ -800,20 +800,20 @@ const Z = (t, e, r = F) => {
|
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
}).then((s) => s.app.drive.folders),
|
|
804
|
-
list: (s, n =
|
|
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
805
|
create: (s) => r({ lightDriveCreateFolder: { __args: { index: t, path: s } } }).then((n) => n.lightDriveCreateFolder),
|
|
806
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((
|
|
808
|
-
}),
|
|
807
|
+
rename: (s, n) => r({ lightDriveRenameFolder: { __args: { index: t, path: s, name: n } } }).then((c) => c.lightDriveRenameFolder)
|
|
808
|
+
}), Fe = () => F({
|
|
809
809
|
app: {
|
|
810
810
|
drives: {
|
|
811
811
|
index: !0,
|
|
812
812
|
name: !0
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
}).then((t) => t.app.drives),
|
|
816
|
-
const s =
|
|
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
817
|
return {
|
|
818
818
|
folders: n,
|
|
819
819
|
files: s,
|
|
@@ -828,9 +828,9 @@ const Z = (t, e, r = F) => {
|
|
|
828
828
|
createFolder: n.create,
|
|
829
829
|
deleteFolder: n.delete,
|
|
830
830
|
renameFolder: n.rename,
|
|
831
|
-
uploadTempFile: (
|
|
831
|
+
uploadTempFile: (c) => e({
|
|
832
832
|
lightDriveUploadTempFile: {
|
|
833
|
-
__args: { index: r, file:
|
|
833
|
+
__args: { index: r, file: c },
|
|
834
834
|
name: !0,
|
|
835
835
|
path: !0,
|
|
836
836
|
size: !0,
|
|
@@ -838,26 +838,26 @@ const Z = (t, e, r = F) => {
|
|
|
838
838
|
}
|
|
839
839
|
}).then((l) => l.lightDriveUploadTempFile)
|
|
840
840
|
};
|
|
841
|
-
},
|
|
841
|
+
}, J = {
|
|
842
842
|
user_id: !0,
|
|
843
843
|
username: !0,
|
|
844
844
|
first_name: !0,
|
|
845
845
|
last_name: !0,
|
|
846
846
|
status: !0
|
|
847
|
-
},
|
|
847
|
+
}, ke = (t) => g({
|
|
848
848
|
addUser: {
|
|
849
849
|
__args: t
|
|
850
850
|
}
|
|
851
|
-
}).then((e) => e.addUser),
|
|
851
|
+
}).then((e) => e.addUser), Ce = (t) => g({
|
|
852
852
|
deleteUser: {
|
|
853
853
|
__args: { id: t }
|
|
854
854
|
}
|
|
855
|
-
}).then((e) => e.deleteUser),
|
|
855
|
+
}).then((e) => e.deleteUser), Oe = (t = J) => L("Users", t).dataPath("app.listUser").fetch(), Pe = (t, e) => g({
|
|
856
856
|
updateUser: {
|
|
857
857
|
__args: { id: t, data: e }
|
|
858
858
|
}
|
|
859
|
-
}).then((r) => r.updateUser),
|
|
860
|
-
list: (r =
|
|
859
|
+
}).then((r) => r.updateUser), Lt = (t, e) => ({
|
|
860
|
+
list: (r = J) => e("Users", r).dataPath("app.listUser").fetch(),
|
|
861
861
|
create: (r) => t({
|
|
862
862
|
addUser: { __args: r }
|
|
863
863
|
}).then((s) => s.addUser),
|
|
@@ -867,7 +867,7 @@ const Z = (t, e, r = F) => {
|
|
|
867
867
|
update: (r, s) => t({
|
|
868
868
|
updateUser: { __args: { id: r, data: s } }
|
|
869
869
|
}).then((n) => n.updateUser)
|
|
870
|
-
}),
|
|
870
|
+
}), ct = (t) => (e) => t({
|
|
871
871
|
app: {
|
|
872
872
|
listConfig: {
|
|
873
873
|
__args: {
|
|
@@ -881,13 +881,13 @@ const Z = (t, e, r = F) => {
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
}).then((r) => r.app.listConfig.data[0]?.value),
|
|
884
|
+
}).then((r) => r.app.listConfig.data[0]?.value), Ue = ct(F), ut = {
|
|
885
885
|
name: !0
|
|
886
|
-
},
|
|
886
|
+
}, De = (t = ut) => F({
|
|
887
887
|
app: {
|
|
888
888
|
roles: t
|
|
889
889
|
}
|
|
890
|
-
}).then((e) => e.app.roles),
|
|
890
|
+
}).then((e) => e.app.roles), Se = (t, e) => g({
|
|
891
891
|
addRole: {
|
|
892
892
|
__args: {
|
|
893
893
|
data: {
|
|
@@ -896,12 +896,12 @@ const Z = (t, e, r = F) => {
|
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
|
-
}).then((r) => r.addRole),
|
|
899
|
+
}).then((r) => r.addRole), je = (t) => g({
|
|
900
900
|
deleteRole: {
|
|
901
901
|
__args: { name: t }
|
|
902
902
|
}
|
|
903
|
-
}).then((e) => e.deleteRole),
|
|
904
|
-
list: (r =
|
|
903
|
+
}).then((e) => e.deleteRole), Gt = (t, e) => ({
|
|
904
|
+
list: (r = ut) => t({
|
|
905
905
|
app: { roles: r }
|
|
906
906
|
}).then((s) => s.app.roles),
|
|
907
907
|
create: (r, s) => e({
|
|
@@ -911,54 +911,54 @@ const Z = (t, e, r = F) => {
|
|
|
911
911
|
deleteRole: { __args: { name: r } }
|
|
912
912
|
}).then((s) => s.deleteRole)
|
|
913
913
|
});
|
|
914
|
-
function
|
|
914
|
+
function H(t) {
|
|
915
915
|
if (Array.isArray(t))
|
|
916
|
-
return t.map((e) =>
|
|
916
|
+
return t.map((e) => H(e)).filter((e) => e !== void 0);
|
|
917
917
|
if (t !== null && typeof t == "object") {
|
|
918
918
|
const e = Object.getPrototypeOf(t);
|
|
919
919
|
if (e === Object.prototype || e === null)
|
|
920
920
|
return Object.fromEntries(
|
|
921
|
-
Object.entries(t).filter(([, r]) => r !== void 0).map(([r, s]) => [r,
|
|
921
|
+
Object.entries(t).filter(([, r]) => r !== void 0).map(([r, s]) => [r, H(s)])
|
|
922
922
|
);
|
|
923
923
|
}
|
|
924
924
|
return t;
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function ht(t, e, r, s, n) {
|
|
927
927
|
if (!(!t || typeof t != "object"))
|
|
928
|
-
for (let
|
|
929
|
-
const l = t[
|
|
928
|
+
for (let c in t) {
|
|
929
|
+
const l = t[c];
|
|
930
930
|
if (l && typeof l == "object") {
|
|
931
931
|
if ("__args" in l) {
|
|
932
|
-
const f =
|
|
932
|
+
const f = H(l.__args), p = {};
|
|
933
933
|
Object.entries(f).forEach(([o, i]) => {
|
|
934
|
-
if (i instanceof Array &&
|
|
935
|
-
p[o] = new
|
|
934
|
+
if (i instanceof Array && N(i)) {
|
|
935
|
+
p[o] = new S(o);
|
|
936
936
|
let a = 0;
|
|
937
|
-
i.forEach((
|
|
938
|
-
|
|
937
|
+
i.forEach((u) => {
|
|
938
|
+
u instanceof File && (r[n.current] || (r[n.current] = []), r[n.current].push("variables." + o + "." + a), s.append(n.current.toString(), u), n.current++, a++);
|
|
939
939
|
}), e[o] = "[Upload!]!";
|
|
940
|
-
} else i instanceof File ? (p[o] = new
|
|
941
|
-
if (
|
|
942
|
-
p[o][a] = new
|
|
940
|
+
} else i instanceof File ? (p[o] = new S(o), r[n.current] = ["variables." + o], s.append(n.current.toString(), i), e[o] = "Upload!", n.current++) : i instanceof Object && x(i) ? (p[o] = {}, Object.entries(i).forEach(([a, u]) => {
|
|
941
|
+
if (u instanceof Array && N(u)) {
|
|
942
|
+
p[o][a] = new S(a);
|
|
943
943
|
let m = 0;
|
|
944
|
-
|
|
945
|
-
|
|
944
|
+
u.forEach((d) => {
|
|
945
|
+
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
946
|
}), e[a] = "[Upload!]!";
|
|
947
|
-
} else
|
|
947
|
+
} else u instanceof File ? (p[o][a] = new S(a), r[n.current] = ["variables." + a], s.append(n.current.toString(), u), e[a] = "Upload!", n.current++) : p[o][a] = u;
|
|
948
948
|
})) : i != null && (p[o] = i);
|
|
949
949
|
}), l.__args = p;
|
|
950
950
|
}
|
|
951
|
-
|
|
951
|
+
ht(l, e, r, s, n);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const pt = (t) => async (e) => {
|
|
956
956
|
const r = e, s = new FormData();
|
|
957
957
|
let n = !1;
|
|
958
|
-
const
|
|
959
|
-
|
|
958
|
+
const c = {}, l = {};
|
|
959
|
+
ht(r, c, l, s, { current: 0 }), n = Object.keys(c).length > 0, n && (r.__variables = c);
|
|
960
960
|
let p = null;
|
|
961
|
-
const i =
|
|
961
|
+
const i = I({ mutation: r });
|
|
962
962
|
if (n ? (s.append("map", JSON.stringify(l)), s.append("operations", JSON.stringify({
|
|
963
963
|
query: i
|
|
964
964
|
})), p = await t.post("", s)) : p = await t.post("", {
|
|
@@ -966,41 +966,41 @@ const nt = (t) => async (e) => {
|
|
|
966
966
|
}), p.data.errors)
|
|
967
967
|
throw new Error(p.data.errors[0].message);
|
|
968
968
|
return p.data.data;
|
|
969
|
-
}, g = async (t) =>
|
|
969
|
+
}, g = async (t) => pt(K().axios)(t), ve = (t, e, r) => g({ sendMail: { __args: { email: t, subject: e, message: r } } }).then((s) => s.sendMail), Jt = (t) => ({
|
|
970
970
|
send: (e, r, s) => t({ sendMail: { __args: { email: e, subject: r, message: s } } }).then((n) => n.sendMail)
|
|
971
|
-
}),
|
|
971
|
+
}), $t = (t) => g({
|
|
972
972
|
lightFSCreateFolder: {
|
|
973
973
|
__args: { location: t }
|
|
974
974
|
}
|
|
975
|
-
}).then((e) => e.lightFSCreateFolder),
|
|
975
|
+
}).then((e) => e.lightFSCreateFolder), zt = (t) => g({
|
|
976
976
|
lightFSDeleteFolder: {
|
|
977
977
|
__args: { location: t }
|
|
978
978
|
}
|
|
979
|
-
}).then((e) => e.lightFSDeleteFolder),
|
|
979
|
+
}).then((e) => e.lightFSDeleteFolder), Qt = (t, e) => g({
|
|
980
980
|
lightFSRenameFolder: {
|
|
981
981
|
__args: { location: t, newName: e }
|
|
982
982
|
}
|
|
983
|
-
}).then((r) => r.lightFSRenameFolder),
|
|
983
|
+
}).then((r) => r.lightFSRenameFolder), Wt = (t, e) => g({
|
|
984
984
|
lightFSRenameFile: {
|
|
985
985
|
__args: { location: t, newName: e }
|
|
986
986
|
}
|
|
987
|
-
}).then((r) => r.lightFSRenameFile),
|
|
987
|
+
}).then((r) => r.lightFSRenameFile), Ht = (t, e) => g({
|
|
988
988
|
lightFSWriteFile: {
|
|
989
989
|
__args: { location: t, content: e }
|
|
990
990
|
}
|
|
991
|
-
}).then((r) => r.lightFSWriteFile),
|
|
991
|
+
}).then((r) => r.lightFSWriteFile), Xt = (t, e, r = !1) => g({
|
|
992
992
|
lightFSUploadFile: {
|
|
993
993
|
__args: { location: t, file: e, rename: r }
|
|
994
994
|
}
|
|
995
|
-
}).then((s) => s.lightFSUploadFile),
|
|
995
|
+
}).then((s) => s.lightFSUploadFile), Yt = (t) => g({
|
|
996
996
|
lightFSDeleteFile: {
|
|
997
997
|
__args: { location: t }
|
|
998
998
|
}
|
|
999
|
-
}).then((e) => e.lightFSDeleteFile),
|
|
999
|
+
}).then((e) => e.lightFSDeleteFile), Zt = (t, e) => g({
|
|
1000
1000
|
lightFSMove: {
|
|
1001
1001
|
__args: { from: t, to: e }
|
|
1002
1002
|
}
|
|
1003
|
-
}).then((r) => r.lightFSMove),
|
|
1003
|
+
}).then((r) => r.lightFSMove), Vt = (t) => F({
|
|
1004
1004
|
app: {
|
|
1005
1005
|
fs: {
|
|
1006
1006
|
exists: {
|
|
@@ -1008,7 +1008,7 @@ const nt = (t) => async (e) => {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
}).then((e) => e.app.fs.exists),
|
|
1011
|
+
}).then((e) => e.app.fs.exists), It = (t, e) => {
|
|
1012
1012
|
const r = {};
|
|
1013
1013
|
return t && (r.search = t), e && (r.label = e), F({
|
|
1014
1014
|
app: {
|
|
@@ -1032,7 +1032,7 @@ const nt = (t) => async (e) => {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
}).then((s) => s.app.fs.find);
|
|
1035
|
-
},
|
|
1035
|
+
}, Kt = (t) => F({
|
|
1036
1036
|
app: {
|
|
1037
1037
|
fs: {
|
|
1038
1038
|
node: {
|
|
@@ -1062,7 +1062,7 @@ const nt = (t) => async (e) => {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
}).then((r) => r.app.fs.node),
|
|
1065
|
+
}).then((r) => r.app.fs.node), xt = (t, e = "text") => F({
|
|
1066
1066
|
app: {
|
|
1067
1067
|
fs: {
|
|
1068
1068
|
node: {
|
|
@@ -1079,7 +1079,7 @@ const nt = (t) => async (e) => {
|
|
|
1079
1079
|
}).then((r) => {
|
|
1080
1080
|
const s = r.app.fs.node;
|
|
1081
1081
|
return s?.__typename === "File" ? e === "text" ? s.content : s.base64Content : null;
|
|
1082
|
-
}),
|
|
1082
|
+
}), te = (t, e) => g({
|
|
1083
1083
|
lightFSUploadBase64: {
|
|
1084
1084
|
__args: { location: t, base64: e },
|
|
1085
1085
|
__typename: !0,
|
|
@@ -1093,11 +1093,11 @@ const nt = (t) => async (e) => {
|
|
|
1093
1093
|
lastModified: !0
|
|
1094
1094
|
}]
|
|
1095
1095
|
}
|
|
1096
|
-
}).then((r) => r.lightFSUploadBase64),
|
|
1096
|
+
}).then((r) => r.lightFSUploadBase64), ee = (t) => g({
|
|
1097
1097
|
lightFSDuplicateFile: {
|
|
1098
1098
|
__args: { location: t }
|
|
1099
1099
|
}
|
|
1100
|
-
}).then((e) => e.lightFSDuplicateFile),
|
|
1100
|
+
}).then((e) => e.lightFSDuplicateFile), re = (t, e) => g({
|
|
1101
1101
|
lightFSUploadTempFile: {
|
|
1102
1102
|
__args: { location: t, file: e },
|
|
1103
1103
|
name: !0,
|
|
@@ -1106,7 +1106,7 @@ const nt = (t) => async (e) => {
|
|
|
1106
1106
|
size: !0,
|
|
1107
1107
|
mimeType: !0
|
|
1108
1108
|
}
|
|
1109
|
-
}).then((r) => r.lightFSUploadTempFile),
|
|
1109
|
+
}).then((r) => r.lightFSUploadTempFile), se = (t, e, r) => {
|
|
1110
1110
|
const s = { location: t };
|
|
1111
1111
|
return e && (s.type = e), r && (s.search = r), F({
|
|
1112
1112
|
app: {
|
|
@@ -1124,28 +1124,28 @@ const nt = (t) => async (e) => {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
1126
|
}).then((n) => n.app.fs.listFiles);
|
|
1127
|
-
},
|
|
1127
|
+
}, Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1128
1128
|
__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" })),
|
|
1129
|
+
createFolder: $t,
|
|
1130
|
+
deleteFile: Yt,
|
|
1131
|
+
deleteFolder: zt,
|
|
1132
|
+
duplicateFile: ee,
|
|
1133
|
+
exists: Vt,
|
|
1134
|
+
find: It,
|
|
1135
|
+
list: Kt,
|
|
1136
|
+
listFiles: se,
|
|
1137
|
+
move: Zt,
|
|
1138
|
+
readFile: xt,
|
|
1139
|
+
renameFile: Wt,
|
|
1140
|
+
renameFolder: Qt,
|
|
1141
|
+
uploadBase64: te,
|
|
1142
|
+
uploadFile: Xt,
|
|
1143
|
+
uploadTempFile: re,
|
|
1144
|
+
writeFile: Ht
|
|
1145
|
+
}, Symbol.toStringTag, { value: "Module" })), X = (t) => {
|
|
1146
1146
|
let e = {};
|
|
1147
1147
|
return typeof t == "string" ? (e[t] = !0, e) : t instanceof Array ? (t.forEach((r) => {
|
|
1148
|
-
Object.entries(
|
|
1148
|
+
Object.entries(X(r)).forEach(([s, n]) => {
|
|
1149
1149
|
e[s] = n;
|
|
1150
1150
|
});
|
|
1151
1151
|
}), e) : (Object.entries(t).forEach(([r, s]) => {
|
|
@@ -1157,168 +1157,227 @@ const nt = (t) => async (e) => {
|
|
|
1157
1157
|
e[r] = s;
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
1160
|
-
e[r] =
|
|
1160
|
+
e[r] = X(s);
|
|
1161
1161
|
}), e);
|
|
1162
|
-
},
|
|
1162
|
+
}, ne = (t) => X(t), Me = (t) => {
|
|
1163
1163
|
const e = typeof window > "u";
|
|
1164
|
-
let r = [];
|
|
1165
|
-
const
|
|
1164
|
+
let r = [], s = null, n = null, c = null, l = null;
|
|
1165
|
+
const f = /* @__PURE__ */ new Set(), p = gt.create({
|
|
1166
1166
|
baseURL: t,
|
|
1167
1167
|
withCredentials: !0
|
|
1168
|
+
}), o = async () => s && !oe(s) || !n ? s : (c ??= n().then((h) => (s = h, h)).finally(() => {
|
|
1169
|
+
c = null;
|
|
1170
|
+
}), c);
|
|
1171
|
+
p.interceptors.request.use(async (h) => {
|
|
1172
|
+
const _ = await o();
|
|
1173
|
+
return _ && (h.headers.Authorization = `Bearer ${_}`), h;
|
|
1168
1174
|
});
|
|
1169
|
-
let
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
}),
|
|
1175
|
+
let i = !1, a = [];
|
|
1176
|
+
const u = (h, _ = null) => {
|
|
1177
|
+
a.forEach((y) => {
|
|
1178
|
+
h ? y.reject(h) : y.resolve(_);
|
|
1179
|
+
}), a = [];
|
|
1174
1180
|
};
|
|
1175
|
-
|
|
1176
|
-
(
|
|
1177
|
-
const _ =
|
|
1178
|
-
if (_ && _.some((
|
|
1179
|
-
const
|
|
1180
|
-
return n ? new Promise((
|
|
1181
|
-
|
|
1182
|
-
}).then(() =>
|
|
1181
|
+
p.interceptors.response.use(
|
|
1182
|
+
(h) => {
|
|
1183
|
+
const _ = h.data.errors;
|
|
1184
|
+
if (_ && _.some((y) => y.extensions?.code === "TOKEN_EXPIRED")) {
|
|
1185
|
+
const y = h.config;
|
|
1186
|
+
return y._lightTokenRetried ? h : (y._lightTokenRetried = !0, n && (s = null), i ? new Promise((A, k) => {
|
|
1187
|
+
a.push({ resolve: A, reject: k });
|
|
1188
|
+
}).then(() => p(y)).catch((A) => Promise.reject(A)) : (i = !0, m().then(() => (i = !1, u(null), p(y))).catch((A) => (i = !1, u(A), Promise.reject(A)))));
|
|
1183
1189
|
}
|
|
1184
|
-
return
|
|
1190
|
+
return h;
|
|
1185
1191
|
},
|
|
1186
|
-
(
|
|
1192
|
+
(h) => Promise.reject(h)
|
|
1187
1193
|
);
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1194
|
+
function m() {
|
|
1195
|
+
return n ? o().then(() => {
|
|
1196
|
+
}) : p.post("/refresh_token");
|
|
1190
1197
|
}
|
|
1191
|
-
e && (
|
|
1192
|
-
if (
|
|
1193
|
-
const _ =
|
|
1194
|
-
r.forEach((
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
}), _.forEach((
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
}), r = Array.from(
|
|
1198
|
+
e && (p.interceptors.request.use((h) => (h.withCredentials = !0, r.length > 0 && (h.headers.Cookie = r.join("; ")), h)), p.interceptors.response.use((h) => {
|
|
1199
|
+
if (h.headers["set-cookie"]) {
|
|
1200
|
+
const _ = h.headers["set-cookie"].map((A) => A.split(";")[0]), y = /* @__PURE__ */ new Map();
|
|
1201
|
+
r.forEach((A) => {
|
|
1202
|
+
const k = A.split("=")[0];
|
|
1203
|
+
y.set(k, A);
|
|
1204
|
+
}), _.forEach((A) => {
|
|
1205
|
+
const k = A.split("=")[0];
|
|
1206
|
+
y.set(k, A);
|
|
1207
|
+
}), r = Array.from(y.values());
|
|
1201
1208
|
}
|
|
1202
|
-
return
|
|
1209
|
+
return h;
|
|
1203
1210
|
}));
|
|
1204
|
-
const
|
|
1205
|
-
const _ =
|
|
1206
|
-
mutation:
|
|
1207
|
-
createList:
|
|
1208
|
-
createCollection:
|
|
1211
|
+
const d = rt(p), b = pt(p), O = (h, _) => L(h, _, d), C = (h, _) => st(h, _, d), P = (h) => {
|
|
1212
|
+
const _ = z(h), y = nt(h, _.$fields, {
|
|
1213
|
+
mutation: b,
|
|
1214
|
+
createList: O,
|
|
1215
|
+
createCollection: C
|
|
1209
1216
|
});
|
|
1210
|
-
return
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1217
|
+
return y.setDataPath(_.getDataPath()), y;
|
|
1218
|
+
}, U = Pt(d, b), Z = () => f.forEach((h) => h()), T = (h) => (async (..._) => {
|
|
1219
|
+
const y = await h(..._);
|
|
1220
|
+
return Z(), y;
|
|
1221
|
+
}), ft = {
|
|
1222
|
+
...U,
|
|
1223
|
+
login: T(U.login),
|
|
1224
|
+
logout: (async () => {
|
|
1225
|
+
try {
|
|
1226
|
+
return await U.logout();
|
|
1227
|
+
} finally {
|
|
1228
|
+
Z();
|
|
1229
|
+
}
|
|
1230
|
+
}),
|
|
1231
|
+
google: { ...U.google, login: T(U.google.login) },
|
|
1232
|
+
facebook: { ...U.facebook, login: T(U.facebook.login) },
|
|
1233
|
+
microsoft: { ...U.microsoft, login: T(U.microsoft.login) },
|
|
1234
|
+
webAuthn: { ...U.webAuthn, login: T(U.webAuthn.login) }
|
|
1235
|
+
}, V = {
|
|
1236
|
+
post: p.post.bind(p),
|
|
1213
1237
|
baseURL: t,
|
|
1214
|
-
axios:
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1238
|
+
axios: p,
|
|
1239
|
+
setAccessToken(h) {
|
|
1240
|
+
s = h;
|
|
1241
|
+
},
|
|
1242
|
+
getAccessToken() {
|
|
1243
|
+
return s;
|
|
1244
|
+
},
|
|
1245
|
+
clearAccessToken() {
|
|
1246
|
+
s = null;
|
|
1247
|
+
},
|
|
1248
|
+
setAccessTokenProvider(h) {
|
|
1249
|
+
l?.(), l = null, n = h, s = null, c = null;
|
|
1223
1250
|
},
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1251
|
+
onAuthChange(h) {
|
|
1252
|
+
return f.add(h), () => f.delete(h);
|
|
1253
|
+
},
|
|
1254
|
+
useAudience(h, _) {
|
|
1255
|
+
l?.(), n = async () => (await h.mutation({
|
|
1256
|
+
createAudienceAccessToken: {
|
|
1257
|
+
__args: { audience: _ }
|
|
1258
|
+
}
|
|
1259
|
+
})).createAudienceAccessToken, s = null, c = null, l = h.onAuthChange(() => {
|
|
1260
|
+
s = null, c = null;
|
|
1261
|
+
});
|
|
1228
1262
|
},
|
|
1229
|
-
|
|
1263
|
+
auth: ft,
|
|
1264
|
+
mutation: b,
|
|
1265
|
+
query: d,
|
|
1266
|
+
config: ct(d),
|
|
1267
|
+
mail: Jt(b),
|
|
1268
|
+
users: Lt(b, O),
|
|
1269
|
+
model(h) {
|
|
1270
|
+
return P(h);
|
|
1271
|
+
},
|
|
1272
|
+
roles: Gt(d, b),
|
|
1273
|
+
collect: (h, _) => {
|
|
1274
|
+
const y = C(h, _);
|
|
1275
|
+
return y.data_path = z(h).getDataPath(), y;
|
|
1276
|
+
},
|
|
1277
|
+
list: (h, _) => O(h, _).dataPath(z(h).getDataPath()),
|
|
1230
1278
|
/**
|
|
1231
1279
|
* @deprecated Use `fs.*` from `filesystem` instead.
|
|
1232
1280
|
*/
|
|
1233
|
-
drive:
|
|
1234
|
-
async collects(
|
|
1235
|
-
const _ = {},
|
|
1236
|
-
for (const
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
for (const
|
|
1242
|
-
if (
|
|
1243
|
-
|
|
1281
|
+
drive: lt(d, b),
|
|
1282
|
+
async collects(h) {
|
|
1283
|
+
const _ = {}, y = {};
|
|
1284
|
+
for (const k in h) {
|
|
1285
|
+
const v = h[k].getQueryPayload();
|
|
1286
|
+
y[k] = v.data_path, _[k] = {};
|
|
1287
|
+
const M = v.data_path.split(".");
|
|
1288
|
+
let R = M[M.length - 1], D = _[k];
|
|
1289
|
+
for (const B of M) {
|
|
1290
|
+
if (B === R) {
|
|
1291
|
+
D[B] = v.query;
|
|
1244
1292
|
break;
|
|
1245
1293
|
}
|
|
1246
|
-
|
|
1294
|
+
D[B] = D[B] || {};
|
|
1247
1295
|
}
|
|
1248
|
-
_[
|
|
1296
|
+
_[k].__aliasFor = M[0];
|
|
1249
1297
|
}
|
|
1250
|
-
const
|
|
1251
|
-
for (const
|
|
1252
|
-
const
|
|
1253
|
-
let
|
|
1254
|
-
for (const
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1298
|
+
const A = await d(_);
|
|
1299
|
+
for (const k in h) {
|
|
1300
|
+
const v = y[k].split(".");
|
|
1301
|
+
let M = v[v.length - 1], R = A[k];
|
|
1302
|
+
for (const D of v) {
|
|
1303
|
+
if (D === M) {
|
|
1304
|
+
h[k]._batchData = A[k][D];
|
|
1257
1305
|
break;
|
|
1258
1306
|
}
|
|
1259
|
-
|
|
1307
|
+
R[D] = R[D] || {};
|
|
1260
1308
|
}
|
|
1261
1309
|
}
|
|
1262
|
-
return
|
|
1310
|
+
return h;
|
|
1263
1311
|
}
|
|
1264
1312
|
};
|
|
1265
|
-
return
|
|
1266
|
-
}
|
|
1313
|
+
return _t(V), V;
|
|
1314
|
+
};
|
|
1315
|
+
function oe(t, e = 30) {
|
|
1316
|
+
try {
|
|
1317
|
+
const r = t.split(".")[1];
|
|
1318
|
+
if (!r) return !0;
|
|
1319
|
+
const s = r.replace(/-/g, "+").replace(/_/g, "/"), n = s.padEnd(Math.ceil(s.length / 4) * 4, "="), c = JSON.parse(globalThis.atob(n));
|
|
1320
|
+
return typeof c.exp == "number" ? c.exp <= Math.floor(Date.now() / 1e3) + e : !1;
|
|
1321
|
+
} catch {
|
|
1322
|
+
return !0;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
const Te = L;
|
|
1267
1326
|
export {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1327
|
+
N as arrayHasFile,
|
|
1328
|
+
ye as auth,
|
|
1329
|
+
jt as changeExpiredPassword,
|
|
1330
|
+
ge as clearModels,
|
|
1331
|
+
Pt as createAuth,
|
|
1332
|
+
Me as createClient,
|
|
1333
|
+
st as createCollection,
|
|
1334
|
+
ct as createConfig,
|
|
1335
|
+
lt as createDrive,
|
|
1336
|
+
ue as createFileFromBase64,
|
|
1337
|
+
he as createFileFromBase85,
|
|
1338
|
+
tt as createFileFromString,
|
|
1339
|
+
L as createList,
|
|
1340
|
+
Jt as createMail,
|
|
1341
|
+
Se as createRole,
|
|
1342
|
+
Gt as createRoles,
|
|
1343
|
+
ke as createUser,
|
|
1344
|
+
Lt as createUsers,
|
|
1345
|
+
J as defaultUserFields,
|
|
1346
|
+
ot as defineModel,
|
|
1347
|
+
de as defineModels,
|
|
1348
|
+
je as deleteRole,
|
|
1349
|
+
Ce as deleteUser,
|
|
1350
|
+
Mt as forgetPassword,
|
|
1351
|
+
Ee as fs,
|
|
1352
|
+
K as getApiClient,
|
|
1353
|
+
ce as getApiClientOptional,
|
|
1354
|
+
Ue as getConfig,
|
|
1355
|
+
Ut as getCurrentUser,
|
|
1356
|
+
Ae as getDrive,
|
|
1357
|
+
Rt as getGrantedRights,
|
|
1358
|
+
z as getModel,
|
|
1359
|
+
pe as hasModel,
|
|
1360
|
+
Nt as isGranted,
|
|
1361
|
+
Te as list,
|
|
1362
|
+
Fe as listDrives,
|
|
1363
|
+
we as listFiles,
|
|
1364
|
+
me as listFolders,
|
|
1365
|
+
fe as listModels,
|
|
1366
|
+
_e as listPermissions,
|
|
1367
|
+
De as listRoles,
|
|
1368
|
+
Oe as listUsers,
|
|
1369
|
+
Dt as login,
|
|
1370
|
+
St as logout,
|
|
1312
1371
|
g as mutation,
|
|
1313
|
-
|
|
1372
|
+
x as objectHasFile,
|
|
1314
1373
|
F as query,
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1374
|
+
be as readFileAsBase64,
|
|
1375
|
+
Et as resetPassword,
|
|
1376
|
+
ve as sendMail,
|
|
1377
|
+
_t as setApiClient,
|
|
1378
|
+
ne as toQuery,
|
|
1379
|
+
vt as updatePassword,
|
|
1380
|
+
Pe as updateUser,
|
|
1381
|
+
Tt as verifyCode,
|
|
1382
|
+
Ot as webAuthn
|
|
1324
1383
|
};
|