@modesto_ma/dsh-channels 0.6.0 → 0.7.0
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 +3 -3
- package/lib/index.js +10 -9
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/analyze/contract.ts +6 -5
- package/src/analyze/server.ts +1 -1
- package/src/config.ts +1 -1
- package/src/settings/surface.ts +1 -1
package/package.json
CHANGED
package/src/analyze/contract.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire contract of the log-platform analyze API.
|
|
3
3
|
*
|
|
4
|
-
* `POST /api/
|
|
4
|
+
* `POST /open-api/logalyze` on the DSH Web server, with
|
|
5
5
|
* `Authorization: Bearer <token>`, an `Idempotency-Key` header, and a JSON
|
|
6
6
|
* body naming the requester, the trigger time, the subject (application +
|
|
7
7
|
* error code), the log-platform detail pages, the target group, and the
|
|
@@ -18,11 +18,12 @@ import { z } from 'zod'
|
|
|
18
18
|
import { FEISHU_USER_ID_PATTERN } from '../domain.ts'
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Exact DSH Web route of the analyze API. It
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Exact DSH Web route of the analyze API. It sits outside DSH's `/api`
|
|
22
|
+
* namespace so a gateway in front of DSH can expose it separately from the
|
|
23
|
+
* login-protected DSH API; the request carries this API's bearer token, not a
|
|
24
|
+
* DSH login.
|
|
24
25
|
*/
|
|
25
|
-
export const ANALYZE_ROUTE = '/api/
|
|
26
|
+
export const ANALYZE_ROUTE = '/open-api/logalyze'
|
|
26
27
|
|
|
27
28
|
/** Largest accepted request body (the prompt dominates it). */
|
|
28
29
|
export const ANALYZE_MAX_BODY_BYTES = 1024 * 1024
|
package/src/analyze/server.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The analyze API's HTTP route on the DSH Web server.
|
|
3
3
|
*
|
|
4
|
-
* Registers the exact route `POST /api/
|
|
4
|
+
* Registers the exact route `POST /open-api/logalyze` (see
|
|
5
5
|
* `./contract.ts`) on the host `webServer`; hosts without one (headless) have
|
|
6
6
|
* no analyze API. This module owns the transport-level checks, in order:
|
|
7
7
|
* path, the `analyzeEnabled` switch, method, bearer token, `Idempotency-Key`,
|
package/src/config.ts
CHANGED
|
@@ -422,7 +422,7 @@ export const configSchema = z.object({
|
|
|
422
422
|
*/
|
|
423
423
|
questionTimeoutMs: z.number().int().min(10_000).max(3_600_000).default(DEFAULT_QUESTION_TIMEOUT_MS),
|
|
424
424
|
/**
|
|
425
|
-
* Switch for the log-platform analyze API (`POST /api/
|
|
425
|
+
* Switch for the log-platform analyze API (`POST /open-api/logalyze`
|
|
426
426
|
* on the DSH Web server). Off (default) answers 404; read per request, so
|
|
427
427
|
* toggling it needs no reconnect. Needs a host with a Web server.
|
|
428
428
|
*/
|
package/src/settings/surface.ts
CHANGED
|
@@ -442,7 +442,7 @@ const FIELD_META: Record<EditableKey, FieldMeta> = {
|
|
|
442
442
|
label: '日志分析接口',
|
|
443
443
|
group: 'analyze',
|
|
444
444
|
summary: '关闭时接口返回 404',
|
|
445
|
-
help: '接口挂在 DSH Web 端口上:POST /api/
|
|
445
|
+
help: '接口挂在 DSH Web 端口上:POST /open-api/logalyze,请求需带 Authorization: Bearer <访问令牌>。只有带 Web 的 profile 才有这个接口。改后立即生效,不需要重连。',
|
|
446
446
|
},
|
|
447
447
|
loggerLevel: { label: 'SDK 日志级别', group: 'logging' },
|
|
448
448
|
}
|