@filen/sync 0.1.1 → 0.1.3

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 (43) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +1 -1
  3. package/SECURITY.md +17 -17
  4. package/dist/constants.d.ts +7 -0
  5. package/dist/constants.js +51 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/ignorer.d.ts +14 -0
  8. package/dist/ignorer.js +69 -0
  9. package/dist/ignorer.js.map +1 -0
  10. package/dist/index.d.ts +27 -6
  11. package/dist/index.js +113 -13
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/deltas.d.ts +9 -31
  14. package/dist/lib/deltas.js +59 -65
  15. package/dist/lib/deltas.js.map +1 -1
  16. package/dist/lib/filesystems/local.d.ts +25 -20
  17. package/dist/lib/filesystems/local.js +203 -55
  18. package/dist/lib/filesystems/local.js.map +1 -1
  19. package/dist/lib/filesystems/remote.d.ts +18 -7
  20. package/dist/lib/filesystems/remote.js +435 -61
  21. package/dist/lib/filesystems/remote.js.map +1 -1
  22. package/dist/lib/ipc.d.ts +9 -0
  23. package/dist/lib/ipc.js +56 -0
  24. package/dist/lib/ipc.js.map +1 -0
  25. package/dist/lib/logger.d.ts +14 -0
  26. package/dist/lib/logger.js +93 -0
  27. package/dist/lib/logger.js.map +1 -0
  28. package/dist/lib/state.d.ts +4 -15
  29. package/dist/lib/state.js +16 -29
  30. package/dist/lib/state.js.map +1 -1
  31. package/dist/lib/sync.d.ts +23 -9
  32. package/dist/lib/sync.js +242 -28
  33. package/dist/lib/sync.js.map +1 -1
  34. package/dist/lib/tasks.d.ts +18 -33
  35. package/dist/lib/tasks.js +52 -29
  36. package/dist/lib/tasks.js.map +1 -1
  37. package/dist/types.d.ts +175 -0
  38. package/dist/utils.d.ts +24 -0
  39. package/dist/utils.js +132 -1
  40. package/dist/utils.js.map +1 -1
  41. package/package.json +60 -58
  42. package/tsconfig.json +24 -24
  43. package/index.d.ts +0 -298
package/index.d.ts DELETED
@@ -1,298 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- declare module "@gcas/fuse" {
4
- // Imported from @gcas/fuse, their module exported them wrong
5
- // Stats object produced by fuse index.js function getStatArray
6
-
7
- export interface Stats {
8
- mode: number
9
- uid: number
10
- gid: number
11
- size: number
12
- dev: number
13
- nlink: number
14
- ino: number
15
- rdev: number
16
- blksize: number
17
- blocks: number
18
- atime: Date
19
- mtime: Date
20
- ctime: Date
21
- }
22
-
23
- export interface OPERATIONS {
24
- init?: (cb: (err: number) => void) => void
25
- error?: (cb: (err: number) => void) => void
26
- access?: (path: string, mode: number, cb: (err: number) => void) => void
27
- statfs?: (
28
- path: string,
29
- cb: (
30
- err: number,
31
- stats?: {
32
- bsize: number
33
- frsize: number
34
- blocks: number
35
- bfree: number
36
- bavail: number
37
- files: number
38
- ffree: number
39
- favail: number
40
- fsid: number
41
- flag: number
42
- namemax: number
43
- }
44
- ) => void
45
- ) => void
46
- fgetattr?: (path: string, fd: number, cb: (err: number, stat?: Stats) => void) => void
47
- getattr?: (path: string, cb: (err: number, stat?: Stats) => void) => void
48
- flush?: (path: string, fd: number, cb: (err: number) => void) => void
49
- fsync?: (path: string, dataSync: boolean, fd: number, cb: (err: number) => void) => void
50
- fsyncdir?: (path: string, dataSync: boolean, fd: number, cb: (err: number) => void) => void
51
- readdir?: (path: string, cb: (err: number, names?: string[], stats?: Stats[]) => void) => void
52
- truncate?: (path: string, size: number, cb: (err: number) => void) => void
53
- ftruncate?: (path: string, fd: number, size: number, cb: (err: number) => void) => void
54
- utimens?: (path: string, atime: Date, mtime: Date, cb: (err: number) => void) => void
55
- readlink?: (path: string, cb: (err: number, linkName?: string) => void) => void
56
- chown?: (path: string, uid: number, gid: number, cb: (err: number) => void) => void
57
- chmod?: (path: string, mode: number, cb: (err: number) => void) => void
58
- mknod?: (path: string, mode: number, dev: number, cb: (err: number) => void) => void
59
- setxattr?: (path: string, name: string, value: Buffer, size: number, flags: number, cb: (err: number) => void) => void
60
- getxattr?: (path: string, name: string, size: number, cb: (err: number) => void) => void
61
- listxattr?: (path: string, cb: (err: number, list?: string[]) => void) => void
62
- removexattr?: (path: string, name: string, cb: (err: number) => void) => void
63
- open?: (path: string, mode: number, cb: (err: number, fd?: number) => void) => void
64
- opendir?: (path: string, mode: number, cb: (err: number, fd?: number) => void) => void
65
- read?: (
66
- path: string,
67
- fd: number,
68
- buffer: Buffer,
69
- length: number,
70
- position: number,
71
- // This contradicts the code in index.js for _op_read, where the callback signature is (err, bytesRead)
72
- // however, it appears that the calling code indeed interprets the "err" position as the value.
73
- cb: (bytesRead?: number) => void
74
- ) => void
75
- write?: (
76
- path: string,
77
- fd: number,
78
- buffer: Buffer,
79
- length: number,
80
- position: number,
81
- // This contradicts the code in index.js for _op_write, where the callback signature is (err, bytesWritten)
82
- // however, it appears that the calling code indeed interprets the "err" position as the value.
83
- cb: (bytesWritten?: number) => void
84
- ) => void
85
- // For every open() call there will be exactly one release() call with the same flags and
86
- // file handle. It is possible to have a file opened more than once, in which case only the
87
- // last release will mean, that no more reads/writes will happen on the file. The return
88
- // value of release is ignored.
89
- release?: (path: string, fd: number, cb: (err: number) => void) => void
90
- releasedir?: (path: string, fd: number, cb: (err: number) => void) => void
91
- create?: (path: string, mode: number, cb: (err: number, fd?: number, modePassedOn?: number) => void) => void
92
- unlink?: (path: string, cb: (err: number) => void) => void
93
- rename?: (src: string, dest: string, cb: (err: number) => void) => void
94
- link?: (src: string, dest: string, cb: (err: number) => void) => void
95
- symlink?: (src: string, dest: string, cb: (err: number) => void) => void
96
- mkdir?: (path: string, mode: number, cb: (err: number) => void) => void
97
- rmdir?: (path: string, cb: (err: number) => void) => void
98
- }
99
-
100
- // See https://github.com/gcasro/fuse
101
- // See https://man7.org/linux/man-pages/man8/mount.fuse3.8.html
102
- export interface OPTIONS {
103
- uid?: number
104
- gid?: number
105
- debug?: boolean
106
- force?: boolean
107
- timeout?: number
108
- allowOther?: boolean
109
- allowRoot?: boolean
110
- autoUnmount?: boolean
111
- defaultPermissions?: string
112
- blkdev?: string
113
- blksize?: number
114
- maxRead?: number
115
- fd?: number
116
- userId?: number
117
- fsname?: string
118
- subtype?: string
119
- kernelCache?: boolean
120
- autoCache?: boolean
121
- umask?: number
122
- entryTimeout?: number
123
- attrTimeout?: number
124
- acAttrTimeout?: number
125
- noforget?: boolean
126
- remember?: number
127
- modules?: string
128
- volname?: string
129
- volicon?: string | boolean
130
- displayFolder?: boolean
131
- }
132
-
133
- export default class Fuse {
134
- constructor(mnt: string, ops?: OPERATIONS, opts?: OPTIONS)
135
-
136
- // Added by @gcas/fuse
137
- static unmount: (mnt: string, cb: (err: null | Error) => void) => any
138
- static beforeMount: (cb: (err: null | Error) => any) => void
139
- static beforeUnmount: (cb: (err: null | Error) => any) => void
140
- static configure: (cb: (err: null | Error) => any) => void
141
- static unconfigure: (cb: (err: null | Error) => any) => void
142
- static isConfigured: (cb: (err: null | Error, result: boolean) => any) => void
143
-
144
- // Error codes - numeric value retrieved from Fuse instance with errno(code)
145
- static EPERM: -1
146
- static ENOENT: -2
147
- static ESRCH: -3
148
- static EINTR: -4
149
- static EIO: -5
150
- static ENXIO: -6
151
- static E2BIG: -7
152
- static ENOEXEC: -8
153
- static EBADF: -9
154
- static ECHILD: -10
155
- static EAGAIN: -11
156
- static ENOMEM: -12
157
- static EACCES: -13
158
- static EFAULT: -14
159
- static ENOTBLK: -15
160
- static EBUSY: -16
161
- static EEXIST: -17
162
- static EXDEV: -18
163
- static ENODEV: -19
164
- static ENOTDIR: -20
165
- static EISDIR: -21
166
- static EINVAL: -22
167
- static ENFILE: -23
168
- static EMFILE: -24
169
- static ENOTTY: -25
170
- static ETXTBSY: -26
171
- static EFBIG: -27
172
- static ENOSPC: -28
173
- static ESPIPE: -29
174
- static EROFS: -30
175
- static EMLINK: -31
176
- static EPIPE: -32
177
- static EDOM: -33
178
- static ERANGE: -34
179
- static EDEADLK: -35
180
- static ENAMETOOLONG: -36
181
- static ENOLCK: -37
182
- static ENOSYS: -38
183
- static ENOTEMPTY: -39
184
- static ELOOP: -40
185
- static EWOULDBLOCK: -11
186
- static ENOMSG: -42
187
- static EIDRM: -43
188
- static ECHRNG: -44
189
- static EL2NSYNC: -45
190
- static EL3HLT: -46
191
- static EL3RST: -47
192
- static ELNRNG: -48
193
- static EUNATCH: -49
194
- static ENOCSI: -50
195
- static EL2HLT: -51
196
- static EBADE: -52
197
- static EBADR: -53
198
- static EXFULL: -54
199
- static ENOANO: -55
200
- static EBADRQC: -56
201
- static EBADSLT: -57
202
- static EDEADLOCK: -35
203
- static EBFONT: -59
204
- static ENOSTR: -60
205
- static ENODATA: -61
206
- static ETIME: -62
207
- static ENOSR: -63
208
- static ENONET: -64
209
- static ENOPKG: -65
210
- static EREMOTE: -66
211
- static ENOLINK: -67
212
- static EADV: -68
213
- static ESRMNT: -69
214
- static ECOMM: -70
215
- static EPROTO: -71
216
- static EMULTIHOP: -72
217
- static EDOTDOT: -73
218
- static EBADMSG: -74
219
- static EOVERFLOW: -75
220
- static ENOTUNIQ: -76
221
- static EBADFD: -77
222
- static EREMCHG: -78
223
- static ELIBACC: -79
224
- static ELIBBAD: -80
225
- static ELIBSCN: -81
226
- static ELIBMAX: -82
227
- static ELIBEXEC: -83
228
- static EILSEQ: -84
229
- static ERESTART: -85
230
- static ESTRPIPE: -86
231
- static EUSERS: -87
232
- static ENOTSOCK: -88
233
- static EDESTADDRREQ: -89
234
- static EMSGSIZE: -90
235
- static EPROTOTYPE: -91
236
- static ENOPROTOOPT: -92
237
- static EPROTONOSUPPORT: -93
238
- static ESOCKTNOSUPPORT: -94
239
- static EOPNOTSUPP: -95
240
- static EPFNOSUPPORT: -96
241
- static EAFNOSUPPORT: -97
242
- static EADDRINUSE: -98
243
- static EADDRNOTAVAIL: -99
244
- static ENETDOWN: -100
245
- static ENETUNREACH: -101
246
- static ENETRESET: -102
247
- static ECONNABORTED: -103
248
- static ECONNRESET: -104
249
- static ENOBUFS: -105
250
- static EISCONN: -106
251
- static ENOTCONN: -107
252
- static ESHUTDOWN: -108
253
- static ETOOMANYREFS: -109
254
- static ETIMEDOUT: -110
255
- static ECONNREFUSED: -111
256
- static EHOSTDOWN: -112
257
- static EHOSTUNREACH: -113
258
- static EALREADY: -114
259
- static EINPROGRESS: -115
260
- static ESTALE: -116
261
- static EUCLEAN: -117
262
- static ENOTNAM: -118
263
- static ENAVAIL: -119
264
- static EISNAM: -120
265
- static EREMOTEIO: -121
266
- static EDQUOT: -122
267
- static ENOMEDIUM: -123
268
- static EMEDIUMTYPE: -124
269
-
270
- public opts: OPTIONS
271
- public mnt: string
272
- public ops: OPERATIONS
273
- public timeout: number
274
-
275
- public mount: (cb: (err: null | Error) => any) => void
276
- public unmount: (cb: (err: null | Error) => any) => void
277
- public errno: (code?: string) => number
278
-
279
- // From "nanoresource"
280
- // See https://github.com/mafintosh/nanoresource/blob/master/index.js
281
- public opening: boolean
282
- public opened: boolean
283
- public closing: boolean
284
- public closed: boolean
285
- public actives: number
286
-
287
- public open(cb: (err: Error) => any): void
288
-
289
- public active(cb?: (err: Error) => any): boolean
290
-
291
- public inactive(): void
292
- public inactive(cb: (err: Error, val: any) => any, err: null, val: any): void
293
- public inactive(cb: (err: Error, val: any) => any, err: Error): void
294
-
295
- public close(cb?: (err?: Error) => any): void
296
- public close(allowActive: boolean, cb: (err?: Error) => any): void
297
- }
298
- }