@supabase/gotrue-js 1.23.0-next.19 → 1.23.0-next.21

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.
Files changed (56) hide show
  1. package/dist/main/GoTrueAdminApi.d.ts +105 -0
  2. package/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  3. package/dist/main/GoTrueAdminApi.js +216 -0
  4. package/dist/main/GoTrueAdminApi.js.map +1 -0
  5. package/dist/main/GoTrueClient.d.ts +80 -52
  6. package/dist/main/GoTrueClient.d.ts.map +1 -1
  7. package/dist/main/GoTrueClient.js +211 -151
  8. package/dist/main/GoTrueClient.js.map +1 -1
  9. package/dist/main/index.d.ts +2 -2
  10. package/dist/main/index.d.ts.map +1 -1
  11. package/dist/main/index.js +3 -3
  12. package/dist/main/index.js.map +1 -1
  13. package/dist/main/lib/fetch.d.ts +17 -4
  14. package/dist/main/lib/fetch.d.ts.map +1 -1
  15. package/dist/main/lib/fetch.js +41 -23
  16. package/dist/main/lib/fetch.js.map +1 -1
  17. package/dist/main/lib/types.d.ts +17 -10
  18. package/dist/main/lib/types.d.ts.map +1 -1
  19. package/dist/main/lib/version.d.ts +1 -1
  20. package/dist/main/lib/version.js +1 -1
  21. package/dist/module/GoTrueAdminApi.d.ts +105 -0
  22. package/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  23. package/dist/module/GoTrueAdminApi.js +213 -0
  24. package/dist/module/GoTrueAdminApi.js.map +1 -0
  25. package/dist/module/GoTrueClient.d.ts +80 -52
  26. package/dist/module/GoTrueClient.d.ts.map +1 -1
  27. package/dist/module/GoTrueClient.js +212 -152
  28. package/dist/module/GoTrueClient.js.map +1 -1
  29. package/dist/module/index.d.ts +2 -2
  30. package/dist/module/index.d.ts.map +1 -1
  31. package/dist/module/index.js +2 -2
  32. package/dist/module/index.js.map +1 -1
  33. package/dist/module/lib/fetch.d.ts +17 -4
  34. package/dist/module/lib/fetch.d.ts.map +1 -1
  35. package/dist/module/lib/fetch.js +37 -18
  36. package/dist/module/lib/fetch.js.map +1 -1
  37. package/dist/module/lib/types.d.ts +17 -10
  38. package/dist/module/lib/types.d.ts.map +1 -1
  39. package/dist/module/lib/version.d.ts +1 -1
  40. package/dist/module/lib/version.js +1 -1
  41. package/package.json +1 -1
  42. package/src/GoTrueAdminApi.ts +236 -0
  43. package/src/GoTrueClient.ts +257 -212
  44. package/src/index.ts +2 -2
  45. package/src/lib/fetch.ts +57 -34
  46. package/src/lib/types.ts +23 -10
  47. package/src/lib/version.ts +1 -1
  48. package/dist/main/GoTrueApi.d.ts +0 -339
  49. package/dist/main/GoTrueApi.d.ts.map +0 -1
  50. package/dist/main/GoTrueApi.js +0 -558
  51. package/dist/main/GoTrueApi.js.map +0 -1
  52. package/dist/module/GoTrueApi.d.ts +0 -339
  53. package/dist/module/GoTrueApi.d.ts.map +0 -1
  54. package/dist/module/GoTrueApi.js +0 -555
  55. package/dist/module/GoTrueApi.js.map +0 -1
  56. package/src/GoTrueApi.ts +0 -808
@@ -0,0 +1,105 @@
1
+ import { Fetch } from './lib/fetch';
2
+ import { AdminUserAttributes, GenerateLinkTypes, Session, User, UserResponse } from './lib/types';
3
+ import { AuthError } from './lib/errors';
4
+ export default class GoTrueAdminApi {
5
+ protected url: string;
6
+ protected headers: {
7
+ [key: string]: string;
8
+ };
9
+ protected fetch: Fetch;
10
+ constructor({ url, headers, fetch, }: {
11
+ url: string;
12
+ headers?: {
13
+ [key: string]: string;
14
+ };
15
+ fetch?: Fetch;
16
+ });
17
+ /**
18
+ * Removes a logged-in session.
19
+ * @param jwt A valid, logged-in JWT.
20
+ */
21
+ signOut(jwt: string): Promise<{
22
+ error: AuthError | null;
23
+ }>;
24
+ /**
25
+ * Sends an invite link to an email address.
26
+ * @param email The email address of the user.
27
+ * @param options.redirectTo A URL or mobile address to send the user to after they are confirmed.
28
+ * @param options.data Optional user metadata
29
+ */
30
+ inviteUserByEmail(email: string, options?: {
31
+ redirectTo?: string;
32
+ data?: object;
33
+ }): Promise<UserResponse>;
34
+ /**
35
+ * Generates links to be sent via email or other.
36
+ * @param type The link type ("signup" or "magiclink" or "recovery" or "invite").
37
+ * @param email The user's email.
38
+ * @param options.password User password. For signup only.
39
+ * @param options.data Optional user metadata. For signup only.
40
+ * @param options.redirectTo The redirect url which should be appended to the generated link
41
+ */
42
+ generateLink(type: GenerateLinkTypes, email: string, options?: {
43
+ password?: string;
44
+ data?: object;
45
+ redirectTo?: string;
46
+ }): Promise<{
47
+ data: User;
48
+ error: null;
49
+ } | {
50
+ data: Session;
51
+ error: null;
52
+ } | {
53
+ data: null;
54
+ error: AuthError;
55
+ }>;
56
+ /**
57
+ * Creates a new user.
58
+ *
59
+ * @param attributes The data you want to create the user with.
60
+ *
61
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
62
+ */
63
+ createUser(attributes: AdminUserAttributes): Promise<UserResponse>;
64
+ /**
65
+ * Get a list of users.
66
+ *
67
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
68
+ */
69
+ listUsers(): Promise<{
70
+ data: {
71
+ users: User[];
72
+ };
73
+ error: null;
74
+ } | {
75
+ data: {
76
+ users: [];
77
+ };
78
+ error: AuthError;
79
+ }>;
80
+ /**
81
+ * Get user by id.
82
+ *
83
+ * @param uid The user's unique identifier
84
+ *
85
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
86
+ */
87
+ getUserById(uid: string): Promise<UserResponse>;
88
+ /**
89
+ * Updates the user data.
90
+ *
91
+ * @param attributes The data you want to update.
92
+ *
93
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
94
+ */
95
+ updateUserById(uid: string, attributes: AdminUserAttributes): Promise<UserResponse>;
96
+ /**
97
+ * Delete a user. Requires a `service_role` key.
98
+ *
99
+ * @param uid The user uid you want to remove.
100
+ *
101
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
102
+ */
103
+ deleteUser(uid: string): Promise<UserResponse>;
104
+ }
105
+ //# sourceMappingURL=GoTrueAdminApi.d.ts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GACL,OAAO,CACN;QACE,IAAI,EAAE,IAAI,CAAA;QACV,KAAK,EAAE,IAAI,CAAA;KACZ,GACD;QACE,IAAI,EAAE,OAAO,CAAA;QACb,KAAK,EAAE,IAAI,CAAA;KACZ,GACD;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CACnC;IAqBD;;;;;;OAMG;IACG,UAAU,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAgBxE;;;;OAIG;IACG,SAAS,IAAI,OAAO,CACxB;QAAE,IAAI,EAAE;YAAE,KAAK,EAAE,IAAI,EAAE,CAAA;SAAE,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE;YAAE,KAAK,EAAE,EAAE,CAAA;SAAE,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CACrF;IAeD;;;;;;OAMG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAerD;;;;;;OAMG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAgBzF;;;;;;OAMG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAcrD"}
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const fetch_1 = require("./lib/fetch");
13
+ const helpers_1 = require("./lib/helpers");
14
+ const errors_1 = require("./lib/errors");
15
+ class GoTrueAdminApi {
16
+ constructor({ url = '', headers = {}, fetch, }) {
17
+ this.url = url;
18
+ this.headers = headers;
19
+ this.fetch = (0, helpers_1.resolveFetch)(fetch);
20
+ }
21
+ /**
22
+ * Removes a logged-in session.
23
+ * @param jwt A valid, logged-in JWT.
24
+ */
25
+ signOut(jwt) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ try {
28
+ yield (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/logout`, {
29
+ jwt,
30
+ noResolveJson: true,
31
+ });
32
+ return { error: null };
33
+ }
34
+ catch (error) {
35
+ if ((0, errors_1.isAuthError)(error)) {
36
+ return { error };
37
+ }
38
+ throw error;
39
+ }
40
+ });
41
+ }
42
+ /**
43
+ * Sends an invite link to an email address.
44
+ * @param email The email address of the user.
45
+ * @param options.redirectTo A URL or mobile address to send the user to after they are confirmed.
46
+ * @param options.data Optional user metadata
47
+ */
48
+ inviteUserByEmail(email, options = {}) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ return yield (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/invite`, {
52
+ body: { email, data: options.data },
53
+ headers: this.headers,
54
+ redirectTo: options.redirectTo,
55
+ xform: fetch_1._userResponse,
56
+ });
57
+ }
58
+ catch (error) {
59
+ if ((0, errors_1.isAuthError)(error)) {
60
+ return { data: { user: null }, error };
61
+ }
62
+ throw error;
63
+ }
64
+ });
65
+ }
66
+ /**
67
+ * Generates links to be sent via email or other.
68
+ * @param type The link type ("signup" or "magiclink" or "recovery" or "invite").
69
+ * @param email The user's email.
70
+ * @param options.password User password. For signup only.
71
+ * @param options.data Optional user metadata. For signup only.
72
+ * @param options.redirectTo The redirect url which should be appended to the generated link
73
+ */
74
+ generateLink(type, email, options = {}) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ try {
77
+ return yield (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/generate_link`, {
78
+ body: {
79
+ type,
80
+ email,
81
+ password: options.password,
82
+ data: options.data,
83
+ redirect_to: options.redirectTo,
84
+ },
85
+ headers: this.headers,
86
+ });
87
+ }
88
+ catch (error) {
89
+ if ((0, errors_1.isAuthError)(error)) {
90
+ return { data: null, error };
91
+ }
92
+ throw error;
93
+ }
94
+ });
95
+ }
96
+ // User Admin API
97
+ /**
98
+ * Creates a new user.
99
+ *
100
+ * @param attributes The data you want to create the user with.
101
+ *
102
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
103
+ */
104
+ createUser(attributes) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ try {
107
+ return yield (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/users`, {
108
+ body: attributes,
109
+ headers: this.headers,
110
+ xform: fetch_1._userResponse,
111
+ });
112
+ }
113
+ catch (error) {
114
+ if ((0, errors_1.isAuthError)(error)) {
115
+ return { data: { user: null }, error };
116
+ }
117
+ throw error;
118
+ }
119
+ });
120
+ }
121
+ /**
122
+ * Get a list of users.
123
+ *
124
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
125
+ */
126
+ listUsers() {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ try {
129
+ const { data, error } = yield (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users`, {
130
+ headers: this.headers,
131
+ });
132
+ if (error)
133
+ throw error;
134
+ return { data: Object.assign({}, data), error: null };
135
+ }
136
+ catch (error) {
137
+ if ((0, errors_1.isAuthError)(error)) {
138
+ return { data: { users: [] }, error };
139
+ }
140
+ throw error;
141
+ }
142
+ });
143
+ }
144
+ /**
145
+ * Get user by id.
146
+ *
147
+ * @param uid The user's unique identifier
148
+ *
149
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
150
+ */
151
+ getUserById(uid) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ try {
154
+ return yield (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users/${uid}`, {
155
+ headers: this.headers,
156
+ xform: fetch_1._userResponse,
157
+ });
158
+ }
159
+ catch (error) {
160
+ if ((0, errors_1.isAuthError)(error)) {
161
+ return { data: { user: null }, error };
162
+ }
163
+ throw error;
164
+ }
165
+ });
166
+ }
167
+ /**
168
+ * Updates the user data.
169
+ *
170
+ * @param attributes The data you want to update.
171
+ *
172
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
173
+ */
174
+ updateUserById(uid, attributes) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ try {
177
+ return yield (0, fetch_1._request)(this.fetch, 'PUT', `${this.url}/admin/users/${uid}`, {
178
+ body: attributes,
179
+ headers: this.headers,
180
+ xform: fetch_1._userResponse,
181
+ });
182
+ }
183
+ catch (error) {
184
+ if ((0, errors_1.isAuthError)(error)) {
185
+ return { data: { user: null }, error };
186
+ }
187
+ throw error;
188
+ }
189
+ });
190
+ }
191
+ /**
192
+ * Delete a user. Requires a `service_role` key.
193
+ *
194
+ * @param uid The user uid you want to remove.
195
+ *
196
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
197
+ */
198
+ deleteUser(uid) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ try {
201
+ return yield (0, fetch_1._request)(this.fetch, 'DELETE', `${this.url}/admin/users/${uid}`, {
202
+ headers: this.headers,
203
+ xform: fetch_1._userResponse,
204
+ });
205
+ }
206
+ catch (error) {
207
+ if ((0, errors_1.isAuthError)(error)) {
208
+ return { data: { user: null }, error };
209
+ }
210
+ throw error;
211
+ }
212
+ });
213
+ }
214
+ }
215
+ exports.default = GoTrueAdminApi;
216
+ //# sourceMappingURL=GoTrueAdminApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoTrueAdminApi.js","sourceRoot":"","sources":["../../src/GoTrueAdminApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA4D;AAC5D,2CAA4C;AAE5C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oBAChB,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,KAAK,EAAE,qBAAa;iBACrB,CAAC,CAAA;aACH;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,IAAA,oBAAW,EAAC,KAAK,CAAC,EAAE;oBACtB,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAA;iBACvC;gBAED,MAAM,KAAK,CAAA;aACZ;QACH,CAAC;KAAA;IAED;;;;;;OAMG;IACG,UAAU,CAAC,GAAW;;YAC1B,IAAI;gBACF,OAAO,MAAM,IAAA,gBAAQ,EAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,gBAAgB,GAAG,EAAE,EAAE;oBAC5E,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,KAAK,EAAE,qBAAa;iBACrB,CAAC,CAAA;aACH;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,IAAA,oBAAW,EAAC,KAAK,CAAC,EAAE;oBACtB,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAA;iBACvC;gBAED,MAAM,KAAK,CAAA;aACZ;QACH,CAAC;KAAA;CACF;AAtOD,iCAsOC"}
@@ -1,20 +1,20 @@
1
- import GoTrueApi from './GoTrueApi';
1
+ import GoTrueAdminApi from './GoTrueAdminApi';
2
2
  import { AuthError } from './lib/errors';
3
3
  import { Fetch } from './lib/fetch';
4
4
  import { Deferred } from './lib/helpers';
5
- import type { AuthChangeEvent, AuthResponse, CallRefreshTokenResult, OAuthResponse, Session, SignInWithOAuthCredentials, SignInWithPasswordCredentials, SignInWithPasswordlessCredentials, Subscription, SupportedStorage, UserAttributes, UserCredentials, UserResponse, VerifyOTPParams } from './lib/types';
5
+ import type { AuthChangeEvent, AuthResponse, CallRefreshTokenResult, OAuthResponse, Session, SignInWithOAuthCredentials, SignInWithPasswordCredentials, SignInWithPasswordlessCredentials, Subscription, SupportedStorage, UserAttributes, UserCredentials, UserResponse, VerifyOtpParams } from './lib/types';
6
6
  export default class GoTrueClient {
7
7
  /**
8
- * Namespace for the GoTrue API methods.
9
- * These can be used for example to get a user from a JWT in a server environment or reset a user's password.
8
+ * Namespace for the GoTrue admin methods.
9
+ * These methods should only be used in a trusted server-side environment.
10
10
  */
11
- api: GoTrueApi;
11
+ admin: GoTrueAdminApi;
12
12
  /**
13
- * The storage key used to identity the values saved in localStorage
13
+ * The storage key used to identify the values saved in localStorage
14
14
  */
15
15
  protected storageKey: string;
16
16
  /**
17
- * The session object for the currently logged in user or null.
17
+ * The session object for the currently logged in user. If null, it means there isn't a logged-in user.
18
18
  * Only used if persistSession is false.
19
19
  */
20
20
  protected inMemorySession: Session | null;
@@ -25,6 +25,11 @@ export default class GoTrueClient {
25
25
  protected refreshTokenTimer?: ReturnType<typeof setTimeout>;
26
26
  protected networkRetries: number;
27
27
  protected refreshingDeferred: Deferred<CallRefreshTokenResult> | null;
28
+ protected url: string;
29
+ protected headers: {
30
+ [key: string]: string;
31
+ };
32
+ protected fetch: Fetch;
28
33
  /**
29
34
  * Create a new client for use in the browser.
30
35
  * @param options.url The URL of the GoTrue server.
@@ -58,6 +63,10 @@ export default class GoTrueClient {
58
63
  * @param phone The user's phone number.
59
64
  * @param options.redirectTo The redirect URL attached to the signup confirmation link. Does not redirect the user if it's a mobile signup.
60
65
  * @param options.data Optional user metadata.
66
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
67
+ *
68
+ * @returns A logged-in session if the server has "autoconfirm" ON
69
+ * @returns A user if the server has "autoconfirm" OFF
61
70
  */
62
71
  signUp({ email, password, phone }: UserCredentials, options?: {
63
72
  redirectTo?: string;
@@ -70,7 +79,7 @@ export default class GoTrueClient {
70
79
  * @param email The user's email address.
71
80
  * @param phone The user's phone number.
72
81
  * @param password The user's password.
73
- * @param options Valid options for password sign-ins.
82
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
74
83
  */
75
84
  signInWithPassword(credentials: SignInWithPasswordCredentials): Promise<AuthResponse>;
76
85
  /**
@@ -78,8 +87,9 @@ export default class GoTrueClient {
78
87
  * @type SignInWithOAuthCredentials
79
88
  * @param provider One of the providers supported by GoTrue.
80
89
  * @param redirectTo A URL to send the user to after they are confirmed (OAuth logins only).
81
- * @param scopes A space-separated list of scopes granted to the OAuth application.
82
- * @param queryParams An object of query params
90
+ * @param options.scopes A space-separated list of scopes granted to the OAuth application.
91
+ * @param options.queryParams An object of query params
92
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
83
93
  */
84
94
  signInWithOAuth(credentials: SignInWithOAuthCredentials): Promise<OAuthResponse>;
85
95
  /**
@@ -87,85 +97,76 @@ export default class GoTrueClient {
87
97
  * @type SignInWithPasswordlessCredentials
88
98
  * @param email The user's email address.
89
99
  * @param phone The user's phone number.
90
- * @param options Valid options for passwordless sign-ins.
100
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
101
+ * @param options.emailRedirectTo The redirect url sent in the magiclink. The url will be appended to the end of the magiclink url. Does not serve to redirect the user after this method is invoked.
102
+ * @param options.shouldCreateUser If set to false, signInWithOtp will not create a new user if the user does not exist. Defaults to true.
91
103
  */
92
104
  signInWithOtp(credentials: SignInWithPasswordlessCredentials): Promise<AuthResponse>;
93
105
  /**
94
- * Log in a user given a User supplied OTP received via mobile.
106
+ * Log in a user given a User supplied Otp received via mobile.
95
107
  * @param email The user's email address.
96
108
  * @param phone The user's phone number.
97
109
  * @param token The user's password.
98
110
  * @param type The user's verification type.
99
- * @param options.redirectTo A URL or mobile address to send the user to after they are confirmed.
111
+ * @param options.redirectTo A URL to send the user to after they are confirmed.
112
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
100
113
  */
101
- verifyOTP(params: VerifyOTPParams, options?: {
114
+ verifyOtp(params: VerifyOtpParams, options?: {
102
115
  redirectTo?: string;
116
+ captchaToken?: string;
103
117
  }): Promise<AuthResponse>;
104
118
  /**
105
119
  * Returns the session data, refreshing it if necessary.
120
+ * If no session is detected, the session returned will be null.
106
121
  */
107
122
  getSession(): Promise<{
108
- session: Session;
123
+ data: {
124
+ session: Session;
125
+ };
109
126
  error: null;
110
127
  } | {
111
- session: null;
128
+ data: {
129
+ session: null;
130
+ };
112
131
  error: AuthError;
113
132
  } | {
114
- session: null;
115
- error: null;
116
- }>;
117
- /**
118
- * Returns the user data based on the current session, refreshing the session if necessary.
119
- */
120
- getUserFromSession(): Promise<UserResponse | {
121
133
  data: {
122
- user: null;
134
+ session: null;
123
135
  };
124
136
  error: null;
125
137
  }>;
138
+ /**
139
+ * Gets the current user details if there is an existing session.
140
+ * @param jwt Takes in an optional access token jwt. If no jwt is provided, getUser() will attempt to get the jwt from the current session.
141
+ */
142
+ getUser(jwt?: string): Promise<UserResponse>;
126
143
  /**
127
144
  * Updates user data, if there is a logged in user.
128
145
  * @param attributes The data you want to update.
129
146
  */
130
- update(attributes: UserAttributes): Promise<UserResponse>;
147
+ updateUser(attributes: UserAttributes): Promise<UserResponse>;
131
148
  /**
132
- * Sets the session data from refresh_token and returns current Session and Error
133
- * @param refresh_token a JWT token
149
+ * Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
150
+ * @param refresh_token The refresh token returned by gotrue.
134
151
  */
135
- setSession(refresh_token: string): Promise<{
136
- session: Session;
137
- error: null;
138
- } | {
139
- session: null;
140
- error: null;
141
- } | {
142
- session: null;
143
- error: AuthError;
144
- }>;
152
+ setSession(refresh_token: string): Promise<AuthResponse>;
145
153
  /**
146
154
  * Gets the session data from a URL string
147
- * @param options.storeSession Optionally store the session in the browser
148
155
  */
149
- getSessionFromUrl(options?: {
150
- storeSession?: boolean;
151
- }): Promise<{
152
- session: Session;
153
- error: null;
154
- } | {
155
- session: null;
156
- error: AuthError;
157
- }>;
156
+ private _getSessionFromUrl;
158
157
  /**
159
158
  * Inside a browser context, `signOut()` will remove the logged in user from the browser session
160
159
  * and log them out - removing all items from localstorage and then trigger a "SIGNED_OUT" event.
161
160
  *
162
- * For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`. There is no way to revoke a user's session JWT before it automatically expires
161
+ * For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.
162
+ * There is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.
163
163
  */
164
164
  signOut(): Promise<{
165
165
  error: AuthError | null;
166
166
  }>;
167
167
  /**
168
168
  * Receive a notification every time an auth event happens.
169
+ * @param callback A callback function to be invoked when an auth event happens.
169
170
  * @returns {Subscription} A subscription object which can be used to unsubscribe itself.
170
171
  */
171
172
  onAuthStateChange(callback: (event: AuthChangeEvent, session: Session | null) => void): {
@@ -175,11 +176,29 @@ export default class GoTrueClient {
175
176
  subscription: null;
176
177
  error: AuthError;
177
178
  };
179
+ /**
180
+ * Sends a reset request to an email address.
181
+ * @param email The email address of the user.
182
+ * @param options.redirectTo A URL to send the user to after they are confirmed.
183
+ * @param options.captchaToken Verification token received when the user completes the captcha on the site.
184
+ */
185
+ resetPasswordForEmail(email: string, options?: {
186
+ redirectTo?: string;
187
+ captchaToken?: string;
188
+ }): Promise<{
189
+ data: {};
190
+ error: null;
191
+ } | {
192
+ data: null;
193
+ error: AuthError;
194
+ }>;
195
+ /**
196
+ * Generates a new JWT.
197
+ * @param refreshToken A valid refresh token that was returned on login.
198
+ */
199
+ private _refreshAccessToken;
178
200
  private _doesSessionExist;
179
- private _handleEmailSignIn;
180
- private _handlePhoneSignIn;
181
201
  private _handleProviderSignIn;
182
- private _handleOpenIDConnectSignIn;
183
202
  /**
184
203
  * Recovers the session from LocalStorage and refreshes
185
204
  * Note: this method is async to accommodate for AsyncStorage e.g. in React native.
@@ -196,9 +215,18 @@ export default class GoTrueClient {
196
215
  private _removeSession;
197
216
  /**
198
217
  * Clear and re-create refresh token timer
199
- * @param value time intervals in milliseconds
218
+ * @param value time intervals in milliseconds.
219
+ * @param session The current session.
200
220
  */
201
221
  private _startAutoRefreshToken;
202
222
  private _handleVisibilityChange;
223
+ /**
224
+ * Generates the relevant login URL for a third-party provider.
225
+ * @param provider One of the providers supported by GoTrue.
226
+ * @param options.redirectTo A URL or mobile address to send the user to after they are confirmed.
227
+ * @param options.scopes A space-separated list of scopes granted to the OAuth application.
228
+ * @param options.queryParams An object of key-value pairs containing query parameters granted to the OAuth application.
229
+ */
230
+ private _getUrlForProvider;
203
231
  }
204
232
  //# sourceMappingURL=GoTrueClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GoTrueClient.d.ts","sourceRoot":"","sources":["../../src/GoTrueClient.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AAQnC,OAAO,EAEL,SAAS,EAMV,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EACL,QAAQ,EAOT,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,aAAa,EAGb,OAAO,EACP,0BAA0B,EAC1B,6BAA6B,EAC7B,iCAAiC,EACjC,YAAY,EACZ,gBAAgB,EAEhB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,eAAe,EAChB,MAAM,aAAa,CAAA;AAcpB,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B;;;OAGG;IACH,GAAG,EAAE,SAAS,CAAA;IACd;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,CAAA;IAE5B;;;OAGG;IACH,SAAS,CAAC,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;IAEzC,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAA;IACnC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAA;IACjC,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAA;IACnC,SAAS,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAY;IACpE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