@tbox.cn/app-contracts-mall 0.17.1 → 0.17.2
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/activity-play-prize/cards.d.ts +314 -0
- package/dist/domain/activity-play-prize.d.ts +208 -0
- package/dist/index.d.ts +3 -0
- package/dist/parking/cards.d.ts +4 -4
- package/dist/promotion/cards.d.ts +28 -28
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.js +727 -640
- package/dist/services/activity-play-prize.d.ts +36 -0
- package/dist/shopping-guide/cards.d.ts +36 -36
- package/package.json +1 -1
- package/src/activity-play-prize/cards.ts +69 -0
- package/src/domain/activity-play-prize.ts +105 -0
- package/src/index.ts +3 -0
- package/src/runtime.ts +18 -0
- package/src/service-slots.json +6 -1
- package/src/services/activity-play-prize.ts +47 -0
- package/tests/activity-play-prize.test.ts +175 -0
- package/tests/service-slots.test.ts +7 -5
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 活动玩法·个人奖品查询 Port(activity-play.prizes 槽——任务07)。
|
|
3
|
+
* 语义:使用当前商圈解析出的授权商家业务连接 + 可信 subjectId(= identity.userId 原值
|
|
4
|
+
* 同值传递,任务06 约定)查询本人中奖记录列表/详情;厂商 wire 词汇不进本层。
|
|
5
|
+
* 结构类型子集接口——provider 包 adapter 实现,消费方(业务模块)仅依赖本契约包。
|
|
6
|
+
*
|
|
7
|
+
* 范围纪律(供给方/消费方共同遵守):
|
|
8
|
+
* - subjectId 必填在场(本人查询语义);缺用户由消费方在**调用 provider 前**显性认证失败
|
|
9
|
+
* (先失败后调供给——缺用户时零奖品 API 调用);
|
|
10
|
+
* - subjectId 不是支付宝 user_id/OpenID/会员号的别名——供应商须明确按该值查询,并与插件
|
|
11
|
+
* 参与发奖使用同一值;
|
|
12
|
+
* - 详情须由上游按商家+玩家范围查询或归属校验保证本人可见——知道记录标识 ≠ 可读取,
|
|
13
|
+
* 不可见记录与不存在同返回 null(不区分泄露他人记录);
|
|
14
|
+
* - 活动枚举/活动白名单/活动当前状态都**不是**本 Port 的前置(活动结束、下架或活动接口
|
|
15
|
+
* 故障不影响本人奖品查询);
|
|
16
|
+
* - 仅供应商成功确认无记录 → total=0/items=[];供应商失败上抛,不得伪装空结果;
|
|
17
|
+
* - 复用与活动查询同一商家业务连接(消费方不另行建第二套凭据/连接/活动登记)。
|
|
18
|
+
*/
|
|
19
|
+
import type { ActivityPlayPrizeDetail, ActivityPlayPrizeListResult } from '../domain/activity-play-prize';
|
|
20
|
+
import type { MallQueryContext } from '../query-context';
|
|
21
|
+
export declare const ACTIVITY_PLAY_PRIZES_SERVICE = "activity-play.prizes";
|
|
22
|
+
/**
|
|
23
|
+
* 奖品查询上下文(MallQueryContext 的本人查询形态:subjectId 必填——由消费方经
|
|
24
|
+
* toMallQueryContext + 严格主体检查组装,值与 identity.userId 原值相等)。
|
|
25
|
+
*/
|
|
26
|
+
export type ActivityPlayPrizeQueryContext = MallQueryContext & {
|
|
27
|
+
/** 当前用户 userid 原值(不数字化/不加去前缀/不重哈希) */
|
|
28
|
+
readonly subjectId: string;
|
|
29
|
+
};
|
|
30
|
+
/** activity-play.prizes 槽供给端口(provider 包 adapter 实现) */
|
|
31
|
+
export interface ActivityPlayPrizeQueryPort {
|
|
32
|
+
/** 本人奖品列表(供应商成功确认无记录 → total=0/items=[];失败上抛供给错误) */
|
|
33
|
+
listMyPrizes(q: ActivityPlayPrizeQueryContext): Promise<ActivityPlayPrizeListResult>;
|
|
34
|
+
/** 本人奖品详情(记录不存在或对当前用户/商家不可见 → null;失败上抛供给错误) */
|
|
35
|
+
getMyPrizeDetail(q: ActivityPlayPrizeQueryContext, prizeRecordRef: string): Promise<ActivityPlayPrizeDetail | null>;
|
|
36
|
+
}
|
|
@@ -196,13 +196,13 @@ export declare const pageInfoSchema: z.ZodObject<{
|
|
|
196
196
|
hasMore: z.ZodBoolean;
|
|
197
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
198
|
page: number;
|
|
199
|
-
pageSize: number;
|
|
200
199
|
total: number;
|
|
200
|
+
pageSize: number;
|
|
201
201
|
hasMore: boolean;
|
|
202
202
|
}, {
|
|
203
203
|
page: number;
|
|
204
|
-
pageSize: number;
|
|
205
204
|
total: number;
|
|
205
|
+
pageSize: number;
|
|
206
206
|
hasMore: boolean;
|
|
207
207
|
}>;
|
|
208
208
|
export declare const refinementSchema: z.ZodObject<{
|
|
@@ -562,13 +562,13 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
562
562
|
hasMore: z.ZodBoolean;
|
|
563
563
|
}, "strip", z.ZodTypeAny, {
|
|
564
564
|
page: number;
|
|
565
|
-
pageSize: number;
|
|
566
565
|
total: number;
|
|
566
|
+
pageSize: number;
|
|
567
567
|
hasMore: boolean;
|
|
568
568
|
}, {
|
|
569
569
|
page: number;
|
|
570
|
-
pageSize: number;
|
|
571
570
|
total: number;
|
|
571
|
+
pageSize: number;
|
|
572
572
|
hasMore: boolean;
|
|
573
573
|
}>>;
|
|
574
574
|
refinements: z.ZodArray<z.ZodObject<{
|
|
@@ -582,7 +582,6 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
582
582
|
queryText: string;
|
|
583
583
|
}>, "many">;
|
|
584
584
|
}, "strip", z.ZodTypeAny, {
|
|
585
|
-
context: "recommendation" | "search" | "similar" | "history";
|
|
586
585
|
items: {
|
|
587
586
|
name: string;
|
|
588
587
|
merchant: {
|
|
@@ -648,6 +647,7 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
648
647
|
expiresAt?: string | undefined;
|
|
649
648
|
}[] | undefined;
|
|
650
649
|
}[];
|
|
650
|
+
context: "recommendation" | "search" | "similar" | "history";
|
|
651
651
|
refinements: {
|
|
652
652
|
label: string;
|
|
653
653
|
queryText: string;
|
|
@@ -656,12 +656,11 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
656
656
|
noResultsReason?: string | undefined;
|
|
657
657
|
pageInfo?: {
|
|
658
658
|
page: number;
|
|
659
|
-
pageSize: number;
|
|
660
659
|
total: number;
|
|
660
|
+
pageSize: number;
|
|
661
661
|
hasMore: boolean;
|
|
662
662
|
} | undefined;
|
|
663
663
|
}, {
|
|
664
|
-
context: "recommendation" | "search" | "similar" | "history";
|
|
665
664
|
items: {
|
|
666
665
|
name: string;
|
|
667
666
|
merchant: {
|
|
@@ -727,6 +726,7 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
727
726
|
expiresAt?: string | undefined;
|
|
728
727
|
}[] | undefined;
|
|
729
728
|
}[];
|
|
729
|
+
context: "recommendation" | "search" | "similar" | "history";
|
|
730
730
|
refinements: {
|
|
731
731
|
label: string;
|
|
732
732
|
queryText: string;
|
|
@@ -735,8 +735,8 @@ export declare const productListCardDataSchema: z.ZodObject<{
|
|
|
735
735
|
noResultsReason?: string | undefined;
|
|
736
736
|
pageInfo?: {
|
|
737
737
|
page: number;
|
|
738
|
-
pageSize: number;
|
|
739
738
|
total: number;
|
|
739
|
+
pageSize: number;
|
|
740
740
|
hasMore: boolean;
|
|
741
741
|
} | undefined;
|
|
742
742
|
}>;
|
|
@@ -1037,13 +1037,13 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1037
1037
|
hasMore: z.ZodBoolean;
|
|
1038
1038
|
}, "strip", z.ZodTypeAny, {
|
|
1039
1039
|
page: number;
|
|
1040
|
-
pageSize: number;
|
|
1041
1040
|
total: number;
|
|
1041
|
+
pageSize: number;
|
|
1042
1042
|
hasMore: boolean;
|
|
1043
1043
|
}, {
|
|
1044
1044
|
page: number;
|
|
1045
|
-
pageSize: number;
|
|
1046
1045
|
total: number;
|
|
1046
|
+
pageSize: number;
|
|
1047
1047
|
hasMore: boolean;
|
|
1048
1048
|
}>>;
|
|
1049
1049
|
refinements: z.ZodArray<z.ZodObject<{
|
|
@@ -1057,7 +1057,6 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1057
1057
|
queryText: string;
|
|
1058
1058
|
}>, "many">;
|
|
1059
1059
|
}, "strip", z.ZodTypeAny, {
|
|
1060
|
-
context: "recommendation" | "search";
|
|
1061
1060
|
items: {
|
|
1062
1061
|
status: {
|
|
1063
1062
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -1119,6 +1118,7 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1119
1118
|
offerRef?: string | undefined;
|
|
1120
1119
|
}[] | undefined;
|
|
1121
1120
|
}[];
|
|
1121
|
+
context: "recommendation" | "search";
|
|
1122
1122
|
refinements: {
|
|
1123
1123
|
label: string;
|
|
1124
1124
|
queryText: string;
|
|
@@ -1129,8 +1129,8 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1129
1129
|
noResultsReason?: string | undefined;
|
|
1130
1130
|
pageInfo?: {
|
|
1131
1131
|
page: number;
|
|
1132
|
-
pageSize: number;
|
|
1133
1132
|
total: number;
|
|
1133
|
+
pageSize: number;
|
|
1134
1134
|
hasMore: boolean;
|
|
1135
1135
|
} | undefined;
|
|
1136
1136
|
categoryTabs?: {
|
|
@@ -1138,7 +1138,6 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1138
1138
|
name: string;
|
|
1139
1139
|
}[] | undefined;
|
|
1140
1140
|
}, {
|
|
1141
|
-
context: "recommendation" | "search";
|
|
1142
1141
|
items: {
|
|
1143
1142
|
status: {
|
|
1144
1143
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -1200,6 +1199,7 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1200
1199
|
offerRef?: string | undefined;
|
|
1201
1200
|
}[] | undefined;
|
|
1202
1201
|
}[];
|
|
1202
|
+
context: "recommendation" | "search";
|
|
1203
1203
|
refinements: {
|
|
1204
1204
|
label: string;
|
|
1205
1205
|
queryText: string;
|
|
@@ -1210,8 +1210,8 @@ export declare const shopListCardDataSchema: z.ZodObject<{
|
|
|
1210
1210
|
noResultsReason?: string | undefined;
|
|
1211
1211
|
pageInfo?: {
|
|
1212
1212
|
page: number;
|
|
1213
|
-
pageSize: number;
|
|
1214
1213
|
total: number;
|
|
1214
|
+
pageSize: number;
|
|
1215
1215
|
hasMore: boolean;
|
|
1216
1216
|
} | undefined;
|
|
1217
1217
|
categoryTabs?: {
|
|
@@ -1518,13 +1518,13 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1518
1518
|
hasMore: z.ZodBoolean;
|
|
1519
1519
|
}, "strip", z.ZodTypeAny, {
|
|
1520
1520
|
page: number;
|
|
1521
|
-
pageSize: number;
|
|
1522
1521
|
total: number;
|
|
1522
|
+
pageSize: number;
|
|
1523
1523
|
hasMore: boolean;
|
|
1524
1524
|
}, {
|
|
1525
1525
|
page: number;
|
|
1526
|
-
pageSize: number;
|
|
1527
1526
|
total: number;
|
|
1527
|
+
pageSize: number;
|
|
1528
1528
|
hasMore: boolean;
|
|
1529
1529
|
}>>;
|
|
1530
1530
|
refinements: z.ZodArray<z.ZodObject<{
|
|
@@ -1538,7 +1538,6 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1538
1538
|
queryText: string;
|
|
1539
1539
|
}>, "many">;
|
|
1540
1540
|
}, "strip", z.ZodTypeAny, {
|
|
1541
|
-
context: "recommendation" | "search";
|
|
1542
1541
|
items: {
|
|
1543
1542
|
status: {
|
|
1544
1543
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -1600,6 +1599,7 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1600
1599
|
offerRef?: string | undefined;
|
|
1601
1600
|
}[] | undefined;
|
|
1602
1601
|
}[];
|
|
1602
|
+
context: "recommendation" | "search";
|
|
1603
1603
|
refinements: {
|
|
1604
1604
|
label: string;
|
|
1605
1605
|
queryText: string;
|
|
@@ -1610,8 +1610,8 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1610
1610
|
noResultsReason?: string | undefined;
|
|
1611
1611
|
pageInfo?: {
|
|
1612
1612
|
page: number;
|
|
1613
|
-
pageSize: number;
|
|
1614
1613
|
total: number;
|
|
1614
|
+
pageSize: number;
|
|
1615
1615
|
hasMore: boolean;
|
|
1616
1616
|
} | undefined;
|
|
1617
1617
|
categoryTabs?: {
|
|
@@ -1619,7 +1619,6 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1619
1619
|
name: string;
|
|
1620
1620
|
}[] | undefined;
|
|
1621
1621
|
}, {
|
|
1622
|
-
context: "recommendation" | "search";
|
|
1623
1622
|
items: {
|
|
1624
1623
|
status: {
|
|
1625
1624
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -1681,6 +1680,7 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1681
1680
|
offerRef?: string | undefined;
|
|
1682
1681
|
}[] | undefined;
|
|
1683
1682
|
}[];
|
|
1683
|
+
context: "recommendation" | "search";
|
|
1684
1684
|
refinements: {
|
|
1685
1685
|
label: string;
|
|
1686
1686
|
queryText: string;
|
|
@@ -1691,8 +1691,8 @@ export declare const merchantListCardDataSchema: z.ZodObject<{
|
|
|
1691
1691
|
noResultsReason?: string | undefined;
|
|
1692
1692
|
pageInfo?: {
|
|
1693
1693
|
page: number;
|
|
1694
|
-
pageSize: number;
|
|
1695
1694
|
total: number;
|
|
1695
|
+
pageSize: number;
|
|
1696
1696
|
hasMore: boolean;
|
|
1697
1697
|
} | undefined;
|
|
1698
1698
|
categoryTabs?: {
|
|
@@ -3915,7 +3915,6 @@ export declare const recommendMerchantsCardDataSchema: z.ZodObject<{
|
|
|
3915
3915
|
noResultsReason: z.ZodOptional<z.ZodString>;
|
|
3916
3916
|
observedAt: z.ZodString;
|
|
3917
3917
|
}, "strip", z.ZodTypeAny, {
|
|
3918
|
-
observedAt: string;
|
|
3919
3918
|
items: {
|
|
3920
3919
|
status: {
|
|
3921
3920
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -3956,6 +3955,7 @@ export declare const recommendMerchantsCardDataSchema: z.ZodObject<{
|
|
|
3956
3955
|
rating?: string | undefined;
|
|
3957
3956
|
avgSpend?: string | undefined;
|
|
3958
3957
|
}[];
|
|
3958
|
+
observedAt: string;
|
|
3959
3959
|
summary?: string | undefined;
|
|
3960
3960
|
noResultsReason?: string | undefined;
|
|
3961
3961
|
categoryTabs?: {
|
|
@@ -3963,7 +3963,6 @@ export declare const recommendMerchantsCardDataSchema: z.ZodObject<{
|
|
|
3963
3963
|
name: string;
|
|
3964
3964
|
}[] | undefined;
|
|
3965
3965
|
}, {
|
|
3966
|
-
observedAt: string;
|
|
3967
3966
|
items: {
|
|
3968
3967
|
status: {
|
|
3969
3968
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -4004,6 +4003,7 @@ export declare const recommendMerchantsCardDataSchema: z.ZodObject<{
|
|
|
4004
4003
|
rating?: string | undefined;
|
|
4005
4004
|
avgSpend?: string | undefined;
|
|
4006
4005
|
}[];
|
|
4006
|
+
observedAt: string;
|
|
4007
4007
|
summary?: string | undefined;
|
|
4008
4008
|
noResultsReason?: string | undefined;
|
|
4009
4009
|
categoryTabs?: {
|
|
@@ -4354,13 +4354,13 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4354
4354
|
hasMore: z.ZodBoolean;
|
|
4355
4355
|
}, "strip", z.ZodTypeAny, {
|
|
4356
4356
|
page: number;
|
|
4357
|
-
pageSize: number;
|
|
4358
4357
|
total: number;
|
|
4358
|
+
pageSize: number;
|
|
4359
4359
|
hasMore: boolean;
|
|
4360
4360
|
}, {
|
|
4361
4361
|
page: number;
|
|
4362
|
-
pageSize: number;
|
|
4363
4362
|
total: number;
|
|
4363
|
+
pageSize: number;
|
|
4364
4364
|
hasMore: boolean;
|
|
4365
4365
|
}>>;
|
|
4366
4366
|
refinements: z.ZodArray<z.ZodObject<{
|
|
@@ -4374,7 +4374,6 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4374
4374
|
queryText: string;
|
|
4375
4375
|
}>, "many">;
|
|
4376
4376
|
}, "strip", z.ZodTypeAny, {
|
|
4377
|
-
context: "recommendation" | "search" | "similar" | "history";
|
|
4378
4377
|
items: {
|
|
4379
4378
|
name: string;
|
|
4380
4379
|
merchant: {
|
|
@@ -4440,6 +4439,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4440
4439
|
expiresAt?: string | undefined;
|
|
4441
4440
|
}[] | undefined;
|
|
4442
4441
|
}[];
|
|
4442
|
+
context: "recommendation" | "search" | "similar" | "history";
|
|
4443
4443
|
refinements: {
|
|
4444
4444
|
label: string;
|
|
4445
4445
|
queryText: string;
|
|
@@ -4448,12 +4448,11 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4448
4448
|
noResultsReason?: string | undefined;
|
|
4449
4449
|
pageInfo?: {
|
|
4450
4450
|
page: number;
|
|
4451
|
-
pageSize: number;
|
|
4452
4451
|
total: number;
|
|
4452
|
+
pageSize: number;
|
|
4453
4453
|
hasMore: boolean;
|
|
4454
4454
|
} | undefined;
|
|
4455
4455
|
}, {
|
|
4456
|
-
context: "recommendation" | "search" | "similar" | "history";
|
|
4457
4456
|
items: {
|
|
4458
4457
|
name: string;
|
|
4459
4458
|
merchant: {
|
|
@@ -4519,6 +4518,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4519
4518
|
expiresAt?: string | undefined;
|
|
4520
4519
|
}[] | undefined;
|
|
4521
4520
|
}[];
|
|
4521
|
+
context: "recommendation" | "search" | "similar" | "history";
|
|
4522
4522
|
refinements: {
|
|
4523
4523
|
label: string;
|
|
4524
4524
|
queryText: string;
|
|
@@ -4527,8 +4527,8 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
4527
4527
|
noResultsReason?: string | undefined;
|
|
4528
4528
|
pageInfo?: {
|
|
4529
4529
|
page: number;
|
|
4530
|
-
pageSize: number;
|
|
4531
4530
|
total: number;
|
|
4531
|
+
pageSize: number;
|
|
4532
4532
|
hasMore: boolean;
|
|
4533
4533
|
} | undefined;
|
|
4534
4534
|
}>;
|
|
@@ -5159,13 +5159,13 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5159
5159
|
hasMore: z.ZodBoolean;
|
|
5160
5160
|
}, "strip", z.ZodTypeAny, {
|
|
5161
5161
|
page: number;
|
|
5162
|
-
pageSize: number;
|
|
5163
5162
|
total: number;
|
|
5163
|
+
pageSize: number;
|
|
5164
5164
|
hasMore: boolean;
|
|
5165
5165
|
}, {
|
|
5166
5166
|
page: number;
|
|
5167
|
-
pageSize: number;
|
|
5168
5167
|
total: number;
|
|
5168
|
+
pageSize: number;
|
|
5169
5169
|
hasMore: boolean;
|
|
5170
5170
|
}>>;
|
|
5171
5171
|
refinements: z.ZodArray<z.ZodObject<{
|
|
@@ -5179,7 +5179,6 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5179
5179
|
queryText: string;
|
|
5180
5180
|
}>, "many">;
|
|
5181
5181
|
}, "strip", z.ZodTypeAny, {
|
|
5182
|
-
context: "recommendation" | "search";
|
|
5183
5182
|
items: {
|
|
5184
5183
|
status: {
|
|
5185
5184
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -5241,6 +5240,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5241
5240
|
offerRef?: string | undefined;
|
|
5242
5241
|
}[] | undefined;
|
|
5243
5242
|
}[];
|
|
5243
|
+
context: "recommendation" | "search";
|
|
5244
5244
|
refinements: {
|
|
5245
5245
|
label: string;
|
|
5246
5246
|
queryText: string;
|
|
@@ -5251,8 +5251,8 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5251
5251
|
noResultsReason?: string | undefined;
|
|
5252
5252
|
pageInfo?: {
|
|
5253
5253
|
page: number;
|
|
5254
|
-
pageSize: number;
|
|
5255
5254
|
total: number;
|
|
5255
|
+
pageSize: number;
|
|
5256
5256
|
hasMore: boolean;
|
|
5257
5257
|
} | undefined;
|
|
5258
5258
|
categoryTabs?: {
|
|
@@ -5260,7 +5260,6 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5260
5260
|
name: string;
|
|
5261
5261
|
}[] | undefined;
|
|
5262
5262
|
}, {
|
|
5263
|
-
context: "recommendation" | "search";
|
|
5264
5263
|
items: {
|
|
5265
5264
|
status: {
|
|
5266
5265
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -5322,6 +5321,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5322
5321
|
offerRef?: string | undefined;
|
|
5323
5322
|
}[] | undefined;
|
|
5324
5323
|
}[];
|
|
5324
|
+
context: "recommendation" | "search";
|
|
5325
5325
|
refinements: {
|
|
5326
5326
|
label: string;
|
|
5327
5327
|
queryText: string;
|
|
@@ -5332,8 +5332,8 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
5332
5332
|
noResultsReason?: string | undefined;
|
|
5333
5333
|
pageInfo?: {
|
|
5334
5334
|
page: number;
|
|
5335
|
-
pageSize: number;
|
|
5336
5335
|
total: number;
|
|
5336
|
+
pageSize: number;
|
|
5337
5337
|
hasMore: boolean;
|
|
5338
5338
|
} | undefined;
|
|
5339
5339
|
categoryTabs?: {
|
|
@@ -6939,7 +6939,6 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
6939
6939
|
noResultsReason: z.ZodOptional<z.ZodString>;
|
|
6940
6940
|
observedAt: z.ZodString;
|
|
6941
6941
|
}, "strip", z.ZodTypeAny, {
|
|
6942
|
-
observedAt: string;
|
|
6943
6942
|
items: {
|
|
6944
6943
|
status: {
|
|
6945
6944
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -6980,6 +6979,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
6980
6979
|
rating?: string | undefined;
|
|
6981
6980
|
avgSpend?: string | undefined;
|
|
6982
6981
|
}[];
|
|
6982
|
+
observedAt: string;
|
|
6983
6983
|
summary?: string | undefined;
|
|
6984
6984
|
noResultsReason?: string | undefined;
|
|
6985
6985
|
categoryTabs?: {
|
|
@@ -6987,7 +6987,6 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
6987
6987
|
name: string;
|
|
6988
6988
|
}[] | undefined;
|
|
6989
6989
|
}, {
|
|
6990
|
-
observedAt: string;
|
|
6991
6990
|
items: {
|
|
6992
6991
|
status: {
|
|
6993
6992
|
code: "enabled" | "unknown" | "disabled";
|
|
@@ -7028,6 +7027,7 @@ export declare const shoppingGuideCardDataSchemas: {
|
|
|
7028
7027
|
rating?: string | undefined;
|
|
7029
7028
|
avgSpend?: string | undefined;
|
|
7030
7029
|
}[];
|
|
7030
|
+
observedAt: string;
|
|
7031
7031
|
summary?: string | undefined;
|
|
7032
7032
|
noResultsReason?: string | undefined;
|
|
7033
7033
|
categoryTabs?: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 个人奖品域卡片数据契约(任务07——本人奖品列表/详情两张稳定卡型)。
|
|
3
|
+
* 与活动域「单一 cardType + mode」形态区分:奖品按 api.md 卡片表为两张独立卡型
|
|
4
|
+
*(列表含 itemActions 标准动作 / 详情平铺),传输层不共用 mode。
|
|
5
|
+
*
|
|
6
|
+
* 分层纪律:HTTP 业务 DTO 只含奖品事实(domain 单源,条目数跟随供应商返回不加展示上限);
|
|
7
|
+
* itemActions、noResultsReason、truncated 是卡片适配层补充字段,仅出现在本卡片契约面
|
|
8
|
+
* ——不回写 DTO、不透传厂商原始 JSON。列表动作沿既有 actionDraftSchema(shared/cards
|
|
9
|
+
* 单源)的 send 形态:value 携带准确中奖记录标识、visibleValue 可用可读名称;信封字段
|
|
10
|
+
* 由 SDK 卡片框架承载,不在本契约。
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { actionDraftSchema } from '../shared/cards';
|
|
14
|
+
import {
|
|
15
|
+
activityPlayPrizeDetailSchema,
|
|
16
|
+
activityPlayPrizeRecordSchema,
|
|
17
|
+
} from '../domain/activity-play-prize';
|
|
18
|
+
|
|
19
|
+
/** 本人奖品列表卡型(列表查询工具出卡) */
|
|
20
|
+
export const ACTIVITY_PLAY_PRIZE_LIST_CARD_TYPE = 'activity-play-prize-list';
|
|
21
|
+
/** 本人奖品详情卡型(详情查询工具出卡) */
|
|
22
|
+
export const ACTIVITY_PLAY_PRIZE_DETAIL_CARD_TYPE = 'activity-play-prize-detail';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 列表卡片展示条目上限(契约单源):schema items.max 与模块出卡适配共用同此值——
|
|
26
|
+
* 超出由适配层截断展示(total 仍为供应商真实值 + truncated 标记),两侧不得各写一个数。
|
|
27
|
+
*/
|
|
28
|
+
export const ACTIVITY_PLAY_PRIZE_CARD_MAX_ITEMS = 50;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 列表卡片条目(奖品记录 DTO + 出卡适配层补充的标准动作)。
|
|
32
|
+
* itemActions 至多 4 项;适配层恒只产出 send 单一 kind(前端经 SDK sendMessage 发起
|
|
33
|
+
* 详情查询——不新增动作协议),schema 沿 actionDraftSchema 单源(判别联合天然拒未知 kind)。
|
|
34
|
+
*/
|
|
35
|
+
export const activityPlayPrizeCardItemSchema = activityPlayPrizeRecordSchema
|
|
36
|
+
.extend({
|
|
37
|
+
itemActions: z.array(actionDraftSchema).max(4).optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export type ActivityPlayPrizeCardItem = z.infer<typeof activityPlayPrizeCardItemSchema>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 本人奖品列表卡片 data(成功空态 = total 0 + 空 items,可附 noResultsReason;
|
|
44
|
+
* 查询失败不产生本卡型——失败走错误路径,不伪装「未中奖」)。
|
|
45
|
+
*/
|
|
46
|
+
export const activityPlayPrizeListCardDataSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
/** 商圈标识:来自当前执行上下文 scope(非模型输入/硬编码) */
|
|
49
|
+
mallId: z.string().min(1),
|
|
50
|
+
/** 供应商真实总数(≠ items.length——items 为展示面,至多 ACTIVITY_PLAY_PRIZE_CARD_MAX_ITEMS 条) */
|
|
51
|
+
total: z.number().int().min(0),
|
|
52
|
+
items: z.array(activityPlayPrizeCardItemSchema).max(ACTIVITY_PLAY_PRIZE_CARD_MAX_ITEMS),
|
|
53
|
+
noResultsReason: z.string().min(1).max(120).optional(),
|
|
54
|
+
/** 展示截断标记:items 超出 50 条展示上限被截断时为 true(total 仍为真实值——展示范围 ≠ 记录范围) */
|
|
55
|
+
truncated: z.boolean().optional(),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
export type ActivityPlayPrizeListCardData = z.infer<typeof activityPlayPrizeListCardDataSchema>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 本人奖品详情卡片 data(平铺:{mallId, ...PrizeDetail}——不套 mode/items 或额外
|
|
62
|
+
* prize 包装对象)。prizeUrl 仅为指引事实字段(不据此增加按钮、自动请求或导航)。
|
|
63
|
+
*/
|
|
64
|
+
export const activityPlayPrizeDetailCardDataSchema = activityPlayPrizeDetailSchema
|
|
65
|
+
.extend({
|
|
66
|
+
mallId: z.string().min(1),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export type ActivityPlayPrizeDetailCardData = z.infer<typeof activityPlayPrizeDetailCardDataSchema>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 活动玩法·个人奖品域模型(任务07——供应商返回的本人中奖记录 DTO + 字段级校验单源)。
|
|
3
|
+
* 语义独立于营销券/权益域:本域只描述「外部供应商提供的本人奖品事实」,不承诺领取核销、
|
|
4
|
+
* 本地奖品库、同步任务或结果推送(一期均不建)。
|
|
5
|
+
*
|
|
6
|
+
* 字段口径(api.md「本人奖品查询」唯一字段清单):
|
|
7
|
+
* - prizeRecordRef/title 必填;记录标识按供应商原字符串定位(同名奖品的不同中奖记录
|
|
8
|
+
* 可区分;'001'/'1.20'/'1e3' 等标识不做数字或 JSON 预解析);
|
|
9
|
+
* - activityId/activityTitle 仅为供应商提供的来源事实(缺失不编造、不以活动列表补齐,
|
|
10
|
+
* 也不是本地登记或查询前置);
|
|
11
|
+
* - prizeType/claimStatus/useStatus 经适配层明确映射产生,未知或缺失兜底 UNKNOWN;
|
|
12
|
+
* - 可选字段缺席归一为缺省(不编造值);必填字段或响应结构非法须上层显性失败,
|
|
13
|
+
* 不得丢弃坏记录后声称用户未中奖;
|
|
14
|
+
* - 图片/时间校验与活动域共用单源 schema(HTTPS / 含时区真实日历时刻)。
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { activityPlayImageUrlSchema, activityPlayTimeSchema } from './activity-play';
|
|
18
|
+
|
|
19
|
+
// ===== 状态桶(未知兜底——已知枚举闭集待琥珀确认后收紧) =====
|
|
20
|
+
|
|
21
|
+
/** 未知状态兜底桶(固定值——适配层映射产物,未确认来源不得编造具体状态) */
|
|
22
|
+
export const ACTIVITY_PLAY_PRIZE_STATUS_UNKNOWN = 'UNKNOWN' as const;
|
|
23
|
+
|
|
24
|
+
/** 状态桶标签(映射后的供应商状态——已知集确认前为 string 面) */
|
|
25
|
+
export type ActivityPlayPrizeStatusTag = string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 状态标签归一(契约单源):raw 命中 known 集 → 原样通过;其余(缺失/null/未知字符串/
|
|
29
|
+
* 非字符串)→ UNKNOWN。只用于归一第三方原始状态值;接口示例不构成供应商已支持证据,
|
|
30
|
+
* known 集以琥珀确认的映射表为准(协议核验页)。
|
|
31
|
+
*/
|
|
32
|
+
export function toActivityPlayPrizeStatusTag(
|
|
33
|
+
raw: unknown,
|
|
34
|
+
known: readonly string[],
|
|
35
|
+
): ActivityPlayPrizeStatusTag {
|
|
36
|
+
return typeof raw === 'string' && known.includes(raw) ? raw : ACTIVITY_PLAY_PRIZE_STATUS_UNKNOWN;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ===== 字段级 schema(供给出口/HTTP/卡片三面共用——与活动域同款纪律) =====
|
|
40
|
+
|
|
41
|
+
/** 中奖记录标识:非空白 ≤128 的原字符串(不数字化/不按名称或活动 ID 推算;空白串显性拒绝) */
|
|
42
|
+
export const activityPlayPrizeRecordRefSchema = z
|
|
43
|
+
.string()
|
|
44
|
+
.max(128)
|
|
45
|
+
.refine((v) => v.trim().length > 0, { message: '记录标识不得为空白' });
|
|
46
|
+
/** 奖品名称:非空 ≤64 */
|
|
47
|
+
export const activityPlayPrizeTitleSchema = z.string().min(1).max(64);
|
|
48
|
+
/** 来源活动标识(供应商提供的事实——不是本系统登记键):非空 ≤128 原字符串 */
|
|
49
|
+
export const activityPlayPrizeActivityIdSchema = z.string().min(1).max(128);
|
|
50
|
+
/** 来源活动名称:非空 ≤64 */
|
|
51
|
+
export const activityPlayPrizeActivityTitleSchema = z.string().min(1).max(64);
|
|
52
|
+
/** 状态桶标签(prizeType/claimStatus/useStatus 共用):非空 ≤32 */
|
|
53
|
+
export const activityPlayPrizeStatusTagSchema = z.string().min(1).max(32);
|
|
54
|
+
/** 使用规则:普通文本 ≤500 */
|
|
55
|
+
export const activityPlayPrizeUsageRuleTextSchema = z.string().min(1).max(500);
|
|
56
|
+
/** 领取方式(详情):非空 ≤64 */
|
|
57
|
+
export const activityPlayPrizeRedemptionMethodSchema = z.string().min(1).max(64);
|
|
58
|
+
/** 领取说明(详情):普通文本 ≤500 */
|
|
59
|
+
export const activityPlayPrizeRedemptionInstructionSchema = z.string().min(1).max(500);
|
|
60
|
+
/** 外部领取指引:有效 URL 且恒 HTTPS(事实字段——不作为插件地址、不据此增加按钮) */
|
|
61
|
+
export const activityPlayPrizeUrlSchema = z.string().url().startsWith('https://');
|
|
62
|
+
|
|
63
|
+
/** 奖品记录基础面(列表项与详情共用同源字段集;strict 拒未知键) */
|
|
64
|
+
export const activityPlayPrizeRecordSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
prizeRecordRef: activityPlayPrizeRecordRefSchema,
|
|
67
|
+
title: activityPlayPrizeTitleSchema,
|
|
68
|
+
/** 奖品类型标签(映射后——未知为 UNKNOWN) */
|
|
69
|
+
prizeType: activityPlayPrizeStatusTagSchema,
|
|
70
|
+
/** 领取状态标签(映射后——未知/缺失为 UNKNOWN) */
|
|
71
|
+
claimStatus: activityPlayPrizeStatusTagSchema,
|
|
72
|
+
/** 使用状态标签(映射后——未知/缺失为 UNKNOWN) */
|
|
73
|
+
useStatus: activityPlayPrizeStatusTagSchema,
|
|
74
|
+
activityId: activityPlayPrizeActivityIdSchema.optional(),
|
|
75
|
+
activityTitle: activityPlayPrizeActivityTitleSchema.optional(),
|
|
76
|
+
imageUrl: activityPlayImageUrlSchema.optional(),
|
|
77
|
+
/** 中奖时间(含时区 ISO 真实日历时刻——缺失不编造) */
|
|
78
|
+
wonAt: activityPlayTimeSchema.optional(),
|
|
79
|
+
usageRuleText: activityPlayPrizeUsageRuleTextSchema.optional(),
|
|
80
|
+
})
|
|
81
|
+
.strict();
|
|
82
|
+
|
|
83
|
+
/** 奖品详情(记录基础面 + 领取方式/说明与外部指引;strict 拒未知键) */
|
|
84
|
+
export const activityPlayPrizeDetailSchema = activityPlayPrizeRecordSchema
|
|
85
|
+
.extend({
|
|
86
|
+
redemptionMethod: activityPlayPrizeRedemptionMethodSchema.optional(),
|
|
87
|
+
redemptionInstruction: activityPlayPrizeRedemptionInstructionSchema.optional(),
|
|
88
|
+
prizeUrl: activityPlayPrizeUrlSchema.optional(),
|
|
89
|
+
})
|
|
90
|
+
.strict();
|
|
91
|
+
|
|
92
|
+
/** 列表结果(total 非负整数——实际统计/翻页覆盖范围按供应商实调记录,不冒称全量历史) */
|
|
93
|
+
export const activityPlayPrizeListResultSchema = z
|
|
94
|
+
.object({
|
|
95
|
+
total: z.number().int().min(0),
|
|
96
|
+
items: z.array(activityPlayPrizeRecordSchema),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
|
|
100
|
+
/** 奖品记录(列表条目形态) */
|
|
101
|
+
export type ActivityPlayPrizeRecord = z.infer<typeof activityPlayPrizeRecordSchema>;
|
|
102
|
+
/** 奖品详情(详情返回形态) */
|
|
103
|
+
export type ActivityPlayPrizeDetail = z.infer<typeof activityPlayPrizeDetailSchema>;
|
|
104
|
+
/** 列表结果(HTTP data 面——无 itemActions/noResultsReason,出卡适配层补充) */
|
|
105
|
+
export type ActivityPlayPrizeListResult = z.infer<typeof activityPlayPrizeListResultSchema>;
|
package/src/index.ts
CHANGED
|
@@ -13,11 +13,13 @@ export * from './domain/entitlement';
|
|
|
13
13
|
export * from './domain/activity';
|
|
14
14
|
export * from './domain/operation';
|
|
15
15
|
export * from './domain/activity-play';
|
|
16
|
+
export * from './domain/activity-play-prize';
|
|
16
17
|
export * from './services/member';
|
|
17
18
|
export * from './services/parking';
|
|
18
19
|
export * from './services/promotion';
|
|
19
20
|
export * from './services/mall-info';
|
|
20
21
|
export * from './services/activity-play';
|
|
22
|
+
export * from './services/activity-play-prize';
|
|
21
23
|
export * from './events';
|
|
22
24
|
export * from './scope';
|
|
23
25
|
export * from './query-context';
|
|
@@ -34,4 +36,5 @@ export * from './member/cards';
|
|
|
34
36
|
export * from './promotion/cards';
|
|
35
37
|
export * from './parking/cards';
|
|
36
38
|
export * from './activity-play/cards';
|
|
39
|
+
export * from './activity-play-prize/cards';
|
|
37
40
|
export * from './alipay-activity/cards';
|
package/src/runtime.ts
CHANGED
|
@@ -36,6 +36,7 @@ export {
|
|
|
36
36
|
} from './services/shopping-guide';
|
|
37
37
|
export { MALL_INFO_SERVICE } from './services/mall-info';
|
|
38
38
|
export { ACTIVITY_PLAY_QUERY_SERVICE, ACTIVITY_PLAY_ENTRY_SERVICE } from './services/activity-play';
|
|
39
|
+
export { ACTIVITY_PLAY_PRIZES_SERVICE } from './services/activity-play-prize';
|
|
39
40
|
export {
|
|
40
41
|
ACTIVITY_PLAY_ENTRY_PROTOCOL_VERSION,
|
|
41
42
|
ACTIVITY_PLAY_TARGET_KIND,
|
|
@@ -52,10 +53,27 @@ export {
|
|
|
52
53
|
activityPlayImageUrlSchema,
|
|
53
54
|
activityPlayStatusOf,
|
|
54
55
|
} from './domain/activity-play';
|
|
56
|
+
export {
|
|
57
|
+
ACTIVITY_PLAY_PRIZE_STATUS_UNKNOWN,
|
|
58
|
+
activityPlayPrizeRecordRefSchema,
|
|
59
|
+
activityPlayPrizeTitleSchema,
|
|
60
|
+
activityPlayPrizeActivityIdSchema,
|
|
61
|
+
activityPlayPrizeActivityTitleSchema,
|
|
62
|
+
activityPlayPrizeStatusTagSchema,
|
|
63
|
+
activityPlayPrizeUsageRuleTextSchema,
|
|
64
|
+
activityPlayPrizeRedemptionMethodSchema,
|
|
65
|
+
activityPlayPrizeRedemptionInstructionSchema,
|
|
66
|
+
activityPlayPrizeUrlSchema,
|
|
67
|
+
activityPlayPrizeRecordSchema,
|
|
68
|
+
activityPlayPrizeDetailSchema,
|
|
69
|
+
activityPlayPrizeListResultSchema,
|
|
70
|
+
toActivityPlayPrizeStatusTag,
|
|
71
|
+
} from './domain/activity-play-prize';
|
|
55
72
|
export { mallLocationSchema, parseMallLocation, mallUserRefSchema, parseMallUserRef } from './guard';
|
|
56
73
|
export * from './shopping-guide/cards';
|
|
57
74
|
export * from './member/cards';
|
|
58
75
|
export * from './promotion/cards';
|
|
59
76
|
export * from './parking/cards';
|
|
60
77
|
export * from './activity-play/cards';
|
|
78
|
+
export * from './activity-play-prize/cards';
|
|
61
79
|
export * from './shared/cards';
|