@narumitw/pi-sync 0.13.0 → 0.14.0

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/src/types.ts ADDED
@@ -0,0 +1,102 @@
1
+ export interface SyncConfig {
2
+ endpoint: string;
3
+ bucket: string;
4
+ region: string;
5
+ accessKeyId: string;
6
+ secretAccessKey: string;
7
+ sessionToken?: string;
8
+ profile: string;
9
+ prefix: string;
10
+ syncSessions: boolean;
11
+ extraFiles: string[];
12
+ }
13
+
14
+ export interface PartialConfig {
15
+ endpoint?: string;
16
+ bucket?: string;
17
+ region?: string;
18
+ accessKeyId?: string;
19
+ secretAccessKey?: string;
20
+ sessionToken?: string;
21
+ profile?: string;
22
+ prefix?: string;
23
+ autoSync?: boolean | string;
24
+ syncSessions?: boolean | string;
25
+ extraFiles?: unknown;
26
+ }
27
+
28
+ export interface SnapshotFile {
29
+ path: string;
30
+ contentBase64: string;
31
+ sha256: string;
32
+ }
33
+
34
+ export interface Snapshot {
35
+ version: number;
36
+ id: string;
37
+ createdAt: string;
38
+ machine: string;
39
+ profile: string;
40
+ syncSessions?: boolean;
41
+ files: SnapshotFile[];
42
+ }
43
+
44
+ export interface LatestPointer {
45
+ version: number;
46
+ profile: string;
47
+ snapshot: string;
48
+ sha256: string;
49
+ createdAt: string;
50
+ machine: string;
51
+ syncSessions?: boolean;
52
+ }
53
+
54
+ export interface RemoteObject<T> {
55
+ value?: T;
56
+ etag?: string;
57
+ missing: boolean;
58
+ }
59
+
60
+ export interface SyncState {
61
+ version: number;
62
+ profile: string;
63
+ lastAppliedSnapshot?: string;
64
+ lastRemoteEtag?: string;
65
+ lastFileHashes: Record<string, string>;
66
+ syncSessions?: boolean;
67
+ extraFiles?: string[];
68
+ }
69
+
70
+ export interface LockFile {
71
+ id: string;
72
+ pid: number;
73
+ command: string;
74
+ startedAt: string;
75
+ }
76
+
77
+ export interface CommandOptions {
78
+ yes: boolean;
79
+ force: boolean;
80
+ stale: boolean;
81
+ silent: boolean;
82
+ reload: boolean;
83
+ auto: boolean;
84
+ args: string[];
85
+ }
86
+
87
+ export interface CommandArgumentCompletion {
88
+ value: string;
89
+ label: string;
90
+ description?: string;
91
+ }
92
+
93
+ export interface SnapshotOptions {
94
+ syncSessions?: boolean;
95
+ sessionDir?: string;
96
+ extraFiles?: string[];
97
+ }
98
+
99
+ export interface SnapshotApplyPlan {
100
+ writes: Array<{ target: string; content: Buffer }>;
101
+ deletes: string[];
102
+ }