@rebasepro/client 0.1.0 → 0.2.1

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 CHANGED
@@ -1,6 +1,21 @@
1
- Source code in this repository is variously licensed under the Business Source
2
- License 1.1 (BSL), Apache version 2.0 and the MIT license. A copy of each
3
- license can be found in each one of the packages under the folder packages
4
- under a file called License. Source code in a given file is licensed under the
5
- BSL and the copyright belongs to Rebase Authors unless otherwise noted at the
6
- beginning of the file.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rebase
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/dist/auth.d.ts CHANGED
@@ -24,8 +24,8 @@ export type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "TOKEN_REFRESHED" | "
24
24
  export interface AuthConfig {
25
25
  needsSetup: boolean;
26
26
  registrationEnabled: boolean;
27
- googleEnabled: boolean;
28
27
  emailServiceEnabled: boolean;
28
+ enabledProviders: string[];
29
29
  }
30
30
  export interface AuthStorage {
31
31
  getItem: (key: string) => string | null;
@@ -50,11 +50,13 @@ export declare function createAuth(transport: Transport, options?: CreateAuthOpt
50
50
  accessToken: string;
51
51
  refreshToken: string;
52
52
  }>;
53
- signInWithGoogle: (tokenOrPayload: string | {
54
- idToken?: string;
55
- accessToken?: string;
56
- code?: string;
57
- redirectUri?: string;
53
+ signInWithGoogle: (payload: {
54
+ idToken: string;
55
+ } | {
56
+ accessToken: string;
57
+ } | {
58
+ code: string;
59
+ redirectUri: string;
58
60
  }) => Promise<{
59
61
  user: RebaseUser;
60
62
  accessToken: string;
package/dist/index.es.js CHANGED
@@ -381,13 +381,12 @@ function createAuth(transport, options) {
381
381
  refreshToken: session.refreshToken
382
382
  };
383
383
  }
384
- async function signInWithGoogle(tokenOrPayload) {
384
+ async function signInWithGoogle(payload) {
385
385
  const fetchFn = getFetch();
386
- const body = typeof tokenOrPayload === "string" ? { idToken: tokenOrPayload } : tokenOrPayload;
387
386
  const res = await fetchFn(authUrl("/google"), {
388
387
  method: "POST",
389
388
  headers: { "Content-Type": "application/json" },
390
- body: JSON.stringify(body)
389
+ body: JSON.stringify(payload)
391
390
  });
392
391
  const responseBody = await res.json().catch(() => ({}));
393
392
  if (!res.ok) throwApiError(res.status, responseBody, res.statusText);