@filen/sync 0.1.1 → 0.1.4
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/LICENSE +661 -661
- package/README.md +1 -1
- package/SECURITY.md +17 -17
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +51 -1
- package/dist/constants.js.map +1 -1
- package/dist/ignorer.d.ts +14 -0
- package/dist/ignorer.js +69 -0
- package/dist/ignorer.js.map +1 -0
- package/dist/index.d.ts +31 -17
- package/dist/index.js +125 -24
- package/dist/index.js.map +1 -1
- package/dist/lib/deltas.d.ts +9 -31
- package/dist/lib/deltas.js +194 -99
- package/dist/lib/deltas.js.map +1 -1
- package/dist/lib/filesystems/local.d.ts +32 -43
- package/dist/lib/filesystems/local.js +383 -106
- package/dist/lib/filesystems/local.js.map +1 -1
- package/dist/lib/filesystems/remote.d.ts +21 -7
- package/dist/lib/filesystems/remote.js +531 -67
- package/dist/lib/filesystems/remote.js.map +1 -1
- package/dist/lib/ipc.d.ts +9 -0
- package/dist/lib/ipc.js +60 -0
- package/dist/lib/ipc.js.map +1 -0
- package/dist/lib/lock.d.ts +13 -0
- package/dist/lib/lock.js +73 -0
- package/dist/lib/lock.js.map +1 -0
- package/dist/lib/logger.d.ts +14 -0
- package/dist/lib/logger.js +93 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/state.d.ts +4 -15
- package/dist/lib/state.js +106 -87
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/sync.d.ts +30 -10
- package/dist/lib/sync.js +363 -36
- package/dist/lib/sync.js.map +1 -1
- package/dist/lib/tasks.d.ts +27 -40
- package/dist/lib/tasks.js +397 -48
- package/dist/lib/tasks.js.map +1 -1
- package/dist/types.d.ts +340 -0
- package/dist/utils.d.ts +42 -0
- package/dist/utils.js +164 -1
- package/dist/utils.js.map +1 -1
- package/index.d.ts +6 -295
- package/jest.config.js +5 -0
- package/package.json +62 -58
- package/tests/utils.test.ts +33 -0
- package/tsconfig.json +24 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type Sync from "../sync";
|
|
3
|
-
import type
|
|
3
|
+
import { type CloudItemTree, type FSItemType } from "@filen/sdk";
|
|
4
4
|
import fs from "fs-extra";
|
|
5
|
-
import type
|
|
5
|
+
import { type DistributiveOmit, type Prettify } from "../../types";
|
|
6
6
|
export type RemoteItem = Prettify<DistributiveOmit<CloudItemTree, "parent"> & {
|
|
7
7
|
path: string;
|
|
8
8
|
}>;
|
|
@@ -12,6 +12,11 @@ export type RemoteTree = {
|
|
|
12
12
|
tree: RemoteDirectoryTree;
|
|
13
13
|
uuids: RemoteDirectoryUUIDs;
|
|
14
14
|
};
|
|
15
|
+
export type RemoteTreeIgnored = {
|
|
16
|
+
localPath: string;
|
|
17
|
+
relativePath: string;
|
|
18
|
+
reason: "dotFile" | "invalidPath" | "remoteIgnore" | "pathLength" | "nameLength" | "defaultIgnore" | "empty";
|
|
19
|
+
};
|
|
15
20
|
export declare class RemoteFileSystem {
|
|
16
21
|
private readonly sync;
|
|
17
22
|
getDirectoryTreeCache: {
|
|
@@ -19,12 +24,18 @@ export declare class RemoteFileSystem {
|
|
|
19
24
|
tree: RemoteDirectoryTree;
|
|
20
25
|
uuids: RemoteDirectoryUUIDs;
|
|
21
26
|
};
|
|
27
|
+
previousTreeRawResponse: string;
|
|
22
28
|
private readonly mutex;
|
|
23
29
|
private readonly mkdirMutex;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
readonly itemsMutex: import("../../semaphore").ISemaphore;
|
|
31
|
+
private deviceIdCache;
|
|
32
|
+
constructor(sync: Sync);
|
|
33
|
+
getDeviceId(): Promise<string>;
|
|
34
|
+
getDirectoryTree(skipCache?: boolean): Promise<{
|
|
35
|
+
result: RemoteTree;
|
|
36
|
+
ignored: RemoteTreeIgnored[];
|
|
37
|
+
changed: boolean;
|
|
38
|
+
}>;
|
|
28
39
|
/**
|
|
29
40
|
* Find the corresponding UUID of the relative path.
|
|
30
41
|
* @date 3/3/2024 - 6:55:53 PM
|
|
@@ -71,7 +82,7 @@ export declare class RemoteFileSystem {
|
|
|
71
82
|
permanent?: boolean;
|
|
72
83
|
}): Promise<void>;
|
|
73
84
|
/**
|
|
74
|
-
* Rename a file/directory inside the remote sync path. Recursively creates intermediate directories if needed.
|
|
85
|
+
* Rename/Move a file/directory inside the remote sync path. Recursively creates intermediate directories if needed.
|
|
75
86
|
* @date 3/2/2024 - 9:35:12 PM
|
|
76
87
|
*
|
|
77
88
|
* @public
|
|
@@ -98,5 +109,8 @@ export declare class RemoteFileSystem {
|
|
|
98
109
|
download({ relativePath }: {
|
|
99
110
|
relativePath: string;
|
|
100
111
|
}): Promise<fs.Stats>;
|
|
112
|
+
remoteDirPathExisting(): Promise<boolean>;
|
|
113
|
+
directoryExists(relativePath: string): Promise<boolean>;
|
|
114
|
+
fileExists(relativePath: string): Promise<boolean>;
|
|
101
115
|
}
|
|
102
116
|
export default RemoteFileSystem;
|