@tbox.cn/app-module-promotion 0.1.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.
Files changed (67) hide show
  1. package/AGENTS.md +16 -0
  2. package/README.md +90 -11
  3. package/dist/chunk-P7IEEV37.js +1347 -0
  4. package/dist/chunk-QOTX4XDS.js +1745 -0
  5. package/dist/client/index.d.ts +21 -3
  6. package/dist/client/index.js +4 -2
  7. package/dist/index.d.ts +4 -3
  8. package/dist/index.js +16 -4
  9. package/dist/promotion-CMKJ4DB3.css +2135 -0
  10. package/dist/promotion-activity-header-pea-v2-4CCHFCCM.jpg +0 -0
  11. package/dist/promotion-coupon-header-pea-v1-4CCHFCCM.jpg +0 -0
  12. package/dist/server/index.d.ts +2481 -41
  13. package/dist/server/index.js +13 -3
  14. package/package.json +28 -15
  15. package/skills/promotion/SKILL.md +137 -0
  16. package/skills/promotion/references/claim-loop.md +18 -0
  17. package/src/client/assets/promotion-activity-header-pea-v2.jpg +0 -0
  18. package/src/client/assets/promotion-coupon-header-pea-v1.jpg +0 -0
  19. package/src/client/assets.d.ts +5 -0
  20. package/src/client/cards/index.ts +10 -0
  21. package/src/client/cards/promotion-activity-category-list/index.tsx +34 -0
  22. package/src/client/cards/promotion-activity-detail/index.tsx +84 -0
  23. package/src/client/cards/promotion-activity-list/index.tsx +58 -0
  24. package/src/client/cards/promotion-best-deal/index.tsx +18 -0
  25. package/src/client/cards/promotion-entitlement-list/index.tsx +163 -0
  26. package/src/client/cards/promotion-offer-detail/index.tsx +116 -0
  27. package/src/client/cards/promotion-offer-list/index.tsx +285 -0
  28. package/src/client/cards/view.ts +72 -0
  29. package/src/client/components/CouponQrCode.tsx +48 -0
  30. package/src/client/components/CouponSheet.tsx +124 -0
  31. package/src/client/components/ImageWithFallback.tsx +39 -0
  32. package/src/client/index.ts +23 -4
  33. package/src/client/styles/promotion.css +2135 -0
  34. package/src/client/types/css.d.ts +2 -0
  35. package/src/client/utils/sanitize-activity-html.ts +48 -0
  36. package/src/client/utils/scroll-card-bottom.ts +40 -0
  37. package/src/server/actions.ts +217 -0
  38. package/src/server/cards/index.ts +19 -0
  39. package/src/server/cards/promotion-activity-category-list/meta.ts +13 -0
  40. package/src/server/cards/promotion-activity-detail/meta.ts +29 -0
  41. package/src/server/cards/promotion-activity-list/meta.ts +13 -0
  42. package/src/server/cards/promotion-best-deal/meta.ts +20 -0
  43. package/src/server/cards/promotion-entitlement-list/meta.ts +17 -0
  44. package/src/server/cards/promotion-entitlement-list/samples.ts +51 -0
  45. package/src/server/cards/promotion-offer-detail/meta.ts +25 -0
  46. package/src/server/cards/promotion-offer-list/meta.ts +20 -0
  47. package/src/server/cards/promotion-offer-list/samples.ts +154 -0
  48. package/src/server/handler.ts +378 -16
  49. package/src/server/index.ts +117 -22
  50. package/src/server/navigation.ts +23 -0
  51. package/src/server/ports.ts +56 -0
  52. package/src/server/service.ts +243 -24
  53. package/src/server/tools.ts +789 -0
  54. package/tbox.module.json +126 -0
  55. package/tests/cards-render.test.tsx +656 -0
  56. package/tests/ports-resolve.test.ts +96 -0
  57. package/tests/pretool-coupons.test.ts +63 -0
  58. package/tests/promotion.test.ts +976 -0
  59. package/tests/samples.test.ts +42 -0
  60. package/tests/view.test.ts +61 -0
  61. package/tsup.config.ts +9 -1
  62. package/dist/chunk-AD6OLHSM.js +0 -86
  63. package/dist/chunk-LQGF6337.js +0 -32
  64. package/src/client/cards/coupon/index.tsx +0 -12
  65. package/src/server/cards/coupon/meta.ts +0 -23
  66. package/tbox.component.json +0 -20
  67. package/tests/service.test.ts +0 -31
@@ -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
+ }