@nhost/nhost-js 5.0.0-beta.9 → 5.0.0-beta10
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/LICENSE +1 -1
- package/README.md +20 -20
- package/dist/fetch-2PHmQBIJ.mjs.map +1 -1
- package/dist/fetch-DWXwEnoe.js.map +1 -1
- package/dist/nhost-js/auth.cjs.js +1 -1
- package/dist/nhost-js/auth.cjs.js.map +1 -1
- package/dist/nhost-js/auth.es.js +38 -38
- package/dist/nhost-js/auth.es.js.map +1 -1
- package/dist/nhost-js/fetch.cjs.js +1 -1
- package/dist/nhost-js/fetch.cjs.js.map +1 -1
- package/dist/nhost-js/fetch.es.js +3 -3
- package/dist/nhost-js/fetch.es.js.map +1 -1
- package/dist/nhost-js/functions.cjs.js.map +1 -1
- package/dist/nhost-js/functions.es.js.map +1 -1
- package/dist/nhost-js/graphql.cjs.js.map +1 -1
- package/dist/nhost-js/graphql.es.js.map +1 -1
- package/dist/nhost-js/session.cjs.js +1 -1
- package/dist/nhost-js/session.cjs.js.map +1 -1
- package/dist/nhost-js/session.es.js +1 -1
- package/dist/nhost-js/session.es.js.map +1 -1
- package/dist/nhost-js/storage.cjs.js +1 -1
- package/dist/nhost-js/storage.cjs.js.map +1 -1
- package/dist/nhost-js/storage.es.js +19 -17
- package/dist/nhost-js/storage.es.js.map +1 -1
- package/dist/nhost-js.cjs.js +1 -1
- package/dist/nhost-js.cjs.js.map +1 -1
- package/dist/nhost-js.es.js +4 -4
- package/dist/nhost-js.es.js.map +1 -1
- package/dist/nhost-js.umd.js +1 -1
- package/dist/nhost-js.umd.js.map +1 -1
- package/dist/refreshSession-Bw715ZmX.js +2 -0
- package/dist/refreshSession-Bw715ZmX.js.map +1 -0
- package/dist/{refreshSession-cGdPdFoG.mjs → refreshSession-WwGlzgtM.mjs} +9 -5
- package/dist/refreshSession-WwGlzgtM.mjs.map +1 -0
- package/dist/src/auth/client.d.ts.map +1 -1
- package/dist/src/auth/client.js +41 -41
- package/dist/src/auth/client.js.map +1 -1
- package/dist/src/fetch/fetch.d.ts +1 -1
- package/dist/src/fetch/fetch.d.ts.map +1 -1
- package/dist/src/fetch/fetch.js +0 -1
- package/dist/src/fetch/fetch.js.map +1 -1
- package/dist/src/fetch/index.d.ts +1 -1
- package/dist/src/fetch/index.d.ts.map +1 -1
- package/dist/src/fetch/index.js +1 -1
- package/dist/src/fetch/index.js.map +1 -1
- package/dist/src/fetch/middlewareSessionRefresh.d.ts +1 -1
- package/dist/src/fetch/middlewareSessionRefresh.d.ts.map +1 -1
- package/dist/src/fetch/middlewareSessionRefresh.js.map +1 -1
- package/dist/src/fetch/middlewareUpdateSessionFromResponse.js +2 -2
- package/dist/src/fetch/middlewareUpdateSessionFromResponse.js.map +1 -1
- package/dist/src/functions/client.d.ts +2 -2
- package/dist/src/functions/client.d.ts.map +1 -1
- package/dist/src/functions/client.js +0 -2
- package/dist/src/functions/client.js.map +1 -1
- package/dist/src/graphql/client.d.ts +4 -4
- package/dist/src/graphql/client.d.ts.map +1 -1
- package/dist/src/graphql/client.js.map +1 -1
- package/dist/src/graphql/index.d.ts +13 -5
- package/dist/src/graphql/index.d.ts.map +1 -1
- package/dist/src/graphql/index.js +13 -5
- package/dist/src/graphql/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/nhost.d.ts +3 -3
- package/dist/src/nhost.d.ts.map +1 -1
- package/dist/src/nhost.js +5 -5
- package/dist/src/nhost.js.map +1 -1
- package/dist/src/session/index.d.ts +3 -3
- package/dist/src/session/index.d.ts.map +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/index.js.map +1 -1
- package/dist/src/session/refreshSession.d.ts +4 -4
- package/dist/src/session/refreshSession.d.ts.map +1 -1
- package/dist/src/session/refreshSession.js +10 -11
- package/dist/src/session/refreshSession.js.map +1 -1
- package/dist/src/session/storage.d.ts +2 -2
- package/dist/src/session/storage.d.ts.map +1 -1
- package/dist/src/session/storage.js +1 -1
- package/dist/src/session/storage.js.map +1 -1
- package/dist/src/session/storageBackend.d.ts.map +1 -1
- package/dist/src/session/storageBackend.js +2 -0
- package/dist/src/session/storageBackend.js.map +1 -1
- package/dist/src/storage/client.d.ts.map +1 -1
- package/dist/src/storage/client.js +21 -17
- package/dist/src/storage/client.js.map +1 -1
- package/dist/src/storage/index.d.ts +2 -2
- package/dist/src/storage/index.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/dist/refreshSession-bgb-tiu4.js +0 -2
- package/dist/refreshSession-bgb-tiu4.js.map +0 -1
- package/dist/refreshSession-cGdPdFoG.mjs.map +0 -1
package/dist/nhost-js/auth.es.js
CHANGED
|
@@ -6,7 +6,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
6
6
|
fetch = createEnhancedFetch(chainFunctions);
|
|
7
7
|
};
|
|
8
8
|
const getJWKs = async (options) => {
|
|
9
|
-
const url = baseURL
|
|
9
|
+
const url = `${baseURL}/.well-known/jwks.json`;
|
|
10
10
|
const res = await fetch(url, {
|
|
11
11
|
...options,
|
|
12
12
|
method: "GET",
|
|
@@ -28,7 +28,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
const elevateWebauthn = async (options) => {
|
|
31
|
-
const url = baseURL
|
|
31
|
+
const url = `${baseURL}/elevate/webauthn`;
|
|
32
32
|
const res = await fetch(url, {
|
|
33
33
|
...options,
|
|
34
34
|
method: "POST",
|
|
@@ -50,7 +50,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
const verifyElevateWebauthn = async (body, options) => {
|
|
53
|
-
const url = baseURL
|
|
53
|
+
const url = `${baseURL}/elevate/webauthn/verify`;
|
|
54
54
|
const res = await fetch(url, {
|
|
55
55
|
...options,
|
|
56
56
|
method: "POST",
|
|
@@ -74,7 +74,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
const healthCheckGet = async (options) => {
|
|
77
|
-
const url = baseURL
|
|
77
|
+
const url = `${baseURL}/healthz`;
|
|
78
78
|
const res = await fetch(url, {
|
|
79
79
|
...options,
|
|
80
80
|
method: "GET",
|
|
@@ -96,7 +96,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
98
|
const healthCheckHead = async (options) => {
|
|
99
|
-
const url = baseURL
|
|
99
|
+
const url = `${baseURL}/healthz`;
|
|
100
100
|
const res = await fetch(url, {
|
|
101
101
|
...options,
|
|
102
102
|
method: "HEAD",
|
|
@@ -117,7 +117,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
const linkIdToken = async (body, options) => {
|
|
120
|
-
const url = baseURL
|
|
120
|
+
const url = `${baseURL}/link/idtoken`;
|
|
121
121
|
const res = await fetch(url, {
|
|
122
122
|
...options,
|
|
123
123
|
method: "POST",
|
|
@@ -141,7 +141,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
143
|
const changeUserMfa = async (options) => {
|
|
144
|
-
const url = baseURL
|
|
144
|
+
const url = `${baseURL}/mfa/totp/generate`;
|
|
145
145
|
const res = await fetch(url, {
|
|
146
146
|
...options,
|
|
147
147
|
method: "GET",
|
|
@@ -163,7 +163,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
const createPAT = async (body, options) => {
|
|
166
|
-
const url = baseURL
|
|
166
|
+
const url = `${baseURL}/pat`;
|
|
167
167
|
const res = await fetch(url, {
|
|
168
168
|
...options,
|
|
169
169
|
method: "POST",
|
|
@@ -187,7 +187,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
189
|
const signInAnonymous = async (body, options) => {
|
|
190
|
-
const url = baseURL
|
|
190
|
+
const url = `${baseURL}/signin/anonymous`;
|
|
191
191
|
const res = await fetch(url, {
|
|
192
192
|
...options,
|
|
193
193
|
method: "POST",
|
|
@@ -211,7 +211,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
213
|
const signInEmailPassword = async (body, options) => {
|
|
214
|
-
const url = baseURL
|
|
214
|
+
const url = `${baseURL}/signin/email-password`;
|
|
215
215
|
const res = await fetch(url, {
|
|
216
216
|
...options,
|
|
217
217
|
method: "POST",
|
|
@@ -235,7 +235,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
const signInIdToken = async (body, options) => {
|
|
238
|
-
const url = baseURL
|
|
238
|
+
const url = `${baseURL}/signin/idtoken`;
|
|
239
239
|
const res = await fetch(url, {
|
|
240
240
|
...options,
|
|
241
241
|
method: "POST",
|
|
@@ -259,7 +259,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
259
259
|
};
|
|
260
260
|
};
|
|
261
261
|
const verifySignInMfaTotp = async (body, options) => {
|
|
262
|
-
const url = baseURL
|
|
262
|
+
const url = `${baseURL}/signin/mfa/totp`;
|
|
263
263
|
const res = await fetch(url, {
|
|
264
264
|
...options,
|
|
265
265
|
method: "POST",
|
|
@@ -283,7 +283,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
283
283
|
};
|
|
284
284
|
};
|
|
285
285
|
const signInOTPEmail = async (body, options) => {
|
|
286
|
-
const url = baseURL
|
|
286
|
+
const url = `${baseURL}/signin/otp/email`;
|
|
287
287
|
const res = await fetch(url, {
|
|
288
288
|
...options,
|
|
289
289
|
method: "POST",
|
|
@@ -307,7 +307,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
307
307
|
};
|
|
308
308
|
};
|
|
309
309
|
const verifySignInOTPEmail = async (body, options) => {
|
|
310
|
-
const url = baseURL
|
|
310
|
+
const url = `${baseURL}/signin/otp/email/verify`;
|
|
311
311
|
const res = await fetch(url, {
|
|
312
312
|
...options,
|
|
313
313
|
method: "POST",
|
|
@@ -331,7 +331,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
331
331
|
};
|
|
332
332
|
};
|
|
333
333
|
const signInPasswordlessEmail = async (body, options) => {
|
|
334
|
-
const url = baseURL
|
|
334
|
+
const url = `${baseURL}/signin/passwordless/email`;
|
|
335
335
|
const res = await fetch(url, {
|
|
336
336
|
...options,
|
|
337
337
|
method: "POST",
|
|
@@ -355,7 +355,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
355
355
|
};
|
|
356
356
|
};
|
|
357
357
|
const signInPasswordlessSms = async (body, options) => {
|
|
358
|
-
const url = baseURL
|
|
358
|
+
const url = `${baseURL}/signin/passwordless/sms`;
|
|
359
359
|
const res = await fetch(url, {
|
|
360
360
|
...options,
|
|
361
361
|
method: "POST",
|
|
@@ -379,7 +379,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
379
379
|
};
|
|
380
380
|
};
|
|
381
381
|
const verifySignInPasswordlessSms = async (body, options) => {
|
|
382
|
-
const url = baseURL
|
|
382
|
+
const url = `${baseURL}/signin/passwordless/sms/otp`;
|
|
383
383
|
const res = await fetch(url, {
|
|
384
384
|
...options,
|
|
385
385
|
method: "POST",
|
|
@@ -403,7 +403,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
405
|
const signInPAT = async (body, options) => {
|
|
406
|
-
const url = baseURL
|
|
406
|
+
const url = `${baseURL}/signin/pat`;
|
|
407
407
|
const res = await fetch(url, {
|
|
408
408
|
...options,
|
|
409
409
|
method: "POST",
|
|
@@ -431,11 +431,11 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
431
431
|
const stringValue = Array.isArray(value) ? value.join(",") : typeof value === "object" ? JSON.stringify(value) : value;
|
|
432
432
|
return `${key}=${encodeURIComponent(stringValue)}`;
|
|
433
433
|
}).join("&");
|
|
434
|
-
const url = encodedParameters ? baseURL
|
|
434
|
+
const url = encodedParameters ? `${baseURL}/signin/provider/${provider}?${encodedParameters}` : `${baseURL}/signin/provider/${provider}`;
|
|
435
435
|
return url;
|
|
436
436
|
};
|
|
437
437
|
const signInWebauthn = async (body, options) => {
|
|
438
|
-
const url = baseURL
|
|
438
|
+
const url = `${baseURL}/signin/webauthn`;
|
|
439
439
|
const res = await fetch(url, {
|
|
440
440
|
...options,
|
|
441
441
|
method: "POST",
|
|
@@ -459,7 +459,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
459
459
|
};
|
|
460
460
|
};
|
|
461
461
|
const verifySignInWebauthn = async (body, options) => {
|
|
462
|
-
const url = baseURL
|
|
462
|
+
const url = `${baseURL}/signin/webauthn/verify`;
|
|
463
463
|
const res = await fetch(url, {
|
|
464
464
|
...options,
|
|
465
465
|
method: "POST",
|
|
@@ -483,7 +483,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
483
483
|
};
|
|
484
484
|
};
|
|
485
485
|
const signOut = async (body, options) => {
|
|
486
|
-
const url = baseURL
|
|
486
|
+
const url = `${baseURL}/signout`;
|
|
487
487
|
const res = await fetch(url, {
|
|
488
488
|
...options,
|
|
489
489
|
method: "POST",
|
|
@@ -507,7 +507,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
507
507
|
};
|
|
508
508
|
};
|
|
509
509
|
const signUpEmailPassword = async (body, options) => {
|
|
510
|
-
const url = baseURL
|
|
510
|
+
const url = `${baseURL}/signup/email-password`;
|
|
511
511
|
const res = await fetch(url, {
|
|
512
512
|
...options,
|
|
513
513
|
method: "POST",
|
|
@@ -531,7 +531,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
531
531
|
};
|
|
532
532
|
};
|
|
533
533
|
const signUpWebauthn = async (body, options) => {
|
|
534
|
-
const url = baseURL
|
|
534
|
+
const url = `${baseURL}/signup/webauthn`;
|
|
535
535
|
const res = await fetch(url, {
|
|
536
536
|
...options,
|
|
537
537
|
method: "POST",
|
|
@@ -555,7 +555,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
555
555
|
};
|
|
556
556
|
};
|
|
557
557
|
const verifySignUpWebauthn = async (body, options) => {
|
|
558
|
-
const url = baseURL
|
|
558
|
+
const url = `${baseURL}/signup/webauthn/verify`;
|
|
559
559
|
const res = await fetch(url, {
|
|
560
560
|
...options,
|
|
561
561
|
method: "POST",
|
|
@@ -579,7 +579,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
579
579
|
};
|
|
580
580
|
};
|
|
581
581
|
const refreshToken = async (body, options) => {
|
|
582
|
-
const url = baseURL
|
|
582
|
+
const url = `${baseURL}/token`;
|
|
583
583
|
const res = await fetch(url, {
|
|
584
584
|
...options,
|
|
585
585
|
method: "POST",
|
|
@@ -603,7 +603,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
603
603
|
};
|
|
604
604
|
};
|
|
605
605
|
const verifyToken = async (body, options) => {
|
|
606
|
-
const url = baseURL
|
|
606
|
+
const url = `${baseURL}/token/verify`;
|
|
607
607
|
const res = await fetch(url, {
|
|
608
608
|
...options,
|
|
609
609
|
method: "POST",
|
|
@@ -627,7 +627,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
627
627
|
};
|
|
628
628
|
};
|
|
629
629
|
const getUser = async (options) => {
|
|
630
|
-
const url = baseURL
|
|
630
|
+
const url = `${baseURL}/user`;
|
|
631
631
|
const res = await fetch(url, {
|
|
632
632
|
...options,
|
|
633
633
|
method: "GET",
|
|
@@ -649,7 +649,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
649
649
|
};
|
|
650
650
|
};
|
|
651
651
|
const deanonymizeUser = async (body, options) => {
|
|
652
|
-
const url = baseURL
|
|
652
|
+
const url = `${baseURL}/user/deanonymize`;
|
|
653
653
|
const res = await fetch(url, {
|
|
654
654
|
...options,
|
|
655
655
|
method: "POST",
|
|
@@ -673,7 +673,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
673
673
|
};
|
|
674
674
|
};
|
|
675
675
|
const changeUserEmail = async (body, options) => {
|
|
676
|
-
const url = baseURL
|
|
676
|
+
const url = `${baseURL}/user/email/change`;
|
|
677
677
|
const res = await fetch(url, {
|
|
678
678
|
...options,
|
|
679
679
|
method: "POST",
|
|
@@ -697,7 +697,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
697
697
|
};
|
|
698
698
|
};
|
|
699
699
|
const sendVerificationEmail = async (body, options) => {
|
|
700
|
-
const url = baseURL
|
|
700
|
+
const url = `${baseURL}/user/email/send-verification-email`;
|
|
701
701
|
const res = await fetch(url, {
|
|
702
702
|
...options,
|
|
703
703
|
method: "POST",
|
|
@@ -721,7 +721,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
721
721
|
};
|
|
722
722
|
};
|
|
723
723
|
const verifyChangeUserMfa = async (body, options) => {
|
|
724
|
-
const url = baseURL
|
|
724
|
+
const url = `${baseURL}/user/mfa`;
|
|
725
725
|
const res = await fetch(url, {
|
|
726
726
|
...options,
|
|
727
727
|
method: "POST",
|
|
@@ -745,7 +745,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
745
745
|
};
|
|
746
746
|
};
|
|
747
747
|
const changeUserPassword = async (body, options) => {
|
|
748
|
-
const url = baseURL
|
|
748
|
+
const url = `${baseURL}/user/password`;
|
|
749
749
|
const res = await fetch(url, {
|
|
750
750
|
...options,
|
|
751
751
|
method: "POST",
|
|
@@ -769,7 +769,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
769
769
|
};
|
|
770
770
|
};
|
|
771
771
|
const sendPasswordResetEmail = async (body, options) => {
|
|
772
|
-
const url = baseURL
|
|
772
|
+
const url = `${baseURL}/user/password/reset`;
|
|
773
773
|
const res = await fetch(url, {
|
|
774
774
|
...options,
|
|
775
775
|
method: "POST",
|
|
@@ -793,7 +793,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
793
793
|
};
|
|
794
794
|
};
|
|
795
795
|
const addSecurityKey = async (options) => {
|
|
796
|
-
const url = baseURL
|
|
796
|
+
const url = `${baseURL}/user/webauthn/add`;
|
|
797
797
|
const res = await fetch(url, {
|
|
798
798
|
...options,
|
|
799
799
|
method: "POST",
|
|
@@ -815,7 +815,7 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
815
815
|
};
|
|
816
816
|
};
|
|
817
817
|
const verifyAddSecurityKey = async (body, options) => {
|
|
818
|
-
const url = baseURL
|
|
818
|
+
const url = `${baseURL}/user/webauthn/verify`;
|
|
819
819
|
const res = await fetch(url, {
|
|
820
820
|
...options,
|
|
821
821
|
method: "POST",
|
|
@@ -843,11 +843,11 @@ const createAPIClient = (baseURL, chainFunctions = []) => {
|
|
|
843
843
|
const stringValue = Array.isArray(value) ? value.join(",") : typeof value === "object" ? JSON.stringify(value) : value;
|
|
844
844
|
return `${key}=${encodeURIComponent(stringValue)}`;
|
|
845
845
|
}).join("&");
|
|
846
|
-
const url = encodedParameters ? baseURL
|
|
846
|
+
const url = encodedParameters ? `${baseURL}/verify?${encodedParameters}` : `${baseURL}/verify`;
|
|
847
847
|
return url;
|
|
848
848
|
};
|
|
849
849
|
const getVersion = async (options) => {
|
|
850
|
-
const url = baseURL
|
|
850
|
+
const url = `${baseURL}/version`;
|
|
851
851
|
const res = await fetch(url, {
|
|
852
852
|
...options,
|
|
853
853
|
method: "GET",
|