@hostlink/light 0.0.17 → 0.0.19
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/axios.d.ts +4 -0
- package/dist/index.d.ts +3 -1
- package/dist/light.js +131 -126
- package/dist/light.umd.cjs +1 -1
- package/dist/login.test.d.ts +1 -0
- package/dist/mutation.d.ts +2 -1
- package/dist/toQuery.d.ts +2 -1
- package/package.json +5 -3
package/dist/axios.d.ts
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import getApiUrl from './getApiUrl';
|
|
|
7
7
|
import setApiUrl from './setApiUrl';
|
|
8
8
|
import uploadFile from './uploadFile';
|
|
9
9
|
import sendMail from './sendMail';
|
|
10
|
+
import getConfig from './getConfig';
|
|
10
11
|
import webauthnLogin from './webauthnLogin';
|
|
11
12
|
import webauthnRegister from './webauthnRegister';
|
|
12
|
-
export
|
|
13
|
+
export type Fields = Object | Array<string | Object> | string;
|
|
14
|
+
export { toQuery, login, logout, query, mutation, getApiUrl, setApiUrl, uploadFile, sendMail, webauthnLogin, webauthnRegister, getConfig };
|
package/dist/light.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsonToGraphQLQuery as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsonToGraphQLQuery as h, VariableType as x } from "json-to-graphql-query";
|
|
2
|
+
import y from "axios";
|
|
3
|
+
let d;
|
|
4
|
+
const _ = () => (d || (d = y.create({
|
|
5
|
+
withCredentials: !0
|
|
6
|
+
})), d), m = () => typeof localStorage > "u" ? "http://127.0.0.1:8888/api/" : localStorage.getItem("light-api-url") === null ? "/api/" : localStorage.getItem("light-api-url"), f = async (t, e = null, r = []) => {
|
|
7
|
+
const n = {
|
|
7
8
|
mutation: {}
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
n.mutation[t] = !0, r instanceof Array && r.length != 0 && (n.mutation[t] = {}), e && (n.mutation[t] = {}, n.mutation[t].__args = e), Object.entries(O(r)).forEach(([u, l]) => {
|
|
11
|
+
n.mutation[t][u] = l;
|
|
11
12
|
});
|
|
12
|
-
const
|
|
13
|
-
query:
|
|
13
|
+
const o = await _().post(m(), {
|
|
14
|
+
query: h(n)
|
|
14
15
|
});
|
|
15
|
-
if (
|
|
16
|
-
throw new Error(
|
|
17
|
-
return
|
|
18
|
-
},
|
|
16
|
+
if (o.data.errors)
|
|
17
|
+
throw new Error(o.data.errors[0].message);
|
|
18
|
+
return o.data.data[t];
|
|
19
|
+
}, B = async (t, e, r = "") => await f("login", {
|
|
19
20
|
username: t,
|
|
20
21
|
password: e,
|
|
21
22
|
code: r
|
|
22
|
-
}),
|
|
23
|
+
}), M = async () => await f("logout"), g = (t) => {
|
|
23
24
|
let e = {};
|
|
24
25
|
return typeof t == "string" ? (e[t] = !0, e) : t instanceof Array ? (t.forEach((r) => {
|
|
25
|
-
Object.entries(
|
|
26
|
-
e[n] =
|
|
26
|
+
Object.entries(g(r)).forEach(([n, o]) => {
|
|
27
|
+
e[n] = o;
|
|
27
28
|
});
|
|
28
29
|
}), e) : (Object.entries(t).forEach(([r, n]) => {
|
|
29
30
|
if (r == "__args" || r == "__aliasFor" || r == "__variables" || r == "__directives" || r == "__all_on" || r == "__name") {
|
|
@@ -34,24 +35,21 @@ const m = () => localStorage.getItem("light-api-url") === null ? "/api/" : local
|
|
|
34
35
|
e[r] = n;
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
e[r] =
|
|
38
|
+
e[r] = g(n);
|
|
38
39
|
}), e);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let r = w(C(t));
|
|
44
|
-
const n = await e.post(m(), {
|
|
45
|
-
query: `{ ${r} }`
|
|
40
|
+
}, O = (t) => g(t), b = async (t) => {
|
|
41
|
+
let e = h(O(t));
|
|
42
|
+
const r = await _().post(m(), {
|
|
43
|
+
query: `{ ${e} }`
|
|
46
44
|
});
|
|
47
|
-
if (
|
|
48
|
-
throw new Error(
|
|
49
|
-
return
|
|
50
|
-
},
|
|
45
|
+
if (r.data.errors)
|
|
46
|
+
throw new Error(r.data.errors[0].message);
|
|
47
|
+
return r.data.data;
|
|
48
|
+
}, P = (t) => {
|
|
51
49
|
localStorage.setItem("light-api-url", t);
|
|
52
50
|
};
|
|
53
|
-
async function
|
|
54
|
-
const e =
|
|
51
|
+
async function Q(t) {
|
|
52
|
+
const e = y.create({
|
|
55
53
|
withCredentials: !0
|
|
56
54
|
}), r = {
|
|
57
55
|
__variables: {
|
|
@@ -59,7 +57,7 @@ async function M(t) {
|
|
|
59
57
|
},
|
|
60
58
|
fsUploadTempFile: {
|
|
61
59
|
__args: {
|
|
62
|
-
file: new
|
|
60
|
+
file: new x("file")
|
|
63
61
|
},
|
|
64
62
|
name: !0,
|
|
65
63
|
path: !0,
|
|
@@ -68,21 +66,27 @@ async function M(t) {
|
|
|
68
66
|
}
|
|
69
67
|
}, n = new FormData();
|
|
70
68
|
n.append("operations", JSON.stringify({
|
|
71
|
-
query:
|
|
69
|
+
query: h({ mutation: r })
|
|
72
70
|
})), n.append("map", JSON.stringify({ 0: ["variables.file"] })), n.append("0", t);
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
throw new Error(
|
|
76
|
-
return
|
|
71
|
+
const o = await e.post(m(), n);
|
|
72
|
+
if (o.data.errors)
|
|
73
|
+
throw new Error(o.data.errors[0].message);
|
|
74
|
+
return o.data.data.fsUploadTempFile;
|
|
77
75
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
const L = (t, e, r) => f("sendMail", { email: t, subject: e, message: r }), W = async (t) => (await b({
|
|
77
|
+
config: {
|
|
78
|
+
__args: {
|
|
79
|
+
name: t
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})).config;
|
|
83
|
+
function S(t) {
|
|
84
|
+
const e = "==".slice(0, (4 - t.length % 4) % 4), r = t.replace(/-/g, "+").replace(/_/g, "/") + e, n = atob(r), o = new ArrayBuffer(n.length), u = new Uint8Array(o);
|
|
81
85
|
for (let l = 0; l < n.length; l++)
|
|
82
86
|
u[l] = n.charCodeAt(l);
|
|
83
|
-
return
|
|
87
|
+
return o;
|
|
84
88
|
}
|
|
85
|
-
function
|
|
89
|
+
function A(t) {
|
|
86
90
|
const e = new Uint8Array(t);
|
|
87
91
|
let r = "";
|
|
88
92
|
for (const u of e)
|
|
@@ -102,37 +106,37 @@ function p(t, e, r) {
|
|
|
102
106
|
return r.map((n) => p(t, e[0], n));
|
|
103
107
|
if (e instanceof Object) {
|
|
104
108
|
const n = {};
|
|
105
|
-
for (const [
|
|
109
|
+
for (const [o, u] of Object.entries(e)) {
|
|
106
110
|
if (u.derive) {
|
|
107
111
|
const l = u.derive(r);
|
|
108
|
-
l !== void 0 && (r[
|
|
112
|
+
l !== void 0 && (r[o] = l);
|
|
109
113
|
}
|
|
110
|
-
if (!(
|
|
114
|
+
if (!(o in r)) {
|
|
111
115
|
if (u.required)
|
|
112
|
-
throw new Error(`Missing key: ${
|
|
116
|
+
throw new Error(`Missing key: ${o}`);
|
|
113
117
|
continue;
|
|
114
118
|
}
|
|
115
|
-
if (r[
|
|
116
|
-
n[
|
|
119
|
+
if (r[o] == null) {
|
|
120
|
+
n[o] = null;
|
|
117
121
|
continue;
|
|
118
122
|
}
|
|
119
|
-
n[
|
|
123
|
+
n[o] = p(
|
|
120
124
|
t,
|
|
121
125
|
u.schema,
|
|
122
|
-
r[
|
|
126
|
+
r[o]
|
|
123
127
|
);
|
|
124
128
|
}
|
|
125
129
|
return n;
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
|
-
function
|
|
132
|
+
function w(t, e) {
|
|
129
133
|
return {
|
|
130
134
|
required: !0,
|
|
131
135
|
schema: t,
|
|
132
136
|
derive: e
|
|
133
137
|
};
|
|
134
138
|
}
|
|
135
|
-
function
|
|
139
|
+
function i(t) {
|
|
136
140
|
return {
|
|
137
141
|
required: !0,
|
|
138
142
|
schema: t
|
|
@@ -144,44 +148,44 @@ function s(t) {
|
|
|
144
148
|
schema: t
|
|
145
149
|
};
|
|
146
150
|
}
|
|
147
|
-
var
|
|
148
|
-
type:
|
|
149
|
-
id:
|
|
151
|
+
var v = {
|
|
152
|
+
type: i(a),
|
|
153
|
+
id: i(c),
|
|
150
154
|
transports: s(a)
|
|
151
|
-
},
|
|
155
|
+
}, C = {
|
|
152
156
|
appid: s(a),
|
|
153
157
|
appidExclude: s(a),
|
|
154
158
|
credProps: s(a)
|
|
155
|
-
},
|
|
159
|
+
}, E = {
|
|
156
160
|
appid: s(a),
|
|
157
161
|
appidExclude: s(a),
|
|
158
162
|
credProps: s(a)
|
|
159
|
-
},
|
|
160
|
-
publicKey:
|
|
161
|
-
rp:
|
|
162
|
-
user:
|
|
163
|
-
id:
|
|
164
|
-
name:
|
|
165
|
-
displayName:
|
|
163
|
+
}, R = {
|
|
164
|
+
publicKey: i({
|
|
165
|
+
rp: i(a),
|
|
166
|
+
user: i({
|
|
167
|
+
id: i(c),
|
|
168
|
+
name: i(a),
|
|
169
|
+
displayName: i(a)
|
|
166
170
|
}),
|
|
167
|
-
challenge:
|
|
168
|
-
pubKeyCredParams:
|
|
171
|
+
challenge: i(c),
|
|
172
|
+
pubKeyCredParams: i(a),
|
|
169
173
|
timeout: s(a),
|
|
170
|
-
excludeCredentials: s([
|
|
174
|
+
excludeCredentials: s([v]),
|
|
171
175
|
authenticatorSelection: s(a),
|
|
172
176
|
attestation: s(a),
|
|
173
|
-
extensions: s(
|
|
177
|
+
extensions: s(C)
|
|
174
178
|
}),
|
|
175
179
|
signal: s(a)
|
|
176
|
-
},
|
|
177
|
-
type:
|
|
178
|
-
id:
|
|
179
|
-
rawId:
|
|
180
|
+
}, q = {
|
|
181
|
+
type: i(a),
|
|
182
|
+
id: i(a),
|
|
183
|
+
rawId: i(c),
|
|
180
184
|
authenticatorAttachment: s(a),
|
|
181
|
-
response:
|
|
182
|
-
clientDataJSON:
|
|
183
|
-
attestationObject:
|
|
184
|
-
transports:
|
|
185
|
+
response: i({
|
|
186
|
+
clientDataJSON: i(c),
|
|
187
|
+
attestationObject: i(c),
|
|
188
|
+
transports: w(
|
|
185
189
|
a,
|
|
186
190
|
(t) => {
|
|
187
191
|
var e;
|
|
@@ -189,102 +193,103 @@ var S = {
|
|
|
189
193
|
}
|
|
190
194
|
)
|
|
191
195
|
}),
|
|
192
|
-
clientExtensionResults:
|
|
193
|
-
|
|
196
|
+
clientExtensionResults: w(
|
|
197
|
+
E,
|
|
194
198
|
(t) => t.getClientExtensionResults()
|
|
195
199
|
)
|
|
196
|
-
},
|
|
200
|
+
}, J = {
|
|
197
201
|
mediation: s(a),
|
|
198
|
-
publicKey:
|
|
199
|
-
challenge:
|
|
202
|
+
publicKey: i({
|
|
203
|
+
challenge: i(c),
|
|
200
204
|
timeout: s(a),
|
|
201
205
|
rpId: s(a),
|
|
202
|
-
allowCredentials: s([
|
|
206
|
+
allowCredentials: s([v]),
|
|
203
207
|
userVerification: s(a),
|
|
204
|
-
extensions: s(
|
|
208
|
+
extensions: s(C)
|
|
205
209
|
}),
|
|
206
210
|
signal: s(a)
|
|
207
|
-
},
|
|
208
|
-
type:
|
|
209
|
-
id:
|
|
210
|
-
rawId:
|
|
211
|
+
}, N = {
|
|
212
|
+
type: i(a),
|
|
213
|
+
id: i(a),
|
|
214
|
+
rawId: i(c),
|
|
211
215
|
authenticatorAttachment: s(a),
|
|
212
|
-
response:
|
|
213
|
-
clientDataJSON:
|
|
214
|
-
authenticatorData:
|
|
215
|
-
signature:
|
|
216
|
-
userHandle:
|
|
216
|
+
response: i({
|
|
217
|
+
clientDataJSON: i(c),
|
|
218
|
+
authenticatorData: i(c),
|
|
219
|
+
signature: i(c),
|
|
220
|
+
userHandle: i(c)
|
|
217
221
|
}),
|
|
218
|
-
clientExtensionResults:
|
|
219
|
-
|
|
222
|
+
clientExtensionResults: w(
|
|
223
|
+
E,
|
|
220
224
|
(t) => t.getClientExtensionResults()
|
|
221
225
|
)
|
|
222
226
|
};
|
|
223
|
-
function
|
|
224
|
-
return p(
|
|
227
|
+
function j(t) {
|
|
228
|
+
return p(S, R, t);
|
|
225
229
|
}
|
|
226
|
-
function
|
|
230
|
+
function T(t) {
|
|
227
231
|
return p(
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
A,
|
|
233
|
+
q,
|
|
230
234
|
t
|
|
231
235
|
);
|
|
232
236
|
}
|
|
233
|
-
function
|
|
234
|
-
return p(
|
|
237
|
+
function K(t) {
|
|
238
|
+
return p(S, J, t);
|
|
235
239
|
}
|
|
236
|
-
function
|
|
240
|
+
function U(t) {
|
|
237
241
|
return p(
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
A,
|
|
243
|
+
N,
|
|
240
244
|
t
|
|
241
245
|
);
|
|
242
246
|
}
|
|
243
|
-
async function
|
|
247
|
+
async function D(t) {
|
|
244
248
|
const e = await navigator.credentials.create(
|
|
245
249
|
t
|
|
246
250
|
);
|
|
247
|
-
return e.toJSON = () =>
|
|
251
|
+
return e.toJSON = () => T(e), e;
|
|
248
252
|
}
|
|
249
|
-
async function
|
|
253
|
+
async function F(t) {
|
|
250
254
|
const e = await navigator.credentials.get(
|
|
251
255
|
t
|
|
252
256
|
);
|
|
253
|
-
return e.toJSON = () =>
|
|
257
|
+
return e.toJSON = () => U(e), e;
|
|
254
258
|
}
|
|
255
|
-
async function
|
|
259
|
+
async function $(t) {
|
|
256
260
|
const r = (await b({
|
|
257
261
|
webAuthnRequestOptions: {
|
|
258
262
|
__args: {
|
|
259
263
|
username: t
|
|
260
264
|
}
|
|
261
265
|
}
|
|
262
|
-
})).webAuthnRequestOptions, n =
|
|
266
|
+
})).webAuthnRequestOptions, n = K({
|
|
263
267
|
publicKey: r
|
|
264
|
-
}),
|
|
265
|
-
await
|
|
268
|
+
}), o = await F(n);
|
|
269
|
+
await f("webAuthnAssertion", {
|
|
266
270
|
username: t,
|
|
267
|
-
assertion:
|
|
271
|
+
assertion: o.toJSON()
|
|
268
272
|
});
|
|
269
273
|
}
|
|
270
|
-
async function
|
|
271
|
-
const t = await b({ webAuthnCreationOptions: !0 }), e =
|
|
274
|
+
async function z() {
|
|
275
|
+
const t = await b({ webAuthnCreationOptions: !0 }), e = j({
|
|
272
276
|
publicKey: t.webAuthnCreationOptions
|
|
273
|
-
}), r = await
|
|
274
|
-
await
|
|
277
|
+
}), r = await D(e);
|
|
278
|
+
await f("webAuthnRegister", {
|
|
275
279
|
registration: r.toJSON()
|
|
276
280
|
});
|
|
277
281
|
}
|
|
278
282
|
export {
|
|
279
283
|
m as getApiUrl,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
284
|
+
W as getConfig,
|
|
285
|
+
B as login,
|
|
286
|
+
M as logout,
|
|
287
|
+
f as mutation,
|
|
283
288
|
b as query,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
L as sendMail,
|
|
290
|
+
P as setApiUrl,
|
|
291
|
+
O as toQuery,
|
|
292
|
+
Q as uploadFile,
|
|
293
|
+
$ as webauthnLogin,
|
|
294
|
+
z as webauthnRegister
|
|
290
295
|
};
|
package/dist/light.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,
|
|
1
|
+
(function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("json-to-graphql-query"),require("axios")):typeof define=="function"&&define.amd?define(["exports","json-to-graphql-query","axios"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.light={},u.jsonToGraphqlQuery,u.axios))})(this,function(u,d,O){"use strict";let y;const _=()=>(y||(y=O.create({withCredentials:!0})),y),h=()=>typeof localStorage>"u"?"http://127.0.0.1:8888/api/":localStorage.getItem("light-api-url")===null?"/api/":localStorage.getItem("light-api-url"),p=async(t,e=null,n=[])=>{const r={mutation:{}};r.mutation[t]=!0,n instanceof Array&&n.length!=0&&(r.mutation[t]={}),e&&(r.mutation[t]={},r.mutation[t].__args=e),Object.entries(m(n)).forEach(([l,f])=>{r.mutation[t][l]=f});const o=await _().post(h(),{query:d.jsonToGraphQLQuery(r)});if(o.data.errors)throw new Error(o.data.errors[0].message);return o.data.data[t]},R=async(t,e,n="")=>await p("login",{username:t,password:e,code:n}),j=async()=>await p("logout"),b=t=>{let e={};return typeof t=="string"?(e[t]=!0,e):t instanceof Array?(t.forEach(n=>{Object.entries(b(n)).forEach(([r,o])=>{e[r]=o})}),e):(Object.entries(t).forEach(([n,r])=>{if(n=="__args"||n=="__aliasFor"||n=="__variables"||n=="__directives"||n=="__all_on"||n=="__name"){e[n]=r;return}if(typeof r=="boolean"){e[n]=r;return}e[n]=b(r)}),e)},m=t=>b(t),w=async t=>{let e=d.jsonToGraphQLQuery(m(t));const n=await _().post(h(),{query:`{ ${e} }`});if(n.data.errors)throw new Error(n.data.errors[0].message);return n.data.data},J=t=>{localStorage.setItem("light-api-url",t)};async function N(t){const e=O.create({withCredentials:!0}),n={__variables:{file:"Upload!"},fsUploadTempFile:{__args:{file:new d.VariableType("file")},name:!0,path:!0,size:!0,mime:!0}},r=new FormData;r.append("operations",JSON.stringify({query:d.jsonToGraphQLQuery({mutation:n})})),r.append("map",JSON.stringify({0:["variables.file"]})),r.append("0",t);const o=await e.post(h(),r);if(o.data.errors)throw new Error(o.data.errors[0].message);return o.data.data.fsUploadTempFile}const T=(t,e,n)=>p("sendMail",{email:t,subject:e,message:n}),U=async t=>(await w({config:{__args:{name:t}}})).config;function A(t){const e="==".slice(0,(4-t.length%4)%4),n=t.replace(/-/g,"+").replace(/_/g,"/")+e,r=atob(n),o=new ArrayBuffer(r.length),l=new Uint8Array(o);for(let f=0;f<r.length;f++)l[f]=r.charCodeAt(f);return o}function v(t){const e=new Uint8Array(t);let n="";for(const l of e)n+=String.fromCharCode(l);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var i="copy",c="convert";function g(t,e,n){if(e===i)return n;if(e===c)return t(n);if(e instanceof Array)return n.map(r=>g(t,e[0],r));if(e instanceof Object){const r={};for(const[o,l]of Object.entries(e)){if(l.derive){const f=l.derive(n);f!==void 0&&(n[o]=f)}if(!(o in n)){if(l.required)throw new Error(`Missing key: ${o}`);continue}if(n[o]==null){r[o]=null;continue}r[o]=g(t,l.schema,n[o])}return r}}function S(t,e){return{required:!0,schema:t,derive:e}}function a(t){return{required:!0,schema:t}}function s(t){return{required:!1,schema:t}}var C={type:a(i),id:a(c),transports:s(i)},q={appid:s(i),appidExclude:s(i),credProps:s(i)},E={appid:s(i),appidExclude:s(i),credProps:s(i)},K={publicKey:a({rp:a(i),user:a({id:a(c),name:a(i),displayName:a(i)}),challenge:a(c),pubKeyCredParams:a(i),timeout:s(i),excludeCredentials:s([C]),authenticatorSelection:s(i),attestation:s(i),extensions:s(q)}),signal:s(i)},F={type:a(i),id:a(i),rawId:a(c),authenticatorAttachment:s(i),response:a({clientDataJSON:a(c),attestationObject:a(c),transports:S(i,t=>{var e;return((e=t.getTransports)==null?void 0:e.call(t))||[]})}),clientExtensionResults:S(E,t=>t.getClientExtensionResults())},x={mediation:s(i),publicKey:a({challenge:a(c),timeout:s(i),rpId:s(i),allowCredentials:s([C]),userVerification:s(i),extensions:s(q)}),signal:s(i)},D={type:a(i),id:a(i),rawId:a(c),authenticatorAttachment:s(i),response:a({clientDataJSON:a(c),authenticatorData:a(c),signature:a(c),userHandle:a(c)}),clientExtensionResults:S(E,t=>t.getClientExtensionResults())};function I(t){return g(A,K,t)}function Q(t){return g(v,F,t)}function V(t){return g(A,x,t)}function L(t){return g(v,D,t)}async function M(t){const e=await navigator.credentials.create(t);return e.toJSON=()=>Q(e),e}async function P(t){const e=await navigator.credentials.get(t);return e.toJSON=()=>L(e),e}async function B(t){const n=(await w({webAuthnRequestOptions:{__args:{username:t}}})).webAuthnRequestOptions,r=V({publicKey:n}),o=await P(r);await p("webAuthnAssertion",{username:t,assertion:o.toJSON()})}async function W(){const t=await w({webAuthnCreationOptions:!0}),e=I({publicKey:t.webAuthnCreationOptions}),n=await M(e);await p("webAuthnRegister",{registration:n.toJSON()})}u.getApiUrl=h,u.getConfig=U,u.login=R,u.logout=j,u.mutation=p,u.query=w,u.sendMail=T,u.setApiUrl=J,u.toQuery=m,u.uploadFile=N,u.webauthnLogin=B,u.webauthnRegister=W,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/mutation.d.ts
CHANGED
package/dist/toQuery.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/light",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,12 +17,14 @@
|
|
|
17
17
|
"dev": "vite --host",
|
|
18
18
|
"build": "tsc && vite build",
|
|
19
19
|
"preview": "vite preview",
|
|
20
|
-
"release": "npm run build && npm version patch && npm publish --access public && git push --follow-tags"
|
|
20
|
+
"release": "npm run build && npm version patch && npm publish --access public && git push --follow-tags",
|
|
21
|
+
"test": "vitest"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"typescript": "^5.0.2",
|
|
24
25
|
"vite": "^4.3.0",
|
|
25
|
-
"vite-plugin-dts": "^3.6.0"
|
|
26
|
+
"vite-plugin-dts": "^3.6.0",
|
|
27
|
+
"vitest": "^0.34.6"
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
30
|
"@github/webauthn-json": "^2.1.1",
|