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

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/index.d.mts CHANGED
@@ -158,15 +158,13 @@ declare function handleJdjrCashLoanExt(options: JdjrCashLoanExternalOptions): Pr
158
158
  * @Author: wutao
159
159
  * @Date: 2026-03-26
160
160
  * @LastEditors: wutao
161
- * @LastEditTime: 2026-03-26
161
+ * @LastEditTime: 2026-09-14 17:19:39
162
162
  */
163
163
 
164
164
  /** 京东保险服务选项接口 */
165
165
  interface JdInsuranceOptions {
166
166
  /** 设备ID */
167
- equipmentId: string;
168
- /** 操作系统 */
169
- os?: string;
167
+ equipmentValue: string;
170
168
  /** 手机号 */
171
169
  phone?: string;
172
170
  /** 入口标识 */
@@ -205,11 +203,7 @@ interface JdInsuranceResult extends JumpConfig {
205
203
  * @returns {string} [return.data.appId] - 小程序appId(仅mini_program模式)
206
204
  * @returns {string} [return.data.path] - 小程序路径(仅mini_program模式)
207
205
  */
208
- declare function handleJdInsurance(options: {
209
- equipmentValue: string;
210
- phone?: string;
211
- entrance?: string;
212
- }): Promise<BuildResultReturn>;
206
+ declare function handleJdInsurance(options: JdInsuranceOptions): Promise<BuildResultReturn>;
213
207
  /**
214
208
  * 处理外部京东保险服务(外部对接版)
215
209
  * @param {object} businessParams - 业务参数
@@ -631,7 +625,7 @@ declare const DyErrorMessage: Record<number, string>;
631
625
  * @Author: wutao
632
626
  * @Date: 2026-04-21
633
627
  * @LastEditors: wutao
634
- * @LastEditTime: 2026-09-03 18:00:19
628
+ * @LastEditTime: 2026-09-14 17:19:39
635
629
  */
636
630
  /**
637
631
  * 展示广告类型
@@ -821,6 +815,56 @@ interface AdvertConfigItem {
821
815
  /** 扩展字段 */
822
816
  [key: string]: any;
823
817
  }
818
+ /** 产品 UI 配置展示模式 */
819
+ type ProductConfigDisplayMode = 'banner' | 'popup' | 'half_screen' | 'mask';
820
+ /** 产品 UI 配置接入系统编码 */
821
+ type ProductConfigSystemCode = 'lyy' | 'third';
822
+ /** 产品 UI 配置动作 */
823
+ interface ProductConfigAction {
824
+ type?: 'business' | 'mini_program' | 'internal' | 'web' | 'api' | 'none';
825
+ businessCode?: string;
826
+ appId?: string;
827
+ path?: string;
828
+ url?: string;
829
+ params?: Record<string, any>;
830
+ [key: string]: any;
831
+ }
832
+ /** 产品 UI 展示配置 */
833
+ interface ProductConfigDisplayConfig {
834
+ image?: string;
835
+ bannerImageUrl?: string;
836
+ popupImageUrl?: string;
837
+ title?: string;
838
+ description?: string;
839
+ buttonText?: string;
840
+ badgeText?: string;
841
+ skinCode?: string;
842
+ heightRatio?: number;
843
+ closeable?: boolean;
844
+ maskClosable?: boolean;
845
+ showAgreement?: boolean;
846
+ action?: ProductConfigAction;
847
+ [key: string]: any;
848
+ }
849
+ /** 按 ID 查询返回的产品 UI 配置 */
850
+ interface ProductConfigApiData {
851
+ id: number | string;
852
+ placementId?: string;
853
+ productCode?: string;
854
+ systemCode?: ProductConfigSystemCode;
855
+ providerCode?: string;
856
+ channelCode?: string;
857
+ sceneCode?: string;
858
+ displayMode?: ProductConfigDisplayMode;
859
+ displayConfig?: ProductConfigDisplayConfig;
860
+ status?: 0 | 1;
861
+ isDeleted?: 0 | 1;
862
+ version?: number;
863
+ creator?: string;
864
+ updater?: string;
865
+ createTime?: string;
866
+ updateTime?: string;
867
+ }
824
868
 
825
869
  /**
826
870
  * @Description: 展示广告服务类型定义
@@ -896,4 +940,98 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
896
940
  */
897
941
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
898
942
 
899
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, 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 ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
943
+ /**
944
+ * @Description 产品投放位服务类型定义
945
+ * @Author wutao
946
+ * @Date 2026-09-09
947
+ * @LastEditors wutao
948
+ * @LastEditTime 2026-09-14 17:19:39
949
+ */
950
+ /** 产品投放位展示形态 */
951
+ type ProductDisplayMode = 'banner' | 'popup' | 'half_screen';
952
+ /** 产品业务系统类型 */
953
+ type ProductSystemType = 'lyy' | 'third_party';
954
+ /** 产品投放位动作类型 */
955
+ type ProductPlacementActionType = 'business' | 'mini_program' | 'internal' | 'web' | 'api' | 'none';
956
+ /** 产品投放位素材 */
957
+ interface ProductPlacementCreative {
958
+ imageUrl?: string;
959
+ title?: string;
960
+ description?: string;
961
+ buttonText?: string;
962
+ badgeText?: string;
963
+ }
964
+ /** 产品投放位面板样式 */
965
+ interface ProductPlacementPanelStyle {
966
+ skinCode: 'default' | 'vip_gold' | 'insurance_blue';
967
+ heightRatio: number;
968
+ closeable: boolean;
969
+ maskClosable: boolean;
970
+ showAgreement: boolean;
971
+ }
972
+ /** 产品投放位业务动作 */
973
+ interface ProductPlacementAction {
974
+ type: ProductPlacementActionType;
975
+ businessCode?: string;
976
+ appId?: string;
977
+ path?: string;
978
+ url?: string;
979
+ params: Record<string, string | number | boolean>;
980
+ }
981
+ /** 标准化产品投放位配置 */
982
+ interface ProductPlacementConfig {
983
+ schemaVersion: number;
984
+ /** 组件查询使用的广告 ID */
985
+ adId: number | string;
986
+ configId: string | number;
987
+ placementId: string;
988
+ /** 接口返回的内部产品编码 */
989
+ productCode?: string;
990
+ systemType: ProductSystemType;
991
+ providerCode?: string;
992
+ channelCode?: string;
993
+ /** 接口返回的内部场景编码 */
994
+ sceneCode?: string;
995
+ displayMode: ProductDisplayMode;
996
+ creative: ProductPlacementCreative;
997
+ panelStyle: ProductPlacementPanelStyle;
998
+ action: ProductPlacementAction;
999
+ }
1000
+ /** 按广告 ID 获取产品 UI 配置参数 */
1001
+ interface GetProductConfigOptions {
1002
+ /** 产品 UI 配置主键,也就是组件传入的广告 ID */
1003
+ id: number | string;
1004
+ }
1005
+ /** 产品投放位配置服务结果 */
1006
+ interface ProductPlacementResult {
1007
+ show: boolean;
1008
+ id: number | string;
1009
+ placementId?: string;
1010
+ config: ProductPlacementConfig | null;
1011
+ reason: 'matched' | 'noConfig';
1012
+ }
1013
+
1014
+ /**
1015
+ * @Description 按广告 ID 返回的产品 UI 配置标准化处理
1016
+ * @Author wutao
1017
+ * @Date 2026-09-09
1018
+ * @LastEditors wutao
1019
+ * @LastEditTime 2026-09-15 12:02:24
1020
+ */
1021
+
1022
+ /**
1023
+ * 把按广告 ID 查询到的产品配置转换为 UI 标准配置
1024
+ * @param productConfig 接口返回的产品 UI 配置
1025
+ * @param expectedId 请求的广告 ID,用于防止响应错配
1026
+ * @returns 标准化配置;不可展示或配置非法时返回 null
1027
+ */
1028
+ declare function normalizeProductConfig(productConfig: ProductConfigApiData | null | undefined, expectedId: number | string): ProductPlacementConfig | null;
1029
+
1030
+ /**
1031
+ * 按广告 ID 获取并标准化产品 UI 配置
1032
+ * @param options 查询参数
1033
+ * @returns 标准化产品 UI 配置结果
1034
+ */
1035
+ declare function getProductConfig(options: GetProductConfigOptions): Promise<BuildResultReturn<ProductPlacementResult>>;
1036
+
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 };
package/dist/index.d.ts CHANGED
@@ -158,15 +158,13 @@ declare function handleJdjrCashLoanExt(options: JdjrCashLoanExternalOptions): Pr
158
158
  * @Author: wutao
159
159
  * @Date: 2026-03-26
160
160
  * @LastEditors: wutao
161
- * @LastEditTime: 2026-03-26
161
+ * @LastEditTime: 2026-09-14 17:19:39
162
162
  */
163
163
 
164
164
  /** 京东保险服务选项接口 */
165
165
  interface JdInsuranceOptions {
166
166
  /** 设备ID */
167
- equipmentId: string;
168
- /** 操作系统 */
169
- os?: string;
167
+ equipmentValue: string;
170
168
  /** 手机号 */
171
169
  phone?: string;
172
170
  /** 入口标识 */
@@ -205,11 +203,7 @@ interface JdInsuranceResult extends JumpConfig {
205
203
  * @returns {string} [return.data.appId] - 小程序appId(仅mini_program模式)
206
204
  * @returns {string} [return.data.path] - 小程序路径(仅mini_program模式)
207
205
  */
208
- declare function handleJdInsurance(options: {
209
- equipmentValue: string;
210
- phone?: string;
211
- entrance?: string;
212
- }): Promise<BuildResultReturn>;
206
+ declare function handleJdInsurance(options: JdInsuranceOptions): Promise<BuildResultReturn>;
213
207
  /**
214
208
  * 处理外部京东保险服务(外部对接版)
215
209
  * @param {object} businessParams - 业务参数
@@ -631,7 +625,7 @@ declare const DyErrorMessage: Record<number, string>;
631
625
  * @Author: wutao
632
626
  * @Date: 2026-04-21
633
627
  * @LastEditors: wutao
634
- * @LastEditTime: 2026-09-03 18:00:19
628
+ * @LastEditTime: 2026-09-14 17:19:39
635
629
  */
636
630
  /**
637
631
  * 展示广告类型
@@ -821,6 +815,56 @@ interface AdvertConfigItem {
821
815
  /** 扩展字段 */
822
816
  [key: string]: any;
823
817
  }
818
+ /** 产品 UI 配置展示模式 */
819
+ type ProductConfigDisplayMode = 'banner' | 'popup' | 'half_screen' | 'mask';
820
+ /** 产品 UI 配置接入系统编码 */
821
+ type ProductConfigSystemCode = 'lyy' | 'third';
822
+ /** 产品 UI 配置动作 */
823
+ interface ProductConfigAction {
824
+ type?: 'business' | 'mini_program' | 'internal' | 'web' | 'api' | 'none';
825
+ businessCode?: string;
826
+ appId?: string;
827
+ path?: string;
828
+ url?: string;
829
+ params?: Record<string, any>;
830
+ [key: string]: any;
831
+ }
832
+ /** 产品 UI 展示配置 */
833
+ interface ProductConfigDisplayConfig {
834
+ image?: string;
835
+ bannerImageUrl?: string;
836
+ popupImageUrl?: string;
837
+ title?: string;
838
+ description?: string;
839
+ buttonText?: string;
840
+ badgeText?: string;
841
+ skinCode?: string;
842
+ heightRatio?: number;
843
+ closeable?: boolean;
844
+ maskClosable?: boolean;
845
+ showAgreement?: boolean;
846
+ action?: ProductConfigAction;
847
+ [key: string]: any;
848
+ }
849
+ /** 按 ID 查询返回的产品 UI 配置 */
850
+ interface ProductConfigApiData {
851
+ id: number | string;
852
+ placementId?: string;
853
+ productCode?: string;
854
+ systemCode?: ProductConfigSystemCode;
855
+ providerCode?: string;
856
+ channelCode?: string;
857
+ sceneCode?: string;
858
+ displayMode?: ProductConfigDisplayMode;
859
+ displayConfig?: ProductConfigDisplayConfig;
860
+ status?: 0 | 1;
861
+ isDeleted?: 0 | 1;
862
+ version?: number;
863
+ creator?: string;
864
+ updater?: string;
865
+ createTime?: string;
866
+ updateTime?: string;
867
+ }
824
868
 
825
869
  /**
826
870
  * @Description: 展示广告服务类型定义
@@ -896,4 +940,98 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
896
940
  */
897
941
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
898
942
 
899
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, 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 ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
943
+ /**
944
+ * @Description 产品投放位服务类型定义
945
+ * @Author wutao
946
+ * @Date 2026-09-09
947
+ * @LastEditors wutao
948
+ * @LastEditTime 2026-09-14 17:19:39
949
+ */
950
+ /** 产品投放位展示形态 */
951
+ type ProductDisplayMode = 'banner' | 'popup' | 'half_screen';
952
+ /** 产品业务系统类型 */
953
+ type ProductSystemType = 'lyy' | 'third_party';
954
+ /** 产品投放位动作类型 */
955
+ type ProductPlacementActionType = 'business' | 'mini_program' | 'internal' | 'web' | 'api' | 'none';
956
+ /** 产品投放位素材 */
957
+ interface ProductPlacementCreative {
958
+ imageUrl?: string;
959
+ title?: string;
960
+ description?: string;
961
+ buttonText?: string;
962
+ badgeText?: string;
963
+ }
964
+ /** 产品投放位面板样式 */
965
+ interface ProductPlacementPanelStyle {
966
+ skinCode: 'default' | 'vip_gold' | 'insurance_blue';
967
+ heightRatio: number;
968
+ closeable: boolean;
969
+ maskClosable: boolean;
970
+ showAgreement: boolean;
971
+ }
972
+ /** 产品投放位业务动作 */
973
+ interface ProductPlacementAction {
974
+ type: ProductPlacementActionType;
975
+ businessCode?: string;
976
+ appId?: string;
977
+ path?: string;
978
+ url?: string;
979
+ params: Record<string, string | number | boolean>;
980
+ }
981
+ /** 标准化产品投放位配置 */
982
+ interface ProductPlacementConfig {
983
+ schemaVersion: number;
984
+ /** 组件查询使用的广告 ID */
985
+ adId: number | string;
986
+ configId: string | number;
987
+ placementId: string;
988
+ /** 接口返回的内部产品编码 */
989
+ productCode?: string;
990
+ systemType: ProductSystemType;
991
+ providerCode?: string;
992
+ channelCode?: string;
993
+ /** 接口返回的内部场景编码 */
994
+ sceneCode?: string;
995
+ displayMode: ProductDisplayMode;
996
+ creative: ProductPlacementCreative;
997
+ panelStyle: ProductPlacementPanelStyle;
998
+ action: ProductPlacementAction;
999
+ }
1000
+ /** 按广告 ID 获取产品 UI 配置参数 */
1001
+ interface GetProductConfigOptions {
1002
+ /** 产品 UI 配置主键,也就是组件传入的广告 ID */
1003
+ id: number | string;
1004
+ }
1005
+ /** 产品投放位配置服务结果 */
1006
+ interface ProductPlacementResult {
1007
+ show: boolean;
1008
+ id: number | string;
1009
+ placementId?: string;
1010
+ config: ProductPlacementConfig | null;
1011
+ reason: 'matched' | 'noConfig';
1012
+ }
1013
+
1014
+ /**
1015
+ * @Description 按广告 ID 返回的产品 UI 配置标准化处理
1016
+ * @Author wutao
1017
+ * @Date 2026-09-09
1018
+ * @LastEditors wutao
1019
+ * @LastEditTime 2026-09-15 12:02:24
1020
+ */
1021
+
1022
+ /**
1023
+ * 把按广告 ID 查询到的产品配置转换为 UI 标准配置
1024
+ * @param productConfig 接口返回的产品 UI 配置
1025
+ * @param expectedId 请求的广告 ID,用于防止响应错配
1026
+ * @returns 标准化配置;不可展示或配置非法时返回 null
1027
+ */
1028
+ declare function normalizeProductConfig(productConfig: ProductConfigApiData | null | undefined, expectedId: number | string): ProductPlacementConfig | null;
1029
+
1030
+ /**
1031
+ * 按广告 ID 获取并标准化产品 UI 配置
1032
+ * @param options 查询参数
1033
+ * @returns 标准化产品 UI 配置结果
1034
+ */
1035
+ declare function getProductConfig(options: GetProductConfigOptions): Promise<BuildResultReturn<ProductPlacementResult>>;
1036
+
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 };