@tbox.cn/app-contracts-mall 0.13.2 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runtime.js CHANGED
@@ -186,22 +186,121 @@ var SHOPPING_DIRECTORY_SERVICE = "shopping-guide.directory";
186
186
  // src/services/mall-info.ts
187
187
  var MALL_INFO_SERVICE = "mall.info";
188
188
 
189
- // src/guard.ts
189
+ // src/services/activity-play.ts
190
+ var ACTIVITY_PLAY_QUERY_SERVICE = "activity-play.query";
191
+ var ACTIVITY_PLAY_ENTRY_SERVICE = "activity-play.entry";
192
+
193
+ // src/domain/activity-play.ts
190
194
  import { z } from "zod";
191
- var mallLocationSchema = z.object({
192
- latitude: z.string().min(1),
193
- longitude: z.string().min(1),
194
- mallId: z.string().optional(),
195
- name: z.string().optional()
195
+ var activityPlayRefSchema = z.string().min(1).max(128).regex(/^[A-Za-z0-9_.:-]+$/);
196
+ var activityPlayTitleSchema = z.string().min(1).max(64);
197
+ var activityPlayDescriptionSchema = z.string().min(1).max(500);
198
+ var activityPlayTimeSchema = z.string().datetime({ offset: true });
199
+ var activityPlayImageUrlSchema = z.string().url().startsWith("https://");
200
+ var activityPlayDirectoryEntrySchema = z.object({
201
+ activityRef: activityPlayRefSchema,
202
+ title: activityPlayTitleSchema,
203
+ description: activityPlayDescriptionSchema.optional(),
204
+ imageUrl: activityPlayImageUrlSchema.optional(),
205
+ startsAt: activityPlayTimeSchema.optional(),
206
+ endsAt: activityPlayTimeSchema.optional(),
207
+ enabled: z.boolean().default(true),
208
+ loginRequired: z.boolean().default(false)
209
+ }).strict();
210
+ var activityPlayActivitySchema = z.object({
211
+ activityRef: activityPlayRefSchema,
212
+ title: activityPlayTitleSchema,
213
+ description: activityPlayDescriptionSchema.optional(),
214
+ imageUrl: activityPlayImageUrlSchema.optional(),
215
+ startsAt: activityPlayTimeSchema.optional(),
216
+ endsAt: activityPlayTimeSchema.optional(),
217
+ status: z.enum(["not_started", "active", "ended", "disabled"]),
218
+ loginRequired: z.boolean()
219
+ }).strict();
220
+ function activityPlayStatusOf(input) {
221
+ if (!input.enabled) return "disabled";
222
+ const now = (input.now ?? /* @__PURE__ */ new Date()).getTime();
223
+ const start = input.startsAt != null ? Date.parse(input.startsAt) : void 0;
224
+ const end = input.endsAt != null ? Date.parse(input.endsAt) : void 0;
225
+ if (start != null && Number.isNaN(start)) throw new Error(`\u6D3B\u52A8 startsAt \u4E0D\u53EF\u89E3\u6790: ${input.startsAt}`);
226
+ if (end != null && Number.isNaN(end)) throw new Error(`\u6D3B\u52A8 endsAt \u4E0D\u53EF\u89E3\u6790: ${input.endsAt}`);
227
+ if (start == null || start <= now) {
228
+ if (end != null && now >= end) return "ended";
229
+ return "active";
230
+ }
231
+ return "not_started";
232
+ }
233
+ var ACTIVITY_PLAY_TARGET_KIND = "miniapp-plugin";
234
+ var ACTIVITY_PLAY_ALIAS_MAX = 64;
235
+ var ACTIVITY_PLAY_SEGMENT_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
236
+ var ACTIVITY_PLAY_PARAMS_MAX_ENTRIES = 32;
237
+ var ACTIVITY_PLAY_PARAMS_KEY_MAX = 64;
238
+ var ACTIVITY_PLAY_PARAMS_VALUE_MAX = 256;
239
+ var ACTIVITY_PLAY_PARAMS_SERIALIZE_MAX = 4096;
240
+ var ACTIVITY_PLAY_PARAMS_RESERVED_KEYS = [
241
+ "userid",
242
+ "openid",
243
+ "memberid",
244
+ "token",
245
+ "authcode",
246
+ "accesstoken",
247
+ "refreshtoken",
248
+ "jwt",
249
+ "ticket",
250
+ "sessionid"
251
+ ];
252
+ function paramsKeyNormalized(key) {
253
+ return key.toLowerCase().replace(/[-_]/g, "");
254
+ }
255
+ var activityPlayPluginAliasSchema = z.string().min(1).max(ACTIVITY_PLAY_ALIAS_MAX).regex(ACTIVITY_PLAY_SEGMENT_RE, {
256
+ message: `\u63D2\u4EF6\u522B\u540D\u987B\u4E3A\u5355\u6BB5\u6807\u8BC6\uFF08\u5B57\u6BCD\u6570\u5B57\u4E0E . _ -\uFF0C\u9996\u5B57\u7B26\u5B57\u6BCD\u6570\u5B57\uFF0C\u2264${ACTIVITY_PLAY_ALIAS_MAX}\uFF09`
257
+ });
258
+ var activityPlayTargetPageSchema = z.string().min(1).max(ACTIVITY_PLAY_ALIAS_MAX).regex(ACTIVITY_PLAY_SEGMENT_RE, {
259
+ message: `\u9875\u9762\u522B\u540D\u987B\u4E3A\u5355\u6BB5\u6807\u8BC6\uFF08\u5B57\u6BCD\u6570\u5B57\u4E0E . _ -\uFF0C\u9996\u5B57\u7B26\u5B57\u6BCD\u6570\u5B57\uFF0C\u2264${ACTIVITY_PLAY_ALIAS_MAX}\uFF09`
260
+ });
261
+ var activityPlayTargetSchema = z.object({
262
+ kind: z.literal(ACTIVITY_PLAY_TARGET_KIND),
263
+ pluginAlias: activityPlayPluginAliasSchema,
264
+ page: activityPlayTargetPageSchema,
265
+ params: z.record(z.string().min(1).max(ACTIVITY_PLAY_PARAMS_KEY_MAX), z.string().max(ACTIVITY_PLAY_PARAMS_VALUE_MAX)).default({}).refine(
266
+ (params) => Object.keys(params).length <= ACTIVITY_PLAY_PARAMS_MAX_ENTRIES,
267
+ { message: `params \u81F3\u591A ${ACTIVITY_PLAY_PARAMS_MAX_ENTRIES} \u9879` }
268
+ ).refine(
269
+ (params) => JSON.stringify(params).length <= ACTIVITY_PLAY_PARAMS_SERIALIZE_MAX,
270
+ { message: `params \u5E8F\u5217\u5316\u603B\u957F \u2264 ${ACTIVITY_PLAY_PARAMS_SERIALIZE_MAX}` }
271
+ ).refine(
272
+ (params) => Object.keys(params).every(
273
+ (key) => (
274
+ // 控制字符拒收
275
+ !/[\u0000-\u001f\u007f]/.test(key) && !/[\u0000-\u001f\u007f]/.test(params[key]) && !ACTIVITY_PLAY_PARAMS_RESERVED_KEYS.includes(paramsKeyNormalized(key))
276
+ )
277
+ ),
278
+ { message: "params \u542B\u4FDD\u7559\u952E\uFF08\u8EAB\u4EFD/\u51ED\u8BC1\u7C7B\uFF09\u6216\u63A7\u5236\u5B57\u7B26" }
279
+ )
280
+ }).strict();
281
+ var ACTIVITY_PLAY_ENTRY_PROTOCOL_VERSION = "1";
282
+ var activityPlayEntrySchema = z.object({
283
+ protocolVersion: z.literal(ACTIVITY_PLAY_ENTRY_PROTOCOL_VERSION),
284
+ activityRef: activityPlayRefSchema,
285
+ target: activityPlayTargetSchema
286
+ }).strict();
287
+
288
+ // src/guard.ts
289
+ import { z as z2 } from "zod";
290
+ var mallLocationSchema = z2.object({
291
+ latitude: z2.string().min(1),
292
+ longitude: z2.string().min(1),
293
+ mallId: z2.string().optional(),
294
+ name: z2.string().optional()
196
295
  });
197
296
  function parseMallLocation(raw) {
198
297
  if (!raw || typeof raw !== "object") return void 0;
199
298
  const result = mallLocationSchema.safeParse(raw);
200
299
  return result.success ? result.data : void 0;
201
300
  }
202
- var mallUserRefSchema = z.object({
203
- userId: z.string().min(1),
204
- subjectId: z.string().optional()
301
+ var mallUserRefSchema = z2.object({
302
+ userId: z2.string().min(1),
303
+ subjectId: z2.string().optional()
205
304
  });
206
305
  function parseMallUserRef(raw) {
207
306
  if (!raw || typeof raw !== "object") return void 0;
@@ -210,360 +309,360 @@ function parseMallUserRef(raw) {
210
309
  }
211
310
 
212
311
  // src/shopping-guide/cards.ts
213
- import { z as z3 } from "zod";
312
+ import { z as z4 } from "zod";
214
313
 
215
314
  // src/shared/cards.ts
216
- import { z as z2 } from "zod";
217
- var actionDraftSchema = z2.discriminatedUnion("kind", [
218
- z2.object({
219
- kind: z2.literal("send"),
220
- label: z2.string().min(1),
315
+ import { z as z3 } from "zod";
316
+ var actionDraftSchema = z3.discriminatedUnion("kind", [
317
+ z3.object({
318
+ kind: z3.literal("send"),
319
+ label: z3.string().min(1),
221
320
  /** 发给服务端 AI 的完整指令(可含隐藏上下文如 merchantId);缺省用 label */
222
- value: z2.string().optional(),
321
+ value: z3.string().optional(),
223
322
  /** 用户气泡展示文本(有值时 sendMessage 走 visible=false 隐藏,只展示此文本为气泡副本);
224
323
  * 缺省则 visible=true,直接展示 value/label */
225
- visibleValue: z2.string().optional()
324
+ visibleValue: z3.string().optional()
226
325
  }),
227
- z2.object({ kind: z2.literal("link"), label: z2.string().min(1), url: z2.string().min(1) })
326
+ z3.object({ kind: z3.literal("link"), label: z3.string().min(1), url: z3.string().min(1) })
228
327
  ]);
229
328
 
230
329
  // src/shopping-guide/cards.ts
231
- var httpsUrlSchema = z3.string().regex(/^https:\/\//).max(2048);
232
- var isoDateTimeSchema = z3.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/);
233
- var moneySchema = z3.object({
234
- currency: z3.literal("CNY"),
235
- amountMinor: z3.number().int().min(0),
236
- display: z3.string().min(1)
330
+ var httpsUrlSchema = z4.string().regex(/^https:\/\//).max(2048);
331
+ var isoDateTimeSchema = z4.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/);
332
+ var moneySchema = z4.object({
333
+ currency: z4.literal("CNY"),
334
+ amountMinor: z4.number().int().min(0),
335
+ display: z4.string().min(1)
237
336
  });
238
- var priceSummarySchema = z3.object({
337
+ var priceSummarySchema = z4.object({
239
338
  sale: moneySchema.optional(),
240
339
  original: moneySchema.optional(),
241
340
  promotion: moneySchema.optional()
242
341
  });
243
- var evidenceSchema = z3.object({
244
- code: z3.string().min(1),
245
- label: z3.string().min(1),
246
- value: z3.string().optional(),
342
+ var evidenceSchema = z4.object({
343
+ code: z4.string().min(1),
344
+ label: z4.string().min(1),
345
+ value: z4.string().optional(),
247
346
  observedAt: isoDateTimeSchema,
248
347
  expiresAt: isoDateTimeSchema.optional(),
249
- sourceKind: z3.enum(["catalog", "merchant", "mall", "policy"])
348
+ sourceKind: z4.enum(["catalog", "merchant", "mall", "policy"])
250
349
  });
251
- var reasonItemSchema = z3.object({ code: z3.string().min(1), label: z3.string().min(1) });
252
- var merchantLocationSchema = z3.object({
253
- buildingName: z3.string().optional(),
254
- floorName: z3.string().optional(),
255
- unitName: z3.string().optional(),
256
- displayText: z3.string().min(1),
257
- poiId: z3.string().optional()
350
+ var reasonItemSchema = z4.object({ code: z4.string().min(1), label: z4.string().min(1) });
351
+ var merchantLocationSchema = z4.object({
352
+ buildingName: z4.string().optional(),
353
+ floorName: z4.string().optional(),
354
+ unitName: z4.string().optional(),
355
+ displayText: z4.string().min(1),
356
+ poiId: z4.string().optional()
258
357
  });
259
358
  var shopLocationSchema = merchantLocationSchema;
260
- var merchantStatusSchema = z3.object({
261
- code: z3.enum(["enabled", "disabled", "unknown"]),
262
- label: z3.string().min(1),
359
+ var merchantStatusSchema = z4.object({
360
+ code: z4.enum(["enabled", "disabled", "unknown"]),
361
+ label: z4.string().min(1),
263
362
  observedAt: isoDateTimeSchema
264
363
  });
265
364
  var shopStatusSchema = merchantStatusSchema;
266
- var pageInfoSchema = z3.object({
267
- page: z3.number().int().min(1),
365
+ var pageInfoSchema = z4.object({
366
+ page: z4.number().int().min(1),
268
367
  // max 200(0.7.5 放宽,原 100):品牌导览常驻入口经 port 直调 pageSize=200 一次拉全量,
269
368
  // provider 回显值入 pageInfo 需过卡 schema(card-emitter safeParse);向后兼容(旧值域 ⊂ 新值域)
270
- pageSize: z3.number().int().min(1).max(200),
271
- total: z3.number().int().min(0),
272
- hasMore: z3.boolean()
369
+ pageSize: z4.number().int().min(1).max(200),
370
+ total: z4.number().int().min(0),
371
+ hasMore: z4.boolean()
273
372
  });
274
- var refinementSchema = z3.object({ label: z3.string().min(1), queryText: z3.string().min(1) });
275
- var shopCouponSchema = z3.object({
276
- name: z3.string().min(1),
373
+ var refinementSchema = z4.object({ label: z4.string().min(1), queryText: z4.string().min(1) });
374
+ var shopCouponSchema = z4.object({
375
+ name: z4.string().min(1),
277
376
  imageUrl: httpsUrlSchema.optional(),
278
- description: z3.string().optional(),
279
- faceValue: z3.number().optional(),
280
- salePrice: z3.number().optional(),
281
- applicableCategories: z3.array(z3.string()).optional(),
282
- validHours: z3.number().optional(),
283
- usageTimeText: z3.string().optional(),
284
- purchaseUrl: z3.string().max(2048).optional(),
285
- freeCouponClaimMode: z3.enum(["DIRECT", "REDIRECT"]).optional(),
286
- offerRef: z3.string().min(1).optional()
377
+ description: z4.string().optional(),
378
+ faceValue: z4.number().optional(),
379
+ salePrice: z4.number().optional(),
380
+ applicableCategories: z4.array(z4.string()).optional(),
381
+ validHours: z4.number().optional(),
382
+ usageTimeText: z4.string().optional(),
383
+ purchaseUrl: z4.string().max(2048).optional(),
384
+ freeCouponClaimMode: z4.enum(["DIRECT", "REDIRECT"]).optional(),
385
+ offerRef: z4.string().min(1).optional()
287
386
  });
288
- var productListCardDataSchema = z3.object({
289
- context: z3.enum(["recommendation", "search", "similar", "history"]),
290
- summary: z3.string().optional(),
291
- items: z3.array(
292
- z3.object({
293
- productId: z3.string().min(1),
294
- name: z3.string().min(1),
387
+ var productListCardDataSchema = z4.object({
388
+ context: z4.enum(["recommendation", "search", "similar", "history"]),
389
+ summary: z4.string().optional(),
390
+ items: z4.array(
391
+ z4.object({
392
+ productId: z4.string().min(1),
393
+ name: z4.string().min(1),
295
394
  imageUrl: httpsUrlSchema.optional(),
296
- brand: z3.string().optional(),
297
- categoryPath: z3.array(z3.string()),
395
+ brand: z4.string().optional(),
396
+ categoryPath: z4.array(z4.string()),
298
397
  price: priceSummarySchema,
299
- availability: z3.object({
300
- status: z3.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
301
- label: z3.string(),
302
- marketable: z3.boolean(),
398
+ availability: z4.object({
399
+ status: z4.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
400
+ label: z4.string(),
401
+ marketable: z4.boolean(),
303
402
  observedAt: isoDateTimeSchema
304
403
  }),
305
- merchant: z3.object({
306
- merchantId: z3.string(),
307
- name: z3.string(),
404
+ merchant: z4.object({
405
+ merchantId: z4.string(),
406
+ name: z4.string(),
308
407
  location: merchantLocationSchema.optional()
309
408
  }),
310
- badges: z3.array(z3.string()),
311
- reasons: z3.array(reasonItemSchema).optional(),
312
- evidence: z3.array(evidenceSchema).optional(),
313
- caveats: z3.array(z3.string()),
314
- itemActions: z3.array(actionDraftSchema)
409
+ badges: z4.array(z4.string()),
410
+ reasons: z4.array(reasonItemSchema).optional(),
411
+ evidence: z4.array(evidenceSchema).optional(),
412
+ caveats: z4.array(z4.string()),
413
+ itemActions: z4.array(actionDraftSchema)
315
414
  })
316
415
  ),
317
- noResultsReason: z3.string().optional(),
416
+ noResultsReason: z4.string().optional(),
318
417
  pageInfo: pageInfoSchema.optional(),
319
- refinements: z3.array(refinementSchema)
418
+ refinements: z4.array(refinementSchema)
320
419
  });
321
- var shopListCardDataSchema = z3.object({
322
- context: z3.enum(["recommendation", "search"]),
420
+ var shopListCardDataSchema = z4.object({
421
+ context: z4.enum(["recommendation", "search"]),
323
422
  /** mall scope 透传:供客户端侧边栏详情 HTTP 请求携带 mallId 与 miniAppId(工具执行时注入) */
324
- mallId: z3.string().optional(),
423
+ mallId: z4.string().optional(),
325
424
  /** 小程序 appId(miniAppId 唯一真值透传;HTTP /shop-detail 鉴权用) */
326
- miniAppId: z3.string().optional(),
327
- summary: z3.string().optional(),
328
- categoryTabs: z3.array(z3.object({ code: z3.string(), name: z3.string() })).optional(),
329
- items: z3.array(
330
- z3.object({
331
- merchantId: z3.string(),
332
- name: z3.string(),
425
+ miniAppId: z4.string().optional(),
426
+ summary: z4.string().optional(),
427
+ categoryTabs: z4.array(z4.object({ code: z4.string(), name: z4.string() })).optional(),
428
+ items: z4.array(
429
+ z4.object({
430
+ merchantId: z4.string(),
431
+ name: z4.string(),
333
432
  logoUrl: httpsUrlSchema.optional(),
334
433
  coverUrl: httpsUrlSchema.optional(),
335
- brand: z3.string().optional(),
336
- businessCategories: z3.array(z3.string()),
434
+ brand: z4.string().optional(),
435
+ businessCategories: z4.array(z4.string()),
337
436
  location: merchantLocationSchema,
338
437
  status: merchantStatusSchema,
339
- contactInfo: z3.array(z3.object({ channel: z3.string(), value: z3.string() })).optional(),
340
- services: z3.array(z3.string()),
341
- promotionFacts: z3.array(z3.string()),
342
- reasons: z3.array(reasonItemSchema).optional(),
343
- evidence: z3.array(evidenceSchema).optional(),
344
- itemActions: z3.array(actionDraftSchema),
438
+ contactInfo: z4.array(z4.object({ channel: z4.string(), value: z4.string() })).optional(),
439
+ services: z4.array(z4.string()),
440
+ promotionFacts: z4.array(z4.string()),
441
+ reasons: z4.array(reasonItemSchema).optional(),
442
+ evidence: z4.array(evidenceSchema).optional(),
443
+ itemActions: z4.array(actionDraftSchema),
345
444
  /** 门店关联优惠券(列表卡透传,供点击下钻时直接展示,避免二次请求) */
346
- coupons: z3.array(shopCouponSchema).optional()
445
+ coupons: z4.array(shopCouponSchema).optional()
347
446
  })
348
447
  ),
349
- noResultsReason: z3.string().optional(),
448
+ noResultsReason: z4.string().optional(),
350
449
  pageInfo: pageInfoSchema.optional(),
351
- refinements: z3.array(refinementSchema)
450
+ refinements: z4.array(refinementSchema)
352
451
  });
353
452
  var merchantListCardDataSchema = shopListCardDataSchema;
354
- var productDetailCardDataSchema = z3.object({
355
- productId: z3.string().min(1),
356
- name: z3.string().min(1),
357
- description: z3.string().optional(),
358
- imageUrls: z3.array(httpsUrlSchema),
359
- brand: z3.string().optional(),
360
- categoryPath: z3.array(z3.string()),
453
+ var productDetailCardDataSchema = z4.object({
454
+ productId: z4.string().min(1),
455
+ name: z4.string().min(1),
456
+ description: z4.string().optional(),
457
+ imageUrls: z4.array(httpsUrlSchema),
458
+ brand: z4.string().optional(),
459
+ categoryPath: z4.array(z4.string()),
361
460
  price: priceSummarySchema,
362
- availability: z3.object({
363
- status: z3.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
364
- label: z3.string(),
365
- marketable: z3.boolean(),
461
+ availability: z4.object({
462
+ status: z4.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
463
+ label: z4.string(),
464
+ marketable: z4.boolean(),
366
465
  observedAt: isoDateTimeSchema
367
466
  }),
368
- merchant: z3.object({
369
- merchantId: z3.string(),
370
- name: z3.string(),
467
+ merchant: z4.object({
468
+ merchantId: z4.string(),
469
+ name: z4.string(),
371
470
  location: merchantLocationSchema.optional()
372
471
  }),
373
- attributes: z3.array(z3.object({ name: z3.string(), value: z3.string() })),
374
- promotionFacts: z3.array(z3.string()),
375
- evidence: z3.array(evidenceSchema),
376
- humanGuideAvailable: z3.boolean(),
377
- itemActions: z3.array(actionDraftSchema)
472
+ attributes: z4.array(z4.object({ name: z4.string(), value: z4.string() })),
473
+ promotionFacts: z4.array(z4.string()),
474
+ evidence: z4.array(evidenceSchema),
475
+ humanGuideAvailable: z4.boolean(),
476
+ itemActions: z4.array(actionDraftSchema)
378
477
  });
379
- var shopDetailCardDataSchema = z3.object({
380
- merchantId: z3.string(),
381
- name: z3.string(),
478
+ var shopDetailCardDataSchema = z4.object({
479
+ merchantId: z4.string(),
480
+ name: z4.string(),
382
481
  /** mall scope 透传:供客户端 Sheet 后台 detail HTTP 请求携带(工具执行时注入,与 shop-list 同源) */
383
- mallId: z3.string().optional(),
482
+ mallId: z4.string().optional(),
384
483
  /** 小程序 appId(miniAppId 唯一真值透传;HTTP /shop-detail 鉴权用) */
385
- miniAppId: z3.string().optional(),
484
+ miniAppId: z4.string().optional(),
386
485
  logoUrl: httpsUrlSchema.optional(),
387
- coverUrls: z3.array(httpsUrlSchema),
388
- brand: z3.string().optional(),
389
- businessCategories: z3.array(z3.string()),
486
+ coverUrls: z4.array(httpsUrlSchema),
487
+ brand: z4.string().optional(),
488
+ businessCategories: z4.array(z4.string()),
390
489
  location: merchantLocationSchema,
391
490
  status: merchantStatusSchema,
392
- description: z3.string().optional(),
393
- contactInfo: z3.array(z3.object({ channel: z3.string(), value: z3.string() })).optional(),
394
- services: z3.array(z3.string()),
395
- promotionFacts: z3.array(z3.string()),
491
+ description: z4.string().optional(),
492
+ contactInfo: z4.array(z4.object({ channel: z4.string(), value: z4.string() })).optional(),
493
+ services: z4.array(z4.string()),
494
+ promotionFacts: z4.array(z4.string()),
396
495
  /** 门店关联优惠券列表(来自 couponList;name/imageUrl/faceValue/salePrice/applicableCategories/validHours) */
397
- coupons: z3.array(shopCouponSchema).optional(),
398
- evidence: z3.array(evidenceSchema),
399
- itemActions: z3.array(actionDraftSchema)
496
+ coupons: z4.array(shopCouponSchema).optional(),
497
+ evidence: z4.array(evidenceSchema),
498
+ itemActions: z4.array(actionDraftSchema)
400
499
  });
401
500
  var merchantDetailCardDataSchema = shopDetailCardDataSchema;
402
- var categoryListCardDataSchema = z3.object({
403
- categories: z3.array(
404
- z3.object({
405
- code: z3.string().min(1),
406
- name: z3.string().min(1),
407
- description: z3.string().optional(),
501
+ var categoryListCardDataSchema = z4.object({
502
+ categories: z4.array(
503
+ z4.object({
504
+ code: z4.string().min(1),
505
+ name: z4.string().min(1),
506
+ description: z4.string().optional(),
408
507
  /** 类目图标 URL;undefined 时前端展示默认图标 */
409
508
  iconUrl: httpsUrlSchema.optional(),
410
- merchantCount: z3.number().int().min(0),
411
- subCategories: z3.array(z3.object({ code: z3.string(), name: z3.string(), merchantCount: z3.number().int().min(0) })).optional(),
509
+ merchantCount: z4.number().int().min(0),
510
+ subCategories: z4.array(z4.object({ code: z4.string(), name: z4.string(), merchantCount: z4.number().int().min(0) })).optional(),
412
511
  /** 0.3.2 类别条目动作(send 合成话术/外链) */
413
- itemActions: z3.array(actionDraftSchema).optional()
512
+ itemActions: z4.array(actionDraftSchema).optional()
414
513
  })
415
514
  ),
416
515
  /** 商场楼栋-楼层结构(与 mall-directory 同语义子集,供 category-list 卡片展示楼层导航) */
417
- buildings: z3.array(
418
- z3.object({
419
- buildingCode: z3.string(),
420
- buildingName: z3.string(),
421
- floors: z3.array(
422
- z3.object({
423
- floorCode: z3.string(),
424
- floorName: z3.string(),
425
- businessCategories: z3.array(z3.string()),
426
- merchantCount: z3.number().int().min(0),
516
+ buildings: z4.array(
517
+ z4.object({
518
+ buildingCode: z4.string(),
519
+ buildingName: z4.string(),
520
+ floors: z4.array(
521
+ z4.object({
522
+ floorCode: z4.string(),
523
+ floorName: z4.string(),
524
+ businessCategories: z4.array(z4.string()),
525
+ merchantCount: z4.number().int().min(0),
427
526
  /** 楼层条目动作(send:查看该楼层门店列表) */
428
- itemActions: z3.array(actionDraftSchema).optional()
527
+ itemActions: z4.array(actionDraftSchema).optional()
429
528
  })
430
529
  )
431
530
  })
432
531
  ).optional(),
433
532
  observedAt: isoDateTimeSchema
434
533
  });
435
- var productComparisonCardDataSchema = z3.object({
436
- products: z3.array(
437
- z3.object({
438
- productId: z3.string().min(1),
439
- name: z3.string().min(1),
534
+ var productComparisonCardDataSchema = z4.object({
535
+ products: z4.array(
536
+ z4.object({
537
+ productId: z4.string().min(1),
538
+ name: z4.string().min(1),
440
539
  imageUrl: httpsUrlSchema.optional(),
441
- brand: z3.string().optional(),
540
+ brand: z4.string().optional(),
442
541
  price: priceSummarySchema,
443
- availability: z3.object({
444
- status: z3.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
445
- label: z3.string(),
446
- marketable: z3.boolean(),
542
+ availability: z4.object({
543
+ status: z4.enum(["in_stock", "out_of_stock", "limited", "unknown"]),
544
+ label: z4.string(),
545
+ marketable: z4.boolean(),
447
546
  observedAt: isoDateTimeSchema
448
547
  }),
449
- merchant: z3.object({ merchantId: z3.string(), name: z3.string() }),
450
- attributes: z3.array(z3.object({ name: z3.string(), value: z3.string() })),
451
- caveats: z3.array(z3.string())
548
+ merchant: z4.object({ merchantId: z4.string(), name: z4.string() }),
549
+ attributes: z4.array(z4.object({ name: z4.string(), value: z4.string() })),
550
+ caveats: z4.array(z4.string())
452
551
  })
453
552
  ),
454
553
  /** 0.3.2 刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
455
554
  refreshRequiredAt: isoDateTimeSchema.optional(),
456
555
  observedAt: isoDateTimeSchema
457
556
  });
458
- var mallDirectoryCardDataSchema = z3.object({
459
- mallId: z3.string(),
460
- mallName: z3.string(),
461
- buildings: z3.array(
462
- z3.object({
463
- buildingCode: z3.string(),
464
- buildingName: z3.string(),
465
- floors: z3.array(
466
- z3.object({
467
- floorCode: z3.string(),
468
- floorName: z3.string(),
469
- businessCategories: z3.array(z3.string()),
470
- merchantCount: z3.number().int().min(0),
557
+ var mallDirectoryCardDataSchema = z4.object({
558
+ mallId: z4.string(),
559
+ mallName: z4.string(),
560
+ buildings: z4.array(
561
+ z4.object({
562
+ buildingCode: z4.string(),
563
+ buildingName: z4.string(),
564
+ floors: z4.array(
565
+ z4.object({
566
+ floorCode: z4.string(),
567
+ floorName: z4.string(),
568
+ businessCategories: z4.array(z4.string()),
569
+ merchantCount: z4.number().int().min(0),
471
570
  /** 0.3.2 楼层条目动作(send:查看楼层门店) */
472
- itemActions: z3.array(actionDraftSchema).optional()
571
+ itemActions: z4.array(actionDraftSchema).optional()
473
572
  })
474
573
  )
475
574
  })
476
575
  ),
477
576
  observedAt: isoDateTimeSchema
478
577
  });
479
- var nearbyMallListCardDataSchema = z3.object({
480
- query: z3.string().optional(),
481
- malls: z3.array(
482
- z3.object({
483
- mallId: z3.string(),
484
- name: z3.string(),
485
- address: z3.string(),
486
- distanceKm: z3.number().min(0).optional(),
487
- status: z3.object({ code: z3.enum(["open", "closed", "unknown"]), label: z3.string() }),
488
- itemActions: z3.array(actionDraftSchema)
578
+ var nearbyMallListCardDataSchema = z4.object({
579
+ query: z4.string().optional(),
580
+ malls: z4.array(
581
+ z4.object({
582
+ mallId: z4.string(),
583
+ name: z4.string(),
584
+ address: z4.string(),
585
+ distanceKm: z4.number().min(0).optional(),
586
+ status: z4.object({ code: z4.enum(["open", "closed", "unknown"]), label: z4.string() }),
587
+ itemActions: z4.array(actionDraftSchema)
489
588
  })
490
589
  )
491
590
  });
492
- var customerServiceFaqCardDataSchema = z3.object({
493
- query: z3.string().min(1),
494
- faqs: z3.array(
495
- z3.object({
496
- question: z3.string().min(1),
497
- answer: z3.string().min(1),
498
- category: z3.string().optional(),
499
- relevanceScore: z3.number().min(0).max(1),
591
+ var customerServiceFaqCardDataSchema = z4.object({
592
+ query: z4.string().min(1),
593
+ faqs: z4.array(
594
+ z4.object({
595
+ question: z4.string().min(1),
596
+ answer: z4.string().min(1),
597
+ category: z4.string().optional(),
598
+ relevanceScore: z4.number().min(0).max(1),
500
599
  /** 0.3.2 答案参考外链(openLink) */
501
600
  referenceUrl: httpsUrlSchema.optional()
502
601
  })
503
602
  ),
504
603
  /** 客服电话(015:deployment.malls 经 mall-directory 服务注入;缺省不渲染拨打条目) */
505
- contactPhone: z3.string().min(1).optional(),
506
- noResultsReason: z3.string().optional()
604
+ contactPhone: z4.string().min(1).optional(),
605
+ noResultsReason: z4.string().optional()
507
606
  });
508
- var humanGuideListCardDataSchema = z3.object({
509
- merchantId: z3.string(),
510
- merchantName: z3.string(),
511
- guides: z3.array(
512
- z3.object({
513
- guideId: z3.string(),
514
- name: z3.string(),
515
- title: z3.string().optional(),
607
+ var humanGuideListCardDataSchema = z4.object({
608
+ merchantId: z4.string(),
609
+ merchantName: z4.string(),
610
+ guides: z4.array(
611
+ z4.object({
612
+ guideId: z4.string(),
613
+ name: z4.string(),
614
+ title: z4.string().optional(),
516
615
  avatarUrl: httpsUrlSchema.optional(),
517
- contactInfo: z3.array(z3.object({ channel: z3.string(), value: z3.string() })).optional(),
518
- available: z3.boolean(),
519
- itemActions: z3.array(actionDraftSchema)
616
+ contactInfo: z4.array(z4.object({ channel: z4.string(), value: z4.string() })).optional(),
617
+ available: z4.boolean(),
618
+ itemActions: z4.array(actionDraftSchema)
520
619
  })
521
620
  )
522
621
  });
523
- var locationHandoffCardDataSchema = z3.object({
524
- merchantId: z3.string(),
525
- merchantName: z3.string(),
622
+ var locationHandoffCardDataSchema = z4.object({
623
+ merchantId: z4.string(),
624
+ merchantName: z4.string(),
526
625
  location: merchantLocationSchema,
527
626
  mapUrl: httpsUrlSchema.optional(),
528
- navigation: z3.object({
529
- provider: z3.enum(["amap", "builtin"]),
530
- launchParams: z3.record(z3.string(), z3.string()).optional()
627
+ navigation: z4.object({
628
+ provider: z4.enum(["amap", "builtin"]),
629
+ launchParams: z4.record(z4.string(), z4.string()).optional()
531
630
  }).optional(),
532
- itemActions: z3.array(actionDraftSchema)
631
+ itemActions: z4.array(actionDraftSchema)
533
632
  });
534
- var recommendMerchantsCardDataSchema = z3.object({
535
- summary: z3.string().optional(),
633
+ var recommendMerchantsCardDataSchema = z4.object({
634
+ summary: z4.string().optional(),
536
635
  /** 类目筛选 Tab(来自 list-categories;有值时渲染 Tab 栏) */
537
- categoryTabs: z3.array(
538
- z3.object({
539
- code: z3.string(),
540
- name: z3.string()
636
+ categoryTabs: z4.array(
637
+ z4.object({
638
+ code: z4.string(),
639
+ name: z4.string()
541
640
  })
542
641
  ).optional(),
543
- items: z3.array(
544
- z3.object({
545
- merchantId: z3.string(),
546
- name: z3.string(),
642
+ items: z4.array(
643
+ z4.object({
644
+ merchantId: z4.string(),
645
+ name: z4.string(),
547
646
  logoUrl: httpsUrlSchema.optional(),
548
647
  coverUrl: httpsUrlSchema.optional(),
549
- brand: z3.string().optional(),
550
- businessCategories: z3.array(z3.string()),
648
+ brand: z4.string().optional(),
649
+ businessCategories: z4.array(z4.string()),
551
650
  location: merchantLocationSchema,
552
651
  status: merchantStatusSchema,
553
- description: z3.string().optional(),
554
- contactInfo: z3.array(z3.object({ channel: z3.string(), value: z3.string() })).optional(),
555
- services: z3.array(z3.string()).optional(),
652
+ description: z4.string().optional(),
653
+ contactInfo: z4.array(z4.object({ channel: z4.string(), value: z4.string() })).optional(),
654
+ services: z4.array(z4.string()).optional(),
556
655
  /** 营业时间/经营状态文本(如 "10:00营业"),来自知识库 经营状态 字段 */
557
- operatingStatus: z3.string().optional(),
656
+ operatingStatus: z4.string().optional(),
558
657
  /** 评分(如 "4.8"),来自知识库 评分 字段 */
559
- rating: z3.string().optional(),
658
+ rating: z4.string().optional(),
560
659
  /** 人均消费文本(如 "¥202"),来自知识库 人均消费 字段(分为单位时自动格式化) */
561
- avgSpend: z3.string().optional(),
562
- promotionFacts: z3.array(z3.string()),
563
- itemActions: z3.array(actionDraftSchema)
660
+ avgSpend: z4.string().optional(),
661
+ promotionFacts: z4.array(z4.string()),
662
+ itemActions: z4.array(actionDraftSchema)
564
663
  })
565
664
  ),
566
- noResultsReason: z3.string().optional(),
665
+ noResultsReason: z4.string().optional(),
567
666
  observedAt: isoDateTimeSchema
568
667
  });
569
668
  var shoppingGuideCardDataSchemas = {
@@ -582,157 +681,157 @@ var shoppingGuideCardDataSchemas = {
582
681
  };
583
682
 
584
683
  // src/member/cards.ts
585
- import { z as z4 } from "zod";
586
- var memberAuthStateSchema = z4.enum(["authenticated", "unauthenticated"]);
587
- var memberStateSchema = z4.enum(["unknown", "active", "not_enrolled", "closed"]);
684
+ import { z as z5 } from "zod";
685
+ var memberAuthStateSchema = z5.enum(["authenticated", "unauthenticated"]);
686
+ var memberStateSchema = z5.enum(["unknown", "active", "not_enrolled", "closed"]);
588
687
  var MEMBER_PREFERENCE_VALUES = [
589
688
  "\u6211\u5E38\u6765\u4E70\u8863\u670D",
590
689
  "\u6211\u5E38\u5E26\u5A03\u6765\u73A9",
591
690
  "\u6211\u5E38\u6765\u5403\u7F8E\u98DF"
592
691
  ];
593
- var memberPreferenceValueSchema = z4.enum(MEMBER_PREFERENCE_VALUES);
692
+ var memberPreferenceValueSchema = z5.enum(MEMBER_PREFERENCE_VALUES);
594
693
  var MEMBER_PREFERENCE_PROMPTS = MEMBER_PREFERENCE_VALUES.map((value) => ({ value, query: value }));
595
694
  var MEMBER_PREFERENCE_RECOMMENDATION_QUERIES = {
596
695
  "\u6211\u5E38\u6765\u4E70\u8863\u670D": "\u63A8\u8350\u9002\u5408\u8D2D\u4E70\u7684\u670D\u88C5\u95E8\u5E97\u548C\u5546\u54C1",
597
696
  "\u6211\u5E38\u5E26\u5A03\u6765\u73A9": "\u63A8\u8350\u9002\u5408\u5E26\u5A03\u7684\u4EB2\u5B50\u5A31\u4E50\u95E8\u5E97",
598
697
  "\u6211\u5E38\u6765\u5403\u7F8E\u98DF": "\u63A8\u8350\u503C\u5F97\u53BB\u7684\u9910\u996E\u7F8E\u98DF\u95E8\u5E97"
599
698
  };
600
- var memberInfoCardDataSchema = z4.object({
601
- userId: z4.string().min(1),
699
+ var memberInfoCardDataSchema = z5.object({
700
+ userId: z5.string().min(1),
602
701
  authState: memberAuthStateSchema,
603
702
  state: memberStateSchema,
604
- displayName: z4.string().optional(),
605
- avatarUrl: z4.string().optional(),
606
- contactDisplay: z4.string().optional(),
607
- memberRef: z4.string().optional(),
608
- registeredAt: z4.string().optional(),
609
- labels: z4.array(z4.object({ labelRef: z4.string(), name: z4.string() }))
703
+ displayName: z5.string().optional(),
704
+ avatarUrl: z5.string().optional(),
705
+ contactDisplay: z5.string().optional(),
706
+ memberRef: z5.string().optional(),
707
+ registeredAt: z5.string().optional(),
708
+ labels: z5.array(z5.object({ labelRef: z5.string(), name: z5.string() }))
610
709
  });
611
- var memberCardSummaryCardDataSchema = z4.object({
612
- userId: z4.string().min(1),
613
- cardRef: z4.string(),
614
- cardDisplay: z4.string(),
615
- status: z4.enum(["active", "inactive", "frozen", "expired", "unknown"]),
616
- levelName: z4.string().optional(),
617
- availablePoints: z4.number().int().min(0),
618
- cardImageUrl: z4.string().optional(),
619
- pointsRuleImageUrl: z4.string().url().optional(),
620
- pointsRuleContent: z4.string().min(1).max(2e4).optional(),
621
- pointsUrl: z4.string().url().optional(),
622
- presentation: z4.object({
623
- variant: z4.enum(["blue", "silver", "gold", "black"]),
624
- labelsEmbedded: z4.boolean().optional()
710
+ var memberCardSummaryCardDataSchema = z5.object({
711
+ userId: z5.string().min(1),
712
+ cardRef: z5.string(),
713
+ cardDisplay: z5.string(),
714
+ status: z5.enum(["active", "inactive", "frozen", "expired", "unknown"]),
715
+ levelName: z5.string().optional(),
716
+ availablePoints: z5.number().int().min(0),
717
+ cardImageUrl: z5.string().optional(),
718
+ pointsRuleImageUrl: z5.string().url().optional(),
719
+ pointsRuleContent: z5.string().min(1).max(2e4).optional(),
720
+ pointsUrl: z5.string().url().optional(),
721
+ presentation: z5.object({
722
+ variant: z5.enum(["blue", "silver", "gold", "black"]),
723
+ labelsEmbedded: z5.boolean().optional()
625
724
  }).optional(),
626
- progress: z4.object({
627
- daySpentCents: z4.number().int().min(0),
628
- yearSpentCents: z4.number().int().min(0),
629
- percent: z4.number().min(0).max(100),
630
- message: z4.string().min(1).max(256)
725
+ progress: z5.object({
726
+ daySpentCents: z5.number().int().min(0),
727
+ yearSpentCents: z5.number().int().min(0),
728
+ percent: z5.number().min(0).max(100),
729
+ message: z5.string().min(1).max(256)
631
730
  }).optional(),
632
- benefits: z4.array(z4.object({
633
- benefitRef: z4.string().min(1),
634
- name: z4.string().min(1).max(128),
635
- iconUrl: z4.string().url().optional(),
636
- description: z4.string().min(1).max(128).optional(),
637
- action: z4.object({
638
- kind: z4.enum(["miniapp", "dialog", "toast"]),
639
- url: z4.string().url().optional(),
640
- title: z4.string().min(1).max(128).optional(),
641
- text: z4.string().min(1).max(2048).optional()
731
+ benefits: z5.array(z5.object({
732
+ benefitRef: z5.string().min(1),
733
+ name: z5.string().min(1).max(128),
734
+ iconUrl: z5.string().url().optional(),
735
+ description: z5.string().min(1).max(128).optional(),
736
+ action: z5.object({
737
+ kind: z5.enum(["miniapp", "dialog", "toast"]),
738
+ url: z5.string().url().optional(),
739
+ title: z5.string().min(1).max(128).optional(),
740
+ text: z5.string().min(1).max(2048).optional()
642
741
  }).optional()
643
742
  })).max(20).optional(),
644
743
  /** 入会后偏好引导;首批固定三项,保留数组形态便于后续扩展。 */
645
- preferencePrompts: z4.array(z4.object({
744
+ preferencePrompts: z5.array(z5.object({
646
745
  value: memberPreferenceValueSchema,
647
- query: z4.string().min(1).max(128)
746
+ query: z5.string().min(1).max(128)
648
747
  })).max(8).optional()
649
748
  });
650
- var memberPointUsageListCardDataSchema = z4.object({
651
- userId: z4.string().min(1),
652
- balance: z4.number().int(),
653
- membershipLabel: z4.string().optional(),
654
- items: z4.array(
655
- z4.object({
656
- usageRecordRef: z4.string(),
657
- title: z4.string(),
658
- amount: z4.string(),
659
- usedAt: z4.string().optional(),
660
- description: z4.string().optional()
749
+ var memberPointUsageListCardDataSchema = z5.object({
750
+ userId: z5.string().min(1),
751
+ balance: z5.number().int(),
752
+ membershipLabel: z5.string().optional(),
753
+ items: z5.array(
754
+ z5.object({
755
+ usageRecordRef: z5.string(),
756
+ title: z5.string(),
757
+ amount: z5.string(),
758
+ usedAt: z5.string().optional(),
759
+ description: z5.string().optional()
661
760
  })
662
761
  ),
663
- total: z4.number().int().min(0)
762
+ total: z5.number().int().min(0)
664
763
  });
665
- var memberEnrollmentFormCardDataSchema = z4.object({
666
- userId: z4.string().min(1),
764
+ var memberEnrollmentFormCardDataSchema = z5.object({
765
+ userId: z5.string().min(1),
667
766
  state: memberStateSchema,
668
767
  /** 表单版本(幂等键组成部分) */
669
- formVersion: z4.string().min(1),
768
+ formVersion: z5.string().min(1),
670
769
  /** 表单字段(readOnly = 授权预填锁定;prefill = 预填值) */
671
- fields: z4.array(
672
- z4.object({
673
- fieldId: z4.string(),
674
- label: z4.string(),
675
- type: z4.enum(["text", "tel", "select", "date"]),
676
- required: z4.boolean(),
677
- readOnly: z4.boolean().optional(),
678
- prefill: z4.string().optional(),
679
- placeholder: z4.string().optional(),
680
- options: z4.array(z4.string()).optional()
770
+ fields: z5.array(
771
+ z5.object({
772
+ fieldId: z5.string(),
773
+ label: z5.string(),
774
+ type: z5.enum(["text", "tel", "select", "date"]),
775
+ required: z5.boolean(),
776
+ readOnly: z5.boolean().optional(),
777
+ prefill: z5.string().optional(),
778
+ placeholder: z5.string().optional(),
779
+ options: z5.array(z5.string()).optional()
681
780
  })
682
781
  ),
683
782
  /** 隐私/条款同意项(required 必勾) */
684
- consents: z4.array(
685
- z4.object({
686
- consentId: z4.string(),
687
- version: z4.string(),
688
- title: z4.string(),
689
- required: z4.boolean(),
690
- url: z4.string().optional()
783
+ consents: z5.array(
784
+ z5.object({
785
+ consentId: z5.string(),
786
+ version: z5.string(),
787
+ title: z5.string(),
788
+ required: z5.boolean(),
789
+ url: z5.string().optional()
691
790
  })
692
791
  ),
693
792
  /** 支付宝授权状态(required → 渲染授权按钮;authorized → mobile 预填 readOnly) */
694
- authorization: z4.object({
695
- status: z4.enum(["required", "authorized", "unavailable"]),
696
- mobileMasked: z4.string().optional()
793
+ authorization: z5.object({
794
+ status: z5.enum(["required", "authorized", "unavailable"]),
795
+ mobileMasked: z5.string().optional()
697
796
  }),
698
797
  /** 手动填写模式提示(授权不可用降级) */
699
- manualNotice: z4.string().optional()
798
+ manualNotice: z5.string().optional()
700
799
  });
701
- var memberEnrollmentStatusCardDataSchema = z4.object({
702
- userId: z4.string().min(1),
703
- attemptRef: z4.string().optional(),
704
- state: z4.enum(["pending_confirmation", "confirmation_timeout", "active", "failed"]),
705
- memberRef: z4.string().optional(),
706
- message: z4.string().optional()
800
+ var memberEnrollmentStatusCardDataSchema = z5.object({
801
+ userId: z5.string().min(1),
802
+ attemptRef: z5.string().optional(),
803
+ state: z5.enum(["pending_confirmation", "confirmation_timeout", "active", "failed"]),
804
+ memberRef: z5.string().optional(),
805
+ message: z5.string().optional()
707
806
  });
708
- var memberEnrollmentCtaCardDataSchema = z4.object({
709
- userId: z4.string().min(1),
710
- authState: z4.literal("authenticated"),
711
- state: z4.enum(["not_enrolled", "closed"]),
807
+ var memberEnrollmentCtaCardDataSchema = z5.object({
808
+ userId: z5.string().min(1),
809
+ authState: z5.literal("authenticated"),
810
+ state: z5.enum(["not_enrolled", "closed"]),
712
811
  /**
713
812
  * alipays:// 深链,由部署配置注入;**可选透传素材**——出卡不依赖它,
714
813
  * 壳能力(getLoginState/openGate)缺席时兜底 openLink 用,未配置恒出卡(无此字段)
715
814
  */
716
- enrollUrl: z4.string().min(1).refine((value) => value.startsWith("alipays://") || value.startsWith("https://"), {
815
+ enrollUrl: z5.string().min(1).refine((value) => value.startsWith("alipays://") || value.startsWith("https://"), {
717
816
  message: "enrollUrl must use alipays:// or https://"
718
817
  }).optional(),
719
- title: z4.string().optional(),
720
- subtitle: z4.string().optional(),
818
+ title: z5.string().optional(),
819
+ subtitle: z5.string().optional(),
721
820
  /**
722
821
  * 入会权益提示列表(工具层注入通用文案;不得包含折扣/免费停车等未经系统确认的承诺)。
723
822
  * 缺省不展示,由渲染层按有无决定是否渲染区块。
724
823
  */
725
- perks: z4.array(z4.string()).optional()
824
+ perks: z5.array(z5.string()).optional()
726
825
  });
727
- var memberLoginCtaCardDataSchema = z4.object({
826
+ var memberLoginCtaCardDataSchema = z5.object({
728
827
  /**
729
828
  * 商场小程序登录页深链,由部署配置注入;**可选透传素材**——出卡不依赖它,
730
829
  * 壳能力(getLoginState)缺席时兜底 openLink 用,未配置恒出卡(无此字段)
731
830
  */
732
- loginUrl: z4.string().min(1).refine((value) => value.startsWith("alipays://") || value.startsWith("https://"), {
831
+ loginUrl: z5.string().min(1).refine((value) => value.startsWith("alipays://") || value.startsWith("https://"), {
733
832
  message: "loginUrl must use alipays:// or https://"
734
833
  }).optional(),
735
- title: z4.string().optional()
834
+ title: z5.string().optional()
736
835
  });
737
836
  var memberCardDataSchemas = {
738
837
  "member-info": memberInfoCardDataSchema,
@@ -745,277 +844,277 @@ var memberCardDataSchemas = {
745
844
  };
746
845
 
747
846
  // src/promotion/cards.ts
748
- import { z as z6 } from "zod";
847
+ import { z as z7 } from "zod";
749
848
 
750
849
  // src/alipay-activity/cards.ts
751
- import { z as z5 } from "zod";
752
- var bumpInVoucherSchema = z5.object({
753
- prizeId: z5.string(),
754
- voucherName: z5.string(),
755
- voucherType: z5.string(),
756
- reductionAmount: z5.string(),
757
- thresholdAmountText: z5.string(),
758
- unit: z5.string(),
759
- merchantName: z5.string(),
760
- merchantLogo: z5.string().optional(),
761
- itemLogo: z5.string().optional()
850
+ import { z as z6 } from "zod";
851
+ var bumpInVoucherSchema = z6.object({
852
+ prizeId: z6.string(),
853
+ voucherName: z6.string(),
854
+ voucherType: z6.string(),
855
+ reductionAmount: z6.string(),
856
+ thresholdAmountText: z6.string(),
857
+ unit: z6.string(),
858
+ merchantName: z6.string(),
859
+ merchantLogo: z6.string().optional(),
860
+ itemLogo: z6.string().optional()
762
861
  });
763
- var bumpInActStatusSchema = z5.enum([
862
+ var bumpInActStatusSchema = z6.enum([
764
863
  "NOT_START",
765
864
  "INIT",
766
865
  "PROCESSING",
767
866
  "FINISH",
768
867
  "RECEIVED"
769
868
  ]);
770
- var promotionBumpInActivityCardDataSchema = z5.object({
771
- activityRef: z5.string(),
772
- title: z5.string(),
773
- mainTitle: z5.string().optional(),
774
- coverUrl: z5.string().optional(),
869
+ var promotionBumpInActivityCardDataSchema = z6.object({
870
+ activityRef: z6.string(),
871
+ title: z6.string(),
872
+ mainTitle: z6.string().optional(),
873
+ coverUrl: z6.string().optional(),
775
874
  /** 联单活动全幅背景图 URL(与 coverUrl 互斥;backgroundUrl 存在时头部采用全幅覆盖布局) */
776
- backgroundUrl: z5.string().optional(),
875
+ backgroundUrl: z6.string().optional(),
777
876
  /** 左上角活动类型胶囊标签,如"碰一下联单" */
778
- tagLabel: z5.string().optional(),
779
- cardLogoUrl: z5.string().optional(),
877
+ tagLabel: z6.string().optional(),
878
+ cardLogoUrl: z6.string().optional(),
780
879
  actStatus: bumpInActStatusSchema,
781
- totalProgress: z5.string().optional(),
782
- currentProgress: z5.string().optional(),
783
- progressUnit: z5.string().optional(),
784
- startAtText: z5.string().optional(),
785
- endAtText: z5.string().optional(),
786
- description: z5.string().optional(),
787
- vouchers: z5.array(bumpInVoucherSchema),
788
- mode: z5.enum(["detail", "banner"]).default("detail"),
880
+ totalProgress: z6.string().optional(),
881
+ currentProgress: z6.string().optional(),
882
+ progressUnit: z6.string().optional(),
883
+ startAtText: z6.string().optional(),
884
+ endAtText: z6.string().optional(),
885
+ description: z6.string().optional(),
886
+ vouchers: z6.array(bumpInVoucherSchema),
887
+ mode: z6.enum(["detail", "banner"]).default("detail"),
789
888
  /** bar(线性进度条,默认)| steps(圆形步骤节点,适合联单任务) */
790
- progressStyle: z5.enum(["bar", "steps"]).default("bar"),
889
+ progressStyle: z6.enum(["bar", "steps"]).default("bar"),
791
890
  /** 参与步骤(联单活动 guide.steps;banner 模式用于渲染步骤进度节点) */
792
- steps: z5.array(z5.object({ title: z5.string(), description: z5.string().optional() })).optional()
891
+ steps: z6.array(z6.object({ title: z6.string(), description: z6.string().optional() })).optional()
793
892
  });
794
893
 
795
894
  // src/promotion/cards.ts
796
- var imageUrlSchema = z6.string().max(2048).optional();
797
- var freeCouponClaimModeSchema = z6.enum(["DIRECT", "REDIRECT"]);
798
- var offerSummarySchema = z6.object({
799
- offerRef: z6.string().min(1),
800
- title: z6.string().min(1),
801
- subtitle: z6.string().optional(),
802
- offerType: z6.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
895
+ var imageUrlSchema = z7.string().max(2048).optional();
896
+ var freeCouponClaimModeSchema = z7.enum(["DIRECT", "REDIRECT"]);
897
+ var offerSummarySchema = z7.object({
898
+ offerRef: z7.string().min(1),
899
+ title: z7.string().min(1),
900
+ subtitle: z7.string().optional(),
901
+ offerType: z7.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
803
902
  /** 主 facet 一句话(如「满 100 减 20」) */
804
- benefitText: z6.string().optional(),
903
+ benefitText: z7.string().optional(),
805
904
  /** 使用门槛(如「满 300 元可用」) */
806
- thresholdText: z6.string().optional(),
905
+ thresholdText: z7.string().optional(),
807
906
  /**
808
907
  * 券的**售价**展示,与 benefitText 是两回事——后者说优惠内容,这里说买这张券要花多少。
809
908
  * 免费券给「免费」,付费券给「¥28.8」。文案由 provider 直接给:各厂商币种、小数位与
810
909
  * 「免费/0 元」措辞不一,客户端不做数值运算也不反解金额。
811
910
  */
812
- priceText: z6.string().optional(),
911
+ priceText: z7.string().optional(),
813
912
  /** 划线原价(如「¥38.8」)。与 priceText 成对出现才有意义,单独给不渲染。 */
814
- originalPriceText: z6.string().optional(),
913
+ originalPriceText: z7.string().optional(),
815
914
  /** 折扣角标(如「7.5折」)。同样是 provider 直出文案,不由前端拿两个价格算。 */
816
- discountLabel: z6.string().optional(),
915
+ discountLabel: z7.string().optional(),
817
916
  /**
818
917
  * 领取按钮文案:免费券「领取」、付费券「抢购」。由 provider 给而非前端按 priceText
819
918
  * 猜——「免费」的写法各家不同,猜错就把付费券写成领取。缺省回落「领取」。
820
919
  */
821
- claimActionLabel: z6.string().optional(),
822
- purchaseUrl: z6.string().max(2048).optional(),
920
+ claimActionLabel: z7.string().optional(),
921
+ purchaseUrl: z7.string().max(2048).optional(),
823
922
  freeCouponClaimMode: freeCouponClaimModeSchema.optional(),
824
923
  /**
825
924
  * 下面三条供**列表内的详情浮层**渲染——浮层就地展开,没有二次请求可拉,
826
925
  * 需要的信息必须随列表一起下发。厂商不给就不渲染对应区块。
827
926
  */
828
- stockText: z6.string().optional(),
829
- usageNoticeText: z6.string().optional(),
830
- guaranteeText: z6.string().optional(),
831
- usageSceneText: z6.string().optional(),
832
- usageTimeText: z6.string().optional(),
833
- claimTimeText: z6.string().optional(),
834
- usageRuleText: z6.string().optional(),
927
+ stockText: z7.string().optional(),
928
+ usageNoticeText: z7.string().optional(),
929
+ guaranteeText: z7.string().optional(),
930
+ usageSceneText: z7.string().optional(),
931
+ usageTimeText: z7.string().optional(),
932
+ claimTimeText: z7.string().optional(),
933
+ usageRuleText: z7.string().optional(),
835
934
  /** 可领取(availability.status === 'AVAILABLE') */
836
- claimable: z6.boolean(),
837
- availabilityStatus: z6.enum(["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]).optional(),
838
- validityText: z6.string().optional(),
935
+ claimable: z7.boolean(),
936
+ availabilityStatus: z7.enum(["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]).optional(),
937
+ validityText: z7.string().optional(),
839
938
  imageUrl: imageUrlSchema,
840
939
  /** 0.3.2 条目动作(send:查看详情) */
841
- itemActions: z6.array(actionDraftSchema).optional(),
842
- tags: z6.array(z6.string())
940
+ itemActions: z7.array(actionDraftSchema).optional(),
941
+ tags: z7.array(z7.string())
843
942
  });
844
- var promotionOfferListCardDataSchema = z6.object({
845
- presentation: z6.enum(["offer", "promotion", "coupon", "recommendation"]).optional(),
846
- mode: z6.enum(["search", "claimable", "recommend"]),
943
+ var promotionOfferListCardDataSchema = z7.object({
944
+ presentation: z7.enum(["offer", "promotion", "coupon", "recommendation"]).optional(),
945
+ mode: z7.enum(["search", "claimable", "recommend"]),
847
946
  /** 客户端默认展示 4 条;传入正整数可覆盖该上限。 */
848
- maxItems: z6.number().int().positive().optional(),
849
- summary: z6.string().optional(),
850
- items: z6.array(offerSummarySchema),
851
- noResultsReason: z6.string().optional(),
852
- nextCursor: z6.string().optional()
947
+ maxItems: z7.number().int().positive().optional(),
948
+ summary: z7.string().optional(),
949
+ items: z7.array(offerSummarySchema),
950
+ noResultsReason: z7.string().optional(),
951
+ nextCursor: z7.string().optional()
853
952
  });
854
- var promotionOfferDetailCardDataSchema = z6.object({
855
- presentation: z6.enum(["offer", "promotion", "promotion-guide", "coupon", "package"]).optional(),
856
- offerRef: z6.string().min(1),
857
- title: z6.string().min(1),
858
- offerType: z6.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
859
- subtitle: z6.string().optional(),
860
- description: z6.string().optional(),
953
+ var promotionOfferDetailCardDataSchema = z7.object({
954
+ presentation: z7.enum(["offer", "promotion", "promotion-guide", "coupon", "package"]).optional(),
955
+ offerRef: z7.string().min(1),
956
+ title: z7.string().min(1),
957
+ offerType: z7.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
958
+ subtitle: z7.string().optional(),
959
+ description: z7.string().optional(),
861
960
  imageUrl: imageUrlSchema,
862
- benefitText: z6.string().optional(),
863
- thresholdText: z6.string().optional(),
864
- validityText: z6.string().optional(),
961
+ benefitText: z7.string().optional(),
962
+ thresholdText: z7.string().optional(),
963
+ validityText: z7.string().optional(),
865
964
  /** 售价三件套,语义同 offerSummary(provider 直出文案,前端不做运算) */
866
- priceText: z6.string().optional(),
867
- originalPriceText: z6.string().optional(),
868
- discountLabel: z6.string().optional(),
869
- claimActionLabel: z6.string().optional(),
870
- purchaseUrl: z6.string().max(2048).optional(),
965
+ priceText: z7.string().optional(),
966
+ originalPriceText: z7.string().optional(),
967
+ discountLabel: z7.string().optional(),
968
+ claimActionLabel: z7.string().optional(),
969
+ purchaseUrl: z7.string().max(2048).optional(),
871
970
  /** 剩余库存文案(如「剩余:29」);厂商不给就不展示,别拿 0 当「售罄」用 */
872
- stockText: z6.string().optional(),
873
- usageNoticeText: z6.string().optional(),
971
+ stockText: z7.string().optional(),
972
+ usageNoticeText: z7.string().optional(),
874
973
  /** 核销场景(如「万铺小二核销」)——告诉用户这张券在哪、怎么用掉 */
875
- usageSceneText: z6.string().optional(),
876
- usageTimeText: z6.string().optional(),
877
- claimTimeText: z6.string().optional(),
878
- usageRuleText: z6.string().optional(),
879
- guaranteeText: z6.string().optional(),
974
+ usageSceneText: z7.string().optional(),
975
+ usageTimeText: z7.string().optional(),
976
+ claimTimeText: z7.string().optional(),
977
+ usageRuleText: z7.string().optional(),
978
+ guaranteeText: z7.string().optional(),
880
979
  /** 使用规则/参与步骤 */
881
- rules: z6.array(z6.string()),
882
- participationMode: z6.enum([
980
+ rules: z7.array(z7.string()),
981
+ participationMode: z7.enum([
883
982
  "AUTOMATIC_DISCOUNT",
884
983
  "CLAIM_THEN_PURCHASE",
885
984
  "REGISTER_THEN_ATTEND",
886
985
  "GROUP_PURCHASE",
887
986
  "UNKNOWN"
888
987
  ]).optional(),
889
- steps: z6.array(z6.object({ title: z6.string(), description: z6.string().optional() })).optional(),
890
- requirements: z6.array(z6.string()).optional(),
891
- notice: z6.string().optional(),
988
+ steps: z7.array(z7.object({ title: z7.string(), description: z7.string().optional() })).optional(),
989
+ requirements: z7.array(z7.string()).optional(),
990
+ notice: z7.string().optional(),
892
991
  /** 厂商可提供时展示适用门店;可选以兼容历史卡数据。 */
893
- stores: z6.array(z6.object({
894
- storeId: z6.string().min(1),
895
- storeName: z6.string().min(1),
896
- businessName: z6.string().optional(),
897
- address: z6.string().optional(),
898
- floor: z6.string().optional()
992
+ stores: z7.array(z7.object({
993
+ storeId: z7.string().min(1),
994
+ storeName: z7.string().min(1),
995
+ businessName: z7.string().optional(),
996
+ address: z7.string().optional(),
997
+ floor: z7.string().optional()
899
998
  })).optional(),
900
- bundleItems: z6.array(z6.object({ name: z6.string(), quantity: z6.number().int().positive() })).optional(),
999
+ bundleItems: z7.array(z7.object({ name: z7.string(), quantity: z7.number().int().positive() })).optional(),
901
1000
  /** 领取动作是否可用(未登录会员/不可用 → false + unavailableReason) */
902
- claimable: z6.boolean(),
903
- unavailableReason: z6.string().optional(),
904
- caveats: z6.array(z6.string())
1001
+ claimable: z7.boolean(),
1002
+ unavailableReason: z7.string().optional(),
1003
+ caveats: z7.array(z7.string())
905
1004
  });
906
- var promotionEntitlementListCardDataSchema = z6.object({
907
- mallId: z6.string().optional(),
908
- miniAppId: z6.string().optional(),
1005
+ var promotionEntitlementListCardDataSchema = z7.object({
1006
+ mallId: z7.string().optional(),
1007
+ miniAppId: z7.string().optional(),
909
1008
  /** 客户端默认展示 4 条;传入正整数可覆盖该上限。 */
910
- maxItems: z6.number().int().positive().optional(),
911
- items: z6.array(
912
- z6.object({
913
- entitlementRef: z6.string().min(1),
914
- title: z6.string().min(1),
1009
+ maxItems: z7.number().int().positive().optional(),
1010
+ items: z7.array(
1011
+ z7.object({
1012
+ entitlementRef: z7.string().min(1),
1013
+ title: z7.string().min(1),
915
1014
  imageUrl: imageUrlSchema,
916
- entitlementType: z6.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
917
- status: z6.enum(["EFFECTIVE", "USED", "EXPIRED", "INVALID", "UNKNOWN"]),
918
- codeMasked: z6.string().optional(),
919
- code: z6.string().optional(),
920
- qrCodeEnabled: z6.boolean().optional(),
921
- benefitText: z6.string().optional(),
922
- thresholdText: z6.string().optional(),
923
- usageNotice: z6.string().optional(),
924
- guaranteeText: z6.string().optional(),
925
- usageSceneText: z6.string().optional(),
926
- usageTimeText: z6.string().optional(),
927
- claimTimeText: z6.string().optional(),
928
- usageRuleText: z6.string().optional(),
929
- validityText: z6.string().optional(),
930
- validUntilText: z6.string().optional(),
1015
+ entitlementType: z7.enum(["COUPON", "BUNDLE", "PROMOTION", "ACTIVITY", "GROUPON"]),
1016
+ status: z7.enum(["EFFECTIVE", "USED", "EXPIRED", "INVALID", "UNKNOWN"]),
1017
+ codeMasked: z7.string().optional(),
1018
+ code: z7.string().optional(),
1019
+ qrCodeEnabled: z7.boolean().optional(),
1020
+ benefitText: z7.string().optional(),
1021
+ thresholdText: z7.string().optional(),
1022
+ usageNotice: z7.string().optional(),
1023
+ guaranteeText: z7.string().optional(),
1024
+ usageSceneText: z7.string().optional(),
1025
+ usageTimeText: z7.string().optional(),
1026
+ claimTimeText: z7.string().optional(),
1027
+ usageRuleText: z7.string().optional(),
1028
+ validityText: z7.string().optional(),
1029
+ validUntilText: z7.string().optional(),
931
1030
  /** 0.3.2 条目动作(send:查看详情) */
932
- itemActions: z6.array(actionDraftSchema).optional(),
933
- stores: z6.array(z6.object({
934
- storeId: z6.string(),
935
- storeName: z6.string(),
936
- businessName: z6.string().optional(),
1031
+ itemActions: z7.array(actionDraftSchema).optional(),
1032
+ stores: z7.array(z7.object({
1033
+ storeId: z7.string(),
1034
+ storeName: z7.string(),
1035
+ businessName: z7.string().optional(),
937
1036
  imageUrl: imageUrlSchema,
938
- address: z6.string().optional(),
939
- floor: z6.string().optional(),
940
- latitude: z6.number().optional(),
941
- longitude: z6.number().optional()
1037
+ address: z7.string().optional(),
1038
+ floor: z7.string().optional(),
1039
+ latitude: z7.number().optional(),
1040
+ longitude: z7.number().optional()
942
1041
  })).optional()
943
1042
  })
944
1043
  ),
945
- noResultsReason: z6.string().optional(),
946
- nextCursor: z6.string().optional()
1044
+ noResultsReason: z7.string().optional(),
1045
+ nextCursor: z7.string().optional()
947
1046
  });
948
- var promotionActivityCategoryListCardDataSchema = z6.object({
949
- items: z6.array(
950
- z6.object({
951
- categoryId: z6.string().min(1),
952
- name: z6.string().min(1),
953
- parentId: z6.string().optional(),
954
- itemActions: z6.array(actionDraftSchema).optional()
1047
+ var promotionActivityCategoryListCardDataSchema = z7.object({
1048
+ items: z7.array(
1049
+ z7.object({
1050
+ categoryId: z7.string().min(1),
1051
+ name: z7.string().min(1),
1052
+ parentId: z7.string().optional(),
1053
+ itemActions: z7.array(actionDraftSchema).optional()
955
1054
  })
956
1055
  ),
957
- noResultsReason: z6.string().optional()
1056
+ noResultsReason: z7.string().optional()
958
1057
  });
959
- var promotionBestDealCardDataSchema = z6.object({
960
- authoritative: z6.boolean(),
961
- originalAmountCents: z6.number().int().min(0),
962
- savingsCents: z6.number().int().min(0).optional(),
963
- expectedPayCents: z6.number().int().min(0).optional(),
964
- appliedOfferRefs: z6.array(z6.string()),
965
- candidates: z6.array(offerSummarySchema).optional(),
966
- message: z6.string().optional()
1058
+ var promotionBestDealCardDataSchema = z7.object({
1059
+ authoritative: z7.boolean(),
1060
+ originalAmountCents: z7.number().int().min(0),
1061
+ savingsCents: z7.number().int().min(0).optional(),
1062
+ expectedPayCents: z7.number().int().min(0).optional(),
1063
+ appliedOfferRefs: z7.array(z7.string()),
1064
+ candidates: z7.array(offerSummarySchema).optional(),
1065
+ message: z7.string().optional()
967
1066
  });
968
- var promotionActivityListCardDataSchema = z6.object({
969
- items: z6.array(
970
- z6.object({
971
- activityRef: z6.string().min(1),
972
- title: z6.string().min(1),
973
- subtitle: z6.string().optional(),
1067
+ var promotionActivityListCardDataSchema = z7.object({
1068
+ items: z7.array(
1069
+ z7.object({
1070
+ activityRef: z7.string().min(1),
1071
+ title: z7.string().min(1),
1072
+ subtitle: z7.string().optional(),
974
1073
  coverUrl: imageUrlSchema,
975
- registrationRequired: z6.boolean(),
976
- jumpOnly: z6.boolean().optional(),
977
- jumpLabel: z6.string().min(1).optional(),
978
- remainingQuota: z6.number().int().min(0).optional(),
979
- periodText: z6.string().optional(),
980
- categoryName: z6.string().optional(),
981
- availabilityStatus: z6.enum(["AVAILABLE", "FULL", "ENDED", "UPCOMING", "UNKNOWN"]).optional(),
982
- itemActions: z6.array(actionDraftSchema).optional()
1074
+ registrationRequired: z7.boolean(),
1075
+ jumpOnly: z7.boolean().optional(),
1076
+ jumpLabel: z7.string().min(1).optional(),
1077
+ remainingQuota: z7.number().int().min(0).optional(),
1078
+ periodText: z7.string().optional(),
1079
+ categoryName: z7.string().optional(),
1080
+ availabilityStatus: z7.enum(["AVAILABLE", "FULL", "ENDED", "UPCOMING", "UNKNOWN"]).optional(),
1081
+ itemActions: z7.array(actionDraftSchema).optional()
983
1082
  })
984
1083
  ),
985
- noResultsReason: z6.string().optional(),
986
- nextCursor: z6.string().optional()
1084
+ noResultsReason: z7.string().optional(),
1085
+ nextCursor: z7.string().optional()
987
1086
  });
988
- var promotionActivityDetailCardDataSchema = z6.object({
989
- presentation: z6.enum(["detail", "schedule", "guide"]).optional(),
990
- activityRef: z6.string().min(1),
991
- title: z6.string().min(1),
992
- subtitle: z6.string().optional(),
993
- categoryName: z6.string().optional(),
994
- description: z6.string().optional(),
1087
+ var promotionActivityDetailCardDataSchema = z7.object({
1088
+ presentation: z7.enum(["detail", "schedule", "guide"]).optional(),
1089
+ activityRef: z7.string().min(1),
1090
+ title: z7.string().min(1),
1091
+ subtitle: z7.string().optional(),
1092
+ categoryName: z7.string().optional(),
1093
+ description: z7.string().optional(),
995
1094
  coverUrl: imageUrlSchema,
996
- periodText: z6.string().optional(),
997
- location: z6.string().optional(),
998
- registrationRequired: z6.boolean(),
999
- jumpOnly: z6.boolean().optional(),
1000
- jumpLabel: z6.string().min(1).optional(),
1095
+ periodText: z7.string().optional(),
1096
+ location: z7.string().optional(),
1097
+ registrationRequired: z7.boolean(),
1098
+ jumpOnly: z7.boolean().optional(),
1099
+ jumpLabel: z7.string().min(1).optional(),
1001
1100
  /** 需报名时直达厂商支付宝小程序活动详情;由客户端 openLink 本地处理。 */
1002
- registrationUrl: z6.string().max(2048).optional(),
1003
- remainingQuota: z6.number().int().min(0).optional(),
1004
- sessions: z6.array(
1005
- z6.object({
1006
- sessionRef: z6.string(),
1007
- title: z6.string(),
1008
- startText: z6.string(),
1009
- endText: z6.string().optional(),
1010
- location: z6.string().optional(),
1011
- remainingQuota: z6.number().int().min(0).optional(),
1012
- status: z6.enum(["OPEN", "FULL", "CLOSED", "UNKNOWN"])
1101
+ registrationUrl: z7.string().max(2048).optional(),
1102
+ remainingQuota: z7.number().int().min(0).optional(),
1103
+ sessions: z7.array(
1104
+ z7.object({
1105
+ sessionRef: z7.string(),
1106
+ title: z7.string(),
1107
+ startText: z7.string(),
1108
+ endText: z7.string().optional(),
1109
+ location: z7.string().optional(),
1110
+ remainingQuota: z7.number().int().min(0).optional(),
1111
+ status: z7.enum(["OPEN", "FULL", "CLOSED", "UNKNOWN"])
1013
1112
  })
1014
1113
  ),
1015
- guideSteps: z6.array(z6.string()),
1016
- guideItems: z6.array(z6.object({ title: z6.string(), description: z6.string().optional() })).optional(),
1017
- conditions: z6.array(z6.string()),
1018
- notice: z6.string().optional()
1114
+ guideSteps: z7.array(z7.string()),
1115
+ guideItems: z7.array(z7.object({ title: z7.string(), description: z7.string().optional() })).optional(),
1116
+ conditions: z7.array(z7.string()),
1117
+ notice: z7.string().optional()
1019
1118
  });
1020
1119
  var promotionCardDataSchemas = {
1021
1120
  "promotion-offer-list": promotionOfferListCardDataSchema,
@@ -1028,172 +1127,172 @@ var promotionCardDataSchemas = {
1028
1127
  };
1029
1128
 
1030
1129
  // src/parking/cards.ts
1031
- import { z as z7 } from "zod";
1032
- var parkingOrderInfoSchema = z7.object({
1130
+ import { z as z8 } from "zod";
1131
+ var parkingOrderInfoSchema = z8.object({
1033
1132
  /** 停车秒数 */
1034
- staySecond: z7.number().int().nonnegative().optional(),
1133
+ staySecond: z8.number().int().nonnegative().optional(),
1035
1134
  /** 停车费,单位分 */
1036
- parkingFee: z7.number().int().nonnegative().optional(),
1135
+ parkingFee: z8.number().int().nonnegative().optional(),
1037
1136
  /** 车牌绑定状态 */
1038
- bindingStatus: z7.number().int().optional(),
1137
+ bindingStatus: z8.number().int().optional(),
1039
1138
  /** 车牌 */
1040
- plateNumber: z7.string().min(1).optional(),
1139
+ plateNumber: z8.string().min(1).optional(),
1041
1140
  /** 1=在场缴费,2=逃费/欠费 */
1042
- orderType: z7.number().int(),
1141
+ orderType: z8.number().int(),
1043
1142
  /** 车场侧订单号 */
1044
- spParkingOrderId: z7.string().min(1).optional(),
1143
+ spParkingOrderId: z8.string().min(1).optional(),
1045
1144
  /** 车场 ID(协议定 string) */
1046
- parkingId: z7.string().min(1),
1145
+ parkingId: z8.string().min(1),
1047
1146
  /** 入场时间 */
1048
- entranceTime: z7.string().min(1).optional(),
1147
+ entranceTime: z8.string().min(1).optional(),
1049
1148
  /** 逗号分隔的能力枚举,如 "LEVEL_DISCOUNT,POINT_DISCOUNT,COUPON" */
1050
- supportDiscount: z7.string().min(1).optional()
1149
+ supportDiscount: z8.string().min(1).optional()
1051
1150
  });
1052
- var parkingPaymentCardDataSchema = z7.object({
1053
- quoteRef: z7.string().min(1),
1054
- plateNo: z7.string().min(1),
1055
- entryAtText: z7.string().optional(),
1056
- durationText: z7.string().optional(),
1151
+ var parkingPaymentCardDataSchema = z8.object({
1152
+ quoteRef: z8.string().min(1),
1153
+ plateNo: z8.string().min(1),
1154
+ entryAtText: z8.string().optional(),
1155
+ durationText: z8.string().optional(),
1057
1156
  /** 费用明细(label + 金额字符串) */
1058
- feeItems: z7.array(z7.object({ name: z7.string(), amountText: z7.string() })),
1059
- totalText: z7.string(),
1060
- discountText: z7.string().optional(),
1061
- payableText: z7.string(),
1157
+ feeItems: z8.array(z8.object({ name: z8.string(), amountText: z8.string() })),
1158
+ totalText: z8.string(),
1159
+ discountText: z8.string().optional(),
1160
+ payableText: z8.string(),
1062
1161
  /** 当前请求主体的会员状态;旧历史卡可缺省。 */
1063
- membership: z7.object({
1064
- state: z7.enum(["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]),
1065
- availablePoints: z7.number().int().min(0).optional()
1162
+ membership: z8.object({
1163
+ state: z8.enum(["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]),
1164
+ availablePoints: z8.number().int().min(0).optional()
1066
1165
  }).optional(),
1067
1166
  /** 服务端归一化后的支付入口;客户端不解析权益标题。 */
1068
- paymentOptions: z7.object({
1069
- direct: z7.object({
1167
+ paymentOptions: z8.object({
1168
+ direct: z8.object({
1070
1169
  /** 已应用积分时 Provider 未必能预览无积分金额;缺省时客户端不得提前承诺金额。 */
1071
- payableText: z7.string().optional(),
1072
- benefitRefs: z7.array(z7.string())
1170
+ payableText: z8.string().optional(),
1171
+ benefitRefs: z8.array(z8.string())
1073
1172
  }),
1074
- points: z7.discriminatedUnion("kind", [
1075
- z7.object({
1076
- kind: z7.literal("exact"),
1077
- pointsToUse: z7.number().int().positive(),
1078
- payableText: z7.string(),
1079
- benefitRefs: z7.array(z7.string()).min(1)
1173
+ points: z8.discriminatedUnion("kind", [
1174
+ z8.object({
1175
+ kind: z8.literal("exact"),
1176
+ pointsToUse: z8.number().int().positive(),
1177
+ payableText: z8.string(),
1178
+ benefitRefs: z8.array(z8.string()).min(1)
1080
1179
  }),
1081
- z7.object({
1082
- kind: z7.literal("requires_reprice"),
1083
- title: z7.string().min(1),
1084
- benefitRefs: z7.array(z7.string()).min(1)
1180
+ z8.object({
1181
+ kind: z8.literal("requires_reprice"),
1182
+ title: z8.string().min(1),
1183
+ benefitRefs: z8.array(z8.string()).min(1)
1085
1184
  })
1086
1185
  ]).optional()
1087
1186
  }).optional(),
1088
1187
  /** 已生效权益 */
1089
- appliedBenefits: z7.array(
1090
- z7.object({
1091
- benefitRef: z7.string(),
1092
- title: z7.string(),
1093
- discountText: z7.string().optional()
1188
+ appliedBenefits: z8.array(
1189
+ z8.object({
1190
+ benefitRef: z8.string(),
1191
+ title: z8.string(),
1192
+ discountText: z8.string().optional()
1094
1193
  })
1095
1194
  ),
1096
1195
  /** 可变更权益(reprice 候选;autoSelected 预勾选) */
1097
- selectableBenefits: z7.array(
1098
- z7.object({
1099
- benefitRef: z7.string(),
1100
- title: z7.string(),
1101
- autoSelected: z7.boolean(),
1102
- description: z7.string().optional(),
1196
+ selectableBenefits: z8.array(
1197
+ z8.object({
1198
+ benefitRef: z8.string(),
1199
+ title: z8.string(),
1200
+ autoSelected: z8.boolean(),
1201
+ description: z8.string().optional(),
1103
1202
  /** 权益类型(券 / 积分抵扣 / 等级权益);客户端据此分组与判定互斥,不得从标题猜测 */
1104
- kind: z7.enum(["points", "discount", "coupon", "other"]).optional(),
1203
+ kind: z8.enum(["points", "discount", "coupon", "other"]).optional(),
1105
1204
  /** 预估优惠金额文案(本地展示用;权威金额以 reprice 回填为准) */
1106
- discountText: z7.string().optional(),
1205
+ discountText: z8.string().optional(),
1107
1206
  /**
1108
1207
  * 与本权益互斥的类型。三类优惠默认可叠加,互斥是厂商按券配置的例外——
1109
1208
  * 标记 ['points'] 表示该券不可与积分抵扣叠加。判定双向生效。
1110
1209
  */
1111
- exclusiveWithKinds: z7.array(z7.enum(["points", "discount", "coupon"])).optional()
1210
+ exclusiveWithKinds: z8.array(z8.enum(["points", "discount", "coupon"])).optional()
1112
1211
  })
1113
1212
  ),
1114
1213
  /** 乐观锁(提交校验;过期 → 提示重新查询) */
1115
- revision: z7.number().int().min(1),
1116
- caveats: z7.array(z7.string()),
1214
+ revision: z8.number().int().min(1),
1215
+ caveats: z8.array(z8.string()),
1117
1216
  /**
1118
1217
  * 支付交接包:客户端卡据 kind 调壳 tbox 能力收款——
1119
1218
  * kind:'pay' → openParkingPay(传 orderInfo,壳跳确认页/收银台);kind:'unpaid' → openParkingUnpaidOrder(传 orderNo)。
1120
1219
  * 缺省 = 走内部 confirm-payment(line)支付链。
1121
1220
  */
1122
- payHandoff: z7.object({
1123
- kind: z7.enum(["pay", "unpaid"]),
1124
- parkingStoreId: z7.string().min(1).optional(),
1221
+ payHandoff: z8.object({
1222
+ kind: z8.enum(["pay", "unpaid"]),
1223
+ parkingStoreId: z8.string().min(1).optional(),
1125
1224
  orderInfo: parkingOrderInfoSchema.optional(),
1126
- orderNo: z7.string().min(1).optional()
1225
+ orderNo: z8.string().min(1).optional()
1127
1226
  }).optional(),
1128
1227
  /**
1129
1228
  * 支付进度(缺省 = 未发起):一经写入这张报价单即终结,按钮恒置灰。
1130
1229
  * 报价是一次性的(token singleUse + revision 乐观锁),发起支付后不可再提交。
1131
1230
  */
1132
- settlement: z7.object({
1133
- state: z7.enum(["paying", "paid", "failed"]),
1134
- text: z7.string().min(1)
1231
+ settlement: z8.object({
1232
+ state: z8.enum(["paying", "paid", "failed"]),
1233
+ text: z8.string().min(1)
1135
1234
  }).optional()
1136
1235
  });
1137
- var parkingPaymentResultCardDataSchema = z7.object({
1138
- paymentRef: z7.string().min(1),
1139
- plateNo: z7.string(),
1140
- status: z7.enum(["PAID", "CANCELLED", "UNKNOWN"]),
1141
- amountText: z7.string().optional(),
1142
- message: z7.string(),
1236
+ var parkingPaymentResultCardDataSchema = z8.object({
1237
+ paymentRef: z8.string().min(1),
1238
+ plateNo: z8.string(),
1239
+ status: z8.enum(["PAID", "CANCELLED", "UNKNOWN"]),
1240
+ amountText: z8.string().optional(),
1241
+ message: z8.string(),
1143
1242
  /** 失败/取消:可重新发起(重新查询报价) */
1144
- retryable: z7.boolean().optional(),
1243
+ retryable: z8.boolean().optional(),
1145
1244
  /** 离场时限提醒(PAID:缴费后免费离场窗口,超时重新计费) */
1146
- leaveNotice: z7.string().optional(),
1245
+ leaveNotice: z8.string().optional(),
1147
1246
  /** 回执明细(车牌 / 停车时长 / 缴费时间等,服务端已格式化) */
1148
- details: z7.array(z7.object({ label: z7.string(), value: z7.string() })).optional()
1247
+ details: z8.array(z8.object({ label: z8.string(), value: z8.string() })).optional()
1149
1248
  });
1150
- var parkingPaymentRecordsCardDataSchema = z7.object({
1151
- items: z7.array(
1152
- z7.object({
1153
- recordRef: z7.string().min(1),
1154
- plateNo: z7.string(),
1155
- amountText: z7.string(),
1156
- paidAtText: z7.string(),
1157
- status: z7.enum(["PAID", "REFUNDED", "CLOSED", "UNKNOWN"]),
1158
- statusText: z7.string().optional(),
1159
- parkName: z7.string().optional(),
1160
- plazaName: z7.string().optional(),
1249
+ var parkingPaymentRecordsCardDataSchema = z8.object({
1250
+ items: z8.array(
1251
+ z8.object({
1252
+ recordRef: z8.string().min(1),
1253
+ plateNo: z8.string(),
1254
+ amountText: z8.string(),
1255
+ paidAtText: z8.string(),
1256
+ status: z8.enum(["PAID", "REFUNDED", "CLOSED", "UNKNOWN"]),
1257
+ statusText: z8.string().optional(),
1258
+ parkName: z8.string().optional(),
1259
+ plazaName: z8.string().optional(),
1161
1260
  /** 展开态字段(entry/exit/单号脱敏) */
1162
- entryAtText: z7.string().optional(),
1163
- exitAtText: z7.string().optional(),
1164
- payOrderNoMasked: z7.string().optional(),
1165
- orderCompleted: z7.boolean().optional(),
1166
- invoiceEligible: z7.boolean().optional(),
1167
- invoiceIssued: z7.boolean().optional()
1261
+ entryAtText: z8.string().optional(),
1262
+ exitAtText: z8.string().optional(),
1263
+ payOrderNoMasked: z8.string().optional(),
1264
+ orderCompleted: z8.boolean().optional(),
1265
+ invoiceEligible: z8.boolean().optional(),
1266
+ invoiceIssued: z8.boolean().optional()
1168
1267
  })
1169
1268
  ),
1170
- total: z7.number().int().min(0),
1171
- hasMore: z7.boolean(),
1269
+ total: z8.number().int().min(0),
1270
+ hasMore: z8.boolean(),
1172
1271
  /** 厂商口径 caveats(厂商事实,7 条并入) */
1173
- caveats: z7.array(z7.string()),
1272
+ caveats: z8.array(z8.string()),
1174
1273
  /** 详情加载、开票提交等动作反馈 */
1175
- message: z7.string().optional()
1274
+ message: z8.string().optional()
1176
1275
  });
1177
- var parkingVehicleManagementCardDataSchema = z7.object({
1178
- bound: z7.array(z7.object({
1179
- vehicleRef: z7.string(),
1180
- plateNo: z7.string(),
1181
- parked: z7.boolean().optional()
1276
+ var parkingVehicleManagementCardDataSchema = z8.object({
1277
+ bound: z8.array(z8.object({
1278
+ vehicleRef: z8.string(),
1279
+ plateNo: z8.string(),
1280
+ parked: z8.boolean().optional()
1182
1281
  })),
1183
- message: z7.string().optional(),
1282
+ message: z8.string().optional(),
1184
1283
  /**
1185
1284
  * 会员状态(缺省 = 未探测):仅 not_enrolled 才展示入会引导。
1186
1285
  * 与 parking-payment 的 membership 同源,避免两张卡对同一用户给出不同判断。
1187
1286
  */
1188
- membership: z7.object({
1189
- state: z7.enum(["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"])
1287
+ membership: z8.object({
1288
+ state: z8.enum(["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"])
1190
1289
  }).optional()
1191
1290
  });
1192
1291
  var PARKING_PLATE_PATTERN = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-HJ-NP-Z][A-HJ-NP-Z](?:[A-HJ-NP-Z0-9]{6}|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])$/;
1193
- var parkingInfoCardDataSchema = z7.object({
1194
- kind: z7.enum(["chargeRules", "benefitPolicy", "vehicleLocation"]),
1195
- title: z7.string().min(1),
1196
- entries: z7.array(z7.object({ label: z7.string(), value: z7.string() }))
1292
+ var parkingInfoCardDataSchema = z8.object({
1293
+ kind: z8.enum(["chargeRules", "benefitPolicy", "vehicleLocation"]),
1294
+ title: z8.string().min(1),
1295
+ entries: z8.array(z8.object({ label: z8.string(), value: z8.string() }))
1197
1296
  });
1198
1297
  var parkingCardDataSchemas = {
1199
1298
  "parking-payment": parkingPaymentCardDataSchema,
@@ -1202,7 +1301,30 @@ var parkingCardDataSchemas = {
1202
1301
  "parking-vehicle-management": parkingVehicleManagementCardDataSchema,
1203
1302
  "parking-info": parkingInfoCardDataSchema
1204
1303
  };
1304
+
1305
+ // src/activity-play/cards.ts
1306
+ import { z as z9 } from "zod";
1307
+ var activityPlayCardDataSchema = z9.object({
1308
+ /** 商圈标识:来自当前执行上下文 scope,非模型输入或硬编码值 */
1309
+ mallId: z9.string().min(1),
1310
+ /** 传输形态:list(列表,可空,≤50 项)/ detail(详情,恰好 1 项,可携 disabled) */
1311
+ mode: z9.enum(["list", "detail"]),
1312
+ /** 活动条目(契约单源 ActivityPlayActivity;不带 enabled 配置字段)——list 可空 ≤50 项 */
1313
+ items: z9.array(activityPlayActivitySchema).max(50)
1314
+ }).superRefine((data, ctx) => {
1315
+ if (data.mode === "detail" && data.items.length !== 1) {
1316
+ ctx.addIssue({
1317
+ code: z9.ZodIssueCode.custom,
1318
+ path: ["items"],
1319
+ message: "detail \u6A21\u5F0F items \u6070\u597D 1 \u9879\uFF08\u7A7A\u6216\u591A\u9879\u5747\u975E\u6CD5\uFF09"
1320
+ });
1321
+ }
1322
+ });
1205
1323
  export {
1324
+ ACTIVITY_PLAY_ENTRY_PROTOCOL_VERSION,
1325
+ ACTIVITY_PLAY_ENTRY_SERVICE,
1326
+ ACTIVITY_PLAY_QUERY_SERVICE,
1327
+ ACTIVITY_PLAY_TARGET_KIND,
1206
1328
  AUTH_LOGIN_SERVICE,
1207
1329
  MALL_INFO_SERVICE,
1208
1330
  MALL_SCOPE_KEY,
@@ -1230,6 +1352,19 @@ export {
1230
1352
  SHOPPING_DIRECTORY_SERVICE,
1231
1353
  SHOPPING_SHOPS_SERVICE,
1232
1354
  actionDraftSchema,
1355
+ activityPlayActivitySchema,
1356
+ activityPlayCardDataSchema,
1357
+ activityPlayDescriptionSchema,
1358
+ activityPlayDirectoryEntrySchema,
1359
+ activityPlayEntrySchema,
1360
+ activityPlayImageUrlSchema,
1361
+ activityPlayPluginAliasSchema,
1362
+ activityPlayRefSchema,
1363
+ activityPlayStatusOf,
1364
+ activityPlayTargetPageSchema,
1365
+ activityPlayTargetSchema,
1366
+ activityPlayTimeSchema,
1367
+ activityPlayTitleSchema,
1233
1368
  categoryListCardDataSchema,
1234
1369
  classifyMemberOutcome,
1235
1370
  createMallContextValidator,