@lacrous/omnicloud 0.2.23 → 0.2.25
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/dist/index.cjs +12 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/server/index.js +35 -8
package/dist/index.cjs
CHANGED
|
@@ -1500,6 +1500,13 @@ function uploadRequestFingerprint(input) {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
|
|
1502
1502
|
// ../core/src/services/file-service.ts
|
|
1503
|
+
function connectionCausedFailure(error) {
|
|
1504
|
+
if (error instanceof TelegramConnectionError) return true;
|
|
1505
|
+
if (error instanceof UploadFailedError) {
|
|
1506
|
+
return error.details instanceof TelegramConnectionError;
|
|
1507
|
+
}
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1503
1510
|
var FileService = class {
|
|
1504
1511
|
constructor(files, folders, engineFor, activity = noopActivityRecorder, operations = null, log = null) {
|
|
1505
1512
|
this.files = files;
|
|
@@ -1576,8 +1583,9 @@ var FileService = class {
|
|
|
1576
1583
|
await operations.update(op.id, { status: "COMPLETED", fileId: record.id });
|
|
1577
1584
|
return record;
|
|
1578
1585
|
} catch (error) {
|
|
1586
|
+
const status = connectionCausedFailure(error) ? "UNKNOWN" : "FAILED";
|
|
1579
1587
|
await operations.update(op.id, {
|
|
1580
|
-
status
|
|
1588
|
+
status,
|
|
1581
1589
|
error: error instanceof Error ? error.message.slice(0, 200) : "upload failed"
|
|
1582
1590
|
});
|
|
1583
1591
|
throw error;
|
|
@@ -2216,14 +2224,11 @@ var FolderService = class {
|
|
|
2216
2224
|
);
|
|
2217
2225
|
const restorableFileIds = restorableFiles.map((file) => file.id);
|
|
2218
2226
|
if (restorableFolders.length > 0) {
|
|
2219
|
-
await this.folders.
|
|
2227
|
+
await this.folders.restoreSubtree(
|
|
2220
2228
|
restorableFolders.map((folder) => folder.id),
|
|
2221
|
-
|
|
2229
|
+
restorableFileIds,
|
|
2230
|
+
{ rootId: id, reparent: { parentId } }
|
|
2222
2231
|
);
|
|
2223
|
-
await this.folders.update(id, { parentId });
|
|
2224
|
-
}
|
|
2225
|
-
if (restorableFileIds.length > 0) {
|
|
2226
|
-
await this.files.updateMany(restorableFileIds, { deletedAt: null, trashBatchId: null });
|
|
2227
2232
|
}
|
|
2228
2233
|
await this.activity.record({
|
|
2229
2234
|
userId,
|