@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/dist/types.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ import { type LocalTreeError, type LocalTreeIgnored } from "./lib/filesystems/local";
2
+ import { type Delta } from "./lib/deltas";
3
+ import { type DoneTask, type TaskError } from "./lib/tasks";
4
+ import { type RemoteTreeIgnored } from "./lib/filesystems/remote";
5
+ import { type SerializedError } from "./utils";
1
6
  export type SyncMode = "twoWay" | "localToCloud" | "localBackup" | "cloudToLocal" | "cloudBackup";
2
7
  export type SyncPair = {
3
8
  uuid: string;
@@ -5,8 +10,178 @@ export type SyncPair = {
5
10
  remotePath: string;
6
11
  remoteParentUUID: string;
7
12
  mode: SyncMode;
13
+ excludeDotFiles: boolean;
14
+ paused: boolean;
8
15
  };
9
16
  export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
10
17
  export type Prettify<T> = {
11
18
  [K in keyof T]: T[K];
12
19
  } & {};
20
+ export type CycleState = "cycleStarted" | "cycleFinished" | "cycleError" | "cycleSuccess" | "cycleWaitingForLocalDirectoryChangesStarted" | "cycleWaitingForLocalDirectoryChangesDone" | "cycleGettingTreesStarted" | "cycleGettingTreesDone" | "cycleProcessingDeltasStarted" | "cycleProcessingDeltasDone" | "cycleProcessingTasksStarted" | "cycleProcessingTasksDone" | "cycleApplyingStateStarted" | "cycleApplyingStateDone" | "cycleSavingStateStarted" | "cycleSavingStateDone" | "cycleRestarting" | "cyclePaused";
21
+ export type SyncMessage = ({
22
+ syncPair: SyncPair;
23
+ } & ({
24
+ type: "transfer";
25
+ data: {
26
+ of: "upload" | "download";
27
+ type: "progress";
28
+ relativePath: string;
29
+ localPath: string;
30
+ bytes: number;
31
+ } | {
32
+ of: "upload" | "download";
33
+ type: "queued";
34
+ relativePath: string;
35
+ localPath: string;
36
+ } | {
37
+ of: "upload" | "download";
38
+ type: "started";
39
+ relativePath: string;
40
+ localPath: string;
41
+ } | {
42
+ of: "upload" | "download";
43
+ type: "finished";
44
+ relativePath: string;
45
+ localPath: string;
46
+ } | {
47
+ of: "upload" | "download";
48
+ type: "error";
49
+ relativePath: string;
50
+ localPath: string;
51
+ error: SerializedError;
52
+ };
53
+ } | {
54
+ type: "localTreeErrors";
55
+ data: {
56
+ errors: Prettify<Omit<LocalTreeError, "error"> & {
57
+ error: SerializedError;
58
+ }>[];
59
+ };
60
+ } | {
61
+ type: "localTreeIgnored";
62
+ data: {
63
+ ignored: LocalTreeIgnored[];
64
+ };
65
+ } | {
66
+ type: "remoteTreeIgnored";
67
+ data: {
68
+ ignored: RemoteTreeIgnored[];
69
+ };
70
+ } | {
71
+ type: "deltas";
72
+ data: {
73
+ deltas: Delta[];
74
+ };
75
+ } | {
76
+ type: "doneTasks";
77
+ data: {
78
+ tasks: Prettify<Omit<DoneTask, "stats">>[];
79
+ errors: Prettify<Omit<TaskError, "error"> & {
80
+ error: SerializedError;
81
+ }>[];
82
+ };
83
+ } | {
84
+ type: "cycleStarted";
85
+ } | {
86
+ type: "cycleFinished";
87
+ } | {
88
+ type: "cycleError";
89
+ data: {
90
+ error: SerializedError;
91
+ };
92
+ } | {
93
+ type: "cycleSuccess";
94
+ } | {
95
+ type: "cycleWaitingForLocalDirectoryChangesStarted";
96
+ } | {
97
+ type: "cycleWaitingForLocalDirectoryChangesDone";
98
+ } | {
99
+ type: "cycleGettingTreesStarted";
100
+ } | {
101
+ type: "cycleGettingTreesDone";
102
+ } | {
103
+ type: "cycleProcessingDeltasStarted";
104
+ } | {
105
+ type: "cycleProcessingDeltasDone";
106
+ } | {
107
+ type: "cycleNoChanges";
108
+ } | {
109
+ type: "cycleProcessingTasksStarted";
110
+ } | {
111
+ type: "cycleProcessingTasksDone";
112
+ } | {
113
+ type: "cycleApplyingStateStarted";
114
+ } | {
115
+ type: "cycleApplyingStateDone";
116
+ } | {
117
+ type: "cycleSavingStateStarted";
118
+ } | {
119
+ type: "cycleSavingStateDone";
120
+ } | {
121
+ type: "cycleRestarting";
122
+ } | {
123
+ type: "cyclePaused";
124
+ } | {
125
+ type: "stopTransfer";
126
+ data: {
127
+ of: "upload" | "download";
128
+ relativePath: string;
129
+ };
130
+ } | {
131
+ type: "pauseTransfer";
132
+ data: {
133
+ of: "upload" | "download";
134
+ relativePath: string;
135
+ };
136
+ } | {
137
+ type: "resumeTransfer";
138
+ data: {
139
+ of: "upload" | "download";
140
+ relativePath: string;
141
+ };
142
+ })) | {
143
+ type: "updateSyncPairs";
144
+ data: {
145
+ pairs: SyncPair[];
146
+ resetCache: boolean;
147
+ };
148
+ } | {
149
+ type: "error";
150
+ data: {
151
+ error: SerializedError;
152
+ };
153
+ } | {
154
+ type: "syncPairsUpdated";
155
+ } | {
156
+ type: "updateLocalIgnorer";
157
+ syncPair: SyncPair;
158
+ data?: {
159
+ content?: string;
160
+ };
161
+ } | {
162
+ type: "updateRemoteIgnorer";
163
+ syncPair: SyncPair;
164
+ data?: {
165
+ content?: string;
166
+ };
167
+ } | {
168
+ type: "resetSyncPairCache";
169
+ } | {
170
+ type: "pauseSyncPair";
171
+ syncPair: SyncPair;
172
+ } | {
173
+ type: "resumeSyncPair";
174
+ syncPair: SyncPair;
175
+ } | {
176
+ type: "changeSyncPairMode";
177
+ syncPair: SyncPair;
178
+ data: {
179
+ mode: SyncMode;
180
+ };
181
+ } | {
182
+ type: "syncPairExcludeDotFiles";
183
+ syncPair: SyncPair;
184
+ } | {
185
+ type: "syncPairIncludeDotFiles";
186
+ syncPair: SyncPair;
187
+ };
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  /**
2
3
  * Chunk large Promise.all executions.
3
4
  * @date 2/14/2024 - 11:59:34 PM
@@ -22,3 +23,26 @@ export declare function promiseAllChunked<T>(promises: Promise<T>[], chunkSize?:
22
23
  * @returns {Promise<T[]>}
23
24
  */
24
25
  export declare function promiseAllSettledChunked<T>(promises: Promise<T>[], chunkSize?: number): Promise<T[]>;
26
+ /**
27
+ * Convert a timestamp from seconds to milliseconds.
28
+ *
29
+ * @export
30
+ * @param {number} timestamp
31
+ * @returns {number}
32
+ */
33
+ export declare function convertTimestampToMs(timestamp: number): number;
34
+ export declare function isPathOverMaxLength(path: string): boolean;
35
+ export declare function isNameOverMaxLength(name: string): boolean;
36
+ export declare const isValidPath: ((path: string) => boolean) & import("lodash").MemoizedFunction;
37
+ export declare const isNameIgnoredByDefault: ((name: string) => boolean) & import("lodash").MemoizedFunction;
38
+ export declare const isRelativePathIgnoredByDefault: ((path: string) => boolean) & import("lodash").MemoizedFunction;
39
+ export declare const isSystemPathIgnoredByDefault: ((path: string) => boolean) & import("lodash").MemoizedFunction;
40
+ export declare const isDirectoryPathIgnoredByDefault: ((path: string) => boolean) & import("lodash").MemoizedFunction;
41
+ export type SerializedError = {
42
+ name: string;
43
+ message: string;
44
+ stack?: string;
45
+ stringified: string;
46
+ };
47
+ export declare function serializeError(error: Error): SerializedError;
48
+ export declare function deserializeError(serializedError: SerializedError): Error;
package/dist/utils.js CHANGED
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promiseAllSettledChunked = exports.promiseAllChunked = void 0;
6
+ exports.deserializeError = exports.serializeError = exports.isDirectoryPathIgnoredByDefault = exports.isSystemPathIgnoredByDefault = exports.isRelativePathIgnoredByDefault = exports.isNameIgnoredByDefault = exports.isValidPath = exports.isNameOverMaxLength = exports.isPathOverMaxLength = exports.convertTimestampToMs = exports.promiseAllSettledChunked = exports.promiseAllChunked = void 0;
7
+ const memoize_1 = __importDefault(require("lodash/memoize"));
8
+ const constants_1 = require("./constants");
9
+ const path_1 = __importDefault(require("path"));
4
10
  /**
5
11
  * Chunk large Promise.all executions.
6
12
  * @date 2/14/2024 - 11:59:34 PM
@@ -50,4 +56,129 @@ async function promiseAllSettledChunked(promises, chunkSize = 100000) {
50
56
  return results;
51
57
  }
52
58
  exports.promiseAllSettledChunked = promiseAllSettledChunked;
59
+ /**
60
+ * Convert a timestamp from seconds to milliseconds.
61
+ *
62
+ * @export
63
+ * @param {number} timestamp
64
+ * @returns {number}
65
+ */
66
+ function convertTimestampToMs(timestamp) {
67
+ const now = Date.now();
68
+ if (Math.abs(now - timestamp) < Math.abs(now - timestamp * 1000)) {
69
+ return timestamp;
70
+ }
71
+ return Math.floor(timestamp * 1000);
72
+ }
73
+ exports.convertTimestampToMs = convertTimestampToMs;
74
+ function isPathOverMaxLength(path) {
75
+ if (process.platform === "linux") {
76
+ return path.length + 1 > 4096;
77
+ }
78
+ else if (process.platform === "darwin") {
79
+ return path.length + 1 > 1024;
80
+ }
81
+ else if (process.platform === "win32") {
82
+ return path.length + 1 > 260;
83
+ }
84
+ return path.length + 1 > 260;
85
+ }
86
+ exports.isPathOverMaxLength = isPathOverMaxLength;
87
+ function isNameOverMaxLength(name) {
88
+ if (process.platform === "linux") {
89
+ return name.length + 1 > 255;
90
+ }
91
+ else if (process.platform === "darwin") {
92
+ return name.length + 1 > 255;
93
+ }
94
+ else if (process.platform === "win32") {
95
+ return name.length + 1 > 255;
96
+ }
97
+ return name.length + 1 > 255;
98
+ }
99
+ exports.isNameOverMaxLength = isNameOverMaxLength;
100
+ exports.isValidPath = (0, memoize_1.default)((path) => {
101
+ const illegalCharsWindows = /[<>:"/\\|?*]|^(?:aux|con|clock\$|nul|prn|com[1-9]|lpt[1-9])$/i;
102
+ const illegalCharsMacOS = /[:]/i;
103
+ const illegalCharsLinux = /[\0/]/i;
104
+ switch (process.platform) {
105
+ case "win32": {
106
+ return illegalCharsWindows.test(path);
107
+ }
108
+ case "darwin": {
109
+ return illegalCharsMacOS.test(path);
110
+ }
111
+ case "linux": {
112
+ return illegalCharsLinux.test(path);
113
+ }
114
+ default: {
115
+ return false;
116
+ }
117
+ }
118
+ });
119
+ exports.isNameIgnoredByDefault = (0, memoize_1.default)((name) => {
120
+ const nameLowercase = name.toLowerCase();
121
+ const extension = path_1.default.extname(name);
122
+ const extensionLowercase = extension.toLowerCase();
123
+ if (name.length === 0 ||
124
+ name.startsWith(" ") ||
125
+ name.endsWith(" ") ||
126
+ name.includes("\n") ||
127
+ name.includes("\r") ||
128
+ nameLowercase.startsWith(".~lock.") ||
129
+ nameLowercase.startsWith(".~lock") ||
130
+ nameLowercase.startsWith("~$") ||
131
+ constants_1.DEFAULT_IGNORED.extensions.includes(extensionLowercase) ||
132
+ constants_1.DEFAULT_IGNORED.names.includes(nameLowercase)) {
133
+ return true;
134
+ }
135
+ return false;
136
+ });
137
+ exports.isRelativePathIgnoredByDefault = (0, memoize_1.default)((path) => {
138
+ if ((0, exports.isNameIgnoredByDefault)(path_1.default.basename(path))) {
139
+ return true;
140
+ }
141
+ const ex = path.split("/");
142
+ for (const part of ex) {
143
+ if (part.length === 0) {
144
+ continue;
145
+ }
146
+ if ((0, exports.isNameIgnoredByDefault)(part)) {
147
+ return true;
148
+ }
149
+ }
150
+ return false;
151
+ });
152
+ exports.isSystemPathIgnoredByDefault = (0, memoize_1.default)((path) => {
153
+ for (const systemPath of constants_1.DEFAULT_IGNORED.system) {
154
+ if (path.toLowerCase().includes(systemPath.toLowerCase())) {
155
+ return true;
156
+ }
157
+ }
158
+ return false;
159
+ });
160
+ exports.isDirectoryPathIgnoredByDefault = (0, memoize_1.default)((path) => {
161
+ for (const directoryPath of constants_1.DEFAULT_IGNORED.directories) {
162
+ if (path.toLowerCase().includes(directoryPath.toLowerCase())) {
163
+ return true;
164
+ }
165
+ }
166
+ return false;
167
+ });
168
+ function serializeError(error) {
169
+ return {
170
+ name: error.name,
171
+ message: error.message,
172
+ stack: error.stack,
173
+ stringified: `${error.name}: ${error.message}`
174
+ };
175
+ }
176
+ exports.serializeError = serializeError;
177
+ function deserializeError(serializedError) {
178
+ const error = new Error(serializedError.message);
179
+ error.name = serializedError.name;
180
+ error.stack = serializedError.stack;
181
+ return error;
182
+ }
183
+ exports.deserializeError = deserializeError;
53
184
  //# sourceMappingURL=utils.js.map
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index.js",
6
- "types": "dist/index.d.ts",
7
- "private": false,
8
- "scripts": {
9
- "test": "jest --forceExit ./__tests__",
10
- "lint": "eslint src/**/* --ext .js,.jsx,.ts,.tsx",
11
- "emitTypes": "tsc --emitDeclarationOnly",
12
- "tsc": "tsc --build",
13
- "clear": "rimraf ./dist",
14
- "build": "npm run clear && npm run lint && npm run tsc",
15
- "dev": "tsx ./dev/index.ts",
16
- "yalc": "npm run build && yalc push"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/FilenCloudDienste/filen-sync.git"
21
- },
22
- "keywords": [
23
- "filen"
24
- ],
25
- "engines": {
26
- "node": ">=18"
27
- },
28
- "author": "Filen",
29
- "license": "AGPLv3",
30
- "bugs": {
31
- "url": "https://github.com/FilenCloudDienste/filen-sync/issues"
32
- },
33
- "homepage": "https://filen.io",
34
- "devDependencies": {
35
- "@jest/globals": "^29.7.0",
36
- "@types/fs-extra": "^11.0.4",
37
- "@types/lodash": "^4.14.202",
38
- "@types/mime-types": "^2.1.4",
39
- "@types/uuid": "^9.0.8",
40
- "@typescript-eslint/eslint-plugin": "^6.20.0",
41
- "@typescript-eslint/parser": "^6.20.0",
42
- "cross-env": "^7.0.3",
43
- "eslint": "^8.56.0",
44
- "jest": "^29.7.0",
45
- "rimraf": "^5.0.5",
46
- "ts-node": "^10.9.2",
47
- "tsx": "^4.11.0",
48
- "typescript": "^5.3.3",
49
- "wait-on": "^7.2.0"
50
- },
51
- "dependencies": {
52
- "@filen/sdk": "^0.1.91",
53
- "@parcel/watcher": "^2.4.1",
54
- "fs-extra": "^11.2.0",
55
- "msgpackr": "^1.10.1",
56
- "uuid": "^9.0.1"
57
- }
58
- }
1
+ {
2
+ "name": "@filen/sync",
3
+ "version": "0.1.3",
4
+ "description": "Filen Sync",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "private": false,
8
+ "scripts": {
9
+ "test": "jest --forceExit ./__tests__",
10
+ "lint": "eslint src/**/* --ext .js,.jsx,.ts,.tsx",
11
+ "emitTypes": "tsc --emitDeclarationOnly",
12
+ "tsc": "tsc --build",
13
+ "clear": "rimraf ./dist",
14
+ "build": "npm run clear && npm run lint && npm run tsc",
15
+ "dev": "tsx ./dev/index.ts",
16
+ "yalc": "npm run build && yalc push"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/FilenCloudDienste/filen-sync.git"
21
+ },
22
+ "keywords": [
23
+ "filen"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "author": "Filen",
29
+ "license": "AGPLv3",
30
+ "bugs": {
31
+ "url": "https://github.com/FilenCloudDienste/filen-sync/issues"
32
+ },
33
+ "homepage": "https://filen.io",
34
+ "devDependencies": {
35
+ "@jest/globals": "^29.7.0",
36
+ "@types/fs-extra": "^11.0.4",
37
+ "@types/lodash": "^4.17.6",
38
+ "@types/mime-types": "^2.1.4",
39
+ "@types/uuid": "^9.0.8",
40
+ "@typescript-eslint/eslint-plugin": "^6.20.0",
41
+ "@typescript-eslint/parser": "^6.20.0",
42
+ "cross-env": "^7.0.3",
43
+ "eslint": "^8.56.0",
44
+ "jest": "^29.7.0",
45
+ "rimraf": "^5.0.5",
46
+ "ts-node": "^10.9.2",
47
+ "tsx": "^4.11.0",
48
+ "typescript": "^5.3.3",
49
+ "wait-on": "^7.2.0"
50
+ },
51
+ "dependencies": {
52
+ "@filen/sdk": "^0.1.129",
53
+ "@parcel/watcher": "^2.4.1",
54
+ "fs-extra": "^11.2.0",
55
+ "ignore": "^5.3.1",
56
+ "lodash": "^4.17.21",
57
+ "rotating-file-stream": "^3.2.3",
58
+ "uuid": "^10.0.0"
59
+ }
60
+ }
package/tsconfig.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "outDir": "dist",
5
- "lib": ["ES2017", "DOM", "DOM.Iterable"],
6
- "module": "commonjs",
7
- "target": "ES2017",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "moduleResolution": "node",
12
- "sourceMap": true,
13
- "skipDefaultLibCheck": true,
14
- "skipLibCheck": true,
15
- "declaration": true,
16
- "resolveJsonModule": true,
17
- "noUncheckedIndexedAccess": true
18
- },
19
- "ts-node": {
20
- "files": true
21
- },
22
- "include": ["src", "index.d.ts"],
23
- "exclude": ["node_modules", "dist", "__tests__", "docs", ".github", "dev", ".vscode"]
24
- }
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": "src",
4
+ "outDir": "dist",
5
+ "lib": ["ES2017", "DOM", "DOM.Iterable"],
6
+ "module": "commonjs",
7
+ "target": "ES2017",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "moduleResolution": "node",
12
+ "sourceMap": true,
13
+ "skipDefaultLibCheck": true,
14
+ "skipLibCheck": true,
15
+ "declaration": true,
16
+ "resolveJsonModule": true,
17
+ "noUncheckedIndexedAccess": true
18
+ },
19
+ "ts-node": {
20
+ "files": true
21
+ },
22
+ "include": ["src"],
23
+ "exclude": ["node_modules", "dist", "__tests__", "docs", ".github", "dev", ".vscode"]
24
+ }