@hostlink/light 2.7.2 → 2.9.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/dist/light.js CHANGED
@@ -1,384 +1,206 @@
1
- var T = Object.defineProperty;
2
- var V = (t, e, r) => e in t ? T(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var C = (t, e, r) => V(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { jsonToGraphQLQuery as E, VariableType as S } from "json-to-graphql-query";
5
- import W from "axios";
6
- import N from "collect.js";
7
- function R(t) {
8
- const e = "==".slice(0, (4 - t.length % 4) % 4), r = t.replace(/-/g, "+").replace(/_/g, "/") + e, s = atob(r), n = new ArrayBuffer(s.length), i = new Uint8Array(n);
9
- for (let c = 0; c < s.length; c++)
10
- i[c] = s.charCodeAt(c);
11
- return n;
12
- }
13
- function J(t) {
14
- const e = new Uint8Array(t);
15
- let r = "";
16
- for (const i of e)
17
- r += String.fromCharCode(i);
18
- return btoa(r).replace(/\+/g, "-").replace(
19
- /\//g,
20
- "_"
21
- ).replace(/=/g, "");
22
- }
23
- var p = "copy", F = "convert";
24
- function v(t, e, r) {
25
- if (e === p)
26
- return r;
27
- if (e === F)
28
- return t(r);
29
- if (e instanceof Array)
30
- return r.map((s) => v(t, e[0], s));
31
- if (e instanceof Object) {
32
- const s = {};
33
- for (const [n, i] of Object.entries(e)) {
34
- if (i.derive) {
35
- const c = i.derive(r);
36
- c !== void 0 && (r[n] = c);
37
- }
38
- if (!(n in r)) {
39
- if (i.required)
40
- throw new Error(`Missing key: ${n}`);
41
- continue;
42
- }
43
- if (r[n] == null) {
44
- s[n] = null;
45
- continue;
46
- }
47
- s[n] = v(
48
- t,
49
- i.schema,
50
- r[n]
51
- );
52
- }
53
- return s;
54
- }
55
- }
56
- function q(t, e) {
57
- return {
58
- required: !0,
59
- schema: t,
60
- derive: e
61
- };
62
- }
63
- function h(t) {
64
- return {
65
- required: !0,
66
- schema: t
67
- };
68
- }
69
- function g(t) {
70
- return {
71
- required: !1,
72
- schema: t
73
- };
74
- }
75
- var B = {
76
- type: h(p),
77
- id: h(F),
78
- transports: g(p)
79
- }, j = {
80
- appid: g(p),
81
- appidExclude: g(p),
82
- credProps: g(p)
83
- }, U = {
84
- appid: g(p),
85
- appidExclude: g(p),
86
- credProps: g(p)
87
- }, K = {
88
- publicKey: h({
89
- rp: h(p),
90
- user: h({
91
- id: h(F),
92
- name: h(p),
93
- displayName: h(p)
94
- }),
95
- challenge: h(F),
96
- pubKeyCredParams: h(p),
97
- timeout: g(p),
98
- excludeCredentials: g([B]),
99
- authenticatorSelection: g(p),
100
- attestation: g(p),
101
- extensions: g(j)
102
- }),
103
- signal: g(p)
104
- }, M = {
105
- type: h(p),
106
- id: h(p),
107
- rawId: h(F),
108
- authenticatorAttachment: g(p),
109
- response: h({
110
- clientDataJSON: h(F),
111
- attestationObject: h(F),
112
- transports: q(
113
- p,
114
- (t) => {
115
- var e;
116
- return ((e = t.getTransports) == null ? void 0 : e.call(t)) || [];
117
- }
118
- )
119
- }),
120
- clientExtensionResults: q(
121
- U,
122
- (t) => t.getClientExtensionResults()
123
- )
124
- }, G = {
125
- mediation: g(p),
126
- publicKey: h({
127
- challenge: h(F),
128
- timeout: g(p),
129
- rpId: g(p),
130
- allowCredentials: g([B]),
131
- userVerification: g(p),
132
- extensions: g(j)
133
- }),
134
- signal: g(p)
135
- }, I = {
136
- type: h(p),
137
- id: h(p),
138
- rawId: h(F),
139
- authenticatorAttachment: g(p),
140
- response: h({
141
- clientDataJSON: h(F),
142
- authenticatorData: h(F),
143
- signature: h(F),
144
- userHandle: h(F)
145
- }),
146
- clientExtensionResults: q(
147
- U,
148
- (t) => t.getClientExtensionResults()
149
- )
150
- };
151
- function Q(t) {
152
- return v(R, K, t);
153
- }
154
- function z(t) {
155
- return v(
156
- J,
157
- M,
158
- t
159
- );
160
- }
161
- function $(t) {
162
- return v(R, G, t);
163
- }
164
- function H(t) {
165
- return v(
166
- J,
167
- I,
168
- t
169
- );
170
- }
171
- async function X(t) {
172
- const e = await navigator.credentials.create(
173
- t
174
- );
175
- return e.toJSON = () => z(e), e;
176
- }
177
- async function Y(t) {
178
- const e = await navigator.credentials.get(
179
- t
180
- );
181
- return e.toJSON = () => H(e), e;
182
- }
183
- const Z = (t) => ({
184
- login: async () => {
185
- const { app: e } = await m(t, {
1
+ var N = Object.defineProperty;
2
+ var B = (t, e, r) => e in t ? N(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var m = (t, e, r) => B(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { jsonToGraphQLQuery as P, VariableType as F } from "json-to-graphql-query";
5
+ import R from "axios";
6
+ import D from "collect.js";
7
+ const E = (t) => ({
8
+ assertion: async () => {
9
+ const { app: s } = await w(t, {
186
10
  app: {
187
11
  auth: {
188
12
  webAuthnRequestOptions: !0
189
13
  }
190
14
  }
191
- }), r = e.auth.webAuthnRequestOptions, s = $({
192
- publicKey: r
193
- }), n = await Y(s);
194
- await u(t, "webAuthnAssertion", {
195
- assertion: n.toJSON()
196
- });
15
+ }), a = s.auth.webAuthnRequestOptions, h = PublicKeyCredential.parseRequestOptionsFromJSON(a);
16
+ return await navigator.credentials.get({ publicKey: h });
197
17
  },
198
- register: async () => {
199
- const { app: e } = await m(t, {
18
+ attestation: async () => {
19
+ const { app: s } = await w(t, {
200
20
  app: {
201
21
  auth: {
202
22
  webAuthnCreationOptions: !0
203
23
  }
204
24
  }
205
- }), r = Q({
206
- publicKey: e.auth.webAuthnCreationOptions
207
- }), s = await X(r);
208
- await u(t, "webAuthnRegister", {
209
- registration: s.toJSON()
210
- });
25
+ }), a = PublicKeyCredential.parseCreationOptionsFromJSON(s.auth.webAuthnCreationOptions);
26
+ return await navigator.credentials.create({ publicKey: a });
211
27
  }
212
- }), x = (t) => ({
213
- WebAuthn: Z(t),
28
+ }), j = (t) => {
29
+ const { assertion: e, attestation: r } = E(t);
30
+ return {
31
+ login: async () => {
32
+ const s = await e();
33
+ await l(t, "webAuthnAssertion", {
34
+ assertion: s.toJSON()
35
+ });
36
+ },
37
+ register: async () => {
38
+ const s = await r();
39
+ await l(t, "webAuthnRegister", {
40
+ registration: s.toJSON()
41
+ });
42
+ }
43
+ };
44
+ }, S = (t) => ({
45
+ WebAuthn: j(t),
214
46
  google: {
215
- unlink: () => u(t, "lightAuthUnlinkGoogle"),
216
- login: (e) => u(t, "lightAuthLoginGoogle", {
47
+ unlink: () => l(t, "lightAuthUnlinkGoogle"),
48
+ login: (e) => l(t, "lightAuthLoginGoogle", {
217
49
  credential: e
218
50
  }),
219
- register: (e) => u(t, "lightAuthRegisterGoogle", {
51
+ register: (e) => l(t, "lightAuthRegisterGoogle", {
220
52
  credential: e
221
53
  })
222
54
  },
223
55
  facebook: {
224
- unlink: () => u(t, "lightAuthUnlinkFacebook"),
225
- login: (e) => u(t, "lightAuthLoginFacebook", {
56
+ unlink: () => l(t, "lightAuthUnlinkFacebook"),
57
+ login: (e) => l(t, "lightAuthLoginFacebook", {
226
58
  access_token: e
227
59
  }),
228
- register: (e) => u(t, "lightAuthRegisterFacebook", {
60
+ register: (e) => l(t, "lightAuthRegisterFacebook", {
229
61
  access_token: e
230
62
  })
231
63
  },
232
64
  microsoft: {
233
- unlink: () => u(t, "lightAuthUnlinkMicrosoft"),
234
- login: (e) => u(t, "lightAuthLoginMicrosoft", {
65
+ unlink: () => l(t, "lightAuthUnlinkMicrosoft"),
66
+ login: (e) => l(t, "lightAuthLoginMicrosoft", {
235
67
  access_token: e
236
68
  }),
237
- register: (e) => u(t, "lightAuthRegisterMicrosoft", {
69
+ register: (e) => l(t, "lightAuthRegisterMicrosoft", {
238
70
  account_id: e
239
71
  })
240
72
  },
241
- login: (e, r, s = "") => u(t, "login", {
73
+ login: (e, r, s = "") => l(t, "login", {
242
74
  username: e,
243
75
  password: r,
244
76
  code: s
245
77
  }),
246
- logout: () => u(t, "logout"),
247
- changeExpiredPassword: (e, r, s) => u(t, "changeExpiredPassword", {
78
+ logout: () => l(t, "logout"),
79
+ changeExpiredPassword: (e, r, s) => l(t, "changeExpiredPassword", {
248
80
  username: e,
249
81
  old_password: r,
250
82
  new_password: s
251
83
  }),
252
- updatePassword: (e, r) => u(t, "changeUserPassword", {
84
+ updatePassword: (e, r) => l(t, "changeUserPassword", {
253
85
  old_password: e,
254
86
  new_password: r
255
87
  }),
256
- resetPassword: (e, r, s) => u(t, "resetPassword", {
88
+ resetPassword: (e, r, s) => l(t, "resetPassword", {
257
89
  jwt: e,
258
90
  password: r,
259
91
  code: s
260
92
  }),
261
- forgetPassword: (e, r) => u(t, "forgetPassword", {
93
+ forgetPassword: (e, r) => l(t, "forgetPassword", {
262
94
  username: e,
263
95
  email: r
264
96
  }),
265
97
  verifyCode(e, r) {
266
- return u(t, "forgetPasswordVerifyCode", {
98
+ return l(t, "forgetPasswordVerifyCode", {
267
99
  jwt: e,
268
100
  code: r
269
101
  });
270
102
  },
271
- granted: async (e) => (await m(t, {
272
- granted: {
273
- __args: {
274
- rights: e
103
+ granted: async (e) => {
104
+ const { my: r } = await w(t, {
105
+ my: {
106
+ grantedRights: {
107
+ __args: {
108
+ rights: e
109
+ }
110
+ }
275
111
  }
276
- }
277
- })).granted
278
- }), tt = (t, e, r) => {
279
- const s = e, n = t, i = r;
280
- let c = "list" + e;
281
- const o = (a) => i[a] ? i[a]() : null;
112
+ });
113
+ return r.grantedRights;
114
+ }
115
+ }), q = (t, e, r) => {
116
+ const s = e, a = t, h = r;
117
+ let p = "list" + e;
118
+ const n = (i) => h[i] ? h[i]() : null;
282
119
  return {
283
- field: o,
284
- $fields: i,
285
- setDataPath(a) {
286
- return c = a, c;
120
+ field: n,
121
+ $fields: h,
122
+ setDataPath(i) {
123
+ return p = i, p;
287
124
  },
288
125
  getDataPath() {
289
- return c;
126
+ return p;
290
127
  },
291
- gqlFields(a) {
292
- const l = [];
293
- for (const f of a)
294
- if (typeof f == "string") {
295
- const _ = o(f);
296
- _ && l.push(_.getGQLField());
297
- } else typeof f == "object" && l.push(f);
298
- return l;
128
+ gqlFields(i) {
129
+ const o = [];
130
+ for (const c of i)
131
+ if (typeof c == "string") {
132
+ const u = n(c);
133
+ u && o.push(u.getGQLField());
134
+ } else typeof c == "object" && o.push(c);
135
+ return o;
299
136
  },
300
- async update(a, l) {
301
- return await u(n, "update" + s, { id: a, data: l });
137
+ async update(i, o) {
138
+ return await l(a, "update" + s, { id: i, data: o });
302
139
  },
303
- async delete(a) {
304
- return await u(n, "delete" + s, { id: a });
140
+ async delete(i) {
141
+ return await l(a, "delete" + s, { id: i });
305
142
  },
306
- async add(a) {
307
- return await u(n, "add" + s, { data: a });
143
+ async add(i) {
144
+ return await l(a, "add" + s, { data: i });
308
145
  },
309
- fields(a) {
310
- let l = [];
311
- for (let f of a) {
312
- const _ = o(f);
313
- _ && l.push(_);
146
+ fields(i) {
147
+ let o = [];
148
+ for (let c of i) {
149
+ const u = n(c);
150
+ u && o.push(u);
314
151
  }
315
- return l;
152
+ return o;
316
153
  },
317
- async get(a, l) {
318
- return (await m(n, {
319
- ["list" + s]: {
320
- __args: {
321
- filters: a
322
- },
323
- data: {
324
- __args: {
325
- limit: 1
326
- },
327
- ...O(l)
328
- }
329
- }
330
- }))["list" + s].data[0];
154
+ async get(i, o) {
155
+ const c = (await Promise.resolve().then(() => O)).default, u = c(s, a, C(o));
156
+ for (const [d, g] of Object.entries(i))
157
+ u.where(d, "==", g);
158
+ return await u.first();
331
159
  },
332
- async list(a, l) {
333
- return (await m(n, {
334
- ["list" + s]: {
335
- __args: {
336
- filters: a
337
- },
338
- data: {
339
- ...O(l)
340
- }
341
- }
342
- }))["list" + s].data;
160
+ async list(i, o) {
161
+ const c = (await Promise.resolve().then(() => O)).default, u = c(s, a, C(o));
162
+ for (const [d, g] of Object.entries(i))
163
+ u.where(d, "==", g);
164
+ return await u.all();
343
165
  }
344
166
  };
345
167
  };
346
- function et(t) {
168
+ function U(t) {
347
169
  t = "<~" + t + "~>";
348
- var e, r, s, n, i, c = String, o = 255;
349
- 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, i = t.length; i > 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(o & r >> 24, o & r >> 16, o & r >> 8, o & r);
350
- return function(a, l) {
351
- for (var f = l; f > 0; f--) a.pop();
352
- }(s, e.length), c.fromCharCode.apply(c, s);
170
+ var e, r, s, a, h, p = String, n = 255;
171
+ 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 = [], a = 0, h = t.length; h > a; a += 5) r = 52200625 * (t.charCodeAt(a) - 33) + 614125 * (t.charCodeAt(a + 1) - 33) + 7225 * (t.charCodeAt(a + 2) - 33) + 85 * (t.charCodeAt(a + 3) - 33) + (t.charCodeAt(a + 4) - 33), s.push(n & r >> 24, n & r >> 16, n & r >> 8, n & r);
172
+ return function(i, o) {
173
+ for (var c = o; c > 0; c--) i.pop();
174
+ }(s, e.length), p.fromCharCode.apply(p, s);
353
175
  }
354
176
  const k = (t = "") => {
355
177
  const e = t, r = (s = "application/octet-stream") => {
356
- const n = new Uint8Array(e.length);
357
- for (let o = 0; o < e.length; o++)
358
- n[o] = e.charCodeAt(o);
359
- const i = new Blob([n], { type: s });
360
- return URL.createObjectURL(i);
178
+ const a = new Uint8Array(e.length);
179
+ for (let n = 0; n < e.length; n++)
180
+ a[n] = e.charCodeAt(n);
181
+ const h = new Blob([a], { type: s });
182
+ return URL.createObjectURL(h);
361
183
  };
362
184
  return {
363
185
  getContent: () => e,
364
186
  getURL: r,
365
187
  download: (s) => {
366
- const n = document.createElement("a");
367
- n.download = s, n.href = r(), document.body.appendChild(n), n.click(), document.body.removeChild(n);
188
+ const a = document.createElement("a");
189
+ a.download = s, a.href = r(), document.body.appendChild(a), a.click(), document.body.removeChild(a);
368
190
  },
369
191
  open: (s) => {
370
192
  window.open(r(s), "_blank");
371
193
  }
372
194
  };
373
- }, _t = {
374
- fromBase85: (t) => k(et(t)),
195
+ }, x = {
196
+ fromBase85: (t) => k(U(t)),
375
197
  fromBase64: (t) => k(atob(t)),
376
198
  fromString: (t) => k(t)
377
- }, P = (t) => {
199
+ }, v = (t) => {
378
200
  let e = {};
379
201
  return typeof t == "string" ? (e[t] = !0, e) : t instanceof Array ? (t.forEach((r) => {
380
- Object.entries(P(r)).forEach(([s, n]) => {
381
- e[s] = n;
202
+ Object.entries(v(r)).forEach(([s, a]) => {
203
+ e[s] = a;
382
204
  });
383
205
  }), e) : (Object.entries(t).forEach(([r, s]) => {
384
206
  if (r == "__args" || r == "__aliasFor" || r == "__variables" || r == "__directives" || r == "__all_on" || r == "__name") {
@@ -389,10 +211,10 @@ const k = (t = "") => {
389
211
  e[r] = s;
390
212
  return;
391
213
  }
392
- e[r] = P(s);
214
+ e[r] = v(s);
393
215
  }), e);
394
- }, O = (t) => P(t), m = async (t, e) => {
395
- let r = E(O(e));
216
+ }, C = (t) => v(t), w = async (t, e) => {
217
+ let r = P(C(e));
396
218
  const s = await t.post("", {
397
219
  query: `{ ${r} }`
398
220
  });
@@ -400,53 +222,53 @@ const k = (t = "") => {
400
222
  throw new Error(s.data.errors[0].message);
401
223
  return s.data.data;
402
224
  };
403
- function rt(t) {
225
+ function L(t) {
404
226
  for (let e = 0; e < t.length; e++)
405
227
  if (t[e] instanceof File)
406
228
  return !0;
407
229
  return !1;
408
230
  }
409
- function st(t) {
231
+ function J(t) {
410
232
  for (let e in t)
411
233
  if (t[e] instanceof File)
412
234
  return !0;
413
235
  return !1;
414
236
  }
415
- const u = async (t, e, r = null, s = []) => {
416
- let n = {
237
+ const l = async (t, e, r = null, s = []) => {
238
+ let a = {
417
239
  [e]: {}
418
240
  };
419
- const i = new FormData();
420
- let c = !1;
241
+ const h = new FormData();
242
+ let p = !1;
421
243
  if (r) {
422
- const l = {}, f = {}, _ = {};
423
- let b = 0;
424
- Object.entries(r).forEach(([y, w]) => {
425
- if (w instanceof Array && rt(w)) {
426
- c = !0;
427
- let D = 0;
428
- w.forEach((A) => {
429
- A instanceof File && (l[y] = new S(y), f[b] = ["variables." + y + "." + D], i.append(b.toString(), A), b++);
430
- }), _[y] = "[Upload!]!";
431
- } else w instanceof File ? (c = !0, l[y] = new S(y), f[b] = ["variables." + y], i.append(b.toString(), w), _[y] = "Upload!", b++) : w instanceof Object && st(w) ? (c = !0, l[y] = {}, Object.entries(w).forEach(([D, A]) => {
432
- A instanceof File ? (l[y][D] = new S(D), f[b] = ["variables." + D], i.append(b.toString(), A), _[D] = "Upload!", b++) : l[y][D] = A;
433
- })) : w !== void 0 && (l[y] = w);
434
- }), n[e].__args = l, n.__variables = _, c && i.append("map", JSON.stringify(f));
244
+ const o = {}, c = {}, u = {};
245
+ let d = 0;
246
+ Object.entries(r).forEach(([g, y]) => {
247
+ if (y instanceof Array && L(y)) {
248
+ p = !0;
249
+ let _ = 0;
250
+ y.forEach((b) => {
251
+ b instanceof File && (o[g] = new F(g), c[d] = ["variables." + g + "." + _], h.append(d.toString(), b), d++);
252
+ }), u[g] = "[Upload!]!";
253
+ } else y instanceof File ? (p = !0, o[g] = new F(g), c[d] = ["variables." + g], h.append(d.toString(), y), u[g] = "Upload!", d++) : y instanceof Object && J(y) ? (p = !0, o[g] = {}, Object.entries(y).forEach(([_, b]) => {
254
+ b instanceof File ? (o[g][_] = new F(_), c[d] = ["variables." + _], h.append(d.toString(), b), u[_] = "Upload!", d++) : o[g][_] = b;
255
+ })) : y !== void 0 && (o[g] = y);
256
+ }), a[e].__args = o, a.__variables = u, p && h.append("map", JSON.stringify(c));
435
257
  }
436
- Object.entries(O(s)).forEach(([l, f]) => {
437
- n[e][l] = f;
438
- }), Object.entries(n[e]).length === 0 && (n[e] = !0);
439
- let o = null;
440
- const a = E({ mutation: n });
441
- if (c ? (i.append("operations", JSON.stringify({
442
- query: a
443
- })), o = await t.post("", i)) : o = await t.post("", {
444
- query: a
445
- }), o.data.errors)
446
- throw new Error(o.data.errors[0].message);
447
- return o.data.data[e];
448
- }, nt = (t) => ({
449
- uploadTempFile: (e) => u(t, "fsUploadTempFile", {
258
+ Object.entries(C(s)).forEach(([o, c]) => {
259
+ a[e][o] = c;
260
+ }), Object.entries(a[e]).length === 0 && (a[e] = !0);
261
+ let n = null;
262
+ const i = P({ mutation: a });
263
+ if (p ? (h.append("operations", JSON.stringify({
264
+ query: i
265
+ })), n = await t.post("", h)) : n = await t.post("", {
266
+ query: i
267
+ }), n.data.errors)
268
+ throw new Error(n.data.errors[0].message);
269
+ return n.data.data[e];
270
+ }, T = (t) => ({
271
+ uploadTempFile: (e) => l(t, "fsUploadTempFile", {
450
272
  file: e
451
273
  }, {
452
274
  name: !0,
@@ -455,7 +277,7 @@ const u = async (t, e, r = null, s = []) => {
455
277
  mime: !0
456
278
  }),
457
279
  folders: {
458
- list: async (e) => (await m(t, {
280
+ list: async (e) => (await w(t, {
459
281
  fsListFolders: {
460
282
  __args: {
461
283
  path: e
@@ -464,44 +286,55 @@ const u = async (t, e, r = null, s = []) => {
464
286
  path: !0
465
287
  }
466
288
  })).fsListFolders,
467
- create: (e) => u(t, "fsCreateFolder", { path: e }),
468
- delete: (e) => u(t, "fsDeleteFolder", { path: e }),
469
- rename: (e, r) => u(t, "fsRenameFolder", { path: e, name: r })
289
+ create: (e) => l(t, "fsCreateFolder", { path: e }),
290
+ delete: (e) => l(t, "fsDeleteFolder", { path: e }),
291
+ rename: (e, r) => l(t, "fsRenameFolder", { path: e, name: r })
470
292
  },
471
293
  files: {
472
- list: async (e) => (await m(t, {
473
- fsListFiles: {
474
- __args: {
475
- path: e
476
- },
477
- name: !0,
478
- path: !0,
479
- size: !0,
480
- mime: !0,
481
- canPreview: !0,
482
- imagePath: !0
483
- }
484
- })).fsListFiles,
294
+ list: async (e) => {
295
+ let { app: r } = await w(t, {
296
+ app: {
297
+ drive: {
298
+ files: {
299
+ __args: {
300
+ path: e
301
+ },
302
+ name: !0,
303
+ path: !0,
304
+ size: !0,
305
+ mime: !0,
306
+ canPreview: !0,
307
+ imagePath: !0
308
+ }
309
+ }
310
+ }
311
+ });
312
+ return r.drive.files;
313
+ },
485
314
  read: async (e) => {
486
- let r = await m(t, {
487
- fsFile: {
488
- __args: {
489
- path: e
490
- },
491
- base64Content: !0
315
+ let { app: r } = await w(t, {
316
+ app: {
317
+ drive: {
318
+ files: {
319
+ __args: {
320
+ path: e
321
+ },
322
+ base64Content: !0
323
+ }
324
+ }
492
325
  }
493
326
  });
494
- return window.atob(r.fsFile.base64Content);
327
+ return window.atob(r.drive.files[0].base64Content);
495
328
  },
496
- write: (e, r) => u(t, "fsWriteFile", {
329
+ write: (e, r) => l(t, "fsWriteFile", {
497
330
  path: e,
498
331
  content: r
499
332
  }),
500
- delete: (e) => u(t, "fsDeleteFile", { path: e }),
501
- rename: (e, r) => u(t, "fsRenameFile", { path: e, name: r }),
502
- move: (e, r) => u(t, "fsMoveFile", { source: e, target: r })
333
+ delete: (e) => l(t, "fsDeleteFile", { path: e }),
334
+ rename: (e, r) => l(t, "fsRenameFile", { path: e, name: r }),
335
+ move: (e, r) => l(t, "fsMoveFile", { source: e, target: r })
503
336
  }
504
- }), it = (t) => ({
337
+ }), M = (t) => ({
505
338
  get: async (e) => (await t({
506
339
  config: {
507
340
  __args: {
@@ -509,13 +342,13 @@ const u = async (t, e, r = null, s = []) => {
509
342
  }
510
343
  }
511
344
  })).config
512
- }), at = (t) => ({
513
- send: (e, r, s) => u(t, "sendMail", {
345
+ }), W = (t) => ({
346
+ send: (e, r, s) => l(t, "sendMail", {
514
347
  email: e,
515
348
  subject: r,
516
349
  message: s
517
350
  })
518
- }), ot = (t) => ({
351
+ }), z = (t) => ({
519
352
  list: async (e = {
520
353
  user_id: !0,
521
354
  username: !0,
@@ -523,52 +356,52 @@ const u = async (t, e, r = null, s = []) => {
523
356
  last_name: !0,
524
357
  status: !0
525
358
  }) => {
526
- const r = L("Users", t, e);
359
+ const r = A("Users", t, e);
527
360
  return r.data_path = "app.users", r.all();
528
361
  }
529
- }), lt = (t) => {
362
+ }), G = (t) => {
530
363
  const e = t, r = {};
531
364
  return {
532
- create(s, n) {
365
+ create(s, a) {
533
366
  r[s] = null;
534
- let i = {};
535
- for (const c of Object.entries(n)) {
536
- const [o, a] = c;
537
- i[o] = () => ({
538
- name: a.name ? a.name : o,
539
- raw: a,
540
- getName: () => a.name ? a.name : o,
541
- getGQLField: () => a.gqlField !== void 0 ? a.gqlField : a.name || o,
367
+ let h = {};
368
+ for (const p of Object.entries(a)) {
369
+ const [n, i] = p;
370
+ h[n] = () => ({
371
+ name: i.name ? i.name : n,
372
+ raw: i,
373
+ getName: () => i.name ? i.name : n,
374
+ getGQLField: () => i.gqlField !== void 0 ? i.gqlField : i.name || n,
542
375
  getRaw() {
543
- return a;
376
+ return i;
544
377
  },
545
- getValue(l) {
546
- return a.field && typeof a.field == "function" ? a.field(l) : a.field && typeof a.field == "string" ? l[a.field] : l[this.getName()];
378
+ getValue(o) {
379
+ return i.field && typeof i.field == "function" ? i.field(o) : i.field && typeof i.field == "string" ? o[i.field] : o[this.getName()];
547
380
  },
548
- getFormattedValue(l) {
549
- const f = this.getValue(l);
550
- return a.format ? a.format(f) : f;
381
+ getFormattedValue(o) {
382
+ const c = this.getValue(o);
383
+ return i.format ? i.format(c) : c;
551
384
  }
552
385
  });
553
386
  }
554
- r[s] = tt(e, s, i);
387
+ r[s] = q(e, s, h);
555
388
  },
556
389
  get(s) {
557
390
  return r[s] || this.create(s, {}), r[s];
558
391
  }
559
392
  };
560
- }, ut = (t) => ({
393
+ }, Q = (t) => ({
561
394
  list: async (e = {
562
395
  name: !0
563
396
  }) => {
564
- const { app: { roles: r } } = await m(t, {
397
+ const { app: { roles: r } } = await w(t, {
565
398
  app: {
566
399
  roles: e
567
400
  }
568
401
  });
569
402
  return r;
570
403
  }
571
- }), ct = [
404
+ }), I = "list", $ = [
572
405
  "flatMap",
573
406
  "chunk",
574
407
  "shuffle",
@@ -594,7 +427,7 @@ const u = async (t, e, r = null, s = []) => {
594
427
  "slice",
595
428
  "tap",
596
429
  "sort"
597
- ], ft = [
430
+ ], K = [
598
431
  "avg",
599
432
  "count",
600
433
  "countBy",
@@ -620,29 +453,27 @@ const u = async (t, e, r = null, s = []) => {
620
453
  "get",
621
454
  "has",
622
455
  "implode",
623
- "partition",
624
- "sole"
456
+ "partition"
625
457
  ];
626
- class d {
458
+ class f {
627
459
  constructor(e, r) {
628
- C(this, "_batchData", null);
629
- // 新增
630
- C(this, "data_path", "");
631
- C(this, "axios");
632
- C(this, "filters");
633
- C(this, "steps");
634
- C(this, "fields");
635
- C(this, "already_limit", !1);
636
- C(this, "already_offset", !1);
637
- C(this, "limit", null);
638
- C(this, "offset", null);
639
- C(this, "_sort", null);
640
- C(this, "_sortDesc", !1);
641
- C(this, "meta", {});
460
+ m(this, "_batchData", null);
461
+ m(this, "data_path", "");
462
+ m(this, "axios");
463
+ m(this, "filters");
464
+ m(this, "steps");
465
+ m(this, "fields");
466
+ m(this, "already_limit", !1);
467
+ m(this, "already_offset", !1);
468
+ m(this, "limit", null);
469
+ m(this, "offset", null);
470
+ m(this, "_sort", null);
471
+ m(this, "_sortDesc", !1);
472
+ m(this, "meta", {});
642
473
  this.axios = r, this.filters = {}, this.steps = [], this.fields = e;
643
474
  }
644
475
  }
645
- d.prototype.getQueryPayload = function() {
476
+ f.prototype.getQueryPayload = function() {
646
477
  let t = {
647
478
  meta: {
648
479
  total: !0,
@@ -656,119 +487,159 @@ d.prototype.getQueryPayload = function() {
656
487
  steps: this.steps
657
488
  };
658
489
  };
659
- d.prototype.dataPath = function(t) {
490
+ f.prototype.dataPath = function(t) {
660
491
  const e = this.clone();
661
492
  return e.data_path = t, e;
662
493
  };
663
- d.prototype.buildArgs = function() {
494
+ f.prototype.buildArgs = function() {
664
495
  let t = {};
665
496
  return Object.keys(this.filters).length > 0 && (t.filters = this.filters), this._sort && (t.sort = this._sort, this._sortDesc && (t.sort += ":desc")), t;
666
497
  };
667
- d.prototype.clone = function() {
498
+ f.prototype.clone = function() {
668
499
  const t = Object.create(this);
669
500
  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;
670
501
  };
671
- N().macro("whereContains", function(t, e) {
502
+ D().macro("whereContains", function(t, e) {
672
503
  return this.filter((r) => r[t].toLowerCase().includes(e.toLowerCase()));
673
504
  });
674
- d.prototype.fetchData = async function() {
675
- if (this._batchData) {
676
- const o = this._batchData;
677
- return this.meta = o.meta, N(o.data);
678
- }
679
- let t = {
680
- meta: {
681
- total: !0,
682
- key: !0,
683
- name: !0
505
+ f.prototype.fetchData = async function() {
506
+ try {
507
+ if (this._batchData) {
508
+ const n = this._batchData;
509
+ return this.meta = n.meta, D(n.data);
684
510
  }
685
- };
686
- 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);
687
- const e = this.data_path.split(".");
688
- let r = {}, s = r, n = e[e.length - 1];
689
- for (const o of e) {
690
- if (o === n) {
691
- s[o] = t;
692
- break;
511
+ let t = {
512
+ meta: {
513
+ total: !0,
514
+ key: !0,
515
+ name: !0
516
+ }
517
+ };
518
+ 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);
519
+ const e = this.data_path.split(".");
520
+ let r = {}, s = r, a = e[e.length - 1];
521
+ for (const n of e) {
522
+ if (n === a) {
523
+ s[n] = t;
524
+ break;
525
+ }
526
+ s[n] = {}, s = s[n];
693
527
  }
694
- s[o] = {}, s = s[o];
528
+ let p = await w(this.axios, r);
529
+ for (const n of e)
530
+ p = p[n];
531
+ return this.meta = p.meta, D(p.data);
532
+ } catch (t) {
533
+ throw console.error("Error fetching collection data:", t), t;
695
534
  }
696
- let c = await m(this.axios, r);
697
- for (const o of e)
698
- c = c[o];
699
- return this.meta = c.meta, N(c.data);
700
535
  };
701
- d.prototype.processData = async function() {
536
+ f.prototype.processData = async function() {
702
537
  let t = await this.fetchData();
703
538
  for (const e of this.steps)
704
539
  t = t[e.type](...e.args);
705
540
  return t;
706
541
  };
707
- d.prototype.all = async function() {
542
+ f.prototype.all = async function() {
708
543
  return (await this.processData()).all();
709
544
  };
710
- for (const t of ct)
711
- d.prototype[t] = function(...e) {
545
+ for (const t of $)
546
+ f.prototype[t] = function(...e) {
712
547
  const r = this.clone();
713
548
  return r.steps.push({ type: t, args: e }), r;
714
549
  };
715
- for (const t of ft)
716
- d.prototype[t] = async function(...e) {
550
+ for (const t of K)
551
+ f.prototype[t] = async function(...e) {
717
552
  return (await this.clone().processData())[t](...e);
718
553
  };
719
- d.prototype.average = d.prototype.avg;
720
- d.prototype.first = async function() {
554
+ f.prototype.average = f.prototype.avg;
555
+ f.prototype.first = async function() {
721
556
  return this.take(1), (await this.processData()).first();
722
557
  };
723
- d.prototype.where = function(...t) {
724
- if (this._batchData)
725
- return this.steps.push({ type: "where", args: t }), this;
726
- if (t.length == 2)
558
+ f.prototype._handleBatchData = function(t, e) {
559
+ return this._batchData ? (this.steps.push({ type: t, args: e }), this) : null;
560
+ };
561
+ f.prototype.where = function(...t) {
562
+ const e = this._handleBatchData("where", t);
563
+ if (e) return e;
564
+ if (t.length === 2)
727
565
  this.filters[t[0]] = t[1];
728
- else if (t.length == 3) {
729
- let e = "==", r = t[0], s = null;
730
- t.length == 3 && (e = t[1], s = t[2]), e === "==" && (this.filters[r] = s), e === "<" && (this.filters[r] = { lt: s }), e === "<=" && (this.filters[r] = { lte: s }), e === ">" && (this.filters[r] = { gt: s }), e === ">=" && (this.filters[r] = { gte: s }), e === "!==" && (this.filters[r] = { ne: s });
566
+ else if (t.length === 3) {
567
+ const r = t[0], s = t[1], a = t[2];
568
+ switch (s) {
569
+ case "==":
570
+ this.filters[r] = a;
571
+ break;
572
+ case "<":
573
+ this.filters[r] = { lt: a };
574
+ break;
575
+ case "<=":
576
+ this.filters[r] = { lte: a };
577
+ break;
578
+ case ">":
579
+ this.filters[r] = { gt: a };
580
+ break;
581
+ case ">=":
582
+ this.filters[r] = { gte: a };
583
+ break;
584
+ case "!==":
585
+ this.filters[r] = { ne: a };
586
+ break;
587
+ default:
588
+ throw new Error(`Unsupported operator: ${s}`);
589
+ }
731
590
  }
732
591
  return this;
733
592
  };
734
- d.prototype.whereContains = function(t, e) {
735
- return this._batchData ? (this.steps.push({ type: "whereContains", args: [t, e] }), this) : (this.filters[t] = { contains: e }, this);
593
+ f.prototype.whereContains = function(t, e) {
594
+ const r = this._handleBatchData("whereContains", [t, e]);
595
+ return r || (this.filters[t] = { contains: e }, this);
736
596
  };
737
- d.prototype.forPage = function(t, e) {
597
+ f.prototype.forPage = function(t, e) {
738
598
  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);
739
599
  };
740
- d.prototype.whereIn = function(t, e) {
741
- return this._batchData ? (this.steps.push({ type: "whereIn", args: [t, e] }), this) : (this.filters[t] = { in: e }, this);
600
+ f.prototype.whereIn = function(t, e) {
601
+ const r = this._handleBatchData("whereIn", [t, e]);
602
+ return r || (this.filters[t] = { in: e }, this);
742
603
  };
743
- d.prototype.whereNotIn = function(t, e) {
744
- return this._batchData ? (this.steps.push({ type: "whereNotIn", args: [t, e] }), this) : (this.filters[t] = { nin: e }, this);
604
+ f.prototype.whereNotIn = function(t, e) {
605
+ const r = this._handleBatchData("whereNotIn", [t, e]);
606
+ return r || (this.filters[t] = { nin: e }, this);
745
607
  };
746
- d.prototype.whereNotBetween = function(t, e) {
747
- return this._batchData ? (this.steps.push({ type: "whereNotBetween", args: [t, e] }), this) : (this.filters[t] = { notBetween: e }, this);
608
+ f.prototype.whereNotBetween = function(t, e) {
609
+ const r = this._handleBatchData("whereNotBetween", [t, e]);
610
+ return r || (this.filters[t] = { notBetween: e }, this);
748
611
  };
749
- d.prototype.whereBetween = function(t, e) {
750
- return this._batchData ? (this.steps.push({ type: "whereBetween", args: [t, e] }), this) : (this.filters[t] = { between: e }, this);
612
+ f.prototype.whereBetween = function(t, e) {
613
+ const r = this._handleBatchData("whereBetween", [t, e]);
614
+ return r || (this.filters[t] = { between: e }, this);
751
615
  };
752
- d.prototype.sortBy = function(t) {
616
+ f.prototype.sortBy = function(t) {
753
617
  return this.steps.push({ type: "sortBy", args: [t] }), typeof t == "string" && (this._sort = t), this;
754
618
  };
755
- d.prototype.sortByDesc = function(t) {
619
+ f.prototype.sortByDesc = function(t) {
756
620
  return this.steps.push({ type: "sortByDesc", args: [t] }), typeof t == "string" && (this._sort = t, this._sortDesc = !0), this;
757
621
  };
758
- d.prototype.skip = function(t) {
622
+ f.prototype.skip = function(t) {
623
+ if (t < 0)
624
+ throw new Error("Offset must be non-negative");
759
625
  return this.already_offset && this.steps.push({ type: "skip", args: [t] }), this.offset = t, this.already_offset = !0, this;
760
626
  };
761
- d.prototype.take = function(t) {
627
+ f.prototype.take = function(t) {
628
+ if (t < 0)
629
+ throw new Error("Length must be non-negative");
762
630
  return this.already_limit ? (this.steps.push({ type: "take", args: [t] }), this) : (this.limit = t, this.already_limit = !0, this);
763
631
  };
764
- d.prototype.splice = function(t, e) {
632
+ f.prototype.splice = function(t, e) {
765
633
  return this.steps.push({ type: "splice", args: [t, e] }), this.offset = t, this.limit = e, this.already_limit = !0, this.already_offset = !0, this;
766
634
  };
767
- const L = (t, e, r) => {
768
- const s = new d(r, e);
769
- return s.data_path = "list" + t, s;
770
- }, pt = (t, e) => ({
771
- uploadTempFile: (r) => u(e, "lightDriveUploadTempFile", {
635
+ const A = (t, e, r) => {
636
+ const s = new f(r, e);
637
+ return s.data_path = I + t, s;
638
+ }, O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
639
+ __proto__: null,
640
+ default: A
641
+ }, Symbol.toStringTag, { value: "Module" })), V = (t, e) => ({
642
+ uploadTempFile: (r) => l(e, "lightDriveUploadTempFile", {
772
643
  index: t,
773
644
  file: r
774
645
  }, {
@@ -781,7 +652,7 @@ const L = (t, e, r) => {
781
652
  list: async (r, s = {
782
653
  name: !0,
783
654
  path: !0
784
- }) => (await m(e, {
655
+ }) => (await w(e, {
785
656
  app: {
786
657
  drive: {
787
658
  __args: {
@@ -796,9 +667,9 @@ const L = (t, e, r) => {
796
667
  }
797
668
  }
798
669
  })).app.drive.folders,
799
- create: (r) => u(e, "lightDriveCreateFolder", { index: t, path: r }),
800
- delete: (r) => u(e, "lightDriveDeleteFolder", { index: t, path: r }),
801
- rename: (r, s) => u(e, "lightDriveRenameFolder", { index: t, path: r, name: s })
670
+ create: (r) => l(e, "lightDriveCreateFolder", { index: t, path: r }),
671
+ delete: (r) => l(e, "lightDriveDeleteFolder", { index: t, path: r }),
672
+ rename: (r, s) => l(e, "lightDriveRenameFolder", { index: t, path: r, name: s })
802
673
  },
803
674
  files: {
804
675
  list: async (r, s = {
@@ -807,7 +678,7 @@ const L = (t, e, r) => {
807
678
  size: !0,
808
679
  mime: !0,
809
680
  url: !0
810
- }) => (await m(e, {
681
+ }) => (await w(e, {
811
682
  app: {
812
683
  drive: {
813
684
  __args: {
@@ -828,7 +699,7 @@ const L = (t, e, r) => {
828
699
  size: !0,
829
700
  mime: !0,
830
701
  url: !0
831
- }) => (await m(e, {
702
+ }) => (await w(e, {
832
703
  app: {
833
704
  drive: {
834
705
  __args: {
@@ -844,7 +715,7 @@ const L = (t, e, r) => {
844
715
  }
845
716
  })).app.drive.file,
846
717
  read: async (r) => {
847
- let s = await m(e, {
718
+ let s = await w(e, {
848
719
  app: {
849
720
  drive: {
850
721
  __args: {
@@ -859,78 +730,94 @@ const L = (t, e, r) => {
859
730
  }
860
731
  }
861
732
  });
862
- return window.atob(s.app.drive.file.base64Content);
733
+ if (!s.app.drive.file || !s.app.drive.file.base64Content)
734
+ throw new Error(`File not found or cannot read content: ${r}`);
735
+ return typeof window < "u" && window.atob ? window.atob(s.app.drive.file.base64Content) : s.app.drive.file.base64Content;
863
736
  },
864
- write: (r, s) => u(e, "lightDriveWriteFile", { index: t, path: r, content: s }),
865
- delete: (r) => u(e, "lightDriveDeleteFile", { index: t, path: r }),
866
- rename: (r, s) => u(e, "lightDriveRenameFile", { index: t, path: r, name: s }),
867
- move: (r, s) => u(e, "lightDriveMoveFile", { index: t, source: r, destination: s })
737
+ write: (r, s) => l(e, "lightDriveWriteFile", { index: t, path: r, content: s }),
738
+ delete: (r) => l(e, "lightDriveDeleteFile", { index: t, path: r }),
739
+ rename: (r, s) => l(e, "lightDriveRenameFile", { index: t, path: r, name: s }),
740
+ move: (r, s) => l(e, "lightDriveMoveFile", { index: t, source: r, destination: s })
868
741
  }
869
- }), mt = (t) => {
870
- const e = W.create({
742
+ }), tt = (t) => {
743
+ const e = typeof window > "u";
744
+ let r = [];
745
+ const s = R.create({
871
746
  baseURL: t,
872
747
  withCredentials: !0
873
- }), r = (i, c = null, o = []) => u(e, i, c, o), s = (i) => m(e, i), n = lt(e);
748
+ });
749
+ e && (s.interceptors.request.use((n) => (n.withCredentials = !0, r.length > 0 && (n.headers.Cookie = r.join("; ")), n)), s.interceptors.response.use((n) => {
750
+ if (n.headers["set-cookie"]) {
751
+ const i = n.headers["set-cookie"].map((u) => u.split(";")[0]), o = r.map((u) => u.split("=")[0]), c = i.filter((u) => {
752
+ const d = u.split("=")[0];
753
+ return !o.includes(d);
754
+ });
755
+ r = [...r, ...c];
756
+ }
757
+ return n;
758
+ }));
759
+ const a = (n, i = null, o = []) => l(s, n, i, o), h = (n) => w(s, n), p = G(s);
874
760
  return {
875
761
  baseURL: t,
876
- axios: e,
877
- auth: x(e),
878
- mutation: r,
879
- query: s,
880
- config: it(s),
881
- mail: at(e),
882
- users: ot(e),
883
- fs: nt(e),
884
- models: n,
885
- model(i) {
886
- return n.get(i);
762
+ axios: s,
763
+ auth: S(s),
764
+ mutation: a,
765
+ query: h,
766
+ config: M(h),
767
+ mail: W(s),
768
+ users: z(s),
769
+ fs: T(s),
770
+ models: p,
771
+ model(n) {
772
+ return p.get(n);
887
773
  },
888
- roles: ut(e),
889
- collect: (i, c) => {
890
- const o = L(i, e, c);
891
- return o.data_path = n.get(i).getDataPath(), o;
774
+ roles: Q(s),
775
+ collect: (n, i) => {
776
+ const o = A(n, s, i);
777
+ return o.data_path = p.get(n).getDataPath(), o;
892
778
  },
893
- drive(i) {
894
- return pt(i, e);
779
+ drive(n) {
780
+ return V(n, s);
895
781
  },
896
- async collects(i) {
897
- const c = {}, o = {};
898
- for (const l in i) {
899
- const f = i[l].getQueryPayload();
900
- o[l] = f.data_path, c[l] = {};
901
- const _ = f.data_path.split(".");
902
- let b = _[_.length - 1], y = c[l];
903
- for (const w of _) {
904
- if (w === b) {
905
- y[w] = f.query;
782
+ async collects(n) {
783
+ const i = {}, o = {};
784
+ for (const u in n) {
785
+ const d = n[u].getQueryPayload();
786
+ o[u] = d.data_path, i[u] = {};
787
+ const g = d.data_path.split(".");
788
+ let y = g[g.length - 1], _ = i[u];
789
+ for (const b of g) {
790
+ if (b === y) {
791
+ _[b] = d.query;
906
792
  break;
907
793
  }
908
- y[w] = y[w] || {};
794
+ _[b] = _[b] || {};
909
795
  }
910
- c[l].__aliasFor = _[0];
796
+ i[u].__aliasFor = g[0];
911
797
  }
912
- const a = await m(e, c);
913
- for (const l in i) {
914
- const f = o[l].split(".");
915
- let _ = f[f.length - 1], b = a[l];
916
- for (const y of f) {
917
- if (y === _) {
918
- i[l]._batchData = a[l][y];
798
+ const c = await w(s, i);
799
+ for (const u in n) {
800
+ const d = o[u].split(".");
801
+ let g = d[d.length - 1], y = c[u];
802
+ for (const _ of d) {
803
+ if (_ === g) {
804
+ n[u]._batchData = c[u][_];
919
805
  break;
920
806
  }
921
- b[y] = b[y] || {};
807
+ y[_] = y[_] || {};
922
808
  }
923
809
  }
924
- return i;
810
+ return n;
925
811
  }
926
812
  };
927
813
  };
928
814
  export {
929
- _t as File,
930
- mt as createClient,
931
- L as createCollection,
815
+ x as File,
816
+ tt as createClient,
817
+ A as createCollection,
932
818
  k as file,
933
- u as mutation,
934
- m as query,
935
- O as toQuery
819
+ l as mutation,
820
+ w as query,
821
+ C as toQuery,
822
+ E as useWebAuthn
936
823
  };