cry-synced-db-client 0.1.5 → 0.1.7
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/db/RestProxy.d.ts +3 -3
- package/dist/db/SyncedDb.d.ts +9 -0
- package/dist/index.js +2303 -19
- package/dist/types/I_SyncedDb.d.ts +54 -1
- package/package.json +4 -3
package/dist/db/RestProxy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AggregateOptions, Timestamp } from "mongodb";
|
|
2
2
|
import type { I_RestInterface, QuerySpec, QueryOpts, GetNewerSpec, BatchSpec, CollectionUpdateRequest, CollectionUpdateResult } from "../types/I_RestInterface";
|
|
3
3
|
/** Progress callback for tracking upload progress */
|
|
4
4
|
export type ProgressCallback = (sentBytes: number, totalBytes: number) => void;
|
|
@@ -55,8 +55,8 @@ export interface RestProxyConfig {
|
|
|
55
55
|
*
|
|
56
56
|
* ## Dependencies
|
|
57
57
|
*
|
|
58
|
-
* - `
|
|
59
|
-
*
|
|
58
|
+
* - `msgpackr` - MessagePack encoding/decoding with structuredClone support for
|
|
59
|
+
* complex types (Date, Map, Set, RegExp, etc.)
|
|
60
60
|
*/
|
|
61
61
|
export declare class RestProxy implements I_RestInterface {
|
|
62
62
|
private endpoint;
|
package/dist/db/SyncedDb.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare class SyncedDb implements I_SyncedDb {
|
|
|
22
22
|
private onServerWriteResult?;
|
|
23
23
|
private onFindNewerManyCall?;
|
|
24
24
|
private onFindNewerCall?;
|
|
25
|
+
private onDexieWriteRequest?;
|
|
26
|
+
private onDexieWriteResult?;
|
|
25
27
|
private autoSyncIntervalMs?;
|
|
26
28
|
private online;
|
|
27
29
|
private syncing;
|
|
@@ -87,6 +89,8 @@ export declare class SyncedDb implements I_SyncedDb {
|
|
|
87
89
|
getDebounceDexieWritesMs(): number;
|
|
88
90
|
getDebounceRestWritesMs(): number;
|
|
89
91
|
getDirty<T extends DbEntity>(): Promise<Readonly<Record<string, readonly T[]>>>;
|
|
92
|
+
deleteCollectionData(collection: string, force?: boolean): Promise<boolean>;
|
|
93
|
+
deleteAllCollectionsData(force?: boolean): Promise<boolean>;
|
|
90
94
|
private assertCollection;
|
|
91
95
|
private stripLocalFields;
|
|
92
96
|
private getPendingKey;
|
|
@@ -102,6 +106,11 @@ export declare class SyncedDb implements I_SyncedDb {
|
|
|
102
106
|
*/
|
|
103
107
|
private executeRestUpload;
|
|
104
108
|
private flushAllPendingChanges;
|
|
109
|
+
private flushPendingChangesForCollection;
|
|
110
|
+
/**
|
|
111
|
+
* Upload dirty items for a single collection to the server
|
|
112
|
+
*/
|
|
113
|
+
private uploadDirtyItemsForCollection;
|
|
105
114
|
private recoverPendingWrites;
|
|
106
115
|
/**
|
|
107
116
|
* Sinhronizira eno samo kolekcijo - uporabi se pri handleServerUpdate za updateMany/deleteMany
|