@wanlianyida/portal-kit 0.1.6-beta.0 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -198,6 +198,24 @@ npm pack --dry-run
198
198
 
199
199
  发布前使用 `pnpm pack` 生成 tarball,在宿主项目安装该产物并检查类型、样式及运行效果;正式发布沿用 `prepublishOnly` 的测试与构建检查。
200
200
 
201
+ ## 回调字段卡片(0.1.6)
202
+
203
+ ```vue
204
+ <script setup lang="ts">
205
+ import { CallbackCards, type CallbackEvent } from '@wanlianyida/portal-kit';
206
+ defineProps<{ items: CallbackEvent[] }>();
207
+ </script>
208
+ <template><CallbackCards :items="items" /></template>
209
+ ```
210
+
211
+ `items` 接收事件数组:`eventName / msgType / description / outFields / samplePayload / status / retryMaxReconsume / delayPolicy`。每个 `outFields[].sourcePath` 一张卡片,标题用 `desc`,编码标签用字段路径。必填来自该字段;名称、事件编码、触发说明、状态、重试规则来自所属事件,不表示每个字段都有独立投递配置。无字段的历史快照回退为事件卡片。
212
+
213
+ 首张默认展开,其余可独立展开;替换 `items` 重置展开状态。没有 `samplePayload` 时不渲染示例区及占位提示;示例仍是事件原报文,以「所属事件回调示例」标明,不推测字段级示例。合法 JSON 格式化后可复制,历史非 JSON 原文安全展示。
214
+
215
+ 组件不发请求、不修改配置。所有新增 CSS 均使用 `portal-callback-*` 命名并限制在 Vue scoped 范围,沿用 CodePreview,未修改已有组件样式及全局变量。
216
+
217
+ 回调卡片恢复原先白色标题区及紧凑细边框重试测算表,字段路径和所属事件编码使用与 feature/errorcode 分支业务域标签一致的蓝色(文字 #526bff、底色 #eef2ff、边框 #d5ddff);包含字段必填、最大重试次数、重试延迟策略的整块信息面板保留浅蓝底色、蓝色重试次数及暖色必填标签。现有 Markdown 表格及其 CSS 保持原样。
218
+
201
219
  ## 公共导航与共享会话(0.1.6-beta.0)
202
220
 
203
221
  导航独立入口不引入 Element Plus 或正文组件的全局 CSS;首页只依赖 Vue 即可接入。
package/dist/index.d.ts CHANGED
@@ -78,6 +78,37 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
78
78
 
79
79
  export declare function buildFeedbackPayload(input: FeedbackInput, now?: Date): FeedbackPayload;
80
80
 
81
+ export declare const CallbackCards: DefineComponent<CallbackCardsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CallbackCardsProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
82
+
83
+ export declare interface CallbackCardsProps {
84
+ items: CallbackEvent[];
85
+ }
86
+
87
+ /** 只读数据,不负责事件查询、配置修改或订阅映射。 */
88
+ export declare interface CallbackEvent {
89
+ msgType: string;
90
+ eventName: string;
91
+ description?: string | null;
92
+ outFields?: CallbackField[];
93
+ samplePayload?: string | null;
94
+ status?: 'enabled' | 'disabled' | null;
95
+ retryMaxReconsume?: number | null;
96
+ delayPolicy?: string | null;
97
+ }
98
+
99
+ export declare interface CallbackField {
100
+ sourcePath: string;
101
+ required: boolean | null;
102
+ desc?: string | null;
103
+ }
104
+
105
+ /** 根据已提供的策略生成相对时间;缺失或未知策略不推测。 */
106
+ export declare function callbackRetrySchedule(count?: number | null, policy?: string | null): {
107
+ nth: number;
108
+ delay: string;
109
+ elapsed: string;
110
+ }[];
111
+
81
112
  /** 公共代码主题使用的 token 分组,供可编辑文本范围与预览 HTML 共用。 */
82
113
  export declare const CODE_HIGHLIGHT_CLASSES: {
83
114
  readonly comment: readonly ["hljs-comment", "hljs-quote"];
@@ -198,6 +229,11 @@ export declare interface FeedbackWidgetProps {
198
229
  merchant?: string;
199
230
  }
200
231
 
232
+ /** 只读展示,不为历史快照伪造运行配置。未知策略原样显示。 */
233
+ export declare function formatCallbackDelay(policy?: string | null): string;
234
+
235
+ export declare function formatCallbackSample(sample?: string | null): string;
236
+
201
237
  export declare function formatFeedbackTime(date: Date): string;
202
238
 
203
239
  export declare interface HeadingSection {