@hostlink/light 3.3.2 → 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 +32 -3
- package/dist/createClient.d.ts +7 -2
- package/dist/index.d.ts +0 -3
- package/dist/light.js +479 -558
- 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
|
-
const
|
|
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 H = (t = "") => {
|
|
|
78
78
|
window.open(r(s), "_blank");
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
},
|
|
82
|
-
function
|
|
81
|
+
}, oe = (t) => tt(atob(t)), ie = (t) => tt(gt(t));
|
|
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
|
-
|
|
101
|
-
|
|
100
|
+
l.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
|
|
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
|
-
|
|
107
|
+
et(c, 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
|
-
|
|
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 v(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 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 l = (m, d, b) => {
|
|
174
|
+
const k = {
|
|
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
|
+
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 =
|
|
189
|
-
n[0] =
|
|
188
|
+
const m = h(), d = E(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 =
|
|
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,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 =
|
|
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
|
|
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: {
|
|
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
|
-
}),
|
|
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
|
-
[`list${t}`]:
|
|
254
|
+
[`list${t}`]: b
|
|
255
255
|
};
|
|
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 ct = "list", ht = [
|
|
|
282
282
|
"slice",
|
|
283
283
|
"tap",
|
|
284
284
|
"sort"
|
|
285
|
-
],
|
|
285
|
+
], yt = [
|
|
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
|
+
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,47 +372,47 @@ b.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
|
}
|
|
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 _t)
|
|
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 yt)
|
|
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,71 +444,71 @@ 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 ||
|
|
494
|
-
let
|
|
495
|
-
const
|
|
489
|
+
const st = (t, e, r = O) => {
|
|
490
|
+
const s = new w(e);
|
|
491
|
+
return s._queryFn = r, s.data_path = dt + t, s;
|
|
492
|
+
}, nt = (t, e = {}, r = {}) => {
|
|
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 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 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
|
-
Object.entries(o).forEach(([
|
|
553
|
-
|
|
552
|
+
Object.entries(o).forEach(([d]) => {
|
|
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
|
-
return (await m()).map((
|
|
560
|
-
const
|
|
561
|
-
return Object.entries(a).forEach(([
|
|
562
|
-
|
|
563
|
-
}),
|
|
559
|
+
return (await m()).map((b) => {
|
|
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
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
return Object.entries(a).forEach(([
|
|
571
|
-
|
|
572
|
-
}),
|
|
567
|
+
const b = await l.fetchFirst.bind(l)();
|
|
568
|
+
if (!b) return b;
|
|
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
|
-
}, D = {},
|
|
578
|
-
const r =
|
|
577
|
+
}, D = {}, ot = (t, e) => {
|
|
578
|
+
const r = nt(t, e);
|
|
579
579
|
return D[t] = r, r;
|
|
580
|
-
},
|
|
580
|
+
}, $ = (t) => D[t] ? D[t] : ot(t, {}), ae = (t) => !!D[t], ce = () => Object.keys(D), le = () => {
|
|
581
581
|
Object.keys(D).forEach((t) => delete D[t]);
|
|
582
|
-
},
|
|
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
|
-
}).then((t) => t.app.permissions),
|
|
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:
|
|
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: wt,
|
|
632
|
+
attestation: bt,
|
|
633
|
+
createWebAuthn: Y,
|
|
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({
|
|
@@ -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
|
+
}), 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 Z = (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 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), 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,153 +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
|
-
},
|
|
711
|
-
name: !0,
|
|
712
|
-
path: !0,
|
|
713
|
-
size: !0,
|
|
714
|
-
mime: !0,
|
|
715
|
-
url: !0
|
|
716
|
-
}, le = (t, e, r = K) => 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), ce = (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), Pt = (t, e = F, r = g) => ({
|
|
741
|
-
list: (s, n = K) => e({ app: { drive: { __args: { index: t }, files: { __args: { path: s }, ...n } } } }).then((h) => h.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((h) => h.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((h) => h.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((h) => h.lightDriveRenameFile),
|
|
789
|
-
move: (s, n) => r({ lightDriveMoveFile: { __args: { index: t, source: s, destination: n } } }).then((h) => h.lightDriveMoveFile)
|
|
790
|
-
}), x = {
|
|
791
|
-
name: !0,
|
|
792
|
-
path: !0
|
|
793
|
-
}, he = (t, e, r = x) => 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), St = (t, e = F, r = g) => ({
|
|
804
|
-
list: (s, n = x) => e({ app: { drive: { __args: { index: t }, folders: { __args: { path: s }, ...n } } } }).then((h) => h.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((h) => h.lightDriveRenameFolder)
|
|
808
|
-
}), ue = () => F({
|
|
809
|
-
app: {
|
|
810
|
-
drives: {
|
|
811
|
-
index: !0,
|
|
812
|
-
name: !0
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
}).then((t) => t.app.drives), pe = (t) => tt(F, g)(t), tt = (t, e) => (r) => {
|
|
816
|
-
const s = Pt(r, t, e), n = St(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: (h) => e({
|
|
832
|
-
lightDriveUploadTempFile: {
|
|
833
|
-
__args: { index: r, file: h },
|
|
834
|
-
name: !0,
|
|
835
|
-
path: !0,
|
|
836
|
-
size: !0,
|
|
837
|
-
mime: !0
|
|
838
|
-
}
|
|
839
|
-
}).then((l) => l.lightDriveUploadTempFile)
|
|
840
|
-
};
|
|
841
|
-
}, B = {
|
|
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
|
}
|
|
@@ -852,12 +721,12 @@ const Z = (t, e, r = F) => {
|
|
|
852
721
|
deleteUser: {
|
|
853
722
|
__args: { id: t }
|
|
854
723
|
}
|
|
855
|
-
}).then((e) => e.deleteUser), de = (t =
|
|
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 Z = (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,9 +750,9 @@ const Z = (t, e, r = F) => {
|
|
|
881
750
|
}
|
|
882
751
|
}
|
|
883
752
|
}
|
|
884
|
-
}).then((r) => r.app.listConfig.data[0]?.value), ye =
|
|
753
|
+
}).then((r) => r.app.listConfig.data[0]?.value), ye = it(O), at = {
|
|
885
754
|
name: !0
|
|
886
|
-
}, we = (t =
|
|
755
|
+
}, we = (t = at) => O({
|
|
887
756
|
app: {
|
|
888
757
|
roles: t
|
|
889
758
|
}
|
|
@@ -900,8 +769,8 @@ const Z = (t, e, r = F) => {
|
|
|
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 Z = (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
|
-
|
|
945
|
-
|
|
813
|
+
l.forEach((d) => {
|
|
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 nt = (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 nt = (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 nt = (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 nt = (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 nt = (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 nt = (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 nt = (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,168 +1026,220 @@ const nt = (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 = [];
|
|
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
|
|
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) => {
|
|
1041
|
+
const _ = await o();
|
|
1042
|
+
return _ && (u.headers.Authorization = `Bearer ${_}`), u;
|
|
1168
1043
|
});
|
|
1169
|
-
let
|
|
1044
|
+
let i = !1, a = [];
|
|
1170
1045
|
const l = (u, _ = null) => {
|
|
1171
|
-
|
|
1172
|
-
u ?
|
|
1173
|
-
}),
|
|
1046
|
+
a.forEach((y) => {
|
|
1047
|
+
u ? y.reject(u) : y.resolve(_);
|
|
1048
|
+
}), a = [];
|
|
1174
1049
|
};
|
|
1175
|
-
|
|
1050
|
+
h.interceptors.response.use(
|
|
1176
1051
|
(u) => {
|
|
1177
1052
|
const _ = u.data.errors;
|
|
1178
|
-
if (_ && _.some((
|
|
1179
|
-
const
|
|
1180
|
-
return n ? new Promise((
|
|
1181
|
-
|
|
1182
|
-
}).then(() =>
|
|
1053
|
+
if (_ && _.some((y) => y.extensions?.code === "TOKEN_EXPIRED")) {
|
|
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)))));
|
|
1183
1058
|
}
|
|
1184
1059
|
return u;
|
|
1185
1060
|
},
|
|
1186
1061
|
(u) => Promise.reject(u)
|
|
1187
1062
|
);
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1063
|
+
function m() {
|
|
1064
|
+
return n ? o().then(() => {
|
|
1065
|
+
}) : h.post("/refresh_token");
|
|
1190
1066
|
}
|
|
1191
|
-
e && (
|
|
1067
|
+
e && (h.interceptors.request.use((u) => (u.withCredentials = !0, r.length > 0 && (u.headers.Cookie = r.join("; ")), u)), h.interceptors.response.use((u) => {
|
|
1192
1068
|
if (u.headers["set-cookie"]) {
|
|
1193
|
-
const _ = u.headers["set-cookie"].map((
|
|
1194
|
-
r.forEach((
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
}), _.forEach((
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
}), r = Array.from(
|
|
1069
|
+
const _ = u.headers["set-cookie"].map((A) => A.split(";")[0]), y = /* @__PURE__ */ new Map();
|
|
1070
|
+
r.forEach((A) => {
|
|
1071
|
+
const F = A.split("=")[0];
|
|
1072
|
+
y.set(F, A);
|
|
1073
|
+
}), _.forEach((A) => {
|
|
1074
|
+
const F = A.split("=")[0];
|
|
1075
|
+
y.set(F, A);
|
|
1076
|
+
}), r = Array.from(y.values());
|
|
1201
1077
|
}
|
|
1202
1078
|
return u;
|
|
1203
1079
|
}));
|
|
1204
|
-
const
|
|
1205
|
-
const _ =
|
|
1206
|
-
mutation:
|
|
1207
|
-
createList:
|
|
1208
|
-
createCollection:
|
|
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, {
|
|
1082
|
+
mutation: b,
|
|
1083
|
+
createList: P,
|
|
1084
|
+
createCollection: k
|
|
1209
1085
|
});
|
|
1210
|
-
return
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1086
|
+
return y.setDataPath(_.getDataPath()), y;
|
|
1087
|
+
}, C = kt(d, b), Z = () => p.forEach((u) => u()), N = (u) => (async (..._) => {
|
|
1088
|
+
const y = await u(..._);
|
|
1089
|
+
return Z(), y;
|
|
1090
|
+
}), ut = {
|
|
1091
|
+
...C,
|
|
1092
|
+
login: N(C.login),
|
|
1093
|
+
logout: (async () => {
|
|
1094
|
+
try {
|
|
1095
|
+
return await C.logout();
|
|
1096
|
+
} finally {
|
|
1097
|
+
Z();
|
|
1098
|
+
}
|
|
1099
|
+
}),
|
|
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) }
|
|
1104
|
+
}, V = {
|
|
1105
|
+
post: h.post.bind(h),
|
|
1213
1106
|
baseURL: t,
|
|
1214
|
-
axios:
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1107
|
+
axios: h,
|
|
1108
|
+
setAccessToken(u) {
|
|
1109
|
+
s = u;
|
|
1110
|
+
},
|
|
1111
|
+
getAccessToken() {
|
|
1112
|
+
return s;
|
|
1113
|
+
},
|
|
1114
|
+
clearAccessToken() {
|
|
1115
|
+
s = null;
|
|
1116
|
+
},
|
|
1117
|
+
setAccessTokenProvider(u) {
|
|
1118
|
+
c?.(), c = null, n = u, s = null, f = null;
|
|
1119
|
+
},
|
|
1120
|
+
onAuthChange(u) {
|
|
1121
|
+
return p.add(u), () => p.delete(u);
|
|
1122
|
+
},
|
|
1123
|
+
useAudience(u, _) {
|
|
1124
|
+
c?.(), n = async () => (await u.mutation({
|
|
1125
|
+
createAudienceAccessToken: {
|
|
1126
|
+
__args: { audience: _ }
|
|
1127
|
+
}
|
|
1128
|
+
})).createAudienceAccessToken, s = null, f = null, c = u.onAuthChange(() => {
|
|
1129
|
+
s = null, f = null;
|
|
1130
|
+
});
|
|
1131
|
+
},
|
|
1132
|
+
auth: ut,
|
|
1133
|
+
mutation: b,
|
|
1134
|
+
query: d,
|
|
1135
|
+
config: it(d),
|
|
1136
|
+
mail: Bt(b),
|
|
1137
|
+
users: Nt(b, P),
|
|
1221
1138
|
model(u) {
|
|
1222
|
-
return
|
|
1139
|
+
return U(u);
|
|
1223
1140
|
},
|
|
1224
|
-
roles:
|
|
1141
|
+
roles: Tt(d, b),
|
|
1225
1142
|
collect: (u, _) => {
|
|
1226
|
-
const
|
|
1227
|
-
return
|
|
1143
|
+
const y = k(u, _);
|
|
1144
|
+
return y.data_path = $(u).getDataPath(), y;
|
|
1228
1145
|
},
|
|
1229
|
-
list: (u, _) =>
|
|
1146
|
+
list: (u, _) => P(u, _).dataPath($(u).getDataPath()),
|
|
1230
1147
|
/**
|
|
1231
1148
|
* @deprecated Use `fs.*` from `filesystem` instead.
|
|
1232
1149
|
*/
|
|
1233
|
-
drive: tt(p, o),
|
|
1234
1150
|
async collects(u) {
|
|
1235
|
-
const _ = {},
|
|
1236
|
-
for (const
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
for (const
|
|
1242
|
-
if (
|
|
1243
|
-
|
|
1151
|
+
const _ = {}, y = {};
|
|
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;
|
|
1244
1160
|
break;
|
|
1245
1161
|
}
|
|
1246
|
-
|
|
1162
|
+
S[L] = S[L] || {};
|
|
1247
1163
|
}
|
|
1248
|
-
_[
|
|
1164
|
+
_[F].__aliasFor = q[0];
|
|
1249
1165
|
}
|
|
1250
|
-
const
|
|
1251
|
-
for (const
|
|
1252
|
-
const
|
|
1253
|
-
let
|
|
1254
|
-
for (const
|
|
1255
|
-
if (
|
|
1256
|
-
u[
|
|
1166
|
+
const A = await d(_);
|
|
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];
|
|
1257
1173
|
break;
|
|
1258
1174
|
}
|
|
1259
|
-
|
|
1175
|
+
B[S] = B[S] || {};
|
|
1260
1176
|
}
|
|
1261
1177
|
}
|
|
1262
1178
|
return u;
|
|
1263
1179
|
}
|
|
1264
1180
|
};
|
|
1265
|
-
return
|
|
1266
|
-
}
|
|
1181
|
+
return pt(V), V;
|
|
1182
|
+
};
|
|
1183
|
+
function te(t, e = 30) {
|
|
1184
|
+
try {
|
|
1185
|
+
const r = t.split(".")[1];
|
|
1186
|
+
if (!r) return !0;
|
|
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;
|
|
1189
|
+
} catch {
|
|
1190
|
+
return !0;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
const Oe = G;
|
|
1267
1194
|
export {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
Mt as createMail,
|
|
1195
|
+
T as arrayHasFile,
|
|
1196
|
+
fe as auth,
|
|
1197
|
+
Ct as changeExpiredPassword,
|
|
1198
|
+
le as clearModels,
|
|
1199
|
+
kt as createAuth,
|
|
1200
|
+
ke as createClient,
|
|
1201
|
+
st as createCollection,
|
|
1202
|
+
it as createConfig,
|
|
1203
|
+
oe as createFileFromBase64,
|
|
1204
|
+
ie as createFileFromBase85,
|
|
1205
|
+
tt as createFileFromString,
|
|
1206
|
+
G as createList,
|
|
1207
|
+
Bt as createMail,
|
|
1282
1208
|
be as createRole,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1209
|
+
Tt as createRoles,
|
|
1210
|
+
pe as createUser,
|
|
1211
|
+
Nt as createUsers,
|
|
1212
|
+
Q as defaultUserFields,
|
|
1213
|
+
ot as defineModel,
|
|
1214
|
+
ue as defineModels,
|
|
1289
1215
|
me as deleteRole,
|
|
1290
1216
|
ge as deleteUser,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1217
|
+
Et as forgetPassword,
|
|
1218
|
+
Fe as fs,
|
|
1219
|
+
I as getApiClient,
|
|
1220
|
+
ne as getApiClientOptional,
|
|
1295
1221
|
ye as getConfig,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
kt as isGranted,
|
|
1222
|
+
Ot as getCurrentUser,
|
|
1223
|
+
qt as getGrantedRights,
|
|
1224
|
+
$ as getModel,
|
|
1225
|
+
ae as hasModel,
|
|
1226
|
+
Dt as isGranted,
|
|
1302
1227
|
Oe as list,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
he as listFolders,
|
|
1306
|
-
se as listModels,
|
|
1307
|
-
ie as listPermissions,
|
|
1228
|
+
ce as listModels,
|
|
1229
|
+
he as listPermissions,
|
|
1308
1230
|
we as listRoles,
|
|
1309
1231
|
de as listUsers,
|
|
1310
|
-
|
|
1311
|
-
|
|
1232
|
+
Pt as login,
|
|
1233
|
+
Ut as logout,
|
|
1312
1234
|
g as mutation,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
At as updatePassword,
|
|
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,
|
|
1321
1242
|
_e as updateUser,
|
|
1322
|
-
|
|
1323
|
-
|
|
1243
|
+
Mt as verifyCode,
|
|
1244
|
+
Ft as webAuthn
|
|
1324
1245
|
};
|