@tbox.cn/app-contracts-mall 0.17.2 → 0.18.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.
@@ -1,8 +1,9 @@
1
1
  /**
2
- * 活动玩法域卡片数据契约(task-02 服务端出卡)。
2
+ * 活动玩法域卡片数据契约(远端活动改造 2026-11-17)。
3
3
  * 单一稳定 CardType `activity-play`,mode 区分列表/详情传输形态——视觉由前端渲染器
4
4
  * 按 mode 组织,传输层不拆分多卡型(与 promotion 域 9 卡型形态区分)。
5
- * 条目复用 activityPlayActivitySchema(含 B 端 enabled 剥离——卡data 不带配置字段)。
5
+ * 条目复用 activityPlayActivitySchema(供应商活动对象——卡 data 不带本地目录/入口配置字段)。
6
+ * 本人奖品两张卡型归任务 07,不在本契约预置空实现。
6
7
  * 信封字段(卡片 ID/时间戳/历史标记/版本)由 SDK 生成,不在本契约。
7
8
  */
8
9
  import { z } from 'zod';
@@ -12,30 +13,27 @@ export declare const activityPlayCardDataSchema: z.ZodEffects<z.ZodObject<{
12
13
  mallId: z.ZodString;
13
14
  /** 传输形态:list(列表,可空,≤50 项)/ detail(详情,恰好 1 项,可携 disabled) */
14
15
  mode: z.ZodEnum<["list", "detail"]>;
15
- /** 活动条目(契约单源 ActivityPlayActivity;不带 enabled 配置字段)——list 可空 ≤50 项 */
16
+ /** 活动条目(供应商活动对象:activityId/title/status 等——list 可空 ≤50 项) */
16
17
  items: z.ZodArray<z.ZodObject<{
17
- activityRef: z.ZodString;
18
+ activityId: z.ZodEffects<z.ZodString, string, string>;
18
19
  title: z.ZodString;
19
20
  description: z.ZodOptional<z.ZodString>;
20
21
  imageUrl: z.ZodOptional<z.ZodString>;
21
22
  startsAt: z.ZodOptional<z.ZodString>;
22
23
  endsAt: z.ZodOptional<z.ZodString>;
23
- status: z.ZodEnum<["not_started", "active", "ended", "disabled"]>;
24
- loginRequired: z.ZodBoolean;
24
+ status: z.ZodEnum<["not_started", "active", "ended", "disabled", "unknown"]>;
25
25
  }, "strict", z.ZodTypeAny, {
26
- status: "not_started" | "active" | "ended" | "disabled";
27
- activityRef: string;
26
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
27
+ activityId: string;
28
28
  title: string;
29
- loginRequired: boolean;
30
29
  description?: string | undefined;
31
30
  imageUrl?: string | undefined;
32
31
  startsAt?: string | undefined;
33
32
  endsAt?: string | undefined;
34
33
  }, {
35
- status: "not_started" | "active" | "ended" | "disabled";
36
- activityRef: string;
34
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
35
+ activityId: string;
37
36
  title: string;
38
- loginRequired: boolean;
39
37
  description?: string | undefined;
40
38
  imageUrl?: string | undefined;
41
39
  startsAt?: string | undefined;
@@ -44,10 +42,9 @@ export declare const activityPlayCardDataSchema: z.ZodEffects<z.ZodObject<{
44
42
  }, "strip", z.ZodTypeAny, {
45
43
  mallId: string;
46
44
  items: {
47
- status: "not_started" | "active" | "ended" | "disabled";
48
- activityRef: string;
45
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
46
+ activityId: string;
49
47
  title: string;
50
- loginRequired: boolean;
51
48
  description?: string | undefined;
52
49
  imageUrl?: string | undefined;
53
50
  startsAt?: string | undefined;
@@ -57,10 +54,9 @@ export declare const activityPlayCardDataSchema: z.ZodEffects<z.ZodObject<{
57
54
  }, {
58
55
  mallId: string;
59
56
  items: {
60
- status: "not_started" | "active" | "ended" | "disabled";
61
- activityRef: string;
57
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
58
+ activityId: string;
62
59
  title: string;
63
- loginRequired: boolean;
64
60
  description?: string | undefined;
65
61
  imageUrl?: string | undefined;
66
62
  startsAt?: string | undefined;
@@ -70,10 +66,9 @@ export declare const activityPlayCardDataSchema: z.ZodEffects<z.ZodObject<{
70
66
  }>, {
71
67
  mallId: string;
72
68
  items: {
73
- status: "not_started" | "active" | "ended" | "disabled";
74
- activityRef: string;
69
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
70
+ activityId: string;
75
71
  title: string;
76
- loginRequired: boolean;
77
72
  description?: string | undefined;
78
73
  imageUrl?: string | undefined;
79
74
  startsAt?: string | undefined;
@@ -83,10 +78,9 @@ export declare const activityPlayCardDataSchema: z.ZodEffects<z.ZodObject<{
83
78
  }, {
84
79
  mallId: string;
85
80
  items: {
86
- status: "not_started" | "active" | "ended" | "disabled";
87
- activityRef: string;
81
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
82
+ activityId: string;
88
83
  title: string;
89
- loginRequired: boolean;
90
84
  description?: string | undefined;
91
85
  imageUrl?: string | undefined;
92
86
  startsAt?: string | undefined;
@@ -70,8 +70,8 @@ export declare const activityPlayPrizeCardItemSchema: z.ZodObject<{
70
70
  prizeType: string;
71
71
  claimStatus: string;
72
72
  useStatus: string;
73
- imageUrl?: string | undefined;
74
73
  activityId?: string | undefined;
74
+ imageUrl?: string | undefined;
75
75
  activityTitle?: string | undefined;
76
76
  wonAt?: string | undefined;
77
77
  usageRuleText?: string | undefined;
@@ -91,8 +91,8 @@ export declare const activityPlayPrizeCardItemSchema: z.ZodObject<{
91
91
  prizeType: string;
92
92
  claimStatus: string;
93
93
  useStatus: string;
94
- imageUrl?: string | undefined;
95
94
  activityId?: string | undefined;
95
+ imageUrl?: string | undefined;
96
96
  activityTitle?: string | undefined;
97
97
  wonAt?: string | undefined;
98
98
  usageRuleText?: string | undefined;
@@ -163,8 +163,8 @@ export declare const activityPlayPrizeListCardDataSchema: z.ZodObject<{
163
163
  prizeType: string;
164
164
  claimStatus: string;
165
165
  useStatus: string;
166
- imageUrl?: string | undefined;
167
166
  activityId?: string | undefined;
167
+ imageUrl?: string | undefined;
168
168
  activityTitle?: string | undefined;
169
169
  wonAt?: string | undefined;
170
170
  usageRuleText?: string | undefined;
@@ -184,8 +184,8 @@ export declare const activityPlayPrizeListCardDataSchema: z.ZodObject<{
184
184
  prizeType: string;
185
185
  claimStatus: string;
186
186
  useStatus: string;
187
- imageUrl?: string | undefined;
188
187
  activityId?: string | undefined;
188
+ imageUrl?: string | undefined;
189
189
  activityTitle?: string | undefined;
190
190
  wonAt?: string | undefined;
191
191
  usageRuleText?: string | undefined;
@@ -212,8 +212,8 @@ export declare const activityPlayPrizeListCardDataSchema: z.ZodObject<{
212
212
  prizeType: string;
213
213
  claimStatus: string;
214
214
  useStatus: string;
215
- imageUrl?: string | undefined;
216
215
  activityId?: string | undefined;
216
+ imageUrl?: string | undefined;
217
217
  activityTitle?: string | undefined;
218
218
  wonAt?: string | undefined;
219
219
  usageRuleText?: string | undefined;
@@ -239,8 +239,8 @@ export declare const activityPlayPrizeListCardDataSchema: z.ZodObject<{
239
239
  prizeType: string;
240
240
  claimStatus: string;
241
241
  useStatus: string;
242
- imageUrl?: string | undefined;
243
242
  activityId?: string | undefined;
243
+ imageUrl?: string | undefined;
244
244
  activityTitle?: string | undefined;
245
245
  wonAt?: string | undefined;
246
246
  usageRuleText?: string | undefined;
@@ -287,8 +287,8 @@ export declare const activityPlayPrizeDetailCardDataSchema: z.ZodObject<{
287
287
  prizeType: string;
288
288
  claimStatus: string;
289
289
  useStatus: string;
290
- imageUrl?: string | undefined;
291
290
  activityId?: string | undefined;
291
+ imageUrl?: string | undefined;
292
292
  activityTitle?: string | undefined;
293
293
  wonAt?: string | undefined;
294
294
  usageRuleText?: string | undefined;
@@ -302,8 +302,8 @@ export declare const activityPlayPrizeDetailCardDataSchema: z.ZodObject<{
302
302
  prizeType: string;
303
303
  claimStatus: string;
304
304
  useStatus: string;
305
- imageUrl?: string | undefined;
306
305
  activityId?: string | undefined;
306
+ imageUrl?: string | undefined;
307
307
  activityTitle?: string | undefined;
308
308
  wonAt?: string | undefined;
309
309
  usageRuleText?: string | undefined;
@@ -107,8 +107,8 @@ export declare const promotionBumpInActivityCardDataSchema: z.ZodObject<{
107
107
  description?: string | undefined;
108
108
  }>, "many">>;
109
109
  }, "strip", z.ZodTypeAny, {
110
- activityRef: string;
111
110
  title: string;
111
+ activityRef: string;
112
112
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
113
113
  vouchers: {
114
114
  merchantName: string;
@@ -139,8 +139,8 @@ export declare const promotionBumpInActivityCardDataSchema: z.ZodObject<{
139
139
  description?: string | undefined;
140
140
  }[] | undefined;
141
141
  }, {
142
- activityRef: string;
143
142
  title: string;
143
+ activityRef: string;
144
144
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
145
145
  vouchers: {
146
146
  merchantName: string;
@@ -236,8 +236,8 @@ export declare const alipayActivityCardDataSchemas: {
236
236
  description?: string | undefined;
237
237
  }>, "many">>;
238
238
  }, "strip", z.ZodTypeAny, {
239
- activityRef: string;
240
239
  title: string;
240
+ activityRef: string;
241
241
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
242
242
  vouchers: {
243
243
  merchantName: string;
@@ -268,8 +268,8 @@ export declare const alipayActivityCardDataSchemas: {
268
268
  description?: string | undefined;
269
269
  }[] | undefined;
270
270
  }, {
271
- activityRef: string;
272
271
  title: string;
272
+ activityRef: string;
273
273
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
274
274
  vouchers: {
275
275
  merchantName: string;
@@ -64,8 +64,8 @@ export declare const activityPlayPrizeRecordSchema: z.ZodObject<{
64
64
  prizeType: string;
65
65
  claimStatus: string;
66
66
  useStatus: string;
67
- imageUrl?: string | undefined;
68
67
  activityId?: string | undefined;
68
+ imageUrl?: string | undefined;
69
69
  activityTitle?: string | undefined;
70
70
  wonAt?: string | undefined;
71
71
  usageRuleText?: string | undefined;
@@ -75,8 +75,8 @@ export declare const activityPlayPrizeRecordSchema: z.ZodObject<{
75
75
  prizeType: string;
76
76
  claimStatus: string;
77
77
  useStatus: string;
78
- imageUrl?: string | undefined;
79
78
  activityId?: string | undefined;
79
+ imageUrl?: string | undefined;
80
80
  activityTitle?: string | undefined;
81
81
  wonAt?: string | undefined;
82
82
  usageRuleText?: string | undefined;
@@ -107,8 +107,8 @@ export declare const activityPlayPrizeDetailSchema: z.ZodObject<{
107
107
  prizeType: string;
108
108
  claimStatus: string;
109
109
  useStatus: string;
110
- imageUrl?: string | undefined;
111
110
  activityId?: string | undefined;
111
+ imageUrl?: string | undefined;
112
112
  activityTitle?: string | undefined;
113
113
  wonAt?: string | undefined;
114
114
  usageRuleText?: string | undefined;
@@ -121,8 +121,8 @@ export declare const activityPlayPrizeDetailSchema: z.ZodObject<{
121
121
  prizeType: string;
122
122
  claimStatus: string;
123
123
  useStatus: string;
124
- imageUrl?: string | undefined;
125
124
  activityId?: string | undefined;
125
+ imageUrl?: string | undefined;
126
126
  activityTitle?: string | undefined;
127
127
  wonAt?: string | undefined;
128
128
  usageRuleText?: string | undefined;
@@ -154,8 +154,8 @@ export declare const activityPlayPrizeListResultSchema: z.ZodObject<{
154
154
  prizeType: string;
155
155
  claimStatus: string;
156
156
  useStatus: string;
157
- imageUrl?: string | undefined;
158
157
  activityId?: string | undefined;
158
+ imageUrl?: string | undefined;
159
159
  activityTitle?: string | undefined;
160
160
  wonAt?: string | undefined;
161
161
  usageRuleText?: string | undefined;
@@ -165,8 +165,8 @@ export declare const activityPlayPrizeListResultSchema: z.ZodObject<{
165
165
  prizeType: string;
166
166
  claimStatus: string;
167
167
  useStatus: string;
168
- imageUrl?: string | undefined;
169
168
  activityId?: string | undefined;
169
+ imageUrl?: string | undefined;
170
170
  activityTitle?: string | undefined;
171
171
  wonAt?: string | undefined;
172
172
  usageRuleText?: string | undefined;
@@ -179,8 +179,8 @@ export declare const activityPlayPrizeListResultSchema: z.ZodObject<{
179
179
  prizeType: string;
180
180
  claimStatus: string;
181
181
  useStatus: string;
182
- imageUrl?: string | undefined;
183
182
  activityId?: string | undefined;
183
+ imageUrl?: string | undefined;
184
184
  activityTitle?: string | undefined;
185
185
  wonAt?: string | undefined;
186
186
  usageRuleText?: string | undefined;
@@ -193,8 +193,8 @@ export declare const activityPlayPrizeListResultSchema: z.ZodObject<{
193
193
  prizeType: string;
194
194
  claimStatus: string;
195
195
  useStatus: string;
196
- imageUrl?: string | undefined;
197
196
  activityId?: string | undefined;
197
+ imageUrl?: string | undefined;
198
198
  activityTitle?: string | undefined;
199
199
  wonAt?: string | undefined;
200
200
  usageRuleText?: string | undefined;
@@ -1,215 +1,78 @@
1
1
  /**
2
- * 活动玩法域模型(TIER1):活动目录查询 DTO + 状态计算 + 字段级运行时校验单源。
3
- * 与旧营销活动(promotion.domain)语义独立:activityRef 是本系统本商圈内的稳定引用,
4
- * 不承诺远端活动 ID、报名名额、场次或深链。
2
+ * 活动玩法域模型(TIER1):远端活动查询 DTO + 字段级运行时校验单源。
3
+ * 活动事实来自供应商 API(查询时转换——远端活动改造 2026-11-17):本层只描述
4
+ * 供应商返回的活动对象,不做本地目录登记、状态计算或参与入口准备。
5
5
  *
6
- * 字段校验单源(验收返修 2026-11-13):`activityPlayDirectoryEntrySchema`(供给方配置条目,
7
- * enabled 缺省 true)与 `activityPlayActivitySchema`(HTTP 活动对象,status 服务端计算)共享
8
- * 同一组字段 schema——provider 校验/HTTP 输出/表单引导三面不漂移(日期日历真值与
9
- * HTTPS URL 有效性由 zod 内建校验承载,非正则形状检查)。
6
+ * 身份语义:activityId 是供应商返回的活动标识,按原字符串处理('001'/'1.20'/'1e3'
7
+ * 不改写、不作数字预解析);公开面不出现第二个 ID 或别名映射。
8
+ *
9
+ * 字段校验单源:`activityPlayActivitySchema` 是工具/HTTP/卡片三方共用的活动对象形状
10
+ * (strict 拒未知键——供给侧键名漂移显性失败,不静默放行);
11
+ * 可选字段(description/imageUrl/startsAt/endsAt)缺席即省略,不合成默认值。
10
12
  */
11
13
  import { z } from 'zod';
12
- /** 活动开放状态(服务端按本地时间与启用标记计算;不表示参与资格) */
13
- export type ActivityPlayStatus = 'not_started' | 'active' | 'ended' | 'disabled';
14
- /** 活动对象(列表/详情同形;status 由服务端计算) */
14
+ /** 活动开放状态(供应商状态转换后返回;unknown = 上游未知值,不得按 active 参与展示) */
15
+ export type ActivityPlayStatus = 'not_started' | 'active' | 'ended' | 'disabled' | 'unknown';
16
+ /** 活动对象(列表/详情同形;activityId 与状态均来自供应商) */
15
17
  export interface ActivityPlayActivity {
16
- /** 本系统本商圈内的稳定活动引用(商圈内唯一;不等同远端活动 ID) */
17
- readonly activityRef: string;
18
+ /** 供应商活动标识(按原字符串处理——非本地配置、非数字) */
19
+ readonly activityId: string;
18
20
  readonly title: string;
19
21
  /** 展示说明,按普通文本处理 */
20
22
  readonly description?: string;
21
23
  /** HTTPS 封面地址 */
22
24
  readonly imageUrl?: string;
23
- /** 含时区的 ISO 时间;缺省表示该方向没有本地时间限制 */
25
+ /** 含时区的 ISO 时间;缺失表示供应商未提供该事实,不编造 */
24
26
  readonly startsAt?: string;
25
27
  readonly endsAt?: string;
28
+ /**
29
+ * 供应商转换后的活动状态:不表示参与资格;unknown 是保守兜底
30
+ * (上游枚举缺失/无法映射时不得推断为 active)。
31
+ */
26
32
  readonly status: ActivityPlayStatus;
27
- /** 是否要求先取得本系统登录态(描述字段;判定归入口任务) */
28
- readonly loginRequired: boolean;
29
33
  }
30
- /** 列表结果(本期为有限本地目录,无远端分页协议;列表被截断不等同没有更多活动) */
34
+ /** 列表结果(上游范围/分页记录归供应商核验;列表被截断不等同没有更多活动) */
31
35
  export interface ActivityPlayPage {
32
36
  readonly items: readonly ActivityPlayActivity[];
33
37
  }
34
- /** 活动引用:非空、≤128、仅字母数字与 _ . : -(商圈内唯一性由目录侧判定) */
35
- export declare const activityPlayRefSchema: z.ZodString;
38
+ /**
39
+ * 供应商活动标识:非空、≤128、拒控制字符与路径段破坏符(/ ? # % ——路径定位与
40
+ * URL 编码歧义防线)。除上述形态约束外**按原字符串**收发:字符集/数字形态不做
41
+ * 归一,'001' 与 '1' 是两个不同活动(与旧 activityRef 的字符集白名单语义不同——
42
+ * 现由供应商定义标识空间)。
43
+ */
44
+ export declare const activityPlayIdSchema: z.ZodEffects<z.ZodString, string, string>;
36
45
  /** 活动名称:非空、≤64 */
37
46
  export declare const activityPlayTitleSchema: z.ZodString;
38
47
  /** 说明:普通文本,≤500 */
39
48
  export declare const activityPlayDescriptionSchema: z.ZodString;
40
- /** 时间:含时区偏移的 ISO 形态,且为真实日历时刻(拒 2027-02-30 类滚日值——zod 校验真实日历时刻) */
49
+ /** 时间:含时区偏移的 ISO 形态,且为真实日历时刻(拒 2027-02-30 类滚日值) */
41
50
  export declare const activityPlayTimeSchema: z.ZodString;
42
51
  /** 封面图:有效 URL 且恒 HTTPS(拒 https://? 等残缺形态) */
43
52
  export declare const activityPlayImageUrlSchema: z.ZodString;
44
- /** 目录登记条目(供给方配置条目真源:enabled 为 B 端字段缺省 true;status 不在此层) */
45
- export declare const activityPlayDirectoryEntrySchema: z.ZodObject<{
46
- activityRef: z.ZodString;
47
- title: z.ZodString;
48
- description: z.ZodOptional<z.ZodString>;
49
- imageUrl: z.ZodOptional<z.ZodString>;
50
- startsAt: z.ZodOptional<z.ZodString>;
51
- endsAt: z.ZodOptional<z.ZodString>;
52
- enabled: z.ZodDefault<z.ZodBoolean>;
53
- loginRequired: z.ZodDefault<z.ZodBoolean>;
54
- }, "strict", z.ZodTypeAny, {
55
- enabled: boolean;
56
- activityRef: string;
57
- title: string;
58
- loginRequired: boolean;
59
- description?: string | undefined;
60
- imageUrl?: string | undefined;
61
- startsAt?: string | undefined;
62
- endsAt?: string | undefined;
63
- }, {
64
- activityRef: string;
65
- title: string;
66
- description?: string | undefined;
67
- enabled?: boolean | undefined;
68
- imageUrl?: string | undefined;
69
- startsAt?: string | undefined;
70
- endsAt?: string | undefined;
71
- loginRequired?: boolean | undefined;
72
- }>;
73
- /** 目录登记条目类型(zod 推断——enabled/loginRequired 经 default 落定后恒在场) */
74
- export type ActivityPlayDirectoryEntry = z.infer<typeof activityPlayDirectoryEntrySchema>;
75
- /** HTTP 活动对象 schema(= 目录条目换装 status;strict 拒未知键) */
53
+ /** 活动对象 schema(列表项/详情/H5 与 B 端展示同形;strict 拒未知键——含旧字段 activityRef/loginRequired) */
76
54
  export declare const activityPlayActivitySchema: z.ZodObject<{
77
- activityRef: z.ZodString;
55
+ activityId: z.ZodEffects<z.ZodString, string, string>;
78
56
  title: z.ZodString;
79
57
  description: z.ZodOptional<z.ZodString>;
80
58
  imageUrl: z.ZodOptional<z.ZodString>;
81
59
  startsAt: z.ZodOptional<z.ZodString>;
82
60
  endsAt: z.ZodOptional<z.ZodString>;
83
- status: z.ZodEnum<["not_started", "active", "ended", "disabled"]>;
84
- loginRequired: z.ZodBoolean;
61
+ status: z.ZodEnum<["not_started", "active", "ended", "disabled", "unknown"]>;
85
62
  }, "strict", z.ZodTypeAny, {
86
- status: "not_started" | "active" | "ended" | "disabled";
87
- activityRef: string;
63
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
64
+ activityId: string;
88
65
  title: string;
89
- loginRequired: boolean;
90
66
  description?: string | undefined;
91
67
  imageUrl?: string | undefined;
92
68
  startsAt?: string | undefined;
93
69
  endsAt?: string | undefined;
94
70
  }, {
95
- status: "not_started" | "active" | "ended" | "disabled";
96
- activityRef: string;
71
+ status: "unknown" | "not_started" | "active" | "ended" | "disabled";
72
+ activityId: string;
97
73
  title: string;
98
- loginRequired: boolean;
99
74
  description?: string | undefined;
100
75
  imageUrl?: string | undefined;
101
76
  startsAt?: string | undefined;
102
77
  endsAt?: string | undefined;
103
78
  }>;
104
- /**
105
- * 状态计算单源(列表/详情/后续入口统一复用):
106
- * - enabled 非真 → disabled(优先于时间);
107
- * - 时间语义(服务端绝对时间判定):startsAt ≤ now < endsAt 为 active;
108
- * now < startsAt 为 not_started;now ≥ endsAt 为 ended(开始包含、结束不包含);
109
- * - 单侧缺省 = 该方向无本地时间限制(缺 startsAt 恒不落 not_started;缺 endsAt 恒不落 ended);
110
- * - 时间串不可解析 → 抛错(config/供给校验前置拦截;此处 fail-visible 不静默降级)。
111
- */
112
- export declare function activityPlayStatusOf(input: {
113
- enabled: boolean;
114
- startsAt?: string;
115
- endsAt?: string;
116
- /** 服务端时间(缺省取当前);测试注入固定时刻 */
117
- now?: Date;
118
- }): ActivityPlayStatus;
119
- /** 插件目标形态:一期唯一 kind——宿主 app.json 声明的别名 + 插件公开页面(不提前建通用导航框架) */
120
- export declare const ACTIVITY_PLAY_TARGET_KIND: "miniapp-plugin";
121
- /**
122
- * 单段别名约束(pluginAlias/page 共用)——本项目工程约束(非支付宝平台限额):
123
- * 非空、≤64、首字符字母数字、仅 A-Za-z0-9 . _ -;拒整条 URL、协议头(://)、路径分隔符、
124
- * 路径穿越(.. 需被字符集排除)与控制字符。
125
- */
126
- export declare const ACTIVITY_PLAY_ALIAS_MAX = 64;
127
- export declare const ACTIVITY_PLAY_SEGMENT_RE: RegExp;
128
- /** params 容量约束(本项目工程上限): ≤32 项、键 ≤64、单值 ≤256、序列化总长 ≤4096 */
129
- export declare const ACTIVITY_PLAY_PARAMS_MAX_ENTRIES = 32;
130
- export declare const ACTIVITY_PLAY_PARAMS_KEY_MAX = 64;
131
- export declare const ACTIVITY_PLAY_PARAMS_VALUE_MAX = 256;
132
- export declare const ACTIVITY_PLAY_PARAMS_SERIALIZE_MAX = 4096;
133
- /**
134
- * 身份/凭证保留键(大小写与 -/_ 分隔归一后比对——配置侧登记即拒;本限制是对
135
- * 「显式键名」的黑名单,不构成对任意字符串值的自动保密识别;只应登记静态公开路由参数)。
136
- */
137
- export declare const ACTIVITY_PLAY_PARAMS_RESERVED_KEYS: readonly ["userid", "openid", "memberid", "token", "authcode", "accesstoken", "refreshtoken", "jwt", "ticket", "sessionid"];
138
- /** pluginAlias:宿主 app.json 引用别名(单段,非 URL/路径) */
139
- export declare const activityPlayPluginAliasSchema: z.ZodString;
140
- /** page:插件导出的公开页面别名(单段,同上则) */
141
- export declare const activityPlayTargetPageSchema: z.ZodString;
142
- /** 结构化插件目标(params 缺席归一为空对象;显式 null 拒绝) */
143
- export declare const activityPlayTargetSchema: z.ZodObject<{
144
- kind: z.ZodLiteral<"miniapp-plugin">;
145
- pluginAlias: z.ZodString;
146
- page: z.ZodString;
147
- params: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, Record<string, string>, Record<string, string> | undefined>, Record<string, string>, Record<string, string> | undefined>, Record<string, string>, Record<string, string> | undefined>;
148
- }, "strict", z.ZodTypeAny, {
149
- params: Record<string, string>;
150
- kind: "miniapp-plugin";
151
- pluginAlias: string;
152
- page: string;
153
- }, {
154
- kind: "miniapp-plugin";
155
- pluginAlias: string;
156
- page: string;
157
- params?: Record<string, string> | undefined;
158
- }>;
159
- /** 结构化插件目标类型(前端消费面;URL 由前端/宿主按桥接交接构造,后端不生成跳转 URL) */
160
- export type ActivityPlayTarget = z.infer<typeof activityPlayTargetSchema>;
161
- /** 入口协议版本(一期 '1'——协议演进靠冻结+迁移,不做数值升级) */
162
- export declare const ACTIVITY_PLAY_ENTRY_PROTOCOL_VERSION: "1";
163
- /** 入口准备结果(HTTP data 面:协议版本 + 活动引用 + 结构化目标——零身份/凭据字段) */
164
- export declare const activityPlayEntrySchema: z.ZodObject<{
165
- protocolVersion: z.ZodLiteral<"1">;
166
- activityRef: z.ZodString;
167
- target: z.ZodObject<{
168
- kind: z.ZodLiteral<"miniapp-plugin">;
169
- pluginAlias: z.ZodString;
170
- page: z.ZodString;
171
- params: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, Record<string, string>, Record<string, string> | undefined>, Record<string, string>, Record<string, string> | undefined>, Record<string, string>, Record<string, string> | undefined>;
172
- }, "strict", z.ZodTypeAny, {
173
- params: Record<string, string>;
174
- kind: "miniapp-plugin";
175
- pluginAlias: string;
176
- page: string;
177
- }, {
178
- kind: "miniapp-plugin";
179
- pluginAlias: string;
180
- page: string;
181
- params?: Record<string, string> | undefined;
182
- }>;
183
- }, "strict", z.ZodTypeAny, {
184
- activityRef: string;
185
- protocolVersion: "1";
186
- target: {
187
- params: Record<string, string>;
188
- kind: "miniapp-plugin";
189
- pluginAlias: string;
190
- page: string;
191
- };
192
- }, {
193
- activityRef: string;
194
- protocolVersion: "1";
195
- target: {
196
- kind: "miniapp-plugin";
197
- pluginAlias: string;
198
- page: string;
199
- params?: Record<string, string> | undefined;
200
- };
201
- }>;
202
- /** 入口准备结果类型 */
203
- export type ActivityPlayEntry = z.infer<typeof activityPlayEntrySchema>;
204
- /**
205
- * 入口侧目录条目视图(两槽一致性对照锚):同一供给下,入口条目随附该供给目录中
206
- * 同引用的活动登记属性——消费方(module-activity-play)用它经查询槽读出的活动对象
207
- * 做内容级一致性比对,比对失败即 ENTRY_UNAVAILABLE(不能用 A 目录的检查放行 B 目录
208
- * 的入口)。比对包含 status(瞬态临界下最多误拒一次,重试即恢复——fail-closed 取向)。
209
- */
210
- export interface ActivityPlayEntryRecord {
211
- /** 供给侧同 ref 条目的活动属性(含 status——与查询侧输出的字段集完全同构) */
212
- readonly activity: ActivityPlayActivity;
213
- /** 结构化插件目标 */
214
- readonly target: ActivityPlayTarget;
215
- }
@@ -1050,8 +1050,8 @@ export declare const promotionActivityListCardDataSchema: z.ZodObject<{
1050
1050
  label: string;
1051
1051
  }>]>, "many">>;
1052
1052
  }, "strip", z.ZodTypeAny, {
1053
- activityRef: string;
1054
1053
  title: string;
1054
+ activityRef: string;
1055
1055
  registrationRequired: boolean;
1056
1056
  itemActions?: ({
1057
1057
  kind: "send";
@@ -1072,8 +1072,8 @@ export declare const promotionActivityListCardDataSchema: z.ZodObject<{
1072
1072
  periodText?: string | undefined;
1073
1073
  categoryName?: string | undefined;
1074
1074
  }, {
1075
- activityRef: string;
1076
1075
  title: string;
1076
+ activityRef: string;
1077
1077
  registrationRequired: boolean;
1078
1078
  itemActions?: ({
1079
1079
  kind: "send";
@@ -1098,8 +1098,8 @@ export declare const promotionActivityListCardDataSchema: z.ZodObject<{
1098
1098
  nextCursor: z.ZodOptional<z.ZodString>;
1099
1099
  }, "strip", z.ZodTypeAny, {
1100
1100
  items: {
1101
- activityRef: string;
1102
1101
  title: string;
1102
+ activityRef: string;
1103
1103
  registrationRequired: boolean;
1104
1104
  itemActions?: ({
1105
1105
  kind: "send";
@@ -1124,8 +1124,8 @@ export declare const promotionActivityListCardDataSchema: z.ZodObject<{
1124
1124
  nextCursor?: string | undefined;
1125
1125
  }, {
1126
1126
  items: {
1127
- activityRef: string;
1128
1127
  title: string;
1128
+ activityRef: string;
1129
1129
  registrationRequired: boolean;
1130
1130
  itemActions?: ({
1131
1131
  kind: "send";
@@ -1206,8 +1206,8 @@ export declare const promotionActivityDetailCardDataSchema: z.ZodObject<{
1206
1206
  conditions: z.ZodArray<z.ZodString, "many">;
1207
1207
  notice: z.ZodOptional<z.ZodString>;
1208
1208
  }, "strip", z.ZodTypeAny, {
1209
- activityRef: string;
1210
1209
  title: string;
1210
+ activityRef: string;
1211
1211
  registrationRequired: boolean;
1212
1212
  sessions: {
1213
1213
  status: "CLOSED" | "UNKNOWN" | "OPEN" | "FULL";
@@ -1237,8 +1237,8 @@ export declare const promotionActivityDetailCardDataSchema: z.ZodObject<{
1237
1237
  description?: string | undefined;
1238
1238
  }[] | undefined;
1239
1239
  }, {
1240
- activityRef: string;
1241
1240
  title: string;
1241
+ activityRef: string;
1242
1242
  registrationRequired: boolean;
1243
1243
  sessions: {
1244
1244
  status: "CLOSED" | "UNKNOWN" | "OPEN" | "FULL";
@@ -2309,8 +2309,8 @@ export declare const promotionCardDataSchemas: {
2309
2309
  label: string;
2310
2310
  }>]>, "many">>;
2311
2311
  }, "strip", z.ZodTypeAny, {
2312
- activityRef: string;
2313
2312
  title: string;
2313
+ activityRef: string;
2314
2314
  registrationRequired: boolean;
2315
2315
  itemActions?: ({
2316
2316
  kind: "send";
@@ -2331,8 +2331,8 @@ export declare const promotionCardDataSchemas: {
2331
2331
  periodText?: string | undefined;
2332
2332
  categoryName?: string | undefined;
2333
2333
  }, {
2334
- activityRef: string;
2335
2334
  title: string;
2335
+ activityRef: string;
2336
2336
  registrationRequired: boolean;
2337
2337
  itemActions?: ({
2338
2338
  kind: "send";
@@ -2357,8 +2357,8 @@ export declare const promotionCardDataSchemas: {
2357
2357
  nextCursor: z.ZodOptional<z.ZodString>;
2358
2358
  }, "strip", z.ZodTypeAny, {
2359
2359
  items: {
2360
- activityRef: string;
2361
2360
  title: string;
2361
+ activityRef: string;
2362
2362
  registrationRequired: boolean;
2363
2363
  itemActions?: ({
2364
2364
  kind: "send";
@@ -2383,8 +2383,8 @@ export declare const promotionCardDataSchemas: {
2383
2383
  nextCursor?: string | undefined;
2384
2384
  }, {
2385
2385
  items: {
2386
- activityRef: string;
2387
2386
  title: string;
2387
+ activityRef: string;
2388
2388
  registrationRequired: boolean;
2389
2389
  itemActions?: ({
2390
2390
  kind: "send";
@@ -2463,8 +2463,8 @@ export declare const promotionCardDataSchemas: {
2463
2463
  conditions: z.ZodArray<z.ZodString, "many">;
2464
2464
  notice: z.ZodOptional<z.ZodString>;
2465
2465
  }, "strip", z.ZodTypeAny, {
2466
- activityRef: string;
2467
2466
  title: string;
2467
+ activityRef: string;
2468
2468
  registrationRequired: boolean;
2469
2469
  sessions: {
2470
2470
  status: "CLOSED" | "UNKNOWN" | "OPEN" | "FULL";
@@ -2494,8 +2494,8 @@ export declare const promotionCardDataSchemas: {
2494
2494
  description?: string | undefined;
2495
2495
  }[] | undefined;
2496
2496
  }, {
2497
- activityRef: string;
2498
2497
  title: string;
2498
+ activityRef: string;
2499
2499
  registrationRequired: boolean;
2500
2500
  sessions: {
2501
2501
  status: "CLOSED" | "UNKNOWN" | "OPEN" | "FULL";