@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 +1 -1
- package/dist/admin.d.ts +1 -0
- package/dist/backups.d.ts +13 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.es.js +516 -72
- 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 +68 -2
- package/package.json +8 -9
- package/src/admin.ts +1 -1
- package/src/api-keys.ts +1 -1
- package/src/backups.ts +40 -0
- package/src/collection.ts +16 -0
- package/src/index.ts +66 -2
- 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 +403 -72
- 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.umd.js +0 -2484
- package/dist/index.umd.js.map +0 -1
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/
|
|
164
|
+
- [`@rebasepro/app`](../auth) — React hook adapter that wraps `client.auth` for CMS integration
|
package/dist/admin.d.ts
CHANGED
|
@@ -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>;
|