@syncular/react 0.15.9 → 0.15.11
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/client.d.ts +3 -1
- package/dist/client.js +1 -0
- package/package.json +4 -4
- package/src/client.ts +7 -0
package/dist/client.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* value → read it) and wraps every result in `Promise.resolve`, so a hook
|
|
12
12
|
* never has to care which core it holds.
|
|
13
13
|
*/
|
|
14
|
-
import type { ClientChangeListener, CommitOutcome, CommitOutcomeQuery, ConflictRecord, InvalidationListener, LeaseState, MutationInput, PresencePeer, QueryReadSpec, QuerySnapshot, RejectionRecord, ResolveCommitOutcomeInput, SchemaFloor, SqlRow, SqlValue, SyncStatusSnapshot, WindowBase, WindowState } from '@syncular/client';
|
|
14
|
+
import type { ClientChangeListener, CommitOutcome, CommitOutcomeQuery, ConflictRecord, InvalidationListener, LeaseState, LocalDataPurgeInput, LocalDataPurgeResult, MutationInput, PresencePeer, QueryReadSpec, QuerySnapshot, RejectionRecord, ResolveCommitOutcomeInput, SchemaFloor, SqlRow, SqlValue, SyncStatusSnapshot, WindowBase, WindowState } from '@syncular/client';
|
|
15
15
|
/**
|
|
16
16
|
* The structural union of `SyncClient` and `SyncClientHandle`. Members that
|
|
17
17
|
* diverge are typed as "value or method, sync or promise"; {@link normalizeClient}
|
|
@@ -27,6 +27,7 @@ export interface SyncClientLike {
|
|
|
27
27
|
patch(table: string, rowId: string, partial: Readonly<Record<string, unknown>>, options?: {
|
|
28
28
|
readonly baseVersion?: number;
|
|
29
29
|
}): string | Promise<string>;
|
|
30
|
+
purgeLocalData(input: LocalDataPurgeInput): LocalDataPurgeResult | Promise<LocalDataPurgeResult>;
|
|
30
31
|
querySnapshot<Row = SqlRow>(spec: QueryReadSpec): QuerySnapshot<Row> | Promise<QuerySnapshot<Row>>;
|
|
31
32
|
statusSnapshot(): SyncStatusSnapshot | Promise<SyncStatusSnapshot>;
|
|
32
33
|
conflicts: readonly ConflictRecord[] | (() => readonly ConflictRecord[] | Promise<readonly ConflictRecord[]>);
|
|
@@ -56,6 +57,7 @@ export interface NormalizedClient {
|
|
|
56
57
|
patch(table: string, rowId: string, partial: Readonly<Record<string, unknown>>, options?: {
|
|
57
58
|
readonly baseVersion?: number;
|
|
58
59
|
}): Promise<string>;
|
|
60
|
+
purgeLocalData(input: LocalDataPurgeInput): Promise<LocalDataPurgeResult>;
|
|
59
61
|
querySnapshot<Row = SqlRow>(spec: QueryReadSpec): Promise<QuerySnapshot<Row>>;
|
|
60
62
|
statusSnapshot(): Promise<SyncStatusSnapshot>;
|
|
61
63
|
conflicts(): Promise<readonly ConflictRecord[]>;
|
package/dist/client.js
CHANGED
|
@@ -18,6 +18,7 @@ export function normalizeClient(client) {
|
|
|
18
18
|
query: (sql, params) => Promise.resolve(client.query(sql, params)),
|
|
19
19
|
mutate: (mutations) => Promise.resolve(client.mutate(mutations)),
|
|
20
20
|
patch: (table, rowId, partial, options) => Promise.resolve(client.patch(table, rowId, partial, options)),
|
|
21
|
+
purgeLocalData: (input) => Promise.resolve(client.purgeLocalData(input)),
|
|
21
22
|
querySnapshot: (spec) => Promise.resolve(client.querySnapshot(spec)),
|
|
22
23
|
statusSnapshot: () => Promise.resolve(client.statusSnapshot()),
|
|
23
24
|
conflicts: () => resolveMember(client, 'conflicts'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/react",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.11",
|
|
4
4
|
"description": "React hooks for Syncular offline-first sync",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"test": "bun test --preload ./test/setup.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@syncular/client": "0.15.
|
|
51
|
+
"@syncular/client": "0.15.11"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": ">=18.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@happy-dom/global-registrator": "^15.11.0",
|
|
58
|
-
"@syncular/core": "0.15.
|
|
59
|
-
"@syncular/server": "0.15.
|
|
58
|
+
"@syncular/core": "0.15.11",
|
|
59
|
+
"@syncular/server": "0.15.11",
|
|
60
60
|
"@testing-library/react": "^16.1.0",
|
|
61
61
|
"@types/react": "^18.3.0",
|
|
62
62
|
"react": "^18.3.1",
|
package/src/client.ts
CHANGED
|
@@ -18,6 +18,8 @@ import type {
|
|
|
18
18
|
ConflictRecord,
|
|
19
19
|
InvalidationListener,
|
|
20
20
|
LeaseState,
|
|
21
|
+
LocalDataPurgeInput,
|
|
22
|
+
LocalDataPurgeResult,
|
|
21
23
|
MutationInput,
|
|
22
24
|
PresencePeer,
|
|
23
25
|
QueryReadSpec,
|
|
@@ -53,6 +55,9 @@ export interface SyncClientLike {
|
|
|
53
55
|
partial: Readonly<Record<string, unknown>>,
|
|
54
56
|
options?: { readonly baseVersion?: number },
|
|
55
57
|
): string | Promise<string>;
|
|
58
|
+
purgeLocalData(
|
|
59
|
+
input: LocalDataPurgeInput,
|
|
60
|
+
): LocalDataPurgeResult | Promise<LocalDataPurgeResult>;
|
|
56
61
|
querySnapshot<Row = SqlRow>(
|
|
57
62
|
spec: QueryReadSpec,
|
|
58
63
|
): QuerySnapshot<Row> | Promise<QuerySnapshot<Row>>;
|
|
@@ -126,6 +131,7 @@ export interface NormalizedClient {
|
|
|
126
131
|
partial: Readonly<Record<string, unknown>>,
|
|
127
132
|
options?: { readonly baseVersion?: number },
|
|
128
133
|
): Promise<string>;
|
|
134
|
+
purgeLocalData(input: LocalDataPurgeInput): Promise<LocalDataPurgeResult>;
|
|
129
135
|
querySnapshot<Row = SqlRow>(spec: QueryReadSpec): Promise<QuerySnapshot<Row>>;
|
|
130
136
|
statusSnapshot(): Promise<SyncStatusSnapshot>;
|
|
131
137
|
conflicts(): Promise<readonly ConflictRecord[]>;
|
|
@@ -158,6 +164,7 @@ export function normalizeClient(client: SyncClientLike): NormalizedClient {
|
|
|
158
164
|
mutate: (mutations) => Promise.resolve(client.mutate(mutations)),
|
|
159
165
|
patch: (table, rowId, partial, options) =>
|
|
160
166
|
Promise.resolve(client.patch(table, rowId, partial, options)),
|
|
167
|
+
purgeLocalData: (input) => Promise.resolve(client.purgeLocalData(input)),
|
|
161
168
|
querySnapshot: (spec) => Promise.resolve(client.querySnapshot(spec)),
|
|
162
169
|
statusSnapshot: () => Promise.resolve(client.statusSnapshot()),
|
|
163
170
|
conflicts: () => resolveMember(client, 'conflicts'),
|