@bi-nova/services 1.7.0-beta.202609181052 → 1.7.0-beta.202609231820

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bi-nova/services
2
2
 
3
- 跨平台广告服务 SDK,以 NovaSDK 插件形式提供京东保险口令、京东金融现金贷等业务服务。
3
+ 跨平台广告服务 SDK,以 NovaSDK 插件形式提供京东保险口令、京东金融现金贷、平台大会员等业务服务。
4
4
 
5
5
  支持环境:微信小程序、支付宝小程序、Taro、H5(浏览器)。
6
6
 
@@ -36,6 +36,8 @@ nova.use(createServices({
36
36
  const result = await nova.jd.handleJdInsurance({ equipmentValue: '...' })
37
37
  ```
38
38
 
39
+ 平台大会员接入请参阅 [平台大会员服务接入指南](/services/global-vip)。
40
+
39
41
 
40
42
  ## 登录态 token 管理
41
43
 
package/dist/index.d.mts CHANGED
@@ -472,7 +472,7 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
472
472
  * @Author: wutao
473
473
  * @Date: 2026-03-30
474
474
  * @LastEditors: wutao
475
- * @LastEditTime: 2026-07-07 15:47:52
475
+ * @LastEditTime: 2026-09-21 18:22:11
476
476
  *
477
477
  * 错误码分段规则:
478
478
  * - 0: 成功
@@ -482,7 +482,8 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
482
482
  * - 2200-2999: 预留其他京东业务
483
483
  * - 3000-3099: 抖音支付业务
484
484
  * - 3000-3999: 预留其他抖音业务
485
- * - 4000+: 预留其他平台业务
485
+ * - 4000-4099: 平台大会员业务
486
+ * - 4100+: 预留其他平台业务
486
487
  *
487
488
  * 命名规范:<业务模块>__<具体场景>
488
489
  * 示例:JD_CASH_LOAN__RTA_FAILED
@@ -619,13 +620,50 @@ declare enum DyErrorCode {
619
620
  * 抖音业务错误信息映射
620
621
  */
621
622
  declare const DyErrorMessage: Record<number, string>;
623
+ /**
624
+ * 平台大会员业务错误码枚举
625
+ */
626
+ declare enum GlobalVipErrorCode {
627
+ /** 缺少设备编号 */
628
+ GLOBAL_VIP__MISSING_EQUIPMENT_VALUE = 4001,
629
+ /** 缺少设备类型 */
630
+ GLOBAL_VIP__MISSING_EQUIPMENT_TYPE = 4002,
631
+ /** 无效的客户端类型 */
632
+ GLOBAL_VIP__INVALID_CLIENT_TYPE = 4003,
633
+ /** 入口资格查询失败 */
634
+ GLOBAL_VIP__ENTRANCE_CHECK_FAILED = 4004,
635
+ /** 未获取到卡类型 */
636
+ GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE = 4005,
637
+ /** 订阅配置查询失败 */
638
+ GLOBAL_VIP__CONFIG_FAILED = 4006,
639
+ /** 订阅配置无效 */
640
+ GLOBAL_VIP__INVALID_CONFIG = 4007,
641
+ /** 会员状态查询失败 */
642
+ GLOBAL_VIP__STATE_QUERY_FAILED = 4008,
643
+ /** 用户已开通会员 */
644
+ GLOBAL_VIP__ALREADY_ACTIVE = 4009,
645
+ /** 签约请求失败 */
646
+ GLOBAL_VIP__SIGN_FAILED = 4010,
647
+ /** 签约结果无效 */
648
+ GLOBAL_VIP__INVALID_SIGN_RESULT = 4011,
649
+ /** 权益查询失败 */
650
+ GLOBAL_VIP__BENEFIT_QUERY_FAILED = 4012,
651
+ /** 曝光记录失败 */
652
+ GLOBAL_VIP__EXPOSURE_FAILED = 4013,
653
+ /** 抖音优惠资格查询失败 */
654
+ GLOBAL_VIP__DISCOUNT_CHECK_FAILED = 4014,
655
+ /** 签约结果轮询失败 */
656
+ GLOBAL_VIP__POLL_FAILED = 4015
657
+ }
658
+ /** 平台大会员业务错误信息映射 */
659
+ declare const GlobalVipErrorMessage: Record<GlobalVipErrorCode, string>;
622
660
 
623
661
  /**
624
662
  * @Description: 广告配置接口类型定义
625
663
  * @Author: wutao
626
664
  * @Date: 2026-04-21
627
665
  * @LastEditors: wutao
628
- * @LastEditTime: 2026-09-14 17:19:39
666
+ * @LastEditTime: 2026-09-23 10:24:19
629
667
  */
630
668
  /**
631
669
  * 展示广告类型
@@ -817,7 +855,7 @@ interface AdvertConfigItem {
817
855
  }
818
856
  /** 产品 UI 配置展示模式 */
819
857
  type ProductConfigDisplayMode = 'banner' | 'popup' | 'half_screen' | 'mask';
820
- /** 产品 UI 配置接入系统编码 */
858
+ /** 产品 UI 配置接入系统编码(预留) */
821
859
  type ProductConfigSystemCode = 'lyy' | 'third';
822
860
  /** 产品 UI 配置动作 */
823
861
  interface ProductConfigAction {
@@ -851,6 +889,7 @@ interface ProductConfigApiData {
851
889
  id: number | string;
852
890
  placementId?: string;
853
891
  productCode?: string;
892
+ /** 预留系统编码,不参与配置有效性判断 */
854
893
  systemCode?: ProductConfigSystemCode;
855
894
  providerCode?: string;
856
895
  channelCode?: string;
@@ -945,7 +984,7 @@ declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<Build
945
984
  * @Author wutao
946
985
  * @Date 2026-09-09
947
986
  * @LastEditors wutao
948
- * @LastEditTime 2026-09-14 17:19:39
987
+ * @LastEditTime 2026-09-23 10:24:19
949
988
  */
950
989
  /** 产品投放位展示形态 */
951
990
  type ProductDisplayMode = 'banner' | 'popup' | 'half_screen';
@@ -975,7 +1014,6 @@ interface ProductPlacementAction {
975
1014
  businessCode?: string;
976
1015
  appId?: string;
977
1016
  path?: string;
978
- url?: string;
979
1017
  params: Record<string, string | number | boolean>;
980
1018
  }
981
1019
  /** 标准化产品投放位配置 */
@@ -987,7 +1025,8 @@ interface ProductPlacementConfig {
987
1025
  placementId: string;
988
1026
  /** 接口返回的内部产品编码 */
989
1027
  productCode?: string;
990
- systemType: ProductSystemType;
1028
+ /** 预留系统类型,仅在接口返回可识别的 systemCode 时提供 */
1029
+ systemType?: ProductSystemType;
991
1030
  providerCode?: string;
992
1031
  channelCode?: string;
993
1032
  /** 接口返回的内部场景编码 */
@@ -1016,7 +1055,7 @@ interface ProductPlacementResult {
1016
1055
  * @Author wutao
1017
1056
  * @Date 2026-09-09
1018
1057
  * @LastEditors wutao
1019
- * @LastEditTime 2026-09-15 12:02:24
1058
+ * @LastEditTime 2026-09-23 10:24:19
1020
1059
  */
1021
1060
 
1022
1061
  /**
@@ -1034,4 +1073,183 @@ declare function normalizeProductConfig(productConfig: ProductConfigApiData | nu
1034
1073
  */
1035
1074
  declare function getProductConfig(options: GetProductConfigOptions): Promise<BuildResultReturn<ProductPlacementResult>>;
1036
1075
 
1037
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type GetProductConfigOptions, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ProductDisplayMode, type ProductPlacementAction, type ProductPlacementActionType, type ProductPlacementConfig, type ProductPlacementCreative, type ProductPlacementPanelStyle, type ProductPlacementResult, type ProductSystemType, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, getProductConfig, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData, normalizeProductConfig };
1076
+ /**
1077
+ * @Description: 平台大会员 API 类型定义
1078
+ * @Author: wutao
1079
+ * @Date: 2026-09-21
1080
+ * @LastEditors: wutao
1081
+ * @LastEditTime: 2026-09-22 16:02:56
1082
+ */
1083
+
1084
+ /** 平台大会员卡等级 */
1085
+ type GlobalVipSubscribeType = 'silver' | 'gold' | 'black' | 'diamond';
1086
+ /** 平台大会员签约渠道 */
1087
+ type GlobalVipChannel = 'OfficialYq' | 'WxOfficial' | 'dyNpp' | 'DySgp';
1088
+ /**
1089
+ * 发起签约的客户端类型
1090
+ * - `wechat`:微信 H5
1091
+ * - `wxMini`:微信小程序
1092
+ * - `aliMini`:支付宝小程序
1093
+ * - `aliPay`:支付宝 H5
1094
+ */
1095
+ type GlobalVipClientType = 'aliMini' | 'aliPay' | 'wxMini' | 'wechat';
1096
+ /** 自动扣费类型 */
1097
+ type GlobalVipDebitType = 'alipay' | 'aliPay' | 'wechat';
1098
+
1099
+ /**
1100
+ * @Description: 平台大会员服务类型定义
1101
+ * @Author: wutao
1102
+ * @Date: 2026-09-21
1103
+ * @LastEditors: wutao
1104
+ * @LastEditTime: 2026-09-23 18:05:01
1105
+ */
1106
+
1107
+ /** 当前操作系统 */
1108
+ type GlobalVipOs = 'ios' | 'android' | 'other';
1109
+ /** 平台大会员业务入口 */
1110
+ type GlobalVipSource = 'homePopup' | 'homeBanner' | 'virtualPosition' | 'shopCartBottom' | 'packageCell' | string;
1111
+ /** 宿主可展示的平台大会员入口 */
1112
+ interface GlobalVipEntrances {
1113
+ window: boolean;
1114
+ banner: boolean;
1115
+ package: boolean;
1116
+ cart: boolean;
1117
+ }
1118
+ /** 平台大会员签约配置 */
1119
+ interface GlobalVipSubscribeConfig {
1120
+ subscribeType: GlobalVipSubscribeType;
1121
+ channelCode: GlobalVipChannel;
1122
+ payAmount: number;
1123
+ firstPayAmount: number;
1124
+ renewAmount: number;
1125
+ effectiveDate: number;
1126
+ tryDay: number;
1127
+ totalBenefitAmount: number;
1128
+ firstBenefitAmount: number;
1129
+ closeButtonPopSecond: number;
1130
+ /** 是否为抖音新用户;抖音新用户可享受新客优惠。 */
1131
+ canEnjoyDiscount: boolean;
1132
+ }
1133
+ /** 平台大会员完整入口上下文 */
1134
+ interface GlobalVipEntryContext {
1135
+ canPurchase: boolean;
1136
+ active: boolean;
1137
+ memberState: number | null;
1138
+ subscribeType: GlobalVipSubscribeType | null;
1139
+ entrances: GlobalVipEntrances;
1140
+ config: GlobalVipSubscribeConfig | null;
1141
+ }
1142
+ /** 归一化后的平台大会员状态 */
1143
+ type GlobalVipMemberStatus = 'inactive' | 'active' | 'refunded' | 'trial' | 'unknown';
1144
+ /** 平台大会员订阅状态 */
1145
+ interface GlobalVipSubscribeState {
1146
+ /** 原始订阅状态:`1` 已扣费,`2` 已退款,`3` 体验期。 */
1147
+ state: number | null;
1148
+ /** 是否已具备有效会员权益;已扣费和体验期均为 `true`。 */
1149
+ active: boolean;
1150
+ status: GlobalVipMemberStatus;
1151
+ }
1152
+ /** 平台大会员签约后交由宿主执行的标准动作 */
1153
+ type GlobalVipSubscribeAction = {
1154
+ type: 'already_active';
1155
+ state: GlobalVipSubscribeState;
1156
+ } | {
1157
+ type: 'command';
1158
+ channel: 'dyNpp' | 'DySgp';
1159
+ command: string;
1160
+ orderNo?: string;
1161
+ } | {
1162
+ type: 'mini_program';
1163
+ channel: 'OfficialYq' | 'WxOfficial';
1164
+ appId: string;
1165
+ path: string;
1166
+ extraData?: Record<string, unknown>;
1167
+ orderNo?: string;
1168
+ } | {
1169
+ type: 'h5';
1170
+ channel: GlobalVipChannel;
1171
+ url: string;
1172
+ orderNo?: string;
1173
+ } | {
1174
+ type: 'douyin_transfer';
1175
+ channel: 'dyNpp' | 'DySgp';
1176
+ payUrl: string;
1177
+ transferUrl: string;
1178
+ shouldExitMiniProgram: boolean;
1179
+ orderNo?: string;
1180
+ };
1181
+ /** 获取入口上下文参数 */
1182
+ interface GetGlobalVipEntryContextOptions {
1183
+ equipmentValue: string;
1184
+ equipmentTypeValue: string;
1185
+ /** 客户端类型:`wechat` 为微信 H5,`wxMini` 为微信小程序,`aliMini` 为支付宝小程序。 */
1186
+ clientType: GlobalVipClientType;
1187
+ phone?: string;
1188
+ }
1189
+ /** 查询权益到账状态参数 */
1190
+ interface CheckGlobalVipBenefitOptions {
1191
+ equipmentValue: string;
1192
+ }
1193
+ /** 平台大会员权益到账状态 */
1194
+ interface GlobalVipBenefitResult {
1195
+ received: boolean;
1196
+ rawData?: unknown;
1197
+ }
1198
+ /** 发起平台大会员签约流程参数 */
1199
+ interface HandleGlobalVipSubscribeOptions {
1200
+ equipmentValue: string;
1201
+ equipmentTypeValue: string;
1202
+ phone?: string;
1203
+ /** 客户端类型:`wechat` 为微信 H5,`wxMini` 为微信小程序,`aliMini` 为支付宝小程序。 */
1204
+ clientType: GlobalVipClientType;
1205
+ debitType: GlobalVipDebitType;
1206
+ os: GlobalVipOs;
1207
+ source?: GlobalVipSource;
1208
+ returnUrl: string;
1209
+ config?: GlobalVipSubscribeConfig;
1210
+ douyinTransferUrl?: string;
1211
+ fromTransferPage?: boolean;
1212
+ /** 微信签约所需 AppId;微信 H5 未传时按当前 services 环境使用内置 AppId。 */
1213
+ wechatAppId?: string;
1214
+ }
1215
+ /** 签约回跳轮询参数 */
1216
+ interface PollGlobalVipSubscribeResultOptions {
1217
+ equipmentValue: string;
1218
+ maxAttempts?: number;
1219
+ interval?: number;
1220
+ checkBenefit?: boolean;
1221
+ }
1222
+ /** 签约回跳轮询结果 */
1223
+ interface GlobalVipSubscribeResult {
1224
+ active: boolean;
1225
+ benefitReceived: boolean;
1226
+ memberState: number | null;
1227
+ attempts: number;
1228
+ }
1229
+ /** 挂载到 nova.globalVip 的公开服务契约 */
1230
+ interface GlobalVipService {
1231
+ getEntryContext(options: GetGlobalVipEntryContextOptions): Promise<BuildResultReturn<GlobalVipEntryContext>>;
1232
+ getSubscribeState(): Promise<BuildResultReturn<GlobalVipSubscribeState>>;
1233
+ checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<BuildResultReturn<GlobalVipBenefitResult>>;
1234
+ recordExposure(): Promise<BuildResultReturn<boolean>>;
1235
+ handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeAction>>;
1236
+ pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
1237
+ clearCache(): void;
1238
+ }
1239
+
1240
+ /** 查询并归一化当前用户的平台大会员状态。 */
1241
+ declare function getSubscribeState(): Promise<BuildResultReturn<GlobalVipSubscribeState>>;
1242
+ /** 一次性获取入口资格、会员状态、入口开关与订阅配置。 */
1243
+ declare function getEntryContext(options: GetGlobalVipEntryContextOptions): Promise<BuildResultReturn<GlobalVipEntryContext>>;
1244
+ /** 查询平台大会员权益是否已到账。 */
1245
+ declare function checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<BuildResultReturn<GlobalVipBenefitResult>>;
1246
+ /** 记录一次后端平台大会员曝光。 */
1247
+ declare function recordExposure(): Promise<BuildResultReturn<boolean>>;
1248
+ /** 创建签约并将渠道响应归一化为宿主动作。 */
1249
+ declare function handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeAction>>;
1250
+ /** 签约回跳后轮询会员状态与权益到账状态。 */
1251
+ declare function pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
1252
+ /** 清除平台大会员入口与订阅配置缓存。 */
1253
+ declare function clearCache(): void;
1254
+
1255
+ export { type CheckGlobalVipBenefitOptions, type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type GetGlobalVipEntryContextOptions, type GetProductConfigOptions, type GlobalVipBenefitResult, type GlobalVipChannel, type GlobalVipClientType, type GlobalVipDebitType, type GlobalVipEntrances, type GlobalVipEntryContext, GlobalVipErrorCode, GlobalVipErrorMessage, type GlobalVipMemberStatus, type GlobalVipOs, type GlobalVipService, type GlobalVipSource, type GlobalVipSubscribeAction, type GlobalVipSubscribeConfig, type GlobalVipSubscribeResult, type GlobalVipSubscribeState, type GlobalVipSubscribeType, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, type HandleGlobalVipSubscribeOptions, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type PollGlobalVipSubscribeResultOptions, type ProductDisplayMode, type ProductPlacementAction, type ProductPlacementActionType, type ProductPlacementConfig, type ProductPlacementCreative, type ProductPlacementPanelStyle, type ProductPlacementResult, type ProductSystemType, type ServicesOptions, checkBenefit, clearCache, createServices, getDisplayAdConfig, getDyPayRtaData, getEntryContext, getProductConfig, getSubscribeState, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, handleSubscribeFlow, normalizeDisplayAdData, normalizeProductConfig, pollSubscribeResult, recordExposure };
package/dist/index.d.ts CHANGED
@@ -472,7 +472,7 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
472
472
  * @Author: wutao
473
473
  * @Date: 2026-03-30
474
474
  * @LastEditors: wutao
475
- * @LastEditTime: 2026-07-07 15:47:52
475
+ * @LastEditTime: 2026-09-21 18:22:11
476
476
  *
477
477
  * 错误码分段规则:
478
478
  * - 0: 成功
@@ -482,7 +482,8 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
482
482
  * - 2200-2999: 预留其他京东业务
483
483
  * - 3000-3099: 抖音支付业务
484
484
  * - 3000-3999: 预留其他抖音业务
485
- * - 4000+: 预留其他平台业务
485
+ * - 4000-4099: 平台大会员业务
486
+ * - 4100+: 预留其他平台业务
486
487
  *
487
488
  * 命名规范:<业务模块>__<具体场景>
488
489
  * 示例:JD_CASH_LOAN__RTA_FAILED
@@ -619,13 +620,50 @@ declare enum DyErrorCode {
619
620
  * 抖音业务错误信息映射
620
621
  */
621
622
  declare const DyErrorMessage: Record<number, string>;
623
+ /**
624
+ * 平台大会员业务错误码枚举
625
+ */
626
+ declare enum GlobalVipErrorCode {
627
+ /** 缺少设备编号 */
628
+ GLOBAL_VIP__MISSING_EQUIPMENT_VALUE = 4001,
629
+ /** 缺少设备类型 */
630
+ GLOBAL_VIP__MISSING_EQUIPMENT_TYPE = 4002,
631
+ /** 无效的客户端类型 */
632
+ GLOBAL_VIP__INVALID_CLIENT_TYPE = 4003,
633
+ /** 入口资格查询失败 */
634
+ GLOBAL_VIP__ENTRANCE_CHECK_FAILED = 4004,
635
+ /** 未获取到卡类型 */
636
+ GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE = 4005,
637
+ /** 订阅配置查询失败 */
638
+ GLOBAL_VIP__CONFIG_FAILED = 4006,
639
+ /** 订阅配置无效 */
640
+ GLOBAL_VIP__INVALID_CONFIG = 4007,
641
+ /** 会员状态查询失败 */
642
+ GLOBAL_VIP__STATE_QUERY_FAILED = 4008,
643
+ /** 用户已开通会员 */
644
+ GLOBAL_VIP__ALREADY_ACTIVE = 4009,
645
+ /** 签约请求失败 */
646
+ GLOBAL_VIP__SIGN_FAILED = 4010,
647
+ /** 签约结果无效 */
648
+ GLOBAL_VIP__INVALID_SIGN_RESULT = 4011,
649
+ /** 权益查询失败 */
650
+ GLOBAL_VIP__BENEFIT_QUERY_FAILED = 4012,
651
+ /** 曝光记录失败 */
652
+ GLOBAL_VIP__EXPOSURE_FAILED = 4013,
653
+ /** 抖音优惠资格查询失败 */
654
+ GLOBAL_VIP__DISCOUNT_CHECK_FAILED = 4014,
655
+ /** 签约结果轮询失败 */
656
+ GLOBAL_VIP__POLL_FAILED = 4015
657
+ }
658
+ /** 平台大会员业务错误信息映射 */
659
+ declare const GlobalVipErrorMessage: Record<GlobalVipErrorCode, string>;
622
660
 
623
661
  /**
624
662
  * @Description: 广告配置接口类型定义
625
663
  * @Author: wutao
626
664
  * @Date: 2026-04-21
627
665
  * @LastEditors: wutao
628
- * @LastEditTime: 2026-09-14 17:19:39
666
+ * @LastEditTime: 2026-09-23 10:24:19
629
667
  */
630
668
  /**
631
669
  * 展示广告类型
@@ -817,7 +855,7 @@ interface AdvertConfigItem {
817
855
  }
818
856
  /** 产品 UI 配置展示模式 */
819
857
  type ProductConfigDisplayMode = 'banner' | 'popup' | 'half_screen' | 'mask';
820
- /** 产品 UI 配置接入系统编码 */
858
+ /** 产品 UI 配置接入系统编码(预留) */
821
859
  type ProductConfigSystemCode = 'lyy' | 'third';
822
860
  /** 产品 UI 配置动作 */
823
861
  interface ProductConfigAction {
@@ -851,6 +889,7 @@ interface ProductConfigApiData {
851
889
  id: number | string;
852
890
  placementId?: string;
853
891
  productCode?: string;
892
+ /** 预留系统编码,不参与配置有效性判断 */
854
893
  systemCode?: ProductConfigSystemCode;
855
894
  providerCode?: string;
856
895
  channelCode?: string;
@@ -945,7 +984,7 @@ declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<Build
945
984
  * @Author wutao
946
985
  * @Date 2026-09-09
947
986
  * @LastEditors wutao
948
- * @LastEditTime 2026-09-14 17:19:39
987
+ * @LastEditTime 2026-09-23 10:24:19
949
988
  */
950
989
  /** 产品投放位展示形态 */
951
990
  type ProductDisplayMode = 'banner' | 'popup' | 'half_screen';
@@ -975,7 +1014,6 @@ interface ProductPlacementAction {
975
1014
  businessCode?: string;
976
1015
  appId?: string;
977
1016
  path?: string;
978
- url?: string;
979
1017
  params: Record<string, string | number | boolean>;
980
1018
  }
981
1019
  /** 标准化产品投放位配置 */
@@ -987,7 +1025,8 @@ interface ProductPlacementConfig {
987
1025
  placementId: string;
988
1026
  /** 接口返回的内部产品编码 */
989
1027
  productCode?: string;
990
- systemType: ProductSystemType;
1028
+ /** 预留系统类型,仅在接口返回可识别的 systemCode 时提供 */
1029
+ systemType?: ProductSystemType;
991
1030
  providerCode?: string;
992
1031
  channelCode?: string;
993
1032
  /** 接口返回的内部场景编码 */
@@ -1016,7 +1055,7 @@ interface ProductPlacementResult {
1016
1055
  * @Author wutao
1017
1056
  * @Date 2026-09-09
1018
1057
  * @LastEditors wutao
1019
- * @LastEditTime 2026-09-15 12:02:24
1058
+ * @LastEditTime 2026-09-23 10:24:19
1020
1059
  */
1021
1060
 
1022
1061
  /**
@@ -1034,4 +1073,183 @@ declare function normalizeProductConfig(productConfig: ProductConfigApiData | nu
1034
1073
  */
1035
1074
  declare function getProductConfig(options: GetProductConfigOptions): Promise<BuildResultReturn<ProductPlacementResult>>;
1036
1075
 
1037
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type GetProductConfigOptions, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ProductDisplayMode, type ProductPlacementAction, type ProductPlacementActionType, type ProductPlacementConfig, type ProductPlacementCreative, type ProductPlacementPanelStyle, type ProductPlacementResult, type ProductSystemType, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, getProductConfig, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData, normalizeProductConfig };
1076
+ /**
1077
+ * @Description: 平台大会员 API 类型定义
1078
+ * @Author: wutao
1079
+ * @Date: 2026-09-21
1080
+ * @LastEditors: wutao
1081
+ * @LastEditTime: 2026-09-22 16:02:56
1082
+ */
1083
+
1084
+ /** 平台大会员卡等级 */
1085
+ type GlobalVipSubscribeType = 'silver' | 'gold' | 'black' | 'diamond';
1086
+ /** 平台大会员签约渠道 */
1087
+ type GlobalVipChannel = 'OfficialYq' | 'WxOfficial' | 'dyNpp' | 'DySgp';
1088
+ /**
1089
+ * 发起签约的客户端类型
1090
+ * - `wechat`:微信 H5
1091
+ * - `wxMini`:微信小程序
1092
+ * - `aliMini`:支付宝小程序
1093
+ * - `aliPay`:支付宝 H5
1094
+ */
1095
+ type GlobalVipClientType = 'aliMini' | 'aliPay' | 'wxMini' | 'wechat';
1096
+ /** 自动扣费类型 */
1097
+ type GlobalVipDebitType = 'alipay' | 'aliPay' | 'wechat';
1098
+
1099
+ /**
1100
+ * @Description: 平台大会员服务类型定义
1101
+ * @Author: wutao
1102
+ * @Date: 2026-09-21
1103
+ * @LastEditors: wutao
1104
+ * @LastEditTime: 2026-09-23 18:05:01
1105
+ */
1106
+
1107
+ /** 当前操作系统 */
1108
+ type GlobalVipOs = 'ios' | 'android' | 'other';
1109
+ /** 平台大会员业务入口 */
1110
+ type GlobalVipSource = 'homePopup' | 'homeBanner' | 'virtualPosition' | 'shopCartBottom' | 'packageCell' | string;
1111
+ /** 宿主可展示的平台大会员入口 */
1112
+ interface GlobalVipEntrances {
1113
+ window: boolean;
1114
+ banner: boolean;
1115
+ package: boolean;
1116
+ cart: boolean;
1117
+ }
1118
+ /** 平台大会员签约配置 */
1119
+ interface GlobalVipSubscribeConfig {
1120
+ subscribeType: GlobalVipSubscribeType;
1121
+ channelCode: GlobalVipChannel;
1122
+ payAmount: number;
1123
+ firstPayAmount: number;
1124
+ renewAmount: number;
1125
+ effectiveDate: number;
1126
+ tryDay: number;
1127
+ totalBenefitAmount: number;
1128
+ firstBenefitAmount: number;
1129
+ closeButtonPopSecond: number;
1130
+ /** 是否为抖音新用户;抖音新用户可享受新客优惠。 */
1131
+ canEnjoyDiscount: boolean;
1132
+ }
1133
+ /** 平台大会员完整入口上下文 */
1134
+ interface GlobalVipEntryContext {
1135
+ canPurchase: boolean;
1136
+ active: boolean;
1137
+ memberState: number | null;
1138
+ subscribeType: GlobalVipSubscribeType | null;
1139
+ entrances: GlobalVipEntrances;
1140
+ config: GlobalVipSubscribeConfig | null;
1141
+ }
1142
+ /** 归一化后的平台大会员状态 */
1143
+ type GlobalVipMemberStatus = 'inactive' | 'active' | 'refunded' | 'trial' | 'unknown';
1144
+ /** 平台大会员订阅状态 */
1145
+ interface GlobalVipSubscribeState {
1146
+ /** 原始订阅状态:`1` 已扣费,`2` 已退款,`3` 体验期。 */
1147
+ state: number | null;
1148
+ /** 是否已具备有效会员权益;已扣费和体验期均为 `true`。 */
1149
+ active: boolean;
1150
+ status: GlobalVipMemberStatus;
1151
+ }
1152
+ /** 平台大会员签约后交由宿主执行的标准动作 */
1153
+ type GlobalVipSubscribeAction = {
1154
+ type: 'already_active';
1155
+ state: GlobalVipSubscribeState;
1156
+ } | {
1157
+ type: 'command';
1158
+ channel: 'dyNpp' | 'DySgp';
1159
+ command: string;
1160
+ orderNo?: string;
1161
+ } | {
1162
+ type: 'mini_program';
1163
+ channel: 'OfficialYq' | 'WxOfficial';
1164
+ appId: string;
1165
+ path: string;
1166
+ extraData?: Record<string, unknown>;
1167
+ orderNo?: string;
1168
+ } | {
1169
+ type: 'h5';
1170
+ channel: GlobalVipChannel;
1171
+ url: string;
1172
+ orderNo?: string;
1173
+ } | {
1174
+ type: 'douyin_transfer';
1175
+ channel: 'dyNpp' | 'DySgp';
1176
+ payUrl: string;
1177
+ transferUrl: string;
1178
+ shouldExitMiniProgram: boolean;
1179
+ orderNo?: string;
1180
+ };
1181
+ /** 获取入口上下文参数 */
1182
+ interface GetGlobalVipEntryContextOptions {
1183
+ equipmentValue: string;
1184
+ equipmentTypeValue: string;
1185
+ /** 客户端类型:`wechat` 为微信 H5,`wxMini` 为微信小程序,`aliMini` 为支付宝小程序。 */
1186
+ clientType: GlobalVipClientType;
1187
+ phone?: string;
1188
+ }
1189
+ /** 查询权益到账状态参数 */
1190
+ interface CheckGlobalVipBenefitOptions {
1191
+ equipmentValue: string;
1192
+ }
1193
+ /** 平台大会员权益到账状态 */
1194
+ interface GlobalVipBenefitResult {
1195
+ received: boolean;
1196
+ rawData?: unknown;
1197
+ }
1198
+ /** 发起平台大会员签约流程参数 */
1199
+ interface HandleGlobalVipSubscribeOptions {
1200
+ equipmentValue: string;
1201
+ equipmentTypeValue: string;
1202
+ phone?: string;
1203
+ /** 客户端类型:`wechat` 为微信 H5,`wxMini` 为微信小程序,`aliMini` 为支付宝小程序。 */
1204
+ clientType: GlobalVipClientType;
1205
+ debitType: GlobalVipDebitType;
1206
+ os: GlobalVipOs;
1207
+ source?: GlobalVipSource;
1208
+ returnUrl: string;
1209
+ config?: GlobalVipSubscribeConfig;
1210
+ douyinTransferUrl?: string;
1211
+ fromTransferPage?: boolean;
1212
+ /** 微信签约所需 AppId;微信 H5 未传时按当前 services 环境使用内置 AppId。 */
1213
+ wechatAppId?: string;
1214
+ }
1215
+ /** 签约回跳轮询参数 */
1216
+ interface PollGlobalVipSubscribeResultOptions {
1217
+ equipmentValue: string;
1218
+ maxAttempts?: number;
1219
+ interval?: number;
1220
+ checkBenefit?: boolean;
1221
+ }
1222
+ /** 签约回跳轮询结果 */
1223
+ interface GlobalVipSubscribeResult {
1224
+ active: boolean;
1225
+ benefitReceived: boolean;
1226
+ memberState: number | null;
1227
+ attempts: number;
1228
+ }
1229
+ /** 挂载到 nova.globalVip 的公开服务契约 */
1230
+ interface GlobalVipService {
1231
+ getEntryContext(options: GetGlobalVipEntryContextOptions): Promise<BuildResultReturn<GlobalVipEntryContext>>;
1232
+ getSubscribeState(): Promise<BuildResultReturn<GlobalVipSubscribeState>>;
1233
+ checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<BuildResultReturn<GlobalVipBenefitResult>>;
1234
+ recordExposure(): Promise<BuildResultReturn<boolean>>;
1235
+ handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeAction>>;
1236
+ pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
1237
+ clearCache(): void;
1238
+ }
1239
+
1240
+ /** 查询并归一化当前用户的平台大会员状态。 */
1241
+ declare function getSubscribeState(): Promise<BuildResultReturn<GlobalVipSubscribeState>>;
1242
+ /** 一次性获取入口资格、会员状态、入口开关与订阅配置。 */
1243
+ declare function getEntryContext(options: GetGlobalVipEntryContextOptions): Promise<BuildResultReturn<GlobalVipEntryContext>>;
1244
+ /** 查询平台大会员权益是否已到账。 */
1245
+ declare function checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<BuildResultReturn<GlobalVipBenefitResult>>;
1246
+ /** 记录一次后端平台大会员曝光。 */
1247
+ declare function recordExposure(): Promise<BuildResultReturn<boolean>>;
1248
+ /** 创建签约并将渠道响应归一化为宿主动作。 */
1249
+ declare function handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeAction>>;
1250
+ /** 签约回跳后轮询会员状态与权益到账状态。 */
1251
+ declare function pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
1252
+ /** 清除平台大会员入口与订阅配置缓存。 */
1253
+ declare function clearCache(): void;
1254
+
1255
+ export { type CheckGlobalVipBenefitOptions, type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type GetGlobalVipEntryContextOptions, type GetProductConfigOptions, type GlobalVipBenefitResult, type GlobalVipChannel, type GlobalVipClientType, type GlobalVipDebitType, type GlobalVipEntrances, type GlobalVipEntryContext, GlobalVipErrorCode, GlobalVipErrorMessage, type GlobalVipMemberStatus, type GlobalVipOs, type GlobalVipService, type GlobalVipSource, type GlobalVipSubscribeAction, type GlobalVipSubscribeConfig, type GlobalVipSubscribeResult, type GlobalVipSubscribeState, type GlobalVipSubscribeType, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, type HandleGlobalVipSubscribeOptions, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type PollGlobalVipSubscribeResultOptions, type ProductDisplayMode, type ProductPlacementAction, type ProductPlacementActionType, type ProductPlacementConfig, type ProductPlacementCreative, type ProductPlacementPanelStyle, type ProductPlacementResult, type ProductSystemType, type ServicesOptions, checkBenefit, clearCache, createServices, getDisplayAdConfig, getDyPayRtaData, getEntryContext, getProductConfig, getSubscribeState, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, handleSubscribeFlow, normalizeDisplayAdData, normalizeProductConfig, pollSubscribeResult, recordExposure };