@rebasepro/client 0.9.0 → 0.9.1-canary.09aaf62

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/README.md CHANGED
@@ -161,4 +161,4 @@ const unsubscribe = client.data.products.listen(
161
161
  - [`@rebasepro/common`](../common) — `QueryBuilder`, `buildRebaseData`, shared utilities
162
162
  - [`@rebasepro/types`](../types) — `Snapshot`, `FindResponse`, `CollectionAccessor`, etc.
163
163
  - [`@rebasepro/utils`](../utils) — `toSnakeCase` and other helpers
164
- - [`@rebasepro/auth`](../auth) — React hook adapter that wraps `client.auth` for CMS integration
164
+ - [`@rebasepro/app`](../auth) — React hook adapter that wraps `client.auth` for CMS integration
package/dist/admin.d.ts CHANGED
@@ -48,6 +48,7 @@ export declare function createAdmin(transport: Transport, options?: CreateAdminO
48
48
  user: AdminUser;
49
49
  temporaryPassword?: string;
50
50
  invitationSent?: boolean;
51
+ emailDeliveryFailed?: boolean;
51
52
  }>;
52
53
  listRoles: () => Promise<{
53
54
  roles: Array<{
@@ -0,0 +1,13 @@
1
+ import { Transport } from "./transport";
2
+ import type { BackupInfo, BackupDestinationKind } from "@rebasepro/types";
3
+ export interface CreateBackupsOptions {
4
+ backupsPath?: string;
5
+ }
6
+ export declare function createBackups(transport: Transport, options?: CreateBackupsOptions): {
7
+ list: () => Promise<{
8
+ backups: BackupInfo[];
9
+ destinationKind: BackupDestinationKind;
10
+ configured: boolean;
11
+ }>;
12
+ download: (key: string) => Promise<Blob>;
13
+ };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { RebaseClientConfig } from "./transport";
2
2
  import { createAuth, CreateAuthOptions } from "./auth";
3
3
  import { createAdmin, CreateAdminOptions } from "./admin";
4
4
  import { createCron, CreateCronOptions } from "./cron";
5
+ import { createBackups } from "./backups";
5
6
  import { createApiKeys, CreateApiKeysOptions } from "./api-keys";
6
7
  import { CollectionClient } from "./collection";
7
8
  import { createFunctionsClient } from "./functions";
@@ -21,9 +22,13 @@ export type { RebaseUser, RebaseTokens } from "./auth";
21
22
  export type { CreateAdminOptions } from "./admin";
22
23
  export type { AdminUser } from "./admin";
23
24
  export type { CreateCronOptions } from "./cron";
25
+ export { createBackups } from "./backups";
26
+ export type { CreateBackupsOptions } from "./backups";
24
27
  export type { ApiKeyMasked, ApiKeyPermission, ApiKeyWithSecret, CreateApiKeyRequest, CreateApiKeysOptions, UpdateApiKeyRequest } from "./api-keys";
25
28
  export type { FunctionInvokeOptions, FunctionsClient } from "./functions";
26
29
  export { RebaseWebSocketClient } from "./websocket";
30
+ export { RebaseRealtimeChannel } from "./realtime-channel";
31
+ export type { PresenceState, PresenceDiff, BroadcastEvent, ChannelTransport } from "./realtime-channel";
27
32
  export interface CreateRebaseClientOptions extends RebaseClientConfig {
28
33
  auth?: CreateAuthOptions;
29
34
  admin?: CreateAdminOptions;
@@ -67,14 +72,24 @@ export type CreateRebaseClientResult<DB = Record<string, unknown>> = Omit<Rebase
67
72
  auth: ReturnType<typeof createAuth>;
68
73
  admin: ReturnType<typeof createAdmin>;
69
74
  cron: ReturnType<typeof createCron>;
75
+ backups: ReturnType<typeof createBackups>;
70
76
  apiKeys: ReturnType<typeof createApiKeys>;
71
77
  functions: ReturnType<typeof createFunctionsClient>;
72
78
  ws?: RebaseWebSocketClient;
79
+ /**
80
+ * Release the realtime socket and its reconnect timer.
81
+ *
82
+ * An open socket keeps the Node event loop alive, so a script that does not
83
+ * call this will not exit on its own. Safe when realtime was never started
84
+ * (`realtime: false`), and safe to call twice.
85
+ */
86
+ close: () => void;
73
87
  storage: StorageSource;
74
88
  storageRegistry: StorageSourceRegistry;
75
89
  createStorageSource: (storageId: string) => StorageSource;
76
90
  fetchStorageSources: () => Promise<StorageSourceDefinition[]>;
77
91
  call: <T = unknown>(endpoint: string, payload?: unknown) => Promise<T>;
92
+ collection: <M extends Record<string, unknown> = Record<string, unknown>>(slug: string) => CollectionClient<M>;
78
93
  data: TypedDataLayer<DB>;
79
94
  };
80
95
  export declare function createRebaseClient<DB = Record<string, unknown>>(options: CreateRebaseClientOptions): CreateRebaseClientResult<DB>;