@supabase/gotrue-js 2.72.0 → 2.72.1-canary.11
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/README.md +95 -3
- package/dist/main/GoTrueAdminApi.js.map +1 -1
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +18 -18
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/base64url.js +10 -11
- package/dist/main/lib/base64url.js.map +1 -1
- package/dist/main/lib/error-codes.d.ts +1 -1
- package/dist/main/lib/error-codes.d.ts.map +1 -1
- package/dist/main/lib/errors.d.ts.map +1 -1
- package/dist/main/lib/errors.js +7 -7
- package/dist/main/lib/errors.js.map +1 -1
- package/dist/main/lib/fetch.d.ts +2 -2
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +8 -9
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/helpers.d.ts +1 -1
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +34 -24
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/local-storage.js +1 -2
- package/dist/main/lib/local-storage.js.map +1 -1
- package/dist/main/lib/locks.js +3 -3
- package/dist/main/lib/locks.js.map +1 -1
- package/dist/main/lib/polyfills.js +1 -2
- package/dist/main/lib/polyfills.js.map +1 -1
- package/dist/main/lib/types.d.ts +76 -76
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.d.ts.map +1 -1
- package/dist/main/lib/version.js +7 -1
- package/dist/main/lib/version.js.map +1 -1
- package/dist/main/lib/web3/ethereum.d.ts +9 -9
- package/dist/main/lib/web3/ethereum.d.ts.map +1 -1
- package/dist/main/lib/web3/ethereum.js +4 -5
- package/dist/main/lib/web3/ethereum.js.map +1 -1
- package/dist/main/lib/web3/solana.d.ts +4 -4
- package/dist/main/lib/web3/solana.d.ts.map +1 -1
- package/dist/module/GoTrueAdminApi.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +19 -18
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/base64url.js.map +1 -1
- package/dist/module/lib/error-codes.d.ts +1 -1
- package/dist/module/lib/error-codes.d.ts.map +1 -1
- package/dist/module/lib/errors.d.ts.map +1 -1
- package/dist/module/lib/fetch.d.ts +2 -2
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/helpers.d.ts +1 -1
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/locks.js.map +1 -1
- package/dist/module/lib/polyfills.js.map +1 -1
- package/dist/module/lib/types.d.ts +76 -76
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.d.ts.map +1 -1
- package/dist/module/lib/version.js +7 -1
- package/dist/module/lib/version.js.map +1 -1
- package/dist/module/lib/web3/ethereum.d.ts +9 -9
- package/dist/module/lib/web3/ethereum.d.ts.map +1 -1
- package/dist/module/lib/web3/ethereum.js.map +1 -1
- package/dist/module/lib/web3/solana.d.ts +4 -4
- package/dist/module/lib/web3/solana.d.ts.map +1 -1
- package/package.json +12 -31
- package/src/lib/types.ts +4 -4
- package/src/lib/version.ts +7 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memoryLocalStorageAdapter =
|
|
3
|
+
exports.memoryLocalStorageAdapter = memoryLocalStorageAdapter;
|
|
4
4
|
/**
|
|
5
5
|
* Returns a localStorage-like object that stores the key-value pairs in
|
|
6
6
|
* memory.
|
|
@@ -18,5 +18,4 @@ function memoryLocalStorageAdapter(store = {}) {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
exports.memoryLocalStorageAdapter = memoryLocalStorageAdapter;
|
|
22
21
|
//# sourceMappingURL=local-storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../src/lib/local-storage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../src/lib/local-storage.ts"],"names":[],"mappings":";;AAMA,8DAcC;AAlBD;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,QAAmC,EAAE;IAC7E,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAA;QAC3B,CAAC;QAED,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACtB,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACpB,CAAC;QAED,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;YAClB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;QACnB,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/main/lib/locks.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProcessLockAcquireTimeoutError = exports.NavigatorLockAcquireTimeoutError = exports.LockAcquireTimeoutError = exports.internals = void 0;
|
|
4
|
+
exports.navigatorLock = navigatorLock;
|
|
5
|
+
exports.processLock = processLock;
|
|
4
6
|
const helpers_1 = require("./helpers");
|
|
5
7
|
/**
|
|
6
8
|
* @experimental
|
|
@@ -127,7 +129,6 @@ async function navigatorLock(name, acquireTimeout, fn) {
|
|
|
127
129
|
}
|
|
128
130
|
}));
|
|
129
131
|
}
|
|
130
|
-
exports.navigatorLock = navigatorLock;
|
|
131
132
|
const PROCESS_LOCKS = {};
|
|
132
133
|
/**
|
|
133
134
|
* Implements a global exclusive lock that works only in the current process.
|
|
@@ -183,5 +184,4 @@ async function processLock(name, acquireTimeout, fn) {
|
|
|
183
184
|
// error or with an acquire timeout error
|
|
184
185
|
return await currentOperation;
|
|
185
186
|
}
|
|
186
|
-
exports.processLock = processLock;
|
|
187
187
|
//# sourceMappingURL=locks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locks.js","sourceRoot":"","sources":["../../../src/lib/locks.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"locks.js","sourceRoot":"","sources":["../../../src/lib/locks.ts"],"names":[],"mappings":";;;AA0DA,sCA8FC;AAkBD,kCAsDC;AAhOD,uCAAgD;AAEhD;;GAEG;AACU,QAAA,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC,CACP,UAAU;QACV,IAAA,8BAAoB,GAAE;QACtB,UAAU,CAAC,YAAY;QACvB,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,gCAAgC,CAAC,KAAK,MAAM,CAC7E;CACF,CAAA;AAED;;;;GAIG;AACH,MAAsB,uBAAwB,SAAQ,KAAK;IAGzD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QAHA,qBAAgB,GAAG,IAAI,CAAA;IAIvC,CAAC;CACF;AAND,0DAMC;AAED,MAAa,gCAAiC,SAAQ,uBAAuB;CAAG;AAAhF,4EAAgF;AAChF,MAAa,8BAA+B,SAAQ,uBAAuB;CAAG;AAA9E,wEAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,cAAsB,EACtB,EAAoB;IAEpB,IAAI,iBAAS,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,kDAAkD,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;IACvF,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,UAAU,CAAC,eAAe,EAA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CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBACxB,UAAU,CAAC,GAAG,EAAE;oBACd,MAAM,CACJ,IAAI,8BAA8B,CAChC,oCAAoC,IAAI,aAAa,CACtD,CACF,CAAA;gBACH,CAAC,EAAE,cAAc,CAAC,CAAA;YACpB,CAAC,CAAC;YACJ,CAAC,CAAC,IAAI;KACT,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACnB;SACE,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,CAAC,CAAA;QACT,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC,CAAC;SACD,IAAI,CAAC,KAAK,IAAI,EAAE;QACf,uEAAuE;QACvE,sDAAsD;QACtD,OAAO,MAAM,EAAE,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAM,EAAE,EAAE;QAC5D,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAC5B,wEAAwE;YACxE,kEAAkE;YAClE,MAAM,iBAAiB,CAAA;YAEvB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,CAAC,CAAA;IACT,CAAC,CAAC,CAAA;IAEF,yEAAyE;IACzE,yCAAyC;IACzC,OAAO,MAAM,gBAAgB,CAAA;AAC/B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.polyfillGlobalThis =
|
|
3
|
+
exports.polyfillGlobalThis = polyfillGlobalThis;
|
|
4
4
|
/**
|
|
5
5
|
* https://mathiasbynens.be/notes/globalthis
|
|
6
6
|
*/
|
|
@@ -26,5 +26,4 @@ function polyfillGlobalThis() {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
exports.polyfillGlobalThis = polyfillGlobalThis;
|
|
30
29
|
//# sourceMappingURL=polyfills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../../src/lib/polyfills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../../src/lib/polyfills.ts"],"names":[],"mappings":";;AAGA,gDAmBC;AAtBD;;GAEG;AACH,SAAgB,kBAAkB;IAChC,IAAI,OAAO,UAAU,KAAK,QAAQ;QAAE,OAAM;IAC1C,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE;YACnD,GAAG,EAAE;gBACH,OAAO,IAAI,CAAA;YACb,CAAC;YACD,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;QACF,2CAA2C;QAC3C,SAAS,CAAC,UAAU,GAAG,SAAS,CAAA;QAChC,2CAA2C;QAC3C,OAAO,MAAM,CAAC,SAAS,CAAC,SAAS,CAAA;IACnC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,6CAA6C;YAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/main/lib/types.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Fetch } from './fetch';
|
|
|
4
4
|
import type { SolanaSignInInput, SolanaSignInOutput } from './web3/solana';
|
|
5
5
|
import { EthereumSignInInput, Hex } from './web3/ethereum';
|
|
6
6
|
/** One of the providers supported by GoTrue. */
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export type Provider = 'apple' | 'azure' | 'bitbucket' | 'discord' | 'facebook' | 'figma' | 'github' | 'gitlab' | 'google' | 'kakao' | 'keycloak' | 'linkedin' | 'linkedin_oidc' | 'notion' | 'slack' | 'slack_oidc' | 'spotify' | 'twitch' | 'twitter' | 'workos' | 'zoom' | 'fly';
|
|
8
|
+
export type AuthChangeEventMFA = 'MFA_CHALLENGE_VERIFIED';
|
|
9
|
+
export type AuthChangeEvent = 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | AuthChangeEventMFA;
|
|
10
10
|
/**
|
|
11
11
|
* Provide your own global lock implementation instead of the default
|
|
12
12
|
* implementation. The function should acquire a lock for the duration of the
|
|
@@ -22,8 +22,8 @@ export declare type AuthChangeEvent = 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' |
|
|
|
22
22
|
* acquired after this much time (ms).
|
|
23
23
|
* @param fn The operation to execute when the lock is acquired.
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type LockFunc = <R>(name: string, acquireTimeout: number, fn: () => Promise<R>) => Promise<R>;
|
|
26
|
+
export type GoTrueClientOptions = {
|
|
27
27
|
url?: string;
|
|
28
28
|
headers?: {
|
|
29
29
|
[key: string]: string;
|
|
@@ -56,12 +56,12 @@ export declare type GoTrueClientOptions = {
|
|
|
56
56
|
*/
|
|
57
57
|
hasCustomAuthorizationHeader?: boolean;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
60
|
-
export
|
|
59
|
+
export type WeakPasswordReasons = 'length' | 'characters' | 'pwned' | (string & {});
|
|
60
|
+
export type WeakPassword = {
|
|
61
61
|
reasons: WeakPasswordReasons[];
|
|
62
62
|
message: string;
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type AuthResponse = {
|
|
65
65
|
data: {
|
|
66
66
|
user: User | null;
|
|
67
67
|
session: Session | null;
|
|
@@ -74,7 +74,7 @@ export declare type AuthResponse = {
|
|
|
74
74
|
};
|
|
75
75
|
error: AuthError;
|
|
76
76
|
};
|
|
77
|
-
export
|
|
77
|
+
export type AuthResponsePassword = {
|
|
78
78
|
data: {
|
|
79
79
|
user: User | null;
|
|
80
80
|
session: Session | null;
|
|
@@ -93,7 +93,7 @@ export declare type AuthResponsePassword = {
|
|
|
93
93
|
*
|
|
94
94
|
* {@see AuthResponse}
|
|
95
95
|
*/
|
|
96
|
-
export
|
|
96
|
+
export type AuthOtpResponse = {
|
|
97
97
|
data: {
|
|
98
98
|
user: null;
|
|
99
99
|
session: null;
|
|
@@ -108,7 +108,7 @@ export declare type AuthOtpResponse = {
|
|
|
108
108
|
};
|
|
109
109
|
error: AuthError;
|
|
110
110
|
};
|
|
111
|
-
export
|
|
111
|
+
export type AuthTokenResponse = {
|
|
112
112
|
data: {
|
|
113
113
|
user: User;
|
|
114
114
|
session: Session;
|
|
@@ -121,7 +121,7 @@ export declare type AuthTokenResponse = {
|
|
|
121
121
|
};
|
|
122
122
|
error: AuthError;
|
|
123
123
|
};
|
|
124
|
-
export
|
|
124
|
+
export type AuthTokenResponsePassword = {
|
|
125
125
|
data: {
|
|
126
126
|
user: User;
|
|
127
127
|
session: Session;
|
|
@@ -136,7 +136,7 @@ export declare type AuthTokenResponsePassword = {
|
|
|
136
136
|
};
|
|
137
137
|
error: AuthError;
|
|
138
138
|
};
|
|
139
|
-
export
|
|
139
|
+
export type OAuthResponse = {
|
|
140
140
|
data: {
|
|
141
141
|
provider: Provider;
|
|
142
142
|
url: string;
|
|
@@ -149,7 +149,7 @@ export declare type OAuthResponse = {
|
|
|
149
149
|
};
|
|
150
150
|
error: AuthError;
|
|
151
151
|
};
|
|
152
|
-
export
|
|
152
|
+
export type SSOResponse = {
|
|
153
153
|
data: {
|
|
154
154
|
/**
|
|
155
155
|
* URL to open in a browser which will complete the sign-in flow by
|
|
@@ -165,7 +165,7 @@ export declare type SSOResponse = {
|
|
|
165
165
|
data: null;
|
|
166
166
|
error: AuthError;
|
|
167
167
|
};
|
|
168
|
-
export
|
|
168
|
+
export type UserResponse = {
|
|
169
169
|
data: {
|
|
170
170
|
user: User;
|
|
171
171
|
};
|
|
@@ -400,7 +400,7 @@ export interface Subscription {
|
|
|
400
400
|
*/
|
|
401
401
|
unsubscribe: () => void;
|
|
402
402
|
}
|
|
403
|
-
export
|
|
403
|
+
export type SignInAnonymouslyCredentials = {
|
|
404
404
|
options?: {
|
|
405
405
|
/**
|
|
406
406
|
* A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
|
|
@@ -412,7 +412,7 @@ export declare type SignInAnonymouslyCredentials = {
|
|
|
412
412
|
captchaToken?: string;
|
|
413
413
|
};
|
|
414
414
|
};
|
|
415
|
-
export
|
|
415
|
+
export type SignUpWithPasswordCredentials = {
|
|
416
416
|
/** The user's email address. */
|
|
417
417
|
email: string;
|
|
418
418
|
/** The user's password. */
|
|
@@ -447,7 +447,7 @@ export declare type SignUpWithPasswordCredentials = {
|
|
|
447
447
|
channel?: 'sms' | 'whatsapp';
|
|
448
448
|
};
|
|
449
449
|
};
|
|
450
|
-
export
|
|
450
|
+
export type SignInWithPasswordCredentials = {
|
|
451
451
|
/** The user's email address. */
|
|
452
452
|
email: string;
|
|
453
453
|
/** The user's password. */
|
|
@@ -466,7 +466,7 @@ export declare type SignInWithPasswordCredentials = {
|
|
|
466
466
|
captchaToken?: string;
|
|
467
467
|
};
|
|
468
468
|
};
|
|
469
|
-
export
|
|
469
|
+
export type SignInWithPasswordlessCredentials = {
|
|
470
470
|
/** The user's email address. */
|
|
471
471
|
email: string;
|
|
472
472
|
options?: {
|
|
@@ -501,8 +501,8 @@ export declare type SignInWithPasswordlessCredentials = {
|
|
|
501
501
|
channel?: 'sms' | 'whatsapp';
|
|
502
502
|
};
|
|
503
503
|
};
|
|
504
|
-
export
|
|
505
|
-
export
|
|
504
|
+
export type AuthFlowType = 'implicit' | 'pkce';
|
|
505
|
+
export type SignInWithOAuthCredentials = {
|
|
506
506
|
/** One of the providers supported by GoTrue. */
|
|
507
507
|
provider: Provider;
|
|
508
508
|
options?: {
|
|
@@ -518,7 +518,7 @@ export declare type SignInWithOAuthCredentials = {
|
|
|
518
518
|
skipBrowserRedirect?: boolean;
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
|
-
export
|
|
521
|
+
export type SignInWithIdTokenCredentials = {
|
|
522
522
|
/** Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`, `keycloak` (deprecated). */
|
|
523
523
|
provider: 'google' | 'apple' | 'azure' | 'facebook' | 'kakao' | (string & {});
|
|
524
524
|
/** OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token. */
|
|
@@ -532,14 +532,14 @@ export declare type SignInWithIdTokenCredentials = {
|
|
|
532
532
|
captchaToken?: string;
|
|
533
533
|
};
|
|
534
534
|
};
|
|
535
|
-
export
|
|
535
|
+
export type SolanaWallet = {
|
|
536
536
|
signIn?: (...inputs: SolanaSignInInput[]) => Promise<SolanaSignInOutput | SolanaSignInOutput[]>;
|
|
537
537
|
publicKey?: {
|
|
538
538
|
toBase58: () => string;
|
|
539
539
|
} | null;
|
|
540
540
|
signMessage?: (message: Uint8Array, encoding?: 'utf8' | string) => Promise<Uint8Array> | undefined;
|
|
541
541
|
};
|
|
542
|
-
export
|
|
542
|
+
export type SolanaWeb3Credentials = {
|
|
543
543
|
chain: 'solana';
|
|
544
544
|
/** Wallet interface to use. If not specified will default to `window.solana`. */
|
|
545
545
|
wallet?: SolanaWallet;
|
|
@@ -563,12 +563,12 @@ export declare type SolanaWeb3Credentials = {
|
|
|
563
563
|
captchaToken?: string;
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
-
export
|
|
567
|
-
export
|
|
566
|
+
export type EthereumWallet = EIP1193Provider;
|
|
567
|
+
export type EthereumWeb3Credentials = {
|
|
568
568
|
chain: 'ethereum';
|
|
569
|
-
/** Wallet interface to use. If not specified will default to `window.
|
|
569
|
+
/** Wallet interface to use. If not specified will default to `window.solana`. */
|
|
570
570
|
wallet?: EthereumWallet;
|
|
571
|
-
/** Optional statement to include in the Sign in with
|
|
571
|
+
/** Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
|
|
572
572
|
statement?: string;
|
|
573
573
|
options?: {
|
|
574
574
|
/** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
|
|
@@ -581,15 +581,15 @@ export declare type EthereumWeb3Credentials = {
|
|
|
581
581
|
chain: 'ethereum';
|
|
582
582
|
/** Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`. */
|
|
583
583
|
message: string;
|
|
584
|
-
/**
|
|
584
|
+
/** Ed25519 signature of the message. */
|
|
585
585
|
signature: Hex;
|
|
586
586
|
options?: {
|
|
587
587
|
/** Verification token received when the user completes the captcha on the site. */
|
|
588
588
|
captchaToken?: string;
|
|
589
589
|
};
|
|
590
590
|
};
|
|
591
|
-
export
|
|
592
|
-
export
|
|
591
|
+
export type Web3Credentials = SolanaWeb3Credentials | EthereumWeb3Credentials;
|
|
592
|
+
export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams | VerifyTokenHashParams;
|
|
593
593
|
export interface VerifyMobileOtpParams {
|
|
594
594
|
/** The user's phone number. */
|
|
595
595
|
phone: string;
|
|
@@ -631,9 +631,9 @@ export interface VerifyTokenHashParams {
|
|
|
631
631
|
/** The user's verification type. */
|
|
632
632
|
type: EmailOtpType;
|
|
633
633
|
}
|
|
634
|
-
export
|
|
635
|
-
export
|
|
636
|
-
export
|
|
634
|
+
export type MobileOtpType = 'sms' | 'phone_change';
|
|
635
|
+
export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email';
|
|
636
|
+
export type ResendParams = {
|
|
637
637
|
type: Extract<EmailOtpType, 'signup' | 'email_change'>;
|
|
638
638
|
email: string;
|
|
639
639
|
options?: {
|
|
@@ -650,7 +650,7 @@ export declare type ResendParams = {
|
|
|
650
650
|
captchaToken?: string;
|
|
651
651
|
};
|
|
652
652
|
};
|
|
653
|
-
export
|
|
653
|
+
export type SignInWithSSO = {
|
|
654
654
|
/** UUID of the SSO provider to invoke single-sign on to. */
|
|
655
655
|
providerId: string;
|
|
656
656
|
options?: {
|
|
@@ -669,25 +669,25 @@ export declare type SignInWithSSO = {
|
|
|
669
669
|
captchaToken?: string;
|
|
670
670
|
};
|
|
671
671
|
};
|
|
672
|
-
export
|
|
672
|
+
export type GenerateSignupLinkParams = {
|
|
673
673
|
type: 'signup';
|
|
674
674
|
email: string;
|
|
675
675
|
password: string;
|
|
676
676
|
options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
|
|
677
677
|
};
|
|
678
|
-
export
|
|
678
|
+
export type GenerateInviteOrMagiclinkParams = {
|
|
679
679
|
type: 'invite' | 'magiclink';
|
|
680
680
|
/** The user's email */
|
|
681
681
|
email: string;
|
|
682
682
|
options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
|
|
683
683
|
};
|
|
684
|
-
export
|
|
684
|
+
export type GenerateRecoveryLinkParams = {
|
|
685
685
|
type: 'recovery';
|
|
686
686
|
/** The user's email */
|
|
687
687
|
email: string;
|
|
688
688
|
options?: Pick<GenerateLinkOptions, 'redirectTo'>;
|
|
689
689
|
};
|
|
690
|
-
export
|
|
690
|
+
export type GenerateEmailChangeLinkParams = {
|
|
691
691
|
type: 'email_change_current' | 'email_change_new';
|
|
692
692
|
/** The user's email */
|
|
693
693
|
email: string;
|
|
@@ -707,8 +707,8 @@ export interface GenerateLinkOptions {
|
|
|
707
707
|
/** The URL which will be appended to the email link generated. */
|
|
708
708
|
redirectTo?: string;
|
|
709
709
|
}
|
|
710
|
-
export
|
|
711
|
-
export
|
|
710
|
+
export type GenerateLinkParams = GenerateSignupLinkParams | GenerateInviteOrMagiclinkParams | GenerateRecoveryLinkParams | GenerateEmailChangeLinkParams;
|
|
711
|
+
export type GenerateLinkResponse = {
|
|
712
712
|
data: {
|
|
713
713
|
properties: GenerateLinkProperties;
|
|
714
714
|
user: User;
|
|
@@ -722,7 +722,7 @@ export declare type GenerateLinkResponse = {
|
|
|
722
722
|
error: AuthError;
|
|
723
723
|
};
|
|
724
724
|
/** The properties related to the email link generated */
|
|
725
|
-
export
|
|
725
|
+
export type GenerateLinkProperties = {
|
|
726
726
|
/**
|
|
727
727
|
* The email link to send to the user.
|
|
728
728
|
* The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
|
|
@@ -742,13 +742,13 @@ export declare type GenerateLinkProperties = {
|
|
|
742
742
|
/** The verification type that the email link is associated to. */
|
|
743
743
|
verification_type: GenerateLinkType;
|
|
744
744
|
};
|
|
745
|
-
export
|
|
746
|
-
export
|
|
747
|
-
export
|
|
745
|
+
export type GenerateLinkType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change_current' | 'email_change_new';
|
|
746
|
+
export type MFAEnrollParams = MFAEnrollTOTPParams | MFAEnrollPhoneParams;
|
|
747
|
+
export type MFAUnenrollParams = {
|
|
748
748
|
/** ID of the factor being unenrolled. */
|
|
749
749
|
factorId: string;
|
|
750
750
|
};
|
|
751
|
-
export
|
|
751
|
+
export type MFAVerifyParams = {
|
|
752
752
|
/** ID of the factor being verified. Returned in enroll(). */
|
|
753
753
|
factorId: string;
|
|
754
754
|
/** ID of the challenge being verified. Returned in challenge(). */
|
|
@@ -756,19 +756,19 @@ export declare type MFAVerifyParams = {
|
|
|
756
756
|
/** Verification code provided by the user. */
|
|
757
757
|
code: string;
|
|
758
758
|
};
|
|
759
|
-
export
|
|
759
|
+
export type MFAChallengeParams = {
|
|
760
760
|
/** ID of the factor to be challenged. Returned in enroll(). */
|
|
761
761
|
factorId: string;
|
|
762
762
|
/** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
|
|
763
763
|
channel?: 'sms' | 'whatsapp';
|
|
764
764
|
};
|
|
765
|
-
export
|
|
765
|
+
export type MFAChallengeAndVerifyParams = {
|
|
766
766
|
/** ID of the factor being verified. Returned in enroll(). */
|
|
767
767
|
factorId: string;
|
|
768
768
|
/** Verification code provided by the user. */
|
|
769
769
|
code: string;
|
|
770
770
|
};
|
|
771
|
-
export
|
|
771
|
+
export type AuthMFAVerifyResponse = {
|
|
772
772
|
data: {
|
|
773
773
|
/** New access token (JWT) after successful verification. */
|
|
774
774
|
access_token: string;
|
|
@@ -786,8 +786,8 @@ export declare type AuthMFAVerifyResponse = {
|
|
|
786
786
|
data: null;
|
|
787
787
|
error: AuthError;
|
|
788
788
|
};
|
|
789
|
-
export
|
|
790
|
-
export
|
|
789
|
+
export type AuthMFAEnrollResponse = AuthMFAEnrollTOTPResponse | AuthMFAEnrollPhoneResponse;
|
|
790
|
+
export type AuthMFAUnenrollResponse = {
|
|
791
791
|
data: {
|
|
792
792
|
/** ID of the factor that was successfully unenrolled. */
|
|
793
793
|
id: string;
|
|
@@ -797,7 +797,7 @@ export declare type AuthMFAUnenrollResponse = {
|
|
|
797
797
|
data: null;
|
|
798
798
|
error: AuthError;
|
|
799
799
|
};
|
|
800
|
-
export
|
|
800
|
+
export type AuthMFAChallengeResponse = {
|
|
801
801
|
data: {
|
|
802
802
|
/** ID of the newly created challenge. */
|
|
803
803
|
id: string;
|
|
@@ -811,7 +811,7 @@ export declare type AuthMFAChallengeResponse = {
|
|
|
811
811
|
data: null;
|
|
812
812
|
error: AuthError;
|
|
813
813
|
};
|
|
814
|
-
export
|
|
814
|
+
export type AuthMFAListFactorsResponse = {
|
|
815
815
|
data: {
|
|
816
816
|
/** All available factors (verified and unverified). */
|
|
817
817
|
all: Factor[];
|
|
@@ -825,8 +825,8 @@ export declare type AuthMFAListFactorsResponse = {
|
|
|
825
825
|
data: null;
|
|
826
826
|
error: AuthError;
|
|
827
827
|
};
|
|
828
|
-
export
|
|
829
|
-
export
|
|
828
|
+
export type AuthenticatorAssuranceLevels = 'aal1' | 'aal2';
|
|
829
|
+
export type AuthMFAGetAuthenticatorAssuranceLevelResponse = {
|
|
830
830
|
data: {
|
|
831
831
|
/** Current AAL level of the session. */
|
|
832
832
|
currentLevel: AuthenticatorAssuranceLevels | null;
|
|
@@ -914,7 +914,7 @@ export interface GoTrueMFAApi {
|
|
|
914
914
|
/**
|
|
915
915
|
* @expermental
|
|
916
916
|
*/
|
|
917
|
-
export
|
|
917
|
+
export type AuthMFAAdminDeleteFactorResponse = {
|
|
918
918
|
data: {
|
|
919
919
|
/** ID of the factor that was successfully deleted. */
|
|
920
920
|
id: string;
|
|
@@ -927,7 +927,7 @@ export declare type AuthMFAAdminDeleteFactorResponse = {
|
|
|
927
927
|
/**
|
|
928
928
|
* @expermental
|
|
929
929
|
*/
|
|
930
|
-
export
|
|
930
|
+
export type AuthMFAAdminDeleteFactorParams = {
|
|
931
931
|
/** ID of the MFA factor to delete. */
|
|
932
932
|
id: string;
|
|
933
933
|
/** ID of the user whose factor is being deleted. */
|
|
@@ -936,7 +936,7 @@ export declare type AuthMFAAdminDeleteFactorParams = {
|
|
|
936
936
|
/**
|
|
937
937
|
* @expermental
|
|
938
938
|
*/
|
|
939
|
-
export
|
|
939
|
+
export type AuthMFAAdminListFactorsResponse = {
|
|
940
940
|
data: {
|
|
941
941
|
/** All factors attached to the user. */
|
|
942
942
|
factors: Factor[];
|
|
@@ -949,7 +949,7 @@ export declare type AuthMFAAdminListFactorsResponse = {
|
|
|
949
949
|
/**
|
|
950
950
|
* @expermental
|
|
951
951
|
*/
|
|
952
|
-
export
|
|
952
|
+
export type AuthMFAAdminListFactorsParams = {
|
|
953
953
|
/** ID of the user. */
|
|
954
954
|
userId: string;
|
|
955
955
|
};
|
|
@@ -974,12 +974,12 @@ export interface GoTrueAdminMFAApi {
|
|
|
974
974
|
*/
|
|
975
975
|
deleteFactor(params: AuthMFAAdminDeleteFactorParams): Promise<AuthMFAAdminDeleteFactorResponse>;
|
|
976
976
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
977
|
+
type AnyFunction = (...args: any[]) => any;
|
|
978
|
+
type MaybePromisify<T> = T | Promise<T>;
|
|
979
|
+
type PromisifyMethods<T> = {
|
|
980
980
|
[K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
|
|
981
981
|
};
|
|
982
|
-
export
|
|
982
|
+
export type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>> & {
|
|
983
983
|
/**
|
|
984
984
|
* If set to `true` signals to the library that the storage medium is used
|
|
985
985
|
* on a server and the values may not be authentic, such as reading from
|
|
@@ -989,29 +989,29 @@ export declare type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem'
|
|
|
989
989
|
*/
|
|
990
990
|
isServer?: boolean;
|
|
991
991
|
};
|
|
992
|
-
export
|
|
992
|
+
export type InitializeResult = {
|
|
993
993
|
error: AuthError | null;
|
|
994
994
|
};
|
|
995
|
-
export
|
|
995
|
+
export type CallRefreshTokenResult = {
|
|
996
996
|
session: Session;
|
|
997
997
|
error: null;
|
|
998
998
|
} | {
|
|
999
999
|
session: null;
|
|
1000
1000
|
error: AuthError;
|
|
1001
1001
|
};
|
|
1002
|
-
export
|
|
1002
|
+
export type Pagination = {
|
|
1003
1003
|
[key: string]: any;
|
|
1004
1004
|
nextPage: number | null;
|
|
1005
1005
|
lastPage: number;
|
|
1006
1006
|
total: number;
|
|
1007
1007
|
};
|
|
1008
|
-
export
|
|
1008
|
+
export type PageParams = {
|
|
1009
1009
|
/** The page number */
|
|
1010
1010
|
page?: number;
|
|
1011
1011
|
/** Number of items returned per page */
|
|
1012
1012
|
perPage?: number;
|
|
1013
1013
|
};
|
|
1014
|
-
export
|
|
1014
|
+
export type SignOut = {
|
|
1015
1015
|
/**
|
|
1016
1016
|
* Determines which sessions should be
|
|
1017
1017
|
* logged out. Global means all
|
|
@@ -1024,7 +1024,7 @@ export declare type SignOut = {
|
|
|
1024
1024
|
*/
|
|
1025
1025
|
scope?: 'global' | 'local' | 'others';
|
|
1026
1026
|
};
|
|
1027
|
-
export
|
|
1027
|
+
export type MFAEnrollTOTPParams = {
|
|
1028
1028
|
/** The type of factor being enrolled. */
|
|
1029
1029
|
factorType: 'totp';
|
|
1030
1030
|
/** Domain which the user is enrolled with. */
|
|
@@ -1032,7 +1032,7 @@ export declare type MFAEnrollTOTPParams = {
|
|
|
1032
1032
|
/** Human readable name assigned to the factor. */
|
|
1033
1033
|
friendlyName?: string;
|
|
1034
1034
|
};
|
|
1035
|
-
export
|
|
1035
|
+
export type MFAEnrollPhoneParams = {
|
|
1036
1036
|
/** The type of factor being enrolled. */
|
|
1037
1037
|
factorType: 'phone';
|
|
1038
1038
|
/** Human readable name assigned to the factor. */
|
|
@@ -1040,7 +1040,7 @@ export declare type MFAEnrollPhoneParams = {
|
|
|
1040
1040
|
/** Phone number associated with a factor. Number should conform to E.164 format */
|
|
1041
1041
|
phone: string;
|
|
1042
1042
|
};
|
|
1043
|
-
export
|
|
1043
|
+
export type AuthMFAEnrollTOTPResponse = {
|
|
1044
1044
|
data: {
|
|
1045
1045
|
/** ID of the factor that was just enrolled (in an unverified state). */
|
|
1046
1046
|
id: string;
|
|
@@ -1068,7 +1068,7 @@ export declare type AuthMFAEnrollTOTPResponse = {
|
|
|
1068
1068
|
data: null;
|
|
1069
1069
|
error: AuthError;
|
|
1070
1070
|
};
|
|
1071
|
-
export
|
|
1071
|
+
export type AuthMFAEnrollPhoneResponse = {
|
|
1072
1072
|
data: {
|
|
1073
1073
|
/** ID of the factor that was just enrolled (in an unverified state). */
|
|
1074
1074
|
id: string;
|
|
@@ -1084,12 +1084,12 @@ export declare type AuthMFAEnrollPhoneResponse = {
|
|
|
1084
1084
|
data: null;
|
|
1085
1085
|
error: AuthError;
|
|
1086
1086
|
};
|
|
1087
|
-
export
|
|
1087
|
+
export type JwtHeader = {
|
|
1088
1088
|
alg: 'RS256' | 'ES256' | 'HS256';
|
|
1089
1089
|
kid: string;
|
|
1090
1090
|
typ: string;
|
|
1091
1091
|
};
|
|
1092
|
-
export
|
|
1092
|
+
export type RequiredClaims = {
|
|
1093
1093
|
iss: string;
|
|
1094
1094
|
sub: string;
|
|
1095
1095
|
aud: string | string[];
|
|
@@ -1099,7 +1099,7 @@ export declare type RequiredClaims = {
|
|
|
1099
1099
|
aal: AuthenticatorAssuranceLevels;
|
|
1100
1100
|
session_id: string;
|
|
1101
1101
|
};
|
|
1102
|
-
export
|
|
1102
|
+
export type JwtPayload = RequiredClaims & {
|
|
1103
1103
|
[key: string]: any;
|
|
1104
1104
|
};
|
|
1105
1105
|
export interface JWK {
|
|
@@ -1110,6 +1110,6 @@ export interface JWK {
|
|
|
1110
1110
|
[key: string]: any;
|
|
1111
1111
|
}
|
|
1112
1112
|
export declare const SIGN_OUT_SCOPES: readonly ["global", "local", "others"];
|
|
1113
|
-
export
|
|
1113
|
+
export type SignOutScope = (typeof SIGN_OUT_SCOPES)[number];
|
|
1114
1114
|
export {};
|
|
1115
1115
|
//# sourceMappingURL=types.d.ts.map
|