@tbox.cn/app-module-activity-play 0.3.1 → 0.4.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.
Files changed (51) hide show
  1. package/INTEGRATION.md +57 -66
  2. package/README.md +13 -5
  3. package/dist/chunk-GDHTMID6.js +185 -0
  4. package/dist/chunk-XIDGKP5D.js +1154 -0
  5. package/dist/client/index.d.ts +2 -0
  6. package/dist/client/index.js +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +38 -10
  9. package/dist/server/index.d.ts +593 -85
  10. package/dist/server/index.js +37 -9
  11. package/package.json +5 -5
  12. package/skills/activity-play/SKILL.md +41 -15
  13. package/src/client/cards/activity-play/ActivityPlayCard.tsx +3 -3
  14. package/src/client/cards/activity-play-prize/ActivityPlayPrizeDetailCard.tsx +44 -0
  15. package/src/client/cards/activity-play-prize/ActivityPlayPrizeListCard.tsx +62 -0
  16. package/src/client/cards/activity-play-prize/index.ts +8 -0
  17. package/src/client/cards/view.ts +6 -3
  18. package/src/client/index.ts +6 -0
  19. package/src/server/cards/activity-play/meta.ts +5 -4
  20. package/src/server/cards/activity-play/samples.ts +43 -18
  21. package/src/server/cards/activity-play-prize-detail/meta.ts +29 -0
  22. package/src/server/cards/activity-play-prize-detail/samples.ts +54 -0
  23. package/src/server/cards/activity-play-prize-list/meta.ts +41 -0
  24. package/src/server/cards/activity-play-prize-list/samples.ts +78 -0
  25. package/src/server/cards/index.ts +5 -1
  26. package/src/server/errors.ts +9 -28
  27. package/src/server/index.ts +48 -11
  28. package/src/server/ports.ts +4 -25
  29. package/src/server/prizes/cards.ts +79 -0
  30. package/src/server/prizes/errors.ts +88 -0
  31. package/src/server/prizes/ports.ts +35 -0
  32. package/src/server/prizes/query.ts +104 -0
  33. package/src/server/prizes/routes.ts +139 -0
  34. package/src/server/prizes/subject.ts +29 -0
  35. package/src/server/prizes/tools.ts +180 -0
  36. package/src/server/query.ts +47 -28
  37. package/src/server/routes.ts +44 -230
  38. package/src/server/tools.ts +36 -31
  39. package/tbox.module.json +16 -6
  40. package/tests/cards-capture.test.ts +3 -4
  41. package/tests/ports.test.ts +57 -0
  42. package/tests/prizes-routes.test.ts +230 -0
  43. package/tests/prizes-tools.test.ts +216 -0
  44. package/tests/prizes.test.ts +375 -0
  45. package/tests/routes.test.ts +89 -16
  46. package/tests/samples.test.ts +2 -2
  47. package/tests/smoke.test.ts +8 -4
  48. package/tests/tools.test.ts +50 -31
  49. package/dist/chunk-CM4OEPC3.js +0 -689
  50. package/dist/chunk-HUBEOW44.js +0 -98
  51. package/tests/entry.test.ts +0 -458
@@ -5,47 +5,73 @@ import * as zod from 'zod';
5
5
  import * as _tbox_cn_app_agent_sdk_server from '@tbox.cn/app-agent-sdk-server';
6
6
  import { ServerContext } from '@tbox.cn/app-agent-sdk-server';
7
7
  import { Router } from 'express';
8
- import { ActivityPlayActivity, ActivityPlayEntryPort, ActivityPlayQueryPort, ActivityPlayPage } from '@tbox.cn/app-contracts-mall';
8
+ import { ActivityPlayQueryPort, ActivityPlayPrizeQueryPort, ActivityPlayPrizeDetail, ActivityPlayPrizeListResult, ActivityPlayPrizeQueryContext, ActivityPlayPrizeDetailCardData, ActivityPlayPrizeListCardData, ActivityPlayActivity, ActivityPlayPage } from '@tbox.cn/app-contracts-mall';
9
9
  import * as _mastra_core_tools from '@mastra/core/tools';
10
10
 
11
11
  /**
12
12
  * 活动玩法 HTTP 接口(挂载 /api/m/activity-play,鉴权归平台 /api 中间件)。
13
13
  * 仅承载 HTTP 出入口形态:query 单值提取 / 错误信封 / 404 映射;查询语义与校验
14
- * 单源在 ./query.ts(task-02 起与工具共用——工具/HTTP 对同参数同错误分类)。
14
+ * 单源在 ./query.ts(与工具共用——工具/HTTP 对同参数同错误分类)。
15
15
  *
16
- * GET /activities?mallId&keyword&limit → {"data":{"items":[活动对象]}}
17
- * GET /activities/:activityRef?mallId → {"data":活动对象}
16
+ * GET /activities?mallId&keyword&limit → {"data":{"items":[活动对象]}}
17
+ * GET /activities/:activityId?mallId → {"data":活动对象}
18
+ * GET /prizes?mallId → {"data":{"total":…,"items":[…]}}(本人奖品——任务07)
19
+ * GET /prizes/:prizeRecordRef?mallId → {"data":PrizeDetail}
18
20
  *
19
- * 语义钉死(任务 01 查询闭环):
21
+ * 语义钉死(远端活动改造 2026-11-17;奖品面 2026-11-18 任务07):
20
22
  * - mallId 必填;请求商圈与已绑定上下文冲突 → 403 SCOPE_MISMATCH(可信上下文不可被
21
23
  * 客户端静默覆盖);无任何商圈(上下文缺商圈且 query 无 mallId)→ 400 SCOPE_REQUIRED;
22
24
  * - 用户身份恒取可信请求上下文(getRequestContext),不解析/不信任任何客户端
23
- * userId/openid/会员号类参数——loginRequired 仅为活动描述字段,本模块不据此拦截;
25
+ * userId/openid/会员号类参数;活动接口不涉及玩家身份(本人奖品经 prizes/ 路由的
26
+ * 主体检查——缺用户 LOGIN_REQUIRED 401 且零奖品 API 调用);
24
27
  * - limit 缺省 20、合法域 1—50(normalizeListLimit 单源——非法/越界 400,不静默钳制);
25
- * - 活动引用不存在 → 404 ACTIVITY_NOT_FOUND;供给未配置/实例缺席/禁用 → 503
26
- * NOT_CONFIGURED;供给配置非法或执行异常 → 502 PROVIDER_ERROR(不回退演示数据)。
28
+ * - activityId/prizeRecordRef 路径段按原字符串定位('001'/'1.20' 不改写;不从标题猜测);
29
+ * - 活动不存在/不可见 → 404 ACTIVITY_NOT_FOUND;奖品不存在/不可见 → 404 PRIZE_NOT_FOUND
30
+ * (同文案不区分,不泄露他人记录);供给未配置/实例缺席/禁用 → 503
31
+ * NOT_CONFIGURED;供给连接非法或上游失败 → 502 PROVIDER_ERROR(不回退演示数据、
32
+ * 不折损为空列表/空奖品结果);
33
+ * - 成功与业务错误响应均 Cache-Control: no-store(远端事实/个人数据不落缓存);
34
+ * - 入口准备(POST entry)已随远端活动改造退场——详情只服务展示,不承担
35
+ * 点击前检查;参与跳转由前端直接携带 mallId/activityId 经宿主桥处理。
36
+ * - 奖品两 GET 的实现与错误收口归 prizes/routes.ts(本域独立文件面——认证/_scope
37
+ * 错误不经活动面转换)。
27
38
  */
28
39
 
40
+ declare function createActivityPlayRouter(ctx: ServerContext): Router;
41
+
29
42
  /**
30
- * 两槽一致性内容级比对(task-03):query 活动对象 vs entry 供给侧活动快照——全字段
31
- *(含 status/loginRequired:不能用 A 目录的状态/登录要求放行 B 目录的入口)。
32
- * 状态在两次读取的毫秒临界差会表现为 ENTRY_UNAVAILABLE(fail-closed——重试即恢复)。
43
+ * 本人奖品 HTTP 接口(任务07——挂载在活动玩法 Router 内(/api/m/activity-play 前缀,
44
+ * 鉴权归平台 /api 中间件),与活动面 routes.ts 分文件:错误面/收口用本域
45
+ * ActivityPlayPrizeHttpError(独立文件纪律——认证/_scope 错误不得经活动面转换被降格)。
46
+ * 查询语义与校验单源在 ./query.ts(与工具共用——工具/HTTP 对同参数同错误分类)。
47
+ *
48
+ * GET /prizes?mallId → {"data":{"total":…,"items":[…]}}
49
+ * GET /prizes/:prizeRecordRef?mallId → {"data":PrizeDetail}
50
+ *
51
+ * 语义钉死(api.md 本域条目):
52
+ * - mallId 必填;请求商圈与已绑定上下文冲突 → 403 SCOPE_MISMATCH(可信上下文不可被
53
+ * 客户端静默覆盖);无任何商圈 → 400 SCOPE_REQUIRED;
54
+ * - 玩家身份恒取可信请求上下文 identity.userId(requirePrizeQueryContext 给出
55
+ * subjectId 同值)——不解析/不信任任何客户端 userId/openid/会员号类参数;缺有效
56
+ * 主体 → LOGIN_REQUIRED 401 且零奖品 API 调用(先于供给解析抛出);
57
+ * - prizeRecordRef 路径段按原字符串收发('001'/' record-001 ' 不改写、不预解析);
58
+ * 商圈/主体检查之后才解析供给;
59
+ * - 记录不存在或不可见(同文案不区分)→ 404 PRIZE_NOT_FOUND;供给未配置/实例缺席/
60
+ * 禁用 → 503 NOT_CONFIGURED;供给连接非法或上游失败 → 502 PROVIDER_ERROR
61
+ * (不回退演示数据、不折损为「未中奖」空结果);
62
+ * - 成功与业务错误响应均 Cache-Control: no-store(当前事实+个人数据不落缓存)。
33
63
  */
34
- declare function activityMatchesForEntry(a: ActivityPlayActivity, b: ActivityPlayActivity): boolean;
35
- declare function createActivityPlayRouter(ctx: ServerContext): Router;
64
+
65
+ declare function createActivityPlayPrizeRouter(ctx: ServerContext): Router;
36
66
 
37
67
  /**
38
- * activity-play 槽供给解析(query + entry 双槽——唯一消费通道,模块零 provider import,
39
- * 经 ctx.integrations registry 解析;实例绑定决定供给范围)。
68
+ * activity-play.query 槽供给解析(唯一消费通道——远端活动改造后单槽)。
69
+ * 模块零 provider import,经 ctx.integrations registry 解析;实例绑定决定供给范围。
40
70
  * 本域无 InMemory 兜底:预期缺席/装配缺口显性 503(NOT_CONFIGURED),供给执行
41
71
  * 异常上抛 502(PROVIDER_ERROR)——不得当空结果、不回退演示数据。
42
- * entry 槽未配置(仅查询形态)时,列表/详情/工具不受影响(consumes optional),
43
- * 只有入口准备路由在该解析处显性失败 503。
44
72
  */
45
73
 
46
74
  declare function resolveActivityPlayQueryPort(reqCtx: RequestContext, ctx: ServerContext): Promise<ActivityPlayQueryPort>;
47
- /** activity-play.entry 槽供给解析(口径与 query 槽同——错误分类走同一 errors 单源) */
48
- declare function resolveActivityPlayEntryPort(reqCtx: RequestContext, ctx: ServerContext): Promise<ActivityPlayEntryPort>;
49
75
 
50
76
  declare const ACTIVITY_PLAY_CARD_TYPE = "activity-play";
51
77
  declare function createActivityPlayTools(opts: {
@@ -56,37 +82,61 @@ declare function createActivityPlayTools(opts: {
56
82
  keyword?: string | undefined;
57
83
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "listActivityPlays", unknown>;
58
84
  getActivityPlayDetail: _tbox_cn_app_agent_sdk_server.Tool<{
59
- activityRef: string;
85
+ activityId: string;
60
86
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "getActivityPlayDetail", unknown>;
61
87
  };
62
88
 
89
+ /** 两张奖品稳定卡型(与 meta.cardType 同名——cards map 键约定铁律) */
90
+ declare const ACTIVITY_PLAY_PRIZE_LIST_CARD_TYPE = "activity-play-prize-list";
91
+ declare const ACTIVITY_PLAY_PRIZE_DETAIL_CARD_TYPE = "activity-play-prize-detail";
92
+ declare function createActivityPlayPrizeTools(opts: {
93
+ getCtx: () => ServerContext;
94
+ }): {
95
+ listMyPrizes: _tbox_cn_app_agent_sdk_server.Tool<{}, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "listMyPrizes", unknown>;
96
+ getMyPrizeDetail: _tbox_cn_app_agent_sdk_server.Tool<{
97
+ prizeRecordRef: string;
98
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "getMyPrizeDetail", unknown>;
99
+ };
100
+
101
+ /**
102
+ * activity-play.prizes 槽供给解析(任务07 奖品链唯一消费通道——与活动面 ports.ts 同构,
103
+ * 错误面用本域 ActivityPlayPrizeHttpError 独立文件纪律)。
104
+ * 模块零 provider import,经 ctx.integrations registry 解析;实例绑定决定供给范围
105
+ * (活动/奖品同一商家连接——连接复用形态归属层整组继承,见 provider-hupo 交接)。
106
+ * 本域无 InMemory 兜底:预期缺席/装配缺口显性 503(NOT_CONFIGURED),供给执行
107
+ * 异常上抛 502(PROVIDER_ERROR)——不得当空结果、不回退演示数据、不伪装「未中奖」。
108
+ *
109
+ * 调用时序纪律(任务07 约定):本解析在严格主体检查**之后**调用(requirePrizeQueryContext
110
+ * 先行——缺用户 LOGIN_REQUIRED 401 发生在任何供给接触之前);resolveService 构造期
111
+ * 零上游 HTTP 调用(真实奖品 API 调用只发生在 Port 方法执行时)。
112
+ */
113
+
114
+ declare function resolveActivityPlayPrizePort(reqCtx: RequestContext, ctx: ServerContext): Promise<ActivityPlayPrizeQueryPort>;
115
+
63
116
  declare const activityPlayCards: {
64
117
  readonly 'activity-play': _tbox_cn_app_contracts.CardMeta<zod.ZodEffects<zod.ZodObject<{
65
118
  mallId: zod.ZodString;
66
119
  mode: zod.ZodEnum<["list", "detail"]>;
67
120
  items: zod.ZodArray<zod.ZodObject<{
68
- activityRef: zod.ZodString;
121
+ activityId: zod.ZodEffects<zod.ZodString, string, string>;
69
122
  title: zod.ZodString;
70
123
  description: zod.ZodOptional<zod.ZodString>;
71
124
  imageUrl: zod.ZodOptional<zod.ZodString>;
72
125
  startsAt: zod.ZodOptional<zod.ZodString>;
73
126
  endsAt: zod.ZodOptional<zod.ZodString>;
74
- status: zod.ZodEnum<["not_started", "active", "ended", "disabled"]>;
75
- loginRequired: zod.ZodBoolean;
127
+ status: zod.ZodEnum<["not_started", "active", "ended", "disabled", "unknown"]>;
76
128
  }, "strict", zod.ZodTypeAny, {
77
- status: "disabled" | "not_started" | "active" | "ended";
129
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
78
130
  title: string;
79
- activityRef: string;
80
- loginRequired: boolean;
131
+ activityId: string;
81
132
  description?: string | undefined;
82
133
  imageUrl?: string | undefined;
83
134
  startsAt?: string | undefined;
84
135
  endsAt?: string | undefined;
85
136
  }, {
86
- status: "disabled" | "not_started" | "active" | "ended";
137
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
87
138
  title: string;
88
- activityRef: string;
89
- loginRequired: boolean;
139
+ activityId: string;
90
140
  description?: string | undefined;
91
141
  imageUrl?: string | undefined;
92
142
  startsAt?: string | undefined;
@@ -96,10 +146,9 @@ declare const activityPlayCards: {
96
146
  mode: "detail" | "list";
97
147
  mallId: string;
98
148
  items: {
99
- status: "disabled" | "not_started" | "active" | "ended";
149
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
100
150
  title: string;
101
- activityRef: string;
102
- loginRequired: boolean;
151
+ activityId: string;
103
152
  description?: string | undefined;
104
153
  imageUrl?: string | undefined;
105
154
  startsAt?: string | undefined;
@@ -109,10 +158,9 @@ declare const activityPlayCards: {
109
158
  mode: "detail" | "list";
110
159
  mallId: string;
111
160
  items: {
112
- status: "disabled" | "not_started" | "active" | "ended";
161
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
113
162
  title: string;
114
- activityRef: string;
115
- loginRequired: boolean;
163
+ activityId: string;
116
164
  description?: string | undefined;
117
165
  imageUrl?: string | undefined;
118
166
  startsAt?: string | undefined;
@@ -122,10 +170,9 @@ declare const activityPlayCards: {
122
170
  mode: "detail" | "list";
123
171
  mallId: string;
124
172
  items: {
125
- status: "disabled" | "not_started" | "active" | "ended";
173
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
126
174
  title: string;
127
- activityRef: string;
128
- loginRequired: boolean;
175
+ activityId: string;
129
176
  description?: string | undefined;
130
177
  imageUrl?: string | undefined;
131
178
  startsAt?: string | undefined;
@@ -135,30 +182,308 @@ declare const activityPlayCards: {
135
182
  mode: "detail" | "list";
136
183
  mallId: string;
137
184
  items: {
138
- status: "disabled" | "not_started" | "active" | "ended";
185
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
139
186
  title: string;
140
- activityRef: string;
141
- loginRequired: boolean;
187
+ activityId: string;
142
188
  description?: string | undefined;
143
189
  imageUrl?: string | undefined;
144
190
  startsAt?: string | undefined;
145
191
  endsAt?: string | undefined;
146
192
  }[];
147
193
  }>>;
194
+ readonly 'activity-play-prize-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
195
+ mallId: zod.ZodString;
196
+ total: zod.ZodNumber;
197
+ items: zod.ZodArray<zod.ZodObject<{
198
+ prizeRecordRef: zod.ZodEffects<zod.ZodString, string, string>;
199
+ title: zod.ZodString;
200
+ prizeType: zod.ZodString;
201
+ claimStatus: zod.ZodString;
202
+ useStatus: zod.ZodString;
203
+ activityId: zod.ZodOptional<zod.ZodString>;
204
+ activityTitle: zod.ZodOptional<zod.ZodString>;
205
+ imageUrl: zod.ZodOptional<zod.ZodString>;
206
+ wonAt: zod.ZodOptional<zod.ZodString>;
207
+ usageRuleText: zod.ZodOptional<zod.ZodString>;
208
+ } & {
209
+ itemActions: zod.ZodOptional<zod.ZodArray<zod.ZodDiscriminatedUnion<"kind", [zod.ZodObject<{
210
+ kind: zod.ZodLiteral<"send">;
211
+ label: zod.ZodString;
212
+ value: zod.ZodOptional<zod.ZodString>;
213
+ visibleValue: zod.ZodOptional<zod.ZodString>;
214
+ }, "strip", zod.ZodTypeAny, {
215
+ kind: "send";
216
+ label: string;
217
+ value?: string | undefined;
218
+ visibleValue?: string | undefined;
219
+ }, {
220
+ kind: "send";
221
+ label: string;
222
+ value?: string | undefined;
223
+ visibleValue?: string | undefined;
224
+ }>, zod.ZodObject<{
225
+ kind: zod.ZodLiteral<"link">;
226
+ label: zod.ZodString;
227
+ url: zod.ZodString;
228
+ }, "strip", zod.ZodTypeAny, {
229
+ url: string;
230
+ kind: "link";
231
+ label: string;
232
+ }, {
233
+ url: string;
234
+ kind: "link";
235
+ label: string;
236
+ }>]>, "many">>;
237
+ }, "strict", zod.ZodTypeAny, {
238
+ title: string;
239
+ prizeRecordRef: string;
240
+ prizeType: string;
241
+ claimStatus: string;
242
+ useStatus: string;
243
+ activityId?: string | undefined;
244
+ imageUrl?: string | undefined;
245
+ activityTitle?: string | undefined;
246
+ wonAt?: string | undefined;
247
+ usageRuleText?: string | undefined;
248
+ itemActions?: ({
249
+ kind: "send";
250
+ label: string;
251
+ value?: string | undefined;
252
+ visibleValue?: string | undefined;
253
+ } | {
254
+ url: string;
255
+ kind: "link";
256
+ label: string;
257
+ })[] | undefined;
258
+ }, {
259
+ title: string;
260
+ prizeRecordRef: string;
261
+ prizeType: string;
262
+ claimStatus: string;
263
+ useStatus: string;
264
+ activityId?: string | undefined;
265
+ imageUrl?: string | undefined;
266
+ activityTitle?: string | undefined;
267
+ wonAt?: string | undefined;
268
+ usageRuleText?: string | undefined;
269
+ itemActions?: ({
270
+ kind: "send";
271
+ label: string;
272
+ value?: string | undefined;
273
+ visibleValue?: string | undefined;
274
+ } | {
275
+ url: string;
276
+ kind: "link";
277
+ label: string;
278
+ })[] | undefined;
279
+ }>, "many">;
280
+ noResultsReason: zod.ZodOptional<zod.ZodString>;
281
+ truncated: zod.ZodOptional<zod.ZodBoolean>;
282
+ }, "strict", zod.ZodTypeAny, {
283
+ mallId: string;
284
+ total: number;
285
+ items: {
286
+ title: string;
287
+ prizeRecordRef: string;
288
+ prizeType: string;
289
+ claimStatus: string;
290
+ useStatus: string;
291
+ activityId?: string | undefined;
292
+ imageUrl?: string | undefined;
293
+ activityTitle?: string | undefined;
294
+ wonAt?: string | undefined;
295
+ usageRuleText?: string | undefined;
296
+ itemActions?: ({
297
+ kind: "send";
298
+ label: string;
299
+ value?: string | undefined;
300
+ visibleValue?: string | undefined;
301
+ } | {
302
+ url: string;
303
+ kind: "link";
304
+ label: string;
305
+ })[] | undefined;
306
+ }[];
307
+ truncated?: boolean | undefined;
308
+ noResultsReason?: string | undefined;
309
+ }, {
310
+ mallId: string;
311
+ total: number;
312
+ items: {
313
+ title: string;
314
+ prizeRecordRef: string;
315
+ prizeType: string;
316
+ claimStatus: string;
317
+ useStatus: string;
318
+ activityId?: string | undefined;
319
+ imageUrl?: string | undefined;
320
+ activityTitle?: string | undefined;
321
+ wonAt?: string | undefined;
322
+ usageRuleText?: string | undefined;
323
+ itemActions?: ({
324
+ kind: "send";
325
+ label: string;
326
+ value?: string | undefined;
327
+ visibleValue?: string | undefined;
328
+ } | {
329
+ url: string;
330
+ kind: "link";
331
+ label: string;
332
+ })[] | undefined;
333
+ }[];
334
+ truncated?: boolean | undefined;
335
+ noResultsReason?: string | undefined;
336
+ }>>;
337
+ readonly 'activity-play-prize-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
338
+ prizeRecordRef: zod.ZodEffects<zod.ZodString, string, string>;
339
+ title: zod.ZodString;
340
+ prizeType: zod.ZodString;
341
+ claimStatus: zod.ZodString;
342
+ useStatus: zod.ZodString;
343
+ activityId: zod.ZodOptional<zod.ZodString>;
344
+ activityTitle: zod.ZodOptional<zod.ZodString>;
345
+ imageUrl: zod.ZodOptional<zod.ZodString>;
346
+ wonAt: zod.ZodOptional<zod.ZodString>;
347
+ usageRuleText: zod.ZodOptional<zod.ZodString>;
348
+ } & {
349
+ redemptionMethod: zod.ZodOptional<zod.ZodString>;
350
+ redemptionInstruction: zod.ZodOptional<zod.ZodString>;
351
+ prizeUrl: zod.ZodOptional<zod.ZodString>;
352
+ } & {
353
+ mallId: zod.ZodString;
354
+ }, "strict", zod.ZodTypeAny, {
355
+ title: string;
356
+ mallId: string;
357
+ prizeRecordRef: string;
358
+ prizeType: string;
359
+ claimStatus: string;
360
+ useStatus: string;
361
+ activityId?: string | undefined;
362
+ imageUrl?: string | undefined;
363
+ activityTitle?: string | undefined;
364
+ wonAt?: string | undefined;
365
+ usageRuleText?: string | undefined;
366
+ redemptionMethod?: string | undefined;
367
+ redemptionInstruction?: string | undefined;
368
+ prizeUrl?: string | undefined;
369
+ }, {
370
+ title: string;
371
+ mallId: string;
372
+ prizeRecordRef: string;
373
+ prizeType: string;
374
+ claimStatus: string;
375
+ useStatus: string;
376
+ activityId?: string | undefined;
377
+ imageUrl?: string | undefined;
378
+ activityTitle?: string | undefined;
379
+ wonAt?: string | undefined;
380
+ usageRuleText?: string | undefined;
381
+ redemptionMethod?: string | undefined;
382
+ redemptionInstruction?: string | undefined;
383
+ prizeUrl?: string | undefined;
384
+ }>>;
385
+ };
386
+
387
+ /**
388
+ * 本人奖品查询核心(任务07——HTTP 与工具两只消费方的共源层,分工同活动面 ./query.ts:
389
+ * 本层承载商圈/主体检查、供给呼叫与供给输出契约自证;入参形态解析与出口信封归两只
390
+ * 消费方,均不得直接读 provider 配置)。
391
+ *
392
+ * 检查序(钉死——缺用户零奖品 API 调用):商圈 scope(SCOPE_REQUIRED)→ 严格主体
393
+ * (LOGIN_REQUIRED,任务06 约定先查后调)→ Port 解析(槽位供给,构造期零上游调用)
394
+ * → Port 呼叫 → 供给输出过公开 schema(必缺字段/结构非法 → PROVIDER_ERROR 显性失败;
395
+ * **不丢弃坏记录冒称未中奖**)。
396
+ *
397
+ * 供给接入形态(步骤 2 接线):Port 经 ctx.integrations registry 解析
398
+ * activity-play.prizes 槽(provider-hupo 双槽同一商家连接——连接复用归属层继承)。
399
+ */
400
+
401
+ /**
402
+ * prizeRecordRef 归一:**原值直传**(首尾空白是合法标识字符——供应商返回 ' record-001 '
403
+ * 时按原样定位,trim 会改查另一条记录)——仅用 trim 判定「全空白非法」;
404
+ * '001'/'1.20'/'1e3' 等标识不做数字或 JSON 预解析。长上限 128 由 schema 承载。
405
+ */
406
+ declare function normalizePrizeRecordRef(raw: string): string;
407
+ /**
408
+ * 奖品查询上下文组装(商圈 + subjectId 必填)。
409
+ * 同值自证:宽松组合子写入的 subjectId 与严格检查读取的 userId 必须同字符串——
410
+ * 主体单源就是 identity.userId(出现分叉即结构性错误,fail-visible 而非静默取一)。
411
+ */
412
+ declare function requirePrizeQueryContext(reqCtx: RequestContext): {
413
+ q: ActivityPlayPrizeQueryContext;
414
+ mallId: string;
415
+ subjectId: string;
148
416
  };
417
+ /** 本人奖品列表(供给输出自证;供应商失败沿供给异常上抛,不伪装空结果) */
418
+ declare function queryMyPrizeList(reqCtx: RequestContext, ctx: ServerContext): Promise<ActivityPlayPrizeListResult>;
419
+ /**
420
+ * 本人奖品详情(不存在或对当前用户/商家不可见 → PRIZE_NOT_FOUND——两者同文案,
421
+ * 不泄露他人记录)。供给侧返回另一记录标识同样视为供给数据非法(不得以请求标识
422
+ * 包装输出——与活动面 assertSupplyActivity 同纪律)。
423
+ */
424
+ declare function queryMyPrizeDetail(reqCtx: RequestContext, ctx: ServerContext, prizeRecordRef: string): Promise<ActivityPlayPrizeDetail>;
425
+
426
+ /** 列表标准动作文案常量(出卡与测试断言单源) */
427
+ declare const PRIZE_VIEW_DETAIL_LABEL = "\u67E5\u770B\u8BE6\u60C5";
428
+ /** 空态文案(成功无记录——非失败事实) */
429
+ declare const PRIZE_NO_RESULTS_TEXT = "\u6682\u65E0\u4E2D\u5956\u8BB0\u5F55";
430
+ /**
431
+ * 本人奖品列表卡片 data:空态(total=0 且零条目)附 noResultsReason;
432
+ * total>0 而 items 为空(上游分页覆盖范围差异)保留 total 事实、不附空态文案——
433
+ * 展示层按事实呈现,不冒称无记录。
434
+ * 超过展示上限(50)截断展示:total 恒保留供应商真实值 + truncated=true 标记
435
+ * 展示范围(items.length ≠ total 的两种成因——分页覆盖差异/展示截断——由 truncated 区分)。
436
+ */
437
+ declare function toPrizeListCardData(input: {
438
+ mallId: string;
439
+ result: ActivityPlayPrizeListResult;
440
+ }): ActivityPlayPrizeListCardData;
441
+ /** 本人奖品详情卡片 data(平铺 {mallId, ...detail}) */
442
+ declare function toPrizeDetailCardData(input: {
443
+ mallId: string;
444
+ detail: ActivityPlayPrizeDetail;
445
+ }): ActivityPlayPrizeDetailCardData;
149
446
 
447
+ type ActivityPlayPrizeErrorCode = 'INVALID_REQUEST' | 'SCOPE_REQUIRED' | 'SCOPE_MISMATCH' | 'LOGIN_REQUIRED' | 'PRIZE_NOT_FOUND' | 'NOT_CONFIGURED' | 'PROVIDER_ERROR';
448
+ /** 可直接渲染的奖品链错误(service/route 层统一抛出/转换) */
449
+ declare class ActivityPlayPrizeHttpError extends Error {
450
+ readonly httpStatus: number;
451
+ readonly code: ActivityPlayPrizeErrorCode;
452
+ constructor(code: ActivityPlayPrizeErrorCode, httpStatus: number, message: string);
453
+ static invalidRequest(message: string): ActivityPlayPrizeHttpError;
454
+ static scopeRequired(message: string): ActivityPlayPrizeHttpError;
455
+ static scopeMismatch(message: string): ActivityPlayPrizeHttpError;
456
+ static loginRequired(message: string): ActivityPlayPrizeHttpError;
457
+ /** 记录不存在与不可见同文案(安全侧:知标识不等于可读取,不泄露他人记录) */
458
+ static prizeNotFound(message: string): ActivityPlayPrizeHttpError;
459
+ static notConfigured(message: string): ActivityPlayPrizeHttpError;
460
+ static providerError(message: string): ActivityPlayPrizeHttpError;
461
+ }
150
462
  /**
151
- * 活动玩法查询核心(HTTP 与工具两只消费方的共源层——task-02 抽取)。
152
- * 职责:可信上下文 → 共用查询(scope 校验/供给解析/错误分类单源),两侧只做各自的
153
- * 入参形态解析(HTTP query 形态 / 工具字符串化 args 形态)与出口
154
- * (HTTP 错误信封 / 工具失败事实)。任何一侧不得直接读 provider 配置。
463
+ * 任意异常 → ActivityPlayPrizeHttpError 归一(映射守门,与活动面 errors.ts 同纪律):
464
+ * - 已是本域错误(含 LOGIN_REQUIRED 等认证形态)→ 原样通过(调用方在供给呼叫前
465
+ * 抛出的认证错误不会被本函数降格);
466
+ * - 供给错误码(未配置/实例缺席或禁用/绑定未解析/未实施)→ 503 NOT_CONFIGURED;
467
+ * - 其余 → 502 PROVIDER_ERROR(不吐原始 message——防配置/凭证内容泄漏)。
468
+ */
469
+ declare function toActivityPlayPrizeError(e: unknown): ActivityPlayPrizeHttpError;
470
+
471
+ /**
472
+ * 本人奖品严格主体检查(任务06 交付约定、任务07 消费——契约包宽松组合子之上的
473
+ * 个人查询最小区分:subject 必须在场)。
155
474
  *
156
- * 语义(任务 01/02 钉死):无商圈或缺席 → SCOPE_REQUIRED;供给配置缺口/实例缺席/禁用
157
- * → NOT_CONFIGURED;供给异常(含非法配置)→ PROVIDER_ERROR;未知引用 → null(调用方
158
- * 分别映射 404 / ACTIVITY_NOT_FOUND 事实)。错误全走 ActivityPlayHttpError(errors.ts
159
- * 单源分类,HTTP 信封与工具失败事实共用 code/message 面)。
475
+ * 纪律(与平台 mallSubjectIdOf 同判式,收紧点仅为本人查询不允许 anonymous):
476
+ * - userid 恒取可信 RequestContext.identity.userId **原值**(local/external/guest 均可;
477
+ * 不数字化、不加减前缀、不重哈希、不从凭据 attributes 挑替代 ID);
478
+ * - anonymous/上下文缺席/无有效 userId → 显性 LOGIN_REQUIRED(401),且发生在任何
479
+ * 奖品供给调用之前——缺用户时零奖品 API 调用;
480
+ * - 本函数不接收调用方传入的 userId 参数:客户端 query/body、工具参数、URL 字段
481
+ * 无从覆盖主体(覆盖面测试见 tests/prizes.test.ts)。
160
482
  */
161
483
 
484
+ /** 读取当前用户 userid 原值(guest 沿平台既有语义放行——正式测试主体匹配归联合验收) */
485
+ declare function requirePrizeSubjectId(reqCtx: RequestContext): string;
486
+
162
487
  /** 列表数量契约(缺省 20;范围 1—50——HTTP 与工具同源非法拒绝,不静默钳制) */
163
488
  declare const ACTIVITY_PLAY_LIMIT_DEFAULT = 20;
164
489
  declare const ACTIVITY_PLAY_LIMIT_MIN = 1;
@@ -166,25 +491,28 @@ declare const ACTIVITY_PLAY_LIMIT_MAX = 50;
166
491
  /**
167
492
  * limit 归一(字符串化入参与 HTTP query 同规则):
168
493
  * **缺席**(undefined——字段没传)→ 缺省 20;传了但为空串/纯空白/非数字/越界 →
169
- * INVALID_REQUEST(明确拒绝——“未传”与“传了非法值”二分,空值不静默变成缺省数量;
170
- * 评审返修:此前空白串被归为缺省,违背任务书空值拒绝语义)。
494
+ * INVALID_REQUEST(明确拒绝——“未传”与“传了非法值”二分,空值不静默变成缺省数量)。
171
495
  */
172
496
  declare function normalizeListLimit(raw: string | undefined): number;
173
497
  /** keyword 归一:trim 后空串按缺省;'invalid' 等普通字符串是合法关键词(不哨兵化) */
174
498
  declare function normalizeKeyword(raw: string | undefined): string | undefined;
175
- /** activityRef 校验(复用契约单源;附件给出的引用非法即 INVALID_REQUEST) */
176
- declare function normalizeActivityRef(raw: string): string;
177
- /** 列表查询(供给侧承载 keyword 匹配/停用隐藏/limit 截断——本层零重复实现) */
499
+ /**
500
+ * activityId 归一(原字符串语义):契约 schema 校验(非空/≤128/拒控制字符与路径段破坏符);
501
+ * 不做数字转换/字符集白名单/**不做 trim**——供应商定义标识空间('001' 与 '1' ' record-001 '
502
+ * 均按原值收发;列表返回 ' record-001 ' 时详情必须原样命中,改写即 404 串答)。
503
+ */
504
+ declare function normalizeActivityId(raw: string): string;
505
+ /** 列表查询(供给侧承载上游查询/适配层 keyword 过滤与 limit 截断——本层零重复实现) */
178
506
  declare function queryActivityPlayList(reqCtx: RequestContext, ctx: ServerContext, input: {
179
507
  keyword?: string;
180
508
  limit: number;
181
509
  }): Promise<ActivityPlayPage>;
182
- /** 详情查询(存在 → 活动对象[可携 disabled];不存在 → null[两调用方各自映射 404/失败事实]) */
183
- declare function queryActivityPlayDetail(reqCtx: RequestContext, ctx: ServerContext, activityRef: string): Promise<ActivityPlayActivity | null>;
510
+ /** 详情查询(上游命中 → 活动对象(可携 unknown/disabled);不存在/不可见 → null) */
511
+ declare function queryActivityPlayDetail(reqCtx: RequestContext, ctx: ServerContext, activityId: string): Promise<ActivityPlayActivity | null>;
184
512
  /** 当前商圈标识(join key:出卡 mallId 恒取执行上下文 scope,非模型输入/硬编码) */
185
513
  declare function requireMallIdOf(reqCtx: RequestContext): string;
186
514
 
187
- type ActivityPlayErrorCode = 'INVALID_REQUEST' | 'SCOPE_REQUIRED' | 'SCOPE_MISMATCH' | 'LOGIN_REQUIRED' | 'ACTIVITY_NOT_FOUND' | 'ACTIVITY_DISABLED' | 'ACTIVITY_NOT_STARTED' | 'ACTIVITY_ENDED' | 'ENTRY_UNAVAILABLE' | 'NOT_CONFIGURED' | 'PROVIDER_ERROR';
515
+ type ActivityPlayErrorCode = 'INVALID_REQUEST' | 'SCOPE_REQUIRED' | 'SCOPE_MISMATCH' | 'LOGIN_REQUIRED' | 'ACTIVITY_NOT_FOUND' | 'NOT_CONFIGURED' | 'PROVIDER_ERROR';
188
516
  /** 可直接渲染的 HTTP 错误(service/route 层统一抛出/转换) */
189
517
  declare class ActivityPlayHttpError extends Error {
190
518
  readonly httpStatus: number;
@@ -194,10 +522,6 @@ declare class ActivityPlayHttpError extends Error {
194
522
  static scopeRequired(message: string): ActivityPlayHttpError;
195
523
  static scopeMismatch(message: string): ActivityPlayHttpError;
196
524
  static notFound(message: string): ActivityPlayHttpError;
197
- static activityDisabled(message: string): ActivityPlayHttpError;
198
- static activityNotStarted(message: string): ActivityPlayHttpError;
199
- static activityEnded(message: string): ActivityPlayHttpError;
200
- static entryUnavailable(message: string): ActivityPlayHttpError;
201
525
  static notConfigured(message: string): ActivityPlayHttpError;
202
526
  static providerError(message: string): ActivityPlayHttpError;
203
527
  }
@@ -205,8 +529,8 @@ declare class ActivityPlayHttpError extends Error {
205
529
  * 任意异常 → ActivityPlayHttpError 归一(映射守门):
206
530
  * - 已是本域 HTTP 错误 → 原样;
207
531
  * - 供给错误码(未配置/实例缺席或禁用/绑定未解析/未实施)→ 503 NOT_CONFIGURED;
208
- * - 其余(供给配置非法、执行异常、未知)→ 502 PROVIDER_ERROR——不吐原始 message
209
- * (防配置/凭证内容泄漏),细节由调用方 logger 留痕。
532
+ * - 其余(连接配置非法、上游失败、执行异常、未知)→ 502 PROVIDER_ERROR——不吐原始
533
+ * message(防连接/凭证内容泄漏),细节由调用方 logger 留痕。
210
534
  */
211
535
  declare function toActivityPlayHttpError(e: unknown): ActivityPlayHttpError;
212
536
 
@@ -219,28 +543,25 @@ declare const serverModule: {
219
543
  mallId: zod.ZodString;
220
544
  mode: zod.ZodEnum<["list", "detail"]>;
221
545
  items: zod.ZodArray<zod.ZodObject<{
222
- activityRef: zod.ZodString;
546
+ activityId: zod.ZodEffects<zod.ZodString, string, string>;
223
547
  title: zod.ZodString;
224
548
  description: zod.ZodOptional<zod.ZodString>;
225
549
  imageUrl: zod.ZodOptional<zod.ZodString>;
226
550
  startsAt: zod.ZodOptional<zod.ZodString>;
227
551
  endsAt: zod.ZodOptional<zod.ZodString>;
228
- status: zod.ZodEnum<["not_started", "active", "ended", "disabled"]>;
229
- loginRequired: zod.ZodBoolean;
552
+ status: zod.ZodEnum<["not_started", "active", "ended", "disabled", "unknown"]>;
230
553
  }, "strict", zod.ZodTypeAny, {
231
- status: "disabled" | "not_started" | "active" | "ended";
554
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
232
555
  title: string;
233
- activityRef: string;
234
- loginRequired: boolean;
556
+ activityId: string;
235
557
  description?: string | undefined;
236
558
  imageUrl?: string | undefined;
237
559
  startsAt?: string | undefined;
238
560
  endsAt?: string | undefined;
239
561
  }, {
240
- status: "disabled" | "not_started" | "active" | "ended";
562
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
241
563
  title: string;
242
- activityRef: string;
243
- loginRequired: boolean;
564
+ activityId: string;
244
565
  description?: string | undefined;
245
566
  imageUrl?: string | undefined;
246
567
  startsAt?: string | undefined;
@@ -250,10 +571,9 @@ declare const serverModule: {
250
571
  mode: "detail" | "list";
251
572
  mallId: string;
252
573
  items: {
253
- status: "disabled" | "not_started" | "active" | "ended";
574
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
254
575
  title: string;
255
- activityRef: string;
256
- loginRequired: boolean;
576
+ activityId: string;
257
577
  description?: string | undefined;
258
578
  imageUrl?: string | undefined;
259
579
  startsAt?: string | undefined;
@@ -263,10 +583,9 @@ declare const serverModule: {
263
583
  mode: "detail" | "list";
264
584
  mallId: string;
265
585
  items: {
266
- status: "disabled" | "not_started" | "active" | "ended";
586
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
267
587
  title: string;
268
- activityRef: string;
269
- loginRequired: boolean;
588
+ activityId: string;
270
589
  description?: string | undefined;
271
590
  imageUrl?: string | undefined;
272
591
  startsAt?: string | undefined;
@@ -276,10 +595,9 @@ declare const serverModule: {
276
595
  mode: "detail" | "list";
277
596
  mallId: string;
278
597
  items: {
279
- status: "disabled" | "not_started" | "active" | "ended";
598
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
280
599
  title: string;
281
- activityRef: string;
282
- loginRequired: boolean;
600
+ activityId: string;
283
601
  description?: string | undefined;
284
602
  imageUrl?: string | undefined;
285
603
  startsAt?: string | undefined;
@@ -289,16 +607,206 @@ declare const serverModule: {
289
607
  mode: "detail" | "list";
290
608
  mallId: string;
291
609
  items: {
292
- status: "disabled" | "not_started" | "active" | "ended";
610
+ status: "unknown" | "disabled" | "not_started" | "active" | "ended";
293
611
  title: string;
294
- activityRef: string;
295
- loginRequired: boolean;
612
+ activityId: string;
296
613
  description?: string | undefined;
297
614
  imageUrl?: string | undefined;
298
615
  startsAt?: string | undefined;
299
616
  endsAt?: string | undefined;
300
617
  }[];
301
618
  }>>;
619
+ readonly 'activity-play-prize-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
620
+ mallId: zod.ZodString;
621
+ total: zod.ZodNumber;
622
+ items: zod.ZodArray<zod.ZodObject<{
623
+ prizeRecordRef: zod.ZodEffects<zod.ZodString, string, string>;
624
+ title: zod.ZodString;
625
+ prizeType: zod.ZodString;
626
+ claimStatus: zod.ZodString;
627
+ useStatus: zod.ZodString;
628
+ activityId: zod.ZodOptional<zod.ZodString>;
629
+ activityTitle: zod.ZodOptional<zod.ZodString>;
630
+ imageUrl: zod.ZodOptional<zod.ZodString>;
631
+ wonAt: zod.ZodOptional<zod.ZodString>;
632
+ usageRuleText: zod.ZodOptional<zod.ZodString>;
633
+ } & {
634
+ itemActions: zod.ZodOptional<zod.ZodArray<zod.ZodDiscriminatedUnion<"kind", [zod.ZodObject<{
635
+ kind: zod.ZodLiteral<"send">;
636
+ label: zod.ZodString;
637
+ value: zod.ZodOptional<zod.ZodString>;
638
+ visibleValue: zod.ZodOptional<zod.ZodString>;
639
+ }, "strip", zod.ZodTypeAny, {
640
+ kind: "send";
641
+ label: string;
642
+ value?: string | undefined;
643
+ visibleValue?: string | undefined;
644
+ }, {
645
+ kind: "send";
646
+ label: string;
647
+ value?: string | undefined;
648
+ visibleValue?: string | undefined;
649
+ }>, zod.ZodObject<{
650
+ kind: zod.ZodLiteral<"link">;
651
+ label: zod.ZodString;
652
+ url: zod.ZodString;
653
+ }, "strip", zod.ZodTypeAny, {
654
+ url: string;
655
+ kind: "link";
656
+ label: string;
657
+ }, {
658
+ url: string;
659
+ kind: "link";
660
+ label: string;
661
+ }>]>, "many">>;
662
+ }, "strict", zod.ZodTypeAny, {
663
+ title: string;
664
+ prizeRecordRef: string;
665
+ prizeType: string;
666
+ claimStatus: string;
667
+ useStatus: string;
668
+ activityId?: string | undefined;
669
+ imageUrl?: string | undefined;
670
+ activityTitle?: string | undefined;
671
+ wonAt?: string | undefined;
672
+ usageRuleText?: string | undefined;
673
+ itemActions?: ({
674
+ kind: "send";
675
+ label: string;
676
+ value?: string | undefined;
677
+ visibleValue?: string | undefined;
678
+ } | {
679
+ url: string;
680
+ kind: "link";
681
+ label: string;
682
+ })[] | undefined;
683
+ }, {
684
+ title: string;
685
+ prizeRecordRef: string;
686
+ prizeType: string;
687
+ claimStatus: string;
688
+ useStatus: string;
689
+ activityId?: string | undefined;
690
+ imageUrl?: string | undefined;
691
+ activityTitle?: string | undefined;
692
+ wonAt?: string | undefined;
693
+ usageRuleText?: string | undefined;
694
+ itemActions?: ({
695
+ kind: "send";
696
+ label: string;
697
+ value?: string | undefined;
698
+ visibleValue?: string | undefined;
699
+ } | {
700
+ url: string;
701
+ kind: "link";
702
+ label: string;
703
+ })[] | undefined;
704
+ }>, "many">;
705
+ noResultsReason: zod.ZodOptional<zod.ZodString>;
706
+ truncated: zod.ZodOptional<zod.ZodBoolean>;
707
+ }, "strict", zod.ZodTypeAny, {
708
+ mallId: string;
709
+ total: number;
710
+ items: {
711
+ title: string;
712
+ prizeRecordRef: string;
713
+ prizeType: string;
714
+ claimStatus: string;
715
+ useStatus: string;
716
+ activityId?: string | undefined;
717
+ imageUrl?: string | undefined;
718
+ activityTitle?: string | undefined;
719
+ wonAt?: string | undefined;
720
+ usageRuleText?: string | undefined;
721
+ itemActions?: ({
722
+ kind: "send";
723
+ label: string;
724
+ value?: string | undefined;
725
+ visibleValue?: string | undefined;
726
+ } | {
727
+ url: string;
728
+ kind: "link";
729
+ label: string;
730
+ })[] | undefined;
731
+ }[];
732
+ truncated?: boolean | undefined;
733
+ noResultsReason?: string | undefined;
734
+ }, {
735
+ mallId: string;
736
+ total: number;
737
+ items: {
738
+ title: string;
739
+ prizeRecordRef: string;
740
+ prizeType: string;
741
+ claimStatus: string;
742
+ useStatus: string;
743
+ activityId?: string | undefined;
744
+ imageUrl?: string | undefined;
745
+ activityTitle?: string | undefined;
746
+ wonAt?: string | undefined;
747
+ usageRuleText?: string | undefined;
748
+ itemActions?: ({
749
+ kind: "send";
750
+ label: string;
751
+ value?: string | undefined;
752
+ visibleValue?: string | undefined;
753
+ } | {
754
+ url: string;
755
+ kind: "link";
756
+ label: string;
757
+ })[] | undefined;
758
+ }[];
759
+ truncated?: boolean | undefined;
760
+ noResultsReason?: string | undefined;
761
+ }>>;
762
+ readonly 'activity-play-prize-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
763
+ prizeRecordRef: zod.ZodEffects<zod.ZodString, string, string>;
764
+ title: zod.ZodString;
765
+ prizeType: zod.ZodString;
766
+ claimStatus: zod.ZodString;
767
+ useStatus: zod.ZodString;
768
+ activityId: zod.ZodOptional<zod.ZodString>;
769
+ activityTitle: zod.ZodOptional<zod.ZodString>;
770
+ imageUrl: zod.ZodOptional<zod.ZodString>;
771
+ wonAt: zod.ZodOptional<zod.ZodString>;
772
+ usageRuleText: zod.ZodOptional<zod.ZodString>;
773
+ } & {
774
+ redemptionMethod: zod.ZodOptional<zod.ZodString>;
775
+ redemptionInstruction: zod.ZodOptional<zod.ZodString>;
776
+ prizeUrl: zod.ZodOptional<zod.ZodString>;
777
+ } & {
778
+ mallId: zod.ZodString;
779
+ }, "strict", zod.ZodTypeAny, {
780
+ title: string;
781
+ mallId: string;
782
+ prizeRecordRef: string;
783
+ prizeType: string;
784
+ claimStatus: string;
785
+ useStatus: string;
786
+ activityId?: string | undefined;
787
+ imageUrl?: string | undefined;
788
+ activityTitle?: string | undefined;
789
+ wonAt?: string | undefined;
790
+ usageRuleText?: string | undefined;
791
+ redemptionMethod?: string | undefined;
792
+ redemptionInstruction?: string | undefined;
793
+ prizeUrl?: string | undefined;
794
+ }, {
795
+ title: string;
796
+ mallId: string;
797
+ prizeRecordRef: string;
798
+ prizeType: string;
799
+ claimStatus: string;
800
+ useStatus: string;
801
+ activityId?: string | undefined;
802
+ imageUrl?: string | undefined;
803
+ activityTitle?: string | undefined;
804
+ wonAt?: string | undefined;
805
+ usageRuleText?: string | undefined;
806
+ redemptionMethod?: string | undefined;
807
+ redemptionInstruction?: string | undefined;
808
+ prizeUrl?: string | undefined;
809
+ }>>;
302
810
  };
303
811
  skills: {
304
812
  [k: string]: _tbox_cn_app_sdk_server.LocalSkill;
@@ -306,4 +814,4 @@ declare const serverModule: {
306
814
  register(ctx: ServerContext): void;
307
815
  };
308
816
 
309
- export { ACTIVITY_PLAY_CARD_TYPE, ACTIVITY_PLAY_LIMIT_DEFAULT, ACTIVITY_PLAY_LIMIT_MAX, ACTIVITY_PLAY_LIMIT_MIN, type ActivityPlayErrorCode, ActivityPlayHttpError, activityMatchesForEntry, activityPlayCards, createActivityPlayRouter, createActivityPlayTools, normalizeActivityRef, normalizeKeyword, normalizeListLimit, queryActivityPlayDetail, queryActivityPlayList, requireMallIdOf, resolveActivityPlayEntryPort, resolveActivityPlayQueryPort, serverModule, toActivityPlayHttpError };
817
+ export { ACTIVITY_PLAY_CARD_TYPE, ACTIVITY_PLAY_LIMIT_DEFAULT, ACTIVITY_PLAY_LIMIT_MAX, ACTIVITY_PLAY_LIMIT_MIN, ACTIVITY_PLAY_PRIZE_DETAIL_CARD_TYPE, ACTIVITY_PLAY_PRIZE_LIST_CARD_TYPE, type ActivityPlayErrorCode, ActivityPlayHttpError, type ActivityPlayPrizeErrorCode, ActivityPlayPrizeHttpError, PRIZE_NO_RESULTS_TEXT, PRIZE_VIEW_DETAIL_LABEL, activityPlayCards, createActivityPlayPrizeRouter, createActivityPlayPrizeTools, createActivityPlayRouter, createActivityPlayTools, normalizeActivityId, normalizeKeyword, normalizeListLimit, normalizePrizeRecordRef, queryActivityPlayDetail, queryActivityPlayList, queryMyPrizeDetail, queryMyPrizeList, requireMallIdOf, requirePrizeQueryContext, requirePrizeSubjectId, resolveActivityPlayPrizePort, resolveActivityPlayQueryPort, serverModule, toActivityPlayHttpError, toActivityPlayPrizeError, toPrizeDetailCardData, toPrizeListCardData };