@supabase/auth-js 2.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/main/AuthAdminApi.d.ts +4 -0
- package/dist/main/AuthAdminApi.d.ts.map +1 -0
- package/dist/main/AuthAdminApi.js +9 -0
- package/dist/main/AuthAdminApi.js.map +1 -0
- package/dist/main/AuthClient.d.ts +4 -0
- package/dist/main/AuthClient.d.ts.map +1 -0
- package/dist/main/AuthClient.js +9 -0
- package/dist/main/AuthClient.js.map +1 -0
- package/dist/main/GoTrueAdminApi.d.ts +99 -0
- package/dist/main/GoTrueAdminApi.d.ts.map +1 -0
- package/dist/main/GoTrueAdminApi.js +268 -0
- package/dist/main/GoTrueAdminApi.js.map +1 -0
- package/dist/main/GoTrueClient.d.ts +432 -0
- package/dist/main/GoTrueClient.d.ts.map +1 -0
- package/dist/main/GoTrueClient.js +1889 -0
- package/dist/main/GoTrueClient.js.map +1 -0
- package/dist/main/index.d.ts +9 -0
- package/dist/main/index.d.ts.map +1 -0
- package/dist/main/index.js +35 -0
- package/dist/main/index.js.map +1 -0
- package/dist/main/lib/constants.d.ts +12 -0
- package/dist/main/lib/constants.d.ts.map +1 -0
- package/dist/main/lib/constants.js +14 -0
- package/dist/main/lib/constants.js.map +1 -0
- package/dist/main/lib/errors.d.ts +96 -0
- package/dist/main/lib/errors.d.ts.map +1 -0
- package/dist/main/lib/errors.js +135 -0
- package/dist/main/lib/errors.js.map +1 -0
- package/dist/main/lib/fetch.d.ts +33 -0
- package/dist/main/lib/fetch.d.ts.map +1 -0
- package/dist/main/lib/fetch.js +162 -0
- package/dist/main/lib/fetch.js.map +1 -0
- package/dist/main/lib/helpers.d.ts +48 -0
- package/dist/main/lib/helpers.d.ts.map +1 -0
- package/dist/main/lib/helpers.js +292 -0
- package/dist/main/lib/helpers.js.map +1 -0
- package/dist/main/lib/local-storage.d.ts +13 -0
- package/dist/main/lib/local-storage.d.ts.map +1 -0
- package/dist/main/lib/local-storage.js +46 -0
- package/dist/main/lib/local-storage.js.map +1 -0
- package/dist/main/lib/locks.d.ts +44 -0
- package/dist/main/lib/locks.d.ts.map +1 -0
- package/dist/main/lib/locks.js +118 -0
- package/dist/main/lib/locks.js.map +1 -0
- package/dist/main/lib/polyfills.d.ts +5 -0
- package/dist/main/lib/polyfills.d.ts.map +1 -0
- package/dist/main/lib/polyfills.js +30 -0
- package/dist/main/lib/polyfills.js.map +1 -0
- package/dist/main/lib/types.d.ts +948 -0
- package/dist/main/lib/types.d.ts.map +1 -0
- package/dist/main/lib/types.js +3 -0
- package/dist/main/lib/types.js.map +1 -0
- package/dist/main/lib/version.d.ts +2 -0
- package/dist/main/lib/version.d.ts.map +1 -0
- package/dist/main/lib/version.js +6 -0
- package/dist/main/lib/version.js.map +1 -0
- package/dist/module/AuthAdminApi.d.ts +4 -0
- package/dist/module/AuthAdminApi.d.ts.map +1 -0
- package/dist/module/AuthAdminApi.js +4 -0
- package/dist/module/AuthAdminApi.js.map +1 -0
- package/dist/module/AuthClient.d.ts +4 -0
- package/dist/module/AuthClient.d.ts.map +1 -0
- package/dist/module/AuthClient.js +4 -0
- package/dist/module/AuthClient.js.map +1 -0
- package/dist/module/GoTrueAdminApi.d.ts +99 -0
- package/dist/module/GoTrueAdminApi.d.ts.map +1 -0
- package/dist/module/GoTrueAdminApi.js +265 -0
- package/dist/module/GoTrueAdminApi.js.map +1 -0
- package/dist/module/GoTrueClient.d.ts +432 -0
- package/dist/module/GoTrueClient.d.ts.map +1 -0
- package/dist/module/GoTrueClient.js +1883 -0
- package/dist/module/GoTrueClient.js.map +1 -0
- package/dist/module/index.d.ts +9 -0
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +9 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/lib/constants.d.ts +12 -0
- package/dist/module/lib/constants.d.ts.map +1 -0
- package/dist/module/lib/constants.js +11 -0
- package/dist/module/lib/constants.js.map +1 -0
- package/dist/module/lib/errors.d.ts +96 -0
- package/dist/module/lib/errors.d.ts.map +1 -0
- package/dist/module/lib/errors.js +117 -0
- package/dist/module/lib/errors.js.map +1 -0
- package/dist/module/lib/fetch.d.ts +33 -0
- package/dist/module/lib/fetch.d.ts.map +1 -0
- package/dist/module/lib/fetch.js +152 -0
- package/dist/module/lib/fetch.js.map +1 -0
- package/dist/module/lib/helpers.d.ts +48 -0
- package/dist/module/lib/helpers.d.ts.map +1 -0
- package/dist/module/lib/helpers.js +249 -0
- package/dist/module/lib/helpers.js.map +1 -0
- package/dist/module/lib/local-storage.d.ts +13 -0
- package/dist/module/lib/local-storage.d.ts.map +1 -0
- package/dist/module/lib/local-storage.js +42 -0
- package/dist/module/lib/local-storage.js.map +1 -0
- package/dist/module/lib/locks.d.ts +44 -0
- package/dist/module/lib/locks.d.ts.map +1 -0
- package/dist/module/lib/locks.js +112 -0
- package/dist/module/lib/locks.js.map +1 -0
- package/dist/module/lib/polyfills.d.ts +5 -0
- package/dist/module/lib/polyfills.d.ts.map +1 -0
- package/dist/module/lib/polyfills.js +26 -0
- package/dist/module/lib/polyfills.js.map +1 -0
- package/dist/module/lib/types.d.ts +948 -0
- package/dist/module/lib/types.d.ts.map +1 -0
- package/dist/module/lib/types.js +2 -0
- package/dist/module/lib/types.js.map +1 -0
- package/dist/module/lib/version.d.ts +2 -0
- package/dist/module/lib/version.d.ts.map +1 -0
- package/dist/module/lib/version.js +3 -0
- package/dist/module/lib/version.js.map +1 -0
- package/package.json +69 -0
- package/src/AuthAdminApi.ts +5 -0
- package/src/AuthClient.ts +5 -0
- package/src/GoTrueAdminApi.ts +333 -0
- package/src/GoTrueClient.ts +2470 -0
- package/src/index.ts +12 -0
- package/src/lib/constants.ts +10 -0
- package/src/lib/errors.ts +150 -0
- package/src/lib/fetch.ts +238 -0
- package/src/lib/helpers.ts +306 -0
- package/src/lib/local-storage.ts +49 -0
- package/src/lib/locks.ts +140 -0
- package/src/lib/polyfills.ts +23 -0
- package/src/lib/types.ts +1120 -0
- package/src/lib/version.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Supabase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# `auth-js`
|
|
2
|
+
|
|
3
|
+
An isomorphic JavaScript client library for the [Supabase Auth](https://github.com/supabase/auth) API.
|
|
4
|
+
|
|
5
|
+
## Docs
|
|
6
|
+
|
|
7
|
+
- Using `auth-js`: https://supabase.com/docs/reference/javascript/auth-signup
|
|
8
|
+
- TypeDoc: https://supabase.github.io/auth-js/v2
|
|
9
|
+
|
|
10
|
+
## Quick start
|
|
11
|
+
|
|
12
|
+
Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install --save @supabase/auth-js
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Usage
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { AuthClient } from '@supabase/auth-js'
|
|
22
|
+
|
|
23
|
+
const GOTRUE_URL = 'http://localhost:9999'
|
|
24
|
+
|
|
25
|
+
const auth = new AuthClient({ url: GOTRUE_URL })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- `signUp()`: https://supabase.io/docs/reference/javascript/auth-signup
|
|
29
|
+
- `signIn()`: https://supabase.io/docs/reference/javascript/auth-signin
|
|
30
|
+
- `signOut()`: https://supabase.io/docs/reference/javascript/auth-signout
|
|
31
|
+
|
|
32
|
+
### Custom `fetch` implementation
|
|
33
|
+
|
|
34
|
+
`auth-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests, but an alternative `fetch` implementation can be provided as an option. This is most useful in environments where `cross-fetch` is not compatible, for instance Cloudflare Workers:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import { AuthClient } from '@supabase/auth-js'
|
|
38
|
+
|
|
39
|
+
const AUTH_URL = 'http://localhost:9999'
|
|
40
|
+
|
|
41
|
+
const auth = new AuthClient({ url: AUTH_URL, fetch: fetch })
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Sponsors
|
|
45
|
+
|
|
46
|
+
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves.
|
|
47
|
+
|
|
48
|
+
[](https://github.com/sponsors/supabase)
|
|
49
|
+
|
|
50
|
+

|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthAdminApi.d.ts","sourceRoot":"","sources":["../../src/AuthAdminApi.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,QAAA,MAAM,YAAY,uBAAiB,CAAA;AAEnC,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const GoTrueAdminApi_1 = __importDefault(require("./GoTrueAdminApi"));
|
|
7
|
+
const AuthAdminApi = GoTrueAdminApi_1.default;
|
|
8
|
+
exports.default = AuthAdminApi;
|
|
9
|
+
//# sourceMappingURL=AuthAdminApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthAdminApi.js","sourceRoot":"","sources":["../../src/AuthAdminApi.ts"],"names":[],"mappings":";;;;;AAAA,sEAA6C;AAE7C,MAAM,YAAY,GAAG,wBAAc,CAAA;AAEnC,kBAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthClient.d.ts","sourceRoot":"","sources":["../../src/AuthClient.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,QAAA,MAAM,UAAU,qBAAe,CAAA;AAE/B,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const GoTrueClient_1 = __importDefault(require("./GoTrueClient"));
|
|
7
|
+
const AuthClient = GoTrueClient_1.default;
|
|
8
|
+
exports.default = AuthClient;
|
|
9
|
+
//# sourceMappingURL=AuthClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthClient.js","sourceRoot":"","sources":["../../src/AuthClient.ts"],"names":[],"mappings":";;;;;AAAA,kEAAyC;AAEzC,MAAM,UAAU,GAAG,sBAAY,CAAA;AAE/B,kBAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Fetch } from './lib/fetch';
|
|
2
|
+
import { AdminUserAttributes, GenerateLinkParams, GenerateLinkResponse, Pagination, User, UserResponse, GoTrueAdminMFAApi, PageParams } from './lib/types';
|
|
3
|
+
import { AuthError } from './lib/errors';
|
|
4
|
+
export default class GoTrueAdminApi {
|
|
5
|
+
/** Contains all MFA administration methods. */
|
|
6
|
+
mfa: GoTrueAdminMFAApi;
|
|
7
|
+
protected url: string;
|
|
8
|
+
protected headers: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
protected fetch: Fetch;
|
|
12
|
+
constructor({ url, headers, fetch, }: {
|
|
13
|
+
url: string;
|
|
14
|
+
headers?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
fetch?: Fetch;
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Removes a logged-in session.
|
|
21
|
+
* @param jwt A valid, logged-in JWT.
|
|
22
|
+
* @param scope The logout sope.
|
|
23
|
+
*/
|
|
24
|
+
signOut(jwt: string, scope?: 'global' | 'local' | 'others'): Promise<{
|
|
25
|
+
data: null;
|
|
26
|
+
error: AuthError | null;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Sends an invite link to an email address.
|
|
30
|
+
* @param email The email address of the user.
|
|
31
|
+
* @param options Additional options to be included when inviting.
|
|
32
|
+
*/
|
|
33
|
+
inviteUserByEmail(email: string, options?: {
|
|
34
|
+
/** A custom data object to store additional metadata about the user. This maps to the `auth.users.user_metadata` column. */
|
|
35
|
+
data?: object;
|
|
36
|
+
/** The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL. */
|
|
37
|
+
redirectTo?: string;
|
|
38
|
+
}): Promise<UserResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Generates email links and OTPs to be sent via a custom email provider.
|
|
41
|
+
* @param email The user's email.
|
|
42
|
+
* @param options.password User password. For signup only.
|
|
43
|
+
* @param options.data Optional user metadata. For signup only.
|
|
44
|
+
* @param options.redirectTo The redirect url which should be appended to the generated link
|
|
45
|
+
*/
|
|
46
|
+
generateLink(params: GenerateLinkParams): Promise<GenerateLinkResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new user.
|
|
49
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
50
|
+
*/
|
|
51
|
+
createUser(attributes: AdminUserAttributes): Promise<UserResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Get a list of users.
|
|
54
|
+
*
|
|
55
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
56
|
+
* @param params An object which supports `page` and `perPage` as numbers, to alter the paginated results.
|
|
57
|
+
*/
|
|
58
|
+
listUsers(params?: PageParams): Promise<{
|
|
59
|
+
data: {
|
|
60
|
+
users: User[];
|
|
61
|
+
aud: string;
|
|
62
|
+
} & Pagination;
|
|
63
|
+
error: null;
|
|
64
|
+
} | {
|
|
65
|
+
data: {
|
|
66
|
+
users: [];
|
|
67
|
+
};
|
|
68
|
+
error: AuthError;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Get user by id.
|
|
72
|
+
*
|
|
73
|
+
* @param uid The user's unique identifier
|
|
74
|
+
*
|
|
75
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
76
|
+
*/
|
|
77
|
+
getUserById(uid: string): Promise<UserResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Updates the user data.
|
|
80
|
+
*
|
|
81
|
+
* @param attributes The data you want to update.
|
|
82
|
+
*
|
|
83
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
84
|
+
*/
|
|
85
|
+
updateUserById(uid: string, attributes: AdminUserAttributes): Promise<UserResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Delete a user. Requires a `service_role` key.
|
|
88
|
+
*
|
|
89
|
+
* @param id The user id you want to remove.
|
|
90
|
+
* @param shouldSoftDelete If true, then the user will be soft-deleted from the auth schema.
|
|
91
|
+
* Defaults to false for backward compatibility.
|
|
92
|
+
*
|
|
93
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
94
|
+
*/
|
|
95
|
+
deleteUser(id: string, shouldSoftDelete?: boolean): Promise<UserResponse>;
|
|
96
|
+
private _listFactors;
|
|
97
|
+
private _deleteFactor;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=GoTrueAdminApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoTrueAdminApi.d.ts","sourceRoot":"","sources":["../../src/GoTrueAdminApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAKN,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,iBAAiB,EAKjB,UAAU,EACX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,SAAS,EAAe,MAAM,cAAc,CAAA;AAErD,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,+CAA+C;IAC/C,GAAG,EAAE,iBAAiB,CAAA;IAEtB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,OAAO,EAAE;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,SAAS,CAAC,KAAK,EAAE,KAAK,CAAA;gBAEV,EACV,GAAQ,EACR,OAAY,EACZ,KAAK,GACN,EAAE;QACD,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE;YACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SACtB,CAAA;QACD,KAAK,CAAC,EAAE,KAAK,CAAA;KACd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YAyBZ,aAAa;CAsB5B"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const fetch_1 = require("./lib/fetch");
|
|
15
|
+
const helpers_1 = require("./lib/helpers");
|
|
16
|
+
const errors_1 = require("./lib/errors");
|
|
17
|
+
class GoTrueAdminApi {
|
|
18
|
+
constructor({ url = '', headers = {}, fetch, }) {
|
|
19
|
+
this.url = url;
|
|
20
|
+
this.headers = headers;
|
|
21
|
+
this.fetch = (0, helpers_1.resolveFetch)(fetch);
|
|
22
|
+
this.mfa = {
|
|
23
|
+
listFactors: this._listFactors.bind(this),
|
|
24
|
+
deleteFactor: this._deleteFactor.bind(this),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Removes a logged-in session.
|
|
29
|
+
* @param jwt A valid, logged-in JWT.
|
|
30
|
+
* @param scope The logout sope.
|
|
31
|
+
*/
|
|
32
|
+
async signOut(jwt, scope = 'global') {
|
|
33
|
+
try {
|
|
34
|
+
await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/logout?scope=${scope}`, {
|
|
35
|
+
headers: this.headers,
|
|
36
|
+
jwt,
|
|
37
|
+
noResolveJson: true,
|
|
38
|
+
});
|
|
39
|
+
return { data: null, error: null };
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
43
|
+
return { data: null, error };
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Sends an invite link to an email address.
|
|
50
|
+
* @param email The email address of the user.
|
|
51
|
+
* @param options Additional options to be included when inviting.
|
|
52
|
+
*/
|
|
53
|
+
async inviteUserByEmail(email, options = {}) {
|
|
54
|
+
try {
|
|
55
|
+
return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/invite`, {
|
|
56
|
+
body: { email, data: options.data },
|
|
57
|
+
headers: this.headers,
|
|
58
|
+
redirectTo: options.redirectTo,
|
|
59
|
+
xform: fetch_1._userResponse,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
64
|
+
return { data: { user: null }, error };
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generates email links and OTPs to be sent via a custom email provider.
|
|
71
|
+
* @param email The user's email.
|
|
72
|
+
* @param options.password User password. For signup only.
|
|
73
|
+
* @param options.data Optional user metadata. For signup only.
|
|
74
|
+
* @param options.redirectTo The redirect url which should be appended to the generated link
|
|
75
|
+
*/
|
|
76
|
+
async generateLink(params) {
|
|
77
|
+
try {
|
|
78
|
+
const { options } = params, rest = __rest(params, ["options"]);
|
|
79
|
+
const body = Object.assign(Object.assign({}, rest), options);
|
|
80
|
+
if ('newEmail' in rest) {
|
|
81
|
+
// replace newEmail with new_email in request body
|
|
82
|
+
body.new_email = rest === null || rest === void 0 ? void 0 : rest.newEmail;
|
|
83
|
+
delete body['newEmail'];
|
|
84
|
+
}
|
|
85
|
+
return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/generate_link`, {
|
|
86
|
+
body: body,
|
|
87
|
+
headers: this.headers,
|
|
88
|
+
xform: fetch_1._generateLinkResponse,
|
|
89
|
+
redirectTo: options === null || options === void 0 ? void 0 : options.redirectTo,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
94
|
+
return {
|
|
95
|
+
data: {
|
|
96
|
+
properties: null,
|
|
97
|
+
user: null,
|
|
98
|
+
},
|
|
99
|
+
error,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// User Admin API
|
|
106
|
+
/**
|
|
107
|
+
* Creates a new user.
|
|
108
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
109
|
+
*/
|
|
110
|
+
async createUser(attributes) {
|
|
111
|
+
try {
|
|
112
|
+
return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/users`, {
|
|
113
|
+
body: attributes,
|
|
114
|
+
headers: this.headers,
|
|
115
|
+
xform: fetch_1._userResponse,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
120
|
+
return { data: { user: null }, error };
|
|
121
|
+
}
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get a list of users.
|
|
127
|
+
*
|
|
128
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
129
|
+
* @param params An object which supports `page` and `perPage` as numbers, to alter the paginated results.
|
|
130
|
+
*/
|
|
131
|
+
async listUsers(params) {
|
|
132
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
133
|
+
try {
|
|
134
|
+
const pagination = { nextPage: null, lastPage: 0, total: 0 };
|
|
135
|
+
const response = await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users`, {
|
|
136
|
+
headers: this.headers,
|
|
137
|
+
noResolveJson: true,
|
|
138
|
+
query: {
|
|
139
|
+
page: (_b = (_a = params === null || params === void 0 ? void 0 : params.page) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
|
|
140
|
+
per_page: (_d = (_c = params === null || params === void 0 ? void 0 : params.perPage) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '',
|
|
141
|
+
},
|
|
142
|
+
xform: fetch_1._noResolveJsonResponse,
|
|
143
|
+
});
|
|
144
|
+
if (response.error)
|
|
145
|
+
throw response.error;
|
|
146
|
+
const users = await response.json();
|
|
147
|
+
const total = (_e = response.headers.get('x-total-count')) !== null && _e !== void 0 ? _e : 0;
|
|
148
|
+
const links = (_g = (_f = response.headers.get('link')) === null || _f === void 0 ? void 0 : _f.split(',')) !== null && _g !== void 0 ? _g : [];
|
|
149
|
+
if (links.length > 0) {
|
|
150
|
+
links.forEach((link) => {
|
|
151
|
+
const page = parseInt(link.split(';')[0].split('=')[1].substring(0, 1));
|
|
152
|
+
const rel = JSON.parse(link.split(';')[1].split('=')[1]);
|
|
153
|
+
pagination[`${rel}Page`] = page;
|
|
154
|
+
});
|
|
155
|
+
pagination.total = parseInt(total);
|
|
156
|
+
}
|
|
157
|
+
return { data: Object.assign(Object.assign({}, users), pagination), error: null };
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
161
|
+
return { data: { users: [] }, error };
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get user by id.
|
|
168
|
+
*
|
|
169
|
+
* @param uid The user's unique identifier
|
|
170
|
+
*
|
|
171
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
172
|
+
*/
|
|
173
|
+
async getUserById(uid) {
|
|
174
|
+
try {
|
|
175
|
+
return await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users/${uid}`, {
|
|
176
|
+
headers: this.headers,
|
|
177
|
+
xform: fetch_1._userResponse,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
182
|
+
return { data: { user: null }, error };
|
|
183
|
+
}
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Updates the user data.
|
|
189
|
+
*
|
|
190
|
+
* @param attributes The data you want to update.
|
|
191
|
+
*
|
|
192
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
193
|
+
*/
|
|
194
|
+
async updateUserById(uid, attributes) {
|
|
195
|
+
try {
|
|
196
|
+
return await (0, fetch_1._request)(this.fetch, 'PUT', `${this.url}/admin/users/${uid}`, {
|
|
197
|
+
body: attributes,
|
|
198
|
+
headers: this.headers,
|
|
199
|
+
xform: fetch_1._userResponse,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
204
|
+
return { data: { user: null }, error };
|
|
205
|
+
}
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Delete a user. Requires a `service_role` key.
|
|
211
|
+
*
|
|
212
|
+
* @param id The user id you want to remove.
|
|
213
|
+
* @param shouldSoftDelete If true, then the user will be soft-deleted from the auth schema.
|
|
214
|
+
* Defaults to false for backward compatibility.
|
|
215
|
+
*
|
|
216
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
217
|
+
*/
|
|
218
|
+
async deleteUser(id, shouldSoftDelete = false) {
|
|
219
|
+
try {
|
|
220
|
+
return await (0, fetch_1._request)(this.fetch, 'DELETE', `${this.url}/admin/users/${id}`, {
|
|
221
|
+
headers: this.headers,
|
|
222
|
+
body: {
|
|
223
|
+
should_soft_delete: shouldSoftDelete,
|
|
224
|
+
},
|
|
225
|
+
xform: fetch_1._userResponse,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
230
|
+
return { data: { user: null }, error };
|
|
231
|
+
}
|
|
232
|
+
throw error;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async _listFactors(params) {
|
|
236
|
+
try {
|
|
237
|
+
const { data, error } = await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users/${params.userId}/factors`, {
|
|
238
|
+
headers: this.headers,
|
|
239
|
+
xform: (factors) => {
|
|
240
|
+
return { data: { factors }, error: null };
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
return { data, error };
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
247
|
+
return { data: null, error };
|
|
248
|
+
}
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
async _deleteFactor(params) {
|
|
253
|
+
try {
|
|
254
|
+
const data = await (0, fetch_1._request)(this.fetch, 'DELETE', `${this.url}/admin/users/${params.userId}/factors/${params.id}`, {
|
|
255
|
+
headers: this.headers,
|
|
256
|
+
});
|
|
257
|
+
return { data, error: null };
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
if ((0, errors_1.isAuthError)(error)) {
|
|
261
|
+
return { data: null, error };
|
|
262
|
+
}
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.default = GoTrueAdminApi;
|
|
268
|
+
//# sourceMappingURL=GoTrueAdminApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoTrueAdminApi.js","sourceRoot":"","sources":["../../src/GoTrueAdminApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,uCAMoB;AACpB,2CAA4C;AAe5C,yCAAqD;AAErD,MAAqB,cAAc;IAUj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