@rebasepro/client 0.12.1-canary.gf5f1d39 → 0.13.1-canary.g18cfeb7

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/dist/auth.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  import { Transport } from "./transport";
2
- import type { AuthChangeEvent, RebaseSession, AuthTokens, DeviceSession, User } from "@rebasepro/types";
2
+ import type { AuthChangeEvent, RebaseSession, DeviceSession, User } from "@rebasepro/types";
3
3
  export type { RebaseSession, AuthTokens, AuthChangeEvent, DeviceSession } from "@rebasepro/types";
4
- /** @deprecated Use `User` from `@rebasepro/types` instead. */
5
- export type RebaseUser = User;
6
- /** @deprecated Use `AuthTokens` from `@rebasepro/types` instead. */
7
- export type RebaseTokens = AuthTokens;
8
4
  /** Minimal, non-sensitive user profile returned by {@link findUserByEmail}. */
9
5
  export interface PublicUserProfile {
10
6
  uid: string;
@@ -128,6 +124,7 @@ export declare function createAuth(transport: Transport, options?: CreateAuthOpt
128
124
  refreshToken: string;
129
125
  }>;
130
126
  signOut: () => Promise<void>;
127
+ stopAutoRefresh: () => void;
131
128
  refreshSession: () => Promise<RebaseSession>;
132
129
  handleUnauthorized: () => Promise<boolean>;
133
130
  getUser: () => Promise<User>;
@@ -180,6 +177,7 @@ export declare function createAuth(transport: Transport, options?: CreateAuthOpt
180
177
  getAuthConfig: () => Promise<AuthConfig>;
181
178
  getSession: () => RebaseSession | null;
182
179
  onAuthStateChange: (callback: (event: AuthChangeEvent, session: RebaseSession | null) => void) => () => boolean;
180
+ canRestoreSession: () => boolean;
183
181
  isInitialized: () => Promise<void>;
184
182
  };
185
183
  export interface CookieStorageOptions {
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import { type OfflineApi, type OfflineConfig } from "./offline";
12
12
  import { InsertOf, RebaseClient, RebaseSdkData, RowOf, StorageSource, StorageSourceDefinition, StorageSourceRegistry, UpdateOf } from "@rebasepro/types";
13
13
  export { RebaseApiError } from "./transport";
14
14
  export { RebaseClientError } from "./errors";
15
+ export type { RebaseErrorCode } from "@rebasepro/types";
15
16
  export type { RebaseClientConfig, FindParams, FindResponse } from "./transport";
16
17
  export type { CollectionClient } from "./collection";
17
18
  export type { FindResult, SDKCollectionClient, SDKQueryBuilderInterface, PaginationMeta } from "@rebasepro/types";
@@ -21,9 +22,7 @@ export type { PaginationErrorCode } from "@rebasepro/common";
21
22
  export { QueryBuilder, or, and, cond } from "@rebasepro/common";
22
23
  export { createCookieStorage, createMemoryStorage } from "./auth";
23
24
  export type { AuthConfig, AuthStorage, CookieStorageOptions, CreateAuthOptions } from "./auth";
24
- export type { RebaseSession, AuthTokens, AuthChangeEvent, DeviceSession } from "@rebasepro/types";
25
- /** @deprecated Import `User` / `AuthTokens` from `@rebasepro/types` instead. */
26
- export type { RebaseUser, RebaseTokens } from "./auth";
25
+ export type { User, RebaseSession, AuthTokens, AuthChangeEvent, DeviceSession } from "@rebasepro/types";
27
26
  export type { CreateAdminOptions } from "./admin";
28
27
  export type { AdminUser } from "./admin";
29
28
  export type { CreateCronOptions } from "./cron";
@@ -120,11 +119,17 @@ export type CreateRebaseClientResult<DB = Record<string, unknown>> = Omit<Rebase
120
119
  channel: (name: string, options?: ChannelOptions) => RebaseRealtimeChannel;
121
120
  };
122
121
  /**
123
- * Release the realtime socket and its reconnect timer.
122
+ * Release everything this client holds that can keep a process alive: the
123
+ * realtime socket and its reconnect timer, channel presence heartbeats, the
124
+ * offline manager, and the scheduled token refresh.
124
125
  *
125
- * An open socket keeps the Node event loop alive, so a script that does not
126
- * call this will not exit on its own. Safe when realtime was never started
127
- * (`realtime: false`), and safe to call twice.
126
+ * Each of those keeps the Node event loop alive on its own, so a script
127
+ * that does not call this will not exit — and, until the refresh timer was
128
+ * included, one that *did* call it still would not if it had signed in.
129
+ *
130
+ * Safe when realtime was never started (`realtime: false`), safe when
131
+ * signed out, and safe to call twice. It does not sign the user out: a
132
+ * persisted session survives for the next client to restore.
128
133
  */
129
134
  close: () => void;
130
135
  storage: StorageSource;