@syncular/tauri 0.54.0 → 0.55.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/remote.js +24 -0
- package/package.json +4 -4
- package/src/remote.ts +26 -0
package/dist/remote.js
CHANGED
|
@@ -859,10 +859,34 @@ function decodeChangeBatch(value) {
|
|
|
859
859
|
];
|
|
860
860
|
})
|
|
861
861
|
: [];
|
|
862
|
+
const appliedCommits = [];
|
|
863
|
+
if (raw.appliedCommits !== undefined) {
|
|
864
|
+
if (!Array.isArray(raw.appliedCommits))
|
|
865
|
+
return undefined;
|
|
866
|
+
for (const entry of raw.appliedCommits) {
|
|
867
|
+
if (entry === null || typeof entry !== 'object')
|
|
868
|
+
return undefined;
|
|
869
|
+
const item = entry;
|
|
870
|
+
if (typeof item.subscriptionId !== 'string' ||
|
|
871
|
+
typeof item.table !== 'string' ||
|
|
872
|
+
typeof item.commitSeq !== 'number' ||
|
|
873
|
+
!Number.isSafeInteger(item.commitSeq) ||
|
|
874
|
+
item.commitSeq < 1 ||
|
|
875
|
+
(item.source !== 'delta' && item.source !== 'pull'))
|
|
876
|
+
return undefined;
|
|
877
|
+
appliedCommits.push({
|
|
878
|
+
subscriptionId: item.subscriptionId,
|
|
879
|
+
table: item.table,
|
|
880
|
+
commitSeq: item.commitSeq,
|
|
881
|
+
source: item.source,
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
}
|
|
862
885
|
return {
|
|
863
886
|
revision: BigInt(raw.revision),
|
|
864
887
|
tables,
|
|
865
888
|
windows,
|
|
889
|
+
...(raw.appliedCommits !== undefined ? { appliedCommits } : {}),
|
|
866
890
|
...(raw.status !== undefined
|
|
867
891
|
? { status: raw.status }
|
|
868
892
|
: {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/tauri",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Tauri integration for the Syncular client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
"test": "bun test"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@syncular/client": "0.
|
|
67
|
+
"@syncular/client": "0.55.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@tauri-apps/api": ">=2.0.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@syncular/react": "0.
|
|
74
|
-
"@syncular/server": "0.
|
|
73
|
+
"@syncular/react": "0.55.0",
|
|
74
|
+
"@syncular/server": "0.55.0"
|
|
75
75
|
}
|
|
76
76
|
}
|
package/src/remote.ts
CHANGED
|
@@ -1327,10 +1327,36 @@ function decodeChangeBatch(value: unknown): ClientChangeBatch | undefined {
|
|
|
1327
1327
|
];
|
|
1328
1328
|
})
|
|
1329
1329
|
: [];
|
|
1330
|
+
const appliedCommits: NonNullable<
|
|
1331
|
+
ClientChangeBatch['appliedCommits']
|
|
1332
|
+
>[number][] = [];
|
|
1333
|
+
if (raw.appliedCommits !== undefined) {
|
|
1334
|
+
if (!Array.isArray(raw.appliedCommits)) return undefined;
|
|
1335
|
+
for (const entry of raw.appliedCommits) {
|
|
1336
|
+
if (entry === null || typeof entry !== 'object') return undefined;
|
|
1337
|
+
const item = entry as Record<string, unknown>;
|
|
1338
|
+
if (
|
|
1339
|
+
typeof item.subscriptionId !== 'string' ||
|
|
1340
|
+
typeof item.table !== 'string' ||
|
|
1341
|
+
typeof item.commitSeq !== 'number' ||
|
|
1342
|
+
!Number.isSafeInteger(item.commitSeq) ||
|
|
1343
|
+
item.commitSeq < 1 ||
|
|
1344
|
+
(item.source !== 'delta' && item.source !== 'pull')
|
|
1345
|
+
)
|
|
1346
|
+
return undefined;
|
|
1347
|
+
appliedCommits.push({
|
|
1348
|
+
subscriptionId: item.subscriptionId,
|
|
1349
|
+
table: item.table,
|
|
1350
|
+
commitSeq: item.commitSeq,
|
|
1351
|
+
source: item.source,
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1330
1355
|
return {
|
|
1331
1356
|
revision: BigInt(raw.revision),
|
|
1332
1357
|
tables,
|
|
1333
1358
|
windows,
|
|
1359
|
+
...(raw.appliedCommits !== undefined ? { appliedCommits } : {}),
|
|
1334
1360
|
...(raw.status !== undefined
|
|
1335
1361
|
? { status: raw.status as SyncStatusSnapshot }
|
|
1336
1362
|
: {}),
|