autosync_backend2 1.2.79 → 1.2.81

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.d.ts CHANGED
@@ -12643,8 +12643,8 @@ export declare const app: Elysia<"", {
12643
12643
  description: string | null;
12644
12644
  nmKey: string | null;
12645
12645
  };
12646
- 400: "nmKey давхцаж байна.";
12647
12646
  401: "Токен олдсонгүй";
12647
+ 409: "nmKey давхцаж байна.";
12648
12648
  422: {
12649
12649
  type: "validation";
12650
12650
  on: string;
@@ -12654,7 +12654,7 @@ export declare const app: Elysia<"", {
12654
12654
  property?: string;
12655
12655
  expected?: string;
12656
12656
  };
12657
- 500: "Failed to create channel";
12657
+ 500: "Суваг үүсгэхэд алдаа гарлаа.";
12658
12658
  };
12659
12659
  };
12660
12660
  };
@@ -12685,7 +12685,8 @@ export declare const app: Elysia<"", {
12685
12685
  oldId: number | null;
12686
12686
  };
12687
12687
  401: "Токен олдсонгүй";
12688
- 404: "Channel not found";
12688
+ 404: "Бүртгэл олдсонгүй.";
12689
+ 409: "nmKey давхцаж байна.";
12689
12690
  422: {
12690
12691
  type: "validation";
12691
12692
  on: string;
@@ -12695,6 +12696,7 @@ export declare const app: Elysia<"", {
12695
12696
  property?: string;
12696
12697
  expected?: string;
12697
12698
  };
12699
+ 500: "Суваг засахэд алдаа гарлаа.";
12698
12700
  };
12699
12701
  };
12700
12702
  };
package/dist/index.js CHANGED
@@ -288378,17 +288378,24 @@ var NotificationChannelLogic;
288378
288378
  return result;
288379
288379
  } catch (err2) {
288380
288380
  if (err2 instanceof DrizzleQueryError && err2.cause instanceof DatabaseError && err2.cause.code === "23505") {
288381
- return status("Bad Request", "nmKey \u0434\u0430\u0432\u0445\u0446\u0430\u0436 \u0431\u0430\u0439\u043D\u0430.");
288381
+ return status("Conflict", "nmKey \u0434\u0430\u0432\u0445\u0446\u0430\u0436 \u0431\u0430\u0439\u043D\u0430.");
288382
288382
  }
288383
- return status("Internal Server Error", "Failed to create channel");
288383
+ return status("Internal Server Error", "\u0421\u0443\u0432\u0430\u0433 \u04AF\u04AF\u0441\u0433\u044D\u0445\u044D\u0434 \u0430\u043B\u0434\u0430\u0430 \u0433\u0430\u0440\u043B\u0430\u0430.");
288384
288384
  }
288385
288385
  };
288386
288386
  NotificationChannelLogic.update = async (id, body) => {
288387
- const [result] = await db_default.update(nmChannelTable).set(body).where(eq(nmChannelTable.id, id)).returning();
288388
- if (!result) {
288389
- return status("Not Found", "Channel not found");
288387
+ try {
288388
+ const [result] = await db_default.update(nmChannelTable).set(body).where(eq(nmChannelTable.id, id)).returning();
288389
+ if (!result) {
288390
+ return status("Not Found", "\u0411\u04AF\u0440\u0442\u0433\u044D\u043B \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
288391
+ }
288392
+ return result;
288393
+ } catch (err2) {
288394
+ if (err2 instanceof DrizzleQueryError && err2.cause instanceof DatabaseError && err2.cause.code === "23505") {
288395
+ return status("Conflict", "nmKey \u0434\u0430\u0432\u0445\u0446\u0430\u0436 \u0431\u0430\u0439\u043D\u0430.");
288396
+ }
288397
+ return status("Internal Server Error", "\u0421\u0443\u0432\u0430\u0433 \u0437\u0430\u0441\u0430\u0445\u044D\u0434 \u0430\u043B\u0434\u0430\u0430 \u0433\u0430\u0440\u043B\u0430\u0430.");
288390
288398
  }
288391
- return result;
288392
288399
  };
288393
288400
  NotificationChannelLogic.remove = async (id) => {
288394
288401
  await db_default.update(nmChannelTable).set({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.2.79",
3
+ "version": "1.2.81",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",