aspect-sync 0.1.10 → 0.1.12
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/README.md +8 -6
- package/dist/index.js +10 -169
- package/package.json +11 -7
- package/dist/batchManager.d.ts +0 -21
- package/dist/batchManager.d.ts.map +0 -1
- package/dist/batchManager.js +0 -121
- package/dist/batchManager.js.map +0 -1
- package/dist/cliDisplay.d.ts +0 -9
- package/dist/cliDisplay.d.ts.map +0 -1
- package/dist/cliDisplay.js +0 -302
- package/dist/cliDisplay.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/weightedAsyncQueue.d.ts +0 -153
- package/dist/lib/weightedAsyncQueue.d.ts.map +0 -1
- package/dist/lib/weightedAsyncQueue.js +0 -322
- package/dist/lib/weightedAsyncQueue.js.map +0 -1
- package/dist/rclone.d.ts +0 -28
- package/dist/rclone.d.ts.map +0 -1
- package/dist/rclone.js +0 -397
- package/dist/rclone.js.map +0 -1
- package/dist/statusTracker.d.ts +0 -46
- package/dist/statusTracker.d.ts.map +0 -1
- package/dist/statusTracker.js +0 -272
- package/dist/statusTracker.js.map +0 -1
- package/dist/sync.d.ts +0 -9
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js +0 -529
- package/dist/sync.js.map +0 -1
- package/dist/types.d.ts +0 -135
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -18
- package/dist/types.js.map +0 -1
- package/dist/uploader.d.ts +0 -7
- package/dist/uploader.d.ts.map +0 -1
- package/dist/uploader.js +0 -203
- package/dist/uploader.js.map +0 -1
- package/dist/util.d.ts +0 -4
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -41
- package/dist/util.js.map +0 -1
package/dist/rclone.js
DELETED
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { spawn } from "child_process";
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
export class RcloneError extends Error {
|
|
5
|
-
stderr;
|
|
6
|
-
constructor(message, stderr) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.stderr = stderr;
|
|
9
|
-
this.name = "RcloneError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export async function checkRcloneInstalled() {
|
|
13
|
-
return new Promise((resolve, reject) => {
|
|
14
|
-
const process = spawn("rclone", ["version"]);
|
|
15
|
-
process.on("error", () => {
|
|
16
|
-
reject(new Error("rclone is not installed or not in PATH. Please install rclone first: https://rclone.org/install/"));
|
|
17
|
-
});
|
|
18
|
-
process.on("close", (code) => {
|
|
19
|
-
if (code === 0) {
|
|
20
|
-
resolve();
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
reject(new Error("rclone is not installed or not in PATH. Please install rclone first: https://rclone.org/install/"));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
export async function syncFromRemote(remote, remotePath, localPath, options) {
|
|
29
|
-
const remoteSource = `${remote}:${remotePath}`;
|
|
30
|
-
console.log(`Syncing from ${remoteSource} to ${localPath}...`);
|
|
31
|
-
console.log("");
|
|
32
|
-
return new Promise((resolve, reject) => {
|
|
33
|
-
// Build rclone arguments dynamically from options
|
|
34
|
-
const args = [
|
|
35
|
-
"sync",
|
|
36
|
-
remoteSource,
|
|
37
|
-
localPath,
|
|
38
|
-
"--progress",
|
|
39
|
-
"--stats", "1s",
|
|
40
|
-
"--stats-one-line",
|
|
41
|
-
"-v",
|
|
42
|
-
// Performance optimizations for high-speed connections (10Gbps+)
|
|
43
|
-
"--transfers", String(options.transfers), // Parallel file transfers
|
|
44
|
-
"--checkers", String(options.checkers), // Parallel file checkers (auto-calculated)
|
|
45
|
-
"--multi-thread-streams", String(options.multiThreadStreams), // Streams per large file
|
|
46
|
-
"--multi-thread-chunk-size", options.multiThreadChunkSize, // Chunk size per stream
|
|
47
|
-
"--multi-thread-cutoff", options.multiThreadCutoff, // Multi-thread files ≥ this size
|
|
48
|
-
"--fast-list", // Read entire directory listings at once
|
|
49
|
-
"--buffer-size", options.bufferSize, // Memory per transfer (total = transfers × buffer-size)
|
|
50
|
-
];
|
|
51
|
-
// Add --use-mmap only if enabled (uses memory-mapped I/O for better memory efficiency)
|
|
52
|
-
if (options.useMmap) {
|
|
53
|
-
args.push("--use-mmap");
|
|
54
|
-
}
|
|
55
|
-
if (options.extraRcloneArgs?.length) {
|
|
56
|
-
args.push(...options.extraRcloneArgs);
|
|
57
|
-
}
|
|
58
|
-
const rcloneProcess = spawn("rclone", args, {
|
|
59
|
-
stdio: 'inherit' // Inherit all streams for native terminal behavior
|
|
60
|
-
});
|
|
61
|
-
// All output goes directly to terminal - no manual handling needed
|
|
62
|
-
// Handle process completion
|
|
63
|
-
rcloneProcess.on("close", (code) => {
|
|
64
|
-
console.log("");
|
|
65
|
-
if (code === 0) {
|
|
66
|
-
console.log(`✓ Rclone sync complete`);
|
|
67
|
-
resolve();
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
console.log(`✗ Failed to sync from ${remoteSource}`);
|
|
71
|
-
reject(new RcloneError(`rclone exited with code ${code}`, "(output shown above)"));
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
// Handle spawn errors (e.g., rclone not found)
|
|
75
|
-
rcloneProcess.on("error", (error) => {
|
|
76
|
-
reject(new RcloneError(`Failed to start rclone: ${error.message}`, ""));
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export async function syncFromRemoteWithFiles(remote, remotePath, localPath, batchFilePath, options, onProgress) {
|
|
81
|
-
const remoteSource = `${remote}:${remotePath}`;
|
|
82
|
-
return new Promise((resolve, reject) => {
|
|
83
|
-
// Build rclone arguments with --files-from for batch filtering
|
|
84
|
-
const args = [
|
|
85
|
-
"sync",
|
|
86
|
-
remoteSource,
|
|
87
|
-
localPath,
|
|
88
|
-
"--files-from", batchFilePath,
|
|
89
|
-
"--progress",
|
|
90
|
-
"--stats", "1s",
|
|
91
|
-
"--stats-one-line",
|
|
92
|
-
"-v",
|
|
93
|
-
// Performance optimizations for high-speed connections (10Gbps+)
|
|
94
|
-
"--transfers", String(options.transfers), // Parallel file transfers
|
|
95
|
-
"--checkers", String(options.checkers), // Parallel file checkers (auto-calculated)
|
|
96
|
-
"--multi-thread-streams", String(options.multiThreadStreams), // Streams per large file
|
|
97
|
-
"--multi-thread-chunk-size", options.multiThreadChunkSize, // Chunk size per stream
|
|
98
|
-
"--multi-thread-cutoff", options.multiThreadCutoff, // Multi-thread files ≥ this size
|
|
99
|
-
"--fast-list", // Read entire directory listings at once
|
|
100
|
-
"--buffer-size", options.bufferSize, // Memory per transfer (total = transfers × buffer-size)
|
|
101
|
-
];
|
|
102
|
-
// Add --use-mmap only if enabled (uses memory-mapped I/O for better memory efficiency)
|
|
103
|
-
if (options.useMmap) {
|
|
104
|
-
args.push("--use-mmap");
|
|
105
|
-
}
|
|
106
|
-
if (options.extraRcloneArgs?.length) {
|
|
107
|
-
args.push(...options.extraRcloneArgs);
|
|
108
|
-
}
|
|
109
|
-
const rcloneProcess = spawn("rclone", args, {
|
|
110
|
-
stdio: ['ignore', 'pipe', 'pipe'] // Capture stdout/stderr for progress parsing
|
|
111
|
-
});
|
|
112
|
-
let lastProgressUpdate = Date.now();
|
|
113
|
-
// Parse rclone output for progress statistics
|
|
114
|
-
const parseRcloneProgress = (line) => {
|
|
115
|
-
if (!onProgress) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const trimmedLine = line.trim();
|
|
119
|
-
// Preferred format: "20.107 MiB / 20.107 MiB, 100%, 41.964 KiB/s, ETA 0s"
|
|
120
|
-
const basicProgressRegex = /^([\d.]+)\s*([A-Za-z]+)\s*\/\s*([\d.]+)\s*([A-Za-z]+),\s*([\d.]+)%?,\s*([\d.]+)\s*([A-Za-z]+)\/s,\s*ETA\s+(.+)$/;
|
|
121
|
-
const basicMatch = trimmedLine.match(basicProgressRegex);
|
|
122
|
-
let bytesTransferred = null;
|
|
123
|
-
let totalBytes = null;
|
|
124
|
-
let speedBytesPerSecond = 0;
|
|
125
|
-
let percentComplete = 0;
|
|
126
|
-
let etaSeconds = 0;
|
|
127
|
-
if (basicMatch) {
|
|
128
|
-
const transferredValue = parseFloat(basicMatch[1]);
|
|
129
|
-
const transferredUnit = basicMatch[2];
|
|
130
|
-
const totalValue = parseFloat(basicMatch[3]);
|
|
131
|
-
const totalUnit = basicMatch[4];
|
|
132
|
-
percentComplete = parseFloat(basicMatch[5]);
|
|
133
|
-
const speedValue = parseFloat(basicMatch[6]);
|
|
134
|
-
const speedUnit = basicMatch[7];
|
|
135
|
-
const etaRaw = basicMatch[8].trim();
|
|
136
|
-
bytesTransferred = convertToBytes(transferredValue, transferredUnit);
|
|
137
|
-
totalBytes = convertToBytes(totalValue, totalUnit);
|
|
138
|
-
speedBytesPerSecond = convertToBytes(speedValue, speedUnit);
|
|
139
|
-
etaSeconds = etaRaw === "-" ? 0 : parseETA(etaRaw);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// Legacy fallback format: "Transferred: 1.234 GiB / 10.000 GiB, 12%, 45.3 MiB/s, ETA 2m15s"
|
|
143
|
-
const transferMatch = trimmedLine.match(/Transferred:\s+([\d.]+)\s*([A-Za-z]+)\s*\/\s*([\d.]+)\s*([A-Za-z]+),\s*([\d.]+)%/);
|
|
144
|
-
const speedMatch = trimmedLine.match(/([\d.]+)\s*([A-Za-z]+)\/s/);
|
|
145
|
-
const etaMatch = trimmedLine.match(/ETA\s+([^\s]+)$/);
|
|
146
|
-
if (!transferMatch) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const transferredValue = parseFloat(transferMatch[1]);
|
|
150
|
-
const transferredUnit = transferMatch[2];
|
|
151
|
-
const totalValue = parseFloat(transferMatch[3]);
|
|
152
|
-
const totalUnit = transferMatch[4];
|
|
153
|
-
percentComplete = parseFloat(transferMatch[5]);
|
|
154
|
-
bytesTransferred = convertToBytes(transferredValue, transferredUnit);
|
|
155
|
-
totalBytes = convertToBytes(totalValue, totalUnit);
|
|
156
|
-
if (speedMatch) {
|
|
157
|
-
const speedValue = parseFloat(speedMatch[1]);
|
|
158
|
-
const speedUnit = speedMatch[2];
|
|
159
|
-
speedBytesPerSecond = convertToBytes(speedValue, speedUnit);
|
|
160
|
-
}
|
|
161
|
-
if (etaMatch) {
|
|
162
|
-
const etaValue = etaMatch[1].trim();
|
|
163
|
-
etaSeconds = etaValue === "-" ? 0 : parseETA(etaValue);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (bytesTransferred === null || totalBytes === null) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
// Throttle progress updates to once per second
|
|
170
|
-
const now = Date.now();
|
|
171
|
-
if (now - lastProgressUpdate < 1000) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
lastProgressUpdate = now;
|
|
175
|
-
onProgress({
|
|
176
|
-
bytesTransferred,
|
|
177
|
-
totalBytes,
|
|
178
|
-
speed: speedBytesPerSecond,
|
|
179
|
-
eta: etaSeconds,
|
|
180
|
-
percentComplete,
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
// Helper to convert size strings to bytes
|
|
184
|
-
const convertToBytes = (value, unit) => {
|
|
185
|
-
const normalizedUnit = unit.trim();
|
|
186
|
-
const units = {
|
|
187
|
-
'B': 1,
|
|
188
|
-
'k': 1024, 'Ki': 1024, 'KiB': 1024, 'kB': 1000,
|
|
189
|
-
'M': 1024 * 1024, 'Mi': 1024 * 1024, 'MiB': 1024 * 1024, 'MB': 1000 * 1000,
|
|
190
|
-
'G': 1024 * 1024 * 1024, 'Gi': 1024 * 1024 * 1024, 'GiB': 1024 * 1024 * 1024, 'GB': 1000 * 1000 * 1000,
|
|
191
|
-
'T': 1024 * 1024 * 1024 * 1024, 'Ti': 1024 * 1024 * 1024 * 1024, 'TiB': 1024 * 1024 * 1024 * 1024, 'TB': 1000 * 1000 * 1000 * 1000,
|
|
192
|
-
};
|
|
193
|
-
return value * (units[normalizedUnit] || 1);
|
|
194
|
-
};
|
|
195
|
-
// Helper to parse ETA strings like "2m15s" to seconds
|
|
196
|
-
const parseETA = (etaString) => {
|
|
197
|
-
let seconds = 0;
|
|
198
|
-
const hourMatch = etaString.match(/(\d+)h/);
|
|
199
|
-
const minMatch = etaString.match(/(\d+)m/);
|
|
200
|
-
const secMatch = etaString.match(/(\d+)s/);
|
|
201
|
-
if (hourMatch)
|
|
202
|
-
seconds += parseInt(hourMatch[1]) * 3600;
|
|
203
|
-
if (minMatch)
|
|
204
|
-
seconds += parseInt(minMatch[1]) * 60;
|
|
205
|
-
if (secMatch)
|
|
206
|
-
seconds += parseInt(secMatch[1]);
|
|
207
|
-
return seconds;
|
|
208
|
-
};
|
|
209
|
-
let stderrOutput = "";
|
|
210
|
-
rcloneProcess.stdout.on("data", (data) => {
|
|
211
|
-
const output = data.toString();
|
|
212
|
-
// Parse each line for progress (but don't print to console)
|
|
213
|
-
output.split('\n').forEach(line => {
|
|
214
|
-
if (line.trim().length === 0)
|
|
215
|
-
return;
|
|
216
|
-
parseRcloneProgress(line);
|
|
217
|
-
});
|
|
218
|
-
// Don't print rclone output - we'll show it via log-update
|
|
219
|
-
});
|
|
220
|
-
rcloneProcess.stderr.on("data", (data) => {
|
|
221
|
-
const output = data.toString();
|
|
222
|
-
stderrOutput += output;
|
|
223
|
-
// Stderr might also contain progress lines
|
|
224
|
-
output.split('\n').forEach(line => {
|
|
225
|
-
if (line.trim().length === 0)
|
|
226
|
-
return;
|
|
227
|
-
parseRcloneProgress(line);
|
|
228
|
-
});
|
|
229
|
-
// Don't print rclone output - we'll show it via log-update
|
|
230
|
-
});
|
|
231
|
-
// Handle process completion
|
|
232
|
-
rcloneProcess.on("close", (code) => {
|
|
233
|
-
if (code === 0) {
|
|
234
|
-
resolve();
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
reject(new RcloneError(`rclone exited with code ${code}`, stderrOutput));
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
// Handle spawn errors (e.g., rclone not found)
|
|
241
|
-
rcloneProcess.on("error", (error) => {
|
|
242
|
-
reject(new RcloneError(`Failed to start rclone: ${error.message}`, ""));
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
export async function listRemoteFiles(remote, remotePath) {
|
|
247
|
-
const remoteSource = `${remote}:${remotePath}`;
|
|
248
|
-
return new Promise((resolve, reject) => {
|
|
249
|
-
const rcloneProcess = spawn("rclone", [
|
|
250
|
-
"lsf",
|
|
251
|
-
remoteSource,
|
|
252
|
-
"--recursive"
|
|
253
|
-
]);
|
|
254
|
-
let stdoutOutput = "";
|
|
255
|
-
let stderrOutput = "";
|
|
256
|
-
rcloneProcess.stdout.on("data", (data) => {
|
|
257
|
-
stdoutOutput += data.toString();
|
|
258
|
-
});
|
|
259
|
-
rcloneProcess.stderr.on("data", (data) => {
|
|
260
|
-
stderrOutput += data.toString();
|
|
261
|
-
});
|
|
262
|
-
rcloneProcess.on("close", (code) => {
|
|
263
|
-
if (code === 0) {
|
|
264
|
-
const files = stdoutOutput
|
|
265
|
-
.split("\n")
|
|
266
|
-
.filter(line => line.trim() !== "" && !line.endsWith("/"));
|
|
267
|
-
resolve(files);
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
reject(new RcloneError(`Failed to list files from ${remoteSource}`, stderrOutput));
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
rcloneProcess.on("error", (error) => {
|
|
274
|
-
reject(new RcloneError(`Failed to start rclone: ${error.message}`, ""));
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
export async function listRemoteFilesWithSize(remote, remotePath, extraArgs = []) {
|
|
279
|
-
const remoteSource = `${remote}:${remotePath}`;
|
|
280
|
-
return new Promise((resolve, reject) => {
|
|
281
|
-
const rcloneProcess = spawn("rclone", [
|
|
282
|
-
"ls",
|
|
283
|
-
remoteSource,
|
|
284
|
-
"--fast-list",
|
|
285
|
-
...extraArgs,
|
|
286
|
-
]);
|
|
287
|
-
let stdoutOutput = "";
|
|
288
|
-
let stderrOutput = "";
|
|
289
|
-
rcloneProcess.stdout.on("data", (data) => {
|
|
290
|
-
stdoutOutput += data.toString();
|
|
291
|
-
});
|
|
292
|
-
rcloneProcess.stderr.on("data", (data) => {
|
|
293
|
-
stderrOutput += data.toString();
|
|
294
|
-
});
|
|
295
|
-
rcloneProcess.on("close", (code) => {
|
|
296
|
-
if (code === 0) {
|
|
297
|
-
const files = stdoutOutput
|
|
298
|
-
.split("\n")
|
|
299
|
-
.map(line => line.trim())
|
|
300
|
-
.filter(line => line.length > 0)
|
|
301
|
-
.map((line) => {
|
|
302
|
-
const match = line.match(/^(\d+)\s+(.+)$/);
|
|
303
|
-
if (!match) {
|
|
304
|
-
return null;
|
|
305
|
-
}
|
|
306
|
-
return {
|
|
307
|
-
size: Number(match[1]),
|
|
308
|
-
path: match[2],
|
|
309
|
-
};
|
|
310
|
-
})
|
|
311
|
-
.filter((entry) => entry !== null);
|
|
312
|
-
resolve(files);
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
reject(new RcloneError(`Failed to list files from ${remoteSource}`, stderrOutput));
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
rcloneProcess.on("error", (error) => {
|
|
319
|
-
reject(new RcloneError(`Failed to start rclone: ${error.message}`, ""));
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
export async function scanLocalDirectory(localPath) {
|
|
324
|
-
const files = [];
|
|
325
|
-
const directories = new Set();
|
|
326
|
-
async function scanDir(currentPath, relativePath = "") {
|
|
327
|
-
const entries = await fs.promises.readdir(currentPath, { withFileTypes: true });
|
|
328
|
-
for (const entry of entries) {
|
|
329
|
-
const entryPath = path.join(currentPath, entry.name);
|
|
330
|
-
const entryRelativePath = relativePath ? path.join(relativePath, entry.name) : entry.name;
|
|
331
|
-
if (entry.isDirectory()) {
|
|
332
|
-
await scanDir(entryPath, entryRelativePath);
|
|
333
|
-
}
|
|
334
|
-
else if (entry.isFile()) {
|
|
335
|
-
const stats = await fs.promises.stat(entryPath);
|
|
336
|
-
files.push({
|
|
337
|
-
relativePath: entryRelativePath,
|
|
338
|
-
absolutePath: entryPath,
|
|
339
|
-
fileName: entry.name,
|
|
340
|
-
size: stats.size,
|
|
341
|
-
});
|
|
342
|
-
// Extract unique directory paths from file path
|
|
343
|
-
const dirPath = path.dirname(entryRelativePath);
|
|
344
|
-
if (dirPath !== ".") {
|
|
345
|
-
// Add all parent directories
|
|
346
|
-
const parts = dirPath.split(path.sep);
|
|
347
|
-
for (let i = 0; i < parts.length; i++) {
|
|
348
|
-
const partialPath = parts.slice(0, i + 1).join(path.sep);
|
|
349
|
-
directories.add(partialPath);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
await scanDir(localPath);
|
|
356
|
-
return {
|
|
357
|
-
files,
|
|
358
|
-
directoryCount: directories.size,
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
export async function deleteLocalFile(filePath) {
|
|
362
|
-
try {
|
|
363
|
-
await fs.promises.unlink(filePath);
|
|
364
|
-
}
|
|
365
|
-
catch (error) {
|
|
366
|
-
console.error(`Failed to delete local file ${filePath}:`, error.message);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
export async function deleteEmptyDirectories(rootPath) {
|
|
370
|
-
async function deleteEmptyDirs(currentPath) {
|
|
371
|
-
const entries = await fs.promises.readdir(currentPath, { withFileTypes: true });
|
|
372
|
-
if (entries.length === 0) {
|
|
373
|
-
await fs.promises.rmdir(currentPath);
|
|
374
|
-
return true;
|
|
375
|
-
}
|
|
376
|
-
let isEmpty = true;
|
|
377
|
-
for (const entry of entries) {
|
|
378
|
-
if (entry.isDirectory()) {
|
|
379
|
-
const entryPath = path.join(currentPath, entry.name);
|
|
380
|
-
const wasDeleted = await deleteEmptyDirs(entryPath);
|
|
381
|
-
if (!wasDeleted) {
|
|
382
|
-
isEmpty = false;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
isEmpty = false;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
if (isEmpty && currentPath !== rootPath) {
|
|
390
|
-
await fs.promises.rmdir(currentPath);
|
|
391
|
-
return true;
|
|
392
|
-
}
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
|
-
await deleteEmptyDirs(rootPath);
|
|
396
|
-
}
|
|
397
|
-
//# sourceMappingURL=rclone.js.map
|
package/dist/rclone.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rclone.js","sourceRoot":"","sources":["../src/rclone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,MAAM,OAAO,WAAY,SAAQ,KAAK;IACS;IAA7C,YAAY,OAAe,EAAkB,MAAc;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,WAAM,GAAN,MAAM,CAAQ;QAEzD,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;QAE5C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACvB,MAAM,CAAC,IAAI,KAAK,CACd,kGAAkG,CACnG,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAA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,CAAC,OAAO,CAAC,CAAA;IAC1E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,QAAgB;IAC3D,KAAK,UAAU,eAAe,CAAC,WAAmB;QAChD,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;QAE/E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;gBACpD,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;gBACnD,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,OAAO,GAAG,KAAK,CAAA;gBACjB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,KAAK,CAAA;YACjB,CAAC;QACH,CAAC;QAED,IAAI,OAAO,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YACxC,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAA;AACjC,CAAC"}
|
package/dist/statusTracker.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type UploadFileState, type UploadTotals, type DownloadProgress, type BatchProgress, BatchPhase } from "./types.js";
|
|
2
|
-
interface UploadDataPoint {
|
|
3
|
-
timestamp: bigint;
|
|
4
|
-
bytes: number;
|
|
5
|
-
}
|
|
6
|
-
interface UploadSpeedState {
|
|
7
|
-
dataPoints: UploadDataPoint[];
|
|
8
|
-
}
|
|
9
|
-
export interface UploadStats {
|
|
10
|
-
uploadSpeedBps: number | null;
|
|
11
|
-
timeRemainingSeconds: number | null;
|
|
12
|
-
formattedSpeed: string;
|
|
13
|
-
formattedTime: string;
|
|
14
|
-
}
|
|
15
|
-
declare class StatusTrackerClass {
|
|
16
|
-
uploadFiles: Record<string, UploadFileState>;
|
|
17
|
-
uploadSpeedState: UploadSpeedState;
|
|
18
|
-
uploadStats: UploadStats;
|
|
19
|
-
batchProgress: BatchProgress | null;
|
|
20
|
-
downloadProgress: DownloadProgress | null;
|
|
21
|
-
addUploadFile(fileId: string, filePath: string, fileName: string, relativePath: string, fileSize: number): void;
|
|
22
|
-
updateUploadProgress(fileId: string, bytesUploaded: number): void;
|
|
23
|
-
markUploadSuccess(fileId: string): void;
|
|
24
|
-
markUploadFailed(fileId: string, errorMessage: string): void;
|
|
25
|
-
markUploadSkipped(fileId: string): void;
|
|
26
|
-
resetFileForRetry(fileId: string): void;
|
|
27
|
-
getUploadFile(fileId: string): UploadFileState | undefined;
|
|
28
|
-
getUploadTotals(): UploadTotals;
|
|
29
|
-
getAllUploadFiles(): UploadFileState[];
|
|
30
|
-
getInProgressFiles(): UploadFileState[];
|
|
31
|
-
getUploadSpeedBps(): number | null;
|
|
32
|
-
getTimeRemainingSeconds(): number | null;
|
|
33
|
-
updateUploadStats(): void;
|
|
34
|
-
initBatchProgress(totalBatches: number, overallFilesTotal: number, overallBytesTotal: number): void;
|
|
35
|
-
setBatchInfo(batchNumber: number, batchFilesTotal: number, batchBytesTotal: number): void;
|
|
36
|
-
updateDownloadProgress(progress: DownloadProgress): void;
|
|
37
|
-
incrementOverallProgress(filesCompleted: number, bytesTransferred: number): void;
|
|
38
|
-
completeBatch(): void;
|
|
39
|
-
resetBatchUploadState(): void;
|
|
40
|
-
getBatchProgress(): BatchProgress | null;
|
|
41
|
-
getDownloadProgress(): DownloadProgress | null;
|
|
42
|
-
setBatchPhase(phase: BatchPhase, extraDetails?: string): void;
|
|
43
|
-
}
|
|
44
|
-
export declare const statusTracker: StatusTrackerClass;
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=statusTracker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"statusTracker.d.ts","sourceRoot":"","sources":["../src/statusTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAMzI,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,gBAAgB;IACxB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,cAAM,kBAAkB;IACtB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAK;IACjD,gBAAgB,EAAE,gBAAgB,CAEjC;IACD,WAAW,EAAE,WAAW,CAKvB;IAGD,aAAa,EAAE,aAAa,GAAG,IAAI,CAAO;IAC1C,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAO;IAEhD,aAAa,CACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,IAAI;IAcP,oBAAoB,CAAC,MAAM,EAAE,MAAM,E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