@tbox.cn/app-module-alipay-activity 0.3.1 → 0.3.3

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.
@@ -37,18 +37,21 @@ var samples = [
37
37
  label: "\u8BE6\u60C5\xB7\u8054\u5355\u8FDB\u884C\u4E2D",
38
38
  note: "\u57FA\u51C6\u5F62\u6001\uFF1Asteps \u5706\u5F62\u8282\u70B9 1/5\u3001\u5355\u5238\u5956\u52B1\u6C60\u3002\u672A\u4E0B\u53D1 backgroundUrl \u65F6\u5934\u90E8\u56DE\u843D\u5230\u6A21\u5757\u81EA\u5E26\u7684\u8054\u5355\u80CC\u666F\u56FE",
39
39
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
40
+ hidden: true,
40
41
  data: BASE
41
42
  },
42
43
  {
43
44
  label: "\u8BE6\u60C5\xB7\u63A5\u8FD1\u8FBE\u6210",
44
45
  note: "currentProgress=4/5\u2014\u2014\u8282\u70B9\u8F68\u9053\u70B9\u4EAE\u5230\u5012\u6570\u7B2C\u4E8C\u73AF\uFF0C\u68C0\u67E5\u672B\u73AF\u4E0E\u6570\u503C\u7684\u6536\u53E3",
45
46
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
47
+ hidden: true,
46
48
  data: { ...BASE, currentProgress: "4" }
47
49
  },
48
50
  {
49
51
  label: "\u8BE6\u60C5\xB7\u5DF2\u8FBE\u6210",
50
52
  note: "5/5\u2014\u2014\u5168\u90E8\u8282\u70B9\u70B9\u4EAE\uFF0C\u5956\u52B1\u6C60\u5E94\u662F\u53EF\u9886\u800C\u975E\u5F85\u89E3\u9501\u7684\u8BED\u6C14",
51
53
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
54
+ hidden: true,
52
55
  data: { ...BASE, currentProgress: "5" }
53
56
  },
54
57
  {
@@ -75,12 +78,14 @@ var samples = [
75
78
  label: "\u8BE6\u60C5\xB7bar \u8FDB\u5EA6",
76
79
  note: "progressStyle='bar'\u2014\u2014\u7EBF\u6027\u8FDB\u5EA6\u6761\u800C\u975E\u5706\u5F62\u8282\u70B9\uFF1B\u540C\u65F6\u4E0D\u518D\u56DE\u843D\u8054\u5355\u80CC\u666F\u56FE\uFF0C\u5934\u90E8\u5F62\u6001\u968F\u4E4B\u4E0D\u540C",
77
80
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
81
+ hidden: true,
78
82
  data: { ...BASE, progressStyle: "bar", currentProgress: "2" }
79
83
  },
80
84
  {
81
85
  label: "\u8BE6\u60C5\xB7\u5E26\u53C2\u4E0E\u6B65\u9AA4",
82
86
  note: "steps \u6570\u7EC4\u4E0B\u53D1\u65F6\u6E32\u67D3\u53C2\u4E0E\u8BF4\u660E\u2014\u2014\u4E0E\u8FDB\u5EA6\u8282\u70B9\u662F\u4E24\u56DE\u4E8B\uFF0C\u68C0\u67E5\u4E24\u8005\u4E0D\u6253\u67B6",
83
87
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
88
+ hidden: true,
84
89
  data: {
85
90
  ...BASE,
86
91
  steps: [
@@ -100,6 +105,7 @@ var samples = [
100
105
  label: "\u8BE6\u60C5\xB7\u6D3B\u52A8\u5DF2\u7ED3\u675F",
101
106
  note: "actStatus='FINISH'\u2014\u2014\u7EC8\u6001\u89D2\u6807\u300C\u5DF2\u7ED3\u675F\u300D\uFF0C\u68C0\u67E5\u662F\u5426\u4ECD\u5728\u9F13\u52B1\u7EE7\u7EED\u652F\u4ED8",
102
107
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
108
+ hidden: true,
103
109
  data: { ...BASE, actStatus: "FINISH", currentProgress: "3" }
104
110
  },
105
111
  {
@@ -112,6 +118,7 @@ var samples = [
112
118
  label: "\u8BE6\u60C5\xB7\u957F\u6807\u9898\u4E0E\u957F\u63CF\u8FF0",
113
119
  note: "\u4E3B\u6807\u9898\u4E0E\u63CF\u8FF0\u90FD\u8D85\u957F\u2014\u2014\u68C0\u67E5\u6362\u884C\u6491\u9AD8\u4E0E\u622A\u65AD\uFF0C\u522B\u628A\u5956\u52B1\u6C60\u6324\u51FA\u9996\u5C4F",
114
120
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
121
+ hidden: true,
115
122
  data: {
116
123
  ...BASE,
117
124
  mainTitle: "\u78B0\u4E00\u4E0B\u652F\u4ED8\u6EE1 5 \u7B14\u5373\u53EF\u89E3\u9501 88 \u5143\u60CA\u559C\u793C\u5305\uFF0C\u6D3B\u52A8\u671F\u5185\u8DE8\u95E8\u5E97\u7D2F\u8BA1\u6709\u6548\uFF0C\u5148\u5230\u5148\u5F97",
@@ -123,13 +130,15 @@ var samples = [
123
130
  note: "isHistory\u2014\u2014\u5361\u5185\u52A8\u4F5C\u7981\u7528\uFF0C\u4FE1\u606F\u7167\u5E38\u5448\u73B0",
124
131
  group: "\u8BE6\u60C5\u5F62\u6001\uFF08mode=detail\uFF09",
125
132
  data: { ...BASE, currentProgress: "3" },
126
- isHistory: true
133
+ isHistory: true,
134
+ hidden: true
127
135
  },
128
136
  // ── banner 模式:压缩形态 ──
129
137
  {
130
138
  label: "\u6A2A\u5E45\xB7\u8054\u5355\u8FDB\u884C\u4E2D",
131
139
  note: "mode='banner'\u2014\u2014\u538B\u7F29\u6210\u4E00\u6761\uFF0C\u4E0E\u9996\u9875\u6D77\u62A5\u662F\u540C\u4E00\u6D3B\u52A8\u7684\u4E24\u79CD\u5448\u73B0",
132
140
  group: "\u6A2A\u5E45\u5F62\u6001\uFF08mode=banner\uFF09",
141
+ hidden: true,
133
142
  data: { ...BASE, mode: "banner", currentProgress: "2" }
134
143
  },
135
144
  {
@@ -142,12 +151,14 @@ var samples = [
142
151
  label: "\u6A2A\u5E45\xB7\u5DF2\u8FBE\u6210",
143
152
  note: "banner \u7EC8\u6001\u2014\u20145/5\uFF0C\u68C0\u67E5\u538B\u7F29\u5F62\u6001\u4E0B\u8FBE\u6210\u8BED\u6C14\u662F\u5426\u4ECD\u7136\u6E05\u695A",
144
153
  group: "\u6A2A\u5E45\u5F62\u6001\uFF08mode=banner\uFF09",
154
+ hidden: true,
145
155
  data: { ...BASE, mode: "banner", currentProgress: "5" }
146
156
  },
147
157
  {
148
158
  label: "\u6A2A\u5E45\xB7\u672A\u5F00\u59CB",
149
159
  note: "banner + NOT_START\u2014\u2014\u538B\u7F29\u5F62\u6001\u4E0B\u300C\u672A\u5F00\u59CB\u300D\u89D2\u6807\u4E0E\u300C\u65E5\u5F00\u59CB\u300D\u884C\u4ECD\u9700\u53EF\u8FA8",
150
160
  group: "\u6A2A\u5E45\u5F62\u6001\uFF08mode=banner\uFF09",
161
+ hidden: true,
151
162
  data: { ...BASE, mode: "banner", actStatus: "NOT_START", currentProgress: "0" }
152
163
  }
153
164
  ];
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  resolveAlipayBumpInService,
11
11
  serverModule,
12
12
  toBumpInCardData
13
- } from "./chunk-RLGO2HTZ.js";
13
+ } from "./chunk-5VWMSB4Z.js";
14
14
  export {
15
15
  AlipayBumpInService,
16
16
  alipayBumpInAuthStrategy,
@@ -115,23 +115,23 @@ declare const serverModule: {
115
115
  merchantLogo: zod.ZodOptional<zod.ZodString>;
116
116
  itemLogo: zod.ZodOptional<zod.ZodString>;
117
117
  }, "strip", zod.ZodTypeAny, {
118
- merchantName: string;
119
118
  prizeId: string;
120
119
  voucherName: string;
121
120
  voucherType: string;
122
121
  reductionAmount: string;
123
122
  thresholdAmountText: string;
124
123
  unit: string;
124
+ merchantName: string;
125
125
  merchantLogo?: string | undefined;
126
126
  itemLogo?: string | undefined;
127
127
  }, {
128
- merchantName: string;
129
128
  prizeId: string;
130
129
  voucherName: string;
131
130
  voucherType: string;
132
131
  reductionAmount: string;
133
132
  thresholdAmountText: string;
134
133
  unit: string;
134
+ merchantName: string;
135
135
  merchantLogo?: string | undefined;
136
136
  itemLogo?: string | undefined;
137
137
  }>, "many">;
@@ -148,29 +148,25 @@ declare const serverModule: {
148
148
  description?: string | undefined;
149
149
  }>, "many">>;
150
150
  }, "strip", zod.ZodTypeAny, {
151
- title: string;
152
- mode: "detail" | "banner";
153
151
  activityRef: string;
152
+ title: string;
154
153
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
155
154
  vouchers: {
156
- merchantName: string;
157
155
  prizeId: string;
158
156
  voucherName: string;
159
157
  voucherType: string;
160
158
  reductionAmount: string;
161
159
  thresholdAmountText: string;
162
160
  unit: string;
161
+ merchantName: string;
163
162
  merchantLogo?: string | undefined;
164
163
  itemLogo?: string | undefined;
165
164
  }[];
166
- progressStyle: "steps" | "bar";
165
+ mode: "detail" | "banner";
166
+ progressStyle: "bar" | "steps";
167
167
  description?: string | undefined;
168
- steps?: {
169
- title: string;
170
- description?: string | undefined;
171
- }[] | undefined;
172
- coverUrl?: string | undefined;
173
168
  mainTitle?: string | undefined;
169
+ coverUrl?: string | undefined;
174
170
  backgroundUrl?: string | undefined;
175
171
  tagLabel?: string | undefined;
176
172
  cardLogoUrl?: string | undefined;
@@ -179,29 +175,28 @@ declare const serverModule: {
179
175
  progressUnit?: string | undefined;
180
176
  startAtText?: string | undefined;
181
177
  endAtText?: string | undefined;
178
+ steps?: {
179
+ title: string;
180
+ description?: string | undefined;
181
+ }[] | undefined;
182
182
  }, {
183
- title: string;
184
183
  activityRef: string;
184
+ title: string;
185
185
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
186
186
  vouchers: {
187
- merchantName: string;
188
187
  prizeId: string;
189
188
  voucherName: string;
190
189
  voucherType: string;
191
190
  reductionAmount: string;
192
191
  thresholdAmountText: string;
193
192
  unit: string;
193
+ merchantName: string;
194
194
  merchantLogo?: string | undefined;
195
195
  itemLogo?: string | undefined;
196
196
  }[];
197
197
  description?: string | undefined;
198
- mode?: "detail" | "banner" | undefined;
199
- steps?: {
200
- title: string;
201
- description?: string | undefined;
202
- }[] | undefined;
203
- coverUrl?: string | undefined;
204
198
  mainTitle?: string | undefined;
199
+ coverUrl?: string | undefined;
205
200
  backgroundUrl?: string | undefined;
206
201
  tagLabel?: string | undefined;
207
202
  cardLogoUrl?: string | undefined;
@@ -210,7 +205,12 @@ declare const serverModule: {
210
205
  progressUnit?: string | undefined;
211
206
  startAtText?: string | undefined;
212
207
  endAtText?: string | undefined;
213
- progressStyle?: "steps" | "bar" | undefined;
208
+ mode?: "detail" | "banner" | undefined;
209
+ steps?: {
210
+ title: string;
211
+ description?: string | undefined;
212
+ }[] | undefined;
213
+ progressStyle?: "bar" | "steps" | undefined;
214
214
  }>>;
215
215
  };
216
216
  skills: {
@@ -11,7 +11,7 @@ import {
11
11
  serverModule,
12
12
  server_default,
13
13
  toBumpInCardData
14
- } from "../chunk-RLGO2HTZ.js";
14
+ } from "../chunk-5VWMSB4Z.js";
15
15
  export {
16
16
  AlipayBumpInService,
17
17
  alipayBumpInAuthStrategy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-alipay-activity",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "支付宝互动营销活动模块:碰出惊喜(碰一下)活动查询与展示(codegen 源)。",
6
6
  "exports": {
@@ -18,11 +18,11 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-contracts": "0.12.0",
22
- "@tbox.cn/app-contracts-mall": "0.12.0",
21
+ "@tbox.cn/app-contracts": "0.12.3",
22
+ "@tbox.cn/app-contracts-mall": "0.12.3",
23
23
  "alipay-sdk": "4.14.0",
24
- "@tbox.cn/app-agent-sdk-client": "0.1.0",
25
- "@tbox.cn/app-agent-sdk-server": "0.1.0"
24
+ "@tbox.cn/app-agent-sdk-client": "0.1.3",
25
+ "@tbox.cn/app-agent-sdk-server": "0.1.4"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "zod": "3.25.76",
@@ -8,6 +8,8 @@
8
8
  * - 覆盖基准是组件实际读取的 data 分支(进度节点点亮/达成语气/多券截断/空奖励池收口/
9
9
  * 长文案撑高/终态措辞),而非 sampleData 的形状;
10
10
  * - 视觉等价的输入合并为一格,note 列全合并口径;
11
+ * - 预览只保留五格附加样本(加服务端合成的「初始态」共六格):多券/空奖励池/未开始/
12
+ * 已领奖/banner + bar;其余 hidden: true,真源与 shape/schema 质量检查覆盖不变;
11
13
  * - 样本即契约:data 必须 dataSchema 校验通过且无 shape 外键(tests/samples.test.ts 双断言)。
12
14
  */
13
15
  import type { CardSample } from '@tbox.cn/app-contracts';
@@ -47,18 +49,21 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
47
49
  label: '详情·联单进行中',
48
50
  note: '基准形态:steps 圆形节点 1/5、单券奖励池。未下发 backgroundUrl 时头部回落到模块自带的联单背景图',
49
51
  group: '详情形态(mode=detail)',
52
+ hidden: true,
50
53
  data: BASE,
51
54
  },
52
55
  {
53
56
  label: '详情·接近达成',
54
57
  note: 'currentProgress=4/5——节点轨道点亮到倒数第二环,检查末环与数值的收口',
55
58
  group: '详情形态(mode=detail)',
59
+ hidden: true,
56
60
  data: { ...BASE, currentProgress: '4' },
57
61
  },
58
62
  {
59
63
  label: '详情·已达成',
60
64
  note: '5/5——全部节点点亮,奖励池应是可领而非待解锁的语气',
61
65
  group: '详情形态(mode=detail)',
66
+ hidden: true,
62
67
  data: { ...BASE, currentProgress: '5' },
63
68
  },
64
69
  {
@@ -85,12 +90,14 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
85
90
  label: '详情·bar 进度',
86
91
  note: "progressStyle='bar'——线性进度条而非圆形节点;同时不再回落联单背景图,头部形态随之不同",
87
92
  group: '详情形态(mode=detail)',
93
+ hidden: true,
88
94
  data: { ...BASE, progressStyle: 'bar' as const, currentProgress: '2' },
89
95
  },
90
96
  {
91
97
  label: '详情·带参与步骤',
92
98
  note: 'steps 数组下发时渲染参与说明——与进度节点是两回事,检查两者不打架',
93
99
  group: '详情形态(mode=detail)',
100
+ hidden: true,
94
101
  data: {
95
102
  ...BASE,
96
103
  steps: [
@@ -110,6 +117,7 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
110
117
  label: '详情·活动已结束',
111
118
  note: "actStatus='FINISH'——终态角标「已结束」,检查是否仍在鼓励继续支付",
112
119
  group: '详情形态(mode=detail)',
120
+ hidden: true,
113
121
  data: { ...BASE, actStatus: 'FINISH', currentProgress: '3' },
114
122
  },
115
123
  {
@@ -122,6 +130,7 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
122
130
  label: '详情·长标题与长描述',
123
131
  note: '主标题与描述都超长——检查换行撑高与截断,别把奖励池挤出首屏',
124
132
  group: '详情形态(mode=detail)',
133
+ hidden: true,
125
134
  data: {
126
135
  ...BASE,
127
136
  mainTitle: '碰一下支付满 5 笔即可解锁 88 元惊喜礼包,活动期内跨门店累计有效,先到先得',
@@ -134,6 +143,7 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
134
143
  group: '详情形态(mode=detail)',
135
144
  data: { ...BASE, currentProgress: '3' },
136
145
  isHistory: true,
146
+ hidden: true,
137
147
  },
138
148
 
139
149
  // ── banner 模式:压缩形态 ──
@@ -141,6 +151,7 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
141
151
  label: '横幅·联单进行中',
142
152
  note: "mode='banner'——压缩成一条,与首页海报是同一活动的两种呈现",
143
153
  group: '横幅形态(mode=banner)',
154
+ hidden: true,
144
155
  data: { ...BASE, mode: 'banner' as const, currentProgress: '2' },
145
156
  },
146
157
  {
@@ -153,12 +164,14 @@ export const samples: CardSample<PromotionBumpInActivityCardData>[] = [
153
164
  label: '横幅·已达成',
154
165
  note: 'banner 终态——5/5,检查压缩形态下达成语气是否仍然清楚',
155
166
  group: '横幅形态(mode=banner)',
167
+ hidden: true,
156
168
  data: { ...BASE, mode: 'banner' as const, currentProgress: '5' },
157
169
  },
158
170
  {
159
171
  label: '横幅·未开始',
160
172
  note: 'banner + NOT_START——压缩形态下「未开始」角标与「日开始」行仍需可辨',
161
173
  group: '横幅形态(mode=banner)',
174
+ hidden: true,
162
175
  data: { ...BASE, mode: 'banner' as const, actStatus: 'NOT_START', currentProgress: '0' },
163
176
  },
164
177
  ];
package/tbox.module.json CHANGED
@@ -3,7 +3,8 @@
3
3
  "id": "module-alipay-activity",
4
4
  "name": "联单活动",
5
5
  "description": "支付宝联单活动",
6
- "version": "0.1.0",
6
+ "version": "0.3.1",
7
+ "hidden": true,
7
8
  "kind": "business",
8
9
  "risk": {
9
10
  "level": "low",
@@ -26,4 +26,23 @@ describe('alipay-activity samples 双断言(样本即契约)', () => {
26
26
  expect(serialized).toContain('"progressStyle":"bar"');
27
27
  expect(meta.samples).toHaveLength(16);
28
28
  });
29
+
30
+ it('历史卡保留质量检查但不进入 Preview', () => {
31
+ const histories = (meta.samples ?? []).filter((sample) => sample.isHistory === true);
32
+ expect(histories).toHaveLength(1);
33
+ expect(histories.every((sample) => sample.hidden === true)).toBe(true);
34
+ });
35
+
36
+ it('碰出惊喜 Preview 只保留五个互补的附加样本', () => {
37
+ const visibleLabels = (meta.samples ?? [])
38
+ .filter((sample) => sample.hidden !== true)
39
+ .map((sample) => sample.label);
40
+ expect(visibleLabels).toEqual([
41
+ '详情·多券奖励池',
42
+ '详情·无奖励池',
43
+ '详情·活动未开始',
44
+ '详情·已领奖',
45
+ '横幅·bar 进度',
46
+ ]);
47
+ });
29
48
  });