cry-synced-db-client 0.1.27 → 0.1.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/index.js +2 -2
- package/dist/types/I_DexieDb.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1712,7 +1712,7 @@ class DexieDb extends Dexie {
|
|
|
1712
1712
|
schema[SYNC_META_TABLE] = "[tenant+collection]";
|
|
1713
1713
|
for (const config of collectionConfigs) {
|
|
1714
1714
|
const additionalIndexes = config.indexes || [];
|
|
1715
|
-
const indexes = ["_id", "_dirty", "
|
|
1715
|
+
const indexes = ["_id", "_dirty", "_ts", ...additionalIndexes.map(String)];
|
|
1716
1716
|
schema[config.name] = indexes.join(", ");
|
|
1717
1717
|
}
|
|
1718
1718
|
this.version(1).stores(schema);
|
|
@@ -1877,7 +1877,7 @@ class DexieDb extends Dexie {
|
|
|
1877
1877
|
async getNewerThan(collection, timestamp) {
|
|
1878
1878
|
const table = this.getTable(collection);
|
|
1879
1879
|
const normalizedTs = this.normalizeTimestamp(timestamp);
|
|
1880
|
-
return await table.where("
|
|
1880
|
+
return await table.where("_ts").above(normalizedTs).toArray();
|
|
1881
1881
|
}
|
|
1882
1882
|
onMetaUpdated(callback) {
|
|
1883
1883
|
this.metaUpdateCallbacks.add(callback);
|
|
@@ -61,7 +61,7 @@ export interface I_DexieDb {
|
|
|
61
61
|
deleteSyncMeta(collection: string): Promise<void>;
|
|
62
62
|
/** Vrne tenant */
|
|
63
63
|
getTenant(): string;
|
|
64
|
-
/** Get records newer than timestamp (uses
|
|
64
|
+
/** Get records newer than timestamp (uses _ts index - server timestamp) */
|
|
65
65
|
getNewerThan<T extends LocalDbEntity>(collection: string, timestamp: any): Promise<T[]>;
|
|
66
66
|
/** Subscribe to metadata updates from other tabs. Returns unsubscribe function. */
|
|
67
67
|
onMetaUpdated(callback: (payload: MetaUpdateBroadcast) => void): () => void;
|