@djvlc/contracts-types 1.7.1 → 1.8.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/dist/index.d.mts +556 -9
- package/dist/index.d.ts +556 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -538,27 +538,100 @@ interface PageMeta {
|
|
|
538
538
|
tags?: string[];
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
|
-
*
|
|
541
|
+
* 视口配置
|
|
542
542
|
*/
|
|
543
|
-
interface
|
|
543
|
+
interface ViewportConfig {
|
|
544
|
+
/** 移动端断点(默认 768px) */
|
|
545
|
+
mobile?: number;
|
|
546
|
+
/** 平板断点(默认 1024px) */
|
|
547
|
+
tablet?: number;
|
|
548
|
+
/** 桌面断点(默认 1440px) */
|
|
549
|
+
desktop?: number;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* 页面布局配置
|
|
553
|
+
*
|
|
554
|
+
* @description
|
|
555
|
+
* 决定页面如何布局和渲染的核心配置。
|
|
556
|
+
* 运行时需第一时间解析,影响整体渲染策略。
|
|
557
|
+
*/
|
|
558
|
+
interface PageLayoutConfig {
|
|
544
559
|
/** 画布类型 */
|
|
545
560
|
canvasType: CanvasType;
|
|
546
|
-
/**
|
|
561
|
+
/** 画布尺寸(仅 canvasType 非 responsive 时生效) */
|
|
547
562
|
canvasSize?: {
|
|
548
563
|
width: number;
|
|
549
564
|
height: number;
|
|
550
565
|
};
|
|
566
|
+
/** 内容最大宽度(响应式页面常用,如 1200px) */
|
|
567
|
+
maxWidth?: number;
|
|
568
|
+
/** 页面容器内边距 */
|
|
569
|
+
padding?: {
|
|
570
|
+
top?: number;
|
|
571
|
+
right?: number;
|
|
572
|
+
bottom?: number;
|
|
573
|
+
left?: number;
|
|
574
|
+
};
|
|
575
|
+
/** 视口断点配置(响应式页面使用) */
|
|
576
|
+
viewport?: ViewportConfig;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* 主题配置
|
|
580
|
+
*/
|
|
581
|
+
interface ThemeConfig {
|
|
582
|
+
/** 预设主题 */
|
|
583
|
+
preset?: 'light' | 'dark' | 'system' | 'custom';
|
|
584
|
+
/** 主题变量覆盖(优先级高于 preset) */
|
|
585
|
+
variables?: Record<string, string>;
|
|
586
|
+
/** 颜色模式切换时的过渡动画 */
|
|
587
|
+
transition?: boolean;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* 页面样式配置
|
|
591
|
+
*
|
|
592
|
+
* @description
|
|
593
|
+
* 纯视觉样式配置,不影响布局逻辑。
|
|
594
|
+
* 运行时可延迟或增量应用。
|
|
595
|
+
*/
|
|
596
|
+
interface PageStylesConfig {
|
|
597
|
+
/** 主题配置 */
|
|
598
|
+
theme?: ThemeConfig;
|
|
551
599
|
/** 背景配置 */
|
|
552
600
|
background?: BackgroundConfig;
|
|
553
|
-
/** 页面级 CSS
|
|
601
|
+
/** 页面级 CSS 变量(与 theme.variables 合并,此处优先级更高) */
|
|
554
602
|
cssVariables?: Record<string, string>;
|
|
555
|
-
/**
|
|
556
|
-
|
|
603
|
+
/** 页面级自定义样式(注入 <style>) */
|
|
604
|
+
customCSS?: string;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* 页面行为配置
|
|
608
|
+
*
|
|
609
|
+
* @description
|
|
610
|
+
* 控制运行时行为,与渲染无直接关系。
|
|
611
|
+
*/
|
|
612
|
+
interface PageBehaviorConfig {
|
|
557
613
|
/** 是否启用调试模式 */
|
|
558
614
|
debug?: boolean;
|
|
559
615
|
/** 国际化配置 */
|
|
560
616
|
i18n?: PageI18nConfig;
|
|
561
617
|
}
|
|
618
|
+
/**
|
|
619
|
+
* 页面配置
|
|
620
|
+
*
|
|
621
|
+
* @description
|
|
622
|
+
* 三层分离结构,便于运行时按需解析:
|
|
623
|
+
* - layout: 布局决策(关键路径,同步解析)
|
|
624
|
+
* - styles: 样式注入(可延迟应用)
|
|
625
|
+
* - behavior: 行为控制(独立处理)
|
|
626
|
+
*/
|
|
627
|
+
interface PageConfig {
|
|
628
|
+
/** 布局配置 */
|
|
629
|
+
layout: PageLayoutConfig;
|
|
630
|
+
/** 样式配置 */
|
|
631
|
+
styles?: PageStylesConfig;
|
|
632
|
+
/** 行为配置 */
|
|
633
|
+
behavior?: PageBehaviorConfig;
|
|
634
|
+
}
|
|
562
635
|
|
|
563
636
|
/**
|
|
564
637
|
* 状态系统类型
|
|
@@ -1829,14 +1902,487 @@ interface PageDraft {
|
|
|
1829
1902
|
updatedAt: ISODateTime;
|
|
1830
1903
|
}
|
|
1831
1904
|
|
|
1905
|
+
/**
|
|
1906
|
+
* 页面快照类型(CDN 产物核心结构)
|
|
1907
|
+
*
|
|
1908
|
+
* @description
|
|
1909
|
+
* PageSnapshotJson 是发布后生成的运行时渲染闭包,包含:
|
|
1910
|
+
* - 页面渲染数据
|
|
1911
|
+
* - 组件锁定清单
|
|
1912
|
+
* - Definition 版本摘要
|
|
1913
|
+
* - 运维配置引用
|
|
1914
|
+
* - 元数据
|
|
1915
|
+
*
|
|
1916
|
+
* 设计原则:一次 resolve 返回渲染所需的一切闭包,减少运行时请求次数。
|
|
1917
|
+
*/
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* 页面快照 JSON 结构
|
|
1921
|
+
*
|
|
1922
|
+
* @description
|
|
1923
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/snapshot.json`
|
|
1924
|
+
* Runtime 加载此文件即可完成页面渲染。
|
|
1925
|
+
*/
|
|
1926
|
+
interface PageSnapshotJson {
|
|
1927
|
+
/**
|
|
1928
|
+
* 页面渲染数据
|
|
1929
|
+
*/
|
|
1930
|
+
page: PageSnapshotPage;
|
|
1931
|
+
/**
|
|
1932
|
+
* 组件锁定清单
|
|
1933
|
+
*/
|
|
1934
|
+
manifest: PageSnapshotManifest;
|
|
1935
|
+
/**
|
|
1936
|
+
* 绑定的 Definition 版本摘要(审计/回放用)
|
|
1937
|
+
*/
|
|
1938
|
+
definitionsDigest: DefinitionsDigest;
|
|
1939
|
+
/**
|
|
1940
|
+
* 运维配置(内联或引用)
|
|
1941
|
+
*/
|
|
1942
|
+
ops: OpsConfig;
|
|
1943
|
+
/**
|
|
1944
|
+
* 元数据
|
|
1945
|
+
*/
|
|
1946
|
+
meta: PageSnapshotMeta;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* 页面渲染数据
|
|
1950
|
+
*/
|
|
1951
|
+
interface PageSnapshotPage {
|
|
1952
|
+
/** Schema 版本 */
|
|
1953
|
+
schemaVersion: string;
|
|
1954
|
+
/** 页面 ID */
|
|
1955
|
+
pageId: string;
|
|
1956
|
+
/** 页面版本 */
|
|
1957
|
+
pageVersion: SemVer;
|
|
1958
|
+
/** 页面标题 */
|
|
1959
|
+
title: string;
|
|
1960
|
+
/** 初始状态 */
|
|
1961
|
+
initialState: Record<string, JsonValue>;
|
|
1962
|
+
/** 数据绑定配置 */
|
|
1963
|
+
bindings: DataBinding[];
|
|
1964
|
+
/** 组件树根节点 */
|
|
1965
|
+
root: ComponentNode;
|
|
1966
|
+
/** 页面配置(画布类型、背景等) */
|
|
1967
|
+
config: {
|
|
1968
|
+
canvasType: 'h5' | 'tablet' | 'pc' | 'responsive';
|
|
1969
|
+
canvasSize?: {
|
|
1970
|
+
width: number;
|
|
1971
|
+
height: number;
|
|
1972
|
+
};
|
|
1973
|
+
background?: {
|
|
1974
|
+
type: 'color' | 'image' | 'gradient';
|
|
1975
|
+
value: string;
|
|
1976
|
+
};
|
|
1977
|
+
cssVariables?: Record<string, string>;
|
|
1978
|
+
};
|
|
1979
|
+
/** SEO 配置 */
|
|
1980
|
+
seo?: {
|
|
1981
|
+
title?: string;
|
|
1982
|
+
description?: string;
|
|
1983
|
+
keywords?: string[];
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* 组件锁定清单(Snapshot 内嵌版本)
|
|
1988
|
+
*/
|
|
1989
|
+
interface PageSnapshotManifest {
|
|
1990
|
+
/** 组件列表 */
|
|
1991
|
+
components: SnapshotComponentEntry[];
|
|
1992
|
+
/** Runtime 版本要求 */
|
|
1993
|
+
runtime: {
|
|
1994
|
+
/** 推荐版本 */
|
|
1995
|
+
version: SemVer;
|
|
1996
|
+
/** 最低版本 */
|
|
1997
|
+
minVersion: SemVer;
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* Snapshot 中的组件条目
|
|
2002
|
+
*/
|
|
2003
|
+
interface SnapshotComponentEntry {
|
|
2004
|
+
/** 组件名称 */
|
|
2005
|
+
name: string;
|
|
2006
|
+
/** 组件版本 */
|
|
2007
|
+
version: SemVer;
|
|
2008
|
+
/** SRI 完整性哈希 */
|
|
2009
|
+
integrity: SHAIntegrity;
|
|
2010
|
+
/** CDN 资源基础 URL */
|
|
2011
|
+
assetsUrl: string;
|
|
2012
|
+
/** 入口点 */
|
|
2013
|
+
entrypoints: {
|
|
2014
|
+
/** JS 入口(相对于 assetsUrl) */
|
|
2015
|
+
js: string;
|
|
2016
|
+
/** CSS 入口(可选) */
|
|
2017
|
+
css?: string;
|
|
2018
|
+
/** 分包列表(可选) */
|
|
2019
|
+
chunks?: string[];
|
|
2020
|
+
};
|
|
2021
|
+
/** 是否预加载 */
|
|
2022
|
+
preload?: boolean;
|
|
2023
|
+
/** 加载优先级 */
|
|
2024
|
+
priority?: 'critical' | 'high' | 'normal' | 'low';
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Definition 版本摘要
|
|
2028
|
+
*
|
|
2029
|
+
* @description
|
|
2030
|
+
* 记录页面绑定的 ActionDefinition 和 DataQueryDefinition 版本。
|
|
2031
|
+
* 用于审计、回放、版本追溯。
|
|
2032
|
+
*/
|
|
2033
|
+
interface DefinitionsDigest {
|
|
2034
|
+
/** 绑定的 Action Definition 版本 */
|
|
2035
|
+
actions: DefinitionVersionDigest[];
|
|
2036
|
+
/** 绑定的 Data Query Definition 版本 */
|
|
2037
|
+
queries: DefinitionVersionDigest[];
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* 单个 Definition 版本摘要
|
|
2041
|
+
*/
|
|
2042
|
+
interface DefinitionVersionDigest {
|
|
2043
|
+
/** Definition ID */
|
|
2044
|
+
id: UniqueId;
|
|
2045
|
+
/** Definition 名称 */
|
|
2046
|
+
name: string;
|
|
2047
|
+
/** 版本 ID */
|
|
2048
|
+
versionId: UniqueId;
|
|
2049
|
+
/** 内容哈希(用于完整性校验) */
|
|
2050
|
+
hash: string;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* 运维配置
|
|
2054
|
+
*
|
|
2055
|
+
* @description
|
|
2056
|
+
* 包含 kill-switch、blocked 组件列表、功能开关等运维控制配置。
|
|
2057
|
+
* 由 User API resolve 时下发,Runtime 据此做运行时控制。
|
|
2058
|
+
*/
|
|
2059
|
+
interface OpsConfig {
|
|
2060
|
+
/** 配置版本 ID(用于缓存失效) */
|
|
2061
|
+
configVersionId?: string;
|
|
2062
|
+
/** Kill-Switch 列表(被紧急关闭的功能/动作) */
|
|
2063
|
+
killSwitch: KillSwitchItem[];
|
|
2064
|
+
/** 被阻断的组件列表 */
|
|
2065
|
+
blockedComponents: BlockedComponentItem[];
|
|
2066
|
+
/** 功能开关 */
|
|
2067
|
+
flags: Record<string, boolean>;
|
|
2068
|
+
/** 限流配置(可选) */
|
|
2069
|
+
rateLimit?: {
|
|
2070
|
+
/** 全局 QPS 限制 */
|
|
2071
|
+
globalQps?: number;
|
|
2072
|
+
/** 按动作类型的 QPS 限制 */
|
|
2073
|
+
actionQps?: Record<string, number>;
|
|
2074
|
+
};
|
|
2075
|
+
/** 配置过期时间(用于缓存) */
|
|
2076
|
+
expiresAt?: ISODateTime;
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Kill-Switch 条目
|
|
2080
|
+
*/
|
|
2081
|
+
interface KillSwitchItem {
|
|
2082
|
+
/** 目标类型 */
|
|
2083
|
+
targetType: 'action' | 'component' | 'feature' | 'page' | 'query';
|
|
2084
|
+
/** 目标 ID(actionType / componentName / featureKey / pageId / queryId) */
|
|
2085
|
+
targetId: string;
|
|
2086
|
+
/** 是否启用(true = 被关闭) */
|
|
2087
|
+
enabled: boolean;
|
|
2088
|
+
/** 关闭原因 */
|
|
2089
|
+
reason?: string;
|
|
2090
|
+
/** 关闭时间 */
|
|
2091
|
+
enabledAt?: ISODateTime;
|
|
2092
|
+
/** 关闭操作者 */
|
|
2093
|
+
enabledBy?: string;
|
|
2094
|
+
/** 用户提示消息 */
|
|
2095
|
+
userMessage?: string;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* 被阻断的组件条目
|
|
2099
|
+
*/
|
|
2100
|
+
interface BlockedComponentItem {
|
|
2101
|
+
/** 组件名称 */
|
|
2102
|
+
name: string;
|
|
2103
|
+
/** 组件版本(可选,不指定则阻断所有版本) */
|
|
2104
|
+
version?: SemVer;
|
|
2105
|
+
/** 阻断原因 */
|
|
2106
|
+
reason: string;
|
|
2107
|
+
/** 阻断时间 */
|
|
2108
|
+
blockedAt: ISODateTime;
|
|
2109
|
+
/** 阻断操作者 */
|
|
2110
|
+
blockedBy: string;
|
|
2111
|
+
/** 降级版本(可选) */
|
|
2112
|
+
fallbackVersion?: SemVer;
|
|
2113
|
+
/** 是否紧急阻断 */
|
|
2114
|
+
urgent: boolean;
|
|
2115
|
+
}
|
|
2116
|
+
/**
|
|
2117
|
+
* 页面快照元数据
|
|
2118
|
+
*
|
|
2119
|
+
* @description
|
|
2120
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/meta.json`
|
|
2121
|
+
* 用于审计、回放、排查。
|
|
2122
|
+
*/
|
|
2123
|
+
interface PageSnapshotMeta {
|
|
2124
|
+
/** 页面 ID */
|
|
2125
|
+
pageId: UniqueId;
|
|
2126
|
+
/** 页面版本 ID */
|
|
2127
|
+
pageVersionId: UniqueId;
|
|
2128
|
+
/** 发布 ID(用于追踪发布操作) */
|
|
2129
|
+
publishId: UniqueId;
|
|
2130
|
+
/** Schema 版本 */
|
|
2131
|
+
schemaVersion: string;
|
|
2132
|
+
/** 创建时间 */
|
|
2133
|
+
createdAt: ISODateTime;
|
|
2134
|
+
/** 创建者 */
|
|
2135
|
+
createdBy: string;
|
|
2136
|
+
/** 内容哈希 */
|
|
2137
|
+
contentHash: string;
|
|
2138
|
+
/** 绑定摘要 */
|
|
2139
|
+
bindings: {
|
|
2140
|
+
/** 组件版本列表(格式:name@version) */
|
|
2141
|
+
componentVersions: string[];
|
|
2142
|
+
/** Definition 版本列表 */
|
|
2143
|
+
definitionVersions: string[];
|
|
2144
|
+
};
|
|
2145
|
+
/** Runtime 版本 */
|
|
2146
|
+
runtimeVersion: SemVer;
|
|
2147
|
+
/** 环境 */
|
|
2148
|
+
env?: 'preview' | 'staging' | 'prod';
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Bootstrap 配置
|
|
2152
|
+
*
|
|
2153
|
+
* @description
|
|
2154
|
+
* 极小的启动参数,用于静态 HTML 场景。
|
|
2155
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/bootstrap.json`
|
|
2156
|
+
*
|
|
2157
|
+
* 使用场景:
|
|
2158
|
+
* - 静态 HTML 页面(不经过服务端渲染)
|
|
2159
|
+
* - 嵌入式页面(iframe)
|
|
2160
|
+
* - 离线缓存场景
|
|
2161
|
+
*/
|
|
2162
|
+
interface BootstrapConfig {
|
|
2163
|
+
/** 页面 ID */
|
|
2164
|
+
pageId: UniqueId;
|
|
2165
|
+
/** 页面版本 ID */
|
|
2166
|
+
pageVersionId: UniqueId;
|
|
2167
|
+
/** Runtime 版本 */
|
|
2168
|
+
runtimeVersion: SemVer;
|
|
2169
|
+
/** Runtime 入口 URL */
|
|
2170
|
+
runtimeEntryUrl: string;
|
|
2171
|
+
/** 页面 JSON URL(snapshot.json) */
|
|
2172
|
+
snapshotUrl: string;
|
|
2173
|
+
/** Manifest URL */
|
|
2174
|
+
manifestUrl: string;
|
|
2175
|
+
/** CDN 基础 URL */
|
|
2176
|
+
cdnBaseUrl: string;
|
|
2177
|
+
/** API 基础 URL */
|
|
2178
|
+
apiBaseUrl: string;
|
|
2179
|
+
/** 环境 */
|
|
2180
|
+
env: 'preview' | 'staging' | 'prod';
|
|
2181
|
+
/** 预连接 URL 列表(性能优化) */
|
|
2182
|
+
preconnectUrls?: string[];
|
|
2183
|
+
/** 预加载资源列表 */
|
|
2184
|
+
preloadAssets?: string[];
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* 预览 Token
|
|
2188
|
+
*
|
|
2189
|
+
* @description
|
|
2190
|
+
* Editor 生成预览链接时使用的令牌。
|
|
2191
|
+
* 存储在 Redis,短 TTL(通常 1-4 小时)。
|
|
2192
|
+
*
|
|
2193
|
+
* 使用流程:
|
|
2194
|
+
* 1. Editor 调用 Admin API 生成预览 Token
|
|
2195
|
+
* 2. 预览链接:`https://{domain}/preview/{token}`
|
|
2196
|
+
* 3. Runtime 调用 User API 验证 Token 并获取草稿内容
|
|
2197
|
+
*/
|
|
2198
|
+
interface PreviewToken {
|
|
2199
|
+
/** Token 值 */
|
|
2200
|
+
token: string;
|
|
2201
|
+
/** 页面 ID */
|
|
2202
|
+
pageId: UniqueId;
|
|
2203
|
+
/** 页面版本 ID(如果预览已发布版本) */
|
|
2204
|
+
pageVersionId?: UniqueId;
|
|
2205
|
+
/** 草稿 ID(如果预览草稿) */
|
|
2206
|
+
draftId?: UniqueId;
|
|
2207
|
+
/** 预览类型 */
|
|
2208
|
+
type: 'draft' | 'version';
|
|
2209
|
+
/** 过期时间 */
|
|
2210
|
+
expiresAt: ISODateTime;
|
|
2211
|
+
/** 创建时间 */
|
|
2212
|
+
createdAt: ISODateTime;
|
|
2213
|
+
/** 创建者 */
|
|
2214
|
+
createdBy: string;
|
|
2215
|
+
/** 允许的访问者(可选,用于限制预览范围) */
|
|
2216
|
+
allowedViewers?: string[];
|
|
2217
|
+
/** 是否允许编辑(预览时是否可以修改草稿) */
|
|
2218
|
+
allowEdit?: boolean;
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* 预览 Token 创建请求
|
|
2222
|
+
*/
|
|
2223
|
+
interface CreatePreviewTokenRequest {
|
|
2224
|
+
/** 页面 ID */
|
|
2225
|
+
pageId: UniqueId;
|
|
2226
|
+
/** 预览类型 */
|
|
2227
|
+
type: 'draft' | 'version';
|
|
2228
|
+
/** 页面版本 ID(type 为 version 时必填) */
|
|
2229
|
+
pageVersionId?: UniqueId;
|
|
2230
|
+
/** 过期时间(秒),默认 3600 */
|
|
2231
|
+
ttlSeconds?: number;
|
|
2232
|
+
/** 允许的访问者 */
|
|
2233
|
+
allowedViewers?: string[];
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* 预览 Token 验证响应
|
|
2237
|
+
*/
|
|
2238
|
+
interface PreviewTokenValidationResult {
|
|
2239
|
+
/** 是否有效 */
|
|
2240
|
+
valid: boolean;
|
|
2241
|
+
/** Token 信息(有效时返回) */
|
|
2242
|
+
token?: PreviewToken;
|
|
2243
|
+
/** 错误原因(无效时返回) */
|
|
2244
|
+
error?: 'expired' | 'not_found' | 'invalid_viewer' | 'revoked';
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* 页面完整性校验 JSON
|
|
2248
|
+
*
|
|
2249
|
+
* @description
|
|
2250
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/integrity.json`
|
|
2251
|
+
* 用于防篡改校验。
|
|
2252
|
+
*/
|
|
2253
|
+
interface PageIntegrityJson {
|
|
2254
|
+
/** 文件完整性哈希 */
|
|
2255
|
+
files: {
|
|
2256
|
+
/** snapshot.json 的哈希 */
|
|
2257
|
+
'snapshot.json': SHAIntegrity;
|
|
2258
|
+
/** manifest.json 的哈希 */
|
|
2259
|
+
'manifest.json': SHAIntegrity;
|
|
2260
|
+
/** meta.json 的哈希(可选) */
|
|
2261
|
+
'meta.json'?: SHAIntegrity;
|
|
2262
|
+
};
|
|
2263
|
+
/** 聚合哈希(所有文件的综合哈希) */
|
|
2264
|
+
aggregateHash: SHAIntegrity;
|
|
2265
|
+
/** 签名(可选,用于更高安全级别) */
|
|
2266
|
+
signature?: {
|
|
2267
|
+
/** 签名算法 */
|
|
2268
|
+
algorithm: 'ed25519' | 'rsa-sha256';
|
|
2269
|
+
/** 签名值(Base64) */
|
|
2270
|
+
value: string;
|
|
2271
|
+
/** 公钥 ID(用于查找对应的公钥) */
|
|
2272
|
+
keyId: string;
|
|
2273
|
+
};
|
|
2274
|
+
/** 生成时间 */
|
|
2275
|
+
generatedAt: ISODateTime;
|
|
2276
|
+
/** 生成者 */
|
|
2277
|
+
generatedBy: string;
|
|
2278
|
+
}
|
|
2279
|
+
/**
|
|
2280
|
+
* 页面资源列表 JSON
|
|
2281
|
+
*
|
|
2282
|
+
* @description
|
|
2283
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/assets.json`
|
|
2284
|
+
* 用于预热、排障。
|
|
2285
|
+
*/
|
|
2286
|
+
interface PageAssetsJson {
|
|
2287
|
+
/** 页面 ID */
|
|
2288
|
+
pageId: UniqueId;
|
|
2289
|
+
/** 页面版本 ID */
|
|
2290
|
+
pageVersionId: UniqueId;
|
|
2291
|
+
/** Runtime 资源 */
|
|
2292
|
+
runtime: {
|
|
2293
|
+
/** Runtime 版本 */
|
|
2294
|
+
version: SemVer;
|
|
2295
|
+
/** JS 入口 */
|
|
2296
|
+
js: string;
|
|
2297
|
+
/** CSS 入口 */
|
|
2298
|
+
css?: string;
|
|
2299
|
+
};
|
|
2300
|
+
/** 组件资源 */
|
|
2301
|
+
components: {
|
|
2302
|
+
/** 组件名称 */
|
|
2303
|
+
name: string;
|
|
2304
|
+
/** 组件版本 */
|
|
2305
|
+
version: SemVer;
|
|
2306
|
+
/** JS 入口 */
|
|
2307
|
+
js: string;
|
|
2308
|
+
/** CSS 入口 */
|
|
2309
|
+
css?: string;
|
|
2310
|
+
/** 分包列表 */
|
|
2311
|
+
chunks?: string[];
|
|
2312
|
+
}[];
|
|
2313
|
+
/** 所有资源 URL 列表(用于预热) */
|
|
2314
|
+
allUrls: string[];
|
|
2315
|
+
/** 生成时间 */
|
|
2316
|
+
generatedAt: ISODateTime;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
1832
2319
|
/**
|
|
1833
2320
|
* 页面解析响应类型
|
|
1834
2321
|
*/
|
|
1835
2322
|
|
|
1836
2323
|
/**
|
|
1837
|
-
* 页面解析响应(Runtime
|
|
2324
|
+
* 页面解析响应(User API → Runtime)
|
|
2325
|
+
*
|
|
2326
|
+
* @description
|
|
2327
|
+
* 对应 User API:`GET /page/resolve`
|
|
2328
|
+
* Runtime 首先调用此接口获取要加载的版本信息。
|
|
1838
2329
|
*/
|
|
1839
2330
|
interface PageResolveResponse {
|
|
2331
|
+
/** 页面 ID */
|
|
2332
|
+
pageId: UniqueId;
|
|
2333
|
+
/** 解析后的页面版本 ID */
|
|
2334
|
+
resolvedVersionId: UniqueId;
|
|
2335
|
+
/** CDN 基础 URL */
|
|
2336
|
+
cdnBase: string;
|
|
2337
|
+
/** Snapshot URL */
|
|
2338
|
+
snapshotUrl: string;
|
|
2339
|
+
/** Manifest URL */
|
|
2340
|
+
manifestUrl: string;
|
|
2341
|
+
/** 运维配置 */
|
|
2342
|
+
ops: OpsConfig;
|
|
2343
|
+
/** ETag(用于缓存) */
|
|
2344
|
+
etag: string;
|
|
2345
|
+
/** 缓存 TTL(秒) */
|
|
2346
|
+
cacheTtlSeconds: number;
|
|
2347
|
+
/** 灰度匹配信息(可选,用于调试) */
|
|
2348
|
+
rolloutMatch?: {
|
|
2349
|
+
/** 匹配的策略 ID */
|
|
2350
|
+
strategyId?: string;
|
|
2351
|
+
/** 匹配的策略名称 */
|
|
2352
|
+
strategyName?: string;
|
|
2353
|
+
/** 是否使用默认版本 */
|
|
2354
|
+
isDefault: boolean;
|
|
2355
|
+
};
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* 页面解析请求参数
|
|
2359
|
+
*/
|
|
2360
|
+
interface PageResolveRequest {
|
|
2361
|
+
/** 页面 ID */
|
|
2362
|
+
pageId: UniqueId;
|
|
2363
|
+
/** 环境 */
|
|
2364
|
+
env?: 'preview' | 'staging' | 'prod';
|
|
2365
|
+
/** 用户 ID(用于灰度) */
|
|
2366
|
+
uid?: string;
|
|
2367
|
+
/** 设备 ID(用于灰度) */
|
|
2368
|
+
deviceId?: string;
|
|
2369
|
+
/** 渠道(用于灰度) */
|
|
2370
|
+
channel?: string;
|
|
2371
|
+
/** 是否包含完整 Snapshot(CDN 失败保底) */
|
|
2372
|
+
includeSnapshot?: boolean;
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* 页面解析响应(包含 Snapshot 的保底版本)
|
|
2376
|
+
*/
|
|
2377
|
+
interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
2378
|
+
/** 完整的页面快照(CDN 失败时使用) */
|
|
2379
|
+
snapshot: PageSnapshotJson;
|
|
2380
|
+
}
|
|
2381
|
+
/**
|
|
2382
|
+
* 页面解析响应(旧版本)
|
|
2383
|
+
* @deprecated 使用 PageResolveResponse 代替
|
|
2384
|
+
*/
|
|
2385
|
+
interface LegacyPageResolveResponse {
|
|
1840
2386
|
/** 页面版本 ID */
|
|
1841
2387
|
pageVersionId: UniqueId;
|
|
1842
2388
|
/** 页面 Schema */
|
|
@@ -1849,7 +2395,8 @@ interface PageResolveResponse {
|
|
|
1849
2395
|
preloadedData?: Record<string, JsonValue>;
|
|
1850
2396
|
}
|
|
1851
2397
|
/**
|
|
1852
|
-
*
|
|
2398
|
+
* 运行时配置(旧版本)
|
|
2399
|
+
* @deprecated 使用 OpsConfig 代替
|
|
1853
2400
|
*/
|
|
1854
2401
|
interface RuntimeConfig {
|
|
1855
2402
|
/** 推荐的运行时版本 */
|
|
@@ -4377,4 +4924,4 @@ declare const ACTION_SPEC_VERSION = "2.0.0";
|
|
|
4377
4924
|
*/
|
|
4378
4925
|
declare const DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
4379
4926
|
|
|
4380
|
-
export { type ABTestRolloutConfig, ACTION_SPEC_VERSION, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BrowserCompat, type BuiltinActionType, COMPONENT_META_SCHEMA_VERSION, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CumulativeReward, DATA_QUERY_SPEC_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocalContext, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OrderByItem, PAGE_SCHEMA_VERSION, PROTOCOL_VERSION, type PageConfig, type PageDraft, type PageI18nConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveResponse, type PageSEO, type PageSchema, type PageState, PageStatus, type PageStatusType, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropValue, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeConfig, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopContext, isDjvlcError, literal, queryRef, stateRef, template };
|
|
4927
|
+
export { type ABTestRolloutConfig, ACTION_SPEC_VERSION, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, COMPONENT_META_SCHEMA_VERSION, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePreviewTokenRequest, type CumulativeReward, DATA_QUERY_SPEC_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DefinitionVersionDigest, type DefinitionsDigest, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocalContext, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LegacyPageResolveResponse, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PAGE_SCHEMA_VERSION, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropValue, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeConfig, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopContext, isDjvlcError, literal, queryRef, stateRef, template };
|
package/dist/index.d.ts
CHANGED
|
@@ -538,27 +538,100 @@ interface PageMeta {
|
|
|
538
538
|
tags?: string[];
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
|
-
*
|
|
541
|
+
* 视口配置
|
|
542
542
|
*/
|
|
543
|
-
interface
|
|
543
|
+
interface ViewportConfig {
|
|
544
|
+
/** 移动端断点(默认 768px) */
|
|
545
|
+
mobile?: number;
|
|
546
|
+
/** 平板断点(默认 1024px) */
|
|
547
|
+
tablet?: number;
|
|
548
|
+
/** 桌面断点(默认 1440px) */
|
|
549
|
+
desktop?: number;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* 页面布局配置
|
|
553
|
+
*
|
|
554
|
+
* @description
|
|
555
|
+
* 决定页面如何布局和渲染的核心配置。
|
|
556
|
+
* 运行时需第一时间解析,影响整体渲染策略。
|
|
557
|
+
*/
|
|
558
|
+
interface PageLayoutConfig {
|
|
544
559
|
/** 画布类型 */
|
|
545
560
|
canvasType: CanvasType;
|
|
546
|
-
/**
|
|
561
|
+
/** 画布尺寸(仅 canvasType 非 responsive 时生效) */
|
|
547
562
|
canvasSize?: {
|
|
548
563
|
width: number;
|
|
549
564
|
height: number;
|
|
550
565
|
};
|
|
566
|
+
/** 内容最大宽度(响应式页面常用,如 1200px) */
|
|
567
|
+
maxWidth?: number;
|
|
568
|
+
/** 页面容器内边距 */
|
|
569
|
+
padding?: {
|
|
570
|
+
top?: number;
|
|
571
|
+
right?: number;
|
|
572
|
+
bottom?: number;
|
|
573
|
+
left?: number;
|
|
574
|
+
};
|
|
575
|
+
/** 视口断点配置(响应式页面使用) */
|
|
576
|
+
viewport?: ViewportConfig;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* 主题配置
|
|
580
|
+
*/
|
|
581
|
+
interface ThemeConfig {
|
|
582
|
+
/** 预设主题 */
|
|
583
|
+
preset?: 'light' | 'dark' | 'system' | 'custom';
|
|
584
|
+
/** 主题变量覆盖(优先级高于 preset) */
|
|
585
|
+
variables?: Record<string, string>;
|
|
586
|
+
/** 颜色模式切换时的过渡动画 */
|
|
587
|
+
transition?: boolean;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* 页面样式配置
|
|
591
|
+
*
|
|
592
|
+
* @description
|
|
593
|
+
* 纯视觉样式配置,不影响布局逻辑。
|
|
594
|
+
* 运行时可延迟或增量应用。
|
|
595
|
+
*/
|
|
596
|
+
interface PageStylesConfig {
|
|
597
|
+
/** 主题配置 */
|
|
598
|
+
theme?: ThemeConfig;
|
|
551
599
|
/** 背景配置 */
|
|
552
600
|
background?: BackgroundConfig;
|
|
553
|
-
/** 页面级 CSS
|
|
601
|
+
/** 页面级 CSS 变量(与 theme.variables 合并,此处优先级更高) */
|
|
554
602
|
cssVariables?: Record<string, string>;
|
|
555
|
-
/**
|
|
556
|
-
|
|
603
|
+
/** 页面级自定义样式(注入 <style>) */
|
|
604
|
+
customCSS?: string;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* 页面行为配置
|
|
608
|
+
*
|
|
609
|
+
* @description
|
|
610
|
+
* 控制运行时行为,与渲染无直接关系。
|
|
611
|
+
*/
|
|
612
|
+
interface PageBehaviorConfig {
|
|
557
613
|
/** 是否启用调试模式 */
|
|
558
614
|
debug?: boolean;
|
|
559
615
|
/** 国际化配置 */
|
|
560
616
|
i18n?: PageI18nConfig;
|
|
561
617
|
}
|
|
618
|
+
/**
|
|
619
|
+
* 页面配置
|
|
620
|
+
*
|
|
621
|
+
* @description
|
|
622
|
+
* 三层分离结构,便于运行时按需解析:
|
|
623
|
+
* - layout: 布局决策(关键路径,同步解析)
|
|
624
|
+
* - styles: 样式注入(可延迟应用)
|
|
625
|
+
* - behavior: 行为控制(独立处理)
|
|
626
|
+
*/
|
|
627
|
+
interface PageConfig {
|
|
628
|
+
/** 布局配置 */
|
|
629
|
+
layout: PageLayoutConfig;
|
|
630
|
+
/** 样式配置 */
|
|
631
|
+
styles?: PageStylesConfig;
|
|
632
|
+
/** 行为配置 */
|
|
633
|
+
behavior?: PageBehaviorConfig;
|
|
634
|
+
}
|
|
562
635
|
|
|
563
636
|
/**
|
|
564
637
|
* 状态系统类型
|
|
@@ -1829,14 +1902,487 @@ interface PageDraft {
|
|
|
1829
1902
|
updatedAt: ISODateTime;
|
|
1830
1903
|
}
|
|
1831
1904
|
|
|
1905
|
+
/**
|
|
1906
|
+
* 页面快照类型(CDN 产物核心结构)
|
|
1907
|
+
*
|
|
1908
|
+
* @description
|
|
1909
|
+
* PageSnapshotJson 是发布后生成的运行时渲染闭包,包含:
|
|
1910
|
+
* - 页面渲染数据
|
|
1911
|
+
* - 组件锁定清单
|
|
1912
|
+
* - Definition 版本摘要
|
|
1913
|
+
* - 运维配置引用
|
|
1914
|
+
* - 元数据
|
|
1915
|
+
*
|
|
1916
|
+
* 设计原则:一次 resolve 返回渲染所需的一切闭包,减少运行时请求次数。
|
|
1917
|
+
*/
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* 页面快照 JSON 结构
|
|
1921
|
+
*
|
|
1922
|
+
* @description
|
|
1923
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/snapshot.json`
|
|
1924
|
+
* Runtime 加载此文件即可完成页面渲染。
|
|
1925
|
+
*/
|
|
1926
|
+
interface PageSnapshotJson {
|
|
1927
|
+
/**
|
|
1928
|
+
* 页面渲染数据
|
|
1929
|
+
*/
|
|
1930
|
+
page: PageSnapshotPage;
|
|
1931
|
+
/**
|
|
1932
|
+
* 组件锁定清单
|
|
1933
|
+
*/
|
|
1934
|
+
manifest: PageSnapshotManifest;
|
|
1935
|
+
/**
|
|
1936
|
+
* 绑定的 Definition 版本摘要(审计/回放用)
|
|
1937
|
+
*/
|
|
1938
|
+
definitionsDigest: DefinitionsDigest;
|
|
1939
|
+
/**
|
|
1940
|
+
* 运维配置(内联或引用)
|
|
1941
|
+
*/
|
|
1942
|
+
ops: OpsConfig;
|
|
1943
|
+
/**
|
|
1944
|
+
* 元数据
|
|
1945
|
+
*/
|
|
1946
|
+
meta: PageSnapshotMeta;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* 页面渲染数据
|
|
1950
|
+
*/
|
|
1951
|
+
interface PageSnapshotPage {
|
|
1952
|
+
/** Schema 版本 */
|
|
1953
|
+
schemaVersion: string;
|
|
1954
|
+
/** 页面 ID */
|
|
1955
|
+
pageId: string;
|
|
1956
|
+
/** 页面版本 */
|
|
1957
|
+
pageVersion: SemVer;
|
|
1958
|
+
/** 页面标题 */
|
|
1959
|
+
title: string;
|
|
1960
|
+
/** 初始状态 */
|
|
1961
|
+
initialState: Record<string, JsonValue>;
|
|
1962
|
+
/** 数据绑定配置 */
|
|
1963
|
+
bindings: DataBinding[];
|
|
1964
|
+
/** 组件树根节点 */
|
|
1965
|
+
root: ComponentNode;
|
|
1966
|
+
/** 页面配置(画布类型、背景等) */
|
|
1967
|
+
config: {
|
|
1968
|
+
canvasType: 'h5' | 'tablet' | 'pc' | 'responsive';
|
|
1969
|
+
canvasSize?: {
|
|
1970
|
+
width: number;
|
|
1971
|
+
height: number;
|
|
1972
|
+
};
|
|
1973
|
+
background?: {
|
|
1974
|
+
type: 'color' | 'image' | 'gradient';
|
|
1975
|
+
value: string;
|
|
1976
|
+
};
|
|
1977
|
+
cssVariables?: Record<string, string>;
|
|
1978
|
+
};
|
|
1979
|
+
/** SEO 配置 */
|
|
1980
|
+
seo?: {
|
|
1981
|
+
title?: string;
|
|
1982
|
+
description?: string;
|
|
1983
|
+
keywords?: string[];
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* 组件锁定清单(Snapshot 内嵌版本)
|
|
1988
|
+
*/
|
|
1989
|
+
interface PageSnapshotManifest {
|
|
1990
|
+
/** 组件列表 */
|
|
1991
|
+
components: SnapshotComponentEntry[];
|
|
1992
|
+
/** Runtime 版本要求 */
|
|
1993
|
+
runtime: {
|
|
1994
|
+
/** 推荐版本 */
|
|
1995
|
+
version: SemVer;
|
|
1996
|
+
/** 最低版本 */
|
|
1997
|
+
minVersion: SemVer;
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* Snapshot 中的组件条目
|
|
2002
|
+
*/
|
|
2003
|
+
interface SnapshotComponentEntry {
|
|
2004
|
+
/** 组件名称 */
|
|
2005
|
+
name: string;
|
|
2006
|
+
/** 组件版本 */
|
|
2007
|
+
version: SemVer;
|
|
2008
|
+
/** SRI 完整性哈希 */
|
|
2009
|
+
integrity: SHAIntegrity;
|
|
2010
|
+
/** CDN 资源基础 URL */
|
|
2011
|
+
assetsUrl: string;
|
|
2012
|
+
/** 入口点 */
|
|
2013
|
+
entrypoints: {
|
|
2014
|
+
/** JS 入口(相对于 assetsUrl) */
|
|
2015
|
+
js: string;
|
|
2016
|
+
/** CSS 入口(可选) */
|
|
2017
|
+
css?: string;
|
|
2018
|
+
/** 分包列表(可选) */
|
|
2019
|
+
chunks?: string[];
|
|
2020
|
+
};
|
|
2021
|
+
/** 是否预加载 */
|
|
2022
|
+
preload?: boolean;
|
|
2023
|
+
/** 加载优先级 */
|
|
2024
|
+
priority?: 'critical' | 'high' | 'normal' | 'low';
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Definition 版本摘要
|
|
2028
|
+
*
|
|
2029
|
+
* @description
|
|
2030
|
+
* 记录页面绑定的 ActionDefinition 和 DataQueryDefinition 版本。
|
|
2031
|
+
* 用于审计、回放、版本追溯。
|
|
2032
|
+
*/
|
|
2033
|
+
interface DefinitionsDigest {
|
|
2034
|
+
/** 绑定的 Action Definition 版本 */
|
|
2035
|
+
actions: DefinitionVersionDigest[];
|
|
2036
|
+
/** 绑定的 Data Query Definition 版本 */
|
|
2037
|
+
queries: DefinitionVersionDigest[];
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* 单个 Definition 版本摘要
|
|
2041
|
+
*/
|
|
2042
|
+
interface DefinitionVersionDigest {
|
|
2043
|
+
/** Definition ID */
|
|
2044
|
+
id: UniqueId;
|
|
2045
|
+
/** Definition 名称 */
|
|
2046
|
+
name: string;
|
|
2047
|
+
/** 版本 ID */
|
|
2048
|
+
versionId: UniqueId;
|
|
2049
|
+
/** 内容哈希(用于完整性校验) */
|
|
2050
|
+
hash: string;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* 运维配置
|
|
2054
|
+
*
|
|
2055
|
+
* @description
|
|
2056
|
+
* 包含 kill-switch、blocked 组件列表、功能开关等运维控制配置。
|
|
2057
|
+
* 由 User API resolve 时下发,Runtime 据此做运行时控制。
|
|
2058
|
+
*/
|
|
2059
|
+
interface OpsConfig {
|
|
2060
|
+
/** 配置版本 ID(用于缓存失效) */
|
|
2061
|
+
configVersionId?: string;
|
|
2062
|
+
/** Kill-Switch 列表(被紧急关闭的功能/动作) */
|
|
2063
|
+
killSwitch: KillSwitchItem[];
|
|
2064
|
+
/** 被阻断的组件列表 */
|
|
2065
|
+
blockedComponents: BlockedComponentItem[];
|
|
2066
|
+
/** 功能开关 */
|
|
2067
|
+
flags: Record<string, boolean>;
|
|
2068
|
+
/** 限流配置(可选) */
|
|
2069
|
+
rateLimit?: {
|
|
2070
|
+
/** 全局 QPS 限制 */
|
|
2071
|
+
globalQps?: number;
|
|
2072
|
+
/** 按动作类型的 QPS 限制 */
|
|
2073
|
+
actionQps?: Record<string, number>;
|
|
2074
|
+
};
|
|
2075
|
+
/** 配置过期时间(用于缓存) */
|
|
2076
|
+
expiresAt?: ISODateTime;
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Kill-Switch 条目
|
|
2080
|
+
*/
|
|
2081
|
+
interface KillSwitchItem {
|
|
2082
|
+
/** 目标类型 */
|
|
2083
|
+
targetType: 'action' | 'component' | 'feature' | 'page' | 'query';
|
|
2084
|
+
/** 目标 ID(actionType / componentName / featureKey / pageId / queryId) */
|
|
2085
|
+
targetId: string;
|
|
2086
|
+
/** 是否启用(true = 被关闭) */
|
|
2087
|
+
enabled: boolean;
|
|
2088
|
+
/** 关闭原因 */
|
|
2089
|
+
reason?: string;
|
|
2090
|
+
/** 关闭时间 */
|
|
2091
|
+
enabledAt?: ISODateTime;
|
|
2092
|
+
/** 关闭操作者 */
|
|
2093
|
+
enabledBy?: string;
|
|
2094
|
+
/** 用户提示消息 */
|
|
2095
|
+
userMessage?: string;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* 被阻断的组件条目
|
|
2099
|
+
*/
|
|
2100
|
+
interface BlockedComponentItem {
|
|
2101
|
+
/** 组件名称 */
|
|
2102
|
+
name: string;
|
|
2103
|
+
/** 组件版本(可选,不指定则阻断所有版本) */
|
|
2104
|
+
version?: SemVer;
|
|
2105
|
+
/** 阻断原因 */
|
|
2106
|
+
reason: string;
|
|
2107
|
+
/** 阻断时间 */
|
|
2108
|
+
blockedAt: ISODateTime;
|
|
2109
|
+
/** 阻断操作者 */
|
|
2110
|
+
blockedBy: string;
|
|
2111
|
+
/** 降级版本(可选) */
|
|
2112
|
+
fallbackVersion?: SemVer;
|
|
2113
|
+
/** 是否紧急阻断 */
|
|
2114
|
+
urgent: boolean;
|
|
2115
|
+
}
|
|
2116
|
+
/**
|
|
2117
|
+
* 页面快照元数据
|
|
2118
|
+
*
|
|
2119
|
+
* @description
|
|
2120
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/meta.json`
|
|
2121
|
+
* 用于审计、回放、排查。
|
|
2122
|
+
*/
|
|
2123
|
+
interface PageSnapshotMeta {
|
|
2124
|
+
/** 页面 ID */
|
|
2125
|
+
pageId: UniqueId;
|
|
2126
|
+
/** 页面版本 ID */
|
|
2127
|
+
pageVersionId: UniqueId;
|
|
2128
|
+
/** 发布 ID(用于追踪发布操作) */
|
|
2129
|
+
publishId: UniqueId;
|
|
2130
|
+
/** Schema 版本 */
|
|
2131
|
+
schemaVersion: string;
|
|
2132
|
+
/** 创建时间 */
|
|
2133
|
+
createdAt: ISODateTime;
|
|
2134
|
+
/** 创建者 */
|
|
2135
|
+
createdBy: string;
|
|
2136
|
+
/** 内容哈希 */
|
|
2137
|
+
contentHash: string;
|
|
2138
|
+
/** 绑定摘要 */
|
|
2139
|
+
bindings: {
|
|
2140
|
+
/** 组件版本列表(格式:name@version) */
|
|
2141
|
+
componentVersions: string[];
|
|
2142
|
+
/** Definition 版本列表 */
|
|
2143
|
+
definitionVersions: string[];
|
|
2144
|
+
};
|
|
2145
|
+
/** Runtime 版本 */
|
|
2146
|
+
runtimeVersion: SemVer;
|
|
2147
|
+
/** 环境 */
|
|
2148
|
+
env?: 'preview' | 'staging' | 'prod';
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Bootstrap 配置
|
|
2152
|
+
*
|
|
2153
|
+
* @description
|
|
2154
|
+
* 极小的启动参数,用于静态 HTML 场景。
|
|
2155
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/bootstrap.json`
|
|
2156
|
+
*
|
|
2157
|
+
* 使用场景:
|
|
2158
|
+
* - 静态 HTML 页面(不经过服务端渲染)
|
|
2159
|
+
* - 嵌入式页面(iframe)
|
|
2160
|
+
* - 离线缓存场景
|
|
2161
|
+
*/
|
|
2162
|
+
interface BootstrapConfig {
|
|
2163
|
+
/** 页面 ID */
|
|
2164
|
+
pageId: UniqueId;
|
|
2165
|
+
/** 页面版本 ID */
|
|
2166
|
+
pageVersionId: UniqueId;
|
|
2167
|
+
/** Runtime 版本 */
|
|
2168
|
+
runtimeVersion: SemVer;
|
|
2169
|
+
/** Runtime 入口 URL */
|
|
2170
|
+
runtimeEntryUrl: string;
|
|
2171
|
+
/** 页面 JSON URL(snapshot.json) */
|
|
2172
|
+
snapshotUrl: string;
|
|
2173
|
+
/** Manifest URL */
|
|
2174
|
+
manifestUrl: string;
|
|
2175
|
+
/** CDN 基础 URL */
|
|
2176
|
+
cdnBaseUrl: string;
|
|
2177
|
+
/** API 基础 URL */
|
|
2178
|
+
apiBaseUrl: string;
|
|
2179
|
+
/** 环境 */
|
|
2180
|
+
env: 'preview' | 'staging' | 'prod';
|
|
2181
|
+
/** 预连接 URL 列表(性能优化) */
|
|
2182
|
+
preconnectUrls?: string[];
|
|
2183
|
+
/** 预加载资源列表 */
|
|
2184
|
+
preloadAssets?: string[];
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* 预览 Token
|
|
2188
|
+
*
|
|
2189
|
+
* @description
|
|
2190
|
+
* Editor 生成预览链接时使用的令牌。
|
|
2191
|
+
* 存储在 Redis,短 TTL(通常 1-4 小时)。
|
|
2192
|
+
*
|
|
2193
|
+
* 使用流程:
|
|
2194
|
+
* 1. Editor 调用 Admin API 生成预览 Token
|
|
2195
|
+
* 2. 预览链接:`https://{domain}/preview/{token}`
|
|
2196
|
+
* 3. Runtime 调用 User API 验证 Token 并获取草稿内容
|
|
2197
|
+
*/
|
|
2198
|
+
interface PreviewToken {
|
|
2199
|
+
/** Token 值 */
|
|
2200
|
+
token: string;
|
|
2201
|
+
/** 页面 ID */
|
|
2202
|
+
pageId: UniqueId;
|
|
2203
|
+
/** 页面版本 ID(如果预览已发布版本) */
|
|
2204
|
+
pageVersionId?: UniqueId;
|
|
2205
|
+
/** 草稿 ID(如果预览草稿) */
|
|
2206
|
+
draftId?: UniqueId;
|
|
2207
|
+
/** 预览类型 */
|
|
2208
|
+
type: 'draft' | 'version';
|
|
2209
|
+
/** 过期时间 */
|
|
2210
|
+
expiresAt: ISODateTime;
|
|
2211
|
+
/** 创建时间 */
|
|
2212
|
+
createdAt: ISODateTime;
|
|
2213
|
+
/** 创建者 */
|
|
2214
|
+
createdBy: string;
|
|
2215
|
+
/** 允许的访问者(可选,用于限制预览范围) */
|
|
2216
|
+
allowedViewers?: string[];
|
|
2217
|
+
/** 是否允许编辑(预览时是否可以修改草稿) */
|
|
2218
|
+
allowEdit?: boolean;
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* 预览 Token 创建请求
|
|
2222
|
+
*/
|
|
2223
|
+
interface CreatePreviewTokenRequest {
|
|
2224
|
+
/** 页面 ID */
|
|
2225
|
+
pageId: UniqueId;
|
|
2226
|
+
/** 预览类型 */
|
|
2227
|
+
type: 'draft' | 'version';
|
|
2228
|
+
/** 页面版本 ID(type 为 version 时必填) */
|
|
2229
|
+
pageVersionId?: UniqueId;
|
|
2230
|
+
/** 过期时间(秒),默认 3600 */
|
|
2231
|
+
ttlSeconds?: number;
|
|
2232
|
+
/** 允许的访问者 */
|
|
2233
|
+
allowedViewers?: string[];
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* 预览 Token 验证响应
|
|
2237
|
+
*/
|
|
2238
|
+
interface PreviewTokenValidationResult {
|
|
2239
|
+
/** 是否有效 */
|
|
2240
|
+
valid: boolean;
|
|
2241
|
+
/** Token 信息(有效时返回) */
|
|
2242
|
+
token?: PreviewToken;
|
|
2243
|
+
/** 错误原因(无效时返回) */
|
|
2244
|
+
error?: 'expired' | 'not_found' | 'invalid_viewer' | 'revoked';
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* 页面完整性校验 JSON
|
|
2248
|
+
*
|
|
2249
|
+
* @description
|
|
2250
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/integrity.json`
|
|
2251
|
+
* 用于防篡改校验。
|
|
2252
|
+
*/
|
|
2253
|
+
interface PageIntegrityJson {
|
|
2254
|
+
/** 文件完整性哈希 */
|
|
2255
|
+
files: {
|
|
2256
|
+
/** snapshot.json 的哈希 */
|
|
2257
|
+
'snapshot.json': SHAIntegrity;
|
|
2258
|
+
/** manifest.json 的哈希 */
|
|
2259
|
+
'manifest.json': SHAIntegrity;
|
|
2260
|
+
/** meta.json 的哈希(可选) */
|
|
2261
|
+
'meta.json'?: SHAIntegrity;
|
|
2262
|
+
};
|
|
2263
|
+
/** 聚合哈希(所有文件的综合哈希) */
|
|
2264
|
+
aggregateHash: SHAIntegrity;
|
|
2265
|
+
/** 签名(可选,用于更高安全级别) */
|
|
2266
|
+
signature?: {
|
|
2267
|
+
/** 签名算法 */
|
|
2268
|
+
algorithm: 'ed25519' | 'rsa-sha256';
|
|
2269
|
+
/** 签名值(Base64) */
|
|
2270
|
+
value: string;
|
|
2271
|
+
/** 公钥 ID(用于查找对应的公钥) */
|
|
2272
|
+
keyId: string;
|
|
2273
|
+
};
|
|
2274
|
+
/** 生成时间 */
|
|
2275
|
+
generatedAt: ISODateTime;
|
|
2276
|
+
/** 生成者 */
|
|
2277
|
+
generatedBy: string;
|
|
2278
|
+
}
|
|
2279
|
+
/**
|
|
2280
|
+
* 页面资源列表 JSON
|
|
2281
|
+
*
|
|
2282
|
+
* @description
|
|
2283
|
+
* 对应 CDN 产物:`/pages/{pageId}/{pageVersionId}/assets.json`
|
|
2284
|
+
* 用于预热、排障。
|
|
2285
|
+
*/
|
|
2286
|
+
interface PageAssetsJson {
|
|
2287
|
+
/** 页面 ID */
|
|
2288
|
+
pageId: UniqueId;
|
|
2289
|
+
/** 页面版本 ID */
|
|
2290
|
+
pageVersionId: UniqueId;
|
|
2291
|
+
/** Runtime 资源 */
|
|
2292
|
+
runtime: {
|
|
2293
|
+
/** Runtime 版本 */
|
|
2294
|
+
version: SemVer;
|
|
2295
|
+
/** JS 入口 */
|
|
2296
|
+
js: string;
|
|
2297
|
+
/** CSS 入口 */
|
|
2298
|
+
css?: string;
|
|
2299
|
+
};
|
|
2300
|
+
/** 组件资源 */
|
|
2301
|
+
components: {
|
|
2302
|
+
/** 组件名称 */
|
|
2303
|
+
name: string;
|
|
2304
|
+
/** 组件版本 */
|
|
2305
|
+
version: SemVer;
|
|
2306
|
+
/** JS 入口 */
|
|
2307
|
+
js: string;
|
|
2308
|
+
/** CSS 入口 */
|
|
2309
|
+
css?: string;
|
|
2310
|
+
/** 分包列表 */
|
|
2311
|
+
chunks?: string[];
|
|
2312
|
+
}[];
|
|
2313
|
+
/** 所有资源 URL 列表(用于预热) */
|
|
2314
|
+
allUrls: string[];
|
|
2315
|
+
/** 生成时间 */
|
|
2316
|
+
generatedAt: ISODateTime;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
1832
2319
|
/**
|
|
1833
2320
|
* 页面解析响应类型
|
|
1834
2321
|
*/
|
|
1835
2322
|
|
|
1836
2323
|
/**
|
|
1837
|
-
* 页面解析响应(Runtime
|
|
2324
|
+
* 页面解析响应(User API → Runtime)
|
|
2325
|
+
*
|
|
2326
|
+
* @description
|
|
2327
|
+
* 对应 User API:`GET /page/resolve`
|
|
2328
|
+
* Runtime 首先调用此接口获取要加载的版本信息。
|
|
1838
2329
|
*/
|
|
1839
2330
|
interface PageResolveResponse {
|
|
2331
|
+
/** 页面 ID */
|
|
2332
|
+
pageId: UniqueId;
|
|
2333
|
+
/** 解析后的页面版本 ID */
|
|
2334
|
+
resolvedVersionId: UniqueId;
|
|
2335
|
+
/** CDN 基础 URL */
|
|
2336
|
+
cdnBase: string;
|
|
2337
|
+
/** Snapshot URL */
|
|
2338
|
+
snapshotUrl: string;
|
|
2339
|
+
/** Manifest URL */
|
|
2340
|
+
manifestUrl: string;
|
|
2341
|
+
/** 运维配置 */
|
|
2342
|
+
ops: OpsConfig;
|
|
2343
|
+
/** ETag(用于缓存) */
|
|
2344
|
+
etag: string;
|
|
2345
|
+
/** 缓存 TTL(秒) */
|
|
2346
|
+
cacheTtlSeconds: number;
|
|
2347
|
+
/** 灰度匹配信息(可选,用于调试) */
|
|
2348
|
+
rolloutMatch?: {
|
|
2349
|
+
/** 匹配的策略 ID */
|
|
2350
|
+
strategyId?: string;
|
|
2351
|
+
/** 匹配的策略名称 */
|
|
2352
|
+
strategyName?: string;
|
|
2353
|
+
/** 是否使用默认版本 */
|
|
2354
|
+
isDefault: boolean;
|
|
2355
|
+
};
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* 页面解析请求参数
|
|
2359
|
+
*/
|
|
2360
|
+
interface PageResolveRequest {
|
|
2361
|
+
/** 页面 ID */
|
|
2362
|
+
pageId: UniqueId;
|
|
2363
|
+
/** 环境 */
|
|
2364
|
+
env?: 'preview' | 'staging' | 'prod';
|
|
2365
|
+
/** 用户 ID(用于灰度) */
|
|
2366
|
+
uid?: string;
|
|
2367
|
+
/** 设备 ID(用于灰度) */
|
|
2368
|
+
deviceId?: string;
|
|
2369
|
+
/** 渠道(用于灰度) */
|
|
2370
|
+
channel?: string;
|
|
2371
|
+
/** 是否包含完整 Snapshot(CDN 失败保底) */
|
|
2372
|
+
includeSnapshot?: boolean;
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* 页面解析响应(包含 Snapshot 的保底版本)
|
|
2376
|
+
*/
|
|
2377
|
+
interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
2378
|
+
/** 完整的页面快照(CDN 失败时使用) */
|
|
2379
|
+
snapshot: PageSnapshotJson;
|
|
2380
|
+
}
|
|
2381
|
+
/**
|
|
2382
|
+
* 页面解析响应(旧版本)
|
|
2383
|
+
* @deprecated 使用 PageResolveResponse 代替
|
|
2384
|
+
*/
|
|
2385
|
+
interface LegacyPageResolveResponse {
|
|
1840
2386
|
/** 页面版本 ID */
|
|
1841
2387
|
pageVersionId: UniqueId;
|
|
1842
2388
|
/** 页面 Schema */
|
|
@@ -1849,7 +2395,8 @@ interface PageResolveResponse {
|
|
|
1849
2395
|
preloadedData?: Record<string, JsonValue>;
|
|
1850
2396
|
}
|
|
1851
2397
|
/**
|
|
1852
|
-
*
|
|
2398
|
+
* 运行时配置(旧版本)
|
|
2399
|
+
* @deprecated 使用 OpsConfig 代替
|
|
1853
2400
|
*/
|
|
1854
2401
|
interface RuntimeConfig {
|
|
1855
2402
|
/** 推荐的运行时版本 */
|
|
@@ -4377,4 +4924,4 @@ declare const ACTION_SPEC_VERSION = "2.0.0";
|
|
|
4377
4924
|
*/
|
|
4378
4925
|
declare const DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
4379
4926
|
|
|
4380
|
-
export { type ABTestRolloutConfig, ACTION_SPEC_VERSION, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BrowserCompat, type BuiltinActionType, COMPONENT_META_SCHEMA_VERSION, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CumulativeReward, DATA_QUERY_SPEC_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocalContext, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OrderByItem, PAGE_SCHEMA_VERSION, PROTOCOL_VERSION, type PageConfig, type PageDraft, type PageI18nConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveResponse, type PageSEO, type PageSchema, type PageState, PageStatus, type PageStatusType, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropValue, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeConfig, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopContext, isDjvlcError, literal, queryRef, stateRef, template };
|
|
4927
|
+
export { type ABTestRolloutConfig, ACTION_SPEC_VERSION, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, COMPONENT_META_SCHEMA_VERSION, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePreviewTokenRequest, type CumulativeReward, DATA_QUERY_SPEC_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DefinitionVersionDigest, type DefinitionsDigest, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocalContext, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LegacyPageResolveResponse, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PAGE_SCHEMA_VERSION, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropValue, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeConfig, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopContext, isDjvlcError, literal, queryRef, stateRef, template };
|