@rebasepro/client 0.9.1-canary.ad870eb → 0.9.1-canary.baa7a6b

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/index.d.ts CHANGED
@@ -27,6 +27,8 @@ export type { CreateBackupsOptions } from "./backups";
27
27
  export type { ApiKeyMasked, ApiKeyPermission, ApiKeyWithSecret, CreateApiKeyRequest, CreateApiKeysOptions, UpdateApiKeyRequest } from "./api-keys";
28
28
  export type { FunctionInvokeOptions, FunctionsClient } from "./functions";
29
29
  export { RebaseWebSocketClient } from "./websocket";
30
+ export { RebaseRealtimeChannel } from "./realtime-channel";
31
+ export type { PresenceState, PresenceDiff, BroadcastEvent, ChannelTransport } from "./realtime-channel";
30
32
  export interface CreateRebaseClientOptions extends RebaseClientConfig {
31
33
  auth?: CreateAuthOptions;
32
34
  admin?: CreateAdminOptions;
@@ -74,11 +76,20 @@ export type CreateRebaseClientResult<DB = Record<string, unknown>> = Omit<Rebase
74
76
  apiKeys: ReturnType<typeof createApiKeys>;
75
77
  functions: ReturnType<typeof createFunctionsClient>;
76
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;
77
87
  storage: StorageSource;
78
88
  storageRegistry: StorageSourceRegistry;
79
89
  createStorageSource: (storageId: string) => StorageSource;
80
90
  fetchStorageSources: () => Promise<StorageSourceDefinition[]>;
81
91
  call: <T = unknown>(endpoint: string, payload?: unknown) => Promise<T>;
92
+ collection: <M extends Record<string, unknown> = Record<string, unknown>>(slug: string) => CollectionClient<M>;
82
93
  data: TypedDataLayer<DB>;
83
94
  };
84
95
  export declare function createRebaseClient<DB = Record<string, unknown>>(options: CreateRebaseClientOptions): CreateRebaseClientResult<DB>;