@bi-nova/services 1.7.0-beta.202609231820 → 2.0.0-beta.202610201555
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 +2 -0
- package/dist/index.d.mts +263 -37
- package/dist/index.d.ts +263 -37
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +3 -2
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -32,6 +32,23 @@ interface JumpConfig {
|
|
|
32
32
|
channel?: string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @Description: API通用类型定义(跨业务复用)
|
|
37
|
+
* @Author: wutao
|
|
38
|
+
* @Date: 2026-03-26
|
|
39
|
+
* @LastEditors: wutao
|
|
40
|
+
* @LastEditTime: 2026-03-26
|
|
41
|
+
*/
|
|
42
|
+
/** API响应基础结构 */
|
|
43
|
+
interface ApiResponse<T = any> {
|
|
44
|
+
/** 响应码 */
|
|
45
|
+
code: string;
|
|
46
|
+
/** 响应消息 */
|
|
47
|
+
message?: string;
|
|
48
|
+
/** 响应体 */
|
|
49
|
+
body?: T;
|
|
50
|
+
}
|
|
51
|
+
|
|
35
52
|
/**
|
|
36
53
|
* @Description: 配置管理和环境域名定义
|
|
37
54
|
* @Author: wutao
|
|
@@ -216,7 +233,8 @@ declare function handleJdInsurance(options: JdInsuranceOptions): Promise<BuildRe
|
|
|
216
233
|
* @returns {number} return.code - 错误码:0=成功,非0=失败
|
|
217
234
|
* @returns {string} return.message - 提示信息
|
|
218
235
|
* @returns {Object|null} return.data - 业务数据
|
|
219
|
-
* @returns {string} [return.data.type] - 结果类型: 'copy_success' | 'mini_program'
|
|
236
|
+
* @returns {string} [return.data.type] - 结果类型: 'h5' | 'copy_success' | 'mini_program'
|
|
237
|
+
* @returns {string} [return.data.url] - H5跳转链接(仅h5模式)
|
|
220
238
|
* @returns {string} [return.data.appId] - 小程序appId(仅mini_program模式)
|
|
221
239
|
* @returns {string} [return.data.path] - 小程序路径(仅mini_program模式)
|
|
222
240
|
*/
|
|
@@ -472,7 +490,7 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
|
|
|
472
490
|
* @Author: wutao
|
|
473
491
|
* @Date: 2026-03-30
|
|
474
492
|
* @LastEditors: wutao
|
|
475
|
-
* @LastEditTime: 2026-09-
|
|
493
|
+
* @LastEditTime: 2026-09-29 14:35:40
|
|
476
494
|
*
|
|
477
495
|
* 错误码分段规则:
|
|
478
496
|
* - 0: 成功
|
|
@@ -483,7 +501,8 @@ declare function handleDyAuthDebitSignFlowWithRawPayInfo(): Promise<BuildResultR
|
|
|
483
501
|
* - 3000-3099: 抖音支付业务
|
|
484
502
|
* - 3000-3999: 预留其他抖音业务
|
|
485
503
|
* - 4000-4099: 平台大会员业务
|
|
486
|
-
* - 4100
|
|
504
|
+
* - 4100-4199: 跨渠道自动代扣业务
|
|
505
|
+
* - 4200+: 预留其他平台业务
|
|
487
506
|
*
|
|
488
507
|
* 命名规范:<业务模块>__<具体场景>
|
|
489
508
|
* 示例:JD_CASH_LOAN__RTA_FAILED
|
|
@@ -657,6 +676,27 @@ declare enum GlobalVipErrorCode {
|
|
|
657
676
|
}
|
|
658
677
|
/** 平台大会员业务错误信息映射 */
|
|
659
678
|
declare const GlobalVipErrorMessage: Record<GlobalVipErrorCode, string>;
|
|
679
|
+
/** 跨渠道自动代扣业务错误码枚举。 */
|
|
680
|
+
declare enum AutomaticDebitErrorCode {
|
|
681
|
+
/** 签约参数无效。 */
|
|
682
|
+
AUTO_DEBIT__INVALID_PARAM = 4101,
|
|
683
|
+
/** 签约请求失败或后端返回业务失败。 */
|
|
684
|
+
AUTO_DEBIT__SIGN_REQUEST_FAILED = 4102,
|
|
685
|
+
/** 签约响应缺少渠道执行所需字段。 */
|
|
686
|
+
AUTO_DEBIT__INVALID_RESPONSE = 4103,
|
|
687
|
+
/** 当前运行端不支持服务端返回的执行方式。 */
|
|
688
|
+
AUTO_DEBIT__UNSUPPORTED_CAPABILITY = 4104,
|
|
689
|
+
/** 渠道 API 或 SDK 调起失败。 */
|
|
690
|
+
AUTO_DEBIT__CHANNEL_INVOKE_FAILED = 4105,
|
|
691
|
+
/** 用户主动取消签约或首笔支付。 */
|
|
692
|
+
AUTO_DEBIT__USER_CANCELLED = 4106,
|
|
693
|
+
/** 后端最终状态明确失败。 */
|
|
694
|
+
AUTO_DEBIT__CONFIRM_FAILED = 4107,
|
|
695
|
+
/** 最终状态确认超时,当前仍为待确认状态。 */
|
|
696
|
+
AUTO_DEBIT__CONFIRM_TIMEOUT = 4108
|
|
697
|
+
}
|
|
698
|
+
/** 跨渠道自动代扣业务错误信息映射。 */
|
|
699
|
+
declare const AutomaticDebitErrorMessage: Record<AutomaticDebitErrorCode, string>;
|
|
660
700
|
|
|
661
701
|
/**
|
|
662
702
|
* @Description: 广告配置接口类型定义
|
|
@@ -927,6 +967,26 @@ interface GetDisplayAdOptions {
|
|
|
927
967
|
userId?: number;
|
|
928
968
|
/** 广告展示类型 */
|
|
929
969
|
type?: DisplayAdType;
|
|
970
|
+
/** 由 UI/宿主传入的埋点上下文;services 不自行推导页面。 */
|
|
971
|
+
pageId?: string;
|
|
972
|
+
moduleId?: string;
|
|
973
|
+
trackingSource?: 'ui' | 'service';
|
|
974
|
+
tracking?: {
|
|
975
|
+
track?: (event: {
|
|
976
|
+
key: string;
|
|
977
|
+
featureId?: string;
|
|
978
|
+
moduleId?: string;
|
|
979
|
+
pageId?: string;
|
|
980
|
+
pageIdSource?: string;
|
|
981
|
+
pageUrl?: string;
|
|
982
|
+
attr?: Record<string, unknown>;
|
|
983
|
+
}) => void;
|
|
984
|
+
resolvePage?: (pageId?: string) => {
|
|
985
|
+
pageId: string;
|
|
986
|
+
pageIdSource: 'props' | 'runtime_path' | 'runtime_route' | 'unknown';
|
|
987
|
+
pageUrl?: string;
|
|
988
|
+
};
|
|
989
|
+
};
|
|
930
990
|
}
|
|
931
991
|
/**
|
|
932
992
|
* 标准化展示广告结果
|
|
@@ -1073,12 +1133,191 @@ declare function normalizeProductConfig(productConfig: ProductConfigApiData | nu
|
|
|
1073
1133
|
*/
|
|
1074
1134
|
declare function getProductConfig(options: GetProductConfigOptions): Promise<BuildResultReturn<ProductPlacementResult>>;
|
|
1075
1135
|
|
|
1136
|
+
/**
|
|
1137
|
+
* @Description: 自动代扣 API 类型定义
|
|
1138
|
+
* @Author: wutao
|
|
1139
|
+
* @Date: 2026-09-29
|
|
1140
|
+
* @LastEditors: wutao
|
|
1141
|
+
* @LastEditTime: 2026-09-29 11:23:27
|
|
1142
|
+
*/
|
|
1143
|
+
|
|
1144
|
+
/** 当前项目已接入的自动代扣渠道。 */
|
|
1145
|
+
declare const AUTOMATIC_DEBIT_CHANNELS: readonly ["OfficialYq", "WxOfficial", "dyNpp", "DySgp"];
|
|
1146
|
+
/** 当前项目已接入的自动代扣渠道类型。 */
|
|
1147
|
+
type AutomaticDebitChannel = typeof AUTOMATIC_DEBIT_CHANNELS[number];
|
|
1148
|
+
/** 当前项目自动代扣接口支持的扣费类型。 */
|
|
1149
|
+
declare const AUTOMATIC_DEBIT_TYPES: readonly ["alipay", "aliPay", "wechat"];
|
|
1150
|
+
/** 当前项目自动代扣接口支持的扣费类型。 */
|
|
1151
|
+
type AutomaticDebitType = typeof AUTOMATIC_DEBIT_TYPES[number];
|
|
1152
|
+
/** 微信自动代扣签约模式。 */
|
|
1153
|
+
type AutomaticDebitWechatSignMode = 'PURE' | 'PAY';
|
|
1154
|
+
/** 抖音外部调起方式偏好。 */
|
|
1155
|
+
type AutomaticDebitDouyinRedirectType = 'ulink' | 'command';
|
|
1156
|
+
/** 服务端支持的自动代扣调起方式。 */
|
|
1157
|
+
declare const AUTOMATIC_DEBIT_REDIRECT_TYPES: readonly ["wxMini", "aliMini", "h5", "command", "jsapi"];
|
|
1158
|
+
/** 服务端支持的自动代扣调起方式。 */
|
|
1159
|
+
type AutomaticDebitRedirectType = typeof AUTOMATIC_DEBIT_REDIRECT_TYPES[number];
|
|
1160
|
+
/** 统一自动代扣签约接口入参。 */
|
|
1161
|
+
interface AutomaticDebitSignRequest {
|
|
1162
|
+
/** 设备编号。 */
|
|
1163
|
+
equipmentValue: string;
|
|
1164
|
+
/** 扣费类型;当前抖音渠道沿用 `wechat`。 */
|
|
1165
|
+
debitType: AutomaticDebitType;
|
|
1166
|
+
/** 后续周期扣费金额。 */
|
|
1167
|
+
debitAmount: number | string;
|
|
1168
|
+
/** 服务端约定的首次执行时间。 */
|
|
1169
|
+
executeTime: string;
|
|
1170
|
+
/** 扣费周期。 */
|
|
1171
|
+
period: number | string;
|
|
1172
|
+
/** 当前项目渠道编码。 */
|
|
1173
|
+
channel: AutomaticDebitChannel;
|
|
1174
|
+
/** 渠道完成后的业务回跳地址。 */
|
|
1175
|
+
returnUrl?: string;
|
|
1176
|
+
/** 渠道需要的用户手机号。 */
|
|
1177
|
+
phoneNumber?: string;
|
|
1178
|
+
/** 首笔支付金额。 */
|
|
1179
|
+
firstPayAmount?: number | string;
|
|
1180
|
+
/** 首次扣费周期。 */
|
|
1181
|
+
firstDebitPeriod?: number | string;
|
|
1182
|
+
/** 服务端业务类型。 */
|
|
1183
|
+
businessType?: number;
|
|
1184
|
+
/** 业务平台标识。 */
|
|
1185
|
+
platform?: string;
|
|
1186
|
+
/** 业务透传参数。 */
|
|
1187
|
+
extraInfo?: Record<string, unknown>;
|
|
1188
|
+
/** 仅签约标识。 */
|
|
1189
|
+
signOnly?: boolean;
|
|
1190
|
+
/** 微信签约模式。 */
|
|
1191
|
+
wechatSignMode?: AutomaticDebitWechatSignMode;
|
|
1192
|
+
/** 微信应用标识。 */
|
|
1193
|
+
wechatAppId?: string;
|
|
1194
|
+
/** 抖音应用标识。 */
|
|
1195
|
+
douyinAppId?: string;
|
|
1196
|
+
/** 抖音外部调起方式偏好。 */
|
|
1197
|
+
douyinRedirectType?: AutomaticDebitDouyinRedirectType;
|
|
1198
|
+
/** 抖音签约承载页地址。 */
|
|
1199
|
+
douyinSignPage?: string;
|
|
1200
|
+
}
|
|
1201
|
+
/** 统一自动代扣签约接口响应体。 */
|
|
1202
|
+
interface AutomaticDebitSignResponse {
|
|
1203
|
+
/** 商户签约订单号。 */
|
|
1204
|
+
orderNo?: string;
|
|
1205
|
+
/** 服务端实际选择的渠道。 */
|
|
1206
|
+
channel?: AutomaticDebitChannel;
|
|
1207
|
+
/** 服务端实际选择的调起方式。 */
|
|
1208
|
+
redirectType?: AutomaticDebitRedirectType;
|
|
1209
|
+
/** H5 地址、渠道口令、小程序路径或渠道交易号。 */
|
|
1210
|
+
payUrl?: string;
|
|
1211
|
+
/** 渠道应用标识。 */
|
|
1212
|
+
appId?: string;
|
|
1213
|
+
/** 渠道 SDK 调起参数。 */
|
|
1214
|
+
payInfo?: Record<string, unknown> | string;
|
|
1215
|
+
/** 抖音交易类型。 */
|
|
1216
|
+
tradeType?: string;
|
|
1217
|
+
/** 抖音换端续接标识。 */
|
|
1218
|
+
douyinRequestId?: string;
|
|
1219
|
+
/** 渠道用户标识;不得输出到日志。 */
|
|
1220
|
+
openId?: string;
|
|
1221
|
+
}
|
|
1222
|
+
/** 自动代扣签约接口完整响应。 */
|
|
1223
|
+
type AutomaticDebitSignApiResponse = ApiResponse<AutomaticDebitSignResponse>;
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* @Description: 自动代扣服务公共类型定义
|
|
1227
|
+
* @Author: wutao
|
|
1228
|
+
* @Date: 2026-09-29
|
|
1229
|
+
* @LastEditors: wutao
|
|
1230
|
+
* @LastEditTime: 2026-10-12 18:07:41
|
|
1231
|
+
*/
|
|
1232
|
+
|
|
1233
|
+
/** SDK 可识别的自动代扣运行端。 */
|
|
1234
|
+
type AutomaticDebitRuntime = 'h5' | 'wechat-mini-program' | 'alipay-mini-program' | 'unknown';
|
|
1235
|
+
/** 自动代扣能力不支持原因。 */
|
|
1236
|
+
type AutomaticDebitCapabilityReason = 'INVALID_RESPONSE' | 'UNSUPPORTED_RUNTIME' | 'MISSING_PLATFORM_API' | 'UNSUPPORTED_CHANNEL_REDIRECT';
|
|
1237
|
+
/** 自动代扣前端执行状态。 */
|
|
1238
|
+
type AutomaticDebitExecutionState = 'redirected' | 'invoked' | 'command_ready' | 'cancelled' | 'failed';
|
|
1239
|
+
/** 自动代扣前端执行结果。 */
|
|
1240
|
+
interface AutomaticDebitExecutionResult {
|
|
1241
|
+
state: AutomaticDebitExecutionState;
|
|
1242
|
+
orderNo?: string;
|
|
1243
|
+
channel?: AutomaticDebitChannel;
|
|
1244
|
+
redirectType?: AutomaticDebitRedirectType;
|
|
1245
|
+
/** 仅在口令或宿主需要兜底处理时返回。 */
|
|
1246
|
+
payUrl?: string;
|
|
1247
|
+
/** 渠道原始结果;业务代码不得依赖其具体结构。 */
|
|
1248
|
+
raw?: unknown;
|
|
1249
|
+
}
|
|
1250
|
+
/** 页面或小程序跳转前交给调用方保存的签约上下文。 */
|
|
1251
|
+
interface AutomaticDebitBeforeRedirectContext {
|
|
1252
|
+
orderNo?: string;
|
|
1253
|
+
channel: AutomaticDebitChannel;
|
|
1254
|
+
redirectType: AutomaticDebitRedirectType;
|
|
1255
|
+
payUrl: string;
|
|
1256
|
+
}
|
|
1257
|
+
/** 小程序无法原生打开 H5 签约地址时交给宿主处理的上下文。 */
|
|
1258
|
+
interface AutomaticDebitExternalRedirectContext extends AutomaticDebitBeforeRedirectContext {
|
|
1259
|
+
runtime: 'wechat-mini-program' | 'alipay-mini-program';
|
|
1260
|
+
}
|
|
1261
|
+
/** 自动代扣执行选项。 */
|
|
1262
|
+
interface AutomaticDebitExecuteOptions {
|
|
1263
|
+
/** 跳转发生前执行;可用于持久化 orderNo 和回跳上下文。 */
|
|
1264
|
+
beforeRedirect?: (context: AutomaticDebitBeforeRedirectContext) => void | Promise<void>;
|
|
1265
|
+
/** 小程序收到 H5 签约地址时,由宿主通过 WebView 或换端能力完成跳转。 */
|
|
1266
|
+
externalRedirect?: (context: AutomaticDebitExternalRedirectContext) => void | Promise<void>;
|
|
1267
|
+
}
|
|
1268
|
+
/** 自动代扣能力检测结果。 */
|
|
1269
|
+
interface AutomaticDebitCapability {
|
|
1270
|
+
supported: boolean;
|
|
1271
|
+
runtime: AutomaticDebitRuntime;
|
|
1272
|
+
channel?: AutomaticDebitChannel;
|
|
1273
|
+
redirectType?: AutomaticDebitRedirectType;
|
|
1274
|
+
/** 不支持时返回稳定、可用于业务判断的原因。 */
|
|
1275
|
+
reason?: AutomaticDebitCapabilityReason;
|
|
1276
|
+
/** 不支持时返回可读的诊断信息。 */
|
|
1277
|
+
message?: string;
|
|
1278
|
+
}
|
|
1279
|
+
/** 抖音换端续接参数。 */
|
|
1280
|
+
interface ResumeDouyinParams {
|
|
1281
|
+
requestId: string;
|
|
1282
|
+
}
|
|
1283
|
+
/** 自动代扣最终状态查询函数。 */
|
|
1284
|
+
type AutomaticDebitConfirmQuery = (orderNo: string) => Promise<'PENDING' | 'SUCCESS' | 'FAILED'>;
|
|
1285
|
+
/** 自动代扣最终状态确认选项。 */
|
|
1286
|
+
interface AutomaticDebitConfirmOptions {
|
|
1287
|
+
/** 查询间隔,默认 2000 毫秒,最小 1000 毫秒。 */
|
|
1288
|
+
intervalMs?: number;
|
|
1289
|
+
/** 最长查询时间,默认 60000 毫秒。 */
|
|
1290
|
+
timeoutMs?: number;
|
|
1291
|
+
/** 用于主动终止轮询。 */
|
|
1292
|
+
signal?: AbortSignal;
|
|
1293
|
+
}
|
|
1294
|
+
/** 自动代扣最终确认状态。 */
|
|
1295
|
+
type AutomaticDebitConfirmState = 'pending' | 'confirmed' | 'failed';
|
|
1296
|
+
/** 自动代扣状态仍待确认的原因。 */
|
|
1297
|
+
type AutomaticDebitConfirmPendingReason = 'timeout' | 'aborted';
|
|
1298
|
+
/** 自动代扣最终状态确认结果。 */
|
|
1299
|
+
interface AutomaticDebitConfirmResult {
|
|
1300
|
+
state: AutomaticDebitConfirmState;
|
|
1301
|
+
orderNo: string;
|
|
1302
|
+
/** 状态仍为 pending 时标识超时或主动取消。 */
|
|
1303
|
+
reason?: AutomaticDebitConfirmPendingReason;
|
|
1304
|
+
/** 查询发生暂态异常或超时时保留最后一次异常。 */
|
|
1305
|
+
lastError?: unknown;
|
|
1306
|
+
}
|
|
1307
|
+
/** 挂载到 `nova.automaticDebit` 的公共服务契约。 */
|
|
1308
|
+
interface AutomaticDebitService {
|
|
1309
|
+
execute(params: AutomaticDebitSignRequest, options?: AutomaticDebitExecuteOptions): Promise<BuildResultReturn<AutomaticDebitExecutionResult>>;
|
|
1310
|
+
resumeDouyin(params: ResumeDouyinParams): Promise<BuildResultReturn<AutomaticDebitExecutionResult>>;
|
|
1311
|
+
getCapability(response: AutomaticDebitSignResponse, options?: AutomaticDebitExecuteOptions): AutomaticDebitCapability;
|
|
1312
|
+
confirm(orderNo: string, query: AutomaticDebitConfirmQuery, options?: AutomaticDebitConfirmOptions): Promise<BuildResultReturn<AutomaticDebitConfirmResult>>;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1076
1315
|
/**
|
|
1077
1316
|
* @Description: 平台大会员 API 类型定义
|
|
1078
1317
|
* @Author: wutao
|
|
1079
1318
|
* @Date: 2026-09-21
|
|
1080
1319
|
* @LastEditors: wutao
|
|
1081
|
-
* @LastEditTime: 2026-
|
|
1320
|
+
* @LastEditTime: 2026-10-12 16:43:08
|
|
1082
1321
|
*/
|
|
1083
1322
|
|
|
1084
1323
|
/** 平台大会员卡等级 */
|
|
@@ -1101,7 +1340,7 @@ type GlobalVipDebitType = 'alipay' | 'aliPay' | 'wechat';
|
|
|
1101
1340
|
* @Author: wutao
|
|
1102
1341
|
* @Date: 2026-09-21
|
|
1103
1342
|
* @LastEditors: wutao
|
|
1104
|
-
* @LastEditTime: 2026-
|
|
1343
|
+
* @LastEditTime: 2026-10-12 18:07:41
|
|
1105
1344
|
*/
|
|
1106
1345
|
|
|
1107
1346
|
/** 当前操作系统 */
|
|
@@ -1149,35 +1388,11 @@ interface GlobalVipSubscribeState {
|
|
|
1149
1388
|
active: boolean;
|
|
1150
1389
|
status: GlobalVipMemberStatus;
|
|
1151
1390
|
}
|
|
1152
|
-
/**
|
|
1153
|
-
type
|
|
1391
|
+
/** 平台大会员签约流程执行结果。 */
|
|
1392
|
+
type GlobalVipSubscribeFlowResult = {
|
|
1154
1393
|
type: 'already_active';
|
|
1155
1394
|
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
|
-
};
|
|
1395
|
+
} | AutomaticDebitExecutionResult;
|
|
1181
1396
|
/** 获取入口上下文参数 */
|
|
1182
1397
|
interface GetGlobalVipEntryContextOptions {
|
|
1183
1398
|
equipmentValue: string;
|
|
@@ -1207,10 +1422,12 @@ interface HandleGlobalVipSubscribeOptions {
|
|
|
1207
1422
|
source?: GlobalVipSource;
|
|
1208
1423
|
returnUrl: string;
|
|
1209
1424
|
config?: GlobalVipSubscribeConfig;
|
|
1210
|
-
douyinTransferUrl?: string;
|
|
1211
|
-
fromTransferPage?: boolean;
|
|
1212
1425
|
/** 微信签约所需 AppId;微信 H5 未传时按当前 services 环境使用内置 AppId。 */
|
|
1213
1426
|
wechatAppId?: string;
|
|
1427
|
+
/** 页面或小程序跳转前保存签约订单号和回跳上下文。 */
|
|
1428
|
+
beforeRedirect?: AutomaticDebitExecuteOptions['beforeRedirect'];
|
|
1429
|
+
/** 小程序收到 H5 签约地址时,通过业务 WebView 或换端能力完成跳转。 */
|
|
1430
|
+
externalRedirect?: AutomaticDebitExecuteOptions['externalRedirect'];
|
|
1214
1431
|
}
|
|
1215
1432
|
/** 签约回跳轮询参数 */
|
|
1216
1433
|
interface PollGlobalVipSubscribeResultOptions {
|
|
@@ -1232,7 +1449,7 @@ interface GlobalVipService {
|
|
|
1232
1449
|
getSubscribeState(): Promise<BuildResultReturn<GlobalVipSubscribeState>>;
|
|
1233
1450
|
checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<BuildResultReturn<GlobalVipBenefitResult>>;
|
|
1234
1451
|
recordExposure(): Promise<BuildResultReturn<boolean>>;
|
|
1235
|
-
handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<
|
|
1452
|
+
handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeFlowResult>>;
|
|
1236
1453
|
pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
|
|
1237
1454
|
clearCache(): void;
|
|
1238
1455
|
}
|
|
@@ -1246,10 +1463,19 @@ declare function checkBenefit(options: CheckGlobalVipBenefitOptions): Promise<Bu
|
|
|
1246
1463
|
/** 记录一次后端平台大会员曝光。 */
|
|
1247
1464
|
declare function recordExposure(): Promise<BuildResultReturn<boolean>>;
|
|
1248
1465
|
/** 创建签约并将渠道响应归一化为宿主动作。 */
|
|
1249
|
-
declare function handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<
|
|
1466
|
+
declare function handleSubscribeFlow(options: HandleGlobalVipSubscribeOptions): Promise<BuildResultReturn<GlobalVipSubscribeFlowResult>>;
|
|
1250
1467
|
/** 签约回跳后轮询会员状态与权益到账状态。 */
|
|
1251
1468
|
declare function pollSubscribeResult(options: PollGlobalVipSubscribeResultOptions): Promise<BuildResultReturn<GlobalVipSubscribeResult>>;
|
|
1252
1469
|
/** 清除平台大会员入口与订阅配置缓存。 */
|
|
1253
1470
|
declare function clearCache(): void;
|
|
1254
1471
|
|
|
1255
|
-
|
|
1472
|
+
/** 创建签约订单并按服务端响应调起对应渠道。 */
|
|
1473
|
+
declare function execute(params: AutomaticDebitSignRequest, options?: AutomaticDebitExecuteOptions): Promise<BuildResultReturn<AutomaticDebitExecutionResult>>;
|
|
1474
|
+
/** 返回当前运行端对指定服务端响应的支持情况。 */
|
|
1475
|
+
declare function getCapability(response: AutomaticDebitSignResponse, options?: AutomaticDebitExecuteOptions): AutomaticDebitCapability;
|
|
1476
|
+
/** 使用 requestId 在抖音 H5 承载页继续自动代扣签约。 */
|
|
1477
|
+
declare function resumeDouyin(params: ResumeDouyinParams): Promise<BuildResultReturn<AutomaticDebitExecutionResult>>;
|
|
1478
|
+
/** 轮询调用方提供的只读查询函数,确认自动代扣最终状态。 */
|
|
1479
|
+
declare function confirm(orderNo: string, query: AutomaticDebitConfirmQuery, options?: AutomaticDebitConfirmOptions): Promise<BuildResultReturn<AutomaticDebitConfirmResult>>;
|
|
1480
|
+
|
|
1481
|
+
export { type AutomaticDebitBeforeRedirectContext, type AutomaticDebitCapability, type AutomaticDebitCapabilityReason, type AutomaticDebitChannel, type AutomaticDebitConfirmOptions, type AutomaticDebitConfirmPendingReason, type AutomaticDebitConfirmQuery, type AutomaticDebitConfirmResult, type AutomaticDebitConfirmState, type AutomaticDebitDouyinRedirectType, AutomaticDebitErrorCode, AutomaticDebitErrorMessage, type AutomaticDebitExecuteOptions, type AutomaticDebitExecutionResult, type AutomaticDebitExecutionState, type AutomaticDebitExternalRedirectContext, type AutomaticDebitRedirectType, type AutomaticDebitRuntime, type AutomaticDebitService, type AutomaticDebitSignApiResponse, type AutomaticDebitSignRequest, type AutomaticDebitSignResponse, type AutomaticDebitType, type AutomaticDebitWechatSignMode, 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 GlobalVipSubscribeConfig, type GlobalVipSubscribeFlowResult, 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 ResumeDouyinParams, type ServicesOptions, checkBenefit, clearCache, confirm, createServices, execute, getCapability, getDisplayAdConfig, getDyPayRtaData, getEntryContext, getProductConfig, getSubscribeState, handleDyAuthDebitSignFlow, handleDyAuthDebitSignFlowWithRawPayInfo, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, handleSubscribeFlow, normalizeDisplayAdData, normalizeProductConfig, pollSubscribeResult, recordExposure, resumeDouyin };
|