@syncular/react 0.15.27 → 0.15.28

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 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, ClientDiagnosticsListener, ClientDiagnosticsRequest, ClientDiagnosticsSnapshot, CommitOutcome, CommitOutcomeQuery, ConflictRecord, InvalidationListener, LeadershipState, LeaseState, LocalDataPurgeInput, LocalDataPurgeResult, MutationInput, PresencePeer, QueryReadSpec, QuerySnapshot, RejectionRecord, ResolveCommitOutcomeInput, SchemaFloor, SecurityLifecycle, SqlRow, SqlValue, SyncStatusSnapshot, WindowBase, WindowState } from '@syncular/client';
14
+ import type { ClientChangeListener, ClientDiagnosticsListener, ClientDiagnosticsRequest, ClientDiagnosticsSnapshot, CommitOutcome, CommitOutcomeQuery, ConflictRecord, InvalidationListener, LeadershipState, LeaseState, LocalDataPurgeInput, LocalDataPurgeResult, LocalDataRebootstrapInput, LocalDataRebootstrapResult, MutationInput, PresencePeer, QueryReadSpec, QuerySnapshot, RejectionRecord, ResolveCommitOutcomeInput, SchemaFloor, SecurityLifecycle, 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}
@@ -36,6 +36,7 @@ export interface SyncClientLike {
36
36
  readonly baseVersion?: number;
37
37
  }): string | Promise<string>;
38
38
  purgeLocalData(input: LocalDataPurgeInput): LocalDataPurgeResult | Promise<LocalDataPurgeResult>;
39
+ rebootstrapLocalData(input: LocalDataRebootstrapInput): LocalDataRebootstrapResult | Promise<LocalDataRebootstrapResult>;
39
40
  querySnapshot<Row = SqlRow>(spec: QueryReadSpec): QuerySnapshot<Row> | Promise<QuerySnapshot<Row>>;
40
41
  statusSnapshot(): SyncStatusSnapshot | Promise<SyncStatusSnapshot>;
41
42
  diagnosticsSnapshot(request?: ClientDiagnosticsRequest): ClientDiagnosticsSnapshot | Promise<ClientDiagnosticsSnapshot>;
@@ -75,6 +76,7 @@ export interface NormalizedClient {
75
76
  readonly baseVersion?: number;
76
77
  }): Promise<string>;
77
78
  purgeLocalData(input: LocalDataPurgeInput): Promise<LocalDataPurgeResult>;
79
+ rebootstrapLocalData(input: LocalDataRebootstrapInput): Promise<LocalDataRebootstrapResult>;
78
80
  querySnapshot<Row = SqlRow>(spec: QueryReadSpec): Promise<QuerySnapshot<Row>>;
79
81
  statusSnapshot(): Promise<SyncStatusSnapshot>;
80
82
  diagnosticsSnapshot(request?: ClientDiagnosticsRequest): Promise<ClientDiagnosticsSnapshot>;
package/dist/client.js CHANGED
@@ -28,6 +28,7 @@ export function normalizeClient(client) {
28
28
  mutate: (mutations) => Promise.resolve(client.mutate(mutations)),
29
29
  patch: (table, rowId, partial, options) => Promise.resolve(client.patch(table, rowId, partial, options)),
30
30
  purgeLocalData: (input) => Promise.resolve(client.purgeLocalData(input)),
31
+ rebootstrapLocalData: (input) => Promise.resolve(client.rebootstrapLocalData(input)),
31
32
  querySnapshot: (spec) => Promise.resolve(client.querySnapshot(spec)),
32
33
  statusSnapshot: () => Promise.resolve(client.statusSnapshot()),
33
34
  diagnosticsSnapshot: (request) => Promise.resolve(client.diagnosticsSnapshot(request)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/react",
3
- "version": "0.15.27",
3
+ "version": "0.15.28",
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.27"
51
+ "@syncular/client": "0.15.28"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": ">=18.0.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
- "@syncular/core": "0.15.27",
59
- "@syncular/server": "0.15.27",
58
+ "@syncular/core": "0.15.28",
59
+ "@syncular/server": "0.15.28",
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
@@ -24,6 +24,8 @@ import type {
24
24
  LeaseState,
25
25
  LocalDataPurgeInput,
26
26
  LocalDataPurgeResult,
27
+ LocalDataRebootstrapInput,
28
+ LocalDataRebootstrapResult,
27
29
  MutationInput,
28
30
  PresencePeer,
29
31
  QueryReadSpec,
@@ -73,6 +75,9 @@ export interface SyncClientLike {
73
75
  purgeLocalData(
74
76
  input: LocalDataPurgeInput,
75
77
  ): LocalDataPurgeResult | Promise<LocalDataPurgeResult>;
78
+ rebootstrapLocalData(
79
+ input: LocalDataRebootstrapInput,
80
+ ): LocalDataRebootstrapResult | Promise<LocalDataRebootstrapResult>;
76
81
  querySnapshot<Row = SqlRow>(
77
82
  spec: QueryReadSpec,
78
83
  ): QuerySnapshot<Row> | Promise<QuerySnapshot<Row>>;
@@ -158,6 +163,9 @@ export interface NormalizedClient {
158
163
  options?: { readonly baseVersion?: number },
159
164
  ): Promise<string>;
160
165
  purgeLocalData(input: LocalDataPurgeInput): Promise<LocalDataPurgeResult>;
166
+ rebootstrapLocalData(
167
+ input: LocalDataRebootstrapInput,
168
+ ): Promise<LocalDataRebootstrapResult>;
161
169
  querySnapshot<Row = SqlRow>(spec: QueryReadSpec): Promise<QuerySnapshot<Row>>;
162
170
  statusSnapshot(): Promise<SyncStatusSnapshot>;
163
171
  diagnosticsSnapshot(
@@ -205,6 +213,8 @@ export function normalizeClient(client: SyncClientLike): NormalizedClient {
205
213
  patch: (table, rowId, partial, options) =>
206
214
  Promise.resolve(client.patch(table, rowId, partial, options)),
207
215
  purgeLocalData: (input) => Promise.resolve(client.purgeLocalData(input)),
216
+ rebootstrapLocalData: (input) =>
217
+ Promise.resolve(client.rebootstrapLocalData(input)),
208
218
  querySnapshot: (spec) => Promise.resolve(client.querySnapshot(spec)),
209
219
  statusSnapshot: () => Promise.resolve(client.statusSnapshot()),
210
220
  diagnosticsSnapshot: (request) =>