@tbox.cn/app-module-member 0.2.0 → 0.8.6

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 (65) hide show
  1. package/AGENTS.md +16 -0
  2. package/README.md +99 -11
  3. package/dist/chunk-KEBILLQ5.js +771 -0
  4. package/dist/chunk-T4SYPQA5.js +1565 -0
  5. package/dist/client/index.d.ts +2 -2
  6. package/dist/client/index.js +1 -1
  7. package/dist/index.d.ts +2 -3
  8. package/dist/index.js +12 -2
  9. package/dist/login-mascot-5D4X6YZ7.jpg +0 -0
  10. package/dist/member-QFCIYILN.css +1734 -0
  11. package/dist/server/index.d.ts +617 -246
  12. package/dist/server/index.js +11 -1
  13. package/package.json +25 -16
  14. package/skills/member/SKILL.md +141 -0
  15. package/skills/member/references/enrollment.md +34 -0
  16. package/skills/member/references/points-and-card.md +24 -0
  17. package/src/client/assets/login-mascot.jpg +0 -0
  18. package/src/client/assets.d.ts +5 -0
  19. package/src/client/cards/index.ts +10 -0
  20. package/src/client/cards/member-card-summary/index.tsx +375 -0
  21. package/src/client/cards/member-enrollment-cta/index.tsx +61 -0
  22. package/src/client/cards/member-enrollment-form/index.tsx +181 -0
  23. package/src/client/cards/member-enrollment-status/index.tsx +65 -0
  24. package/src/client/cards/member-info/index.tsx +60 -0
  25. package/src/client/cards/member-login-cta/index.tsx +81 -0
  26. package/src/client/cards/member-point-usage-list/index.tsx +53 -0
  27. package/src/client/cards/view.ts +39 -0
  28. package/src/client/components/ImageWithFallback.tsx +38 -0
  29. package/src/client/index.ts +6 -4
  30. package/src/client/styles/member.css +1734 -0
  31. package/src/client/types/css.d.ts +2 -0
  32. package/src/server/action.ts +348 -0
  33. package/src/server/cards/index.ts +7 -7
  34. package/src/server/cards/member-card-summary/meta.ts +26 -5
  35. package/src/server/cards/member-card-summary/samples.ts +272 -0
  36. package/src/server/cards/member-enrollment-cta/meta.ts +19 -0
  37. package/src/server/cards/member-enrollment-form/meta.ts +10 -6
  38. package/src/server/cards/member-enrollment-status/meta.ts +5 -6
  39. package/src/server/cards/member-info/meta.ts +1 -1
  40. package/src/server/cards/member-login-cta/meta.ts +16 -0
  41. package/src/server/cards/member-point-usage-list/meta.ts +2 -3
  42. package/src/server/handler.ts +159 -119
  43. package/src/server/index.ts +109 -50
  44. package/src/server/ports.ts +66 -0
  45. package/src/server/service.ts +94 -80
  46. package/src/server/status.ts +87 -0
  47. package/src/server/subject-binding.ts +19 -0
  48. package/src/server/tool.ts +469 -99
  49. package/tbox.module.json +124 -0
  50. package/tests/cards-render.test.tsx +526 -0
  51. package/tests/enrollment.test.ts +121 -0
  52. package/tests/ports-resolve.test.ts +95 -0
  53. package/tests/preference-memory.test.ts +86 -0
  54. package/tests/samples.test.ts +61 -0
  55. package/tests/service.test.ts +593 -35
  56. package/tests/skills.test.ts +65 -0
  57. package/tests/status.test.ts +127 -0
  58. package/tests/view.test.ts +33 -0
  59. package/tsup.config.ts +9 -1
  60. package/dist/chunk-JGZGLFO6.js +0 -111
  61. package/dist/chunk-ZV6B36AO.js +0 -613
  62. package/src/client/cards/index.tsx +0 -135
  63. package/src/server/cards/member-coupon-detail/meta.ts +0 -19
  64. package/src/server/cards/member-coupon-list/meta.ts +0 -18
  65. package/tbox.component.json +0 -28
@@ -1,29 +1,40 @@
1
- import * as _mastra_core_tools from '@mastra/core/tools';
1
+ import * as _tbox_cn_app_sdk_server from '@tbox.cn/app-sdk/server';
2
+ import { ServerContext } from '@tbox.cn/app-sdk/server';
2
3
  import * as _tbox_cn_app_contracts from '@tbox.cn/app-contracts';
4
+ import { RequestContext } from '@tbox.cn/app-contracts';
3
5
  import * as zod from 'zod';
4
- import { PreToolDef, ServerContext } from '@tbox.cn/app-sdk/server';
5
- import { MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberCouponPort, MemberEnrollmentPort, MemberAccountSnapshot, MemberProfileSnapshot, MemberCardSnapshot, Points, MemberBenefitsSnapshot, PointUsageRecord, DiscountRule, MemberCouponSnapshot } from '@tbox.cn/app-contracts-mall';
6
+ import { MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberEnrollmentPort, MemberAccountSnapshot, MemberProfileSnapshot, MemberCardSnapshot, Points, MemberBenefitsSnapshot, MemberEnrollmentFormDefinition, PointUsageRecord, DiscountRule, MemberEnrollmentInput, MemberEnrollmentResult, MemberEnrollmentStatus } from '@tbox.cn/app-contracts-mall';
6
7
 
7
8
  /**
8
- * MemberService:商圈会员完整实现(011 K2:6 Port 全量)。
9
+ * MemberService:商圈会员完整实现(011 K2 Port + 015 入会升级)。
9
10
  * extends 契约 Port(保证满足消费方子集约束);完整接口只在本模块包内。
10
11
  */
11
- interface MemberService extends MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberCouponPort, MemberEnrollmentPort {
12
- /** 积分变动记录(单测/观测用) */
13
- audit: {
14
- action: string;
15
- userId: string;
16
- amount: number;
17
- key?: string;
18
- }[];
12
+ /**
13
+ * InMemory 演示实现(仅供隔离单测;运行时注册与 Provider 解析不得使用)。
14
+ * 017 槽位原子化后非 Port 成员归位:getEnrollmentFormDefinition 已收编
15
+ * MemberEnrollmentPort optional 方法(R13);enrollUrl/loginUrl 为槽产物自由属性
16
+ * (enrollment/account 槽的类型视图见 ports.ts);audit 转 InMemory 私有观测成员。
17
+ */
18
+ interface MemberService extends MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberEnrollmentPort {
19
+ /** 入会落地页深链(alipays:// 或 H5 链接),从 deployment provider config 注入;空串表示未配置。 */
20
+ readonly enrollUrl: string;
21
+ /**
22
+ * 登录页深链,同样从 deployment provider config 注入。
23
+ * 可选而非必填——真实 provider 接入前不该被迫实现;缺省时登录引导退回文本。
24
+ */
25
+ readonly loginUrl?: string;
19
26
  }
20
- /** 内存实现(PoC;真实数据源 = joycity-membership provider 接入点,二期) */
27
+
28
+ /** 仅供隔离单测使用的 fixture;运行时注册与 Provider 解析不得使用。 */
21
29
  declare class InMemoryMemberService implements MemberService {
30
+ readonly enrollUrl: string;
22
31
  private balances;
23
- private levels;
24
32
  private idempotentKeys;
25
33
  private usages;
26
34
  private profiles;
35
+ private enrollmentAttempts;
36
+ private pendingConfirmations;
37
+ private statusQueries;
27
38
  audit: {
28
39
  action: string;
29
40
  userId: string;
@@ -36,6 +47,7 @@ declare class InMemoryMemberService implements MemberService {
36
47
  getCard(userId: string): Promise<MemberCardSnapshot | null>;
37
48
  queryPoints(userId: string): Promise<Points>;
38
49
  getBenefits(userId: string): Promise<MemberBenefitsSnapshot>;
50
+ getEnrollmentFormDefinition(): Promise<MemberEnrollmentFormDefinition>;
39
51
  listPointUsage(userId: string, page: number, pageSize: number): Promise<{
40
52
  items: ReadonlyArray<PointUsageRecord>;
41
53
  total: number;
@@ -44,40 +56,44 @@ declare class InMemoryMemberService implements MemberService {
44
56
  deductPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
45
57
  refundPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
46
58
  awardPoints(userId: string, amount: number): Promise<boolean>;
47
- listCoupons(userId: string, page: number, pageSize: number): Promise<{
48
- items: ReadonlyArray<MemberCouponSnapshot>;
49
- total: number;
50
- }>;
51
- getCoupon(_userId: string, _couponRef: string): Promise<MemberCouponSnapshot | null>;
52
- enroll(input: {
53
- userId: string;
54
- name?: string;
55
- phone?: string;
56
- }): Promise<{
57
- success: boolean;
59
+ enroll(input: MemberEnrollmentInput): Promise<MemberEnrollmentResult>;
60
+ getEnrollmentStatus(userId: string, attemptRef: string): Promise<{
61
+ status: MemberEnrollmentStatus;
58
62
  memberRef?: string;
59
- error?: string;
63
+ reason?: string;
60
64
  }>;
61
- completeAuthorization(input: {
62
- userId: string;
63
- scopes: readonly string[];
64
- }): Promise<{
65
- success: boolean;
66
- }>;
67
- private levelOf;
68
- private maybeUpgrade;
69
- private levelChangeListeners;
70
- onLevelChange(fn: (e: {
71
- userId: string;
72
- newLevel: 'silver' | 'gold' | 'platinum';
73
- }) => void): void;
74
65
  }
75
66
 
67
+ /**
68
+ * member Port 分槽解析(017 槽位原子化):五槽独立解析(account/profile/card/
69
+ * benefits/enrollment),无运行时 InMemory 兜底(InMemoryMemberService 仅限隔离单测)。
70
+ * 解析失败一律上抛:未配置/禁用等预期缺席错误码由 registry 抛出,调用方按业务文案转译
71
+ * (status fail-soft / 工具层文案兜底)。
72
+ *
73
+ * 非 Port 成员归位:loginUrl 挂 account 槽产物、enrollUrl 挂 enrollment 槽产物
74
+ * (厂商 fat 实现运行期携带;契约 Port 不含——返回类型上的可选属性扩展即类型视图)。
75
+ */
76
+
77
+ /** account 槽产物类型视图:Port + 厂商实例携带的登录深链(可选) */
78
+ type MemberAccountService = MemberAccountPort & {
79
+ readonly loginUrl?: string;
80
+ };
81
+ /** enrollment 槽产物类型视图:Port + 厂商实例携带的入会深链(可选) */
82
+ type MemberEnrollmentService = MemberEnrollmentPort & {
83
+ readonly enrollUrl?: string;
84
+ };
85
+ declare function resolveMemberAccountPort(reqCtx: RequestContext, ctx: ServerContext): Promise<MemberAccountService>;
86
+ declare function resolveMemberProfilePort(reqCtx: RequestContext, ctx: ServerContext): Promise<MemberProfilePort>;
87
+ declare function resolveMemberCardPort(reqCtx: RequestContext, ctx: ServerContext): Promise<MemberCardPort>;
88
+ declare function resolveMemberBenefitsPort(reqCtx: RequestContext, ctx: ServerContext): Promise<MemberBenefitsPort>;
89
+ declare function resolveMemberEnrollmentPort(reqCtx: RequestContext, ctx: ServerContext): Promise<MemberEnrollmentService>;
90
+
76
91
  /** 7 卡 meta map(key 约定 = cardType) */
77
92
  declare const memberCards: {
78
93
  readonly 'member-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
79
94
  userId: zod.ZodString;
80
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
95
+ authState: zod.ZodEnum<["authenticated", "unauthenticated"]>;
96
+ state: zod.ZodEnum<["unknown", "active", "not_enrolled", "closed"]>;
81
97
  displayName: zod.ZodOptional<zod.ZodString>;
82
98
  avatarUrl: zod.ZodOptional<zod.ZodString>;
83
99
  contactDisplay: zod.ZodOptional<zod.ZodString>;
@@ -95,7 +111,8 @@ declare const memberCards: {
95
111
  }>, "many">;
96
112
  }, "strip", zod.ZodTypeAny, {
97
113
  userId: string;
98
- state: "active" | "not_enrolled" | "closed";
114
+ state: "unknown" | "active" | "not_enrolled" | "closed";
115
+ authState: "authenticated" | "unauthenticated";
99
116
  labels: {
100
117
  name: string;
101
118
  labelRef: string;
@@ -107,7 +124,8 @@ declare const memberCards: {
107
124
  registeredAt?: string | undefined;
108
125
  }, {
109
126
  userId: string;
110
- state: "active" | "not_enrolled" | "closed";
127
+ state: "unknown" | "active" | "not_enrolled" | "closed";
128
+ authState: "authenticated" | "unauthenticated";
111
129
  labels: {
112
130
  name: string;
113
131
  labelRef: string;
@@ -126,100 +144,168 @@ declare const memberCards: {
126
144
  levelName: zod.ZodOptional<zod.ZodString>;
127
145
  availablePoints: zod.ZodNumber;
128
146
  cardImageUrl: zod.ZodOptional<zod.ZodString>;
147
+ pointsRuleImageUrl: zod.ZodOptional<zod.ZodString>;
148
+ pointsRuleContent: zod.ZodOptional<zod.ZodString>;
149
+ pointsUrl: zod.ZodOptional<zod.ZodString>;
150
+ presentation: zod.ZodOptional<zod.ZodObject<{
151
+ variant: zod.ZodEnum<["blue", "silver", "gold", "black"]>;
152
+ labelsEmbedded: zod.ZodOptional<zod.ZodBoolean>;
153
+ }, "strip", zod.ZodTypeAny, {
154
+ variant: "silver" | "gold" | "blue" | "black";
155
+ labelsEmbedded?: boolean | undefined;
156
+ }, {
157
+ variant: "silver" | "gold" | "blue" | "black";
158
+ labelsEmbedded?: boolean | undefined;
159
+ }>>;
160
+ progress: zod.ZodOptional<zod.ZodObject<{
161
+ daySpentCents: zod.ZodNumber;
162
+ yearSpentCents: zod.ZodNumber;
163
+ percent: zod.ZodNumber;
164
+ message: zod.ZodString;
165
+ }, "strip", zod.ZodTypeAny, {
166
+ message: string;
167
+ daySpentCents: number;
168
+ yearSpentCents: number;
169
+ percent: number;
170
+ }, {
171
+ message: string;
172
+ daySpentCents: number;
173
+ yearSpentCents: number;
174
+ percent: number;
175
+ }>>;
176
+ benefits: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
177
+ benefitRef: zod.ZodString;
178
+ name: zod.ZodString;
179
+ iconUrl: zod.ZodOptional<zod.ZodString>;
180
+ description: zod.ZodOptional<zod.ZodString>;
181
+ action: zod.ZodOptional<zod.ZodObject<{
182
+ kind: zod.ZodEnum<["miniapp", "dialog", "toast"]>;
183
+ url: zod.ZodOptional<zod.ZodString>;
184
+ title: zod.ZodOptional<zod.ZodString>;
185
+ text: zod.ZodOptional<zod.ZodString>;
186
+ }, "strip", zod.ZodTypeAny, {
187
+ kind: "toast" | "miniapp" | "dialog";
188
+ url?: string | undefined;
189
+ text?: string | undefined;
190
+ title?: string | undefined;
191
+ }, {
192
+ kind: "toast" | "miniapp" | "dialog";
193
+ url?: string | undefined;
194
+ text?: string | undefined;
195
+ title?: string | undefined;
196
+ }>>;
197
+ }, "strip", zod.ZodTypeAny, {
198
+ name: string;
199
+ benefitRef: string;
200
+ description?: string | undefined;
201
+ action?: {
202
+ kind: "toast" | "miniapp" | "dialog";
203
+ url?: string | undefined;
204
+ text?: string | undefined;
205
+ title?: string | undefined;
206
+ } | undefined;
207
+ iconUrl?: string | undefined;
208
+ }, {
209
+ name: string;
210
+ benefitRef: string;
211
+ description?: string | undefined;
212
+ action?: {
213
+ kind: "toast" | "miniapp" | "dialog";
214
+ url?: string | undefined;
215
+ text?: string | undefined;
216
+ title?: string | undefined;
217
+ } | undefined;
218
+ iconUrl?: string | undefined;
219
+ }>, "many">>;
220
+ preferencePrompts: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
221
+ value: zod.ZodEnum<["我常来买衣服", "我常带娃来玩", "我常来吃美食"]>;
222
+ query: zod.ZodString;
223
+ }, "strip", zod.ZodTypeAny, {
224
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
225
+ query: string;
226
+ }, {
227
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
228
+ query: string;
229
+ }>, "many">>;
129
230
  }, "strip", zod.ZodTypeAny, {
130
231
  status: "unknown" | "active" | "inactive" | "frozen" | "expired";
131
232
  userId: string;
132
233
  cardRef: string;
133
234
  cardDisplay: string;
134
235
  availablePoints: number;
236
+ presentation?: {
237
+ variant: "silver" | "gold" | "blue" | "black";
238
+ labelsEmbedded?: boolean | undefined;
239
+ } | undefined;
135
240
  levelName?: string | undefined;
136
241
  cardImageUrl?: string | undefined;
242
+ pointsRuleImageUrl?: string | undefined;
243
+ pointsRuleContent?: string | undefined;
244
+ pointsUrl?: string | undefined;
245
+ progress?: {
246
+ message: string;
247
+ daySpentCents: number;
248
+ yearSpentCents: number;
249
+ percent: number;
250
+ } | undefined;
251
+ benefits?: {
252
+ name: string;
253
+ benefitRef: string;
254
+ description?: string | undefined;
255
+ action?: {
256
+ kind: "toast" | "miniapp" | "dialog";
257
+ url?: string | undefined;
258
+ text?: string | undefined;
259
+ title?: string | undefined;
260
+ } | undefined;
261
+ iconUrl?: string | undefined;
262
+ }[] | undefined;
263
+ preferencePrompts?: {
264
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
265
+ query: string;
266
+ }[] | undefined;
137
267
  }, {
138
268
  status: "unknown" | "active" | "inactive" | "frozen" | "expired";
139
269
  userId: string;
140
270
  cardRef: string;
141
271
  cardDisplay: string;
142
272
  availablePoints: number;
273
+ presentation?: {
274
+ variant: "silver" | "gold" | "blue" | "black";
275
+ labelsEmbedded?: boolean | undefined;
276
+ } | undefined;
143
277
  levelName?: string | undefined;
144
278
  cardImageUrl?: string | undefined;
145
- }>>;
146
- readonly 'member-coupon-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
147
- userId: zod.ZodString;
148
- items: zod.ZodArray<zod.ZodObject<{
149
- couponRef: zod.ZodString;
150
- title: zod.ZodString;
151
- type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
152
- status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
153
- benefitText: zod.ZodOptional<zod.ZodString>;
154
- thresholdText: zod.ZodOptional<zod.ZodString>;
155
- }, "strip", zod.ZodTypeAny, {
156
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
157
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
158
- title: string;
159
- couponRef: string;
160
- benefitText?: string | undefined;
161
- thresholdText?: string | undefined;
162
- }, {
163
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
164
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
165
- title: string;
166
- couponRef: string;
167
- benefitText?: string | undefined;
168
- thresholdText?: string | undefined;
169
- }>, "many">;
170
- total: zod.ZodNumber;
171
- }, "strip", zod.ZodTypeAny, {
172
- userId: string;
173
- total: number;
174
- items: {
175
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
176
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
177
- title: string;
178
- couponRef: string;
179
- benefitText?: string | undefined;
180
- thresholdText?: string | undefined;
181
- }[];
182
- }, {
183
- userId: string;
184
- total: number;
185
- items: {
186
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
187
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
188
- title: string;
189
- couponRef: string;
190
- benefitText?: string | undefined;
191
- thresholdText?: string | undefined;
192
- }[];
193
- }>>;
194
- readonly 'member-coupon-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
195
- couponRef: zod.ZodString;
196
- title: zod.ZodString;
197
- type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
198
- status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
199
- description: zod.ZodOptional<zod.ZodString>;
200
- benefitText: zod.ZodOptional<zod.ZodString>;
201
- thresholdText: zod.ZodOptional<zod.ZodString>;
202
- }, "strip", zod.ZodTypeAny, {
203
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
204
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
205
- title: string;
206
- couponRef: string;
207
- description?: string | undefined;
208
- benefitText?: string | undefined;
209
- thresholdText?: string | undefined;
210
- }, {
211
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
212
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
213
- title: string;
214
- couponRef: string;
215
- description?: string | undefined;
216
- benefitText?: string | undefined;
217
- thresholdText?: string | undefined;
279
+ pointsRuleImageUrl?: string | undefined;
280
+ pointsRuleContent?: string | undefined;
281
+ pointsUrl?: string | undefined;
282
+ progress?: {
283
+ message: string;
284
+ daySpentCents: number;
285
+ yearSpentCents: number;
286
+ percent: number;
287
+ } | undefined;
288
+ benefits?: {
289
+ name: string;
290
+ benefitRef: string;
291
+ description?: string | undefined;
292
+ action?: {
293
+ kind: "toast" | "miniapp" | "dialog";
294
+ url?: string | undefined;
295
+ text?: string | undefined;
296
+ title?: string | undefined;
297
+ } | undefined;
298
+ iconUrl?: string | undefined;
299
+ }[] | undefined;
300
+ preferencePrompts?: {
301
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
302
+ query: string;
303
+ }[] | undefined;
218
304
  }>>;
219
305
  readonly 'member-point-usage-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
220
306
  userId: zod.ZodString;
221
307
  balance: zod.ZodNumber;
222
- level: zod.ZodEnum<["silver", "gold", "platinum"]>;
308
+ membershipLabel: zod.ZodOptional<zod.ZodString>;
223
309
  items: zod.ZodArray<zod.ZodObject<{
224
310
  usageRecordRef: zod.ZodString;
225
311
  title: zod.ZodString;
@@ -227,15 +313,15 @@ declare const memberCards: {
227
313
  usedAt: zod.ZodOptional<zod.ZodString>;
228
314
  description: zod.ZodOptional<zod.ZodString>;
229
315
  }, "strip", zod.ZodTypeAny, {
230
- amount: string;
231
316
  title: string;
232
317
  usageRecordRef: string;
318
+ amount: string;
233
319
  description?: string | undefined;
234
320
  usedAt?: string | undefined;
235
321
  }, {
236
- amount: string;
237
322
  title: string;
238
323
  usageRecordRef: string;
324
+ amount: string;
239
325
  description?: string | undefined;
240
326
  usedAt?: string | undefined;
241
327
  }>, "many">;
@@ -244,94 +330,208 @@ declare const memberCards: {
244
330
  userId: string;
245
331
  total: number;
246
332
  items: {
247
- amount: string;
248
333
  title: string;
249
334
  usageRecordRef: string;
335
+ amount: string;
250
336
  description?: string | undefined;
251
337
  usedAt?: string | undefined;
252
338
  }[];
253
339
  balance: number;
254
- level: "silver" | "gold" | "platinum";
340
+ membershipLabel?: string | undefined;
255
341
  }, {
256
342
  userId: string;
257
343
  total: number;
258
344
  items: {
259
- amount: string;
260
345
  title: string;
261
346
  usageRecordRef: string;
347
+ amount: string;
262
348
  description?: string | undefined;
263
349
  usedAt?: string | undefined;
264
350
  }[];
265
351
  balance: number;
266
- level: "silver" | "gold" | "platinum";
352
+ membershipLabel?: string | undefined;
267
353
  }>>;
268
354
  readonly 'member-enrollment-form': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
269
355
  userId: zod.ZodString;
270
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
356
+ state: zod.ZodEnum<["unknown", "active", "not_enrolled", "closed"]>;
357
+ formVersion: zod.ZodString;
271
358
  fields: zod.ZodArray<zod.ZodObject<{
272
359
  fieldId: zod.ZodString;
273
360
  label: zod.ZodString;
361
+ type: zod.ZodEnum<["text", "tel", "select", "date"]>;
274
362
  required: zod.ZodBoolean;
363
+ readOnly: zod.ZodOptional<zod.ZodBoolean>;
364
+ prefill: zod.ZodOptional<zod.ZodString>;
365
+ placeholder: zod.ZodOptional<zod.ZodString>;
366
+ options: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
275
367
  }, "strip", zod.ZodTypeAny, {
368
+ type: "date" | "text" | "tel" | "select";
276
369
  required: boolean;
277
370
  label: string;
278
371
  fieldId: string;
372
+ options?: string[] | undefined;
373
+ readOnly?: boolean | undefined;
374
+ prefill?: string | undefined;
375
+ placeholder?: string | undefined;
279
376
  }, {
377
+ type: "date" | "text" | "tel" | "select";
280
378
  required: boolean;
281
379
  label: string;
282
380
  fieldId: string;
381
+ options?: string[] | undefined;
382
+ readOnly?: boolean | undefined;
383
+ prefill?: string | undefined;
384
+ placeholder?: string | undefined;
385
+ }>, "many">;
386
+ consents: zod.ZodArray<zod.ZodObject<{
387
+ consentId: zod.ZodString;
388
+ version: zod.ZodString;
389
+ title: zod.ZodString;
390
+ required: zod.ZodBoolean;
391
+ url: zod.ZodOptional<zod.ZodString>;
392
+ }, "strip", zod.ZodTypeAny, {
393
+ required: boolean;
394
+ version: string;
395
+ title: string;
396
+ consentId: string;
397
+ url?: string | undefined;
398
+ }, {
399
+ required: boolean;
400
+ version: string;
401
+ title: string;
402
+ consentId: string;
403
+ url?: string | undefined;
283
404
  }>, "many">;
284
- actionId: zod.ZodString;
405
+ authorization: zod.ZodObject<{
406
+ status: zod.ZodEnum<["required", "authorized", "unavailable"]>;
407
+ mobileMasked: zod.ZodOptional<zod.ZodString>;
408
+ }, "strip", zod.ZodTypeAny, {
409
+ status: "required" | "unavailable" | "authorized";
410
+ mobileMasked?: string | undefined;
411
+ }, {
412
+ status: "required" | "unavailable" | "authorized";
413
+ mobileMasked?: string | undefined;
414
+ }>;
415
+ manualNotice: zod.ZodOptional<zod.ZodString>;
285
416
  }, "strip", zod.ZodTypeAny, {
286
417
  userId: string;
287
- actionId: string;
288
- state: "active" | "not_enrolled" | "closed";
418
+ authorization: {
419
+ status: "required" | "unavailable" | "authorized";
420
+ mobileMasked?: string | undefined;
421
+ };
422
+ state: "unknown" | "active" | "not_enrolled" | "closed";
423
+ formVersion: string;
289
424
  fields: {
425
+ type: "date" | "text" | "tel" | "select";
290
426
  required: boolean;
291
427
  label: string;
292
428
  fieldId: string;
429
+ options?: string[] | undefined;
430
+ readOnly?: boolean | undefined;
431
+ prefill?: string | undefined;
432
+ placeholder?: string | undefined;
433
+ }[];
434
+ consents: {
435
+ required: boolean;
436
+ version: string;
437
+ title: string;
438
+ consentId: string;
439
+ url?: string | undefined;
293
440
  }[];
441
+ manualNotice?: string | undefined;
294
442
  }, {
295
443
  userId: string;
296
- actionId: string;
297
- state: "active" | "not_enrolled" | "closed";
444
+ authorization: {
445
+ status: "required" | "unavailable" | "authorized";
446
+ mobileMasked?: string | undefined;
447
+ };
448
+ state: "unknown" | "active" | "not_enrolled" | "closed";
449
+ formVersion: string;
298
450
  fields: {
451
+ type: "date" | "text" | "tel" | "select";
299
452
  required: boolean;
300
453
  label: string;
301
454
  fieldId: string;
455
+ options?: string[] | undefined;
456
+ readOnly?: boolean | undefined;
457
+ prefill?: string | undefined;
458
+ placeholder?: string | undefined;
459
+ }[];
460
+ consents: {
461
+ required: boolean;
462
+ version: string;
463
+ title: string;
464
+ consentId: string;
465
+ url?: string | undefined;
302
466
  }[];
467
+ manualNotice?: string | undefined;
303
468
  }>>;
304
469
  readonly 'member-enrollment-status': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
305
470
  userId: zod.ZodString;
306
- success: zod.ZodBoolean;
471
+ attemptRef: zod.ZodOptional<zod.ZodString>;
472
+ state: zod.ZodEnum<["pending_confirmation", "confirmation_timeout", "active", "failed"]>;
307
473
  memberRef: zod.ZodOptional<zod.ZodString>;
308
474
  message: zod.ZodOptional<zod.ZodString>;
309
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
310
475
  }, "strip", zod.ZodTypeAny, {
311
- success: boolean;
312
476
  userId: string;
313
- state: "active" | "not_enrolled" | "closed";
477
+ state: "failed" | "active" | "pending_confirmation" | "confirmation_timeout";
314
478
  message?: string | undefined;
315
479
  memberRef?: string | undefined;
480
+ attemptRef?: string | undefined;
316
481
  }, {
317
- success: boolean;
318
482
  userId: string;
319
- state: "active" | "not_enrolled" | "closed";
483
+ state: "failed" | "active" | "pending_confirmation" | "confirmation_timeout";
320
484
  message?: string | undefined;
321
485
  memberRef?: string | undefined;
486
+ attemptRef?: string | undefined;
487
+ }>>;
488
+ readonly 'member-enrollment-cta': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
489
+ userId: zod.ZodString;
490
+ authState: zod.ZodLiteral<"authenticated">;
491
+ state: zod.ZodEnum<["not_enrolled", "closed"]>;
492
+ enrollUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
493
+ title: zod.ZodOptional<zod.ZodString>;
494
+ subtitle: zod.ZodOptional<zod.ZodString>;
495
+ perks: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
496
+ }, "strip", zod.ZodTypeAny, {
497
+ userId: string;
498
+ state: "not_enrolled" | "closed";
499
+ authState: "authenticated";
500
+ title?: string | undefined;
501
+ subtitle?: string | undefined;
502
+ enrollUrl?: string | undefined;
503
+ perks?: string[] | undefined;
504
+ }, {
505
+ userId: string;
506
+ state: "not_enrolled" | "closed";
507
+ authState: "authenticated";
508
+ title?: string | undefined;
509
+ subtitle?: string | undefined;
510
+ enrollUrl?: string | undefined;
511
+ perks?: string[] | undefined;
512
+ }>>;
513
+ readonly 'member-login-cta': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
514
+ loginUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
515
+ title: zod.ZodOptional<zod.ZodString>;
516
+ }, "strip", zod.ZodTypeAny, {
517
+ title?: string | undefined;
518
+ loginUrl?: string | undefined;
519
+ }, {
520
+ title?: string | undefined;
521
+ loginUrl?: string | undefined;
322
522
  }>>;
323
523
  };
324
524
 
325
525
  /** 模块注册入口:自注册闭环(与客户端 clientModule 对称) */
326
526
  declare const serverModule: {
327
527
  declaration: {
328
- componentId: string;
329
- features: string[];
528
+ moduleId: string;
330
529
  };
331
530
  cards: {
332
531
  readonly 'member-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
333
532
  userId: zod.ZodString;
334
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
533
+ authState: zod.ZodEnum<["authenticated", "unauthenticated"]>;
534
+ state: zod.ZodEnum<["unknown", "active", "not_enrolled", "closed"]>;
335
535
  displayName: zod.ZodOptional<zod.ZodString>;
336
536
  avatarUrl: zod.ZodOptional<zod.ZodString>;
337
537
  contactDisplay: zod.ZodOptional<zod.ZodString>;
@@ -349,7 +549,8 @@ declare const serverModule: {
349
549
  }>, "many">;
350
550
  }, "strip", zod.ZodTypeAny, {
351
551
  userId: string;
352
- state: "active" | "not_enrolled" | "closed";
552
+ state: "unknown" | "active" | "not_enrolled" | "closed";
553
+ authState: "authenticated" | "unauthenticated";
353
554
  labels: {
354
555
  name: string;
355
556
  labelRef: string;
@@ -361,7 +562,8 @@ declare const serverModule: {
361
562
  registeredAt?: string | undefined;
362
563
  }, {
363
564
  userId: string;
364
- state: "active" | "not_enrolled" | "closed";
565
+ state: "unknown" | "active" | "not_enrolled" | "closed";
566
+ authState: "authenticated" | "unauthenticated";
365
567
  labels: {
366
568
  name: string;
367
569
  labelRef: string;
@@ -380,100 +582,168 @@ declare const serverModule: {
380
582
  levelName: zod.ZodOptional<zod.ZodString>;
381
583
  availablePoints: zod.ZodNumber;
382
584
  cardImageUrl: zod.ZodOptional<zod.ZodString>;
585
+ pointsRuleImageUrl: zod.ZodOptional<zod.ZodString>;
586
+ pointsRuleContent: zod.ZodOptional<zod.ZodString>;
587
+ pointsUrl: zod.ZodOptional<zod.ZodString>;
588
+ presentation: zod.ZodOptional<zod.ZodObject<{
589
+ variant: zod.ZodEnum<["blue", "silver", "gold", "black"]>;
590
+ labelsEmbedded: zod.ZodOptional<zod.ZodBoolean>;
591
+ }, "strip", zod.ZodTypeAny, {
592
+ variant: "silver" | "gold" | "blue" | "black";
593
+ labelsEmbedded?: boolean | undefined;
594
+ }, {
595
+ variant: "silver" | "gold" | "blue" | "black";
596
+ labelsEmbedded?: boolean | undefined;
597
+ }>>;
598
+ progress: zod.ZodOptional<zod.ZodObject<{
599
+ daySpentCents: zod.ZodNumber;
600
+ yearSpentCents: zod.ZodNumber;
601
+ percent: zod.ZodNumber;
602
+ message: zod.ZodString;
603
+ }, "strip", zod.ZodTypeAny, {
604
+ message: string;
605
+ daySpentCents: number;
606
+ yearSpentCents: number;
607
+ percent: number;
608
+ }, {
609
+ message: string;
610
+ daySpentCents: number;
611
+ yearSpentCents: number;
612
+ percent: number;
613
+ }>>;
614
+ benefits: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
615
+ benefitRef: zod.ZodString;
616
+ name: zod.ZodString;
617
+ iconUrl: zod.ZodOptional<zod.ZodString>;
618
+ description: zod.ZodOptional<zod.ZodString>;
619
+ action: zod.ZodOptional<zod.ZodObject<{
620
+ kind: zod.ZodEnum<["miniapp", "dialog", "toast"]>;
621
+ url: zod.ZodOptional<zod.ZodString>;
622
+ title: zod.ZodOptional<zod.ZodString>;
623
+ text: zod.ZodOptional<zod.ZodString>;
624
+ }, "strip", zod.ZodTypeAny, {
625
+ kind: "toast" | "miniapp" | "dialog";
626
+ url?: string | undefined;
627
+ text?: string | undefined;
628
+ title?: string | undefined;
629
+ }, {
630
+ kind: "toast" | "miniapp" | "dialog";
631
+ url?: string | undefined;
632
+ text?: string | undefined;
633
+ title?: string | undefined;
634
+ }>>;
635
+ }, "strip", zod.ZodTypeAny, {
636
+ name: string;
637
+ benefitRef: string;
638
+ description?: string | undefined;
639
+ action?: {
640
+ kind: "toast" | "miniapp" | "dialog";
641
+ url?: string | undefined;
642
+ text?: string | undefined;
643
+ title?: string | undefined;
644
+ } | undefined;
645
+ iconUrl?: string | undefined;
646
+ }, {
647
+ name: string;
648
+ benefitRef: string;
649
+ description?: string | undefined;
650
+ action?: {
651
+ kind: "toast" | "miniapp" | "dialog";
652
+ url?: string | undefined;
653
+ text?: string | undefined;
654
+ title?: string | undefined;
655
+ } | undefined;
656
+ iconUrl?: string | undefined;
657
+ }>, "many">>;
658
+ preferencePrompts: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
659
+ value: zod.ZodEnum<["我常来买衣服", "我常带娃来玩", "我常来吃美食"]>;
660
+ query: zod.ZodString;
661
+ }, "strip", zod.ZodTypeAny, {
662
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
663
+ query: string;
664
+ }, {
665
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
666
+ query: string;
667
+ }>, "many">>;
383
668
  }, "strip", zod.ZodTypeAny, {
384
669
  status: "unknown" | "active" | "inactive" | "frozen" | "expired";
385
670
  userId: string;
386
671
  cardRef: string;
387
672
  cardDisplay: string;
388
673
  availablePoints: number;
674
+ presentation?: {
675
+ variant: "silver" | "gold" | "blue" | "black";
676
+ labelsEmbedded?: boolean | undefined;
677
+ } | undefined;
389
678
  levelName?: string | undefined;
390
679
  cardImageUrl?: string | undefined;
680
+ pointsRuleImageUrl?: string | undefined;
681
+ pointsRuleContent?: string | undefined;
682
+ pointsUrl?: string | undefined;
683
+ progress?: {
684
+ message: string;
685
+ daySpentCents: number;
686
+ yearSpentCents: number;
687
+ percent: number;
688
+ } | undefined;
689
+ benefits?: {
690
+ name: string;
691
+ benefitRef: string;
692
+ description?: string | undefined;
693
+ action?: {
694
+ kind: "toast" | "miniapp" | "dialog";
695
+ url?: string | undefined;
696
+ text?: string | undefined;
697
+ title?: string | undefined;
698
+ } | undefined;
699
+ iconUrl?: string | undefined;
700
+ }[] | undefined;
701
+ preferencePrompts?: {
702
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
703
+ query: string;
704
+ }[] | undefined;
391
705
  }, {
392
706
  status: "unknown" | "active" | "inactive" | "frozen" | "expired";
393
707
  userId: string;
394
708
  cardRef: string;
395
709
  cardDisplay: string;
396
710
  availablePoints: number;
711
+ presentation?: {
712
+ variant: "silver" | "gold" | "blue" | "black";
713
+ labelsEmbedded?: boolean | undefined;
714
+ } | undefined;
397
715
  levelName?: string | undefined;
398
716
  cardImageUrl?: string | undefined;
399
- }>>;
400
- readonly 'member-coupon-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
401
- userId: zod.ZodString;
402
- items: zod.ZodArray<zod.ZodObject<{
403
- couponRef: zod.ZodString;
404
- title: zod.ZodString;
405
- type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
406
- status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
407
- benefitText: zod.ZodOptional<zod.ZodString>;
408
- thresholdText: zod.ZodOptional<zod.ZodString>;
409
- }, "strip", zod.ZodTypeAny, {
410
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
411
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
412
- title: string;
413
- couponRef: string;
414
- benefitText?: string | undefined;
415
- thresholdText?: string | undefined;
416
- }, {
417
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
418
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
419
- title: string;
420
- couponRef: string;
421
- benefitText?: string | undefined;
422
- thresholdText?: string | undefined;
423
- }>, "many">;
424
- total: zod.ZodNumber;
425
- }, "strip", zod.ZodTypeAny, {
426
- userId: string;
427
- total: number;
428
- items: {
429
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
430
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
431
- title: string;
432
- couponRef: string;
433
- benefitText?: string | undefined;
434
- thresholdText?: string | undefined;
435
- }[];
436
- }, {
437
- userId: string;
438
- total: number;
439
- items: {
440
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
441
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
442
- title: string;
443
- couponRef: string;
444
- benefitText?: string | undefined;
445
- thresholdText?: string | undefined;
446
- }[];
447
- }>>;
448
- readonly 'member-coupon-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
449
- couponRef: zod.ZodString;
450
- title: zod.ZodString;
451
- type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
452
- status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
453
- description: zod.ZodOptional<zod.ZodString>;
454
- benefitText: zod.ZodOptional<zod.ZodString>;
455
- thresholdText: zod.ZodOptional<zod.ZodString>;
456
- }, "strip", zod.ZodTypeAny, {
457
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
458
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
459
- title: string;
460
- couponRef: string;
461
- description?: string | undefined;
462
- benefitText?: string | undefined;
463
- thresholdText?: string | undefined;
464
- }, {
465
- type: "unknown" | "amount" | "discount" | "gift" | "parking";
466
- status: "unknown" | "expired" | "effective" | "used" | "invalid";
467
- title: string;
468
- couponRef: string;
469
- description?: string | undefined;
470
- benefitText?: string | undefined;
471
- thresholdText?: string | undefined;
717
+ pointsRuleImageUrl?: string | undefined;
718
+ pointsRuleContent?: string | undefined;
719
+ pointsUrl?: string | undefined;
720
+ progress?: {
721
+ message: string;
722
+ daySpentCents: number;
723
+ yearSpentCents: number;
724
+ percent: number;
725
+ } | undefined;
726
+ benefits?: {
727
+ name: string;
728
+ benefitRef: string;
729
+ description?: string | undefined;
730
+ action?: {
731
+ kind: "toast" | "miniapp" | "dialog";
732
+ url?: string | undefined;
733
+ text?: string | undefined;
734
+ title?: string | undefined;
735
+ } | undefined;
736
+ iconUrl?: string | undefined;
737
+ }[] | undefined;
738
+ preferencePrompts?: {
739
+ value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
740
+ query: string;
741
+ }[] | undefined;
472
742
  }>>;
473
743
  readonly 'member-point-usage-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
474
744
  userId: zod.ZodString;
475
745
  balance: zod.ZodNumber;
476
- level: zod.ZodEnum<["silver", "gold", "platinum"]>;
746
+ membershipLabel: zod.ZodOptional<zod.ZodString>;
477
747
  items: zod.ZodArray<zod.ZodObject<{
478
748
  usageRecordRef: zod.ZodString;
479
749
  title: zod.ZodString;
@@ -481,15 +751,15 @@ declare const serverModule: {
481
751
  usedAt: zod.ZodOptional<zod.ZodString>;
482
752
  description: zod.ZodOptional<zod.ZodString>;
483
753
  }, "strip", zod.ZodTypeAny, {
484
- amount: string;
485
754
  title: string;
486
755
  usageRecordRef: string;
756
+ amount: string;
487
757
  description?: string | undefined;
488
758
  usedAt?: string | undefined;
489
759
  }, {
490
- amount: string;
491
760
  title: string;
492
761
  usageRecordRef: string;
762
+ amount: string;
493
763
  description?: string | undefined;
494
764
  usedAt?: string | undefined;
495
765
  }>, "many">;
@@ -498,101 +768,202 @@ declare const serverModule: {
498
768
  userId: string;
499
769
  total: number;
500
770
  items: {
501
- amount: string;
502
771
  title: string;
503
772
  usageRecordRef: string;
773
+ amount: string;
504
774
  description?: string | undefined;
505
775
  usedAt?: string | undefined;
506
776
  }[];
507
777
  balance: number;
508
- level: "silver" | "gold" | "platinum";
778
+ membershipLabel?: string | undefined;
509
779
  }, {
510
780
  userId: string;
511
781
  total: number;
512
782
  items: {
513
- amount: string;
514
783
  title: string;
515
784
  usageRecordRef: string;
785
+ amount: string;
516
786
  description?: string | undefined;
517
787
  usedAt?: string | undefined;
518
788
  }[];
519
789
  balance: number;
520
- level: "silver" | "gold" | "platinum";
790
+ membershipLabel?: string | undefined;
521
791
  }>>;
522
792
  readonly 'member-enrollment-form': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
523
793
  userId: zod.ZodString;
524
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
794
+ state: zod.ZodEnum<["unknown", "active", "not_enrolled", "closed"]>;
795
+ formVersion: zod.ZodString;
525
796
  fields: zod.ZodArray<zod.ZodObject<{
526
797
  fieldId: zod.ZodString;
527
798
  label: zod.ZodString;
799
+ type: zod.ZodEnum<["text", "tel", "select", "date"]>;
528
800
  required: zod.ZodBoolean;
801
+ readOnly: zod.ZodOptional<zod.ZodBoolean>;
802
+ prefill: zod.ZodOptional<zod.ZodString>;
803
+ placeholder: zod.ZodOptional<zod.ZodString>;
804
+ options: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
529
805
  }, "strip", zod.ZodTypeAny, {
806
+ type: "date" | "text" | "tel" | "select";
530
807
  required: boolean;
531
808
  label: string;
532
809
  fieldId: string;
810
+ options?: string[] | undefined;
811
+ readOnly?: boolean | undefined;
812
+ prefill?: string | undefined;
813
+ placeholder?: string | undefined;
533
814
  }, {
815
+ type: "date" | "text" | "tel" | "select";
534
816
  required: boolean;
535
817
  label: string;
536
818
  fieldId: string;
819
+ options?: string[] | undefined;
820
+ readOnly?: boolean | undefined;
821
+ prefill?: string | undefined;
822
+ placeholder?: string | undefined;
823
+ }>, "many">;
824
+ consents: zod.ZodArray<zod.ZodObject<{
825
+ consentId: zod.ZodString;
826
+ version: zod.ZodString;
827
+ title: zod.ZodString;
828
+ required: zod.ZodBoolean;
829
+ url: zod.ZodOptional<zod.ZodString>;
830
+ }, "strip", zod.ZodTypeAny, {
831
+ required: boolean;
832
+ version: string;
833
+ title: string;
834
+ consentId: string;
835
+ url?: string | undefined;
836
+ }, {
837
+ required: boolean;
838
+ version: string;
839
+ title: string;
840
+ consentId: string;
841
+ url?: string | undefined;
537
842
  }>, "many">;
538
- actionId: zod.ZodString;
843
+ authorization: zod.ZodObject<{
844
+ status: zod.ZodEnum<["required", "authorized", "unavailable"]>;
845
+ mobileMasked: zod.ZodOptional<zod.ZodString>;
846
+ }, "strip", zod.ZodTypeAny, {
847
+ status: "required" | "unavailable" | "authorized";
848
+ mobileMasked?: string | undefined;
849
+ }, {
850
+ status: "required" | "unavailable" | "authorized";
851
+ mobileMasked?: string | undefined;
852
+ }>;
853
+ manualNotice: zod.ZodOptional<zod.ZodString>;
539
854
  }, "strip", zod.ZodTypeAny, {
540
855
  userId: string;
541
- actionId: string;
542
- state: "active" | "not_enrolled" | "closed";
856
+ authorization: {
857
+ status: "required" | "unavailable" | "authorized";
858
+ mobileMasked?: string | undefined;
859
+ };
860
+ state: "unknown" | "active" | "not_enrolled" | "closed";
861
+ formVersion: string;
543
862
  fields: {
863
+ type: "date" | "text" | "tel" | "select";
544
864
  required: boolean;
545
865
  label: string;
546
866
  fieldId: string;
867
+ options?: string[] | undefined;
868
+ readOnly?: boolean | undefined;
869
+ prefill?: string | undefined;
870
+ placeholder?: string | undefined;
871
+ }[];
872
+ consents: {
873
+ required: boolean;
874
+ version: string;
875
+ title: string;
876
+ consentId: string;
877
+ url?: string | undefined;
547
878
  }[];
879
+ manualNotice?: string | undefined;
548
880
  }, {
549
881
  userId: string;
550
- actionId: string;
551
- state: "active" | "not_enrolled" | "closed";
882
+ authorization: {
883
+ status: "required" | "unavailable" | "authorized";
884
+ mobileMasked?: string | undefined;
885
+ };
886
+ state: "unknown" | "active" | "not_enrolled" | "closed";
887
+ formVersion: string;
552
888
  fields: {
889
+ type: "date" | "text" | "tel" | "select";
553
890
  required: boolean;
554
891
  label: string;
555
892
  fieldId: string;
893
+ options?: string[] | undefined;
894
+ readOnly?: boolean | undefined;
895
+ prefill?: string | undefined;
896
+ placeholder?: string | undefined;
897
+ }[];
898
+ consents: {
899
+ required: boolean;
900
+ version: string;
901
+ title: string;
902
+ consentId: string;
903
+ url?: string | undefined;
556
904
  }[];
905
+ manualNotice?: string | undefined;
557
906
  }>>;
558
907
  readonly 'member-enrollment-status': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
559
908
  userId: zod.ZodString;
560
- success: zod.ZodBoolean;
909
+ attemptRef: zod.ZodOptional<zod.ZodString>;
910
+ state: zod.ZodEnum<["pending_confirmation", "confirmation_timeout", "active", "failed"]>;
561
911
  memberRef: zod.ZodOptional<zod.ZodString>;
562
912
  message: zod.ZodOptional<zod.ZodString>;
563
- state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
564
913
  }, "strip", zod.ZodTypeAny, {
565
- success: boolean;
566
914
  userId: string;
567
- state: "active" | "not_enrolled" | "closed";
915
+ state: "failed" | "active" | "pending_confirmation" | "confirmation_timeout";
568
916
  message?: string | undefined;
569
917
  memberRef?: string | undefined;
918
+ attemptRef?: string | undefined;
570
919
  }, {
571
- success: boolean;
572
920
  userId: string;
573
- state: "active" | "not_enrolled" | "closed";
921
+ state: "failed" | "active" | "pending_confirmation" | "confirmation_timeout";
574
922
  message?: string | undefined;
575
923
  memberRef?: string | undefined;
924
+ attemptRef?: string | undefined;
576
925
  }>>;
577
- };
578
- preTools: {
579
- queryPoints: PreToolDef<_mastra_core_tools.Tool<{
926
+ readonly 'member-enrollment-cta': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
927
+ userId: zod.ZodString;
928
+ authState: zod.ZodLiteral<"authenticated">;
929
+ state: zod.ZodEnum<["not_enrolled", "closed"]>;
930
+ enrollUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
931
+ title: zod.ZodOptional<zod.ZodString>;
932
+ subtitle: zod.ZodOptional<zod.ZodString>;
933
+ perks: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
934
+ }, "strip", zod.ZodTypeAny, {
580
935
  userId: string;
936
+ state: "not_enrolled" | "closed";
937
+ authState: "authenticated";
938
+ title?: string | undefined;
939
+ subtitle?: string | undefined;
940
+ enrollUrl?: string | undefined;
941
+ perks?: string[] | undefined;
581
942
  }, {
582
943
  userId: string;
583
- total: number;
584
- items: {
585
- amount: string;
586
- title: string;
587
- usageRecordRef: string;
588
- description?: string | undefined;
589
- usedAt?: string | undefined;
590
- }[];
591
- balance: number;
592
- level: "silver" | "gold" | "platinum";
593
- }, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "queryPoints", unknown>>;
944
+ state: "not_enrolled" | "closed";
945
+ authState: "authenticated";
946
+ title?: string | undefined;
947
+ subtitle?: string | undefined;
948
+ enrollUrl?: string | undefined;
949
+ perks?: string[] | undefined;
950
+ }>>;
951
+ readonly 'member-login-cta': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
952
+ loginUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
953
+ title: zod.ZodOptional<zod.ZodString>;
954
+ }, "strip", zod.ZodTypeAny, {
955
+ title?: string | undefined;
956
+ loginUrl?: string | undefined;
957
+ }, {
958
+ title?: string | undefined;
959
+ loginUrl?: string | undefined;
960
+ }>>;
961
+ };
962
+ preTools: {};
963
+ skills: {
964
+ [k: string]: _tbox_cn_app_sdk_server.LocalSkill;
594
965
  };
595
966
  register(ctx: ServerContext): void;
596
967
  };
597
968
 
598
- export { InMemoryMemberService, type MemberService, memberCards, serverModule };
969
+ export { InMemoryMemberService, type MemberAccountService, type MemberEnrollmentService, type MemberService, memberCards, resolveMemberAccountPort, resolveMemberBenefitsPort, resolveMemberCardPort, resolveMemberEnrollmentPort, resolveMemberProfilePort, serverModule };