@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 +11 -0
- package/dist/index.es.js +487 -71
- package/dist/index.es.js.map +1 -1
- package/dist/realtime-channel.d.ts +89 -0
- package/dist/transport.d.ts +34 -0
- package/dist/websocket.d.ts +67 -1
- package/package.json +8 -6
- package/src/collection.ts +16 -0
- package/src/index.ts +59 -1
- package/src/realtime-channel.test.ts +241 -0
- package/src/realtime-channel.ts +238 -0
- package/src/realtime-optout.test.ts +119 -0
- package/src/realtime-row-identity.test.ts +254 -0
- package/src/sdk_query_builder.ts +4 -1
- package/src/transport.ts +34 -0
- package/src/websocket.ts +402 -71
- package/dist/collection.test.d.ts +0 -1
- package/dist/cron.test.d.ts +0 -1
- package/dist/data-proxy.test.d.ts +0 -1
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>;
|