@prestizni-software/server-dem 0.6.6 → 0.6.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/AutoUpdateServerManagerClass.d.ts +3 -0
- package/dist/AutoUpdateServerManagerClass.js +74 -1
- package/dist/AutoUpdateServerManagerClass.js.map +1 -1
- package/dist/AutoUpdatedServerObjectClass.js +6 -0
- package/dist/AutoUpdatedServerObjectClass.js.map +1 -1
- package/dist/CommonTypes.d.ts +7 -1
- package/dist/CommonTypes.js +7 -0
- package/dist/CommonTypes.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/sync/ClientStateReconciler.d.ts +41 -0
- package/dist/sync/ClientStateReconciler.js +162 -0
- package/dist/sync/ClientStateReconciler.js.map +1 -0
- package/dist/sync/ServerChangeTracker.d.ts +50 -0
- package/dist/sync/ServerChangeTracker.js +181 -0
- package/dist/sync/ServerChangeTracker.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.js +8 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/storage/IClientStorageAdapter.d.ts +23 -0
- package/dist/sync/storage/IClientStorageAdapter.js +2 -0
- package/dist/sync/storage/IClientStorageAdapter.js.map +1 -0
- package/dist/sync/storage/IndexedDbStorageAdapter.d.ts +22 -0
- package/dist/sync/storage/IndexedDbStorageAdapter.js +125 -0
- package/dist/sync/storage/IndexedDbStorageAdapter.js.map +1 -0
- package/dist/sync/storage/LocalStorageAdapter.d.ts +27 -0
- package/dist/sync/storage/LocalStorageAdapter.js +85 -0
- package/dist/sync/storage/LocalStorageAdapter.js.map +1 -0
- package/dist/sync/storage/MemoryStorageAdapter.d.ts +13 -0
- package/dist/sync/storage/MemoryStorageAdapter.js +25 -0
- package/dist/sync/storage/MemoryStorageAdapter.js.map +1 -0
- package/dist/sync/types.d.ts +67 -0
- package/dist/sync/types.js +5 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types and interfaces for DEM Delta Synchronization & Change Tracking.
|
|
3
|
+
*/
|
|
4
|
+
export type ChangeType = "create" | "update" | "delete";
|
|
5
|
+
export interface ChangeEntry<T = unknown> {
|
|
6
|
+
revision: number;
|
|
7
|
+
type: ChangeType;
|
|
8
|
+
id: string;
|
|
9
|
+
data?: Partial<T>;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
estimatedBytes: number;
|
|
12
|
+
}
|
|
13
|
+
export type PruneMode = "either" | "both";
|
|
14
|
+
export interface ChangeLogOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Maximum age of entries in milliseconds (TTL).
|
|
17
|
+
* E.g. 7 * 24 * 60 * 60 * 1000 for 7 days.
|
|
18
|
+
*/
|
|
19
|
+
maxAgeMs?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum estimated size of all entries combined in bytes.
|
|
22
|
+
* E.g. 10 * 1024 * 1024 for 10 MB.
|
|
23
|
+
*/
|
|
24
|
+
maxSizeBytes?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of entries to retain.
|
|
27
|
+
*/
|
|
28
|
+
maxEntries?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Pruning policy when both conditions are specified:
|
|
31
|
+
* - 'either': prune if entry exceeds maxAge OR total size exceeds maxSizeBytes (default)
|
|
32
|
+
* - 'both': prune only if BOTH conditions are violated
|
|
33
|
+
*/
|
|
34
|
+
pruneMode?: PruneMode;
|
|
35
|
+
}
|
|
36
|
+
export interface DeltaSyncPayload<T = unknown> {
|
|
37
|
+
status: "up-to-date" | "delta" | "full";
|
|
38
|
+
revision: number;
|
|
39
|
+
changes?: ChangeEntry<T>[];
|
|
40
|
+
ids?: string[];
|
|
41
|
+
objects?: T[];
|
|
42
|
+
properties?: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface StoredManagerState<T = unknown> {
|
|
45
|
+
className: string;
|
|
46
|
+
revision: number;
|
|
47
|
+
ids: string[];
|
|
48
|
+
objects: T[];
|
|
49
|
+
properties: string[];
|
|
50
|
+
savedAt: number;
|
|
51
|
+
}
|
|
52
|
+
export interface ClientDeltaSyncOptions {
|
|
53
|
+
/**
|
|
54
|
+
* The storage adapter instance to use for client caching and offline persistence.
|
|
55
|
+
*/
|
|
56
|
+
storage?: import("./storage/IClientStorageAdapter.js").IClientStorageAdapter;
|
|
57
|
+
/**
|
|
58
|
+
* Optional custom identifier for cache namespace.
|
|
59
|
+
*/
|
|
60
|
+
cacheKeyPrefix?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ServerDeltaSyncOptions extends ChangeLogOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Set to false to disable change tracking on the server manager.
|
|
65
|
+
*/
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|