@lacrous/omnicloud 0.2.24 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacrous/omnicloud",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "SDK and core building blocks for OmniCloud — self-hosted cloud storage powered by your Telegram account.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,9 +48,9 @@
48
48
  "prisma": "^6.2.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@omnicloud/core": "0.2.24",
52
- "@omnicloud/shared": "0.2.24",
53
- "@omnicloud/telegram": "0.2.24",
51
+ "@omnicloud/core": "0.2.25",
52
+ "@omnicloud/shared": "0.2.25",
53
+ "@omnicloud/telegram": "0.2.25",
54
54
  "@types/node": "^22.10.0",
55
55
  "esbuild": "0.25.12",
56
56
  "tsup": "^8.3.0",
package/server/index.js CHANGED
@@ -1093,6 +1093,13 @@ function uploadRequestFingerprint(input) {
1093
1093
  }
1094
1094
 
1095
1095
  // ../core/src/services/file-service.ts
1096
+ function connectionCausedFailure(error) {
1097
+ if (error instanceof TelegramConnectionError) return true;
1098
+ if (error instanceof UploadFailedError) {
1099
+ return error.details instanceof TelegramConnectionError;
1100
+ }
1101
+ return false;
1102
+ }
1096
1103
  var FileService = class {
1097
1104
  constructor(files, folders, engineFor, activity = noopActivityRecorder, operations = null, log = null) {
1098
1105
  this.files = files;
@@ -1163,8 +1170,9 @@ var FileService = class {
1163
1170
  await operations.update(op.id, { status: "COMPLETED", fileId: record.id });
1164
1171
  return record;
1165
1172
  } catch (error) {
1173
+ const status = connectionCausedFailure(error) ? "UNKNOWN" : "FAILED";
1166
1174
  await operations.update(op.id, {
1167
- status: "FAILED",
1175
+ status,
1168
1176
  error: error instanceof Error ? error.message.slice(0, 200) : "upload failed"
1169
1177
  });
1170
1178
  throw error;
@@ -5087,7 +5095,7 @@ function encryptionCheck(configured) {
5087
5095
  }
5088
5096
 
5089
5097
  // ../../apps/api/src/routes/storage.ts
5090
- var VERSION = "0.2.24";
5098
+ var VERSION = "0.2.25";
5091
5099
  function registerStorageRoutes(app2, container2) {
5092
5100
  app2.get("/api/health", async () => {
5093
5101
  const database = await probeDatabase(container2);