@tbox.cn/app-module-member 0.2.0 → 0.8.7
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 +99 -11
- package/dist/chunk-EPQEF43P.js +1581 -0
- package/dist/chunk-QWGRWD5C.js +766 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +12 -2
- package/dist/member-372B74DY.css +1740 -0
- package/dist/server/index.d.ts +657 -286
- package/dist/server/index.js +11 -1
- package/package.json +25 -16
- package/skills/member/SKILL.md +141 -0
- package/skills/member/references/enrollment.md +34 -0
- package/skills/member/references/points-and-card.md +24 -0
- package/src/client/cards/index.ts +10 -0
- package/src/client/cards/member-card-summary/index.tsx +375 -0
- package/src/client/cards/member-enrollment-cta/index.tsx +61 -0
- package/src/client/cards/member-enrollment-form/index.tsx +181 -0
- package/src/client/cards/member-enrollment-status/index.tsx +65 -0
- package/src/client/cards/member-info/index.tsx +60 -0
- package/src/client/cards/member-login-cta/index.tsx +81 -0
- package/src/client/cards/member-point-usage-list/index.tsx +53 -0
- package/src/client/cards/view.ts +39 -0
- package/src/client/components/ImageWithFallback.tsx +38 -0
- package/src/client/index.ts +6 -4
- package/src/client/styles/member.css +1740 -0
- package/src/client/types/css.d.ts +2 -0
- package/src/server/action.ts +348 -0
- package/src/server/cards/index.ts +7 -7
- package/src/server/cards/member-card-summary/meta.ts +26 -5
- package/src/server/cards/member-card-summary/samples.ts +272 -0
- package/src/server/cards/member-enrollment-cta/meta.ts +19 -0
- package/src/server/cards/member-enrollment-form/meta.ts +10 -6
- package/src/server/cards/member-enrollment-status/meta.ts +5 -6
- package/src/server/cards/member-info/meta.ts +1 -1
- package/src/server/cards/member-login-cta/meta.ts +16 -0
- package/src/server/cards/member-point-usage-list/meta.ts +2 -3
- package/src/server/handler.ts +159 -119
- package/src/server/index.ts +129 -50
- package/src/server/ports.ts +66 -0
- package/src/server/service.ts +94 -80
- package/src/server/status.ts +87 -0
- package/src/server/subject-binding.ts +19 -0
- package/src/server/tool.ts +469 -99
- package/tbox.module.json +124 -0
- package/tests/cards-render.test.tsx +526 -0
- package/tests/enrollment.test.ts +121 -0
- package/tests/ports-resolve.test.ts +95 -0
- package/tests/preference-memory.test.ts +86 -0
- package/tests/samples.test.ts +61 -0
- package/tests/service.test.ts +593 -35
- package/tests/skills.test.ts +65 -0
- package/tests/snapshot-service.test.ts +75 -0
- package/tests/status.test.ts +127 -0
- package/tests/view.test.ts +33 -0
- package/tsup.config.ts +9 -1
- package/dist/chunk-JGZGLFO6.js +0 -111
- package/dist/chunk-ZV6B36AO.js +0 -613
- package/src/client/cards/index.tsx +0 -135
- package/src/server/cards/member-coupon-detail/meta.ts +0 -19
- package/src/server/cards/member-coupon-list/meta.ts +0 -18
- package/tbox.component.json +0 -28
package/dist/server/index.d.ts
CHANGED
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
import * as
|
|
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 {
|
|
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
|
|
9
|
+
* MemberService:商圈会员完整实现(011 K2 六 Port + 015 入会升级)。
|
|
9
10
|
* extends 契约 Port(保证满足消费方子集约束);完整接口只在本模块包内。
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
60
|
-
}>;
|
|
61
|
-
completeAuthorization(input: {
|
|
62
|
-
userId: string;
|
|
63
|
-
scopes: readonly string[];
|
|
64
|
-
}): Promise<{
|
|
65
|
-
success: boolean;
|
|
63
|
+
reason?: string;
|
|
66
64
|
}>;
|
|
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
|
-
|
|
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>;
|
|
@@ -87,18 +103,19 @@ declare const memberCards: {
|
|
|
87
103
|
labelRef: zod.ZodString;
|
|
88
104
|
name: zod.ZodString;
|
|
89
105
|
}, "strip", zod.ZodTypeAny, {
|
|
90
|
-
name: string;
|
|
91
106
|
labelRef: string;
|
|
92
|
-
}, {
|
|
93
107
|
name: string;
|
|
108
|
+
}, {
|
|
94
109
|
labelRef: string;
|
|
110
|
+
name: string;
|
|
95
111
|
}>, "many">;
|
|
96
112
|
}, "strip", zod.ZodTypeAny, {
|
|
97
113
|
userId: string;
|
|
98
|
-
|
|
114
|
+
authState: "authenticated" | "unauthenticated";
|
|
115
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
99
116
|
labels: {
|
|
100
|
-
name: string;
|
|
101
117
|
labelRef: string;
|
|
118
|
+
name: string;
|
|
102
119
|
}[];
|
|
103
120
|
displayName?: string | undefined;
|
|
104
121
|
avatarUrl?: string | undefined;
|
|
@@ -107,10 +124,11 @@ declare const memberCards: {
|
|
|
107
124
|
registeredAt?: string | undefined;
|
|
108
125
|
}, {
|
|
109
126
|
userId: string;
|
|
110
|
-
|
|
127
|
+
authState: "authenticated" | "unauthenticated";
|
|
128
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
111
129
|
labels: {
|
|
112
|
-
name: string;
|
|
113
130
|
labelRef: string;
|
|
131
|
+
name: string;
|
|
114
132
|
}[];
|
|
115
133
|
displayName?: string | undefined;
|
|
116
134
|
avatarUrl?: string | undefined;
|
|
@@ -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
|
+
title?: string | undefined;
|
|
189
|
+
url?: string | undefined;
|
|
190
|
+
text?: string | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
kind: "toast" | "miniapp" | "dialog";
|
|
193
|
+
title?: string | undefined;
|
|
194
|
+
url?: string | undefined;
|
|
195
|
+
text?: 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
|
+
title?: string | undefined;
|
|
204
|
+
url?: string | undefined;
|
|
205
|
+
text?: 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
|
+
title?: string | undefined;
|
|
215
|
+
url?: string | undefined;
|
|
216
|
+
text?: 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
|
-
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
131
231
|
userId: string;
|
|
232
|
+
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
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
|
+
title?: string | undefined;
|
|
258
|
+
url?: string | undefined;
|
|
259
|
+
text?: string | undefined;
|
|
260
|
+
} | undefined;
|
|
261
|
+
iconUrl?: string | undefined;
|
|
262
|
+
}[] | undefined;
|
|
263
|
+
preferencePrompts?: {
|
|
264
|
+
value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
|
|
265
|
+
query: string;
|
|
266
|
+
}[] | undefined;
|
|
137
267
|
}, {
|
|
138
|
-
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
139
268
|
userId: string;
|
|
269
|
+
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
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
|
+
title?: string | undefined;
|
|
295
|
+
url?: string | undefined;
|
|
296
|
+
text?: 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
|
-
|
|
308
|
+
membershipLabel: zod.ZodOptional<zod.ZodString>;
|
|
223
309
|
items: zod.ZodArray<zod.ZodObject<{
|
|
224
310
|
usageRecordRef: zod.ZodString;
|
|
225
311
|
title: zod.ZodString;
|
|
@@ -227,111 +313,225 @@ 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
|
-
title: string;
|
|
232
316
|
usageRecordRef: string;
|
|
233
|
-
|
|
317
|
+
title: string;
|
|
318
|
+
amount: string;
|
|
234
319
|
usedAt?: string | undefined;
|
|
320
|
+
description?: string | undefined;
|
|
235
321
|
}, {
|
|
236
|
-
amount: string;
|
|
237
|
-
title: string;
|
|
238
322
|
usageRecordRef: string;
|
|
239
|
-
|
|
323
|
+
title: string;
|
|
324
|
+
amount: string;
|
|
240
325
|
usedAt?: string | undefined;
|
|
326
|
+
description?: string | undefined;
|
|
241
327
|
}>, "many">;
|
|
242
328
|
total: zod.ZodNumber;
|
|
243
329
|
}, "strip", zod.ZodTypeAny, {
|
|
244
330
|
userId: string;
|
|
245
|
-
|
|
331
|
+
balance: number;
|
|
246
332
|
items: {
|
|
247
|
-
amount: string;
|
|
248
|
-
title: string;
|
|
249
333
|
usageRecordRef: string;
|
|
250
|
-
|
|
334
|
+
title: string;
|
|
335
|
+
amount: string;
|
|
251
336
|
usedAt?: string | undefined;
|
|
337
|
+
description?: string | undefined;
|
|
252
338
|
}[];
|
|
253
|
-
|
|
254
|
-
|
|
339
|
+
total: number;
|
|
340
|
+
membershipLabel?: string | undefined;
|
|
255
341
|
}, {
|
|
256
342
|
userId: string;
|
|
257
|
-
|
|
343
|
+
balance: number;
|
|
258
344
|
items: {
|
|
259
|
-
amount: string;
|
|
260
|
-
title: string;
|
|
261
345
|
usageRecordRef: string;
|
|
262
|
-
|
|
346
|
+
title: string;
|
|
347
|
+
amount: string;
|
|
263
348
|
usedAt?: string | undefined;
|
|
349
|
+
description?: string | undefined;
|
|
264
350
|
}[];
|
|
265
|
-
|
|
266
|
-
|
|
351
|
+
total: number;
|
|
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
|
+
title: string;
|
|
394
|
+
required: boolean;
|
|
395
|
+
version: string;
|
|
396
|
+
consentId: string;
|
|
397
|
+
url?: string | undefined;
|
|
398
|
+
}, {
|
|
399
|
+
title: string;
|
|
400
|
+
required: boolean;
|
|
401
|
+
version: string;
|
|
402
|
+
consentId: string;
|
|
403
|
+
url?: string | undefined;
|
|
283
404
|
}>, "many">;
|
|
284
|
-
|
|
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
|
-
|
|
288
|
-
|
|
418
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
419
|
+
authorization: {
|
|
420
|
+
status: "required" | "unavailable" | "authorized";
|
|
421
|
+
mobileMasked?: string | undefined;
|
|
422
|
+
};
|
|
289
423
|
fields: {
|
|
424
|
+
type: "date" | "text" | "tel" | "select";
|
|
290
425
|
required: boolean;
|
|
291
426
|
label: string;
|
|
292
427
|
fieldId: string;
|
|
428
|
+
options?: string[] | undefined;
|
|
429
|
+
readOnly?: boolean | undefined;
|
|
430
|
+
prefill?: string | undefined;
|
|
431
|
+
placeholder?: string | undefined;
|
|
293
432
|
}[];
|
|
433
|
+
formVersion: string;
|
|
434
|
+
consents: {
|
|
435
|
+
title: string;
|
|
436
|
+
required: boolean;
|
|
437
|
+
version: string;
|
|
438
|
+
consentId: string;
|
|
439
|
+
url?: string | undefined;
|
|
440
|
+
}[];
|
|
441
|
+
manualNotice?: string | undefined;
|
|
294
442
|
}, {
|
|
295
443
|
userId: string;
|
|
296
|
-
|
|
297
|
-
|
|
444
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
445
|
+
authorization: {
|
|
446
|
+
status: "required" | "unavailable" | "authorized";
|
|
447
|
+
mobileMasked?: string | undefined;
|
|
448
|
+
};
|
|
298
449
|
fields: {
|
|
450
|
+
type: "date" | "text" | "tel" | "select";
|
|
299
451
|
required: boolean;
|
|
300
452
|
label: string;
|
|
301
453
|
fieldId: string;
|
|
454
|
+
options?: string[] | undefined;
|
|
455
|
+
readOnly?: boolean | undefined;
|
|
456
|
+
prefill?: string | undefined;
|
|
457
|
+
placeholder?: string | undefined;
|
|
458
|
+
}[];
|
|
459
|
+
formVersion: string;
|
|
460
|
+
consents: {
|
|
461
|
+
title: string;
|
|
462
|
+
required: boolean;
|
|
463
|
+
version: 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
|
-
|
|
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" | "
|
|
314
|
-
message?: string | undefined;
|
|
477
|
+
state: "active" | "failed" | "pending_confirmation" | "confirmation_timeout";
|
|
315
478
|
memberRef?: string | undefined;
|
|
479
|
+
message?: string | undefined;
|
|
480
|
+
attemptRef?: string | undefined;
|
|
316
481
|
}, {
|
|
317
|
-
success: boolean;
|
|
318
482
|
userId: string;
|
|
319
|
-
state: "active" | "
|
|
320
|
-
message?: string | undefined;
|
|
483
|
+
state: "active" | "failed" | "pending_confirmation" | "confirmation_timeout";
|
|
321
484
|
memberRef?: string | undefined;
|
|
485
|
+
message?: 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
|
+
authState: "authenticated";
|
|
499
|
+
state: "not_enrolled" | "closed";
|
|
500
|
+
title?: string | undefined;
|
|
501
|
+
subtitle?: string | undefined;
|
|
502
|
+
enrollUrl?: string | undefined;
|
|
503
|
+
perks?: string[] | undefined;
|
|
504
|
+
}, {
|
|
505
|
+
userId: string;
|
|
506
|
+
authState: "authenticated";
|
|
507
|
+
state: "not_enrolled" | "closed";
|
|
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
|
-
|
|
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
|
-
|
|
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>;
|
|
@@ -341,18 +541,19 @@ declare const serverModule: {
|
|
|
341
541
|
labelRef: zod.ZodString;
|
|
342
542
|
name: zod.ZodString;
|
|
343
543
|
}, "strip", zod.ZodTypeAny, {
|
|
344
|
-
name: string;
|
|
345
544
|
labelRef: string;
|
|
346
|
-
}, {
|
|
347
545
|
name: string;
|
|
546
|
+
}, {
|
|
348
547
|
labelRef: string;
|
|
548
|
+
name: string;
|
|
349
549
|
}>, "many">;
|
|
350
550
|
}, "strip", zod.ZodTypeAny, {
|
|
351
551
|
userId: string;
|
|
352
|
-
|
|
552
|
+
authState: "authenticated" | "unauthenticated";
|
|
553
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
353
554
|
labels: {
|
|
354
|
-
name: string;
|
|
355
555
|
labelRef: string;
|
|
556
|
+
name: string;
|
|
356
557
|
}[];
|
|
357
558
|
displayName?: string | undefined;
|
|
358
559
|
avatarUrl?: string | undefined;
|
|
@@ -361,10 +562,11 @@ declare const serverModule: {
|
|
|
361
562
|
registeredAt?: string | undefined;
|
|
362
563
|
}, {
|
|
363
564
|
userId: string;
|
|
364
|
-
|
|
565
|
+
authState: "authenticated" | "unauthenticated";
|
|
566
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
365
567
|
labels: {
|
|
366
|
-
name: string;
|
|
367
568
|
labelRef: string;
|
|
569
|
+
name: string;
|
|
368
570
|
}[];
|
|
369
571
|
displayName?: string | undefined;
|
|
370
572
|
avatarUrl?: string | undefined;
|
|
@@ -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
|
+
title?: string | undefined;
|
|
627
|
+
url?: string | undefined;
|
|
628
|
+
text?: string | undefined;
|
|
629
|
+
}, {
|
|
630
|
+
kind: "toast" | "miniapp" | "dialog";
|
|
631
|
+
title?: string | undefined;
|
|
632
|
+
url?: string | undefined;
|
|
633
|
+
text?: 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
|
+
title?: string | undefined;
|
|
642
|
+
url?: string | undefined;
|
|
643
|
+
text?: 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
|
+
title?: string | undefined;
|
|
653
|
+
url?: string | undefined;
|
|
654
|
+
text?: 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
|
-
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
385
669
|
userId: string;
|
|
670
|
+
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
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
|
+
title?: string | undefined;
|
|
696
|
+
url?: string | undefined;
|
|
697
|
+
text?: string | undefined;
|
|
698
|
+
} | undefined;
|
|
699
|
+
iconUrl?: string | undefined;
|
|
700
|
+
}[] | undefined;
|
|
701
|
+
preferencePrompts?: {
|
|
702
|
+
value: "我常来买衣服" | "我常带娃来玩" | "我常来吃美食";
|
|
703
|
+
query: string;
|
|
704
|
+
}[] | undefined;
|
|
391
705
|
}, {
|
|
392
|
-
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
393
706
|
userId: string;
|
|
707
|
+
status: "unknown" | "active" | "inactive" | "frozen" | "expired";
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
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
|
+
title?: string | undefined;
|
|
733
|
+
url?: string | undefined;
|
|
734
|
+
text?: 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
|
-
|
|
746
|
+
membershipLabel: zod.ZodOptional<zod.ZodString>;
|
|
477
747
|
items: zod.ZodArray<zod.ZodObject<{
|
|
478
748
|
usageRecordRef: zod.ZodString;
|
|
479
749
|
title: zod.ZodString;
|
|
@@ -481,118 +751,219 @@ 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
|
-
title: string;
|
|
486
754
|
usageRecordRef: string;
|
|
487
|
-
|
|
755
|
+
title: string;
|
|
756
|
+
amount: string;
|
|
488
757
|
usedAt?: string | undefined;
|
|
758
|
+
description?: string | undefined;
|
|
489
759
|
}, {
|
|
490
|
-
amount: string;
|
|
491
|
-
title: string;
|
|
492
760
|
usageRecordRef: string;
|
|
493
|
-
|
|
761
|
+
title: string;
|
|
762
|
+
amount: string;
|
|
494
763
|
usedAt?: string | undefined;
|
|
764
|
+
description?: string | undefined;
|
|
495
765
|
}>, "many">;
|
|
496
766
|
total: zod.ZodNumber;
|
|
497
767
|
}, "strip", zod.ZodTypeAny, {
|
|
498
768
|
userId: string;
|
|
499
|
-
|
|
769
|
+
balance: number;
|
|
500
770
|
items: {
|
|
501
|
-
amount: string;
|
|
502
|
-
title: string;
|
|
503
771
|
usageRecordRef: string;
|
|
504
|
-
|
|
772
|
+
title: string;
|
|
773
|
+
amount: string;
|
|
505
774
|
usedAt?: string | undefined;
|
|
775
|
+
description?: string | undefined;
|
|
506
776
|
}[];
|
|
507
|
-
|
|
508
|
-
|
|
777
|
+
total: number;
|
|
778
|
+
membershipLabel?: string | undefined;
|
|
509
779
|
}, {
|
|
510
780
|
userId: string;
|
|
511
|
-
|
|
781
|
+
balance: number;
|
|
512
782
|
items: {
|
|
513
|
-
amount: string;
|
|
514
|
-
title: string;
|
|
515
783
|
usageRecordRef: string;
|
|
516
|
-
|
|
784
|
+
title: string;
|
|
785
|
+
amount: string;
|
|
517
786
|
usedAt?: string | undefined;
|
|
787
|
+
description?: string | undefined;
|
|
518
788
|
}[];
|
|
519
|
-
|
|
520
|
-
|
|
789
|
+
total: number;
|
|
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
|
+
title: string;
|
|
832
|
+
required: boolean;
|
|
833
|
+
version: string;
|
|
834
|
+
consentId: string;
|
|
835
|
+
url?: string | undefined;
|
|
836
|
+
}, {
|
|
837
|
+
title: string;
|
|
838
|
+
required: boolean;
|
|
839
|
+
version: string;
|
|
840
|
+
consentId: string;
|
|
841
|
+
url?: string | undefined;
|
|
537
842
|
}>, "many">;
|
|
538
|
-
|
|
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
|
-
|
|
542
|
-
|
|
856
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
857
|
+
authorization: {
|
|
858
|
+
status: "required" | "unavailable" | "authorized";
|
|
859
|
+
mobileMasked?: string | undefined;
|
|
860
|
+
};
|
|
543
861
|
fields: {
|
|
862
|
+
type: "date" | "text" | "tel" | "select";
|
|
544
863
|
required: boolean;
|
|
545
864
|
label: string;
|
|
546
865
|
fieldId: string;
|
|
866
|
+
options?: string[] | undefined;
|
|
867
|
+
readOnly?: boolean | undefined;
|
|
868
|
+
prefill?: string | undefined;
|
|
869
|
+
placeholder?: string | undefined;
|
|
547
870
|
}[];
|
|
871
|
+
formVersion: string;
|
|
872
|
+
consents: {
|
|
873
|
+
title: string;
|
|
874
|
+
required: boolean;
|
|
875
|
+
version: string;
|
|
876
|
+
consentId: string;
|
|
877
|
+
url?: string | undefined;
|
|
878
|
+
}[];
|
|
879
|
+
manualNotice?: string | undefined;
|
|
548
880
|
}, {
|
|
549
881
|
userId: string;
|
|
550
|
-
|
|
551
|
-
|
|
882
|
+
state: "unknown" | "active" | "not_enrolled" | "closed";
|
|
883
|
+
authorization: {
|
|
884
|
+
status: "required" | "unavailable" | "authorized";
|
|
885
|
+
mobileMasked?: string | undefined;
|
|
886
|
+
};
|
|
552
887
|
fields: {
|
|
888
|
+
type: "date" | "text" | "tel" | "select";
|
|
553
889
|
required: boolean;
|
|
554
890
|
label: string;
|
|
555
891
|
fieldId: string;
|
|
892
|
+
options?: string[] | undefined;
|
|
893
|
+
readOnly?: boolean | undefined;
|
|
894
|
+
prefill?: string | undefined;
|
|
895
|
+
placeholder?: string | undefined;
|
|
896
|
+
}[];
|
|
897
|
+
formVersion: string;
|
|
898
|
+
consents: {
|
|
899
|
+
title: string;
|
|
900
|
+
required: boolean;
|
|
901
|
+
version: 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
|
-
|
|
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" | "
|
|
568
|
-
message?: string | undefined;
|
|
915
|
+
state: "active" | "failed" | "pending_confirmation" | "confirmation_timeout";
|
|
569
916
|
memberRef?: string | undefined;
|
|
917
|
+
message?: string | undefined;
|
|
918
|
+
attemptRef?: string | undefined;
|
|
570
919
|
}, {
|
|
571
|
-
success: boolean;
|
|
572
920
|
userId: string;
|
|
573
|
-
state: "active" | "
|
|
574
|
-
message?: string | undefined;
|
|
921
|
+
state: "active" | "failed" | "pending_confirmation" | "confirmation_timeout";
|
|
575
922
|
memberRef?: string | undefined;
|
|
923
|
+
message?: string | undefined;
|
|
924
|
+
attemptRef?: string | undefined;
|
|
576
925
|
}>>;
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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
|
+
authState: "authenticated";
|
|
937
|
+
state: "not_enrolled" | "closed";
|
|
938
|
+
title?: string | undefined;
|
|
939
|
+
subtitle?: string | undefined;
|
|
940
|
+
enrollUrl?: string | undefined;
|
|
941
|
+
perks?: string[] | undefined;
|
|
581
942
|
}, {
|
|
582
943
|
userId: string;
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
},
|
|
944
|
+
authState: "authenticated";
|
|
945
|
+
state: "not_enrolled" | "closed";
|
|
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 };
|