@ftvs/jssdk 1.3.0 → 1.4.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/lib/index.d.ts +189 -0
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -180,6 +180,46 @@ interface DefaultAddressResult {
|
|
|
180
180
|
*/
|
|
181
181
|
declare function defaultAddress(): Promise<DefaultAddressResult>;
|
|
182
182
|
|
|
183
|
+
interface GetAppInfoResult {
|
|
184
|
+
/**
|
|
185
|
+
* 设备Id
|
|
186
|
+
*/
|
|
187
|
+
deviceId: string;
|
|
188
|
+
/**
|
|
189
|
+
* 维度
|
|
190
|
+
*/
|
|
191
|
+
latitude: string;
|
|
192
|
+
/**
|
|
193
|
+
* 经度
|
|
194
|
+
*/
|
|
195
|
+
longitude: string;
|
|
196
|
+
/**
|
|
197
|
+
* 网络类型
|
|
198
|
+
*/
|
|
199
|
+
netType: string;
|
|
200
|
+
/**
|
|
201
|
+
* 是否已经登录
|
|
202
|
+
*/
|
|
203
|
+
isLogin: boolean;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 获取App信息。
|
|
207
|
+
* @category 基础
|
|
208
|
+
* @example
|
|
209
|
+
* ```javascript
|
|
210
|
+
* const res = await ftv.getAppInfo();
|
|
211
|
+
* // 结果类似:
|
|
212
|
+
* //{
|
|
213
|
+
* // "deviceId": "9afe0aab4be06ce5",
|
|
214
|
+
* // "isLogin": true,
|
|
215
|
+
* // "latitude": "26.61858",
|
|
216
|
+
* // "longitude": "106.64360",
|
|
217
|
+
* // "netType": "WIFI"
|
|
218
|
+
* }
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare function getAppInfo(): Promise<GetAppInfoResult>;
|
|
222
|
+
|
|
183
223
|
interface GetAuthCodePayload {
|
|
184
224
|
/**
|
|
185
225
|
* 应用id
|
|
@@ -228,6 +268,38 @@ interface GetTokenResult {
|
|
|
228
268
|
*/
|
|
229
269
|
declare function getAuthToken(): Promise<GetTokenResult>;
|
|
230
270
|
|
|
271
|
+
interface GetAuthUserInfoResult {
|
|
272
|
+
/**
|
|
273
|
+
* 昵称
|
|
274
|
+
*/
|
|
275
|
+
username: string;
|
|
276
|
+
/**
|
|
277
|
+
* 用户头像
|
|
278
|
+
*/
|
|
279
|
+
avatar: string;
|
|
280
|
+
/**
|
|
281
|
+
* 实名状态
|
|
282
|
+
* 0-未实名
|
|
283
|
+
* 1-已实名
|
|
284
|
+
*/
|
|
285
|
+
authStatus: number;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* 用户基本信息(多彩未来内部使用)。
|
|
289
|
+
* @category 开放接口 > 用户信息
|
|
290
|
+
* @example
|
|
291
|
+
* ```javascript
|
|
292
|
+
* const res = await ftv.getAuthUserInfo();
|
|
293
|
+
* // 结果类似:
|
|
294
|
+
* // {
|
|
295
|
+
* // username: '张三’
|
|
296
|
+
* // avatar: 'https://www.dcwl.tv/xxxxx.png’
|
|
297
|
+
* // username: 1
|
|
298
|
+
* // }
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
declare function getAuthUserInfo(): Promise<GetAuthUserInfoResult>;
|
|
302
|
+
|
|
231
303
|
interface Environment {
|
|
232
304
|
/**
|
|
233
305
|
* 是否在未来电视客户端中。
|
|
@@ -296,6 +368,7 @@ declare function getEnvSync(): Environment;
|
|
|
296
368
|
*/
|
|
297
369
|
declare function getEnv(): Promise<Environment>;
|
|
298
370
|
|
|
371
|
+
declare type OneOrMany<T> = T | T[];
|
|
299
372
|
declare type OneData<T> = {
|
|
300
373
|
[K in keyof T]: any;
|
|
301
374
|
};
|
|
@@ -400,6 +473,16 @@ interface NavigateToPayLoad {
|
|
|
400
473
|
*/
|
|
401
474
|
declare function navigateTo(payload: NavigateToPayLoad): Promise<void>;
|
|
402
475
|
|
|
476
|
+
/**
|
|
477
|
+
* 去登录页。
|
|
478
|
+
* @category 基础
|
|
479
|
+
* @example
|
|
480
|
+
* ```javascript
|
|
481
|
+
* await ftv.openLoginPage();
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
declare function openLoginPage(): Promise<void>;
|
|
485
|
+
|
|
403
486
|
interface RequestFaceAuthenticationPayload {
|
|
404
487
|
/**
|
|
405
488
|
* 内部认证`0` 属于多彩未来电视的服务使用
|
|
@@ -431,6 +514,96 @@ interface RequestFaceAuthenticationResult {
|
|
|
431
514
|
*/
|
|
432
515
|
declare function requestFaceAuthentication(payload: RequestFaceAuthenticationPayload): Promise<RequestFaceAuthenticationResult>;
|
|
433
516
|
|
|
517
|
+
interface paramsData {
|
|
518
|
+
/**
|
|
519
|
+
* 标题
|
|
520
|
+
*/
|
|
521
|
+
title: string;
|
|
522
|
+
/**
|
|
523
|
+
* 内容
|
|
524
|
+
*/
|
|
525
|
+
content: string;
|
|
526
|
+
}
|
|
527
|
+
interface RequestPaymentPayload {
|
|
528
|
+
/**
|
|
529
|
+
* 业务名称
|
|
530
|
+
*/
|
|
531
|
+
orgName: string;
|
|
532
|
+
/**
|
|
533
|
+
* 订单号
|
|
534
|
+
*/
|
|
535
|
+
orderNo: string;
|
|
536
|
+
/**
|
|
537
|
+
* 金额
|
|
538
|
+
*/
|
|
539
|
+
orderAmt: number;
|
|
540
|
+
/**
|
|
541
|
+
* 支付状态标签
|
|
542
|
+
* `0 不展示`
|
|
543
|
+
*
|
|
544
|
+
*/
|
|
545
|
+
amtType?: string;
|
|
546
|
+
/**
|
|
547
|
+
* 开放平台APPID
|
|
548
|
+
*/
|
|
549
|
+
openAppId?: string;
|
|
550
|
+
/**
|
|
551
|
+
* 支付二维码生成参数
|
|
552
|
+
*/
|
|
553
|
+
qrCode: string;
|
|
554
|
+
/**
|
|
555
|
+
* 支付类型
|
|
556
|
+
* number `1 微信 2 支付宝`
|
|
557
|
+
*/
|
|
558
|
+
qrType: 1 | 2;
|
|
559
|
+
/**
|
|
560
|
+
* `paramsData:{content: string;title: string}`;
|
|
561
|
+
*
|
|
562
|
+
* 
|
|
563
|
+
*/
|
|
564
|
+
params: OneOrMany<paramsData>;
|
|
565
|
+
}
|
|
566
|
+
interface RequestPaymentResult {
|
|
567
|
+
/**
|
|
568
|
+
* 支付状态
|
|
569
|
+
*/
|
|
570
|
+
status: boolean;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* 支付。
|
|
574
|
+
*
|
|
575
|
+
* @category 开放接口 > 支付
|
|
576
|
+
* @example
|
|
577
|
+
* ```javascript
|
|
578
|
+
* const res = await ftv.requestPayment({
|
|
579
|
+
* "orgName": "静脉采血",
|
|
580
|
+
* "orderNo": "2024121029777035859353601",
|
|
581
|
+
* "orderAmt": 0.01,
|
|
582
|
+
* "qrCode": "weixin://wxpay/bizpayurl?pr=rr0QIYVz1",
|
|
583
|
+
* "qrType": 1,
|
|
584
|
+
* "params": [
|
|
585
|
+
* {
|
|
586
|
+
* "title": "订单名称",
|
|
587
|
+
* "content": "静脉采血"
|
|
588
|
+
* },
|
|
589
|
+
* {
|
|
590
|
+
* "title": "订单编号",
|
|
591
|
+
* "content": "2024121029777035859353601"
|
|
592
|
+
* },
|
|
593
|
+
* {
|
|
594
|
+
* "title": "创建时间",
|
|
595
|
+
* "content": "2024-08-12 15:26:18"
|
|
596
|
+
* }
|
|
597
|
+
* ]
|
|
598
|
+
* });
|
|
599
|
+
* // 结果类似:
|
|
600
|
+
* // {
|
|
601
|
+
* // status: true
|
|
602
|
+
* // }
|
|
603
|
+
* ```
|
|
604
|
+
*/
|
|
605
|
+
declare function requestPayment(payload: RequestPaymentPayload): Promise<RequestPaymentResult>;
|
|
606
|
+
|
|
434
607
|
interface ReturnToControlPayload {
|
|
435
608
|
/**
|
|
436
609
|
* 是否管控
|
|
@@ -493,11 +666,15 @@ type _ftv_ConfigPayload = ConfigPayload;
|
|
|
493
666
|
declare const _ftv_config: typeof config;
|
|
494
667
|
type _ftv_DefaultAddressResult = DefaultAddressResult;
|
|
495
668
|
declare const _ftv_defaultAddress: typeof defaultAddress;
|
|
669
|
+
type _ftv_GetAppInfoResult = GetAppInfoResult;
|
|
670
|
+
declare const _ftv_getAppInfo: typeof getAppInfo;
|
|
496
671
|
type _ftv_GetAuthCodePayload = GetAuthCodePayload;
|
|
497
672
|
type _ftv_GetAuthCodeResult = GetAuthCodeResult;
|
|
498
673
|
declare const _ftv_getAuthCode: typeof getAuthCode;
|
|
499
674
|
type _ftv_GetTokenResult = GetTokenResult;
|
|
500
675
|
declare const _ftv_getAuthToken: typeof getAuthToken;
|
|
676
|
+
type _ftv_GetAuthUserInfoResult = GetAuthUserInfoResult;
|
|
677
|
+
declare const _ftv_getAuthUserInfo: typeof getAuthUserInfo;
|
|
501
678
|
declare const _ftv_getEnv: typeof getEnv;
|
|
502
679
|
type _ftv_Environment = Environment;
|
|
503
680
|
declare const _ftv_getEnvSync: typeof getEnvSync;
|
|
@@ -507,9 +684,13 @@ declare const _ftv_getUserInfo: typeof getUserInfo;
|
|
|
507
684
|
declare const _ftv_navigateBack: typeof navigateBack;
|
|
508
685
|
type _ftv_NavigateToPayLoad = NavigateToPayLoad;
|
|
509
686
|
declare const _ftv_navigateTo: typeof navigateTo;
|
|
687
|
+
declare const _ftv_openLoginPage: typeof openLoginPage;
|
|
510
688
|
type _ftv_RequestFaceAuthenticationPayload = RequestFaceAuthenticationPayload;
|
|
511
689
|
type _ftv_RequestFaceAuthenticationResult = RequestFaceAuthenticationResult;
|
|
512
690
|
declare const _ftv_requestFaceAuthentication: typeof requestFaceAuthentication;
|
|
691
|
+
type _ftv_RequestPaymentPayload = RequestPaymentPayload;
|
|
692
|
+
type _ftv_RequestPaymentResult = RequestPaymentResult;
|
|
693
|
+
declare const _ftv_requestPayment: typeof requestPayment;
|
|
513
694
|
type _ftv_ReturnToControlPayload = ReturnToControlPayload;
|
|
514
695
|
declare const _ftv_returnToControl: typeof returnToControl;
|
|
515
696
|
type _ftv_SelectFamilyResult = SelectFamilyResult;
|
|
@@ -526,11 +707,15 @@ declare namespace _ftv {
|
|
|
526
707
|
_ftv_config as config,
|
|
527
708
|
_ftv_DefaultAddressResult as DefaultAddressResult,
|
|
528
709
|
_ftv_defaultAddress as defaultAddress,
|
|
710
|
+
_ftv_GetAppInfoResult as GetAppInfoResult,
|
|
711
|
+
_ftv_getAppInfo as getAppInfo,
|
|
529
712
|
_ftv_GetAuthCodePayload as GetAuthCodePayload,
|
|
530
713
|
_ftv_GetAuthCodeResult as GetAuthCodeResult,
|
|
531
714
|
_ftv_getAuthCode as getAuthCode,
|
|
532
715
|
_ftv_GetTokenResult as GetTokenResult,
|
|
533
716
|
_ftv_getAuthToken as getAuthToken,
|
|
717
|
+
_ftv_GetAuthUserInfoResult as GetAuthUserInfoResult,
|
|
718
|
+
_ftv_getAuthUserInfo as getAuthUserInfo,
|
|
534
719
|
_ftv_getEnv as getEnv,
|
|
535
720
|
_ftv_Environment as Environment,
|
|
536
721
|
_ftv_getEnvSync as getEnvSync,
|
|
@@ -540,9 +725,13 @@ declare namespace _ftv {
|
|
|
540
725
|
_ftv_navigateBack as navigateBack,
|
|
541
726
|
_ftv_NavigateToPayLoad as NavigateToPayLoad,
|
|
542
727
|
_ftv_navigateTo as navigateTo,
|
|
728
|
+
_ftv_openLoginPage as openLoginPage,
|
|
543
729
|
_ftv_RequestFaceAuthenticationPayload as RequestFaceAuthenticationPayload,
|
|
544
730
|
_ftv_RequestFaceAuthenticationResult as RequestFaceAuthenticationResult,
|
|
545
731
|
_ftv_requestFaceAuthentication as requestFaceAuthentication,
|
|
732
|
+
_ftv_RequestPaymentPayload as RequestPaymentPayload,
|
|
733
|
+
_ftv_RequestPaymentResult as RequestPaymentResult,
|
|
734
|
+
_ftv_requestPayment as requestPayment,
|
|
546
735
|
_ftv_ReturnToControlPayload as ReturnToControlPayload,
|
|
547
736
|
_ftv_returnToControl as returnToControl,
|
|
548
737
|
_ftv_SelectFamilyResult as SelectFamilyResult,
|