@solazah/solazah-runtime 0.0.171 → 0.0.172

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/Sync.d.ts +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solazah/solazah-runtime",
3
- "version": "0.0.171",
3
+ "version": "0.0.172",
4
4
  "main": "index.cjs",
5
5
  "module": "index.js",
6
6
  "types": "types/index.d.ts",
package/types/Sync.d.ts CHANGED
@@ -31,6 +31,18 @@ export interface SyncAppliedPayload {
31
31
  db?: boolean;
32
32
  files?: boolean;
33
33
  }
34
+ /** 一条同步变更日志(仅记"有活动/出错"的同步),给账号-同步页排障。 */
35
+ export interface SyncLogEntry {
36
+ at: number;
37
+ reason: string;
38
+ ns: string;
39
+ dbPulled: number;
40
+ dbPushed: number;
41
+ filesPulled: number;
42
+ filesPushed: number;
43
+ ok: boolean;
44
+ error?: string;
45
+ }
34
46
  /**
35
47
  * window.sync —— 数据库/工作空间同步的公共 API(sync.* IPC)。
36
48
  * 状态变更通过 ipcRenderer 的 "sync.statusChanged" 事件推送(渲染层自行监听)。
@@ -51,6 +63,8 @@ export default class Sync {
51
63
  configure: (patch: SyncConfigPatch) => Promise<SyncStatusDto>;
52
64
  /** 立即同步一次,返回最新状态。 */
53
65
  now: () => Promise<SyncStatusDto>;
66
+ /** 读同步变更日志(最新在前),给账号-同步页排障。 */
67
+ getLog: (limit?: number) => Promise<SyncLogEntry[]>;
54
68
  /**
55
69
  * 订阅"同步已应用"(主进程拉到远端 DB/文件变更后广播)→ 据此重拉刷新。返回退订闭包。
56
70
  * 多订阅者共用单条 ipcRenderer 通道(宿主 on 会 removeAllListeners,故在本实例内自行分发)。