@hostlink/light 3.0.6 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts +1 -1
- package/dist/createClient.d.ts +23 -17
- package/dist/drive.d.ts +32 -32
- package/dist/index.d.ts +1 -2
- package/dist/light.js +640 -640
- package/dist/light.umd.cjs +1 -1
- package/dist/model.d.ts +0 -4
- package/dist/models.d.ts +346 -2
- package/dist/permission.d.ts +1 -1
- package/dist/users.d.ts +1 -1
- package/package.json +1 -1
package/dist/light.js
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import { jsonToGraphQLQuery as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { jsonToGraphQLQuery as v, VariableType as w } from "json-to-graphql-query";
|
|
2
|
+
import U from "collect.js";
|
|
3
|
+
import z from "axios";
|
|
4
|
+
function j(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
|
|
13
|
-
const
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
10
|
+
function E(t, e, r = ".", n) {
|
|
11
|
+
if (!j(e))
|
|
12
|
+
return E(t, {}, r, n);
|
|
13
|
+
const o = Object.assign({}, e);
|
|
14
|
+
for (const c in t) {
|
|
15
|
+
if (c === "__proto__" || c === "constructor")
|
|
16
16
|
continue;
|
|
17
|
-
const l = t[
|
|
18
|
-
l != null && (n && n(
|
|
17
|
+
const l = t[c];
|
|
18
|
+
l != null && (n && n(o, c, l, r) || (Array.isArray(l) && Array.isArray(o[c]) ? o[c] = [...l, ...o[c]] : j(l) && j(o[c]) ? o[c] = E(
|
|
19
19
|
l,
|
|
20
|
-
|
|
21
|
-
(r ? `${r}.` : "") +
|
|
20
|
+
o[c],
|
|
21
|
+
(r ? `${r}.` : "") + c.toString(),
|
|
22
22
|
n
|
|
23
|
-
) :
|
|
23
|
+
) : o[c] = l));
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return o;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function H(t) {
|
|
28
28
|
return (...e) => (
|
|
29
29
|
// eslint-disable-next-line unicorn/no-array-reduce
|
|
30
|
-
e.reduce((r, n) =>
|
|
30
|
+
e.reduce((r, n) => E(r, n, "", t), {})
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
33
|
+
const m = H();
|
|
34
|
+
let O = null;
|
|
35
|
+
const X = (t) => {
|
|
36
|
+
O = t;
|
|
37
|
+
}, q = () => {
|
|
38
|
+
if (!O)
|
|
39
39
|
throw new Error("Api client not initialized. Call setApiClient() first.");
|
|
40
|
-
return
|
|
41
|
-
},
|
|
42
|
-
function
|
|
40
|
+
return O;
|
|
41
|
+
}, Mt = () => O;
|
|
42
|
+
function A(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 B(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 && A(t[e]))
|
|
51
51
|
return !0;
|
|
52
52
|
return !1;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Y(t) {
|
|
55
55
|
t = "<~" + t + "~>";
|
|
56
|
-
var e, r, 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, n = [],
|
|
58
|
-
return (function(s,
|
|
59
|
-
for (var
|
|
56
|
+
var e, r, n, o, c, l = String, h = 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, n = [], o = 0, c = t.length; c > o; o += 5) r = 52200625 * (t.charCodeAt(o) - 33) + 614125 * (t.charCodeAt(o + 1) - 33) + 7225 * (t.charCodeAt(o + 2) - 33) + 85 * (t.charCodeAt(o + 3) - 33) + (t.charCodeAt(o + 4) - 33), n.push(h & r >> 24, h & r >> 16, h & r >> 8, h & r);
|
|
58
|
+
return (function(s, i) {
|
|
59
|
+
for (var a = i; a > 0; a--) s.pop();
|
|
60
60
|
})(n, e.length), l.fromCharCode.apply(l, n);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const N = (t = "") => {
|
|
63
63
|
const e = t, r = (n = "application/octet-stream") => {
|
|
64
|
-
const
|
|
65
|
-
for (let
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
return URL.createObjectURL(
|
|
64
|
+
const o = new Uint8Array(e.length);
|
|
65
|
+
for (let h = 0; h < e.length; h++)
|
|
66
|
+
o[h] = e.charCodeAt(h);
|
|
67
|
+
const c = new Blob([o], { type: n });
|
|
68
|
+
return URL.createObjectURL(c);
|
|
69
69
|
};
|
|
70
70
|
return {
|
|
71
71
|
getContent: () => e,
|
|
72
72
|
getURL: r,
|
|
73
73
|
download: (n) => {
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const o = document.createElement("a");
|
|
75
|
+
o.download = n, o.href = r(), document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
76
76
|
},
|
|
77
77
|
open: (n) => {
|
|
78
78
|
window.open(r(n), "_blank");
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
},
|
|
82
|
-
function
|
|
81
|
+
}, Jt = (t) => N(atob(t)), Lt = (t) => N(Y(t));
|
|
82
|
+
function M(t, e, r, n, o) {
|
|
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
|
-
const
|
|
89
|
-
Object.entries(
|
|
90
|
-
if (
|
|
91
|
-
s[
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
p instanceof File && (r[
|
|
95
|
-
}), e[
|
|
96
|
-
} else
|
|
97
|
-
if (p instanceof Array &&
|
|
98
|
-
s[
|
|
99
|
-
let
|
|
100
|
-
p.forEach((
|
|
101
|
-
|
|
102
|
-
}), e[
|
|
103
|
-
} else p instanceof File ? (s[
|
|
104
|
-
})) :
|
|
88
|
+
const h = l.__args, s = {};
|
|
89
|
+
Object.entries(h).forEach(([i, a]) => {
|
|
90
|
+
if (a instanceof Array && A(a)) {
|
|
91
|
+
s[i] = new w(i);
|
|
92
|
+
let u = 0;
|
|
93
|
+
a.forEach((p) => {
|
|
94
|
+
p instanceof File && (r[o.current] || (r[o.current] = []), r[o.current].push("variables." + i + "." + u), n.append(o.current.toString(), p), o.current++, u++);
|
|
95
|
+
}), e[i] = "[Upload!]!";
|
|
96
|
+
} else a instanceof File ? (s[i] = new w(i), r[o.current] = ["variables." + i], n.append(o.current.toString(), a), e[i] = "Upload!", o.current++) : a instanceof Object && B(a) ? (s[i] = {}, Object.entries(a).forEach(([u, p]) => {
|
|
97
|
+
if (p instanceof Array && A(p)) {
|
|
98
|
+
s[i][u] = new w(u);
|
|
99
|
+
let _ = 0;
|
|
100
|
+
p.forEach((d) => {
|
|
101
|
+
d instanceof File && (r[o.current] || (r[o.current] = []), r[o.current].push("variables." + u + "." + _), n.append(o.current.toString(), d), o.current++, _++);
|
|
102
|
+
}), e[u] = "[Upload!]!";
|
|
103
|
+
} else p instanceof File ? (s[i][u] = new w(u), r[o.current] = ["variables." + u], n.append(o.current.toString(), p), e[u] = "Upload!", o.current++) : s[i][u] = p;
|
|
104
|
+
})) : a != null && (s[i] = a);
|
|
105
105
|
}), l.__args = s;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
M(l, e, r, n, o);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
const y = async (t) => {
|
|
112
|
-
const e =
|
|
113
|
-
let
|
|
114
|
-
const
|
|
115
|
-
|
|
112
|
+
const { axios: e } = q(), r = t, n = new FormData();
|
|
113
|
+
let o = !1;
|
|
114
|
+
const c = {}, l = {};
|
|
115
|
+
M(r, c, l, n, { current: 0 }), o = Object.keys(c).length > 0, o && (r.__variables = c);
|
|
116
116
|
let s = null;
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
query:
|
|
120
|
-
})), s = await e.
|
|
121
|
-
query:
|
|
117
|
+
const a = v({ query: r });
|
|
118
|
+
if (o ? (n.append("map", JSON.stringify(l)), n.append("operations", JSON.stringify({
|
|
119
|
+
query: a
|
|
120
|
+
})), s = await e.post("", n)) : s = await e.post("", {
|
|
121
|
+
query: a
|
|
122
122
|
}), s.data.errors)
|
|
123
123
|
throw new Error(s.data.errors[0].message);
|
|
124
124
|
return s.data.data;
|
|
125
125
|
};
|
|
126
|
-
function
|
|
127
|
-
let r, n = [],
|
|
128
|
-
const l = (s) => !s || typeof s != "object" ? !1 : Object.values(s).some((
|
|
126
|
+
function C(t, e) {
|
|
127
|
+
let r, n = [], o, c;
|
|
128
|
+
const l = (s) => !s || typeof s != "object" ? !1 : Object.values(s).some((i) => i && typeof i == "object" && Object.keys(i).some((a) => a.startsWith("_"))), h = () => n.length === 0 ? (n.unshift({}), n[0]) : (l(n[0]) && n.unshift({}), n[0]);
|
|
129
129
|
return {
|
|
130
130
|
first() {
|
|
131
131
|
return this.fetchFirst();
|
|
@@ -134,34 +134,34 @@ function k(t, e) {
|
|
|
134
134
|
return this.fetch();
|
|
135
135
|
},
|
|
136
136
|
async fetchFirst() {
|
|
137
|
-
const
|
|
138
|
-
return Array.isArray(
|
|
137
|
+
const i = await this.limit(1).fetch();
|
|
138
|
+
return Array.isArray(i) && i.length > 0 ? i[0] : null;
|
|
139
139
|
},
|
|
140
140
|
async fetchWithMeta() {
|
|
141
|
-
let
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
for (const
|
|
145
|
-
|
|
146
|
-
return
|
|
141
|
+
let i = await y(this.toQuery(!0));
|
|
142
|
+
if (c) {
|
|
143
|
+
const a = c.split(".");
|
|
144
|
+
for (const u of a)
|
|
145
|
+
i = i[u];
|
|
146
|
+
return i;
|
|
147
147
|
}
|
|
148
|
-
return
|
|
148
|
+
return i[`list${t}`];
|
|
149
149
|
},
|
|
150
150
|
async fetch() {
|
|
151
|
-
let
|
|
152
|
-
if (
|
|
153
|
-
const
|
|
154
|
-
for (const
|
|
155
|
-
|
|
156
|
-
return
|
|
151
|
+
let i = await y(this.toQuery());
|
|
152
|
+
if (c) {
|
|
153
|
+
const a = c.split(".");
|
|
154
|
+
for (const u of a)
|
|
155
|
+
i = i[u];
|
|
156
|
+
return i.data;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return i[`list${t}`].data;
|
|
159
159
|
},
|
|
160
160
|
dataPath(s) {
|
|
161
|
-
return s && typeof s == "string" && (
|
|
161
|
+
return s && typeof s == "string" && (c = s), this;
|
|
162
162
|
},
|
|
163
163
|
sort(s) {
|
|
164
|
-
return s && typeof s == "string" && (
|
|
164
|
+
return s && typeof s == "string" && (o = s), this;
|
|
165
165
|
},
|
|
166
166
|
filters(s) {
|
|
167
167
|
return s && typeof s == "object" && (n = [s]), this;
|
|
@@ -169,9 +169,9 @@ function k(t, e) {
|
|
|
169
169
|
// where can be called as:
|
|
170
170
|
// where('key', value) -> exact match
|
|
171
171
|
// where('key', '>', value) -> operator-based (>, <, >=, <=, !=, in, contains)
|
|
172
|
-
where(s,
|
|
173
|
-
const
|
|
174
|
-
const
|
|
172
|
+
where(s, i, a) {
|
|
173
|
+
const u = (p, _, d) => {
|
|
174
|
+
const F = {
|
|
175
175
|
">": "_gt",
|
|
176
176
|
"<": "_lt",
|
|
177
177
|
">=": "_gte",
|
|
@@ -179,182 +179,415 @@ function k(t, e) {
|
|
|
179
179
|
"!=": "_ne",
|
|
180
180
|
in: "_in",
|
|
181
181
|
contains: "_contains"
|
|
182
|
-
}[
|
|
183
|
-
|
|
182
|
+
}[_];
|
|
183
|
+
F && n.push({ [p]: { [F]: d } });
|
|
184
184
|
};
|
|
185
|
-
if (
|
|
186
|
-
|
|
185
|
+
if (a !== void 0)
|
|
186
|
+
u(s, String(i), a);
|
|
187
187
|
else {
|
|
188
|
-
const p =
|
|
189
|
-
n[0] =
|
|
188
|
+
const p = h(), _ = m(p, { [s]: i });
|
|
189
|
+
n[0] = _;
|
|
190
190
|
}
|
|
191
191
|
return this;
|
|
192
192
|
},
|
|
193
193
|
// whereContains adds a _contains filter for a specific field
|
|
194
194
|
// If the same field is used multiple times, it merges them into an array
|
|
195
|
-
whereContains(s,
|
|
195
|
+
whereContains(s, i) {
|
|
196
196
|
if (s && typeof s == "string") {
|
|
197
|
-
const
|
|
198
|
-
|
|
197
|
+
const a = h(), u = { _contains: i };
|
|
198
|
+
a[s] ? Array.isArray(a[s]) ? a[s].push(u) : a[s] = [a[s], u] : a[s] = [u], n[0] = a;
|
|
199
199
|
}
|
|
200
200
|
return this;
|
|
201
201
|
},
|
|
202
202
|
// ...existing code...
|
|
203
203
|
// whereIn adds an _in filter for a specific field
|
|
204
204
|
// If the same field is used multiple times, it merges them into an array
|
|
205
|
-
whereIn(s,
|
|
206
|
-
if (s && typeof s == "string" && Array.isArray(
|
|
207
|
-
const
|
|
208
|
-
|
|
205
|
+
whereIn(s, i) {
|
|
206
|
+
if (s && typeof s == "string" && Array.isArray(i)) {
|
|
207
|
+
const a = h(), u = { _in: i };
|
|
208
|
+
a[s] ? Array.isArray(a[s]) ? a[s].push(u) : a[s] = [a[s], u] : a[s] = [u], n[0] = a;
|
|
209
209
|
}
|
|
210
210
|
return this;
|
|
211
211
|
},
|
|
212
212
|
// whereBetween adds a _between filter for a specific field
|
|
213
|
-
whereBetween(s,
|
|
213
|
+
whereBetween(s, i, a) {
|
|
214
214
|
if (s && typeof s == "string") {
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const u = h(), p = { _between: [i, a] };
|
|
216
|
+
u[s] ? Array.isArray(u[s]) ? u[s].push(p) : u[s] = [u[s], p] : u[s] = p, n[0] = u;
|
|
217
217
|
}
|
|
218
218
|
return this;
|
|
219
219
|
},
|
|
220
220
|
// limit sets paging/limit for the data selection
|
|
221
221
|
limit(s) {
|
|
222
|
-
return typeof s == "number" && Number.isFinite(s) && (r =
|
|
222
|
+
return typeof s == "number" && Number.isFinite(s) && (r = m(r || {}, { limit: s })), this;
|
|
223
223
|
},
|
|
224
224
|
// offset sets the starting index for the data selection
|
|
225
225
|
offset(s) {
|
|
226
|
-
return typeof s == "number" && Number.isFinite(s) && (r =
|
|
226
|
+
return typeof s == "number" && Number.isFinite(s) && (r = m(r || {}, { offset: s })), this;
|
|
227
227
|
},
|
|
228
228
|
toQuery(s = !1) {
|
|
229
|
-
let
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
),
|
|
229
|
+
let i;
|
|
230
|
+
const a = n.length > 0 && Object.keys(n[0] || {}).length > 0, u = a ? 1 : 0, p = n.length > u;
|
|
231
|
+
a && p ? i = n : p ? i = n.slice(u) : a && (i = n[0]);
|
|
232
|
+
const _ = m(
|
|
233
|
+
o ? { sort: o } : {},
|
|
234
|
+
i ? { filters: i } : {}
|
|
235
|
+
), d = {
|
|
236
236
|
data: {
|
|
237
237
|
...e
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
|
-
if (r && (
|
|
240
|
+
if (r && (d.data.__args = r), Object.keys(_).length > 0 && (d.__args = _), s && (d.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 D = c.split(".");
|
|
246
|
+
let F = d;
|
|
247
|
+
for (let k = D.length - 1; k >= 0; k--)
|
|
248
|
+
F = {
|
|
249
|
+
[D[k]]: F
|
|
250
250
|
};
|
|
251
|
-
return
|
|
251
|
+
return F;
|
|
252
252
|
}
|
|
253
253
|
return {
|
|
254
|
-
[`list${t}`]:
|
|
254
|
+
[`list${t}`]: d
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
const Z = "list", V = [
|
|
260
|
+
"flatMap",
|
|
261
|
+
"chunk",
|
|
262
|
+
"shuffle",
|
|
263
|
+
"splice",
|
|
264
|
+
"sortBy",
|
|
265
|
+
"map",
|
|
266
|
+
"reverse",
|
|
267
|
+
"groupBy",
|
|
268
|
+
"keyBy",
|
|
269
|
+
"keys",
|
|
270
|
+
"mapToDictionary",
|
|
271
|
+
"mapWithKeys",
|
|
272
|
+
"nth",
|
|
273
|
+
"skipUntil",
|
|
274
|
+
"skipWhile",
|
|
275
|
+
"takeUntil",
|
|
276
|
+
"takeWhile",
|
|
277
|
+
"unique",
|
|
278
|
+
"pluck",
|
|
279
|
+
"push",
|
|
280
|
+
"only",
|
|
281
|
+
"pad",
|
|
282
|
+
"slice",
|
|
283
|
+
"tap",
|
|
284
|
+
"sort"
|
|
285
|
+
], I = [
|
|
286
|
+
"avg",
|
|
287
|
+
"count",
|
|
288
|
+
"countBy",
|
|
289
|
+
"dd",
|
|
290
|
+
"each",
|
|
291
|
+
"every",
|
|
292
|
+
"filter",
|
|
293
|
+
"firstWhere",
|
|
294
|
+
"isEmpty",
|
|
295
|
+
"isNotEmpty",
|
|
296
|
+
"last",
|
|
297
|
+
"mapToGroups",
|
|
298
|
+
"max",
|
|
299
|
+
"median",
|
|
300
|
+
"min",
|
|
301
|
+
"mode",
|
|
302
|
+
"contains",
|
|
303
|
+
"sole",
|
|
304
|
+
"sort",
|
|
305
|
+
"split",
|
|
306
|
+
"sum",
|
|
307
|
+
"toJson",
|
|
308
|
+
"get",
|
|
309
|
+
"has",
|
|
310
|
+
"implode",
|
|
311
|
+
"partition"
|
|
312
|
+
];
|
|
313
|
+
class g {
|
|
314
|
+
_batchData = null;
|
|
315
|
+
data_path = "";
|
|
316
|
+
filters;
|
|
317
|
+
steps;
|
|
318
|
+
fields;
|
|
319
|
+
already_limit = !1;
|
|
320
|
+
already_offset = !1;
|
|
321
|
+
limit = null;
|
|
322
|
+
offset = null;
|
|
323
|
+
_sort = null;
|
|
324
|
+
_sortDesc = !1;
|
|
325
|
+
meta = {};
|
|
326
|
+
constructor(e) {
|
|
327
|
+
this.filters = {}, this.steps = [], this.fields = e;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
g.prototype.getQueryPayload = function() {
|
|
331
|
+
let t = {
|
|
332
|
+
meta: {
|
|
333
|
+
total: !0,
|
|
334
|
+
key: !0,
|
|
335
|
+
name: !0
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
return t.__args = this.buildArgs(), t.data = this.fields, t.data.__args = t.data.__args || {}, this.limit && (t.data.__args.limit = this.limit), this.offset && (t.data.__args.offset = this.offset), {
|
|
339
|
+
data_path: this.data_path,
|
|
340
|
+
query: t,
|
|
341
|
+
steps: this.steps
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
g.prototype.dataPath = function(t) {
|
|
345
|
+
const e = this.clone();
|
|
346
|
+
return e.data_path = t, e;
|
|
347
|
+
};
|
|
348
|
+
g.prototype.buildArgs = function() {
|
|
349
|
+
let t = {};
|
|
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
|
+
};
|
|
352
|
+
g.prototype.clone = function() {
|
|
353
|
+
const t = Object.create(this);
|
|
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
|
+
};
|
|
356
|
+
U().macro("whereContains", function(t, e) {
|
|
357
|
+
return this.filter((r) => r[t].toLowerCase().includes(e.toLowerCase()));
|
|
358
|
+
});
|
|
359
|
+
g.prototype.fetchData = async function() {
|
|
360
|
+
try {
|
|
361
|
+
if (this._batchData) {
|
|
362
|
+
const h = this._batchData;
|
|
363
|
+
return this.meta = h.meta, U(h.data);
|
|
364
|
+
}
|
|
365
|
+
let t = {
|
|
366
|
+
meta: {
|
|
367
|
+
total: !0,
|
|
368
|
+
key: !0,
|
|
369
|
+
name: !0
|
|
370
|
+
}
|
|
371
|
+
};
|
|
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
|
+
const e = this.data_path.split(".");
|
|
374
|
+
let r = {}, n = r, o = e[e.length - 1];
|
|
375
|
+
for (const h of e) {
|
|
376
|
+
if (h === o) {
|
|
377
|
+
n[h] = t;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
n[h] = {}, n = n[h];
|
|
381
|
+
}
|
|
382
|
+
let l = await y(r);
|
|
383
|
+
for (const h of e)
|
|
384
|
+
l = l[h];
|
|
385
|
+
return this.meta = l.meta, U(l.data);
|
|
386
|
+
} catch (t) {
|
|
387
|
+
throw console.error("Error fetching collection data:", t), t;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
g.prototype.processData = async function() {
|
|
391
|
+
let t = await this.fetchData();
|
|
392
|
+
for (const e of this.steps)
|
|
393
|
+
t = t[e.type](...e.args);
|
|
394
|
+
return t;
|
|
395
|
+
};
|
|
396
|
+
g.prototype.all = async function() {
|
|
397
|
+
return (await this.processData()).all();
|
|
398
|
+
};
|
|
399
|
+
for (const t of V)
|
|
400
|
+
g.prototype[t] = function(...e) {
|
|
401
|
+
const r = this.clone();
|
|
402
|
+
return r.steps.push({ type: t, args: e }), r;
|
|
403
|
+
};
|
|
404
|
+
for (const t of I)
|
|
405
|
+
g.prototype[t] = async function(...e) {
|
|
406
|
+
return (await this.clone().processData())[t](...e);
|
|
407
|
+
};
|
|
408
|
+
g.prototype.average = g.prototype.avg;
|
|
409
|
+
g.prototype.first = async function() {
|
|
410
|
+
return this.take(1), (await this.processData()).first();
|
|
411
|
+
};
|
|
412
|
+
g.prototype._handleBatchData = function(t, e) {
|
|
413
|
+
return this._batchData ? (this.steps.push({ type: t, args: e }), this) : null;
|
|
414
|
+
};
|
|
415
|
+
g.prototype.where = function(...t) {
|
|
416
|
+
const e = this._handleBatchData("where", t);
|
|
417
|
+
if (e) return e;
|
|
418
|
+
if (t.length === 2)
|
|
419
|
+
this.filters[t[0]] = t[1];
|
|
420
|
+
else if (t.length === 3) {
|
|
421
|
+
const r = t[0], n = t[1], o = t[2];
|
|
422
|
+
switch (n) {
|
|
423
|
+
case "==":
|
|
424
|
+
this.filters[r] = o;
|
|
425
|
+
break;
|
|
426
|
+
case "<":
|
|
427
|
+
this.filters[r] = { lt: o };
|
|
428
|
+
break;
|
|
429
|
+
case "<=":
|
|
430
|
+
this.filters[r] = { lte: o };
|
|
431
|
+
break;
|
|
432
|
+
case ">":
|
|
433
|
+
this.filters[r] = { gt: o };
|
|
434
|
+
break;
|
|
435
|
+
case ">=":
|
|
436
|
+
this.filters[r] = { gte: o };
|
|
437
|
+
break;
|
|
438
|
+
case "!==":
|
|
439
|
+
this.filters[r] = { ne: o };
|
|
440
|
+
break;
|
|
441
|
+
default:
|
|
442
|
+
throw new Error(`Unsupported operator: ${n}`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return this;
|
|
446
|
+
};
|
|
447
|
+
g.prototype.whereContains = function(t, e) {
|
|
448
|
+
const r = this._handleBatchData("whereContains", [t, e]);
|
|
449
|
+
return r || (this.filters[t] = { contains: e }, this);
|
|
450
|
+
};
|
|
451
|
+
g.prototype.forPage = function(t, e) {
|
|
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
|
+
};
|
|
454
|
+
g.prototype.whereIn = function(t, e) {
|
|
455
|
+
const r = this._handleBatchData("whereIn", [t, e]);
|
|
456
|
+
return r || (this.filters[t] = { in: e }, this);
|
|
457
|
+
};
|
|
458
|
+
g.prototype.whereNotIn = function(t, e) {
|
|
459
|
+
const r = this._handleBatchData("whereNotIn", [t, e]);
|
|
460
|
+
return r || (this.filters[t] = { nin: e }, this);
|
|
461
|
+
};
|
|
462
|
+
g.prototype.whereNotBetween = function(t, e) {
|
|
463
|
+
const r = this._handleBatchData("whereNotBetween", [t, e]);
|
|
464
|
+
return r || (this.filters[t] = { notBetween: e }, this);
|
|
465
|
+
};
|
|
466
|
+
g.prototype.whereBetween = function(t, e) {
|
|
467
|
+
const r = this._handleBatchData("whereBetween", [t, e]);
|
|
468
|
+
return r || (this.filters[t] = { between: e }, this);
|
|
469
|
+
};
|
|
470
|
+
g.prototype.sortBy = function(t) {
|
|
471
|
+
return this.steps.push({ type: "sortBy", args: [t] }), typeof t == "string" && (this._sort = t), this;
|
|
472
|
+
};
|
|
473
|
+
g.prototype.sortByDesc = function(t) {
|
|
474
|
+
return this.steps.push({ type: "sortByDesc", args: [t] }), typeof t == "string" && (this._sort = t, this._sortDesc = !0), this;
|
|
475
|
+
};
|
|
476
|
+
g.prototype.skip = function(t) {
|
|
477
|
+
if (t < 0)
|
|
478
|
+
throw new Error("Offset must be non-negative");
|
|
479
|
+
return this.already_offset && this.steps.push({ type: "skip", args: [t] }), this.offset = t, this.already_offset = !0, this;
|
|
480
|
+
};
|
|
481
|
+
g.prototype.take = function(t) {
|
|
482
|
+
if (t < 0)
|
|
483
|
+
throw new Error("Length must be non-negative");
|
|
484
|
+
return this.already_limit ? (this.steps.push({ type: "take", args: [t] }), this) : (this.limit = t, this.already_limit = !0, this);
|
|
485
|
+
};
|
|
486
|
+
g.prototype.splice = function(t, e) {
|
|
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
|
+
};
|
|
489
|
+
const J = (t, e) => {
|
|
490
|
+
const r = new g(e);
|
|
491
|
+
return r.data_path = Z + t, r;
|
|
492
|
+
}, K = (t, e = {}) => {
|
|
493
|
+
const r = e;
|
|
494
|
+
let n = "list" + t;
|
|
495
|
+
const o = (c) => r[c] ? r[c] : null;
|
|
263
496
|
return {
|
|
264
|
-
field:
|
|
265
|
-
$fields:
|
|
266
|
-
setDataPath(
|
|
267
|
-
return
|
|
497
|
+
field: o,
|
|
498
|
+
$fields: r,
|
|
499
|
+
setDataPath(c) {
|
|
500
|
+
return n = c, n;
|
|
268
501
|
},
|
|
269
502
|
getDataPath() {
|
|
270
|
-
return
|
|
503
|
+
return n;
|
|
271
504
|
},
|
|
272
|
-
gqlFields(
|
|
273
|
-
let
|
|
274
|
-
for (const
|
|
275
|
-
if (typeof
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
} else typeof
|
|
279
|
-
return
|
|
505
|
+
gqlFields(c) {
|
|
506
|
+
let l = {};
|
|
507
|
+
for (const h of c)
|
|
508
|
+
if (typeof h == "string") {
|
|
509
|
+
const s = o(h);
|
|
510
|
+
s && (l = m(l, s.gqlField ? typeof s.gqlField == "string" ? { [s.gqlField]: !0 } : s.gqlField : { [s.name || h]: !0 }));
|
|
511
|
+
} else typeof h == "object" && (l = m(l, h));
|
|
512
|
+
return l;
|
|
280
513
|
},
|
|
281
|
-
update(
|
|
514
|
+
update(c, l) {
|
|
282
515
|
return f({
|
|
283
|
-
["update" +
|
|
284
|
-
__args: { id:
|
|
516
|
+
["update" + t]: {
|
|
517
|
+
__args: { id: c, data: l }
|
|
285
518
|
}
|
|
286
|
-
}).then((
|
|
519
|
+
}).then((h) => h["update" + t]);
|
|
287
520
|
},
|
|
288
|
-
async delete(
|
|
521
|
+
async delete(c) {
|
|
289
522
|
return f({
|
|
290
|
-
["delete" +
|
|
291
|
-
__args: { id:
|
|
523
|
+
["delete" + t]: {
|
|
524
|
+
__args: { id: c }
|
|
292
525
|
}
|
|
293
|
-
}).then((
|
|
526
|
+
}).then((l) => l["delete" + t]);
|
|
294
527
|
},
|
|
295
|
-
add(
|
|
528
|
+
add(c) {
|
|
296
529
|
return f({
|
|
297
|
-
["add" +
|
|
298
|
-
__args: { data:
|
|
530
|
+
["add" + t]: {
|
|
531
|
+
__args: { data: c }
|
|
299
532
|
}
|
|
300
|
-
}).then((
|
|
533
|
+
}).then((l) => l["add" + t]);
|
|
301
534
|
},
|
|
302
|
-
fields(
|
|
303
|
-
let
|
|
304
|
-
for (let
|
|
305
|
-
const
|
|
306
|
-
|
|
535
|
+
fields(c) {
|
|
536
|
+
let l = [];
|
|
537
|
+
for (let h of c) {
|
|
538
|
+
const s = o(h);
|
|
539
|
+
s && l.push(s);
|
|
307
540
|
}
|
|
308
|
-
return
|
|
541
|
+
return l;
|
|
309
542
|
},
|
|
310
|
-
async get(
|
|
311
|
-
const
|
|
312
|
-
for (const [
|
|
313
|
-
|
|
314
|
-
return await
|
|
543
|
+
async get(c, l) {
|
|
544
|
+
const h = J(t, vt(l));
|
|
545
|
+
for (const [s, i] of Object.entries(c))
|
|
546
|
+
h.where(s, "==", i);
|
|
547
|
+
return await h.first();
|
|
315
548
|
},
|
|
316
|
-
list(
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
Object.entries(
|
|
320
|
-
|
|
549
|
+
list(c) {
|
|
550
|
+
let l = c;
|
|
551
|
+
const h = {};
|
|
552
|
+
Object.entries(c).forEach(([a]) => {
|
|
553
|
+
r[a] && (h[a] = r[a], r[a].gqlField && (delete l[a], l = m(l, r[a].gqlField)), r[a].gql && (l = m(l, r[a].gql), delete l[a]));
|
|
321
554
|
});
|
|
322
|
-
const
|
|
555
|
+
const s = C(t, l).dataPath(n), i = s.fetch.bind(s);
|
|
323
556
|
return {
|
|
324
|
-
...
|
|
557
|
+
...s,
|
|
325
558
|
async fetch() {
|
|
326
|
-
return (await
|
|
327
|
-
const
|
|
328
|
-
return Object.entries(
|
|
329
|
-
|
|
330
|
-
}),
|
|
559
|
+
return (await i()).map((u) => {
|
|
560
|
+
const p = { ...u };
|
|
561
|
+
return Object.entries(h).forEach(([_, d]) => {
|
|
562
|
+
d.format && typeof d.format == "function" && (p[_] = d.format(u));
|
|
563
|
+
}), p;
|
|
331
564
|
});
|
|
332
565
|
},
|
|
333
566
|
async fetchFirst() {
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
336
|
-
const
|
|
337
|
-
return Object.entries(
|
|
338
|
-
|
|
339
|
-
}),
|
|
567
|
+
const u = await s.fetchFirst.bind(s)();
|
|
568
|
+
if (!u) return u;
|
|
569
|
+
const p = { ...u };
|
|
570
|
+
return Object.entries(h).forEach(([_, d]) => {
|
|
571
|
+
d.format && typeof d.format == "function" && (p[_] = d.format(u));
|
|
572
|
+
}), p;
|
|
340
573
|
}
|
|
341
574
|
};
|
|
342
575
|
}
|
|
343
576
|
};
|
|
344
|
-
},
|
|
345
|
-
const r =
|
|
346
|
-
return
|
|
347
|
-
},
|
|
348
|
-
Object.keys(
|
|
349
|
-
},
|
|
577
|
+
}, b = {}, L = (t, e) => {
|
|
578
|
+
const r = K(t, e);
|
|
579
|
+
return b[t] = r, r;
|
|
580
|
+
}, P = (t) => b[t] ? b[t] : L(t, {}), $t = (t) => !!b[t], Qt = () => Object.keys(b), Gt = () => {
|
|
581
|
+
Object.keys(b).forEach((t) => delete b[t]);
|
|
582
|
+
}, Tt = (t) => {
|
|
350
583
|
Object.entries(t).forEach(([e, r]) => {
|
|
351
|
-
|
|
584
|
+
L(e, r);
|
|
352
585
|
});
|
|
353
|
-
},
|
|
586
|
+
}, Rt = () => y({
|
|
354
587
|
app: {
|
|
355
588
|
permissions: !0
|
|
356
589
|
}
|
|
357
|
-
}).then((t) => t.app.permissions),
|
|
590
|
+
}).then((t) => t.app.permissions), $ = async () => {
|
|
358
591
|
const { app: t } = await y({
|
|
359
592
|
app: {
|
|
360
593
|
auth: {
|
|
@@ -363,7 +596,7 @@ const I = (t, e = {}) => {
|
|
|
363
596
|
}
|
|
364
597
|
}), e = t.auth.webAuthnRequestOptions, r = PublicKeyCredential.parseRequestOptionsFromJSON(e);
|
|
365
598
|
return await navigator.credentials.get({ publicKey: r });
|
|
366
|
-
},
|
|
599
|
+
}, Q = async () => {
|
|
367
600
|
const { app: t } = await y({
|
|
368
601
|
app: {
|
|
369
602
|
auth: {
|
|
@@ -372,8 +605,8 @@ const I = (t, e = {}) => {
|
|
|
372
605
|
}
|
|
373
606
|
}), e = PublicKeyCredential.parseCreationOptionsFromJSON(t.auth.webAuthnCreationOptions);
|
|
374
607
|
return await navigator.credentials.create({ publicKey: e });
|
|
375
|
-
},
|
|
376
|
-
const t = await
|
|
608
|
+
}, x = async () => {
|
|
609
|
+
const t = await $();
|
|
377
610
|
return await f({
|
|
378
611
|
webAuthnAssertion: {
|
|
379
612
|
__args: {
|
|
@@ -381,8 +614,8 @@ const I = (t, e = {}) => {
|
|
|
381
614
|
}
|
|
382
615
|
}
|
|
383
616
|
}).then((e) => e.webAuthnAssertion);
|
|
384
|
-
},
|
|
385
|
-
const t = await
|
|
617
|
+
}, tt = async () => {
|
|
618
|
+
const t = await Q();
|
|
386
619
|
return await f({
|
|
387
620
|
webAuthnRegister: {
|
|
388
621
|
__args: {
|
|
@@ -390,13 +623,13 @@ const I = (t, e = {}) => {
|
|
|
390
623
|
}
|
|
391
624
|
}
|
|
392
625
|
}).then((e) => e.webAuthnRegister);
|
|
393
|
-
},
|
|
626
|
+
}, et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
394
627
|
__proto__: null,
|
|
395
|
-
assertion:
|
|
396
|
-
attestation:
|
|
397
|
-
login:
|
|
398
|
-
register:
|
|
399
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
628
|
+
assertion: $,
|
|
629
|
+
attestation: Q,
|
|
630
|
+
login: x,
|
|
631
|
+
register: tt
|
|
632
|
+
}, Symbol.toStringTag, { value: "Module" })), rt = (t = R) => y({ my: t }).then((e) => e.my), st = (t, e, r = "") => f({ login: { __args: { username: t, password: e, code: r } } }).then((n) => n.login), nt = () => f({ logout: !0 }).then((t) => t.logout), ot = (t, e, r) => f({ changeExpiredPassword: { __args: { username: t, old_password: e, new_password: r } } }).then((n) => n.changeExpiredPassword), it = (t, e) => f({ changeUserPassword: { __args: { old_password: t, new_password: e } } }).then((r) => r.changeUserPassword), at = (t, e, r) => f({ resetPassword: { __args: { jwt: t, password: e, code: r } } }).then((n) => n.resetPassword), ct = (t, e) => f({ forgetPassword: { __args: { username: t, email: e } } }).then((r) => r.forgetPassword), lt = (t, e) => f({ forgetPasswordVerifyCode: { __args: { jwt: t, code: e } } }).then((r) => r.forgetPasswordVerifyCode), ut = (t) => y({
|
|
400
633
|
my: {
|
|
401
634
|
granted: {
|
|
402
635
|
__args: {
|
|
@@ -404,7 +637,7 @@ const I = (t, e = {}) => {
|
|
|
404
637
|
}
|
|
405
638
|
}
|
|
406
639
|
}
|
|
407
|
-
}).then((e) => e.my.granted),
|
|
640
|
+
}).then((e) => e.my.granted), ht = (t) => y({
|
|
408
641
|
my: {
|
|
409
642
|
grantedRights: {
|
|
410
643
|
__args: {
|
|
@@ -412,9 +645,9 @@ const I = (t, e = {}) => {
|
|
|
412
645
|
}
|
|
413
646
|
}
|
|
414
647
|
}
|
|
415
|
-
}).then((e) => e.my.grantedRights),
|
|
416
|
-
getCurrentUser:
|
|
417
|
-
webAuthn:
|
|
648
|
+
}).then((e) => e.my.grantedRights), pt = {
|
|
649
|
+
getCurrentUser: rt,
|
|
650
|
+
webAuthn: et,
|
|
418
651
|
google: {
|
|
419
652
|
unlink: () => f({ lightAuthUnlinkGoogle: !0 }).then((t) => t.lightAuthUnlinkGoogle),
|
|
420
653
|
login: (t) => f({ lightAuthLoginGoogle: { __args: { credential: t } } }).then((e) => e.lightAuthLoginGoogle),
|
|
@@ -430,22 +663,22 @@ const I = (t, e = {}) => {
|
|
|
430
663
|
login: (t) => f({ lightAuthLoginMicrosoft: { __args: { access_token: t } } }).then((e) => e.lightAuthLoginMicrosoft),
|
|
431
664
|
register: (t) => f({ lightAuthRegisterMicrosoft: { __args: { account_id: t } } }).then((e) => e.lightAuthRegisterMicrosoft)
|
|
432
665
|
},
|
|
433
|
-
login:
|
|
434
|
-
logout:
|
|
435
|
-
changeExpiredPassword:
|
|
436
|
-
updatePassword:
|
|
437
|
-
resetPassword:
|
|
438
|
-
forgetPassword:
|
|
439
|
-
verifyCode:
|
|
440
|
-
grantedRights:
|
|
441
|
-
isGranted:
|
|
442
|
-
}
|
|
666
|
+
login: st,
|
|
667
|
+
logout: nt,
|
|
668
|
+
changeExpiredPassword: ot,
|
|
669
|
+
updatePassword: it,
|
|
670
|
+
resetPassword: at,
|
|
671
|
+
forgetPassword: ct,
|
|
672
|
+
verifyCode: lt,
|
|
673
|
+
grantedRights: ht,
|
|
674
|
+
isGranted: ut
|
|
675
|
+
}, G = {
|
|
443
676
|
name: !0,
|
|
444
677
|
path: !0,
|
|
445
678
|
size: !0,
|
|
446
679
|
mime: !0,
|
|
447
680
|
url: !0
|
|
448
|
-
},
|
|
681
|
+
}, ft = (t, e, r = G) => y({
|
|
449
682
|
app: {
|
|
450
683
|
drive: {
|
|
451
684
|
__args: { index: t },
|
|
@@ -455,7 +688,7 @@ const I = (t, e = {}) => {
|
|
|
455
688
|
}
|
|
456
689
|
}
|
|
457
690
|
}
|
|
458
|
-
}).then((n) => n.app.drive.files),
|
|
691
|
+
}).then((n) => n.app.drive.files), dt = (t, e) => y({
|
|
459
692
|
app: {
|
|
460
693
|
drive: {
|
|
461
694
|
__args: {
|
|
@@ -469,8 +702,8 @@ const I = (t, e = {}) => {
|
|
|
469
702
|
}
|
|
470
703
|
}
|
|
471
704
|
}
|
|
472
|
-
}).then((r) => r.app.drive?.file?.base64Content),
|
|
473
|
-
list: (e, r = G) =>
|
|
705
|
+
}).then((r) => r.app.drive?.file?.base64Content), gt = (t) => ({
|
|
706
|
+
list: (e, r = G) => ft(t, e, r),
|
|
474
707
|
get: (e, r = {
|
|
475
708
|
name: !0,
|
|
476
709
|
path: !0,
|
|
@@ -493,7 +726,7 @@ const I = (t, e = {}) => {
|
|
|
493
726
|
}
|
|
494
727
|
}).then((n) => n.app.drive.file),
|
|
495
728
|
readFileAsBase64(e) {
|
|
496
|
-
return
|
|
729
|
+
return dt(t, e);
|
|
497
730
|
},
|
|
498
731
|
read: async (e) => {
|
|
499
732
|
let r = await y({
|
|
@@ -519,10 +752,10 @@ const I = (t, e = {}) => {
|
|
|
519
752
|
delete: (e) => f({ lightDriveDeleteFile: { __args: { index: t, path: e } } }).then((r) => r.lightDriveDeleteFile),
|
|
520
753
|
rename: (e, r) => f({ lightDriveRenameFile: { __args: { index: t, path: e, name: r } } }).then((n) => n.lightDriveRenameFile),
|
|
521
754
|
move: (e, r) => f({ lightDriveMoveFile: { __args: { index: t, source: e, destination: r } } }).then((n) => n.lightDriveMoveFile)
|
|
522
|
-
}),
|
|
755
|
+
}), T = {
|
|
523
756
|
name: !0,
|
|
524
757
|
path: !0
|
|
525
|
-
},
|
|
758
|
+
}, _t = (t, e, r = T) => y({
|
|
526
759
|
app: {
|
|
527
760
|
drive: {
|
|
528
761
|
__args: { index: t },
|
|
@@ -532,65 +765,68 @@ const I = (t, e = {}) => {
|
|
|
532
765
|
}
|
|
533
766
|
}
|
|
534
767
|
}
|
|
535
|
-
}).then((n) => n.app.drive.folders),
|
|
536
|
-
list: (e, r =
|
|
768
|
+
}).then((n) => n.app.drive.folders), yt = (t) => ({
|
|
769
|
+
list: (e, r = T) => _t(t, e, r),
|
|
537
770
|
create: (e) => f({ lightDriveCreateFolder: { __args: { index: t, path: e } } }).then((r) => r.lightDriveCreateFolder),
|
|
538
771
|
delete: (e) => f({ lightDriveDeleteFolder: { __args: { index: t, path: e } } }).then((r) => r.lightDriveDeleteFolder),
|
|
539
772
|
rename: (e, r) => f({ lightDriveRenameFolder: { __args: { index: t, path: e, name: r } } }).then((n) => n.lightDriveRenameFolder)
|
|
540
|
-
}),
|
|
773
|
+
}), Wt = () => y({
|
|
541
774
|
app: {
|
|
542
775
|
drives: {
|
|
543
776
|
index: !0,
|
|
544
777
|
name: !0
|
|
545
778
|
}
|
|
546
779
|
}
|
|
547
|
-
}).then((t) => t.app.drives),
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
780
|
+
}).then((t) => t.app.drives), wt = (t) => {
|
|
781
|
+
const e = gt(t), r = yt(t);
|
|
782
|
+
return {
|
|
783
|
+
folders: r,
|
|
784
|
+
files: e,
|
|
785
|
+
listFiles: e.list,
|
|
786
|
+
getFile: e.get,
|
|
787
|
+
readFile: e.read,
|
|
788
|
+
writeFile: e.write,
|
|
789
|
+
deleteFile: e.delete,
|
|
790
|
+
renameFile: e.rename,
|
|
791
|
+
moveFile: e.move,
|
|
792
|
+
listFolders: r.list,
|
|
793
|
+
createFolder: r.create,
|
|
794
|
+
deleteFolder: r.delete,
|
|
795
|
+
renameFolder: r.rename,
|
|
796
|
+
uploadTempFile: (n) => f({
|
|
797
|
+
lightDriveUploadTempFile: {
|
|
798
|
+
__args: { index: t, file: n },
|
|
799
|
+
name: !0,
|
|
800
|
+
path: !0,
|
|
801
|
+
size: !0,
|
|
802
|
+
mime: !0
|
|
803
|
+
}
|
|
804
|
+
}).then((o) => o.lightDriveUploadTempFile)
|
|
805
|
+
};
|
|
806
|
+
}, R = {
|
|
571
807
|
user_id: !0,
|
|
572
808
|
username: !0,
|
|
573
809
|
first_name: !0,
|
|
574
810
|
last_name: !0,
|
|
575
811
|
status: !0
|
|
576
|
-
},
|
|
812
|
+
}, mt = (t) => f({
|
|
577
813
|
addUser: {
|
|
578
814
|
__args: t
|
|
579
815
|
}
|
|
580
|
-
}).then((e) => e.addUser),
|
|
816
|
+
}).then((e) => e.addUser), bt = (t) => f({
|
|
581
817
|
deleteUser: {
|
|
582
818
|
__args: { id: t }
|
|
583
819
|
}
|
|
584
|
-
}).then((e) => e.deleteUser),
|
|
820
|
+
}).then((e) => e.deleteUser), Ft = (t = R) => C("Users", t).dataPath("app.listUser").fetch(), At = (t, e) => f({
|
|
585
821
|
updateUser: {
|
|
586
822
|
__args: { id: t, data: e }
|
|
587
823
|
}
|
|
588
|
-
}).then((r) => r.updateUser),
|
|
589
|
-
list:
|
|
590
|
-
create:
|
|
591
|
-
delete:
|
|
592
|
-
update:
|
|
593
|
-
}
|
|
824
|
+
}).then((r) => r.updateUser), Ot = {
|
|
825
|
+
list: Ft,
|
|
826
|
+
create: mt,
|
|
827
|
+
delete: bt,
|
|
828
|
+
update: At
|
|
829
|
+
}, Ct = (t) => y({
|
|
594
830
|
app: {
|
|
595
831
|
listConfig: {
|
|
596
832
|
__args: {
|
|
@@ -604,13 +840,13 @@ const I = (t, e = {}) => {
|
|
|
604
840
|
}
|
|
605
841
|
}
|
|
606
842
|
}
|
|
607
|
-
}).then((e) => e.app.listConfig.data[0]?.value),
|
|
843
|
+
}).then((e) => e.app.listConfig.data[0]?.value), Dt = {
|
|
608
844
|
name: !0
|
|
609
|
-
},
|
|
845
|
+
}, kt = (t = Dt) => y({
|
|
610
846
|
app: {
|
|
611
847
|
roles: t
|
|
612
848
|
}
|
|
613
|
-
}).then((e) => e.app.roles),
|
|
849
|
+
}).then((e) => e.app.roles), jt = (t, e) => f({
|
|
614
850
|
addRole: {
|
|
615
851
|
__args: {
|
|
616
852
|
data: {
|
|
@@ -619,65 +855,65 @@ const I = (t, e = {}) => {
|
|
|
619
855
|
}
|
|
620
856
|
}
|
|
621
857
|
}
|
|
622
|
-
}).then((r) => r.addRole),
|
|
858
|
+
}).then((r) => r.addRole), Pt = (t) => f({
|
|
623
859
|
deleteRole: {
|
|
624
860
|
__args: { name: t }
|
|
625
861
|
}
|
|
626
|
-
}).then((e) => e.deleteRole),
|
|
627
|
-
list:
|
|
628
|
-
create:
|
|
629
|
-
delete:
|
|
862
|
+
}).then((e) => e.deleteRole), Ut = () => ({
|
|
863
|
+
list: kt,
|
|
864
|
+
create: jt,
|
|
865
|
+
delete: Pt
|
|
630
866
|
});
|
|
631
|
-
function
|
|
867
|
+
function W(t, e, r, n, o) {
|
|
632
868
|
if (!(!t || typeof t != "object"))
|
|
633
|
-
for (let
|
|
634
|
-
const l = t[
|
|
869
|
+
for (let c in t) {
|
|
870
|
+
const l = t[c];
|
|
635
871
|
if (l && typeof l == "object") {
|
|
636
872
|
if ("__args" in l) {
|
|
637
|
-
const
|
|
638
|
-
Object.entries(
|
|
639
|
-
if (
|
|
640
|
-
s[
|
|
641
|
-
let
|
|
642
|
-
|
|
643
|
-
p instanceof File && (r[
|
|
644
|
-
}), e[
|
|
645
|
-
} else
|
|
646
|
-
if (p instanceof Array &&
|
|
647
|
-
s[
|
|
648
|
-
let
|
|
649
|
-
p.forEach((
|
|
650
|
-
|
|
651
|
-
}), e[
|
|
652
|
-
} else p instanceof File ? (s[
|
|
653
|
-
})) :
|
|
873
|
+
const h = l.__args, s = {};
|
|
874
|
+
Object.entries(h).forEach(([i, a]) => {
|
|
875
|
+
if (a instanceof Array && A(a)) {
|
|
876
|
+
s[i] = new w(i);
|
|
877
|
+
let u = 0;
|
|
878
|
+
a.forEach((p) => {
|
|
879
|
+
p instanceof File && (r[o.current] || (r[o.current] = []), r[o.current].push("variables." + i + "." + u), n.append(o.current.toString(), p), o.current++, u++);
|
|
880
|
+
}), e[i] = "[Upload!]!";
|
|
881
|
+
} else a instanceof File ? (s[i] = new w(i), r[o.current] = ["variables." + i], n.append(o.current.toString(), a), e[i] = "Upload!", o.current++) : a instanceof Object && B(a) ? (s[i] = {}, Object.entries(a).forEach(([u, p]) => {
|
|
882
|
+
if (p instanceof Array && A(p)) {
|
|
883
|
+
s[i][u] = new w(u);
|
|
884
|
+
let _ = 0;
|
|
885
|
+
p.forEach((d) => {
|
|
886
|
+
d instanceof File && (r[o.current] || (r[o.current] = []), r[o.current].push("variables." + u + "." + _), n.append(o.current.toString(), d), o.current++, _++);
|
|
887
|
+
}), e[u] = "[Upload!]!";
|
|
888
|
+
} else p instanceof File ? (s[i][u] = new w(u), r[o.current] = ["variables." + u], n.append(o.current.toString(), p), e[u] = "Upload!", o.current++) : s[i][u] = p;
|
|
889
|
+
})) : a != null && (s[i] = a);
|
|
654
890
|
}), l.__args = s;
|
|
655
891
|
}
|
|
656
|
-
|
|
892
|
+
W(l, e, r, n, o);
|
|
657
893
|
}
|
|
658
894
|
}
|
|
659
895
|
}
|
|
660
896
|
const f = async (t) => {
|
|
661
|
-
const
|
|
662
|
-
let
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
let
|
|
666
|
-
const a =
|
|
667
|
-
if (
|
|
897
|
+
const { axios: e } = q(), r = t, n = new FormData();
|
|
898
|
+
let o = !1;
|
|
899
|
+
const c = {}, l = {};
|
|
900
|
+
W(r, c, l, n, { current: 0 }), o = Object.keys(c).length > 0, o && (r.__variables = c);
|
|
901
|
+
let s = null;
|
|
902
|
+
const a = v({ mutation: r });
|
|
903
|
+
if (o ? (n.append("map", JSON.stringify(l)), n.append("operations", JSON.stringify({
|
|
668
904
|
query: a
|
|
669
|
-
})),
|
|
905
|
+
})), s = await e.post("", n)) : s = await e.post("", {
|
|
670
906
|
query: a
|
|
671
|
-
}),
|
|
672
|
-
throw new Error(
|
|
673
|
-
return
|
|
674
|
-
},
|
|
675
|
-
send:
|
|
676
|
-
},
|
|
907
|
+
}), s.data.errors)
|
|
908
|
+
throw new Error(s.data.errors[0].message);
|
|
909
|
+
return s.data.data;
|
|
910
|
+
}, Et = (t, e, r) => f({ sendMail: { __args: { email: t, subject: e, message: r } } }).then((n) => n.sendMail), St = {
|
|
911
|
+
send: Et
|
|
912
|
+
}, S = (t) => {
|
|
677
913
|
let e = {};
|
|
678
914
|
return typeof t == "string" ? (e[t] = !0, e) : t instanceof Array ? (t.forEach((r) => {
|
|
679
|
-
Object.entries(
|
|
680
|
-
e[n] =
|
|
915
|
+
Object.entries(S(r)).forEach(([n, o]) => {
|
|
916
|
+
e[n] = o;
|
|
681
917
|
});
|
|
682
918
|
}), e) : (Object.entries(t).forEach(([r, n]) => {
|
|
683
919
|
if (r == "__args" || r == "__aliasFor" || r == "__variables" || r == "__directives" || r == "__all_on" || r == "__name") {
|
|
@@ -688,365 +924,129 @@ const f = async (t) => {
|
|
|
688
924
|
e[r] = n;
|
|
689
925
|
return;
|
|
690
926
|
}
|
|
691
|
-
e[r] =
|
|
927
|
+
e[r] = S(n);
|
|
692
928
|
}), e);
|
|
693
|
-
},
|
|
694
|
-
"flatMap",
|
|
695
|
-
"chunk",
|
|
696
|
-
"shuffle",
|
|
697
|
-
"splice",
|
|
698
|
-
"sortBy",
|
|
699
|
-
"map",
|
|
700
|
-
"reverse",
|
|
701
|
-
"groupBy",
|
|
702
|
-
"keyBy",
|
|
703
|
-
"keys",
|
|
704
|
-
"mapToDictionary",
|
|
705
|
-
"mapWithKeys",
|
|
706
|
-
"nth",
|
|
707
|
-
"skipUntil",
|
|
708
|
-
"skipWhile",
|
|
709
|
-
"takeUntil",
|
|
710
|
-
"takeWhile",
|
|
711
|
-
"unique",
|
|
712
|
-
"pluck",
|
|
713
|
-
"push",
|
|
714
|
-
"only",
|
|
715
|
-
"pad",
|
|
716
|
-
"slice",
|
|
717
|
-
"tap",
|
|
718
|
-
"sort"
|
|
719
|
-
], vt = [
|
|
720
|
-
"avg",
|
|
721
|
-
"count",
|
|
722
|
-
"countBy",
|
|
723
|
-
"dd",
|
|
724
|
-
"each",
|
|
725
|
-
"every",
|
|
726
|
-
"filter",
|
|
727
|
-
"firstWhere",
|
|
728
|
-
"isEmpty",
|
|
729
|
-
"isNotEmpty",
|
|
730
|
-
"last",
|
|
731
|
-
"mapToGroups",
|
|
732
|
-
"max",
|
|
733
|
-
"median",
|
|
734
|
-
"min",
|
|
735
|
-
"mode",
|
|
736
|
-
"contains",
|
|
737
|
-
"sole",
|
|
738
|
-
"sort",
|
|
739
|
-
"split",
|
|
740
|
-
"sum",
|
|
741
|
-
"toJson",
|
|
742
|
-
"get",
|
|
743
|
-
"has",
|
|
744
|
-
"implode",
|
|
745
|
-
"partition"
|
|
746
|
-
];
|
|
747
|
-
class g {
|
|
748
|
-
_batchData = null;
|
|
749
|
-
data_path = "";
|
|
750
|
-
filters;
|
|
751
|
-
steps;
|
|
752
|
-
fields;
|
|
753
|
-
already_limit = !1;
|
|
754
|
-
already_offset = !1;
|
|
755
|
-
limit = null;
|
|
756
|
-
offset = null;
|
|
757
|
-
_sort = null;
|
|
758
|
-
_sortDesc = !1;
|
|
759
|
-
meta = {};
|
|
760
|
-
constructor(e) {
|
|
761
|
-
this.filters = {}, this.steps = [], this.fields = e;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
g.prototype.getQueryPayload = function() {
|
|
765
|
-
let t = {
|
|
766
|
-
meta: {
|
|
767
|
-
total: !0,
|
|
768
|
-
key: !0,
|
|
769
|
-
name: !0
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
return t.__args = this.buildArgs(), t.data = this.fields, t.data.__args = t.data.__args || {}, this.limit && (t.data.__args.limit = this.limit), this.offset && (t.data.__args.offset = this.offset), {
|
|
773
|
-
data_path: this.data_path,
|
|
774
|
-
query: t,
|
|
775
|
-
steps: this.steps
|
|
776
|
-
};
|
|
777
|
-
};
|
|
778
|
-
g.prototype.dataPath = function(t) {
|
|
779
|
-
const e = this.clone();
|
|
780
|
-
return e.data_path = t, e;
|
|
781
|
-
};
|
|
782
|
-
g.prototype.buildArgs = function() {
|
|
783
|
-
let t = {};
|
|
784
|
-
return Object.keys(this.filters).length > 0 && (t.filters = this.filters), this._sort && (t.sort = this._sort, this._sortDesc && (t.sort += ":desc")), t;
|
|
785
|
-
};
|
|
786
|
-
g.prototype.clone = function() {
|
|
787
|
-
const t = Object.create(this);
|
|
788
|
-
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;
|
|
789
|
-
};
|
|
790
|
-
S().macro("whereContains", function(t, e) {
|
|
791
|
-
return this.filter((r) => r[t].toLowerCase().includes(e.toLowerCase()));
|
|
792
|
-
});
|
|
793
|
-
g.prototype.fetchData = async function() {
|
|
794
|
-
try {
|
|
795
|
-
if (this._batchData) {
|
|
796
|
-
const u = this._batchData;
|
|
797
|
-
return this.meta = u.meta, S(u.data);
|
|
798
|
-
}
|
|
799
|
-
let t = {
|
|
800
|
-
meta: {
|
|
801
|
-
total: !0,
|
|
802
|
-
key: !0,
|
|
803
|
-
name: !0
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
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);
|
|
807
|
-
const e = this.data_path.split(".");
|
|
808
|
-
let r = {}, n = r, i = e[e.length - 1];
|
|
809
|
-
for (const u of e) {
|
|
810
|
-
if (u === i) {
|
|
811
|
-
n[u] = t;
|
|
812
|
-
break;
|
|
813
|
-
}
|
|
814
|
-
n[u] = {}, n = n[u];
|
|
815
|
-
}
|
|
816
|
-
let l = await y(r);
|
|
817
|
-
for (const u of e)
|
|
818
|
-
l = l[u];
|
|
819
|
-
return this.meta = l.meta, S(l.data);
|
|
820
|
-
} catch (t) {
|
|
821
|
-
throw console.error("Error fetching collection data:", t), t;
|
|
822
|
-
}
|
|
823
|
-
};
|
|
824
|
-
g.prototype.processData = async function() {
|
|
825
|
-
let t = await this.fetchData();
|
|
826
|
-
for (const e of this.steps)
|
|
827
|
-
t = t[e.type](...e.args);
|
|
828
|
-
return t;
|
|
829
|
-
};
|
|
830
|
-
g.prototype.all = async function() {
|
|
831
|
-
return (await this.processData()).all();
|
|
832
|
-
};
|
|
833
|
-
for (const t of St)
|
|
834
|
-
g.prototype[t] = function(...e) {
|
|
835
|
-
const r = this.clone();
|
|
836
|
-
return r.steps.push({ type: t, args: e }), r;
|
|
837
|
-
};
|
|
838
|
-
for (const t of vt)
|
|
839
|
-
g.prototype[t] = async function(...e) {
|
|
840
|
-
return (await this.clone().processData())[t](...e);
|
|
841
|
-
};
|
|
842
|
-
g.prototype.average = g.prototype.avg;
|
|
843
|
-
g.prototype.first = async function() {
|
|
844
|
-
return this.take(1), (await this.processData()).first();
|
|
845
|
-
};
|
|
846
|
-
g.prototype._handleBatchData = function(t, e) {
|
|
847
|
-
return this._batchData ? (this.steps.push({ type: t, args: e }), this) : null;
|
|
848
|
-
};
|
|
849
|
-
g.prototype.where = function(...t) {
|
|
850
|
-
const e = this._handleBatchData("where", t);
|
|
851
|
-
if (e) return e;
|
|
852
|
-
if (t.length === 2)
|
|
853
|
-
this.filters[t[0]] = t[1];
|
|
854
|
-
else if (t.length === 3) {
|
|
855
|
-
const r = t[0], n = t[1], i = t[2];
|
|
856
|
-
switch (n) {
|
|
857
|
-
case "==":
|
|
858
|
-
this.filters[r] = i;
|
|
859
|
-
break;
|
|
860
|
-
case "<":
|
|
861
|
-
this.filters[r] = { lt: i };
|
|
862
|
-
break;
|
|
863
|
-
case "<=":
|
|
864
|
-
this.filters[r] = { lte: i };
|
|
865
|
-
break;
|
|
866
|
-
case ">":
|
|
867
|
-
this.filters[r] = { gt: i };
|
|
868
|
-
break;
|
|
869
|
-
case ">=":
|
|
870
|
-
this.filters[r] = { gte: i };
|
|
871
|
-
break;
|
|
872
|
-
case "!==":
|
|
873
|
-
this.filters[r] = { ne: i };
|
|
874
|
-
break;
|
|
875
|
-
default:
|
|
876
|
-
throw new Error(`Unsupported operator: ${n}`);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return this;
|
|
880
|
-
};
|
|
881
|
-
g.prototype.whereContains = function(t, e) {
|
|
882
|
-
const r = this._handleBatchData("whereContains", [t, e]);
|
|
883
|
-
return r || (this.filters[t] = { contains: e }, this);
|
|
884
|
-
};
|
|
885
|
-
g.prototype.forPage = function(t, e) {
|
|
886
|
-
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);
|
|
887
|
-
};
|
|
888
|
-
g.prototype.whereIn = function(t, e) {
|
|
889
|
-
const r = this._handleBatchData("whereIn", [t, e]);
|
|
890
|
-
return r || (this.filters[t] = { in: e }, this);
|
|
891
|
-
};
|
|
892
|
-
g.prototype.whereNotIn = function(t, e) {
|
|
893
|
-
const r = this._handleBatchData("whereNotIn", [t, e]);
|
|
894
|
-
return r || (this.filters[t] = { nin: e }, this);
|
|
895
|
-
};
|
|
896
|
-
g.prototype.whereNotBetween = function(t, e) {
|
|
897
|
-
const r = this._handleBatchData("whereNotBetween", [t, e]);
|
|
898
|
-
return r || (this.filters[t] = { notBetween: e }, this);
|
|
899
|
-
};
|
|
900
|
-
g.prototype.whereBetween = function(t, e) {
|
|
901
|
-
const r = this._handleBatchData("whereBetween", [t, e]);
|
|
902
|
-
return r || (this.filters[t] = { between: e }, this);
|
|
903
|
-
};
|
|
904
|
-
g.prototype.sortBy = function(t) {
|
|
905
|
-
return this.steps.push({ type: "sortBy", args: [t] }), typeof t == "string" && (this._sort = t), this;
|
|
906
|
-
};
|
|
907
|
-
g.prototype.sortByDesc = function(t) {
|
|
908
|
-
return this.steps.push({ type: "sortByDesc", args: [t] }), typeof t == "string" && (this._sort = t, this._sortDesc = !0), this;
|
|
909
|
-
};
|
|
910
|
-
g.prototype.skip = function(t) {
|
|
911
|
-
if (t < 0)
|
|
912
|
-
throw new Error("Offset must be non-negative");
|
|
913
|
-
return this.already_offset && this.steps.push({ type: "skip", args: [t] }), this.offset = t, this.already_offset = !0, this;
|
|
914
|
-
};
|
|
915
|
-
g.prototype.take = function(t) {
|
|
916
|
-
if (t < 0)
|
|
917
|
-
throw new Error("Length must be non-negative");
|
|
918
|
-
return this.already_limit ? (this.steps.push({ type: "take", args: [t] }), this) : (this.limit = t, this.already_limit = !0, this);
|
|
919
|
-
};
|
|
920
|
-
g.prototype.splice = function(t, e) {
|
|
921
|
-
return this.steps.push({ type: "splice", args: [t, e] }), this.offset = t, this.limit = e, this.already_limit = !0, this.already_offset = !0, this;
|
|
922
|
-
};
|
|
923
|
-
const H = (t, e) => {
|
|
924
|
-
const r = new g(e);
|
|
925
|
-
return r.data_path = Et + t, r;
|
|
926
|
-
}, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
927
|
-
__proto__: null,
|
|
928
|
-
default: H
|
|
929
|
-
}, Symbol.toStringTag, { value: "Module" })), Ht = (t) => {
|
|
929
|
+
}, vt = (t) => S(t), zt = (t) => {
|
|
930
930
|
const e = typeof window > "u";
|
|
931
931
|
let r = [];
|
|
932
|
-
const n =
|
|
932
|
+
const n = z.create({
|
|
933
933
|
baseURL: t,
|
|
934
934
|
withCredentials: !0
|
|
935
935
|
});
|
|
936
|
-
e && (n.interceptors.request.use((
|
|
937
|
-
if (
|
|
938
|
-
const l =
|
|
936
|
+
e && (n.interceptors.request.use((c) => (c.withCredentials = !0, r.length > 0 && (c.headers.Cookie = r.join("; ")), c)), n.interceptors.response.use((c) => {
|
|
937
|
+
if (c.headers["set-cookie"]) {
|
|
938
|
+
const l = c.headers["set-cookie"].map((s) => s.split(";")[0]), h = /* @__PURE__ */ new Map();
|
|
939
939
|
r.forEach((s) => {
|
|
940
|
-
const
|
|
941
|
-
|
|
940
|
+
const i = s.split("=")[0];
|
|
941
|
+
h.set(i, s);
|
|
942
942
|
}), l.forEach((s) => {
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
}), r = Array.from(
|
|
943
|
+
const i = s.split("=")[0];
|
|
944
|
+
h.set(i, s);
|
|
945
|
+
}), r = Array.from(h.values());
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return c;
|
|
948
948
|
}));
|
|
949
|
-
const
|
|
949
|
+
const o = {
|
|
950
950
|
post: n.post,
|
|
951
951
|
baseURL: t,
|
|
952
952
|
axios: n,
|
|
953
|
-
auth:
|
|
953
|
+
auth: pt,
|
|
954
954
|
mutation: f,
|
|
955
955
|
query: y,
|
|
956
|
-
config:
|
|
957
|
-
mail:
|
|
958
|
-
users:
|
|
959
|
-
model(
|
|
960
|
-
return
|
|
956
|
+
config: Ct,
|
|
957
|
+
mail: St,
|
|
958
|
+
users: Ot,
|
|
959
|
+
model(c) {
|
|
960
|
+
return P(c);
|
|
961
961
|
},
|
|
962
|
-
roles:
|
|
963
|
-
collect: (
|
|
964
|
-
const
|
|
965
|
-
return
|
|
962
|
+
roles: Ut(),
|
|
963
|
+
collect: (c, l) => {
|
|
964
|
+
const h = J(c, l);
|
|
965
|
+
return h.data_path = P(c).getDataPath(), h;
|
|
966
966
|
},
|
|
967
|
-
list: (
|
|
968
|
-
drive:
|
|
969
|
-
async collects(
|
|
970
|
-
const l = {},
|
|
971
|
-
for (const
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
let p =
|
|
976
|
-
for (const
|
|
977
|
-
if (
|
|
978
|
-
d
|
|
967
|
+
list: (c, l) => C(c, l).dataPath(P(c).getDataPath()),
|
|
968
|
+
drive: wt,
|
|
969
|
+
async collects(c) {
|
|
970
|
+
const l = {}, h = {};
|
|
971
|
+
for (const i in c) {
|
|
972
|
+
const a = c[i].getQueryPayload();
|
|
973
|
+
h[i] = a.data_path, l[i] = {};
|
|
974
|
+
const u = a.data_path.split(".");
|
|
975
|
+
let p = u[u.length - 1], _ = l[i];
|
|
976
|
+
for (const d of u) {
|
|
977
|
+
if (d === p) {
|
|
978
|
+
_[d] = a.query;
|
|
979
979
|
break;
|
|
980
980
|
}
|
|
981
|
-
d
|
|
981
|
+
_[d] = _[d] || {};
|
|
982
982
|
}
|
|
983
|
-
l[
|
|
983
|
+
l[i].__aliasFor = u[0];
|
|
984
984
|
}
|
|
985
985
|
const s = await y(l);
|
|
986
|
-
for (const
|
|
987
|
-
const
|
|
988
|
-
let
|
|
989
|
-
for (const
|
|
990
|
-
if (
|
|
991
|
-
|
|
986
|
+
for (const i in c) {
|
|
987
|
+
const a = h[i].split(".");
|
|
988
|
+
let u = a[a.length - 1], p = s[i];
|
|
989
|
+
for (const _ of a) {
|
|
990
|
+
if (_ === u) {
|
|
991
|
+
c[i]._batchData = s[i][_];
|
|
992
992
|
break;
|
|
993
993
|
}
|
|
994
|
-
p[
|
|
994
|
+
p[_] = p[_] || {};
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
|
-
return
|
|
997
|
+
return c;
|
|
998
998
|
}
|
|
999
999
|
};
|
|
1000
|
-
return
|
|
1001
|
-
},
|
|
1000
|
+
return X(o), o;
|
|
1001
|
+
}, Ht = C;
|
|
1002
1002
|
export {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1003
|
+
A as arrayHasFile,
|
|
1004
|
+
pt as auth,
|
|
1005
|
+
ot as changeExpiredPassword,
|
|
1006
1006
|
Gt as clearModels,
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1007
|
+
zt as createClient,
|
|
1008
|
+
J as createCollection,
|
|
1009
|
+
Jt as createFileFromBase64,
|
|
1010
|
+
Lt as createFileFromBase85,
|
|
1011
|
+
N as createFileFromString,
|
|
1012
|
+
C as createList,
|
|
1013
|
+
jt as createRole,
|
|
1014
|
+
mt as createUser,
|
|
1015
|
+
R as defaultUserFields,
|
|
1016
|
+
L as defineModel,
|
|
1017
|
+
Tt as defineModels,
|
|
1018
|
+
Pt as deleteRole,
|
|
1019
|
+
bt as deleteUser,
|
|
1020
|
+
ct as forgetPassword,
|
|
1021
|
+
q as getApiClient,
|
|
1022
|
+
Mt as getApiClientOptional,
|
|
1023
|
+
Ct as getConfig,
|
|
1024
|
+
rt as getCurrentUser,
|
|
1025
|
+
wt as getDrive,
|
|
1026
|
+
ht as getGrantedRights,
|
|
1027
|
+
P as getModel,
|
|
1028
|
+
$t as hasModel,
|
|
1029
|
+
ut as isGranted,
|
|
1030
|
+
Ht as list,
|
|
1031
|
+
Wt as listDrives,
|
|
1032
|
+
ft as listFiles,
|
|
1033
|
+
_t as listFolders,
|
|
1034
|
+
Qt as listModels,
|
|
1035
|
+
Rt as listPermissions,
|
|
1036
|
+
kt as listRoles,
|
|
1037
|
+
Ft as listUsers,
|
|
1038
|
+
st as login,
|
|
1039
|
+
nt as logout,
|
|
1040
1040
|
f as mutation,
|
|
1041
|
-
|
|
1041
|
+
B as objectHasFile,
|
|
1042
1042
|
y as query,
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1043
|
+
dt as readFileAsBase64,
|
|
1044
|
+
at as resetPassword,
|
|
1045
|
+
Et as sendMail,
|
|
1046
|
+
X as setApiClient,
|
|
1047
|
+
vt as toQuery,
|
|
1048
|
+
it as updatePassword,
|
|
1049
|
+
At as updateUser,
|
|
1050
|
+
lt as verifyCode,
|
|
1051
|
+
et as webAuthn
|
|
1052
1052
|
};
|