@tbox.cn/app-module-promotion 0.2.0 → 0.9.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.
- package/AGENTS.md +16 -0
- package/README.md +90 -11
- package/dist/chunk-P7IEEV37.js +1347 -0
- package/dist/chunk-QOTX4XDS.js +1745 -0
- package/dist/client/index.d.ts +21 -3
- package/dist/client/index.js +4 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +16 -4
- package/dist/promotion-CMKJ4DB3.css +2135 -0
- package/dist/promotion-activity-header-pea-v2-4CCHFCCM.jpg +0 -0
- package/dist/promotion-coupon-header-pea-v1-4CCHFCCM.jpg +0 -0
- package/dist/server/index.d.ts +2481 -41
- package/dist/server/index.js +13 -3
- package/package.json +28 -15
- package/skills/promotion/SKILL.md +137 -0
- package/skills/promotion/references/claim-loop.md +18 -0
- package/src/client/assets/promotion-activity-header-pea-v2.jpg +0 -0
- package/src/client/assets/promotion-coupon-header-pea-v1.jpg +0 -0
- package/src/client/assets.d.ts +5 -0
- package/src/client/cards/index.ts +10 -0
- package/src/client/cards/promotion-activity-category-list/index.tsx +34 -0
- package/src/client/cards/promotion-activity-detail/index.tsx +84 -0
- package/src/client/cards/promotion-activity-list/index.tsx +58 -0
- package/src/client/cards/promotion-best-deal/index.tsx +18 -0
- package/src/client/cards/promotion-entitlement-list/index.tsx +163 -0
- package/src/client/cards/promotion-offer-detail/index.tsx +116 -0
- package/src/client/cards/promotion-offer-list/index.tsx +285 -0
- package/src/client/cards/view.ts +72 -0
- package/src/client/components/CouponQrCode.tsx +48 -0
- package/src/client/components/CouponSheet.tsx +124 -0
- package/src/client/components/ImageWithFallback.tsx +39 -0
- package/src/client/index.ts +23 -4
- package/src/client/styles/promotion.css +2135 -0
- package/src/client/types/css.d.ts +2 -0
- package/src/client/utils/sanitize-activity-html.ts +48 -0
- package/src/client/utils/scroll-card-bottom.ts +40 -0
- package/src/server/actions.ts +217 -0
- package/src/server/cards/index.ts +19 -0
- package/src/server/cards/promotion-activity-category-list/meta.ts +13 -0
- package/src/server/cards/promotion-activity-detail/meta.ts +29 -0
- package/src/server/cards/promotion-activity-list/meta.ts +13 -0
- package/src/server/cards/promotion-best-deal/meta.ts +20 -0
- package/src/server/cards/promotion-entitlement-list/meta.ts +17 -0
- package/src/server/cards/promotion-entitlement-list/samples.ts +51 -0
- package/src/server/cards/promotion-offer-detail/meta.ts +25 -0
- package/src/server/cards/promotion-offer-list/meta.ts +20 -0
- package/src/server/cards/promotion-offer-list/samples.ts +154 -0
- package/src/server/handler.ts +378 -16
- package/src/server/index.ts +117 -22
- package/src/server/navigation.ts +23 -0
- package/src/server/ports.ts +56 -0
- package/src/server/service.ts +243 -24
- package/src/server/tools.ts +789 -0
- package/tbox.module.json +126 -0
- package/tests/cards-render.test.tsx +656 -0
- package/tests/ports-resolve.test.ts +96 -0
- package/tests/pretool-coupons.test.ts +63 -0
- package/tests/promotion.test.ts +976 -0
- package/tests/samples.test.ts +42 -0
- package/tests/view.test.ts +61 -0
- package/tsup.config.ts +9 -1
- package/dist/chunk-AD6OLHSM.js +0 -86
- package/dist/chunk-LQGF6337.js +0 -32
- package/src/client/cards/coupon/index.tsx +0 -12
- package/src/server/cards/coupon/meta.ts +0 -23
- package/tbox.component.json +0 -20
- package/tests/service.test.ts +0 -31
package/tbox.module.json
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "module-promotion",
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"kind": "business",
|
|
6
|
+
"risk": {
|
|
7
|
+
"level": "low",
|
|
8
|
+
"writeBoundary": "source"
|
|
9
|
+
},
|
|
10
|
+
"distribution": {
|
|
11
|
+
"defaultMode": "codegen"
|
|
12
|
+
},
|
|
13
|
+
"contributes": {
|
|
14
|
+
"handlers": [
|
|
15
|
+
"promotion"
|
|
16
|
+
],
|
|
17
|
+
"tools": [
|
|
18
|
+
"listActivityCategories",
|
|
19
|
+
"listActivities",
|
|
20
|
+
"getActivityDetail",
|
|
21
|
+
"listActivitySessions",
|
|
22
|
+
"getActivityGuide",
|
|
23
|
+
"searchOffers",
|
|
24
|
+
"getOfferDetail",
|
|
25
|
+
"listEntitlements",
|
|
26
|
+
"listPromotions",
|
|
27
|
+
"getPromotionDetail",
|
|
28
|
+
"getParticipationGuide",
|
|
29
|
+
"listCoupons",
|
|
30
|
+
"getPackageDetail",
|
|
31
|
+
"recommendOffers",
|
|
32
|
+
"calculateBestDeal"
|
|
33
|
+
],
|
|
34
|
+
"cards": [
|
|
35
|
+
{
|
|
36
|
+
"cardType": "promotion-offer-list",
|
|
37
|
+
"schemaVersion": 1
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"cardType": "promotion-offer-detail",
|
|
41
|
+
"schemaVersion": 1
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"cardType": "promotion-entitlement-list",
|
|
45
|
+
"schemaVersion": 1
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"cardType": "promotion-activity-list",
|
|
49
|
+
"schemaVersion": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"cardType": "promotion-activity-detail",
|
|
53
|
+
"schemaVersion": 2
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"cardType": "promotion-activity-category-list",
|
|
57
|
+
"schemaVersion": 1
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"cardType": "promotion-best-deal",
|
|
61
|
+
"schemaVersion": 1
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"routes": [],
|
|
65
|
+
"pages": [],
|
|
66
|
+
"tabs": [],
|
|
67
|
+
"actions": [
|
|
68
|
+
"promotion.acquire",
|
|
69
|
+
"promotion.acquire-from-list"
|
|
70
|
+
],
|
|
71
|
+
"skills": [
|
|
72
|
+
"promotion"
|
|
73
|
+
],
|
|
74
|
+
"services": [
|
|
75
|
+
{
|
|
76
|
+
"service": "promotion.offers",
|
|
77
|
+
"optional": false,
|
|
78
|
+
"defaults": [
|
|
79
|
+
{
|
|
80
|
+
"provider": "mock",
|
|
81
|
+
"implementation": "mock-promotion@1"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"service": "promotion.entitlements",
|
|
87
|
+
"optional": false,
|
|
88
|
+
"defaults": [
|
|
89
|
+
{
|
|
90
|
+
"provider": "mock",
|
|
91
|
+
"implementation": "mock-promotion@1"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"service": "promotion.activities",
|
|
97
|
+
"optional": false,
|
|
98
|
+
"defaults": [
|
|
99
|
+
{
|
|
100
|
+
"provider": "mock",
|
|
101
|
+
"implementation": "mock-promotion@1"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"service": "promotion.acquisition",
|
|
107
|
+
"optional": false,
|
|
108
|
+
"defaults": [
|
|
109
|
+
{
|
|
110
|
+
"provider": "mock",
|
|
111
|
+
"implementation": "mock-promotion@1"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"dependencies": {
|
|
118
|
+
"modules": [
|
|
119
|
+
{
|
|
120
|
+
"id": "contracts-mall",
|
|
121
|
+
"required": true
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"env": []
|
|
126
|
+
}
|