dexie-cloud-addon 4.0.11 → 4.0.12
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/modern/define-ydoc-trigger.d.ts +2 -0
- package/dist/modern/dexie-cloud-addon.js +9 -4
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +9 -4
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/modern/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +1 -0
- package/dist/modern/yjs/Y.d.ts +3 -0
- package/dist/modern/yjs/YDexieCloudSyncState.d.ts +3 -0
- package/dist/modern/yjs/YTable.d.ts +2 -0
- package/dist/modern/yjs/applyYMessages.d.ts +9 -0
- package/dist/modern/yjs/awareness.d.ts +4 -0
- package/dist/modern/yjs/createYClientUpdateObservable.d.ts +4 -0
- package/dist/modern/yjs/createYHandler.d.ts +5 -0
- package/dist/modern/yjs/downloadYDocsFromServer.d.ts +3 -0
- package/dist/modern/yjs/getUpdatesTable.d.ts +3 -0
- package/dist/modern/yjs/listUpdatesSince.d.ts +2 -0
- package/dist/modern/yjs/listYClientMessagesAndStateVector.d.ts +26 -0
- package/dist/modern/yjs/reopenDocSignal.d.ts +10 -0
- package/dist/modern/yjs/updateYSyncStates.d.ts +6 -0
- package/dist/umd/define-ydoc-trigger.d.ts +2 -0
- package/dist/umd/dexie-cloud-addon.js +9 -4
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +9 -4
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/dist/umd/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +1 -0
- package/dist/umd/yjs/Y.d.ts +3 -0
- package/dist/umd/yjs/YDexieCloudSyncState.d.ts +3 -0
- package/dist/umd/yjs/YTable.d.ts +2 -0
- package/dist/umd/yjs/applyYMessages.d.ts +9 -0
- package/dist/umd/yjs/awareness.d.ts +4 -0
- package/dist/umd/yjs/createYClientUpdateObservable.d.ts +4 -0
- package/dist/umd/yjs/createYHandler.d.ts +5 -0
- package/dist/umd/yjs/downloadYDocsFromServer.d.ts +3 -0
- package/dist/umd/yjs/getUpdatesTable.d.ts +3 -0
- package/dist/umd/yjs/listUpdatesSince.d.ts +2 -0
- package/dist/umd/yjs/listYClientMessagesAndStateVector.d.ts +26 -0
- package/dist/umd/yjs/reopenDocSignal.d.ts +10 -0
- package/dist/umd/yjs/updateYSyncStates.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEXIE_CLOUD_SYNCER_ID = "dexie-cloud-syncer";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DexieCloudDB } from '../db/DexieCloudDB';
|
|
2
|
+
import { YServerMessage } from 'dexie-cloud-common';
|
|
3
|
+
export declare function applyYServerMessages(yMessages: YServerMessage[], db: DexieCloudDB): Promise<{
|
|
4
|
+
receivedUntils: {
|
|
5
|
+
[yTable: string]: number;
|
|
6
|
+
};
|
|
7
|
+
resyncNeeded: boolean;
|
|
8
|
+
yServerRevision?: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DexieCloudDB } from "../db/DexieCloudDB";
|
|
2
|
+
export declare function getAwarenessLibrary(db: DexieCloudDB): typeof import('y-protocols/awareness');
|
|
3
|
+
export declare const awarenessWeakMap: WeakMap<any, import("y-protocols/awareness").Awareness>;
|
|
4
|
+
export declare const getDocAwareness: (doc: any) => import("y-protocols/awareness").Awareness | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DexieCloudDB } from '../db/DexieCloudDB';
|
|
2
|
+
import { PersistedSyncState } from '../db/entities/PersistedSyncState';
|
|
3
|
+
export declare function downloadYDocsFromServer(db: DexieCloudDB, databaseUrl: string, { yDownloadedRealms, realms }: PersistedSyncState): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Table } from 'dexie';
|
|
2
|
+
import type { YClientMessage } from 'dexie-cloud-common';
|
|
3
|
+
import { DexieCloudDB } from '../db/DexieCloudDB';
|
|
4
|
+
import { EntityCommon } from '../db/entities/EntityCommon';
|
|
5
|
+
/** Queries the local database for YMessages to send to server.
|
|
6
|
+
*
|
|
7
|
+
* There are 2 messages that this function can provide:
|
|
8
|
+
* YUpdateFromClientRequest ( for local updates )
|
|
9
|
+
* YStateVector ( for state vector of foreign updates so that server can reduce the number of udpates to send back )
|
|
10
|
+
*
|
|
11
|
+
* Notice that we do not do a step 1 sync phase here to get a state vector from the server. Reason we can avoid
|
|
12
|
+
* the 2-step sync is that we are client-server and not client-client here and we keep track of the client changes
|
|
13
|
+
* sent to server by letting server acknowledge them. There is always a chance that some client update has already
|
|
14
|
+
* been sent and that the client failed to receive the ack. However, if this happens it does not matter - the change
|
|
15
|
+
* would be sent again and Yjs handles duplicate changes anyway. And it's rare so we earn the cost of roundtrips by
|
|
16
|
+
* avoiding the step1 sync and instead keep track of this in the `unsentFrom` property of the SyncState.
|
|
17
|
+
*
|
|
18
|
+
* @param db
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function listYClientMessagesAndStateVector(db: DexieCloudDB, tablesToSync: Table<EntityCommon>[]): Promise<{
|
|
22
|
+
yMessages: YClientMessage[];
|
|
23
|
+
lastUpdateIds: {
|
|
24
|
+
[yTable: string]: number;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { YjsDoc } from "dexie";
|
|
2
|
+
import { Subject } from "rxjs";
|
|
3
|
+
/** A property (package-private) on Y.Doc that is used
|
|
4
|
+
* to signal that the server wants us to send a 'doc-open' message
|
|
5
|
+
* to the server for this document.
|
|
6
|
+
*
|
|
7
|
+
* @param doc
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOpenDocSignal(doc: YjsDoc): Subject<void>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.0.
|
|
11
|
+
* Version 4.0.12, Mon Jun 09 2025
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -3755,6 +3755,9 @@
|
|
|
3755
3755
|
serverRev,
|
|
3756
3756
|
};
|
|
3757
3757
|
}));
|
|
3758
|
+
// Clean up baseRevs for tables that do not exist anymore or are no longer marked for sync
|
|
3759
|
+
// Resolve #2168 by also cleaning up baseRevs for tables that are not marked for sync
|
|
3760
|
+
yield db.$baseRevs.where('tableName').noneOf(Object.keys(schema).filter((table) => schema[table].markedForSync)).delete();
|
|
3758
3761
|
});
|
|
3759
3762
|
}
|
|
3760
3763
|
|
|
@@ -3960,7 +3963,9 @@
|
|
|
3960
3963
|
//
|
|
3961
3964
|
const [clientChangeSet, syncState, baseRevs] = yield db.transaction('r', db.tables, () => __awaiter(this, void 0, void 0, function* () {
|
|
3962
3965
|
const syncState = yield db.getPersistedSyncState();
|
|
3963
|
-
|
|
3966
|
+
let baseRevs = yield db.$baseRevs.toArray();
|
|
3967
|
+
// Resolve #2168
|
|
3968
|
+
baseRevs = baseRevs.filter(br => tablesToSync.some(tbl => tbl.name === br.tableName));
|
|
3964
3969
|
let clientChanges = yield listClientChanges(mutationTables);
|
|
3965
3970
|
throwIfCancelled(cancelToken);
|
|
3966
3971
|
if (doSyncify) {
|
|
@@ -6315,7 +6320,7 @@
|
|
|
6315
6320
|
const syncComplete = new rxjs.Subject();
|
|
6316
6321
|
dexie.cloud = {
|
|
6317
6322
|
// @ts-ignore
|
|
6318
|
-
version: "4.0.
|
|
6323
|
+
version: "4.0.12",
|
|
6319
6324
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
6320
6325
|
schema: null,
|
|
6321
6326
|
get currentUserId() {
|
|
@@ -6610,7 +6615,7 @@
|
|
|
6610
6615
|
}
|
|
6611
6616
|
}
|
|
6612
6617
|
// @ts-ignore
|
|
6613
|
-
dexieCloud.version = "4.0.
|
|
6618
|
+
dexieCloud.version = "4.0.12";
|
|
6614
6619
|
Dexie.Cloud = dexieCloud;
|
|
6615
6620
|
|
|
6616
6621
|
exports.default = dexieCloud;
|