@hostlink/light 1.0.1 → 1.1.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/file.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ export declare const file: (s?: string) => {
2
+ getContent: () => string;
3
+ getURL: (mime?: string) => string;
4
+ download: (filename: string) => void;
5
+ open: (mime: string) => void;
6
+ };
7
+ export declare const File: {
8
+ fromBase85: (a: string) => {
9
+ getContent: () => string;
10
+ getURL: (mime?: string) => string;
11
+ download: (filename: string) => void;
12
+ open: (mime: string) => void;
13
+ };
14
+ fromBase64: (a: string) => {
15
+ getContent: () => string;
16
+ getURL: (mime?: string) => string;
17
+ download: (filename: string) => void;
18
+ open: (mime: string) => void;
19
+ };
20
+ fromString: (a: string) => {
21
+ getContent: () => string;
22
+ getURL: (mime?: string) => string;
23
+ download: (filename: string) => void;
24
+ open: (mime: string) => void;
25
+ };
26
+ };
package/dist/fs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type File = {
1
+ export type FSFile = {
2
2
  name: string;
3
3
  path: string;
4
4
  size: number;
@@ -6,12 +6,12 @@ export type File = {
6
6
  canPreview: boolean;
7
7
  imagePath: string;
8
8
  };
9
- export type Folder = {
9
+ export type FSFolder = {
10
10
  name: String;
11
11
  path: String;
12
12
  };
13
13
  export declare const fsListFiles: (path: string) => Promise<Array<File>>;
14
- export declare const fsListFolders: (path: string) => Promise<Array<Folder>>;
14
+ export declare const fsListFolders: (path: string) => Promise<Array<FSFolder>>;
15
15
  export declare const fsReadFile: (path: string) => Promise<string>;
16
16
  export declare const fsWriteFile: (path: string, content: string) => Promise<boolean>;
17
17
  export declare const fsDeleteFile: (path: string) => Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './auth';
2
2
  export * from './axios';
3
3
  export * from './granted';
4
4
  export * from './model';
5
+ export * from './file';
5
6
  import query from './query';
6
7
  import mutation from './mutation';
7
8
  import toQuery from './toQuery';
package/dist/light.js CHANGED
@@ -1,111 +1,212 @@
1
- import x from "axios";
2
- import { jsonToGraphQLQuery as h, VariableType as E } from "json-to-graphql-query";
3
- const G = (e, t, r = "") => c("login", {
1
+ import U from "axios";
2
+ import { VariableType as R, jsonToGraphQLQuery as v } from "json-to-graphql-query";
3
+ const X = (e, t, r = "") => u("login", {
4
4
  username: e,
5
5
  password: t,
6
6
  code: r
7
- }), W = () => c("logout"), B = (e, t) => c("updatePassword", {
7
+ }), Y = () => u("logout"), Z = (e, t) => u("updatePassword", {
8
8
  old_password: e,
9
9
  new_password: t
10
- }), I = (e, t, r) => c("resetPassword", {
10
+ }), k = (e, t, r) => u("resetPassword", {
11
11
  email: e,
12
12
  password: t,
13
13
  code: r
14
- }), z = (e) => c("forgetPassword", {
14
+ }), ee = (e) => u("forgetPassword", {
15
15
  email: e
16
16
  });
17
- let w;
18
- const $ = (e) => {
19
- w = e;
20
- }, y = () => (w || (w = x.create({
17
+ let h;
18
+ const te = (e) => {
19
+ h = e;
20
+ }, b = () => (h || (h = U.create({
21
21
  withCredentials: !0
22
- })), w), H = async (e) => (await d({
22
+ })), h), re = async (e) => (await p({
23
23
  granted: {
24
24
  __args: {
25
25
  rights: e
26
26
  }
27
27
  }
28
- })).granted, g = {}, X = (e, t) => {
29
- g[e] = {};
28
+ })).granted, m = {}, ne = (e, t) => {
29
+ m[e] = {};
30
30
  for (const r of Object.entries(t)) {
31
- const [n, s] = r;
32
- g[e][n] = () => ({
33
- name: s.name ? s.name : n,
34
- raw: s,
35
- getName: () => s.name ? s.name : n,
36
- getGQLField: () => s.gqlField !== void 0 ? s.gqlField : s.name || n,
31
+ const [s, n] = r;
32
+ m[e][s] = () => ({
33
+ name: n.name ? n.name : s,
34
+ raw: n,
35
+ getName: () => n.name ? n.name : s,
36
+ getGQLField: () => n.gqlField !== void 0 ? n.gqlField : n.name || s,
37
37
  getRaw() {
38
- return s;
38
+ return n;
39
39
  },
40
- getValue(u) {
41
- return s.field && typeof s.field == "function" ? s.field(u) : s.field && typeof s.field == "string" ? u[s.field] : u[this.getName()];
40
+ getValue(a) {
41
+ return n.field && typeof n.field == "function" ? n.field(a) : n.field && typeof n.field == "string" ? a[n.field] : a[this.getName()];
42
42
  },
43
- getFormattedValue(u) {
44
- const f = this.getValue(u);
45
- return s.format ? s.format(f) : f;
43
+ getFormattedValue(a) {
44
+ const c = this.getValue(a);
45
+ return n.format ? n.format(c) : c;
46
46
  }
47
47
  });
48
48
  }
49
- }, q = (e, t) => !g[e] || !g[e][t] ? null : g[e][t](), Y = (e, t) => {
49
+ }, q = (e, t) => !m[e] || !m[e][t] ? null : m[e][t](), se = (e, t) => {
50
50
  const r = [];
51
- for (const n of t)
52
- if (typeof n == "string") {
53
- const s = q(e, n);
54
- s && r.push(s.getGQLField());
51
+ for (const s of t)
52
+ if (typeof s == "string") {
53
+ const n = q(e, s);
54
+ n && r.push(n.getGQLField());
55
55
  } else
56
- typeof n == "object" && r.push(n);
56
+ typeof s == "object" && r.push(s);
57
57
  return r;
58
- }, m = (e) => {
58
+ }, S = (e) => {
59
+ const t = new FormData(), r = {}, s = {}, n = {};
60
+ let a = 0, c = !1;
61
+ return Object.entries(e).forEach(([d, g]) => {
62
+ g instanceof File ? (c = !0, s[d] = "Upload!", n[d] = new R(d), t.append(a.toString(), g), r[a] = ["variables." + d], a++) : n[d] = g;
63
+ }), c ? (t.append("map", JSON.stringify(r)), {
64
+ data: n,
65
+ formData: t,
66
+ mutation: {
67
+ __variables: s
68
+ }
69
+ }) : {
70
+ data: n,
71
+ formData: null,
72
+ mutation: {}
73
+ };
74
+ }, ae = (e) => {
75
+ const t = e;
76
+ return {
77
+ name: t,
78
+ async update(r, s) {
79
+ const n = S(s);
80
+ return await u("update" + t, { id: r, data: n.data }, [], n.mutation, n.formData);
81
+ },
82
+ async delete(r) {
83
+ return await u("delete" + t, { id: r });
84
+ },
85
+ async add(r) {
86
+ const s = S(r);
87
+ return await u("add" + t, { data: s.data }, [], s.mutation, s.formData);
88
+ },
89
+ fields(r) {
90
+ let s = [];
91
+ for (let n of r) {
92
+ const a = q(t, n);
93
+ a && s.push(a);
94
+ }
95
+ return s;
96
+ },
97
+ async get(r, s) {
98
+ return (await p({
99
+ ["list" + t]: {
100
+ __args: {
101
+ filters: r
102
+ },
103
+ data: {
104
+ __args: {
105
+ limit: 1
106
+ },
107
+ ...y(s)
108
+ }
109
+ }
110
+ }))["list" + t].data[0];
111
+ },
112
+ async list(r, s) {
113
+ return (await p({
114
+ ["list" + t]: {
115
+ __args: {
116
+ filters: r
117
+ },
118
+ data: {
119
+ ...y(s)
120
+ }
121
+ }
122
+ }))["list" + t].data;
123
+ }
124
+ };
125
+ };
126
+ function P(e) {
127
+ e = "<~" + e + "~>";
128
+ var t, r, s, n, a, c = String, d = 255;
129
+ for (e.slice(0, 2) === "<~" && e.slice(-2), e = e.slice(2, -2).replace(/\s/g, "").replace("z", "!!!!!"), t = "uuuuu".slice(e.length % 5 || 5), e += t, s = [], n = 0, a = e.length; a > n; n += 5)
130
+ r = 52200625 * (e.charCodeAt(n) - 33) + 614125 * (e.charCodeAt(n + 1) - 33) + 7225 * (e.charCodeAt(n + 2) - 33) + 85 * (e.charCodeAt(n + 3) - 33) + (e.charCodeAt(n + 4) - 33), s.push(d & r >> 24, d & r >> 16, d & r >> 8, d & r);
131
+ return function(g, L) {
132
+ for (var O = L; O > 0; O--)
133
+ g.pop();
134
+ }(s, t.length), c.fromCharCode.apply(c, s);
135
+ }
136
+ const F = (e = "") => {
137
+ const t = e, r = (s = "application/octet-stream") => {
138
+ const n = new Uint8Array(t.length);
139
+ for (let d = 0; d < t.length; d++)
140
+ n[d] = t.charCodeAt(d);
141
+ const a = new Blob([n], { type: s });
142
+ return URL.createObjectURL(a);
143
+ };
144
+ return {
145
+ getContent: () => t,
146
+ getURL: r,
147
+ download: (s) => {
148
+ const n = document.createElement("a");
149
+ n.download = s, n.href = r(), document.body.appendChild(n), n.click(), document.body.removeChild(n);
150
+ },
151
+ open: (s) => {
152
+ window.open(r(s), "_blank");
153
+ }
154
+ };
155
+ }, oe = {
156
+ fromBase85: (e) => F(P(e)),
157
+ fromBase64: (e) => F(atob(e)),
158
+ fromString: (e) => F(e)
159
+ }, C = (e) => {
59
160
  let t = {};
60
161
  return typeof e == "string" ? (t[e] = !0, t) : e instanceof Array ? (e.forEach((r) => {
61
- Object.entries(m(r)).forEach(([n, s]) => {
62
- t[n] = s;
162
+ Object.entries(C(r)).forEach(([s, n]) => {
163
+ t[s] = n;
63
164
  });
64
- }), t) : (Object.entries(e).forEach(([r, n]) => {
165
+ }), t) : (Object.entries(e).forEach(([r, s]) => {
65
166
  if (r == "__args" || r == "__aliasFor" || r == "__variables" || r == "__directives" || r == "__all_on" || r == "__name") {
66
- t[r] = n;
167
+ t[r] = s;
67
168
  return;
68
169
  }
69
- if (typeof n == "boolean") {
70
- t[r] = n;
170
+ if (typeof s == "boolean") {
171
+ t[r] = s;
71
172
  return;
72
173
  }
73
- t[r] = m(n);
174
+ t[r] = C(s);
74
175
  }), t);
75
- }, F = (e) => m(e), d = async (e) => {
76
- let t = h(F(e));
77
- const r = await y().post(_(), {
176
+ }, y = (e) => C(e), p = async (e) => {
177
+ let t = v(y(e));
178
+ const r = await b().post(_(), {
78
179
  query: `{ ${t} }`
79
180
  });
80
181
  if (r.data.errors)
81
182
  throw new Error(r.data.errors[0].message);
82
183
  return r.data.data;
83
- }, c = async (e, t = null, r = []) => {
84
- const n = {
85
- mutation: {}
86
- };
87
- n.mutation[e] = !0, r instanceof Array && r.length != 0 && (n.mutation[e] = {}), t && (n.mutation[e] = {}, n.mutation[e].__args = t), Object.entries(F(r)).forEach(([u, f]) => {
88
- n.mutation[e][u] = f;
184
+ }, u = async (e, t = null, r = [], s = {}, n = null) => {
185
+ s[e] = !0, r instanceof Array && r.length != 0 && (s[e] = {}), t && (s[e] = {}, s[e].__args = t), Object.entries(y(r)).forEach(([d, g]) => {
186
+ s[e][d] = g;
89
187
  });
90
- const s = await y().post(_(), {
91
- query: h(n)
92
- });
93
- if (s.data.errors)
94
- throw new Error(s.data.errors[0].message);
95
- return s.data.data[e];
188
+ let a = null;
189
+ const c = v({ mutation: s });
190
+ if (n ? (n.append("operations", JSON.stringify({
191
+ query: c
192
+ })), a = await b().post(_(), n)) : a = await b().post(_(), {
193
+ query: c
194
+ }), a.data.errors)
195
+ throw new Error(a.data.errors[0].message);
196
+ return a.data.data[e];
96
197
  };
97
- let O = "/api/";
98
- const Z = (e) => {
99
- O = e;
100
- }, _ = () => O;
101
- async function k(e) {
198
+ let E = "/api/";
199
+ const ie = (e) => {
200
+ E = e;
201
+ }, _ = () => E;
202
+ async function le(e) {
102
203
  const t = {
103
204
  __variables: {
104
205
  file: "Upload!"
105
206
  },
106
207
  fsUploadTempFile: {
107
208
  __args: {
108
- file: new E("file")
209
+ file: new R("file")
109
210
  },
110
211
  name: !0,
111
212
  path: !0,
@@ -114,224 +215,224 @@ async function k(e) {
114
215
  }
115
216
  }, r = new FormData();
116
217
  r.append("operations", JSON.stringify({
117
- query: h({ mutation: t })
218
+ query: v({ mutation: t })
118
219
  })), r.append("map", JSON.stringify({ 0: ["variables.file"] })), r.append("0", e);
119
- const n = await y().post(_(), r);
120
- if (n.data.errors)
121
- throw new Error(n.data.errors[0].message);
122
- return n.data.data.fsUploadTempFile;
220
+ const s = await b().post(_(), r);
221
+ if (s.data.errors)
222
+ throw new Error(s.data.errors[0].message);
223
+ return s.data.data.fsUploadTempFile;
123
224
  }
124
- const ee = (e, t, r) => c("sendMail", {
225
+ const ce = (e, t, r) => u("sendMail", {
125
226
  email: e,
126
227
  subject: t,
127
228
  message: r
128
- }), te = async (e) => (await d({
229
+ }), ue = async (e) => (await p({
129
230
  config: {
130
231
  __args: {
131
232
  name: e
132
233
  }
133
234
  }
134
235
  })).config;
135
- function v(e) {
136
- const t = "==".slice(0, (4 - e.length % 4) % 4), r = e.replace(/-/g, "+").replace(/_/g, "/") + t, n = atob(r), s = new ArrayBuffer(n.length), u = new Uint8Array(s);
137
- for (let f = 0; f < n.length; f++)
138
- u[f] = n.charCodeAt(f);
139
- return s;
236
+ function N(e) {
237
+ const t = "==".slice(0, (4 - e.length % 4) % 4), r = e.replace(/-/g, "+").replace(/_/g, "/") + t, s = atob(r), n = new ArrayBuffer(s.length), a = new Uint8Array(n);
238
+ for (let c = 0; c < s.length; c++)
239
+ a[c] = s.charCodeAt(c);
240
+ return n;
140
241
  }
141
- function A(e) {
242
+ function x(e) {
142
243
  const t = new Uint8Array(e);
143
244
  let r = "";
144
- for (const u of t)
145
- r += String.fromCharCode(u);
245
+ for (const a of t)
246
+ r += String.fromCharCode(a);
146
247
  return btoa(r).replace(/\+/g, "-").replace(
147
248
  /\//g,
148
249
  "_"
149
250
  ).replace(/=/g, "");
150
251
  }
151
- var a = "copy", l = "convert";
152
- function p(e, t, r) {
153
- if (t === a)
252
+ var o = "copy", f = "convert";
253
+ function w(e, t, r) {
254
+ if (t === o)
154
255
  return r;
155
- if (t === l)
256
+ if (t === f)
156
257
  return e(r);
157
258
  if (t instanceof Array)
158
- return r.map((n) => p(e, t[0], n));
259
+ return r.map((s) => w(e, t[0], s));
159
260
  if (t instanceof Object) {
160
- const n = {};
161
- for (const [s, u] of Object.entries(t)) {
162
- if (u.derive) {
163
- const f = u.derive(r);
164
- f !== void 0 && (r[s] = f);
261
+ const s = {};
262
+ for (const [n, a] of Object.entries(t)) {
263
+ if (a.derive) {
264
+ const c = a.derive(r);
265
+ c !== void 0 && (r[n] = c);
165
266
  }
166
- if (!(s in r)) {
167
- if (u.required)
168
- throw new Error(`Missing key: ${s}`);
267
+ if (!(n in r)) {
268
+ if (a.required)
269
+ throw new Error(`Missing key: ${n}`);
169
270
  continue;
170
271
  }
171
- if (r[s] == null) {
172
- n[s] = null;
272
+ if (r[n] == null) {
273
+ s[n] = null;
173
274
  continue;
174
275
  }
175
- n[s] = p(
276
+ s[n] = w(
176
277
  e,
177
- u.schema,
178
- r[s]
278
+ a.schema,
279
+ r[n]
179
280
  );
180
281
  }
181
- return n;
282
+ return s;
182
283
  }
183
284
  }
184
- function b(e, t) {
285
+ function A(e, t) {
185
286
  return {
186
287
  required: !0,
187
288
  schema: e,
188
289
  derive: t
189
290
  };
190
291
  }
191
- function o(e) {
292
+ function i(e) {
192
293
  return {
193
294
  required: !0,
194
295
  schema: e
195
296
  };
196
297
  }
197
- function i(e) {
298
+ function l(e) {
198
299
  return {
199
300
  required: !1,
200
301
  schema: e
201
302
  };
202
303
  }
203
- var C = {
204
- type: o(a),
205
- id: o(l),
206
- transports: i(a)
207
- }, S = {
208
- appid: i(a),
209
- appidExclude: i(a),
210
- credProps: i(a)
211
- }, R = {
212
- appid: i(a),
213
- appidExclude: i(a),
214
- credProps: i(a)
215
- }, N = {
216
- publicKey: o({
217
- rp: o(a),
218
- user: o({
219
- id: o(l),
220
- name: o(a),
221
- displayName: o(a)
304
+ var J = {
305
+ type: i(o),
306
+ id: i(f),
307
+ transports: l(o)
308
+ }, j = {
309
+ appid: l(o),
310
+ appidExclude: l(o),
311
+ credProps: l(o)
312
+ }, D = {
313
+ appid: l(o),
314
+ appidExclude: l(o),
315
+ credProps: l(o)
316
+ }, T = {
317
+ publicKey: i({
318
+ rp: i(o),
319
+ user: i({
320
+ id: i(f),
321
+ name: i(o),
322
+ displayName: i(o)
222
323
  }),
223
- challenge: o(l),
224
- pubKeyCredParams: o(a),
225
- timeout: i(a),
226
- excludeCredentials: i([C]),
227
- authenticatorSelection: i(a),
228
- attestation: i(a),
229
- extensions: i(S)
324
+ challenge: i(f),
325
+ pubKeyCredParams: i(o),
326
+ timeout: l(o),
327
+ excludeCredentials: l([J]),
328
+ authenticatorSelection: l(o),
329
+ attestation: l(o),
330
+ extensions: l(j)
230
331
  }),
231
- signal: i(a)
232
- }, J = {
233
- type: o(a),
234
- id: o(a),
235
- rawId: o(l),
236
- authenticatorAttachment: i(a),
237
- response: o({
238
- clientDataJSON: o(l),
239
- attestationObject: o(l),
240
- transports: b(
241
- a,
332
+ signal: l(o)
333
+ }, V = {
334
+ type: i(o),
335
+ id: i(o),
336
+ rawId: i(f),
337
+ authenticatorAttachment: l(o),
338
+ response: i({
339
+ clientDataJSON: i(f),
340
+ attestationObject: i(f),
341
+ transports: A(
342
+ o,
242
343
  (e) => {
243
344
  var t;
244
345
  return ((t = e.getTransports) == null ? void 0 : t.call(e)) || [];
245
346
  }
246
347
  )
247
348
  }),
248
- clientExtensionResults: b(
249
- R,
349
+ clientExtensionResults: A(
350
+ D,
250
351
  (e) => e.getClientExtensionResults()
251
352
  )
252
- }, j = {
253
- mediation: i(a),
254
- publicKey: o({
255
- challenge: o(l),
256
- timeout: i(a),
257
- rpId: i(a),
258
- allowCredentials: i([C]),
259
- userVerification: i(a),
260
- extensions: i(S)
353
+ }, K = {
354
+ mediation: l(o),
355
+ publicKey: i({
356
+ challenge: i(f),
357
+ timeout: l(o),
358
+ rpId: l(o),
359
+ allowCredentials: l([J]),
360
+ userVerification: l(o),
361
+ extensions: l(j)
261
362
  }),
262
- signal: i(a)
263
- }, L = {
264
- type: o(a),
265
- id: o(a),
266
- rawId: o(l),
267
- authenticatorAttachment: i(a),
268
- response: o({
269
- clientDataJSON: o(l),
270
- authenticatorData: o(l),
271
- signature: o(l),
272
- userHandle: o(l)
363
+ signal: l(o)
364
+ }, M = {
365
+ type: i(o),
366
+ id: i(o),
367
+ rawId: i(f),
368
+ authenticatorAttachment: l(o),
369
+ response: i({
370
+ clientDataJSON: i(f),
371
+ authenticatorData: i(f),
372
+ signature: i(f),
373
+ userHandle: i(f)
273
374
  }),
274
- clientExtensionResults: b(
275
- R,
375
+ clientExtensionResults: A(
376
+ D,
276
377
  (e) => e.getClientExtensionResults()
277
378
  )
278
379
  };
279
- function P(e) {
280
- return p(v, N, e);
380
+ function B(e) {
381
+ return w(N, T, e);
281
382
  }
282
- function D(e) {
283
- return p(
284
- A,
285
- J,
383
+ function Q(e) {
384
+ return w(
385
+ x,
386
+ V,
286
387
  e
287
388
  );
288
389
  }
289
- function T(e) {
290
- return p(v, j, e);
390
+ function G(e) {
391
+ return w(N, K, e);
291
392
  }
292
- function V(e) {
293
- return p(
294
- A,
295
- L,
393
+ function W(e) {
394
+ return w(
395
+ x,
396
+ M,
296
397
  e
297
398
  );
298
399
  }
299
- async function K(e) {
400
+ async function z(e) {
300
401
  const t = await navigator.credentials.create(
301
402
  e
302
403
  );
303
- return t.toJSON = () => D(t), t;
404
+ return t.toJSON = () => Q(t), t;
304
405
  }
305
- async function M(e) {
406
+ async function I(e) {
306
407
  const t = await navigator.credentials.get(
307
408
  e
308
409
  );
309
- return t.toJSON = () => V(t), t;
410
+ return t.toJSON = () => W(t), t;
310
411
  }
311
- async function re(e) {
312
- const r = (await d({
412
+ async function de(e) {
413
+ const r = (await p({
313
414
  webAuthnRequestOptions: {
314
415
  __args: {
315
416
  username: e
316
417
  }
317
418
  }
318
- })).webAuthnRequestOptions, n = T({
419
+ })).webAuthnRequestOptions, s = G({
319
420
  publicKey: r
320
- }), s = await M(n);
321
- await c("webAuthnAssertion", {
421
+ }), n = await I(s);
422
+ await u("webAuthnAssertion", {
322
423
  username: e,
323
- assertion: s.toJSON()
424
+ assertion: n.toJSON()
324
425
  });
325
426
  }
326
- async function ne() {
327
- const e = await d({ webAuthnCreationOptions: !0 }), t = P({
427
+ async function fe() {
428
+ const e = await p({ webAuthnCreationOptions: !0 }), t = B({
328
429
  publicKey: e.webAuthnCreationOptions
329
- }), r = await K(t);
330
- await c("webAuthnRegister", {
430
+ }), r = await z(t);
431
+ await u("webAuthnRegister", {
331
432
  registration: r.toJSON()
332
433
  });
333
434
  }
334
- const se = async (e) => (await d({
435
+ const pe = async (e) => (await p({
335
436
  fsListFiles: {
336
437
  __args: {
337
438
  path: e
@@ -343,7 +444,7 @@ const se = async (e) => (await d({
343
444
  canPreview: !0,
344
445
  imagePath: !0
345
446
  }
346
- })).fsListFiles, ae = async (e) => (await d({
447
+ })).fsListFiles, ge = async (e) => (await p({
347
448
  fsListFolders: {
348
449
  __args: {
349
450
  path: e
@@ -351,8 +452,8 @@ const se = async (e) => (await d({
351
452
  name: !0,
352
453
  path: !0
353
454
  }
354
- })).fsListFolders, oe = async (e) => {
355
- let t = await d({
455
+ })).fsListFolders, we = async (e) => {
456
+ let t = await p({
356
457
  fsFile: {
357
458
  __args: {
358
459
  path: e
@@ -361,55 +462,59 @@ const se = async (e) => (await d({
361
462
  }
362
463
  });
363
464
  return window.atob(t.fsFile.base64Content);
364
- }, ie = (e, t) => c("fsWriteFile", {
465
+ }, me = (e, t) => u("fsWriteFile", {
365
466
  path: e,
366
467
  content: t
367
- }), ue = (e) => c("fsDeleteFile", {
468
+ }), he = (e) => u("fsDeleteFile", {
368
469
  path: e
369
- }), ce = (e) => c("fsCreateFolder", {
470
+ }), be = (e) => u("fsCreateFolder", {
370
471
  path: e
371
- }), le = (e) => c("fsDeleteFolder", {
472
+ }), ye = (e) => u("fsDeleteFolder", {
372
473
  path: e
373
- }), fe = (e, t) => c("fsRenameFile", {
474
+ }), _e = (e, t) => u("fsRenameFile", {
374
475
  path: e,
375
476
  name: t
376
- }), de = (e, t) => c("fsRenameFolder", {
477
+ }), Fe = (e, t) => u("fsRenameFolder", {
377
478
  path: e,
378
479
  name: t
379
- }), pe = (e, t) => c("fsMoveFile", {
480
+ }), Ce = (e, t) => u("fsMoveFile", {
380
481
  source: e,
381
482
  target: t
382
483
  });
383
484
  export {
384
- X as defineModel,
385
- z as forgetPassword,
386
- ce as fsCreateFolder,
387
- ue as fsDeleteFile,
388
- le as fsDeleteFolder,
389
- se as fsListFiles,
390
- ae as fsListFolders,
391
- pe as fsMoveFile,
392
- oe as fsReadFile,
393
- fe as fsRenameFile,
394
- de as fsRenameFolder,
395
- ie as fsWriteFile,
485
+ oe as File,
486
+ S as convertData,
487
+ ne as defineModel,
488
+ F as file,
489
+ ee as forgetPassword,
490
+ be as fsCreateFolder,
491
+ he as fsDeleteFile,
492
+ ye as fsDeleteFolder,
493
+ pe as fsListFiles,
494
+ ge as fsListFolders,
495
+ Ce as fsMoveFile,
496
+ we as fsReadFile,
497
+ _e as fsRenameFile,
498
+ Fe as fsRenameFolder,
499
+ me as fsWriteFile,
396
500
  _ as getApiUrl,
397
- y as getAxios,
398
- te as getConfig,
399
- Y as getGQLFields,
501
+ b as getAxios,
502
+ ue as getConfig,
503
+ se as getGQLFields,
400
504
  q as getModelField,
401
- H as granted,
402
- G as login,
403
- W as logout,
404
- c as mutation,
405
- d as query,
406
- I as resetPassword,
407
- ee as sendMail,
408
- Z as setApiUrl,
409
- $ as setAxios,
410
- F as toQuery,
411
- B as updatePassword,
412
- k as uploadFile,
413
- re as webauthnLogin,
414
- ne as webauthnRegister
505
+ re as granted,
506
+ X as login,
507
+ Y as logout,
508
+ ae as model,
509
+ u as mutation,
510
+ p as query,
511
+ k as resetPassword,
512
+ ce as sendMail,
513
+ ie as setApiUrl,
514
+ te as setAxios,
515
+ y as toQuery,
516
+ Z as updatePassword,
517
+ le as uploadFile,
518
+ de as webauthnLogin,
519
+ fe as webauthnRegister
415
520
  };
@@ -1 +1 @@
1
- (function(i,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("axios"),require("json-to-graphql-query")):typeof define=="function"&&define.amd?define(["exports","axios","json-to-graphql-query"],w):(i=typeof globalThis<"u"?globalThis:i||self,w(i.light={},i.axios,i.jsonToGraphqlQuery))})(this,function(i,w,h){"use strict";const E=(e,t,r="")=>l("login",{username:e,password:t,code:r}),N=()=>l("logout"),P=(e,t)=>l("updatePassword",{old_password:e,new_password:t}),J=(e,t,r)=>l("resetPassword",{email:e,password:t,code:r}),D=e=>l("forgetPassword",{email:e});let y;const M=e=>{y=e},F=()=>(y||(y=w.create({withCredentials:!0})),y),T=async e=>(await g({granted:{__args:{rights:e}}})).granted,m={},Q=(e,t)=>{m[e]={};for(const r of Object.entries(t)){const[n,s]=r;m[e][n]=()=>({name:s.name?s.name:n,raw:s,getName:()=>s.name?s.name:n,getGQLField:()=>s.gqlField!==void 0?s.gqlField:s.name||n,getRaw(){return s},getValue(c){return s.field&&typeof s.field=="function"?s.field(c):s.field&&typeof s.field=="string"?c[s.field]:c[this.getName()]},getFormattedValue(c){const d=this.getValue(c);return s.format?s.format(d):d}})}},O=(e,t)=>!m[e]||!m[e][t]?null:m[e][t](),U=(e,t)=>{const r=[];for(const n of t)if(typeof n=="string"){const s=O(e,n);s&&r.push(s.getGQLField())}else typeof n=="object"&&r.push(n);return r},_=e=>{let t={};return typeof e=="string"?(t[e]=!0,t):e instanceof Array?(e.forEach(r=>{Object.entries(_(r)).forEach(([n,s])=>{t[n]=s})}),t):(Object.entries(e).forEach(([r,n])=>{if(r=="__args"||r=="__aliasFor"||r=="__variables"||r=="__directives"||r=="__all_on"||r=="__name"){t[r]=n;return}if(typeof n=="boolean"){t[r]=n;return}t[r]=_(n)}),t)},v=e=>_(e),g=async e=>{let t=h.jsonToGraphQLQuery(v(e));const r=await F().post(b(),{query:`{ ${t} }`});if(r.data.errors)throw new Error(r.data.errors[0].message);return r.data.data},l=async(e,t=null,r=[])=>{const n={mutation:{}};n.mutation[e]=!0,r instanceof Array&&r.length!=0&&(n.mutation[e]={}),t&&(n.mutation[e]={},n.mutation[e].__args=t),Object.entries(v(r)).forEach(([c,d])=>{n.mutation[e][c]=d});const s=await F().post(b(),{query:h.jsonToGraphQLQuery(n)});if(s.data.errors)throw new Error(s.data.errors[0].message);return s.data.data[e]};let C="/api/";const V=e=>{C=e},b=()=>C;async function K(e){const t={__variables:{file:"Upload!"},fsUploadTempFile:{__args:{file:new h.VariableType("file")},name:!0,path:!0,size:!0,mime:!0}},r=new FormData;r.append("operations",JSON.stringify({query:h.jsonToGraphQLQuery({mutation:t})})),r.append("map",JSON.stringify({0:["variables.file"]})),r.append("0",e);const n=await F().post(b(),r);if(n.data.errors)throw new Error(n.data.errors[0].message);return n.data.data.fsUploadTempFile}const G=(e,t,r)=>l("sendMail",{email:e,subject:t,message:r}),W=async e=>(await g({config:{__args:{name:e}}})).config;function R(e){const t="==".slice(0,(4-e.length%4)%4),r=e.replace(/-/g,"+").replace(/_/g,"/")+t,n=atob(r),s=new ArrayBuffer(n.length),c=new Uint8Array(s);for(let d=0;d<n.length;d++)c[d]=n.charCodeAt(d);return s}function S(e){const t=new Uint8Array(e);let r="";for(const c of t)r+=String.fromCharCode(c);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var a="copy",f="convert";function p(e,t,r){if(t===a)return r;if(t===f)return e(r);if(t instanceof Array)return r.map(n=>p(e,t[0],n));if(t instanceof Object){const n={};for(const[s,c]of Object.entries(t)){if(c.derive){const d=c.derive(r);d!==void 0&&(r[s]=d)}if(!(s in r)){if(c.required)throw new Error(`Missing key: ${s}`);continue}if(r[s]==null){n[s]=null;continue}n[s]=p(e,c.schema,r[s])}return n}}function A(e,t){return{required:!0,schema:e,derive:t}}function o(e){return{required:!0,schema:e}}function u(e){return{required:!1,schema:e}}var q={type:o(a),id:o(f),transports:u(a)},L={appid:u(a),appidExclude:u(a),credProps:u(a)},j={appid:u(a),appidExclude:u(a),credProps:u(a)},B={publicKey:o({rp:o(a),user:o({id:o(f),name:o(a),displayName:o(a)}),challenge:o(f),pubKeyCredParams:o(a),timeout:u(a),excludeCredentials:u([q]),authenticatorSelection:u(a),attestation:u(a),extensions:u(L)}),signal:u(a)},I={type:o(a),id:o(a),rawId:o(f),authenticatorAttachment:u(a),response:o({clientDataJSON:o(f),attestationObject:o(f),transports:A(a,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:A(j,e=>e.getClientExtensionResults())},z={mediation:u(a),publicKey:o({challenge:o(f),timeout:u(a),rpId:u(a),allowCredentials:u([q]),userVerification:u(a),extensions:u(L)}),signal:u(a)},$={type:o(a),id:o(a),rawId:o(f),authenticatorAttachment:u(a),response:o({clientDataJSON:o(f),authenticatorData:o(f),signature:o(f),userHandle:o(f)}),clientExtensionResults:A(j,e=>e.getClientExtensionResults())};function H(e){return p(R,B,e)}function X(e){return p(S,I,e)}function Y(e){return p(R,z,e)}function Z(e){return p(S,$,e)}async function k(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>X(t),t}async function x(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>Z(t),t}async function ee(e){const r=(await g({webAuthnRequestOptions:{__args:{username:e}}})).webAuthnRequestOptions,n=Y({publicKey:r}),s=await x(n);await l("webAuthnAssertion",{username:e,assertion:s.toJSON()})}async function te(){const e=await g({webAuthnCreationOptions:!0}),t=H({publicKey:e.webAuthnCreationOptions}),r=await k(t);await l("webAuthnRegister",{registration:r.toJSON()})}const re=async e=>(await g({fsListFiles:{__args:{path:e},name:!0,path:!0,size:!0,mime:!0,canPreview:!0,imagePath:!0}})).fsListFiles,ne=async e=>(await g({fsListFolders:{__args:{path:e},name:!0,path:!0}})).fsListFolders,se=async e=>{let t=await g({fsFile:{__args:{path:e},base64Content:!0}});return window.atob(t.fsFile.base64Content)},ie=(e,t)=>l("fsWriteFile",{path:e,content:t}),ae=e=>l("fsDeleteFile",{path:e}),oe=e=>l("fsCreateFolder",{path:e}),ue=e=>l("fsDeleteFolder",{path:e}),le=(e,t)=>l("fsRenameFile",{path:e,name:t}),ce=(e,t)=>l("fsRenameFolder",{path:e,name:t}),fe=(e,t)=>l("fsMoveFile",{source:e,target:t});i.defineModel=Q,i.forgetPassword=D,i.fsCreateFolder=oe,i.fsDeleteFile=ae,i.fsDeleteFolder=ue,i.fsListFiles=re,i.fsListFolders=ne,i.fsMoveFile=fe,i.fsReadFile=se,i.fsRenameFile=le,i.fsRenameFolder=ce,i.fsWriteFile=ie,i.getApiUrl=b,i.getAxios=F,i.getConfig=W,i.getGQLFields=U,i.getModelField=O,i.granted=T,i.login=E,i.logout=N,i.mutation=l,i.query=g,i.resetPassword=J,i.sendMail=G,i.setApiUrl=V,i.setAxios=M,i.toQuery=v,i.updatePassword=P,i.uploadFile=K,i.webauthnLogin=ee,i.webauthnRegister=te,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ (function(s,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("axios"),require("json-to-graphql-query")):typeof define=="function"&&define.amd?define(["exports","axios","json-to-graphql-query"],m):(s=typeof globalThis<"u"?globalThis:s||self,m(s.light={},s.axios,s.jsonToGraphqlQuery))})(this,function(s,m,y){"use strict";const U=(e,t,r="")=>d("login",{username:e,password:t,code:r}),M=()=>d("logout"),T=(e,t)=>d("updatePassword",{old_password:e,new_password:t}),V=(e,t,r)=>d("resetPassword",{email:e,password:t,code:r}),Q=e=>d("forgetPassword",{email:e});let C;const K=e=>{C=e},b=()=>(C||(C=m.create({withCredentials:!0})),C),B=async e=>(await p({granted:{__args:{rights:e}}})).granted,F={},W=(e,t)=>{F[e]={};for(const r of Object.entries(t)){const[a,n]=r;F[e][a]=()=>({name:n.name?n.name:a,raw:n,getName:()=>n.name?n.name:a,getGQLField:()=>n.gqlField!==void 0?n.gqlField:n.name||a,getRaw(){return n},getValue(i){return n.field&&typeof n.field=="function"?n.field(i):n.field&&typeof n.field=="string"?i[n.field]:i[this.getName()]},getFormattedValue(i){const u=this.getValue(i);return n.format?n.format(u):u}})}},O=(e,t)=>!F[e]||!F[e][t]?null:F[e][t](),G=(e,t)=>{const r=[];for(const a of t)if(typeof a=="string"){const n=O(e,a);n&&r.push(n.getGQLField())}else typeof a=="object"&&r.push(a);return r},S=e=>{const t=new FormData,r={},a={},n={};let i=0,u=!1;return Object.entries(e).forEach(([f,w])=>{w instanceof File?(u=!0,a[f]="Upload!",n[f]=new y.VariableType(f),t.append(i.toString(),w),r[i]=["variables."+f],i++):n[f]=w}),u?(t.append("map",JSON.stringify(r)),{data:n,formData:t,mutation:{__variables:a}}):{data:n,formData:null,mutation:{}}},z=e=>{const t=e;return{name:t,async update(r,a){const n=S(a);return await d("update"+t,{id:r,data:n.data},[],n.mutation,n.formData)},async delete(r){return await d("delete"+t,{id:r})},async add(r){const a=S(r);return await d("add"+t,{data:a.data},[],a.mutation,a.formData)},fields(r){let a=[];for(let n of r){const i=O(t,n);i&&a.push(i)}return a},async get(r,a){return(await p({["list"+t]:{__args:{filters:r},data:{__args:{limit:1},..._(a)}}}))["list"+t].data[0]},async list(r,a){return(await p({["list"+t]:{__args:{filters:r},data:{..._(a)}}}))["list"+t].data}}};function I(e){e="<~"+e+"~>";var t,r,a,n,i,u=String,f=255;for(e.slice(0,2)==="<~"&&e.slice(-2),e=e.slice(2,-2).replace(/\s/g,"").replace("z","!!!!!"),t="uuuuu".slice(e.length%5||5),e+=t,a=[],n=0,i=e.length;i>n;n+=5)r=52200625*(e.charCodeAt(n)-33)+614125*(e.charCodeAt(n+1)-33)+7225*(e.charCodeAt(n+2)-33)+85*(e.charCodeAt(n+3)-33)+(e.charCodeAt(n+4)-33),a.push(f&r>>24,f&r>>16,f&r>>8,f&r);return function(w,Fe){for(var P=Fe;P>0;P--)w.pop()}(a,t.length),u.fromCharCode.apply(u,a)}const v=(e="")=>{const t=e,r=(a="application/octet-stream")=>{const n=new Uint8Array(t.length);for(let f=0;f<t.length;f++)n[f]=t.charCodeAt(f);const i=new Blob([n],{type:a});return URL.createObjectURL(i)};return{getContent:()=>t,getURL:r,download:a=>{const n=document.createElement("a");n.download=a,n.href=r(),document.body.appendChild(n),n.click(),document.body.removeChild(n)},open:a=>{window.open(r(a),"_blank")}}},$={fromBase85:e=>v(I(e)),fromBase64:e=>v(atob(e)),fromString:e=>v(e)},R=e=>{let t={};return typeof e=="string"?(t[e]=!0,t):e instanceof Array?(e.forEach(r=>{Object.entries(R(r)).forEach(([a,n])=>{t[a]=n})}),t):(Object.entries(e).forEach(([r,a])=>{if(r=="__args"||r=="__aliasFor"||r=="__variables"||r=="__directives"||r=="__all_on"||r=="__name"){t[r]=a;return}if(typeof a=="boolean"){t[r]=a;return}t[r]=R(a)}),t)},_=e=>R(e),p=async e=>{let t=y.jsonToGraphQLQuery(_(e));const r=await b().post(A(),{query:`{ ${t} }`});if(r.data.errors)throw new Error(r.data.errors[0].message);return r.data.data},d=async(e,t=null,r=[],a={},n=null)=>{a[e]=!0,r instanceof Array&&r.length!=0&&(a[e]={}),t&&(a[e]={},a[e].__args=t),Object.entries(_(r)).forEach(([f,w])=>{a[e][f]=w});let i=null;const u=y.jsonToGraphQLQuery({mutation:a});if(n?(n.append("operations",JSON.stringify({query:u})),i=await b().post(A(),n)):i=await b().post(A(),{query:u}),i.data.errors)throw new Error(i.data.errors[0].message);return i.data.data[e]};let L="/api/";const H=e=>{L=e},A=()=>L;async function X(e){const t={__variables:{file:"Upload!"},fsUploadTempFile:{__args:{file:new y.VariableType("file")},name:!0,path:!0,size:!0,mime:!0}},r=new FormData;r.append("operations",JSON.stringify({query:y.jsonToGraphQLQuery({mutation:t})})),r.append("map",JSON.stringify({0:["variables.file"]})),r.append("0",e);const a=await b().post(A(),r);if(a.data.errors)throw new Error(a.data.errors[0].message);return a.data.data.fsUploadTempFile}const Y=(e,t,r)=>d("sendMail",{email:e,subject:t,message:r}),Z=async e=>(await p({config:{__args:{name:e}}})).config;function E(e){const t="==".slice(0,(4-e.length%4)%4),r=e.replace(/-/g,"+").replace(/_/g,"/")+t,a=atob(r),n=new ArrayBuffer(a.length),i=new Uint8Array(n);for(let u=0;u<a.length;u++)i[u]=a.charCodeAt(u);return n}function j(e){const t=new Uint8Array(e);let r="";for(const i of t)r+=String.fromCharCode(i);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var o="copy",g="convert";function h(e,t,r){if(t===o)return r;if(t===g)return e(r);if(t instanceof Array)return r.map(a=>h(e,t[0],a));if(t instanceof Object){const a={};for(const[n,i]of Object.entries(t)){if(i.derive){const u=i.derive(r);u!==void 0&&(r[n]=u)}if(!(n in r)){if(i.required)throw new Error(`Missing key: ${n}`);continue}if(r[n]==null){a[n]=null;continue}a[n]=h(e,i.schema,r[n])}return a}}function q(e,t){return{required:!0,schema:e,derive:t}}function l(e){return{required:!0,schema:e}}function c(e){return{required:!1,schema:e}}var D={type:l(o),id:l(g),transports:c(o)},N={appid:c(o),appidExclude:c(o),credProps:c(o)},J={appid:c(o),appidExclude:c(o),credProps:c(o)},k={publicKey:l({rp:l(o),user:l({id:l(g),name:l(o),displayName:l(o)}),challenge:l(g),pubKeyCredParams:l(o),timeout:c(o),excludeCredentials:c([D]),authenticatorSelection:c(o),attestation:c(o),extensions:c(N)}),signal:c(o)},x={type:l(o),id:l(o),rawId:l(g),authenticatorAttachment:c(o),response:l({clientDataJSON:l(g),attestationObject:l(g),transports:q(o,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:q(J,e=>e.getClientExtensionResults())},ee={mediation:c(o),publicKey:l({challenge:l(g),timeout:c(o),rpId:c(o),allowCredentials:c([D]),userVerification:c(o),extensions:c(N)}),signal:c(o)},te={type:l(o),id:l(o),rawId:l(g),authenticatorAttachment:c(o),response:l({clientDataJSON:l(g),authenticatorData:l(g),signature:l(g),userHandle:l(g)}),clientExtensionResults:q(J,e=>e.getClientExtensionResults())};function re(e){return h(E,k,e)}function ne(e){return h(j,x,e)}function ae(e){return h(E,ee,e)}function se(e){return h(j,te,e)}async function ie(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>ne(t),t}async function oe(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>se(t),t}async function le(e){const r=(await p({webAuthnRequestOptions:{__args:{username:e}}})).webAuthnRequestOptions,a=ae({publicKey:r}),n=await oe(a);await d("webAuthnAssertion",{username:e,assertion:n.toJSON()})}async function ce(){const e=await p({webAuthnCreationOptions:!0}),t=re({publicKey:e.webAuthnCreationOptions}),r=await ie(t);await d("webAuthnRegister",{registration:r.toJSON()})}const ue=async e=>(await p({fsListFiles:{__args:{path:e},name:!0,path:!0,size:!0,mime:!0,canPreview:!0,imagePath:!0}})).fsListFiles,de=async e=>(await p({fsListFolders:{__args:{path:e},name:!0,path:!0}})).fsListFolders,fe=async e=>{let t=await p({fsFile:{__args:{path:e},base64Content:!0}});return window.atob(t.fsFile.base64Content)},ge=(e,t)=>d("fsWriteFile",{path:e,content:t}),pe=e=>d("fsDeleteFile",{path:e}),we=e=>d("fsCreateFolder",{path:e}),he=e=>d("fsDeleteFolder",{path:e}),me=(e,t)=>d("fsRenameFile",{path:e,name:t}),ye=(e,t)=>d("fsRenameFolder",{path:e,name:t}),be=(e,t)=>d("fsMoveFile",{source:e,target:t});s.File=$,s.convertData=S,s.defineModel=W,s.file=v,s.forgetPassword=Q,s.fsCreateFolder=we,s.fsDeleteFile=pe,s.fsDeleteFolder=he,s.fsListFiles=ue,s.fsListFolders=de,s.fsMoveFile=be,s.fsReadFile=fe,s.fsRenameFile=me,s.fsRenameFolder=ye,s.fsWriteFile=ge,s.getApiUrl=A,s.getAxios=b,s.getConfig=Z,s.getGQLFields=G,s.getModelField=O,s.granted=B,s.login=U,s.logout=M,s.model=z,s.mutation=d,s.query=p,s.resetPassword=V,s.sendMail=Y,s.setApiUrl=H,s.setAxios=K,s.toQuery=_,s.updatePassword=T,s.uploadFile=X,s.webauthnLogin=le,s.webauthnRegister=ce,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
package/dist/model.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type Fields } from ".";
1
2
  export type ModelField = {
2
3
  name: string;
3
4
  raw: FieldOption;
@@ -23,3 +24,25 @@ export declare const defineModel: (name: string, fields: {
23
24
  }) => void;
24
25
  export declare const getModelField: (name: string, field: string) => ModelField | null;
25
26
  export declare const getGQLFields: (model: string, fields: (string | object)[]) => any[];
27
+ export declare const convertData: (data: Object) => {
28
+ data: any;
29
+ formData: FormData;
30
+ mutation: {
31
+ __variables: any;
32
+ };
33
+ } | {
34
+ data: any;
35
+ formData: null;
36
+ mutation: {
37
+ __variables?: undefined;
38
+ };
39
+ };
40
+ export declare const model: (name: string) => {
41
+ name: string;
42
+ update(id: number, data: Object): Promise<any>;
43
+ delete(id: number): Promise<any>;
44
+ add(data: Object): Promise<any>;
45
+ fields(fields: string[]): ModelField[];
46
+ get(filters: any, fields: Fields): Promise<any>;
47
+ list(filters: any, fields: Fields): Promise<any>;
48
+ };
@@ -1,3 +1,6 @@
1
1
  import { Fields } from '.';
2
- declare const _default: (operation: string, args?: any, fields?: Fields) => Promise<any>;
2
+ import { Nullable } from 'vitest';
3
+ declare const _default: (operation: string, args?: any, fields?: Fields, mutation?: {
4
+ [key: string]: any;
5
+ }, formData?: Nullable<FormData>) => Promise<any>;
3
6
  export default _default;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/light",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"