Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/conat/hub/api/sync.ts
1712 views
1
import { authFirst } from "./util";
2
3
export interface Patch {
4
seq: number;
5
time: number;
6
mesg: {
7
time: number;
8
wall: number;
9
patch: string;
10
user_id: number;
11
is_snapshot?: boolean;
12
parents: number[];
13
version?: number;
14
};
15
}
16
17
export interface HistoryInfo {
18
doctype: string;
19
init: { time: Date; size: number; error: string };
20
last_active: Date;
21
path: string;
22
project_id: string;
23
read_only: boolean;
24
save: {
25
state: string;
26
error: string;
27
hash: number;
28
time: number;
29
expected_hash: number;
30
};
31
string_id: string;
32
users: string[];
33
}
34
35
export interface Sync {
36
history: (opts: {
37
account_id?: string;
38
project_id: string;
39
path: string;
40
}) => Promise<{ patches: Patch[] }>;
41
}
42
43
export const sync = {
44
history: authFirst,
45
};
46
47