@syncular/tauri 0.34.0 → 0.36.0
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 +7 -0
- package/dist/index.js +11 -0
- package/package.json +4 -4
- package/src/index.ts +19 -0
package/dist/index.d.ts
CHANGED
|
@@ -212,6 +212,13 @@ export declare class TauriSyncClient implements PromiseMethods<ClientSnapshotMet
|
|
|
212
212
|
readonly scopes?: Record<string, readonly string[]>;
|
|
213
213
|
readonly params?: string;
|
|
214
214
|
}): Promise<void>;
|
|
215
|
+
/** Register several subscriptions in one local transaction. */
|
|
216
|
+
subscribeMany(inputs: readonly {
|
|
217
|
+
readonly id: string;
|
|
218
|
+
readonly table: string;
|
|
219
|
+
readonly scopes?: Record<string, readonly string[]>;
|
|
220
|
+
readonly params?: string;
|
|
221
|
+
}[]): Promise<void>;
|
|
215
222
|
unsubscribe(id: string): Promise<void>;
|
|
216
223
|
setWindow(base: WindowBase, units: readonly string[]): Promise<void>;
|
|
217
224
|
windowState(base: WindowBase): Promise<WindowState>;
|
package/dist/index.js
CHANGED
|
@@ -658,6 +658,17 @@ export class TauriSyncClient {
|
|
|
658
658
|
...(input.params !== undefined ? { params: input.params } : {}),
|
|
659
659
|
});
|
|
660
660
|
}
|
|
661
|
+
/** Register several subscriptions in one local transaction. */
|
|
662
|
+
async subscribeMany(inputs) {
|
|
663
|
+
await this.#command('subscribeMany', {
|
|
664
|
+
subscriptions: inputs.map((input) => ({
|
|
665
|
+
id: input.id,
|
|
666
|
+
table: input.table,
|
|
667
|
+
scopes: input.scopes ?? {},
|
|
668
|
+
...(input.params !== undefined ? { params: input.params } : {}),
|
|
669
|
+
})),
|
|
670
|
+
});
|
|
671
|
+
}
|
|
661
672
|
async unsubscribe(id) {
|
|
662
673
|
await this.#command('unsubscribe', { id });
|
|
663
674
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/tauri",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Tauri integration for the Syncular client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"test": "bun test"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@syncular/client": "0.
|
|
59
|
+
"@syncular/client": "0.36.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@tauri-apps/api": ">=2.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@syncular/react": "0.
|
|
66
|
-
"@syncular/server": "0.
|
|
65
|
+
"@syncular/react": "0.36.0",
|
|
66
|
+
"@syncular/server": "0.36.0"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/index.ts
CHANGED
|
@@ -1060,6 +1060,25 @@ export class TauriSyncClient implements PromiseMethods<ClientSnapshotMethods> {
|
|
|
1060
1060
|
});
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
|
+
/** Register several subscriptions in one local transaction. */
|
|
1064
|
+
async subscribeMany(
|
|
1065
|
+
inputs: readonly {
|
|
1066
|
+
readonly id: string;
|
|
1067
|
+
readonly table: string;
|
|
1068
|
+
readonly scopes?: Record<string, readonly string[]>;
|
|
1069
|
+
readonly params?: string;
|
|
1070
|
+
}[],
|
|
1071
|
+
): Promise<void> {
|
|
1072
|
+
await this.#command('subscribeMany', {
|
|
1073
|
+
subscriptions: inputs.map((input) => ({
|
|
1074
|
+
id: input.id,
|
|
1075
|
+
table: input.table,
|
|
1076
|
+
scopes: input.scopes ?? {},
|
|
1077
|
+
...(input.params !== undefined ? { params: input.params } : {}),
|
|
1078
|
+
})),
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1063
1082
|
async unsubscribe(id: string): Promise<void> {
|
|
1064
1083
|
await this.#command('unsubscribe', { id });
|
|
1065
1084
|
}
|