dsh-opendesign-corouter 0.1.16 → 0.1.17
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/lib/config.d.ts +4 -0
- package/lib/device-auth.d.ts +1 -1
- package/lib/index.d.ts +12 -0
- package/lib/index.js +132 -7
- package/lib/index.js.map +4 -4
- package/lib/model-catalog-snapshot.d.ts +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 最近一次成功的网关模型目录快照。
|
|
3
|
+
*
|
|
4
|
+
* 快照保存在普通插件配置里,这样宿主重启后不会静默退回内置目录。它按不可信输入校验:
|
|
5
|
+
* 未知字段、越界数值与重复 id 一律拒绝;无效快照返回 `undefined`(忽略该字段),
|
|
6
|
+
* 不让损坏的持久化数据阻断插件加载。`baseURL` 绑定读取时的网关,换网关后旧快照不生效。
|
|
7
|
+
*/
|
|
8
|
+
import type { CatalogModel } from './catalog.js';
|
|
9
|
+
export interface ModelCatalogSnapshot {
|
|
10
|
+
/** 读取目录时的规范化网关地址。 */
|
|
11
|
+
baseURL: string;
|
|
12
|
+
/** 成功读取时间的 ISO-8601 字符串。 */
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
models: readonly CatalogModel[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validate a persisted snapshot into a fresh, allowlisted value.
|
|
18
|
+
* This is also a Schemastery transform: every constant and helper lives inline because the
|
|
19
|
+
* function is serialized as source and re-executed in a fresh realm. Avoid nested function
|
|
20
|
+
* declarations here — bundlers wrap them with helpers the fresh realm does not define.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseModelCatalogSnapshot(value: unknown): ModelCatalogSnapshot | undefined;
|