@djvlc/contracts-types 1.8.4 → 1.8.6
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 +156 -15
- package/dist/index.d.ts +156 -15
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -252,7 +252,7 @@ declare function isDjvlcError(error: unknown): error is DjvlcError;
|
|
|
252
252
|
*/
|
|
253
253
|
interface ApiSuccessResponse<T = unknown> {
|
|
254
254
|
/** 是否成功 */
|
|
255
|
-
success:
|
|
255
|
+
success: boolean;
|
|
256
256
|
/** 业务状态码 */
|
|
257
257
|
code: string;
|
|
258
258
|
/** 响应消息 */
|
|
@@ -269,27 +269,19 @@ interface ApiSuccessResponse<T = unknown> {
|
|
|
269
269
|
/**
|
|
270
270
|
* 错误详情
|
|
271
271
|
*/
|
|
272
|
-
interface ApiErrorDetail {
|
|
273
|
-
/** 字段路径 */
|
|
274
|
-
field?: string;
|
|
275
|
-
/** 错误消息 */
|
|
276
|
-
message: string;
|
|
277
|
-
/** 错误码 */
|
|
278
|
-
code?: string;
|
|
279
|
-
}
|
|
280
272
|
/**
|
|
281
273
|
* 错误响应
|
|
282
274
|
* 与 platform 仓库的 ErrorResponse 保持一致
|
|
283
275
|
*/
|
|
284
276
|
interface ApiErrorResponse {
|
|
285
277
|
/** 是否成功 */
|
|
286
|
-
success:
|
|
278
|
+
success: boolean;
|
|
287
279
|
/** 错误码 */
|
|
288
280
|
code: ErrorCode | string;
|
|
289
281
|
/** 错误消息(用户可读) */
|
|
290
282
|
message: string;
|
|
291
283
|
/** 错误详情(验证错误时使用,放在 data 字段中) */
|
|
292
|
-
data?:
|
|
284
|
+
data?: Record<string, unknown>;
|
|
293
285
|
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
294
286
|
timestamp: number;
|
|
295
287
|
/** 请求路径 */
|
|
@@ -352,6 +344,8 @@ interface PaginatedResponse<T> {
|
|
|
352
344
|
declare enum VersionStatus {
|
|
353
345
|
/** 草稿状态(仅 canary 可用) */
|
|
354
346
|
DRAFT = "draft",
|
|
347
|
+
/** Canary 状态(灰度发布) */
|
|
348
|
+
CANARY = "canary",
|
|
355
349
|
/** 稳定状态(可正式使用) */
|
|
356
350
|
STABLE = "stable",
|
|
357
351
|
/** 已废弃(不推荐使用) */
|
|
@@ -362,7 +356,7 @@ declare enum VersionStatus {
|
|
|
362
356
|
/**
|
|
363
357
|
* 版本状态类型(字符串字面量版本,用于 JSON/数据库存储)
|
|
364
358
|
*/
|
|
365
|
-
type VersionStatusType = 'draft' | 'stable' | 'deprecated' | 'blocked';
|
|
359
|
+
type VersionStatusType = 'draft' | 'canary' | 'stable' | 'deprecated' | 'blocked';
|
|
366
360
|
/**
|
|
367
361
|
* 页面状态枚举
|
|
368
362
|
*/
|
|
@@ -384,11 +378,12 @@ type PageStatusType = 'draft' | 'published' | 'archived';
|
|
|
384
378
|
* @description
|
|
385
379
|
* 用于组件版本的生命周期管理。
|
|
386
380
|
* - draft: 开发中,仅内部可见
|
|
381
|
+
* - canary: 灰度发布
|
|
387
382
|
* - stable: 稳定版,推荐使用
|
|
388
383
|
* - deprecated: 已废弃,不推荐使用,但仍可用
|
|
389
384
|
* - blocked: 已阻断,禁止使用(安全原因)
|
|
390
385
|
*/
|
|
391
|
-
type ComponentStatus = 'draft' | 'stable' | 'deprecated' | 'blocked';
|
|
386
|
+
type ComponentStatus = 'draft' | 'canary' | 'stable' | 'deprecated' | 'blocked';
|
|
392
387
|
/**
|
|
393
388
|
* 发布渠道
|
|
394
389
|
*/
|
|
@@ -2514,6 +2509,10 @@ interface PageResolveResponse {
|
|
|
2514
2509
|
etag: string;
|
|
2515
2510
|
/** 缓存 TTL(秒) */
|
|
2516
2511
|
cacheTtlSeconds: number;
|
|
2512
|
+
/** 链路追踪 ID(全链路透传,可观测原则) */
|
|
2513
|
+
traceId?: string;
|
|
2514
|
+
/** 运行时版本(SemVer,与 manifest.runtime.version 一致) */
|
|
2515
|
+
runtimeVersion?: string;
|
|
2517
2516
|
/** 灰度匹配信息(可选,用于调试) */
|
|
2518
2517
|
rolloutMatch?: {
|
|
2519
2518
|
/** 匹配的策略 ID */
|
|
@@ -2549,6 +2548,109 @@ interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
|
2549
2548
|
snapshot: PageSnapshotJson;
|
|
2550
2549
|
}
|
|
2551
2550
|
|
|
2551
|
+
/**
|
|
2552
|
+
* 页面管理端类型定义
|
|
2553
|
+
*/
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* 页面基本信息(列表/详情用)
|
|
2557
|
+
*/
|
|
2558
|
+
interface PageInfo extends PageMeta {
|
|
2559
|
+
/** 页面 ID */
|
|
2560
|
+
id: UniqueId;
|
|
2561
|
+
/** 页面状态 */
|
|
2562
|
+
status: 'draft' | 'published' | 'archived';
|
|
2563
|
+
/** 当前发布版本 */
|
|
2564
|
+
currentVersion?: string;
|
|
2565
|
+
/** 创建时间 */
|
|
2566
|
+
createdAt: ISODateTime;
|
|
2567
|
+
/** 更新时间 */
|
|
2568
|
+
updatedAt: ISODateTime;
|
|
2569
|
+
/** 创建者 ID */
|
|
2570
|
+
createdBy: string;
|
|
2571
|
+
/** 更新者 ID */
|
|
2572
|
+
updatedBy: string;
|
|
2573
|
+
}
|
|
2574
|
+
/**
|
|
2575
|
+
* 创建页面请求
|
|
2576
|
+
*/
|
|
2577
|
+
interface CreatePageRequest {
|
|
2578
|
+
/** 页面标题 */
|
|
2579
|
+
title: string;
|
|
2580
|
+
/** 页面描述 */
|
|
2581
|
+
description?: string;
|
|
2582
|
+
/** 标签 */
|
|
2583
|
+
tags?: string[];
|
|
2584
|
+
/** 模板 ID(可选,从模板创建) */
|
|
2585
|
+
templateId?: string;
|
|
2586
|
+
}
|
|
2587
|
+
/**
|
|
2588
|
+
* 更新页面请求
|
|
2589
|
+
*/
|
|
2590
|
+
interface UpdatePageRequest {
|
|
2591
|
+
/** 页面标题 */
|
|
2592
|
+
title?: string;
|
|
2593
|
+
/** 页面描述 */
|
|
2594
|
+
description?: string;
|
|
2595
|
+
/** 标签 */
|
|
2596
|
+
tags?: string[];
|
|
2597
|
+
}
|
|
2598
|
+
/**
|
|
2599
|
+
* 模板信息
|
|
2600
|
+
*/
|
|
2601
|
+
interface TemplateInfo {
|
|
2602
|
+
/** 模板 ID */
|
|
2603
|
+
id: UniqueId;
|
|
2604
|
+
/** 模板名称 */
|
|
2605
|
+
name: string;
|
|
2606
|
+
/** 模板描述 */
|
|
2607
|
+
description?: string;
|
|
2608
|
+
/** 缩略图 URL */
|
|
2609
|
+
thumbnail?: string;
|
|
2610
|
+
/** 模板状态 */
|
|
2611
|
+
status: 'active' | 'inactive' | 'archived';
|
|
2612
|
+
/** 标签 */
|
|
2613
|
+
tags?: string[];
|
|
2614
|
+
/** 创建时间 */
|
|
2615
|
+
createdAt: ISODateTime;
|
|
2616
|
+
/** 更新时间 */
|
|
2617
|
+
updatedAt: ISODateTime;
|
|
2618
|
+
/** 创建者 ID */
|
|
2619
|
+
createdBy: string;
|
|
2620
|
+
/** 更新者 ID */
|
|
2621
|
+
updatedBy: string;
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* 创建模板请求
|
|
2625
|
+
*/
|
|
2626
|
+
interface CreateTemplateRequest {
|
|
2627
|
+
/** 模板名称 */
|
|
2628
|
+
name: string;
|
|
2629
|
+
/** 模板描述 */
|
|
2630
|
+
description?: string;
|
|
2631
|
+
/** 缩略图 URL */
|
|
2632
|
+
thumbnail?: string;
|
|
2633
|
+
/** 标签 */
|
|
2634
|
+
tags?: string[];
|
|
2635
|
+
/** 来源页面 ID */
|
|
2636
|
+
pageId?: string;
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* 更新模板请求
|
|
2640
|
+
*/
|
|
2641
|
+
interface UpdateTemplateRequest {
|
|
2642
|
+
/** 模板名称 */
|
|
2643
|
+
name?: string;
|
|
2644
|
+
/** 模板描述 */
|
|
2645
|
+
description?: string;
|
|
2646
|
+
/** 缩略图 URL */
|
|
2647
|
+
thumbnail?: string;
|
|
2648
|
+
/** 标签 */
|
|
2649
|
+
tags?: string[];
|
|
2650
|
+
/** 模板状态 */
|
|
2651
|
+
status?: 'active' | 'inactive' | 'archived';
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2552
2654
|
/**
|
|
2553
2655
|
* 属性 Schema 类型定义
|
|
2554
2656
|
*/
|
|
@@ -3172,6 +3274,45 @@ interface ComponentQueryParams {
|
|
|
3172
3274
|
/** 最低运行时版本 */
|
|
3173
3275
|
minRuntimeVersion?: SemVer;
|
|
3174
3276
|
}
|
|
3277
|
+
/**
|
|
3278
|
+
* 组件版本查询项(用于 ResolveVersionsRequest)
|
|
3279
|
+
*/
|
|
3280
|
+
interface ComponentVersionQuery {
|
|
3281
|
+
/** 组件名称(如 @djvlc/button) */
|
|
3282
|
+
name: string;
|
|
3283
|
+
/** 版本范围(如 ^1.0.0, >=1.0.0, 1.2.3) */
|
|
3284
|
+
versionRange: string;
|
|
3285
|
+
}
|
|
3286
|
+
/**
|
|
3287
|
+
* 版本解析请求(Registry API POST /batch/resolve)
|
|
3288
|
+
*/
|
|
3289
|
+
interface ResolveVersionsRequest {
|
|
3290
|
+
/** 待解析的组件列表 */
|
|
3291
|
+
components: ComponentVersionQuery[];
|
|
3292
|
+
/** Runtime 版本(用于兼容性检查) */
|
|
3293
|
+
runtimeVersion?: SemVer;
|
|
3294
|
+
/** 是否跳过被阻断的组件 */
|
|
3295
|
+
skipBlocked?: boolean;
|
|
3296
|
+
}
|
|
3297
|
+
/**
|
|
3298
|
+
* 解析后的组件信息(支撑 Runtime 按版本拉取实现与 schema)
|
|
3299
|
+
*/
|
|
3300
|
+
interface ResolvedComponent {
|
|
3301
|
+
/** 组件名称 */
|
|
3302
|
+
name: string;
|
|
3303
|
+
/** 请求的版本范围 */
|
|
3304
|
+
versionRange?: string;
|
|
3305
|
+
/** 解析后的具体版本 */
|
|
3306
|
+
resolvedVersion: SemVer;
|
|
3307
|
+
/** 入口文件 URL */
|
|
3308
|
+
entryUrl: string;
|
|
3309
|
+
/** SRI 完整性哈希(主入口) */
|
|
3310
|
+
integrity: string;
|
|
3311
|
+
/** 版本状态 */
|
|
3312
|
+
status: ComponentStatus;
|
|
3313
|
+
/** 兼容性信息(可选) */
|
|
3314
|
+
compat?: CompatInfo;
|
|
3315
|
+
}
|
|
3175
3316
|
|
|
3176
3317
|
/**
|
|
3177
3318
|
* HostAPI 类型(组件调用 Runtime 提供的 API)
|
|
@@ -3288,7 +3429,7 @@ interface TrackEvent {
|
|
|
3288
3429
|
/** 事件参数 */
|
|
3289
3430
|
params?: Record<string, unknown>;
|
|
3290
3431
|
/** 事件类型 */
|
|
3291
|
-
type?: 'click' | '
|
|
3432
|
+
type?: 'page_view' | 'click' | 'exposure' | 'custom';
|
|
3292
3433
|
}
|
|
3293
3434
|
/**
|
|
3294
3435
|
* 动作执行结果
|
|
@@ -5022,4 +5163,4 @@ declare const VERSION = "1.0.0";
|
|
|
5022
5163
|
*/
|
|
5023
5164
|
declare const PROTOCOL_VERSION = "1.0.0";
|
|
5024
5165
|
|
|
5025
|
-
export { type ABTestRolloutConfig, 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
|
|
5166
|
+
export { type ABTestRolloutConfig, 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 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, 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 ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, 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 ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, 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 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, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, 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 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 ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, 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 TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.d.ts
CHANGED
|
@@ -252,7 +252,7 @@ declare function isDjvlcError(error: unknown): error is DjvlcError;
|
|
|
252
252
|
*/
|
|
253
253
|
interface ApiSuccessResponse<T = unknown> {
|
|
254
254
|
/** 是否成功 */
|
|
255
|
-
success:
|
|
255
|
+
success: boolean;
|
|
256
256
|
/** 业务状态码 */
|
|
257
257
|
code: string;
|
|
258
258
|
/** 响应消息 */
|
|
@@ -269,27 +269,19 @@ interface ApiSuccessResponse<T = unknown> {
|
|
|
269
269
|
/**
|
|
270
270
|
* 错误详情
|
|
271
271
|
*/
|
|
272
|
-
interface ApiErrorDetail {
|
|
273
|
-
/** 字段路径 */
|
|
274
|
-
field?: string;
|
|
275
|
-
/** 错误消息 */
|
|
276
|
-
message: string;
|
|
277
|
-
/** 错误码 */
|
|
278
|
-
code?: string;
|
|
279
|
-
}
|
|
280
272
|
/**
|
|
281
273
|
* 错误响应
|
|
282
274
|
* 与 platform 仓库的 ErrorResponse 保持一致
|
|
283
275
|
*/
|
|
284
276
|
interface ApiErrorResponse {
|
|
285
277
|
/** 是否成功 */
|
|
286
|
-
success:
|
|
278
|
+
success: boolean;
|
|
287
279
|
/** 错误码 */
|
|
288
280
|
code: ErrorCode | string;
|
|
289
281
|
/** 错误消息(用户可读) */
|
|
290
282
|
message: string;
|
|
291
283
|
/** 错误详情(验证错误时使用,放在 data 字段中) */
|
|
292
|
-
data?:
|
|
284
|
+
data?: Record<string, unknown>;
|
|
293
285
|
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
294
286
|
timestamp: number;
|
|
295
287
|
/** 请求路径 */
|
|
@@ -352,6 +344,8 @@ interface PaginatedResponse<T> {
|
|
|
352
344
|
declare enum VersionStatus {
|
|
353
345
|
/** 草稿状态(仅 canary 可用) */
|
|
354
346
|
DRAFT = "draft",
|
|
347
|
+
/** Canary 状态(灰度发布) */
|
|
348
|
+
CANARY = "canary",
|
|
355
349
|
/** 稳定状态(可正式使用) */
|
|
356
350
|
STABLE = "stable",
|
|
357
351
|
/** 已废弃(不推荐使用) */
|
|
@@ -362,7 +356,7 @@ declare enum VersionStatus {
|
|
|
362
356
|
/**
|
|
363
357
|
* 版本状态类型(字符串字面量版本,用于 JSON/数据库存储)
|
|
364
358
|
*/
|
|
365
|
-
type VersionStatusType = 'draft' | 'stable' | 'deprecated' | 'blocked';
|
|
359
|
+
type VersionStatusType = 'draft' | 'canary' | 'stable' | 'deprecated' | 'blocked';
|
|
366
360
|
/**
|
|
367
361
|
* 页面状态枚举
|
|
368
362
|
*/
|
|
@@ -384,11 +378,12 @@ type PageStatusType = 'draft' | 'published' | 'archived';
|
|
|
384
378
|
* @description
|
|
385
379
|
* 用于组件版本的生命周期管理。
|
|
386
380
|
* - draft: 开发中,仅内部可见
|
|
381
|
+
* - canary: 灰度发布
|
|
387
382
|
* - stable: 稳定版,推荐使用
|
|
388
383
|
* - deprecated: 已废弃,不推荐使用,但仍可用
|
|
389
384
|
* - blocked: 已阻断,禁止使用(安全原因)
|
|
390
385
|
*/
|
|
391
|
-
type ComponentStatus = 'draft' | 'stable' | 'deprecated' | 'blocked';
|
|
386
|
+
type ComponentStatus = 'draft' | 'canary' | 'stable' | 'deprecated' | 'blocked';
|
|
392
387
|
/**
|
|
393
388
|
* 发布渠道
|
|
394
389
|
*/
|
|
@@ -2514,6 +2509,10 @@ interface PageResolveResponse {
|
|
|
2514
2509
|
etag: string;
|
|
2515
2510
|
/** 缓存 TTL(秒) */
|
|
2516
2511
|
cacheTtlSeconds: number;
|
|
2512
|
+
/** 链路追踪 ID(全链路透传,可观测原则) */
|
|
2513
|
+
traceId?: string;
|
|
2514
|
+
/** 运行时版本(SemVer,与 manifest.runtime.version 一致) */
|
|
2515
|
+
runtimeVersion?: string;
|
|
2517
2516
|
/** 灰度匹配信息(可选,用于调试) */
|
|
2518
2517
|
rolloutMatch?: {
|
|
2519
2518
|
/** 匹配的策略 ID */
|
|
@@ -2549,6 +2548,109 @@ interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
|
2549
2548
|
snapshot: PageSnapshotJson;
|
|
2550
2549
|
}
|
|
2551
2550
|
|
|
2551
|
+
/**
|
|
2552
|
+
* 页面管理端类型定义
|
|
2553
|
+
*/
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* 页面基本信息(列表/详情用)
|
|
2557
|
+
*/
|
|
2558
|
+
interface PageInfo extends PageMeta {
|
|
2559
|
+
/** 页面 ID */
|
|
2560
|
+
id: UniqueId;
|
|
2561
|
+
/** 页面状态 */
|
|
2562
|
+
status: 'draft' | 'published' | 'archived';
|
|
2563
|
+
/** 当前发布版本 */
|
|
2564
|
+
currentVersion?: string;
|
|
2565
|
+
/** 创建时间 */
|
|
2566
|
+
createdAt: ISODateTime;
|
|
2567
|
+
/** 更新时间 */
|
|
2568
|
+
updatedAt: ISODateTime;
|
|
2569
|
+
/** 创建者 ID */
|
|
2570
|
+
createdBy: string;
|
|
2571
|
+
/** 更新者 ID */
|
|
2572
|
+
updatedBy: string;
|
|
2573
|
+
}
|
|
2574
|
+
/**
|
|
2575
|
+
* 创建页面请求
|
|
2576
|
+
*/
|
|
2577
|
+
interface CreatePageRequest {
|
|
2578
|
+
/** 页面标题 */
|
|
2579
|
+
title: string;
|
|
2580
|
+
/** 页面描述 */
|
|
2581
|
+
description?: string;
|
|
2582
|
+
/** 标签 */
|
|
2583
|
+
tags?: string[];
|
|
2584
|
+
/** 模板 ID(可选,从模板创建) */
|
|
2585
|
+
templateId?: string;
|
|
2586
|
+
}
|
|
2587
|
+
/**
|
|
2588
|
+
* 更新页面请求
|
|
2589
|
+
*/
|
|
2590
|
+
interface UpdatePageRequest {
|
|
2591
|
+
/** 页面标题 */
|
|
2592
|
+
title?: string;
|
|
2593
|
+
/** 页面描述 */
|
|
2594
|
+
description?: string;
|
|
2595
|
+
/** 标签 */
|
|
2596
|
+
tags?: string[];
|
|
2597
|
+
}
|
|
2598
|
+
/**
|
|
2599
|
+
* 模板信息
|
|
2600
|
+
*/
|
|
2601
|
+
interface TemplateInfo {
|
|
2602
|
+
/** 模板 ID */
|
|
2603
|
+
id: UniqueId;
|
|
2604
|
+
/** 模板名称 */
|
|
2605
|
+
name: string;
|
|
2606
|
+
/** 模板描述 */
|
|
2607
|
+
description?: string;
|
|
2608
|
+
/** 缩略图 URL */
|
|
2609
|
+
thumbnail?: string;
|
|
2610
|
+
/** 模板状态 */
|
|
2611
|
+
status: 'active' | 'inactive' | 'archived';
|
|
2612
|
+
/** 标签 */
|
|
2613
|
+
tags?: string[];
|
|
2614
|
+
/** 创建时间 */
|
|
2615
|
+
createdAt: ISODateTime;
|
|
2616
|
+
/** 更新时间 */
|
|
2617
|
+
updatedAt: ISODateTime;
|
|
2618
|
+
/** 创建者 ID */
|
|
2619
|
+
createdBy: string;
|
|
2620
|
+
/** 更新者 ID */
|
|
2621
|
+
updatedBy: string;
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* 创建模板请求
|
|
2625
|
+
*/
|
|
2626
|
+
interface CreateTemplateRequest {
|
|
2627
|
+
/** 模板名称 */
|
|
2628
|
+
name: string;
|
|
2629
|
+
/** 模板描述 */
|
|
2630
|
+
description?: string;
|
|
2631
|
+
/** 缩略图 URL */
|
|
2632
|
+
thumbnail?: string;
|
|
2633
|
+
/** 标签 */
|
|
2634
|
+
tags?: string[];
|
|
2635
|
+
/** 来源页面 ID */
|
|
2636
|
+
pageId?: string;
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* 更新模板请求
|
|
2640
|
+
*/
|
|
2641
|
+
interface UpdateTemplateRequest {
|
|
2642
|
+
/** 模板名称 */
|
|
2643
|
+
name?: string;
|
|
2644
|
+
/** 模板描述 */
|
|
2645
|
+
description?: string;
|
|
2646
|
+
/** 缩略图 URL */
|
|
2647
|
+
thumbnail?: string;
|
|
2648
|
+
/** 标签 */
|
|
2649
|
+
tags?: string[];
|
|
2650
|
+
/** 模板状态 */
|
|
2651
|
+
status?: 'active' | 'inactive' | 'archived';
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2552
2654
|
/**
|
|
2553
2655
|
* 属性 Schema 类型定义
|
|
2554
2656
|
*/
|
|
@@ -3172,6 +3274,45 @@ interface ComponentQueryParams {
|
|
|
3172
3274
|
/** 最低运行时版本 */
|
|
3173
3275
|
minRuntimeVersion?: SemVer;
|
|
3174
3276
|
}
|
|
3277
|
+
/**
|
|
3278
|
+
* 组件版本查询项(用于 ResolveVersionsRequest)
|
|
3279
|
+
*/
|
|
3280
|
+
interface ComponentVersionQuery {
|
|
3281
|
+
/** 组件名称(如 @djvlc/button) */
|
|
3282
|
+
name: string;
|
|
3283
|
+
/** 版本范围(如 ^1.0.0, >=1.0.0, 1.2.3) */
|
|
3284
|
+
versionRange: string;
|
|
3285
|
+
}
|
|
3286
|
+
/**
|
|
3287
|
+
* 版本解析请求(Registry API POST /batch/resolve)
|
|
3288
|
+
*/
|
|
3289
|
+
interface ResolveVersionsRequest {
|
|
3290
|
+
/** 待解析的组件列表 */
|
|
3291
|
+
components: ComponentVersionQuery[];
|
|
3292
|
+
/** Runtime 版本(用于兼容性检查) */
|
|
3293
|
+
runtimeVersion?: SemVer;
|
|
3294
|
+
/** 是否跳过被阻断的组件 */
|
|
3295
|
+
skipBlocked?: boolean;
|
|
3296
|
+
}
|
|
3297
|
+
/**
|
|
3298
|
+
* 解析后的组件信息(支撑 Runtime 按版本拉取实现与 schema)
|
|
3299
|
+
*/
|
|
3300
|
+
interface ResolvedComponent {
|
|
3301
|
+
/** 组件名称 */
|
|
3302
|
+
name: string;
|
|
3303
|
+
/** 请求的版本范围 */
|
|
3304
|
+
versionRange?: string;
|
|
3305
|
+
/** 解析后的具体版本 */
|
|
3306
|
+
resolvedVersion: SemVer;
|
|
3307
|
+
/** 入口文件 URL */
|
|
3308
|
+
entryUrl: string;
|
|
3309
|
+
/** SRI 完整性哈希(主入口) */
|
|
3310
|
+
integrity: string;
|
|
3311
|
+
/** 版本状态 */
|
|
3312
|
+
status: ComponentStatus;
|
|
3313
|
+
/** 兼容性信息(可选) */
|
|
3314
|
+
compat?: CompatInfo;
|
|
3315
|
+
}
|
|
3175
3316
|
|
|
3176
3317
|
/**
|
|
3177
3318
|
* HostAPI 类型(组件调用 Runtime 提供的 API)
|
|
@@ -3288,7 +3429,7 @@ interface TrackEvent {
|
|
|
3288
3429
|
/** 事件参数 */
|
|
3289
3430
|
params?: Record<string, unknown>;
|
|
3290
3431
|
/** 事件类型 */
|
|
3291
|
-
type?: 'click' | '
|
|
3432
|
+
type?: 'page_view' | 'click' | 'exposure' | 'custom';
|
|
3292
3433
|
}
|
|
3293
3434
|
/**
|
|
3294
3435
|
* 动作执行结果
|
|
@@ -5022,4 +5163,4 @@ declare const VERSION = "1.0.0";
|
|
|
5022
5163
|
*/
|
|
5023
5164
|
declare const PROTOCOL_VERSION = "1.0.0";
|
|
5024
5165
|
|
|
5025
|
-
export { type ABTestRolloutConfig, 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
|
|
5166
|
+
export { type ABTestRolloutConfig, 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 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, 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 ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, 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 ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, 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 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, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, 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 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 ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, 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 TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.js
CHANGED
|
@@ -182,6 +182,7 @@ function isDjvlcError(error) {
|
|
|
182
182
|
// src/common/status.ts
|
|
183
183
|
var VersionStatus = /* @__PURE__ */ ((VersionStatus2) => {
|
|
184
184
|
VersionStatus2["DRAFT"] = "draft";
|
|
185
|
+
VersionStatus2["CANARY"] = "canary";
|
|
185
186
|
VersionStatus2["STABLE"] = "stable";
|
|
186
187
|
VersionStatus2["DEPRECATED"] = "deprecated";
|
|
187
188
|
VersionStatus2["BLOCKED"] = "blocked";
|
package/dist/index.mjs
CHANGED
|
@@ -180,6 +180,7 @@ function isDjvlcError(error) {
|
|
|
180
180
|
// src/common/status.ts
|
|
181
181
|
var VersionStatus = /* @__PURE__ */ ((VersionStatus2) => {
|
|
182
182
|
VersionStatus2["DRAFT"] = "draft";
|
|
183
|
+
VersionStatus2["CANARY"] = "canary";
|
|
183
184
|
VersionStatus2["STABLE"] = "stable";
|
|
184
185
|
VersionStatus2["DEPRECATED"] = "deprecated";
|
|
185
186
|
VersionStatus2["BLOCKED"] = "blocked";
|