@supabase/auth-js 2.58.1-canary.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.
Files changed (192) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -0
  3. package/dist/main/AuthAdminApi.d.ts +4 -0
  4. package/dist/main/AuthAdminApi.d.ts.map +1 -0
  5. package/dist/main/AuthAdminApi.js +9 -0
  6. package/dist/main/AuthAdminApi.js.map +1 -0
  7. package/dist/main/AuthClient.d.ts +4 -0
  8. package/dist/main/AuthClient.d.ts.map +1 -0
  9. package/dist/main/AuthClient.js +9 -0
  10. package/dist/main/AuthClient.js.map +1 -0
  11. package/dist/main/GoTrueAdminApi.d.ts +99 -0
  12. package/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  13. package/dist/main/GoTrueAdminApi.js +278 -0
  14. package/dist/main/GoTrueAdminApi.js.map +1 -0
  15. package/dist/main/GoTrueClient.d.ts +531 -0
  16. package/dist/main/GoTrueClient.d.ts.map +1 -0
  17. package/dist/main/GoTrueClient.js +2564 -0
  18. package/dist/main/GoTrueClient.js.map +1 -0
  19. package/dist/main/index.d.ts +9 -0
  20. package/dist/main/index.d.ts.map +1 -0
  21. package/dist/main/index.js +36 -0
  22. package/dist/main/index.js.map +1 -0
  23. package/dist/main/lib/base64url.d.ts +76 -0
  24. package/dist/main/lib/base64url.d.ts.map +1 -0
  25. package/dist/main/lib/base64url.js +269 -0
  26. package/dist/main/lib/base64url.js.map +1 -0
  27. package/dist/main/lib/constants.d.ts +26 -0
  28. package/dist/main/lib/constants.d.ts.map +1 -0
  29. package/dist/main/lib/constants.js +31 -0
  30. package/dist/main/lib/constants.js.map +1 -0
  31. package/dist/main/lib/error-codes.d.ts +7 -0
  32. package/dist/main/lib/error-codes.d.ts.map +1 -0
  33. package/dist/main/lib/error-codes.js +3 -0
  34. package/dist/main/lib/error-codes.js.map +1 -0
  35. package/dist/main/lib/errors.d.ts +100 -0
  36. package/dist/main/lib/errors.d.ts.map +1 -0
  37. package/dist/main/lib/errors.js +137 -0
  38. package/dist/main/lib/errors.js.map +1 -0
  39. package/dist/main/lib/fetch.d.ts +34 -0
  40. package/dist/main/lib/fetch.d.ts.map +1 -0
  41. package/dist/main/lib/fetch.js +194 -0
  42. package/dist/main/lib/fetch.js.map +1 -0
  43. package/dist/main/lib/helpers.d.ts +67 -0
  44. package/dist/main/lib/helpers.d.ts.map +1 -0
  45. package/dist/main/lib/helpers.js +388 -0
  46. package/dist/main/lib/helpers.js.map +1 -0
  47. package/dist/main/lib/local-storage.d.ts +9 -0
  48. package/dist/main/lib/local-storage.d.ts.map +1 -0
  49. package/dist/main/lib/local-storage.js +21 -0
  50. package/dist/main/lib/local-storage.js.map +1 -0
  51. package/dist/main/lib/locks.d.ts +64 -0
  52. package/dist/main/lib/locks.d.ts.map +1 -0
  53. package/dist/main/lib/locks.js +187 -0
  54. package/dist/main/lib/locks.js.map +1 -0
  55. package/dist/main/lib/polyfills.d.ts +5 -0
  56. package/dist/main/lib/polyfills.d.ts.map +1 -0
  57. package/dist/main/lib/polyfills.js +29 -0
  58. package/dist/main/lib/polyfills.js.map +1 -0
  59. package/dist/main/lib/types.d.ts +1130 -0
  60. package/dist/main/lib/types.d.ts.map +1 -0
  61. package/dist/main/lib/types.js +22 -0
  62. package/dist/main/lib/types.js.map +1 -0
  63. package/dist/main/lib/version.d.ts +2 -0
  64. package/dist/main/lib/version.d.ts.map +1 -0
  65. package/dist/main/lib/version.js +11 -0
  66. package/dist/main/lib/version.js.map +1 -0
  67. package/dist/main/lib/web3/ethereum.d.ts +96 -0
  68. package/dist/main/lib/web3/ethereum.d.ts.map +1 -0
  69. package/dist/main/lib/web3/ethereum.js +66 -0
  70. package/dist/main/lib/web3/ethereum.js.map +1 -0
  71. package/dist/main/lib/web3/solana.d.ts +160 -0
  72. package/dist/main/lib/web3/solana.d.ts.map +1 -0
  73. package/dist/main/lib/web3/solana.js +4 -0
  74. package/dist/main/lib/web3/solana.js.map +1 -0
  75. package/dist/main/lib/webauthn.d.ts +274 -0
  76. package/dist/main/lib/webauthn.d.ts.map +1 -0
  77. package/dist/main/lib/webauthn.dom.d.ts +583 -0
  78. package/dist/main/lib/webauthn.dom.d.ts.map +1 -0
  79. package/dist/main/lib/webauthn.dom.js +4 -0
  80. package/dist/main/lib/webauthn.dom.js.map +1 -0
  81. package/dist/main/lib/webauthn.errors.d.ts +80 -0
  82. package/dist/main/lib/webauthn.errors.d.ts.map +1 -0
  83. package/dist/main/lib/webauthn.errors.js +265 -0
  84. package/dist/main/lib/webauthn.errors.js.map +1 -0
  85. package/dist/main/lib/webauthn.js +702 -0
  86. package/dist/main/lib/webauthn.js.map +1 -0
  87. package/dist/module/AuthAdminApi.d.ts +4 -0
  88. package/dist/module/AuthAdminApi.d.ts.map +1 -0
  89. package/dist/module/AuthAdminApi.js +4 -0
  90. package/dist/module/AuthAdminApi.js.map +1 -0
  91. package/dist/module/AuthClient.d.ts +4 -0
  92. package/dist/module/AuthClient.d.ts.map +1 -0
  93. package/dist/module/AuthClient.js +4 -0
  94. package/dist/module/AuthClient.js.map +1 -0
  95. package/dist/module/GoTrueAdminApi.d.ts +99 -0
  96. package/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  97. package/dist/module/GoTrueAdminApi.js +275 -0
  98. package/dist/module/GoTrueAdminApi.js.map +1 -0
  99. package/dist/module/GoTrueClient.d.ts +531 -0
  100. package/dist/module/GoTrueClient.d.ts.map +1 -0
  101. package/dist/module/GoTrueClient.js +2559 -0
  102. package/dist/module/GoTrueClient.js.map +1 -0
  103. package/dist/module/index.d.ts +9 -0
  104. package/dist/module/index.d.ts.map +1 -0
  105. package/dist/module/index.js +9 -0
  106. package/dist/module/index.js.map +1 -0
  107. package/dist/module/lib/base64url.d.ts +76 -0
  108. package/dist/module/lib/base64url.d.ts.map +1 -0
  109. package/dist/module/lib/base64url.js +257 -0
  110. package/dist/module/lib/base64url.js.map +1 -0
  111. package/dist/module/lib/constants.d.ts +26 -0
  112. package/dist/module/lib/constants.d.ts.map +1 -0
  113. package/dist/module/lib/constants.js +28 -0
  114. package/dist/module/lib/constants.js.map +1 -0
  115. package/dist/module/lib/error-codes.d.ts +7 -0
  116. package/dist/module/lib/error-codes.d.ts.map +1 -0
  117. package/dist/module/lib/error-codes.js +2 -0
  118. package/dist/module/lib/error-codes.js.map +1 -0
  119. package/dist/module/lib/errors.d.ts +100 -0
  120. package/dist/module/lib/errors.d.ts.map +1 -0
  121. package/dist/module/lib/errors.js +116 -0
  122. package/dist/module/lib/errors.js.map +1 -0
  123. package/dist/module/lib/fetch.d.ts +34 -0
  124. package/dist/module/lib/fetch.d.ts.map +1 -0
  125. package/dist/module/lib/fetch.js +184 -0
  126. package/dist/module/lib/fetch.js.map +1 -0
  127. package/dist/module/lib/helpers.d.ts +67 -0
  128. package/dist/module/lib/helpers.d.ts.map +1 -0
  129. package/dist/module/lib/helpers.js +329 -0
  130. package/dist/module/lib/helpers.js.map +1 -0
  131. package/dist/module/lib/local-storage.d.ts +9 -0
  132. package/dist/module/lib/local-storage.d.ts.map +1 -0
  133. package/dist/module/lib/local-storage.js +18 -0
  134. package/dist/module/lib/local-storage.js.map +1 -0
  135. package/dist/module/lib/locks.d.ts +64 -0
  136. package/dist/module/lib/locks.d.ts.map +1 -0
  137. package/dist/module/lib/locks.js +179 -0
  138. package/dist/module/lib/locks.js.map +1 -0
  139. package/dist/module/lib/polyfills.d.ts +5 -0
  140. package/dist/module/lib/polyfills.d.ts.map +1 -0
  141. package/dist/module/lib/polyfills.js +26 -0
  142. package/dist/module/lib/polyfills.js.map +1 -0
  143. package/dist/module/lib/types.d.ts +1130 -0
  144. package/dist/module/lib/types.d.ts.map +1 -0
  145. package/dist/module/lib/types.js +19 -0
  146. package/dist/module/lib/types.js.map +1 -0
  147. package/dist/module/lib/version.d.ts +2 -0
  148. package/dist/module/lib/version.d.ts.map +1 -0
  149. package/dist/module/lib/version.js +8 -0
  150. package/dist/module/lib/version.js.map +1 -0
  151. package/dist/module/lib/web3/ethereum.d.ts +96 -0
  152. package/dist/module/lib/web3/ethereum.d.ts.map +1 -0
  153. package/dist/module/lib/web3/ethereum.js +60 -0
  154. package/dist/module/lib/web3/ethereum.js.map +1 -0
  155. package/dist/module/lib/web3/solana.d.ts +160 -0
  156. package/dist/module/lib/web3/solana.d.ts.map +1 -0
  157. package/dist/module/lib/web3/solana.js +3 -0
  158. package/dist/module/lib/web3/solana.js.map +1 -0
  159. package/dist/module/lib/webauthn.d.ts +274 -0
  160. package/dist/module/lib/webauthn.d.ts.map +1 -0
  161. package/dist/module/lib/webauthn.dom.d.ts +583 -0
  162. package/dist/module/lib/webauthn.dom.d.ts.map +1 -0
  163. package/dist/module/lib/webauthn.dom.js +3 -0
  164. package/dist/module/lib/webauthn.dom.js.map +1 -0
  165. package/dist/module/lib/webauthn.errors.d.ts +80 -0
  166. package/dist/module/lib/webauthn.errors.d.ts.map +1 -0
  167. package/dist/module/lib/webauthn.errors.js +257 -0
  168. package/dist/module/lib/webauthn.errors.js.map +1 -0
  169. package/dist/module/lib/webauthn.js +685 -0
  170. package/dist/module/lib/webauthn.js.map +1 -0
  171. package/package.json +49 -0
  172. package/src/AuthAdminApi.ts +5 -0
  173. package/src/AuthClient.ts +5 -0
  174. package/src/GoTrueAdminApi.ts +352 -0
  175. package/src/GoTrueClient.ts +3483 -0
  176. package/src/index.ts +13 -0
  177. package/src/lib/base64url.ts +308 -0
  178. package/src/lib/constants.ts +34 -0
  179. package/src/lib/error-codes.ts +90 -0
  180. package/src/lib/errors.ts +165 -0
  181. package/src/lib/fetch.ts +283 -0
  182. package/src/lib/helpers.ts +416 -0
  183. package/src/lib/local-storage.ts +21 -0
  184. package/src/lib/locks.ts +225 -0
  185. package/src/lib/polyfills.ts +23 -0
  186. package/src/lib/types.ts +1450 -0
  187. package/src/lib/version.ts +7 -0
  188. package/src/lib/web3/ethereum.ts +184 -0
  189. package/src/lib/web3/solana.ts +186 -0
  190. package/src/lib/webauthn.dom.ts +636 -0
  191. package/src/lib/webauthn.errors.ts +317 -0
  192. package/src/lib/webauthn.ts +929 -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,148 @@
1
+ # `auth-js`
2
+
3
+ An isomorphic JavaScript client library for the [Supabase Auth](https://github.com/supabase/auth) API.
4
+
5
+ <div align="center">
6
+
7
+ [![pkg.pr.new](https://pkg.pr.new/badge/supabase/auth-js)](https://pkg.pr.new/~/supabase/auth-js)
8
+
9
+ </div>
10
+
11
+ ## Docs
12
+
13
+ - Using `auth-js`: https://supabase.com/docs/reference/javascript/auth-signup
14
+ - TypeDoc: https://supabase.github.io/auth-js/v2
15
+
16
+ ## Quick start
17
+
18
+ Install
19
+
20
+ ```bash
21
+ npm install --save @supabase/auth-js
22
+ ```
23
+
24
+ Usage
25
+
26
+ ```js
27
+ import { AuthClient } from '@supabase/auth-js'
28
+
29
+ const GOTRUE_URL = 'http://localhost:9999'
30
+
31
+ const auth = new AuthClient({ url: GOTRUE_URL })
32
+ ```
33
+
34
+ - `signUp()`: https://supabase.io/docs/reference/javascript/auth-signup
35
+ - `signIn()`: https://supabase.io/docs/reference/javascript/auth-signin
36
+ - `signOut()`: https://supabase.io/docs/reference/javascript/auth-signout
37
+
38
+ ### Custom `fetch` implementation
39
+
40
+ `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:
41
+
42
+ ```js
43
+ import { AuthClient } from '@supabase/auth-js'
44
+
45
+ const AUTH_URL = 'http://localhost:9999'
46
+
47
+ const auth = new AuthClient({ url: AUTH_URL, fetch: fetch })
48
+ ```
49
+
50
+ ## Development
51
+
52
+ This package is part of the [Supabase JavaScript monorepo](https://github.com/supabase/supabase-js). To work on this package:
53
+
54
+ ### Building
55
+
56
+ ```bash
57
+ # Complete build (from monorepo root)
58
+ npx nx build auth-js
59
+
60
+ # Build with watch mode for development
61
+ npx nx build auth-js --watch
62
+
63
+ # Individual build targets
64
+ npx nx build:main auth-js # CommonJS build (dist/main/)
65
+ npx nx build:module auth-js # ES Modules build (dist/module/)
66
+
67
+ # Other useful commands
68
+ npx nx clean auth-js # Clean build artifacts
69
+ npx nx format auth-js # Format code with Prettier
70
+ npx nx lint auth-js # Run ESLint
71
+ npx nx typecheck auth-js # TypeScript type checking
72
+ npx nx docs auth-js # Generate documentation
73
+ ```
74
+
75
+ #### Build Outputs
76
+
77
+ - **CommonJS (`dist/main/`)** - For Node.js environments
78
+ - **ES Modules (`dist/module/`)** - For modern bundlers (Webpack, Vite, Rollup)
79
+ - **TypeScript definitions (`dist/module/index.d.ts`)** - Type definitions for TypeScript projects
80
+
81
+ ### Testing
82
+
83
+ **Docker Required!** The auth-js tests require a local Supabase Auth server (GoTrue) running in Docker.
84
+
85
+ ```bash
86
+ # Run complete test suite (from monorepo root)
87
+ npx nx test:auth auth-js
88
+ ```
89
+
90
+ This command automatically:
91
+
92
+ 1. Stops any existing test containers
93
+ 2. Starts a Supabase Auth server (GoTrue) and PostgreSQL database in Docker
94
+ 3. Waits for services to be ready (30 seconds)
95
+ 4. Runs the test suite
96
+ 5. Cleans up Docker containers after tests complete
97
+
98
+ #### Individual Test Commands
99
+
100
+ ```bash
101
+ # Run just the test suite (requires infrastructure to be running)
102
+ npx nx test:suite auth-js
103
+
104
+ # Manually manage test infrastructure
105
+ npx nx test:infra auth-js # Start Docker containers
106
+ npx nx test:clean auth-js # Stop and remove containers
107
+ ```
108
+
109
+ #### Development Testing
110
+
111
+ For actively developing and debugging tests:
112
+
113
+ ```bash
114
+ # Start infrastructure once
115
+ npx nx test:infra auth-js
116
+
117
+ # Run tests multiple times (faster since containers stay up)
118
+ npx nx test:suite auth-js
119
+
120
+ # Clean up when done
121
+ npx nx test:clean auth-js
122
+ ```
123
+
124
+ #### Test Infrastructure
125
+
126
+ The Docker setup includes:
127
+
128
+ - **Supabase Auth (GoTrue)** - The authentication server
129
+ - **PostgreSQL** - Database for auth data
130
+ - Pre-configured with test users and settings
131
+
132
+ #### Prerequisites
133
+
134
+ - **Docker** must be installed and running
135
+ - Ports used by test infrastructure (check `infra/docker-compose.yml`)
136
+ - No full Supabase instance needed - just the Auth server
137
+
138
+ ### Contributing
139
+
140
+ We welcome contributions! Please see our [Contributing Guide](../../../docs/CONTRIBUTING.md) for details on how to get started.
141
+
142
+ For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
143
+
144
+ ## Sponsors
145
+
146
+ 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.
147
+
148
+ [![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)
@@ -0,0 +1,4 @@
1
+ import GoTrueAdminApi from './GoTrueAdminApi';
2
+ declare const AuthAdminApi: typeof GoTrueAdminApi;
3
+ export default AuthAdminApi;
4
+ //# sourceMappingURL=AuthAdminApi.d.ts.map
@@ -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,4 @@
1
+ import GoTrueClient from './GoTrueClient';
2
+ declare const AuthClient: typeof GoTrueClient;
3
+ export default AuthClient;
4
+ //# sourceMappingURL=AuthClient.d.ts.map
@@ -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, SignOutScope } 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?: SignOutScope): 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. Soft deletion allows user identification from the hashed user ID but is not reversible.
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/GoT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UAAU,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAgBxE;;;;;OAKG;IACG,SAAS,CACb,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CACN;QAAE,IAAI,EAAE;YAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,GAAG,UAAU,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,GAClE;QAAE,IAAI,EAAE;YAAE,KAAK,EAAE,EAAE,CAAA;SAAE,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAC5C;IAmCD;;;;;;OAMG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAiBrD;;;;;;OAMG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBzF;;;;;;;;OAQG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,UAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;YAoB/D,YAAY;YA2BZ,aAAa;CAyB5B"}
@@ -0,0 +1,278 @@
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 types_1 = require("./lib/types");
17
+ const errors_1 = require("./lib/errors");
18
+ class GoTrueAdminApi {
19
+ constructor({ url = '', headers = {}, fetch, }) {
20
+ this.url = url;
21
+ this.headers = headers;
22
+ this.fetch = (0, helpers_1.resolveFetch)(fetch);
23
+ this.mfa = {
24
+ listFactors: this._listFactors.bind(this),
25
+ deleteFactor: this._deleteFactor.bind(this),
26
+ };
27
+ }
28
+ /**
29
+ * Removes a logged-in session.
30
+ * @param jwt A valid, logged-in JWT.
31
+ * @param scope The logout sope.
32
+ */
33
+ async signOut(jwt, scope = types_1.SIGN_OUT_SCOPES[0]) {
34
+ if (types_1.SIGN_OUT_SCOPES.indexOf(scope) < 0) {
35
+ throw new Error(`@supabase/auth-js: Parameter scope must be one of ${types_1.SIGN_OUT_SCOPES.join(', ')}`);
36
+ }
37
+ try {
38
+ await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/logout?scope=${scope}`, {
39
+ headers: this.headers,
40
+ jwt,
41
+ noResolveJson: true,
42
+ });
43
+ return { data: null, error: null };
44
+ }
45
+ catch (error) {
46
+ if ((0, errors_1.isAuthError)(error)) {
47
+ return { data: null, error };
48
+ }
49
+ throw error;
50
+ }
51
+ }
52
+ /**
53
+ * Sends an invite link to an email address.
54
+ * @param email The email address of the user.
55
+ * @param options Additional options to be included when inviting.
56
+ */
57
+ async inviteUserByEmail(email, options = {}) {
58
+ try {
59
+ return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/invite`, {
60
+ body: { email, data: options.data },
61
+ headers: this.headers,
62
+ redirectTo: options.redirectTo,
63
+ xform: fetch_1._userResponse,
64
+ });
65
+ }
66
+ catch (error) {
67
+ if ((0, errors_1.isAuthError)(error)) {
68
+ return { data: { user: null }, error };
69
+ }
70
+ throw error;
71
+ }
72
+ }
73
+ /**
74
+ * Generates email links and OTPs to be sent via a custom email provider.
75
+ * @param email The user's email.
76
+ * @param options.password User password. For signup only.
77
+ * @param options.data Optional user metadata. For signup only.
78
+ * @param options.redirectTo The redirect url which should be appended to the generated link
79
+ */
80
+ async generateLink(params) {
81
+ try {
82
+ const { options } = params, rest = __rest(params, ["options"]);
83
+ const body = Object.assign(Object.assign({}, rest), options);
84
+ if ('newEmail' in rest) {
85
+ // replace newEmail with new_email in request body
86
+ body.new_email = rest === null || rest === void 0 ? void 0 : rest.newEmail;
87
+ delete body['newEmail'];
88
+ }
89
+ return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/generate_link`, {
90
+ body: body,
91
+ headers: this.headers,
92
+ xform: fetch_1._generateLinkResponse,
93
+ redirectTo: options === null || options === void 0 ? void 0 : options.redirectTo,
94
+ });
95
+ }
96
+ catch (error) {
97
+ if ((0, errors_1.isAuthError)(error)) {
98
+ return {
99
+ data: {
100
+ properties: null,
101
+ user: null,
102
+ },
103
+ error,
104
+ };
105
+ }
106
+ throw error;
107
+ }
108
+ }
109
+ // User Admin API
110
+ /**
111
+ * Creates a new user.
112
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
113
+ */
114
+ async createUser(attributes) {
115
+ try {
116
+ return await (0, fetch_1._request)(this.fetch, 'POST', `${this.url}/admin/users`, {
117
+ body: attributes,
118
+ headers: this.headers,
119
+ xform: fetch_1._userResponse,
120
+ });
121
+ }
122
+ catch (error) {
123
+ if ((0, errors_1.isAuthError)(error)) {
124
+ return { data: { user: null }, error };
125
+ }
126
+ throw error;
127
+ }
128
+ }
129
+ /**
130
+ * Get a list of users.
131
+ *
132
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
133
+ * @param params An object which supports `page` and `perPage` as numbers, to alter the paginated results.
134
+ */
135
+ async listUsers(params) {
136
+ var _a, _b, _c, _d, _e, _f, _g;
137
+ try {
138
+ const pagination = { nextPage: null, lastPage: 0, total: 0 };
139
+ const response = await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users`, {
140
+ headers: this.headers,
141
+ noResolveJson: true,
142
+ query: {
143
+ 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 : '',
144
+ 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 : '',
145
+ },
146
+ xform: fetch_1._noResolveJsonResponse,
147
+ });
148
+ if (response.error)
149
+ throw response.error;
150
+ const users = await response.json();
151
+ const total = (_e = response.headers.get('x-total-count')) !== null && _e !== void 0 ? _e : 0;
152
+ const links = (_g = (_f = response.headers.get('link')) === null || _f === void 0 ? void 0 : _f.split(',')) !== null && _g !== void 0 ? _g : [];
153
+ if (links.length > 0) {
154
+ links.forEach((link) => {
155
+ const page = parseInt(link.split(';')[0].split('=')[1].substring(0, 1));
156
+ const rel = JSON.parse(link.split(';')[1].split('=')[1]);
157
+ pagination[`${rel}Page`] = page;
158
+ });
159
+ pagination.total = parseInt(total);
160
+ }
161
+ return { data: Object.assign(Object.assign({}, users), pagination), error: null };
162
+ }
163
+ catch (error) {
164
+ if ((0, errors_1.isAuthError)(error)) {
165
+ return { data: { users: [] }, error };
166
+ }
167
+ throw error;
168
+ }
169
+ }
170
+ /**
171
+ * Get user by id.
172
+ *
173
+ * @param uid The user's unique identifier
174
+ *
175
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
176
+ */
177
+ async getUserById(uid) {
178
+ (0, helpers_1.validateUUID)(uid);
179
+ try {
180
+ return await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users/${uid}`, {
181
+ headers: this.headers,
182
+ xform: fetch_1._userResponse,
183
+ });
184
+ }
185
+ catch (error) {
186
+ if ((0, errors_1.isAuthError)(error)) {
187
+ return { data: { user: null }, error };
188
+ }
189
+ throw error;
190
+ }
191
+ }
192
+ /**
193
+ * Updates the user data.
194
+ *
195
+ * @param attributes The data you want to update.
196
+ *
197
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
198
+ */
199
+ async updateUserById(uid, attributes) {
200
+ (0, helpers_1.validateUUID)(uid);
201
+ try {
202
+ return await (0, fetch_1._request)(this.fetch, 'PUT', `${this.url}/admin/users/${uid}`, {
203
+ body: attributes,
204
+ headers: this.headers,
205
+ xform: fetch_1._userResponse,
206
+ });
207
+ }
208
+ catch (error) {
209
+ if ((0, errors_1.isAuthError)(error)) {
210
+ return { data: { user: null }, error };
211
+ }
212
+ throw error;
213
+ }
214
+ }
215
+ /**
216
+ * Delete a user. Requires a `service_role` key.
217
+ *
218
+ * @param id The user id you want to remove.
219
+ * @param shouldSoftDelete If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible.
220
+ * Defaults to false for backward compatibility.
221
+ *
222
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
223
+ */
224
+ async deleteUser(id, shouldSoftDelete = false) {
225
+ (0, helpers_1.validateUUID)(id);
226
+ try {
227
+ return await (0, fetch_1._request)(this.fetch, 'DELETE', `${this.url}/admin/users/${id}`, {
228
+ headers: this.headers,
229
+ body: {
230
+ should_soft_delete: shouldSoftDelete,
231
+ },
232
+ xform: fetch_1._userResponse,
233
+ });
234
+ }
235
+ catch (error) {
236
+ if ((0, errors_1.isAuthError)(error)) {
237
+ return { data: { user: null }, error };
238
+ }
239
+ throw error;
240
+ }
241
+ }
242
+ async _listFactors(params) {
243
+ (0, helpers_1.validateUUID)(params.userId);
244
+ try {
245
+ const { data, error } = await (0, fetch_1._request)(this.fetch, 'GET', `${this.url}/admin/users/${params.userId}/factors`, {
246
+ headers: this.headers,
247
+ xform: (factors) => {
248
+ return { data: { factors }, error: null };
249
+ },
250
+ });
251
+ return { data, error };
252
+ }
253
+ catch (error) {
254
+ if ((0, errors_1.isAuthError)(error)) {
255
+ return { data: null, error };
256
+ }
257
+ throw error;
258
+ }
259
+ }
260
+ async _deleteFactor(params) {
261
+ (0, helpers_1.validateUUID)(params.userId);
262
+ (0, helpers_1.validateUUID)(params.id);
263
+ try {
264
+ const data = await (0, fetch_1._request)(this.fetch, 'DELETE', `${this.url}/admin/users/${params.userId}/factors/${params.id}`, {
265
+ headers: this.headers,
266
+ });
267
+ return { data, error: null };
268
+ }
269
+ catch (error) {
270
+ if ((0, errors_1.isAuthError)(error)) {
271
+ return { data: null, error };
272
+ }
273
+ throw error;
274
+ }
275
+ }
276
+ }
277
+ exports.default = GoTrueAdminApi;
278
+ //# sourceMappingURL=GoTrueAdminApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoTrueAdminApi.js","sourceRoot":"","sources":["../../src/GoTrueAdminApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,uCAMoB;AACpB,2CAA0D;AAC1D,uCAeoB;AACpB,yCAAqD;AAErD,MAAqB,cAAc;IAUjC,YAAY,EACV,GAAG,GAAG,EAAE,EACR,OAAO,GAAG,EAAE,EACZ,KAAK,GAON;QACC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,CAAA;QAChC,IAAI,CAAC,GAAG,GAAG;YACT,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5C,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CACX,GAAW,EACX,QAAsB,uBAAe,CAAC,CAAC,CAAC;QAExC,IAAI,uBAAe,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CACb,qDAAqD,uBAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClF,CAAA;QACH,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAA,gBAAQ,EAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,iBAAiB,KAAK,EAAE,EAAE;gBACtE,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,GAAG;gBACH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