@bi-nova/services 1.4.1 → 1.5.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/index.d.mts CHANGED
@@ -278,6 +278,17 @@ interface HandleDyJsapiPayFlowResult {
278
278
  /** 抖音支付回调结果,type 为 pay_result 时返回 */
279
279
  payResult?: DouyinPayResult;
280
280
  }
281
+ /** 抖音授权代扣签约聚合流程返回数据 */
282
+ interface HandleDyAuthDebitSignFlowResult {
283
+ /** 结果类型:auth_redirect 表示已跳转授权,sign_result 表示已完成签约 SDK 调起 */
284
+ type: 'auth_redirect' | 'sign_result';
285
+ /** 抖音授权地址,type 为 auth_redirect 时返回 */
286
+ authUrl?: string;
287
+ /** 签约订单号,type 为 sign_result 时返回 */
288
+ orderNo?: string;
289
+ /** 抖音支付/签约回调结果,type 为 sign_result 时返回 */
290
+ payResult?: DouyinPayResult;
291
+ }
281
292
  /** handleDyPayFlow 入参 */
282
293
  interface HandleDyPayFlowParams {
283
294
  /** 商品金额(必传,单位:元) */
@@ -442,6 +453,15 @@ declare function handleDyPayCommandFlow(params: HandleDyPayCommandFlowParams): P
442
453
  * @returns 返回标准化结果,授权跳转时 type=auth_redirect,支付调起完成时 type=pay_result
443
454
  */
444
455
  declare function handleDyJsapiPayFlow(params: HandleDyJsapiPayFlowParams): Promise<BuildResultReturn<HandleDyJsapiPayFlowResult>>;
456
+ /**
457
+ * 处理抖音授权代扣签约聚合流程
458
+ *
459
+ * 内部完成授权 token 检查、requestId 读取、授权代扣签约接口调用、JSSDK 验签初始化和 dypay 调起。
460
+ * 无授权 token 时,会自动跳转抖音授权;授权回跳地址会保留当前页面参数并移除 url_token。
461
+ *
462
+ * @returns 返回标准化结果,授权跳转时 type=auth_redirect,签约调起完成时 type=sign_result
463
+ */
464
+ declare function handleDyAuthDebitSignFlow(): Promise<BuildResultReturn<HandleDyAuthDebitSignFlowResult>>;
445
465
 
446
466
  /**
447
467
  * @Description: 业务错误码定义
@@ -581,7 +601,13 @@ declare enum DyErrorCode {
581
601
  /** 抖音支付口令复制失败 */
582
602
  DY_PAY_COMMAND__COPY_FAILED = 3034,
583
603
  /** 抖音支付口令 RTA 数据无效 */
584
- DY_PAY_COMMAND__INVALID_RTA_DATA = 3035
604
+ DY_PAY_COMMAND__INVALID_RTA_DATA = 3035,
605
+ /** 缺少授权代扣签约 requestId */
606
+ DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID = 3036,
607
+ /** 授权代扣签约失败 */
608
+ DY_PAY__AUTH_DEBIT_SIGN_FAILED = 3037,
609
+ /** 授权代扣签约请求失败 */
610
+ DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED = 3038
585
611
  }
586
612
  /**
587
613
  * 抖音业务错误信息映射
@@ -788,4 +814,4 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
788
814
  */
789
815
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
790
816
 
791
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, 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, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
817
+ 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, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
package/dist/index.d.ts CHANGED
@@ -278,6 +278,17 @@ interface HandleDyJsapiPayFlowResult {
278
278
  /** 抖音支付回调结果,type 为 pay_result 时返回 */
279
279
  payResult?: DouyinPayResult;
280
280
  }
281
+ /** 抖音授权代扣签约聚合流程返回数据 */
282
+ interface HandleDyAuthDebitSignFlowResult {
283
+ /** 结果类型:auth_redirect 表示已跳转授权,sign_result 表示已完成签约 SDK 调起 */
284
+ type: 'auth_redirect' | 'sign_result';
285
+ /** 抖音授权地址,type 为 auth_redirect 时返回 */
286
+ authUrl?: string;
287
+ /** 签约订单号,type 为 sign_result 时返回 */
288
+ orderNo?: string;
289
+ /** 抖音支付/签约回调结果,type 为 sign_result 时返回 */
290
+ payResult?: DouyinPayResult;
291
+ }
281
292
  /** handleDyPayFlow 入参 */
282
293
  interface HandleDyPayFlowParams {
283
294
  /** 商品金额(必传,单位:元) */
@@ -442,6 +453,15 @@ declare function handleDyPayCommandFlow(params: HandleDyPayCommandFlowParams): P
442
453
  * @returns 返回标准化结果,授权跳转时 type=auth_redirect,支付调起完成时 type=pay_result
443
454
  */
444
455
  declare function handleDyJsapiPayFlow(params: HandleDyJsapiPayFlowParams): Promise<BuildResultReturn<HandleDyJsapiPayFlowResult>>;
456
+ /**
457
+ * 处理抖音授权代扣签约聚合流程
458
+ *
459
+ * 内部完成授权 token 检查、requestId 读取、授权代扣签约接口调用、JSSDK 验签初始化和 dypay 调起。
460
+ * 无授权 token 时,会自动跳转抖音授权;授权回跳地址会保留当前页面参数并移除 url_token。
461
+ *
462
+ * @returns 返回标准化结果,授权跳转时 type=auth_redirect,签约调起完成时 type=sign_result
463
+ */
464
+ declare function handleDyAuthDebitSignFlow(): Promise<BuildResultReturn<HandleDyAuthDebitSignFlowResult>>;
445
465
 
446
466
  /**
447
467
  * @Description: 业务错误码定义
@@ -581,7 +601,13 @@ declare enum DyErrorCode {
581
601
  /** 抖音支付口令复制失败 */
582
602
  DY_PAY_COMMAND__COPY_FAILED = 3034,
583
603
  /** 抖音支付口令 RTA 数据无效 */
584
- DY_PAY_COMMAND__INVALID_RTA_DATA = 3035
604
+ DY_PAY_COMMAND__INVALID_RTA_DATA = 3035,
605
+ /** 缺少授权代扣签约 requestId */
606
+ DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID = 3036,
607
+ /** 授权代扣签约失败 */
608
+ DY_PAY__AUTH_DEBIT_SIGN_FAILED = 3037,
609
+ /** 授权代扣签约请求失败 */
610
+ DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED = 3038
585
611
  }
586
612
  /**
587
613
  * 抖音业务错误信息映射
@@ -788,4 +814,4 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
788
814
  */
789
815
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
790
816
 
791
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, 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, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
817
+ 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, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };