ysk-omni 1.0.4 → 1.0.5
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/CHANGELOG.md +24 -0
- package/CHANGELOG.zh.md +24 -0
- package/README-ZH.md +21 -14
- package/README.md +21 -14
- package/dist/middlewares/error.middleware.d.ts.map +1 -1
- package/dist/middlewares/error.middleware.js +24 -7
- package/dist/middlewares/error.middleware.js.map +1 -1
- package/docs/en/operations.md +4 -0
- package/docs/zh/operations.md +4 -0
- package/package.json +8 -5
- package/public/admin/boot.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ Newest first. Every version from 1.0.0 is grouped by category. `README.md` shows
|
|
|
4
4
|
|
|
5
5
|
Entries come from git history, tags, and GitHub Releases.
|
|
6
6
|
|
|
7
|
+
## 1.0.5 — 2026-10-25
|
|
8
|
+
|
|
9
|
+
### Security
|
|
10
|
+
|
|
11
|
+
- Upgrade `multer` 1.4.5-lts to 2.5.0 to fix CVE-2026-77078 (High multipart field-name DoS) and later 2.x multipart fixes through 2.5.0, including CVE-2026-113872. Upload routes still use `memoryStorage`. Multer limit errors now return 413 / 400 instead of 500.
|
|
12
|
+
- Pin transitive `body-parser` 1.20.9 (CVE-2026-111181 / GHSA-27r3-jxmh-p828) with an npm `overrides` entry so `express.json` and `urlencoded` get the patched parser.
|
|
13
|
+
- Upgrade `vite` 6.4.4 → 6.4.5 (GHSA-8g5g-mxqh-grgj). The advisory applies to the Admin Vite **dev** server; production serves the built static Admin bundle.
|
|
14
|
+
- Production hosts should run a Node.js build from the 2026-10-21 security releases (22.23.4, 24.22.1, 26.12.1, or current patched LTS) for CVE-2026-111497 and related runtime fixes. Package `engines` stay `>=20`.
|
|
15
|
+
|
|
16
|
+
### Dependency upgrades
|
|
17
|
+
|
|
18
|
+
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
19
|
+
- `@types/multer` 1.4.13 → 2.3.0
|
|
20
|
+
- `body-parser` 1.20.8 → 1.20.9 (override)
|
|
21
|
+
- `vite` 6.4.4 → 6.4.5
|
|
22
|
+
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
23
|
+
|
|
24
|
+
### Internal/CI
|
|
25
|
+
|
|
26
|
+
- Bump the package version to 1.0.5, update Admin fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.5.
|
|
27
|
+
|
|
28
|
+
GitHub Release: https://github.com/yanshekki/ysk-omni/releases/tag/v1.0.5
|
|
29
|
+
Compare: https://github.com/yanshekki/ysk-omni/compare/v1.0.4...v1.0.5
|
|
30
|
+
|
|
7
31
|
## 1.0.4 — 2026-10-11
|
|
8
32
|
|
|
9
33
|
### Security
|
package/CHANGELOG.zh.md
CHANGED
|
@@ -4,6 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
條目來自 git 歷史、標籤與 GitHub Release。
|
|
6
6
|
|
|
7
|
+
## 1.0.5 — 2026-10-25
|
|
8
|
+
|
|
9
|
+
### 安全
|
|
10
|
+
|
|
11
|
+
- 將 `multer` 由 1.4.5-lts 升至 2.5.0,修復 CVE-2026-77078(高危 multipart 欄位名拒絕服務)以及 2.x 至 2.5.0 的後續 multipart 修補,包括 CVE-2026-113872。上傳路由仍用 `memoryStorage`。Multer 上限錯誤改回 413/400,不再當 500。
|
|
12
|
+
- 以 npm `overrides` 釘選傳遞依賴 `body-parser` 1.20.9(CVE-2026-111181/GHSA-27r3-jxmh-p828),讓 `express.json` 與 `urlencoded` 用上已修補的解析器。
|
|
13
|
+
- 將 `vite` 由 6.4.4 升至 6.4.5(GHSA-8g5g-mxqh-grgj)。該公告只影響 Admin Vite **開發**伺服器;生產環境提供已建置的靜態 Admin。
|
|
14
|
+
- 生產主機應使用 2026-10-21 Node.js 安全版本(22.23.4、24.22.1、26.12.1,或現行已修補 LTS),以覆蓋 CVE-2026-111497 等執行時期修補。套件 `engines` 維持 `>=20`。
|
|
15
|
+
|
|
16
|
+
### 依賴升級
|
|
17
|
+
|
|
18
|
+
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
19
|
+
- `@types/multer` 1.4.13 → 2.3.0
|
|
20
|
+
- `body-parser` 1.20.8 → 1.20.9(override)
|
|
21
|
+
- `vite` 6.4.4 → 6.4.5
|
|
22
|
+
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
23
|
+
|
|
24
|
+
### 內部/CI
|
|
25
|
+
|
|
26
|
+
- 將套件版本升至 1.0.5、更新 Admin fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.5。
|
|
27
|
+
|
|
28
|
+
GitHub Release:https://github.com/yanshekki/ysk-omni/releases/tag/v1.0.5
|
|
29
|
+
比較:https://github.com/yanshekki/ysk-omni/compare/v1.0.4...v1.0.5
|
|
30
|
+
|
|
7
31
|
## 1.0.4 — 2026-10-11
|
|
8
32
|
|
|
9
33
|
### 安全
|
package/README-ZH.md
CHANGED
|
@@ -34,6 +34,27 @@ curl -sS http://127.0.0.1:3850/v1/models \
|
|
|
34
34
|
|
|
35
35
|
## 更新日誌
|
|
36
36
|
|
|
37
|
+
### 1.0.5 — 2026-10-25
|
|
38
|
+
|
|
39
|
+
### 安全
|
|
40
|
+
|
|
41
|
+
- 將 `multer` 由 1.4.5-lts 升至 2.5.0,修復 CVE-2026-77078(高危 multipart 欄位名拒絕服務)以及 2.x 至 2.5.0 的後續 multipart 修補,包括 CVE-2026-113872。上傳路由仍用 `memoryStorage`。Multer 上限錯誤改回 413/400,不再當 500。
|
|
42
|
+
- 以 npm `overrides` 釘選傳遞依賴 `body-parser` 1.20.9(CVE-2026-111181/GHSA-27r3-jxmh-p828),讓 `express.json` 與 `urlencoded` 用上已修補的解析器。
|
|
43
|
+
- 將 `vite` 由 6.4.4 升至 6.4.5(GHSA-8g5g-mxqh-grgj)。該公告只影響 Admin Vite **開發**伺服器;生產環境提供已建置的靜態 Admin。
|
|
44
|
+
- 生產主機應使用 2026-10-21 Node.js 安全版本(22.23.4、24.22.1、26.12.1,或現行已修補 LTS),以覆蓋 CVE-2026-111497 等執行時期修補。套件 `engines` 維持 `>=20`。
|
|
45
|
+
|
|
46
|
+
### 依賴升級
|
|
47
|
+
|
|
48
|
+
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
49
|
+
- `@types/multer` 1.4.13 → 2.3.0
|
|
50
|
+
- `body-parser` 1.20.8 → 1.20.9(override)
|
|
51
|
+
- `vite` 6.4.4 → 6.4.5
|
|
52
|
+
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
53
|
+
|
|
54
|
+
### 內部/CI
|
|
55
|
+
|
|
56
|
+
- 將套件版本升至 1.0.5、更新 Admin fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.5。
|
|
57
|
+
|
|
37
58
|
### 1.0.4 — 2026-10-11
|
|
38
59
|
|
|
39
60
|
### 安全
|
|
@@ -71,20 +92,6 @@ curl -sS http://127.0.0.1:3850/v1/models \
|
|
|
71
92
|
- 開發文件記錄這條更新日誌規則。
|
|
72
93
|
- CI 與發佈工作流程改用在 Node 24 上執行的 GitHub Actions(`actions/checkout@v7`、`actions/setup-node@v7`、`softprops/action-gh-release@v3`)。發佈工作使用 Node 24。
|
|
73
94
|
|
|
74
|
-
### 1.0.2 — 2026-09-28
|
|
75
|
-
|
|
76
|
-
### 改進
|
|
77
|
-
|
|
78
|
-
- 完成其餘 Admin 字串的八種語言翻譯(`683a52f`)
|
|
79
|
-
- 將 Admin 字串 600–799 譯成八種語言(`8f77c6e`)
|
|
80
|
-
- 將 Admin 字串 400–599 譯成八種語言(`03c1bc3`)
|
|
81
|
-
- 將 Admin 字串 200–399 譯成八種語言(`dfebb9e`)
|
|
82
|
-
- 將首 200 條 Admin 字串譯成八種語言(`e891f6d`)
|
|
83
|
-
|
|
84
|
-
### 內部/CI
|
|
85
|
-
|
|
86
|
-
- 將套件版本升至 1.0.2、更新測試 fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.2(`03b3b1b`)
|
|
87
|
-
|
|
88
95
|
完整更新日誌:[CHANGELOG.zh.md](./CHANGELOG.zh.md)。
|
|
89
96
|
|
|
90
97
|
## 授權
|
package/README.md
CHANGED
|
@@ -34,6 +34,27 @@ Full CLI, API, Admin, Catalog, Runtimes, keys, and operations: **[Documentation]
|
|
|
34
34
|
|
|
35
35
|
## Changelog
|
|
36
36
|
|
|
37
|
+
### 1.0.5 — 2026-10-25
|
|
38
|
+
|
|
39
|
+
### Security
|
|
40
|
+
|
|
41
|
+
- Upgrade `multer` 1.4.5-lts to 2.5.0 to fix CVE-2026-77078 (High multipart field-name DoS) and later 2.x multipart fixes through 2.5.0, including CVE-2026-113872. Upload routes still use `memoryStorage`. Multer limit errors now return 413 / 400 instead of 500.
|
|
42
|
+
- Pin transitive `body-parser` 1.20.9 (CVE-2026-111181 / GHSA-27r3-jxmh-p828) with an npm `overrides` entry so `express.json` and `urlencoded` get the patched parser.
|
|
43
|
+
- Upgrade `vite` 6.4.4 → 6.4.5 (GHSA-8g5g-mxqh-grgj). The advisory applies to the Admin Vite **dev** server; production serves the built static Admin bundle.
|
|
44
|
+
- Production hosts should run a Node.js build from the 2026-10-21 security releases (22.23.4, 24.22.1, 26.12.1, or current patched LTS) for CVE-2026-111497 and related runtime fixes. Package `engines` stay `>=20`.
|
|
45
|
+
|
|
46
|
+
### Dependency upgrades
|
|
47
|
+
|
|
48
|
+
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
49
|
+
- `@types/multer` 1.4.13 → 2.3.0
|
|
50
|
+
- `body-parser` 1.20.8 → 1.20.9 (override)
|
|
51
|
+
- `vite` 6.4.4 → 6.4.5
|
|
52
|
+
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
53
|
+
|
|
54
|
+
### Internal/CI
|
|
55
|
+
|
|
56
|
+
- Bump the package version to 1.0.5, update Admin fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.5.
|
|
57
|
+
|
|
37
58
|
### 1.0.4 — 2026-10-11
|
|
38
59
|
|
|
39
60
|
### Security
|
|
@@ -71,20 +92,6 @@ Full CLI, API, Admin, Catalog, Runtimes, keys, and operations: **[Documentation]
|
|
|
71
92
|
- Development docs record this changelog rule.
|
|
72
93
|
- CI and the release workflow use GitHub Actions on the Node 24 runtime (`actions/checkout@v7`, `actions/setup-node@v7`, `softprops/action-gh-release@v3`). The publish job runs on Node 24.
|
|
73
94
|
|
|
74
|
-
### 1.0.2 — 2026-09-28
|
|
75
|
-
|
|
76
|
-
### Improvements
|
|
77
|
-
|
|
78
|
-
- Finish remaining Admin strings for eight languages (`683a52f`)
|
|
79
|
-
- Translate Admin strings 600–799 into eight languages (`8f77c6e`)
|
|
80
|
-
- Translate Admin strings 400–599 into eight languages (`03c1bc3`)
|
|
81
|
-
- Translate Admin strings 200–399 into eight languages (`dfebb9e`)
|
|
82
|
-
- Translate first 200 Admin strings into eight languages (`e891f6d`)
|
|
83
|
-
|
|
84
|
-
### Internal/CI
|
|
85
|
-
|
|
86
|
-
- Bump the package version, update fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.2 (`03b3b1b`)
|
|
87
|
-
|
|
88
95
|
Full changelog: [CHANGELOG.md](./CHANGELOG.md).
|
|
89
96
|
|
|
90
97
|
## License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.middleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"error.middleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAyB/D,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAEtF;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,YAAY,GAClB,IAAI,CAwCN"}
|
|
@@ -1,10 +1,26 @@
|
|
|
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
6
|
exports.notFoundHandler = notFoundHandler;
|
|
4
7
|
exports.errorMiddleware = errorMiddleware;
|
|
8
|
+
const multer_1 = __importDefault(require("multer"));
|
|
9
|
+
const env_1 = require("../config/env");
|
|
5
10
|
const http_exception_1 = require("../exceptions/http.exception");
|
|
6
11
|
const exception_factory_1 = require("../exceptions/exception.factory");
|
|
7
12
|
const logger_1 = require("../utils/logger");
|
|
13
|
+
function toHttpException(err) {
|
|
14
|
+
if (err instanceof http_exception_1.HttpException)
|
|
15
|
+
return err;
|
|
16
|
+
if (err instanceof multer_1.default.MulterError) {
|
|
17
|
+
if (err.code === 'LIMIT_FILE_SIZE') {
|
|
18
|
+
return exception_factory_1.ExceptionFactory.documentTooLarge(env_1.env.UPLOAD_MAX_BYTES);
|
|
19
|
+
}
|
|
20
|
+
return exception_factory_1.ExceptionFactory.validation(err.message);
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
8
24
|
function requestPath(req) {
|
|
9
25
|
return req.originalUrl || req.url || req.path || '';
|
|
10
26
|
}
|
|
@@ -19,24 +35,25 @@ function errorMiddleware(err, req, res, _next) {
|
|
|
19
35
|
res.status(httpErr.statusCode).json((0, http_exception_1.toProtocolErrorBody)(httpErr, path));
|
|
20
36
|
return;
|
|
21
37
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
const httpErr = toHttpException(err);
|
|
39
|
+
if (httpErr) {
|
|
40
|
+
if (httpErr.statusCode >= 500) {
|
|
41
|
+
logger_1.logger.error({ err, requestId: req.requestId, path: req.path }, httpErr.message);
|
|
25
42
|
}
|
|
26
43
|
else {
|
|
27
|
-
logger_1.logger.warn({ code:
|
|
44
|
+
logger_1.logger.warn({ code: httpErr.code, requestId: req.requestId, path: req.path }, httpErr.message);
|
|
28
45
|
}
|
|
29
46
|
if (res.headersSent) {
|
|
30
47
|
return;
|
|
31
48
|
}
|
|
32
|
-
res.status(
|
|
49
|
+
res.status(httpErr.statusCode).json((0, http_exception_1.toProtocolErrorBody)(httpErr, path));
|
|
33
50
|
return;
|
|
34
51
|
}
|
|
35
52
|
logger_1.logger.error({ err, requestId: req.requestId, path: req.path }, 'Unhandled error');
|
|
36
53
|
if (res.headersSent) {
|
|
37
54
|
return;
|
|
38
55
|
}
|
|
39
|
-
const
|
|
40
|
-
res.status(
|
|
56
|
+
const fallback = exception_factory_1.ExceptionFactory.internal();
|
|
57
|
+
res.status(fallback.statusCode).json((0, http_exception_1.toProtocolErrorBody)(fallback, path));
|
|
41
58
|
}
|
|
42
59
|
//# sourceMappingURL=error.middleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"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"}
|
package/docs/en/operations.md
CHANGED
|
@@ -11,6 +11,10 @@ curl -sS http://127.0.0.1:3850/ready
|
|
|
11
11
|
|
|
12
12
|
`/ready` checks SQLite and whether `llama-server` is on PATH.
|
|
13
13
|
|
|
14
|
+
## Node.js runtime
|
|
15
|
+
|
|
16
|
+
The package `engines` field is Node.js 20 or later. After the 2026-10-21 Node security releases, production hosts should run a patched build: **22.23.4**, **24.22.1**, **26.12.1**, or the current patched LTS. That set includes the Brotli out-of-bounds write (CVE-2026-111497).
|
|
17
|
+
|
|
14
18
|
## Process manager
|
|
15
19
|
|
|
16
20
|
```bash
|
package/docs/zh/operations.md
CHANGED
|
@@ -11,6 +11,10 @@ curl -sS http://127.0.0.1:3850/ready
|
|
|
11
11
|
|
|
12
12
|
`/ready` 檢查 SQLite,以及 `llama-server` 是否在 PATH。
|
|
13
13
|
|
|
14
|
+
## Node.js 執行時期
|
|
15
|
+
|
|
16
|
+
套件 `engines` 為 Node.js 20 或以上。2026-10-21 Node 安全版本之後,生產主機應使用已修補版本:**22.23.4**、**24.22.1**、**26.12.1**,或現行已修補 LTS。當中包括 Brotli 越界寫入(CVE-2026-111497)。
|
|
17
|
+
|
|
14
18
|
## 行程管理
|
|
15
19
|
|
|
16
20
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ysk-omni",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "YSK Omni — local models behind an OpenAI-compatible gateway, with Admin panel and CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openai",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"express": "^4.22.3",
|
|
83
83
|
"express-rate-limit": "^7.5.0",
|
|
84
84
|
"helmet": "^8.0.0",
|
|
85
|
-
"multer": "^
|
|
85
|
+
"multer": "^2.5.0",
|
|
86
86
|
"pino": "^9.6.0",
|
|
87
87
|
"pino-http": "^10.4.0",
|
|
88
88
|
"prisma": "6.19.3",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@eslint/js": "^9.39.5",
|
|
93
93
|
"@types/cors": "^2.8.17",
|
|
94
94
|
"@types/express": "^4.17.21",
|
|
95
|
-
"@types/multer": "^
|
|
95
|
+
"@types/multer": "^2.3.0",
|
|
96
96
|
"@types/node": "^22.20.5",
|
|
97
97
|
"@vitest/coverage-v8": "^3.0.9",
|
|
98
98
|
"eslint": "^9.39.5",
|
|
@@ -100,11 +100,14 @@
|
|
|
100
100
|
"pino-pretty": "^13.2.0",
|
|
101
101
|
"tsx": "^4.23.15",
|
|
102
102
|
"typescript": "5.8",
|
|
103
|
-
"typescript-eslint": "^8.
|
|
104
|
-
"vite": "^6.4.
|
|
103
|
+
"typescript-eslint": "^8.72.0",
|
|
104
|
+
"vite": "^6.4.5",
|
|
105
105
|
"vitest": "^3.0.9"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=20"
|
|
109
|
+
},
|
|
110
|
+
"overrides": {
|
|
111
|
+
"body-parser": "1.20.9"
|
|
109
112
|
}
|
|
110
113
|
}
|
package/public/admin/boot.js
CHANGED
|
@@ -28,7 +28,7 @@ const Vs="YSK Omni",Ws="Admin Panel",Qs="Admin",Js="API Key",Ys="One-time login
|
|
|
28
28
|
<div class="lang-switch-heading">${dt(a)}</div>
|
|
29
29
|
<ul class="lang-switch-list" role="listbox" aria-label="${dt(a)}">${i}</ul>
|
|
30
30
|
</div>
|
|
31
|
-
</div>`}function Ht(){document.querySelectorAll("[data-lang-switch]").forEach(a=>{a.classList.remove("is-open");const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");s&&s.setAttribute("aria-expanded","false"),i&&i.setAttribute("hidden","")})}function cm(a){const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");if(!s||!i)return;const o=s.getBoundingClientRect(),n=Math.min(280,Math.max(o.width,228)),d=Math.min(Math.max(8,o.left),Math.max(8,window.innerWidth-n-8));i.style.width=`${n}px`,i.style.left=`${d}px`;const r=window.innerHeight-o.bottom;r<260&&o.top>r?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top+6}px`):(i.style.top=`${o.bottom+6}px`,i.style.bottom="auto")}function ns(a){document.querySelectorAll("[data-lang-switch]").forEach(s=>{const i=s.querySelector(".lang-switch-btn"),o=s.querySelector(".lang-switch-panel");if(!i||!o)return;const n=()=>{Ht(),s.classList.add("is-open"),i.setAttribute("aria-expanded","true"),o.removeAttribute("hidden"),cm(s)},d=()=>{s.classList.remove("is-open"),i.setAttribute("aria-expanded","false"),o.setAttribute("hidden","")};o.addEventListener("click",r=>r.stopPropagation()),i.addEventListener("click",r=>{r.stopPropagation(),s.classList.contains("is-open")?d():n()}),s.querySelectorAll("[data-lang]").forEach(r=>{r.addEventListener("click",u=>{u.stopPropagation();const m=r.getAttribute("data-lang")||"";if(!Ma(m)||m===ze){d();return}nm(m),a()})})}),window.__yskLangSwitchBound||(window.__yskLangSwitchBound=!0,document.addEventListener("click",()=>Ht()),document.addEventListener("keydown",s=>{s.key==="Escape"&&Ht()}),window.addEventListener("resize",()=>Ht()))}os(ze);const um="1.0.
|
|
31
|
+
</div>`}function Ht(){document.querySelectorAll("[data-lang-switch]").forEach(a=>{a.classList.remove("is-open");const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");s&&s.setAttribute("aria-expanded","false"),i&&i.setAttribute("hidden","")})}function cm(a){const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");if(!s||!i)return;const o=s.getBoundingClientRect(),n=Math.min(280,Math.max(o.width,228)),d=Math.min(Math.max(8,o.left),Math.max(8,window.innerWidth-n-8));i.style.width=`${n}px`,i.style.left=`${d}px`;const r=window.innerHeight-o.bottom;r<260&&o.top>r?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top+6}px`):(i.style.top=`${o.bottom+6}px`,i.style.bottom="auto")}function ns(a){document.querySelectorAll("[data-lang-switch]").forEach(s=>{const i=s.querySelector(".lang-switch-btn"),o=s.querySelector(".lang-switch-panel");if(!i||!o)return;const n=()=>{Ht(),s.classList.add("is-open"),i.setAttribute("aria-expanded","true"),o.removeAttribute("hidden"),cm(s)},d=()=>{s.classList.remove("is-open"),i.setAttribute("aria-expanded","false"),o.setAttribute("hidden","")};o.addEventListener("click",r=>r.stopPropagation()),i.addEventListener("click",r=>{r.stopPropagation(),s.classList.contains("is-open")?d():n()}),s.querySelectorAll("[data-lang]").forEach(r=>{r.addEventListener("click",u=>{u.stopPropagation();const m=r.getAttribute("data-lang")||"";if(!Ma(m)||m===ze){d();return}nm(m),a()})})}),window.__yskLangSwitchBound||(window.__yskLangSwitchBound=!0,document.addEventListener("click",()=>Ht()),document.addEventListener("keydown",s=>{s.key==="Escape"&&Ht()}),window.addEventListener("resize",()=>Ht()))}os(ze);const um="1.0.5",mm={version:um},pm=String(mm.version),rs=new Set([".txt",".md",".markdown",".csv",".json",".xml",".html",".htm",".js",".ts",".tsx",".jsx",".py",".java",".go",".rs",".c",".cpp",".h",".hpp",".css",".yml",".yaml",".toml",".ini",".env",".sh",".sql",".log",".pdf",".png",".jpg",".jpeg",".webp",".gif"]),gm=[...rs].join(","),ft="/admin/api",Vt="gog_admin_session";let Xe=null,Ze=!1;function Ia(a,s){const i=a?.error&&typeof a.error=="object"?a.error:a||{},o=typeof i.code=="string"?i.code:"",n=i.details&&typeof i.details=="object"?i.details:{},d=typeof n.feature=="string"?n.feature:typeof n.flag=="string"?n.flag:"",r=typeof n.reason=="string"?n.reason:"",u=String(i.message||a?.message||s||"");if(d&&(o==="feature_disabled"||o==="media_not_supported"||o==="forbidden")){const c=`errors.feature.${d}`;if(Pe(c))return e(c)}if(o==="feature_disabled"&&Pe("errors.feature_disabled")){const c=la(u);return c&&Pe(`errors.feature.${c}`)?e(`errors.feature.${c}`):e("errors.feature_disabled")}if(r&&Pe(`errors.media.${r}`))return e(`errors.media.${r}`);if(o==="media_generation_failed"&&r&&Pe(`errors.media.${r}`))return e(`errors.media.${r}`);if(o==="media_forbidden"&&Pe("errors.media_forbidden"))return e("errors.media_forbidden");const m=la(u);if(m&&Pe(`errors.feature.${m}`))return e(`errors.feature.${m}`);if(o){const c=`errors.${o}`;if(Pe(c))return e(c)}const g=la(u);return g&&Pe(`errors.feature.${g}`)?e(`errors.feature.${g}`):/agent-mode|agent mode|Safe keys cannot/i.test(u)?e("errors.media.agent_or_admin_required"):/no image file was found/i.test(u)?e("errors.media.no_image_in_sandbox"):/no video file was found/i.test(u)?e("errors.media.no_video_in_sandbox"):/does not support image edits/i.test(u)?e("errors.media.provider_no_edit"):/Provide an image file|sourceAssetId|sourceDocumentId/i.test(u)?e("errors.media.source_required"):/must be an image/i.test(u)?e("errors.media.source_must_be_image"):u||e("common.requestFailed")}function la(a){const s=String(a||"");return/videoApi/i.test(s)||/Video API is disabled/i.test(s)?"videoApi":/imagesApi/i.test(s)||/Images API is disabled/i.test(s)?"imagesApi":/audioApi/i.test(s)||/Audio API is disabled/i.test(s)?"audioApi":/filesOpenAiAlias/i.test(s)||/Files API alias/i.test(s)?"filesOpenAiAlias":/Tools are disabled/i.test(s)||/\btools\b/i.test(s)&&/disabled/i.test(s)&&/image/i.test(s)?"tools":""}const l={key:sessionStorage.getItem(Vt)||"",page:"dashboard",me:null,error:"",modal:null,chatFilter:{q:"",status:"",model:"",apiKeyId:"",from:"",to:"",policyMode:"",hasDocuments:"",sortBy:"createdAt",sortDir:"desc",limit:50,offset:0},docFilter:{q:"",apiKeyId:"",storageType:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",limit:20,offset:0},keyFilter:{q:"",role:"",mode:"",isActive:"",sortBy:"createdAt",sortDir:"desc",limit:20,offset:0},auditFilter:{q:"",action:"",apiKeyId:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",limit:50,offset:0},usageFilter:{tab:"model",modelQ:"",keyQ:"",keyActive:"",modelPage:0,keyPage:0,pageSize:10,sortBy:"lastUsedAt",sortDir:"desc",modelSortBy:"requests",modelSortDir:"desc"},ddosFilter:{tab:"policy",liveQ:"",banQ:"",banSource:"",livePage:0,banPage:0,pageSize:15,liveSortBy:"startedAt",liveSortDir:"desc",banSortBy:"createdAt",banSortDir:"desc",eventSortBy:"at",eventSortDir:"desc"},mediaFilter:{tab:"studio",q:"",kind:"",provider:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",jobSortBy:"createdAt",jobSortDir:"desc",limit:20,offset:0},systemTab:"software",sessionQ:"",pm2Tab:"runner",apiFeaturesTab:"protocols",catalogTab:"local",catalogModality:"",catalogPulling:"",catalogPull:{id:"",bytes:0,total:0},catalogQueue:[],catalogQueueRunning:!1,catalogHubQ:"",catalogHubHits:null,catalogHubNext:"",catalogHubBusy:!1,catalogPopularSyncedAt:"",runtimesOs:"host",runtimesMod:"",runtimesReport:null,runtimesInstall:null,models:[],catalogLocal:[],keys:[]},fm={login:"login",dashboard:"dashboard",chat:"chat",chats:"chats",keys:"keys",documents:"documents",media:"media",catalog:"catalog",runtimes:"runtimes",audit:"audit",settings:"settings","api-features":"apiFeatures",apifeatures:"apiFeatures",usage:"usage",ddos:"ddos",queue:"queue",pm2:"pm2",system:"system",support:"support",business:"business"};function bm(a){return a==="apiFeatures"?"api-features":a||"dashboard"}function wa(a){const s=String(a||"").replace(/^#\/?/,"").split("?")[0].split("/")[0].toLowerCase();return s?s==="runtime"||s==="engines"||s==="engine"?"runtimes":fm[s]||null:null}function Ta(a){const s=`#/${bm(a)}`;location.hash!==s&&history.pushState(null,"",s)}function hm(){const a=wa(location.hash);return a||(l.key?"dashboard":"login")}async function I(a,s={}){const i={...s.body?{"Content-Type":"application/json"}:{},...l.key?{Authorization:`Bearer ${l.key}`}:{},...s.headers||{}},o=await fetch(`${ft}${a}`,{...s,headers:i}),n=await o.text();let d=null;try{d=n?JSON.parse(n):null}catch{d={error:{message:n}}}if(!o.ok){const r=Ia(d,o.statusText),u=d?.error?.code||"";o.status===401?l.page!=="login"&&Wt(!1):o.status===403&&!["media_forbidden","feature_disabled","forbidden","media_not_supported"].includes(u)&&l.page!=="login"&&Wt(!1);const m=new Error(r);throw m.status=o.status,m.code=u,m.details=d?.error?.details,m}return d}async function Ft(a){const s=await a.text();let i=null;try{i=s?JSON.parse(s):null}catch{i={error:{message:s}}}if(!a.ok){const o=Ia(i,a.statusText),n=new Error(o);throw n.status=a.status,n.code=i?.error?.code,n.details=i?.error?.details,n}return i}function Wt(a=!0){const s=l.key;a&&s&&String(s).startsWith("gog_sess_")&&fetch("/admin/api/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${s}`}}).catch(()=>{}),a&&sessionStorage.removeItem(Vt),l.key="",l.me=null,l.page="login",Ta("login"),oa()}function xa(a){Ca(a,{writeHash:!0})}function Ca(a,s={}){const i=a||"dashboard";l.page=i,l.modal=null,l.error="",i==="chats"&&(l.chatFilter.offset=0),i==="documents"&&(l.docFilter.offset=0),i==="keys"&&(l.keyFilter.offset=0),i==="audit"&&(l.auditFilter.offset=0),i==="media"&&(l.mediaFilter.offset=0),i!=="ddos"&&Xe&&(clearInterval(Xe),Xe=null),i!=="chat"&&document.body.classList.remove("chat-history-open"),s.writeHash!==!1&&Ta(i),oa()}function t(a){return String(a??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}let Le=null,Qt=null;function et(a){const s=Qt;Qt=null,Le&&(Le.remove(),Le=null),document.body.classList.remove("ui-dialog-open"),document.removeEventListener("keydown",Ea,!0),s&&s(a)}function Ea(a){if(Le&&a.key==="Escape"){a.preventDefault(),a.stopPropagation();const s=Le.dataset.cancelable!=="0";et(s?Le.dataset.prompt==="1"?null:!1:!0)}}function La(a){Le&&et(!1);const s=a.variant||(a.showCancel===!1?"info":"confirm"),i=a.showCancel!==!1,o=!!a.input,n=a.title||e(s==="danger"?"common.dangerTitle":i?"common.confirmTitle":"common.notice"),d=a.confirmText||e(i?"common.confirm":"common.ok"),r=a.cancelText||e("common.cancel"),u=s==="danger"?"!":s==="info"&&!i?"i":"?",m=document.createElement("div");m.className="ui-dialog-back",m.id="ui-dialog-back",m.dataset.cancelable=i||o?"1":"0",m.dataset.prompt=o?"1":"0",m.setAttribute("role","presentation"),m.innerHTML=`
|
|
32
32
|
<div class="ui-dialog ui-dialog--${t(s)}" role="alertdialog" aria-modal="true" aria-labelledby="ui-dialog-title" aria-describedby="ui-dialog-msg">
|
|
33
33
|
<div class="ui-dialog-h">
|
|
34
34
|
<div class="ui-dialog-icon" aria-hidden="true">${u}</div>
|