@nahisaho/yata-global 1.6.6
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/api-client.d.ts +71 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +165 -0
- package/dist/api-client.js.map +1 -0
- package/dist/cache-manager.d.ts +122 -0
- package/dist/cache-manager.d.ts.map +1 -0
- package/dist/cache-manager.js +376 -0
- package/dist/cache-manager.js.map +1 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +548 -0
- package/dist/index.js.map +1 -0
- package/dist/kgpr/index.d.ts +12 -0
- package/dist/kgpr/index.d.ts.map +1 -0
- package/dist/kgpr/index.js +12 -0
- package/dist/kgpr/index.js.map +1 -0
- package/dist/kgpr/kgpr-manager.d.ts +162 -0
- package/dist/kgpr/kgpr-manager.d.ts.map +1 -0
- package/dist/kgpr/kgpr-manager.js +465 -0
- package/dist/kgpr/kgpr-manager.js.map +1 -0
- package/dist/kgpr/merge-engine.d.ts +269 -0
- package/dist/kgpr/merge-engine.d.ts.map +1 -0
- package/dist/kgpr/merge-engine.js +451 -0
- package/dist/kgpr/merge-engine.js.map +1 -0
- package/dist/kgpr/notification-service.d.ts +227 -0
- package/dist/kgpr/notification-service.d.ts.map +1 -0
- package/dist/kgpr/notification-service.js +440 -0
- package/dist/kgpr/notification-service.js.map +1 -0
- package/dist/kgpr/privacy-filter.d.ts +61 -0
- package/dist/kgpr/privacy-filter.d.ts.map +1 -0
- package/dist/kgpr/privacy-filter.js +191 -0
- package/dist/kgpr/privacy-filter.js.map +1 -0
- package/dist/kgpr/types.d.ts +303 -0
- package/dist/kgpr/types.d.ts.map +1 -0
- package/dist/kgpr/types.js +40 -0
- package/dist/kgpr/types.js.map +1 -0
- package/dist/sync-engine.d.ts +104 -0
- package/dist/sync-engine.d.ts.map +1 -0
- package/dist/sync-engine.js +275 -0
- package/dist/sync-engine.js.map +1 -0
- package/dist/types.d.ts +353 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YATA Global - Sync Engine
|
|
3
|
+
*
|
|
4
|
+
* Handles synchronization between local cache and YATA Global server
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module @nahisaho/yata-global
|
|
8
|
+
*
|
|
9
|
+
* @see REQ-YG-SYNC-001
|
|
10
|
+
*/
|
|
11
|
+
import { EventEmitter } from 'events';
|
|
12
|
+
import type { SharedPattern, SyncConfig, SyncResult, SyncStatus } from './types.js';
|
|
13
|
+
import { ApiClient } from './api-client.js';
|
|
14
|
+
import { CacheManager } from './cache-manager.js';
|
|
15
|
+
/**
|
|
16
|
+
* Sync engine events
|
|
17
|
+
*/
|
|
18
|
+
export interface SyncEngineEvents {
|
|
19
|
+
'sync:start': void;
|
|
20
|
+
'sync:progress': {
|
|
21
|
+
phase: string;
|
|
22
|
+
progress: number;
|
|
23
|
+
};
|
|
24
|
+
'sync:complete': SyncResult;
|
|
25
|
+
'sync:error': Error;
|
|
26
|
+
'conflict': {
|
|
27
|
+
type: 'framework' | 'pattern';
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sync engine for YATA Global
|
|
33
|
+
*/
|
|
34
|
+
export declare class SyncEngine extends EventEmitter {
|
|
35
|
+
private apiClient;
|
|
36
|
+
private cacheManager;
|
|
37
|
+
private config;
|
|
38
|
+
private syncInProgress;
|
|
39
|
+
private lastError;
|
|
40
|
+
private pendingChanges;
|
|
41
|
+
private syncTimer;
|
|
42
|
+
constructor(apiClient: ApiClient, cacheManager: CacheManager, config: SyncConfig);
|
|
43
|
+
/**
|
|
44
|
+
* Get current sync status
|
|
45
|
+
*/
|
|
46
|
+
getStatus(): SyncStatus;
|
|
47
|
+
/**
|
|
48
|
+
* Count pending changes
|
|
49
|
+
*/
|
|
50
|
+
private countPendingChanges;
|
|
51
|
+
/**
|
|
52
|
+
* Start automatic sync
|
|
53
|
+
*/
|
|
54
|
+
startAutoSync(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Stop automatic sync
|
|
57
|
+
*/
|
|
58
|
+
stopAutoSync(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Queue pattern for creation
|
|
61
|
+
*/
|
|
62
|
+
queuePatternCreate(pattern: Omit<SharedPattern, 'id' | 'authorId' | 'rating' | 'downloads' | 'createdAt' | 'updatedAt'>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Queue pattern update
|
|
65
|
+
*/
|
|
66
|
+
queuePatternUpdate(id: string, updates: Partial<SharedPattern>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Queue pattern deletion
|
|
69
|
+
*/
|
|
70
|
+
queuePatternDelete(id: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Queue pattern rating
|
|
73
|
+
*/
|
|
74
|
+
queueRating(patternId: string, rating: 1 | 2 | 3 | 4 | 5): void;
|
|
75
|
+
/**
|
|
76
|
+
* Perform full sync
|
|
77
|
+
*/
|
|
78
|
+
sync(): Promise<SyncResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Push local changes to server
|
|
81
|
+
*/
|
|
82
|
+
private pushChanges;
|
|
83
|
+
/**
|
|
84
|
+
* Pull remote changes from server
|
|
85
|
+
*/
|
|
86
|
+
private pullChanges;
|
|
87
|
+
/**
|
|
88
|
+
* Force refresh all data
|
|
89
|
+
*/
|
|
90
|
+
forceRefresh(): Promise<SyncResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Enable offline mode
|
|
93
|
+
*/
|
|
94
|
+
enableOfflineMode(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Disable offline mode
|
|
97
|
+
*/
|
|
98
|
+
disableOfflineMode(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Check if offline mode is enabled
|
|
101
|
+
*/
|
|
102
|
+
isOfflineMode(): boolean;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=sync-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../src/sync-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAEV,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA+BlD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,IAAI,CAAC;IACnB,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,KAAK,CAAC;IACpB,UAAU,EAAE;QAAE,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,cAAc,CAGpB;IACF,OAAO,CAAC,SAAS,CAA+B;gBAEpC,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU;IAOhF;;OAEG;IACH,SAAS,IAAI,UAAU;IAUvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;OAEG;IACH,aAAa,IAAI,IAAI;IAYrB;;OAEG;IACH,YAAY,IAAI,IAAI;IAOpB;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,IAAI;IAI9H;;OAEG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAIrE;;OAEG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;IAQ/D;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAgFjC;;OAEG;YACW,WAAW;IA4CzB;;OAEG;YACW,WAAW;IAuCzB;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC;IASzC;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAKzB;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAK1B;;OAEG;IACH,aAAa,IAAI,OAAO;CAGzB"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YATA Global - Sync Engine
|
|
3
|
+
*
|
|
4
|
+
* Handles synchronization between local cache and YATA Global server
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module @nahisaho/yata-global
|
|
8
|
+
*
|
|
9
|
+
* @see REQ-YG-SYNC-001
|
|
10
|
+
*/
|
|
11
|
+
import { EventEmitter } from 'events';
|
|
12
|
+
/**
|
|
13
|
+
* Sync engine for YATA Global
|
|
14
|
+
*/
|
|
15
|
+
export class SyncEngine extends EventEmitter {
|
|
16
|
+
apiClient;
|
|
17
|
+
cacheManager;
|
|
18
|
+
config;
|
|
19
|
+
syncInProgress = false;
|
|
20
|
+
lastError = null;
|
|
21
|
+
pendingChanges = {
|
|
22
|
+
patterns: { create: [], update: [], delete: [] },
|
|
23
|
+
ratings: [],
|
|
24
|
+
};
|
|
25
|
+
syncTimer = null;
|
|
26
|
+
constructor(apiClient, cacheManager, config) {
|
|
27
|
+
super();
|
|
28
|
+
this.apiClient = apiClient;
|
|
29
|
+
this.cacheManager = cacheManager;
|
|
30
|
+
this.config = config;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get current sync status
|
|
34
|
+
*/
|
|
35
|
+
getStatus() {
|
|
36
|
+
return {
|
|
37
|
+
lastSync: this.cacheManager.getLastSyncTime(),
|
|
38
|
+
inProgress: this.syncInProgress,
|
|
39
|
+
pendingChanges: this.countPendingChanges(),
|
|
40
|
+
lastError: this.lastError ?? undefined,
|
|
41
|
+
connected: !this.config.offlineMode,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Count pending changes
|
|
46
|
+
*/
|
|
47
|
+
countPendingChanges() {
|
|
48
|
+
return (this.pendingChanges.patterns.create.length +
|
|
49
|
+
this.pendingChanges.patterns.update.length +
|
|
50
|
+
this.pendingChanges.patterns.delete.length +
|
|
51
|
+
this.pendingChanges.ratings.length);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Start automatic sync
|
|
55
|
+
*/
|
|
56
|
+
startAutoSync() {
|
|
57
|
+
if (this.syncTimer)
|
|
58
|
+
return;
|
|
59
|
+
this.syncTimer = setInterval(() => {
|
|
60
|
+
if (!this.syncInProgress && !this.config.offlineMode) {
|
|
61
|
+
this.sync().catch(err => {
|
|
62
|
+
this.emit('sync:error', err);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, this.config.syncInterval * 1000);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Stop automatic sync
|
|
69
|
+
*/
|
|
70
|
+
stopAutoSync() {
|
|
71
|
+
if (this.syncTimer) {
|
|
72
|
+
clearInterval(this.syncTimer);
|
|
73
|
+
this.syncTimer = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Queue pattern for creation
|
|
78
|
+
*/
|
|
79
|
+
queuePatternCreate(pattern) {
|
|
80
|
+
this.pendingChanges.patterns.create.push(pattern);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Queue pattern update
|
|
84
|
+
*/
|
|
85
|
+
queuePatternUpdate(id, updates) {
|
|
86
|
+
this.pendingChanges.patterns.update.push({ id, updates });
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Queue pattern deletion
|
|
90
|
+
*/
|
|
91
|
+
queuePatternDelete(id) {
|
|
92
|
+
this.pendingChanges.patterns.delete.push(id);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Queue pattern rating
|
|
96
|
+
*/
|
|
97
|
+
queueRating(patternId, rating) {
|
|
98
|
+
// Remove any existing rating for this pattern
|
|
99
|
+
this.pendingChanges.ratings = this.pendingChanges.ratings.filter(r => r.patternId !== patternId);
|
|
100
|
+
this.pendingChanges.ratings.push({ patternId, rating });
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Perform full sync
|
|
104
|
+
*/
|
|
105
|
+
async sync() {
|
|
106
|
+
if (this.syncInProgress) {
|
|
107
|
+
return {
|
|
108
|
+
success: false,
|
|
109
|
+
frameworksPulled: 0,
|
|
110
|
+
patternsPulled: 0,
|
|
111
|
+
changesPushed: 0,
|
|
112
|
+
conflictsResolved: 0,
|
|
113
|
+
duration: 0,
|
|
114
|
+
error: 'Sync already in progress',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (this.config.offlineMode) {
|
|
118
|
+
return {
|
|
119
|
+
success: false,
|
|
120
|
+
frameworksPulled: 0,
|
|
121
|
+
patternsPulled: 0,
|
|
122
|
+
changesPushed: 0,
|
|
123
|
+
conflictsResolved: 0,
|
|
124
|
+
duration: 0,
|
|
125
|
+
error: 'Offline mode enabled',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
this.syncInProgress = true;
|
|
129
|
+
this.lastError = null;
|
|
130
|
+
const startTime = Date.now();
|
|
131
|
+
this.emit('sync:start');
|
|
132
|
+
try {
|
|
133
|
+
// Phase 1: Push local changes
|
|
134
|
+
this.emit('sync:progress', { phase: 'push', progress: 0 });
|
|
135
|
+
const changesPushed = await this.pushChanges();
|
|
136
|
+
// Phase 2: Pull remote changes
|
|
137
|
+
this.emit('sync:progress', { phase: 'pull', progress: 50 });
|
|
138
|
+
const { frameworksPulled, patternsPulled, conflictsResolved } = await this.pullChanges();
|
|
139
|
+
// Phase 3: Update cache metadata
|
|
140
|
+
this.emit('sync:progress', { phase: 'finalize', progress: 90 });
|
|
141
|
+
this.cacheManager.setLastSyncTime(new Date());
|
|
142
|
+
this.cacheManager.enforceMaxSize();
|
|
143
|
+
const result = {
|
|
144
|
+
success: true,
|
|
145
|
+
frameworksPulled,
|
|
146
|
+
patternsPulled,
|
|
147
|
+
changesPushed,
|
|
148
|
+
conflictsResolved,
|
|
149
|
+
duration: Date.now() - startTime,
|
|
150
|
+
};
|
|
151
|
+
this.emit('sync:complete', result);
|
|
152
|
+
this.emit('sync:progress', { phase: 'complete', progress: 100 });
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
157
|
+
this.lastError = errorMessage;
|
|
158
|
+
const result = {
|
|
159
|
+
success: false,
|
|
160
|
+
frameworksPulled: 0,
|
|
161
|
+
patternsPulled: 0,
|
|
162
|
+
changesPushed: 0,
|
|
163
|
+
conflictsResolved: 0,
|
|
164
|
+
duration: Date.now() - startTime,
|
|
165
|
+
error: errorMessage,
|
|
166
|
+
};
|
|
167
|
+
this.emit('sync:error', error instanceof Error ? error : new Error(errorMessage));
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
this.syncInProgress = false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Push local changes to server
|
|
176
|
+
*/
|
|
177
|
+
async pushChanges() {
|
|
178
|
+
let pushed = 0;
|
|
179
|
+
// Push pattern creations
|
|
180
|
+
for (const pattern of this.pendingChanges.patterns.create) {
|
|
181
|
+
const response = await this.apiClient.post('/patterns', pattern);
|
|
182
|
+
if (response.success) {
|
|
183
|
+
pushed++;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Push pattern updates
|
|
187
|
+
for (const { id, updates } of this.pendingChanges.patterns.update) {
|
|
188
|
+
const response = await this.apiClient.put(`/patterns/${id}`, updates);
|
|
189
|
+
if (response.success) {
|
|
190
|
+
pushed++;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Push pattern deletions
|
|
194
|
+
for (const id of this.pendingChanges.patterns.delete) {
|
|
195
|
+
const response = await this.apiClient.delete(`/patterns/${id}`);
|
|
196
|
+
if (response.success) {
|
|
197
|
+
pushed++;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Push ratings
|
|
201
|
+
for (const { patternId, rating } of this.pendingChanges.ratings) {
|
|
202
|
+
const response = await this.apiClient.post(`/patterns/${patternId}/rate`, { rating });
|
|
203
|
+
if (response.success) {
|
|
204
|
+
pushed++;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Clear pending changes
|
|
208
|
+
this.pendingChanges = {
|
|
209
|
+
patterns: { create: [], update: [], delete: [] },
|
|
210
|
+
ratings: [],
|
|
211
|
+
};
|
|
212
|
+
return pushed;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Pull remote changes from server
|
|
216
|
+
*/
|
|
217
|
+
async pullChanges() {
|
|
218
|
+
const lastSync = this.cacheManager.getLastSyncTime();
|
|
219
|
+
const since = lastSync ? lastSync.getTime() : 0;
|
|
220
|
+
// Get delta from server
|
|
221
|
+
const response = await this.apiClient.get('/sync/delta', { since });
|
|
222
|
+
if (!response.success || !response.data) {
|
|
223
|
+
throw new Error(response.error || 'Failed to get sync delta');
|
|
224
|
+
}
|
|
225
|
+
const delta = response.data;
|
|
226
|
+
let conflictsResolved = 0;
|
|
227
|
+
// Apply framework changes
|
|
228
|
+
if (delta.frameworks.added.length > 0 || delta.frameworks.updated.length > 0) {
|
|
229
|
+
const frameworks = [...delta.frameworks.added, ...delta.frameworks.updated];
|
|
230
|
+
this.cacheManager.cacheFrameworks(frameworks);
|
|
231
|
+
}
|
|
232
|
+
// Note: We don't delete frameworks locally, they just expire
|
|
233
|
+
// Apply pattern changes
|
|
234
|
+
if (delta.patterns.added.length > 0 || delta.patterns.updated.length > 0) {
|
|
235
|
+
const patterns = [...delta.patterns.added, ...delta.patterns.updated];
|
|
236
|
+
this.cacheManager.cachePatterns(patterns);
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
frameworksPulled: delta.frameworks.added.length + delta.frameworks.updated.length,
|
|
240
|
+
patternsPulled: delta.patterns.added.length + delta.patterns.updated.length,
|
|
241
|
+
conflictsResolved,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Force refresh all data
|
|
246
|
+
*/
|
|
247
|
+
async forceRefresh() {
|
|
248
|
+
// Clear all cache
|
|
249
|
+
this.cacheManager.clearAll();
|
|
250
|
+
this.cacheManager.setSyncMeta('last_sync', '0');
|
|
251
|
+
// Perform full sync
|
|
252
|
+
return this.sync();
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Enable offline mode
|
|
256
|
+
*/
|
|
257
|
+
enableOfflineMode() {
|
|
258
|
+
this.config.offlineMode = true;
|
|
259
|
+
this.stopAutoSync();
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Disable offline mode
|
|
263
|
+
*/
|
|
264
|
+
disableOfflineMode() {
|
|
265
|
+
this.config.offlineMode = false;
|
|
266
|
+
this.startAutoSync();
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Check if offline mode is enabled
|
|
270
|
+
*/
|
|
271
|
+
isOfflineMode() {
|
|
272
|
+
return this.config.offlineMode;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=sync-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-engine.js","sourceRoot":"","sources":["../src/sync-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAmDtC;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAClC,SAAS,CAAY;IACrB,YAAY,CAAe;IAC3B,MAAM,CAAa;IACnB,cAAc,GAAY,KAAK,CAAC;IAChC,SAAS,GAAkB,IAAI,CAAC;IAChC,cAAc,GAAmB;QACvC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAChD,OAAO,EAAE,EAAE;KACZ,CAAC;IACM,SAAS,GAA0B,IAAI,CAAC;IAEhD,YAAY,SAAoB,EAAE,YAA0B,EAAE,MAAkB;QAC9E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;YAC7C,UAAU,EAAE,IAAI,CAAC,cAAc;YAC/B,cAAc,EAAE,IAAI,CAAC,mBAAmB,EAAE;YAC1C,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;YACtC,SAAS,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;SACpC,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,O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