zmp-sdk 2.14.4 → 2.15.0-rc.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/browser.min.js +956 -229
- package/dist/index.es.js +956 -229
- package/dist/index.js +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/types/src/config.d.ts +1 -0
- package/dist/types/src/constants.d.ts +14 -88
- package/dist/types/src/controller/index.d.ts +1 -0
- package/dist/types/src/controller/interface.d.ts +1 -0
- package/dist/types/src/controller/mock-mp-manager.d.ts +1 -0
- package/dist/types/src/controller/zalo-mp-manager.d.ts +3 -0
- package/dist/types/src/services/zalo.d.ts +18 -0
- package/dist/types/src/types/callbackData.d.ts +14 -0
- package/dist/types/src/types/enum.d.ts +2 -1
- package/dist/types/src/types/inputData.d.ts +9 -0
- package/dist/types/src/utils/response.d.ts +3 -0
- package/package.json +2 -2
package/dist/browser.min.js
CHANGED
|
@@ -21366,6 +21366,7 @@
|
|
|
21366
21366
|
ShareSheetType[ShareSheetType["video"] = 12] = "video";
|
|
21367
21367
|
ShareSheetType[ShareSheetType["link"] = 4] = "link";
|
|
21368
21368
|
ShareSheetType[ShareSheetType["oa"] = 5] = "oa";
|
|
21369
|
+
ShareSheetType[ShareSheetType["zmp"] = 20] = "zmp";
|
|
21369
21370
|
})(ShareSheetType || (ShareSheetType = {}));
|
|
21370
21371
|
var OrientationType;
|
|
21371
21372
|
(function (OrientationType) {
|
|
@@ -21452,121 +21453,500 @@
|
|
|
21452
21453
|
};
|
|
21453
21454
|
|
|
21454
21455
|
const ACTION = {
|
|
21455
|
-
GET_DOWNLOADED_STICKER:
|
|
21456
|
-
|
|
21457
|
-
|
|
21458
|
-
|
|
21459
|
-
|
|
21460
|
-
|
|
21461
|
-
|
|
21462
|
-
|
|
21463
|
-
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
|
|
21470
|
-
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
|
|
21474
|
-
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21480
|
-
|
|
21481
|
-
|
|
21482
|
-
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
|
|
21488
|
-
|
|
21489
|
-
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21511
|
-
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
|
|
21526
|
-
|
|
21527
|
-
|
|
21528
|
-
|
|
21529
|
-
|
|
21530
|
-
|
|
21531
|
-
|
|
21532
|
-
|
|
21533
|
-
|
|
21534
|
-
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21456
|
+
GET_DOWNLOADED_STICKER: {
|
|
21457
|
+
name: 'action.get.downloaded.sticker',
|
|
21458
|
+
version_live: { android: 0, iOS: 0 },
|
|
21459
|
+
have_permission: false
|
|
21460
|
+
},
|
|
21461
|
+
OPEN_SHARE_STICKER: {
|
|
21462
|
+
name: 'action.open.share.sticker',
|
|
21463
|
+
version_live: { android: 0, iOS: 0 },
|
|
21464
|
+
have_permission: false
|
|
21465
|
+
},
|
|
21466
|
+
OPEN_PROFILE: {
|
|
21467
|
+
name: 'action.open.profile',
|
|
21468
|
+
version_live: { android: 0, iOS: 0 },
|
|
21469
|
+
have_permission: false
|
|
21470
|
+
},
|
|
21471
|
+
OPEN_FEED_DETAIL: {
|
|
21472
|
+
name: 'action.open.feeddetail',
|
|
21473
|
+
version_live: { android: 0, iOS: 0 },
|
|
21474
|
+
have_permission: false
|
|
21475
|
+
},
|
|
21476
|
+
OPEN_FRIEND_RADA: {
|
|
21477
|
+
name: 'action.open.friendrada',
|
|
21478
|
+
version_live: { android: 0, iOS: 0 },
|
|
21479
|
+
have_permission: false
|
|
21480
|
+
},
|
|
21481
|
+
OPEN_INAPP: {
|
|
21482
|
+
name: 'action.open.inapp',
|
|
21483
|
+
version_live: { android: 0, iOS: 0 },
|
|
21484
|
+
have_permission: false
|
|
21485
|
+
},
|
|
21486
|
+
OPEN_OUTAPP: {
|
|
21487
|
+
name: 'action.open.outapp',
|
|
21488
|
+
version_live: { android: 0, iOS: 0 },
|
|
21489
|
+
have_permission: false
|
|
21490
|
+
},
|
|
21491
|
+
OPEN_PAGE: {
|
|
21492
|
+
name: 'action.open.page',
|
|
21493
|
+
version_live: { android: 0, iOS: 0 },
|
|
21494
|
+
have_permission: false
|
|
21495
|
+
},
|
|
21496
|
+
OPEN_PHOTODETAIL: {
|
|
21497
|
+
name: 'action.open.photodetail',
|
|
21498
|
+
version_live: { android: 0, iOS: 0 },
|
|
21499
|
+
have_permission: false
|
|
21500
|
+
},
|
|
21501
|
+
OPEN_GALARY: {
|
|
21502
|
+
name: 'action.open.galary',
|
|
21503
|
+
version_live: { android: 0, iOS: 0 },
|
|
21504
|
+
have_permission: false
|
|
21505
|
+
},
|
|
21506
|
+
OPEN_GAMECENTER: {
|
|
21507
|
+
name: 'action.open.gamecenter',
|
|
21508
|
+
version_live: { android: 0, iOS: 0 },
|
|
21509
|
+
have_permission: false
|
|
21510
|
+
},
|
|
21511
|
+
OPEN_GAMENEWS: {
|
|
21512
|
+
name: 'action.open.gamenews',
|
|
21513
|
+
version_live: { android: 0, iOS: 0 },
|
|
21514
|
+
have_permission: false
|
|
21515
|
+
},
|
|
21516
|
+
OPEN_TAB_CONTACT: {
|
|
21517
|
+
name: 'action.open.tab.contact',
|
|
21518
|
+
version_live: { android: 0, iOS: 0 },
|
|
21519
|
+
have_permission: false
|
|
21520
|
+
},
|
|
21521
|
+
OPEN_TAB_SOCIAL: {
|
|
21522
|
+
name: 'action.open.tab.social',
|
|
21523
|
+
version_live: { android: 0, iOS: 0 },
|
|
21524
|
+
have_permission: false
|
|
21525
|
+
},
|
|
21526
|
+
OPEN_FRIENDSUGGEST: {
|
|
21527
|
+
name: 'action.open.friendsuggest',
|
|
21528
|
+
version_live: { android: 0, iOS: 0 },
|
|
21529
|
+
have_permission: false
|
|
21530
|
+
},
|
|
21531
|
+
OPEN_GROUPLIST: {
|
|
21532
|
+
name: 'action.open.grouplist',
|
|
21533
|
+
version_live: { android: 0, iOS: 0 },
|
|
21534
|
+
have_permission: false
|
|
21535
|
+
},
|
|
21536
|
+
OPEN_NEARBY: {
|
|
21537
|
+
name: 'action.open.nearby',
|
|
21538
|
+
version_live: { android: 0, iOS: 0 },
|
|
21539
|
+
have_permission: false
|
|
21540
|
+
},
|
|
21541
|
+
OPEN_ROOM: {
|
|
21542
|
+
name: 'action.open.room',
|
|
21543
|
+
version_live: { android: 0, iOS: 0 },
|
|
21544
|
+
have_permission: false
|
|
21545
|
+
},
|
|
21546
|
+
OPEN_STICKERSTORE: {
|
|
21547
|
+
name: 'action.open.stickerstore',
|
|
21548
|
+
version_live: { android: 0, iOS: 0 },
|
|
21549
|
+
have_permission: false
|
|
21550
|
+
},
|
|
21551
|
+
OPEN_CREATECHAT: {
|
|
21552
|
+
name: 'action.open.createchat',
|
|
21553
|
+
version_live: { android: 0, iOS: 0 },
|
|
21554
|
+
have_permission: false
|
|
21555
|
+
},
|
|
21556
|
+
COPY_LINK_CATESTICKER: {
|
|
21557
|
+
name: 'action.copy.link.catesticker',
|
|
21558
|
+
version_live: { android: 0, iOS: 0 },
|
|
21559
|
+
have_permission: false
|
|
21560
|
+
},
|
|
21561
|
+
REQUEST_BUY_STICKER: {
|
|
21562
|
+
name: 'action.request.buy.sticker',
|
|
21563
|
+
version_live: { android: 0, iOS: 0 },
|
|
21564
|
+
have_permission: false
|
|
21565
|
+
},
|
|
21566
|
+
OPEN_CHAT: {
|
|
21567
|
+
name: 'action.open.chat',
|
|
21568
|
+
version_live: { android: 0, iOS: 0 },
|
|
21569
|
+
have_permission: false
|
|
21570
|
+
},
|
|
21571
|
+
OPEN_TAB_CHAT: {
|
|
21572
|
+
name: 'action.open.tab.chat',
|
|
21573
|
+
version_live: { android: 0, iOS: 0 },
|
|
21574
|
+
have_permission: false
|
|
21575
|
+
},
|
|
21576
|
+
OPEN_CHATGROUP: {
|
|
21577
|
+
name: 'action.open.chatgroup',
|
|
21578
|
+
version_live: { android: 0, iOS: 0 },
|
|
21579
|
+
have_permission: false
|
|
21580
|
+
},
|
|
21581
|
+
OPEN_ADDFRIEND: {
|
|
21582
|
+
name: 'action.open.addfriend',
|
|
21583
|
+
version_live: { android: 0, iOS: 0 },
|
|
21584
|
+
have_permission: false
|
|
21585
|
+
},
|
|
21586
|
+
OPEN_TAB_MORE: {
|
|
21587
|
+
name: 'action.open.tab.more',
|
|
21588
|
+
version_live: { android: 0, iOS: 0 },
|
|
21589
|
+
have_permission: false
|
|
21590
|
+
},
|
|
21591
|
+
OPEN_POSTFEED: {
|
|
21592
|
+
name: 'action.open.postfeed',
|
|
21593
|
+
version_live: { android: 0, iOS: 0 },
|
|
21594
|
+
have_permission: false
|
|
21595
|
+
},
|
|
21596
|
+
OPEN_LOGINDEVICES: {
|
|
21597
|
+
name: 'action.open.logindevices',
|
|
21598
|
+
version_live: { android: 0, iOS: 0 },
|
|
21599
|
+
have_permission: false
|
|
21600
|
+
},
|
|
21601
|
+
OPEN_SENDSTICKER: {
|
|
21602
|
+
name: 'action.open.sendsticker',
|
|
21603
|
+
version_live: { android: 0, iOS: 0 },
|
|
21604
|
+
have_permission: false
|
|
21605
|
+
},
|
|
21606
|
+
REPORT_ABUSE: {
|
|
21607
|
+
name: 'action.report.abuse',
|
|
21608
|
+
version_live: { android: 0, iOS: 0 },
|
|
21609
|
+
have_permission: false
|
|
21610
|
+
},
|
|
21611
|
+
FOLLOW_OA: {
|
|
21612
|
+
name: 'action.follow.oa',
|
|
21613
|
+
version_live: { android: 0, iOS: 0 },
|
|
21614
|
+
have_permission: false
|
|
21615
|
+
},
|
|
21616
|
+
UNFOLLOW_OA: {
|
|
21617
|
+
name: 'action.unfollow.oa',
|
|
21618
|
+
version_live: { android: 0, iOS: 0 },
|
|
21619
|
+
have_permission: false
|
|
21620
|
+
},
|
|
21621
|
+
OPEN_GAMEDETAIL: {
|
|
21622
|
+
name: 'action.open.gamedetail',
|
|
21623
|
+
version_live: { android: 0, iOS: 0 },
|
|
21624
|
+
have_permission: false
|
|
21625
|
+
},
|
|
21626
|
+
OPEN_SHARESHEET: {
|
|
21627
|
+
name: 'action.open.sharesheet',
|
|
21628
|
+
version_live: { android: 0, iOS: 0 },
|
|
21629
|
+
have_permission: false
|
|
21630
|
+
},
|
|
21631
|
+
REQUEST_PERMISSION_CAMERA: {
|
|
21632
|
+
name: 'action.request.permission.camera',
|
|
21633
|
+
version_live: { android: 0, iOS: 0 },
|
|
21634
|
+
have_permission: false
|
|
21635
|
+
},
|
|
21636
|
+
CHANGE_TITLE_HEADER: {
|
|
21637
|
+
name: 'action.change.title.header',
|
|
21638
|
+
version_live: { android: 0, iOS: 0 },
|
|
21639
|
+
have_permission: false,
|
|
21640
|
+
skip_jump: true
|
|
21641
|
+
},
|
|
21642
|
+
WEBVIEW_CLEARCACHE: {
|
|
21643
|
+
name: 'action.webview.clearcache',
|
|
21644
|
+
version_live: { android: 0, iOS: 0 },
|
|
21645
|
+
have_permission: false
|
|
21646
|
+
},
|
|
21647
|
+
WEBVIEW_CONFIRMCACHE: {
|
|
21648
|
+
name: 'action.webview.confirmcache',
|
|
21649
|
+
version_live: { android: 0, iOS: 0 },
|
|
21650
|
+
have_permission: false
|
|
21651
|
+
},
|
|
21652
|
+
WEBVIEW_ISVISIBLE: {
|
|
21653
|
+
name: 'action.webview.isvisible',
|
|
21654
|
+
version_live: { android: 0, iOS: 0 },
|
|
21655
|
+
have_permission: false
|
|
21656
|
+
},
|
|
21657
|
+
WEBVIEW_NETWORKTYPE: {
|
|
21658
|
+
name: 'action.webview.networktype',
|
|
21659
|
+
version_live: { android: 0, iOS: 0 },
|
|
21660
|
+
have_permission: false,
|
|
21661
|
+
skip_jump: true
|
|
21662
|
+
},
|
|
21663
|
+
CHANGE_BUTTON_HEADER: {
|
|
21664
|
+
name: 'action.change.button.header',
|
|
21665
|
+
version_live: { android: 0, iOS: 0 },
|
|
21666
|
+
have_permission: false
|
|
21667
|
+
},
|
|
21668
|
+
CREATE_OPTIONS_MENU: {
|
|
21669
|
+
name: 'action.create.options.menu',
|
|
21670
|
+
version_live: { android: 0, iOS: 0 },
|
|
21671
|
+
have_permission: false,
|
|
21672
|
+
skip_jump: true
|
|
21673
|
+
},
|
|
21674
|
+
CREATE_SHORTCUT: {
|
|
21675
|
+
name: 'action.create.shortcut',
|
|
21676
|
+
version_live: { android: 0, iOS: 0 },
|
|
21677
|
+
have_permission: false
|
|
21678
|
+
},
|
|
21679
|
+
CHANGE_ACTIONBAR_LEFTBUTTON_TYPE: {
|
|
21680
|
+
name: 'action.change.actionbar.leftbutton.type',
|
|
21681
|
+
version_live: { android: 0, iOS: 0 },
|
|
21682
|
+
have_permission: false,
|
|
21683
|
+
skip_jump: true
|
|
21684
|
+
},
|
|
21685
|
+
WINDOW_CLOSE: {
|
|
21686
|
+
name: 'action.window.close',
|
|
21687
|
+
version_live: { android: 0, iOS: 0 },
|
|
21688
|
+
have_permission: false,
|
|
21689
|
+
skip_jump: true
|
|
21690
|
+
},
|
|
21691
|
+
WEBVIEW_CHECKRESERROR: {
|
|
21692
|
+
name: 'action.webview.checkResError',
|
|
21693
|
+
version_live: { android: 0, iOS: 0 },
|
|
21694
|
+
have_permission: false
|
|
21695
|
+
},
|
|
21696
|
+
IAP_REQUESTPAYMENT: {
|
|
21697
|
+
name: 'action.iap.requestpayment',
|
|
21698
|
+
version_live: { android: 0, iOS: 0 },
|
|
21699
|
+
have_permission: false
|
|
21700
|
+
},
|
|
21701
|
+
ZBROWSER_GETSTATS: {
|
|
21702
|
+
name: 'action.zbrowser.getstats',
|
|
21703
|
+
version_live: { android: 0, iOS: 0 },
|
|
21704
|
+
have_permission: false
|
|
21705
|
+
},
|
|
21706
|
+
ZBROWSER_JSBRIDGE: {
|
|
21707
|
+
name: 'action.zbrowser.jsbridge',
|
|
21708
|
+
version_live: { android: 0, iOS: 0 },
|
|
21709
|
+
have_permission: false,
|
|
21710
|
+
skip_jump: true
|
|
21711
|
+
},
|
|
21712
|
+
PROMPT_AUTHENTICATION: {
|
|
21713
|
+
name: 'action.prompt.authentication',
|
|
21714
|
+
version_live: { android: 0, iOS: 0 },
|
|
21715
|
+
have_permission: false
|
|
21716
|
+
},
|
|
21717
|
+
CHANGE_ACTIONBAR_COLOR: {
|
|
21718
|
+
name: 'action.change.actionbar.color',
|
|
21719
|
+
version_live: { android: 0, iOS: 0 },
|
|
21720
|
+
have_permission: false,
|
|
21721
|
+
skip_jump: true
|
|
21722
|
+
},
|
|
21723
|
+
PROMPT_AUTHENTICATION_CHECK_STATE: {
|
|
21724
|
+
name: 'action.prompt.authentication.check_state',
|
|
21725
|
+
version_live: { android: 0, iOS: 0 },
|
|
21726
|
+
have_permission: false
|
|
21727
|
+
},
|
|
21728
|
+
OPEN_APPSTORE: {
|
|
21729
|
+
name: 'action.open.appstore',
|
|
21730
|
+
version_live: { android: 0, iOS: 0 },
|
|
21731
|
+
have_permission: false
|
|
21732
|
+
},
|
|
21733
|
+
GET_LOCATION: {
|
|
21734
|
+
name: 'action.get.location',
|
|
21735
|
+
version_live: { android: 0, iOS: 0 },
|
|
21736
|
+
have_permission: false
|
|
21737
|
+
},
|
|
21738
|
+
QUERY_LOCATION_HIDE: {
|
|
21739
|
+
name: 'action.query.location.hide',
|
|
21740
|
+
version_live: { android: 0, iOS: 0 },
|
|
21741
|
+
have_permission: false
|
|
21742
|
+
},
|
|
21743
|
+
SHOW_TOAST: {
|
|
21744
|
+
name: 'action.show.toast',
|
|
21745
|
+
version_live: { android: 0, iOS: 0 },
|
|
21746
|
+
have_permission: false
|
|
21747
|
+
},
|
|
21748
|
+
OPEN_APP: {
|
|
21749
|
+
name: 'action.open.app',
|
|
21750
|
+
version_live: { android: 0, iOS: 0 },
|
|
21751
|
+
have_permission: false
|
|
21752
|
+
},
|
|
21753
|
+
HIDE_KEYBOARD: {
|
|
21754
|
+
name: 'action.hide.keyboard',
|
|
21755
|
+
version_live: { android: 0, iOS: 0 },
|
|
21756
|
+
have_permission: false
|
|
21757
|
+
},
|
|
21758
|
+
OPEN_PHONE: {
|
|
21759
|
+
name: 'action.open.phone',
|
|
21760
|
+
version_live: { android: 0, iOS: 0 },
|
|
21761
|
+
have_permission: false
|
|
21762
|
+
},
|
|
21763
|
+
OPEN_QR: {
|
|
21764
|
+
name: 'action.open.qr',
|
|
21765
|
+
version_live: { android: 0, iOS: 0 },
|
|
21766
|
+
have_permission: false
|
|
21767
|
+
},
|
|
21768
|
+
OPEN_SMS: {
|
|
21769
|
+
name: 'action.open.sms',
|
|
21770
|
+
version_live: { android: 0, iOS: 0 },
|
|
21771
|
+
have_permission: false
|
|
21772
|
+
},
|
|
21773
|
+
VIEW_MYQR: {
|
|
21774
|
+
name: 'action.view.myqr',
|
|
21775
|
+
version_live: { android: 0, iOS: 0 },
|
|
21776
|
+
have_permission: false
|
|
21777
|
+
},
|
|
21778
|
+
KEEP_SCREEN: {
|
|
21779
|
+
name: 'action.keep.screen',
|
|
21780
|
+
version_live: { android: 0, iOS: 0 },
|
|
21781
|
+
have_permission: false
|
|
21782
|
+
},
|
|
21783
|
+
CHANGE_AUTOROTATE: {
|
|
21784
|
+
name: 'action.change.autorotate',
|
|
21785
|
+
version_live: { android: 0, iOS: 0 },
|
|
21786
|
+
have_permission: false,
|
|
21787
|
+
skip_jump: true
|
|
21788
|
+
},
|
|
21789
|
+
CHECK_APP_INSTALLED: {
|
|
21790
|
+
name: 'action.check.app.installed',
|
|
21791
|
+
version_live: { android: 0, iOS: 0 },
|
|
21792
|
+
have_permission: false
|
|
21793
|
+
},
|
|
21794
|
+
QUERY_SHOW: {
|
|
21795
|
+
name: 'action.query.show',
|
|
21796
|
+
version_live: { android: 0, iOS: 0 },
|
|
21797
|
+
have_permission: false
|
|
21798
|
+
},
|
|
21799
|
+
QUERY_HIDE: {
|
|
21800
|
+
name: 'action.query.hide',
|
|
21801
|
+
version_live: { android: 0, iOS: 0 },
|
|
21802
|
+
have_permission: false
|
|
21803
|
+
},
|
|
21804
|
+
OPEN_INAPPRW: {
|
|
21805
|
+
name: 'action.open.inapprw',
|
|
21806
|
+
version_live: { android: 0, iOS: 0 },
|
|
21807
|
+
have_permission: false
|
|
21808
|
+
},
|
|
21809
|
+
ZALORUN_GETTRACKINGSTATUS: {
|
|
21810
|
+
name: 'action.zalorun.getTrackingStatus',
|
|
21811
|
+
version_live: { android: 0, iOS: 0 },
|
|
21812
|
+
have_permission: false
|
|
21813
|
+
},
|
|
21814
|
+
ZALORUN_SETTRACKINGSTATUS: {
|
|
21815
|
+
name: 'action.zalorun.setTrackingStatus',
|
|
21816
|
+
version_live: { android: 0, iOS: 0 },
|
|
21817
|
+
have_permission: false
|
|
21818
|
+
},
|
|
21819
|
+
ZALORUN_GETDAYSTEP: {
|
|
21820
|
+
name: 'action.zalorun.getDayStep',
|
|
21821
|
+
version_live: { android: 0, iOS: 0 },
|
|
21822
|
+
have_permission: false
|
|
21823
|
+
},
|
|
21824
|
+
ZALORUN_FORCESUBMITDATA: {
|
|
21825
|
+
name: 'action.zalorun.forceSubmitData',
|
|
21826
|
+
version_live: { android: 0, iOS: 0 },
|
|
21827
|
+
have_permission: false
|
|
21828
|
+
},
|
|
21829
|
+
ZALORUN_SETWEIGHT: {
|
|
21830
|
+
name: 'action.zalorun.setWeight',
|
|
21831
|
+
version_live: { android: 0, iOS: 0 },
|
|
21832
|
+
have_permission: false
|
|
21833
|
+
},
|
|
21834
|
+
OPEN_PROFILE_EXT: {
|
|
21835
|
+
name: 'action.open.profile.ext',
|
|
21836
|
+
version_live: { android: 0, iOS: 0 },
|
|
21837
|
+
have_permission: false
|
|
21838
|
+
},
|
|
21839
|
+
DOWNLOAD_CATE: {
|
|
21840
|
+
name: 'action.download.cate',
|
|
21841
|
+
version_live: { android: 0, iOS: 0 },
|
|
21842
|
+
have_permission: false
|
|
21843
|
+
},
|
|
21844
|
+
JUMP_LOGIN: {
|
|
21845
|
+
name: 'action.jump.login',
|
|
21846
|
+
version_live: { android: 0, iOS: 0 },
|
|
21847
|
+
have_permission: false,
|
|
21848
|
+
skip_jump: true,
|
|
21849
|
+
white_list: true
|
|
21850
|
+
},
|
|
21851
|
+
OPEN_ADTIMA_ADS_INTERSTITIAL: {
|
|
21852
|
+
name: 'action.open.adtima.ads.interstitial',
|
|
21853
|
+
version_live: { android: 0, iOS: 0 },
|
|
21854
|
+
have_permission: false
|
|
21855
|
+
},
|
|
21856
|
+
OPEN_ADTIMA_ADS: {
|
|
21857
|
+
name: 'action.open.adtima.ads',
|
|
21858
|
+
version_live: { android: 0, iOS: 0 },
|
|
21859
|
+
have_permission: false
|
|
21860
|
+
},
|
|
21861
|
+
GET_ADIDCLIENT: {
|
|
21862
|
+
name: 'action.get.adidclient',
|
|
21863
|
+
version_live: { android: 0, iOS: 0 },
|
|
21864
|
+
have_permission: false
|
|
21865
|
+
},
|
|
21866
|
+
SCAN_IBEACON: {
|
|
21867
|
+
name: 'action.scan.ibeacon',
|
|
21868
|
+
version_live: { android: 0, iOS: 0 },
|
|
21869
|
+
have_permission: false
|
|
21870
|
+
},
|
|
21871
|
+
SAVE_IMAGE_GALLERY: {
|
|
21872
|
+
name: 'action.save.image.gallery',
|
|
21873
|
+
version_live: { android: 576, iOS: 408 },
|
|
21874
|
+
have_permission: false
|
|
21875
|
+
},
|
|
21876
|
+
OPEN_MP: {
|
|
21877
|
+
name: 'action.open.mp',
|
|
21878
|
+
version_live: { android: 576, iOS: 402 },
|
|
21879
|
+
have_permission: false
|
|
21880
|
+
},
|
|
21881
|
+
CHANGE_ACTIONBAR: {
|
|
21882
|
+
name: 'action.change.actionbar',
|
|
21883
|
+
version_live: { android: 0, iOS: 402 },
|
|
21884
|
+
have_permission: false,
|
|
21885
|
+
skip_jump: true
|
|
21886
|
+
},
|
|
21887
|
+
INTERACTIVE_VIBRATION: {
|
|
21888
|
+
name: 'action.interactive.vibration',
|
|
21889
|
+
version_live: { android: 0, iOS: 0 },
|
|
21890
|
+
have_permission: false
|
|
21891
|
+
},
|
|
21892
|
+
ZBROWSER_MPDS: {
|
|
21893
|
+
name: 'action.zbrowser.mpds',
|
|
21894
|
+
version_live: { android: 576, iOS: 402 },
|
|
21895
|
+
have_permission: false
|
|
21896
|
+
},
|
|
21897
|
+
WEBVIEW_SET_RESULT: {
|
|
21898
|
+
name: 'action.webview.set.result',
|
|
21899
|
+
version_live: { android: 589, iOS: 416 },
|
|
21900
|
+
have_permission: false
|
|
21901
|
+
},
|
|
21902
|
+
MP_GET_NUMBER: {
|
|
21903
|
+
name: 'action.mp.get.number',
|
|
21904
|
+
version_live: { android: 589, iOS: 416 },
|
|
21905
|
+
have_permission: false
|
|
21906
|
+
},
|
|
21907
|
+
MP_OPEN_PROFILE_PICKER: {
|
|
21908
|
+
name: 'action.mp.open.profile.picker',
|
|
21909
|
+
version_live: {
|
|
21910
|
+
android: 999,
|
|
21911
|
+
iOS: 999
|
|
21912
|
+
},
|
|
21913
|
+
have_permission: false
|
|
21914
|
+
},
|
|
21915
|
+
GET_SUPPORTED_ACTIONS: {
|
|
21916
|
+
name: 'action.get.supported.actions',
|
|
21917
|
+
version_live: { android: 0, iOS: 0 },
|
|
21918
|
+
have_permission: false,
|
|
21919
|
+
white_list: true
|
|
21920
|
+
}
|
|
21543
21921
|
};
|
|
21544
21922
|
const ACTION_HAVE_CALLBACK = [
|
|
21545
|
-
ACTION.GET_DOWNLOADED_STICKER,
|
|
21546
|
-
ACTION.REPORT_ABUSE,
|
|
21547
|
-
ACTION.FOLLOW_OA,
|
|
21548
|
-
ACTION.UNFOLLOW_OA,
|
|
21549
|
-
ACTION.OPEN_SHARESHEET,
|
|
21550
|
-
ACTION.CREATE_OPTIONS_MENU,
|
|
21551
|
-
ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,
|
|
21552
|
-
ACTION.WINDOW_CLOSE,
|
|
21553
|
-
ACTION.ZBROWSER_JSBRIDGE,
|
|
21554
|
-
ACTION.GET_LOCATION,
|
|
21555
|
-
ACTION.QUERY_LOCATION_HIDE,
|
|
21556
|
-
ACTION.SHOW_TOAST,
|
|
21557
|
-
ACTION.VIEW_MYQR,
|
|
21558
|
-
ACTION.KEEP_SCREEN,
|
|
21559
|
-
ACTION.ZALORUN_GETTRACKINGSTATUS,
|
|
21560
|
-
ACTION.ZALORUN_SETTRACKINGSTATUS,
|
|
21561
|
-
ACTION.ZALORUN_GETDAYSTEP,
|
|
21562
|
-
ACTION.ZALORUN_FORCESUBMITDATA,
|
|
21563
|
-
ACTION.ZALORUN_SETWEIGHT,
|
|
21564
|
-
ACTION.DOWNLOAD_CATE
|
|
21923
|
+
ACTION.GET_DOWNLOADED_STICKER.name,
|
|
21924
|
+
ACTION.REPORT_ABUSE.name,
|
|
21925
|
+
ACTION.FOLLOW_OA.name,
|
|
21926
|
+
ACTION.UNFOLLOW_OA.name,
|
|
21927
|
+
ACTION.OPEN_SHARESHEET.name,
|
|
21928
|
+
ACTION.CREATE_OPTIONS_MENU.name,
|
|
21929
|
+
ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,
|
|
21930
|
+
ACTION.WINDOW_CLOSE.name,
|
|
21931
|
+
ACTION.ZBROWSER_JSBRIDGE.name,
|
|
21932
|
+
ACTION.GET_LOCATION.name,
|
|
21933
|
+
ACTION.QUERY_LOCATION_HIDE.name,
|
|
21934
|
+
ACTION.SHOW_TOAST.name,
|
|
21935
|
+
ACTION.VIEW_MYQR.name,
|
|
21936
|
+
ACTION.KEEP_SCREEN.name,
|
|
21937
|
+
ACTION.ZALORUN_GETTRACKINGSTATUS.name,
|
|
21938
|
+
ACTION.ZALORUN_SETTRACKINGSTATUS.name,
|
|
21939
|
+
ACTION.ZALORUN_GETDAYSTEP.name,
|
|
21940
|
+
ACTION.ZALORUN_FORCESUBMITDATA.name,
|
|
21941
|
+
ACTION.ZALORUN_SETWEIGHT.name,
|
|
21942
|
+
ACTION.DOWNLOAD_CATE.name
|
|
21565
21943
|
];
|
|
21566
21944
|
const RESPONSE_CODE = {
|
|
21567
21945
|
BAD_REQUEST: -1400,
|
|
21946
|
+
INTERNAL_SERVER_ERROR: -1500,
|
|
21568
21947
|
UNAUTHORIZED: -1401,
|
|
21569
|
-
FORBIDDEN: -1403
|
|
21948
|
+
FORBIDDEN: -1403,
|
|
21949
|
+
CLIENT_NOT_SUPPORT: -1404
|
|
21570
21950
|
};
|
|
21571
21951
|
const MESSAGES = {
|
|
21572
21952
|
READ_MORE: 'Read more at: https://miniapp.zalo.me/docs/api',
|
|
@@ -21585,12 +21965,101 @@
|
|
|
21585
21965
|
iOS: 400,
|
|
21586
21966
|
wp: 0,
|
|
21587
21967
|
unknown: 0
|
|
21588
|
-
};
|
|
21968
|
+
};
|
|
21969
|
+
// List actions supported before support action action.get.supported.actions
|
|
21970
|
+
const ZALO_IOS_ACTIONS_SUPPORTED_BEFORE_VER_402 = [
|
|
21971
|
+
ACTION.GET_DOWNLOADED_STICKER.name,
|
|
21972
|
+
ACTION.OPEN_SHARE_STICKER.name,
|
|
21973
|
+
ACTION.OPEN_PROFILE.name,
|
|
21974
|
+
ACTION.OPEN_FEED_DETAIL.name,
|
|
21975
|
+
ACTION.OPEN_FRIEND_RADA.name,
|
|
21976
|
+
ACTION.OPEN_INAPP.name,
|
|
21977
|
+
ACTION.OPEN_OUTAPP.name,
|
|
21978
|
+
ACTION.OPEN_PAGE.name,
|
|
21979
|
+
ACTION.OPEN_PHOTODETAIL.name,
|
|
21980
|
+
ACTION.OPEN_GALARY.name,
|
|
21981
|
+
ACTION.OPEN_GAMECENTER.name,
|
|
21982
|
+
ACTION.OPEN_GAMENEWS.name,
|
|
21983
|
+
ACTION.OPEN_TAB_CONTACT.name,
|
|
21984
|
+
ACTION.OPEN_TAB_SOCIAL.name,
|
|
21985
|
+
ACTION.OPEN_FRIENDSUGGEST.name,
|
|
21986
|
+
ACTION.OPEN_GROUPLIST.name,
|
|
21987
|
+
ACTION.OPEN_NEARBY.name,
|
|
21988
|
+
ACTION.OPEN_ROOM.name,
|
|
21989
|
+
ACTION.OPEN_STICKERSTORE.name,
|
|
21990
|
+
ACTION.OPEN_CREATECHAT.name,
|
|
21991
|
+
ACTION.COPY_LINK_CATESTICKER.name,
|
|
21992
|
+
ACTION.REQUEST_BUY_STICKER.name,
|
|
21993
|
+
ACTION.OPEN_CHAT.name,
|
|
21994
|
+
ACTION.OPEN_TAB_CHAT.name,
|
|
21995
|
+
ACTION.OPEN_CHATGROUP.name,
|
|
21996
|
+
ACTION.OPEN_ADDFRIEND.name,
|
|
21997
|
+
ACTION.OPEN_TAB_MORE.name,
|
|
21998
|
+
ACTION.OPEN_POSTFEED.name,
|
|
21999
|
+
ACTION.OPEN_LOGINDEVICES.name,
|
|
22000
|
+
ACTION.OPEN_SENDSTICKER.name,
|
|
22001
|
+
ACTION.REPORT_ABUSE.name,
|
|
22002
|
+
ACTION.FOLLOW_OA.name,
|
|
22003
|
+
ACTION.UNFOLLOW_OA.name,
|
|
22004
|
+
ACTION.OPEN_GAMEDETAIL.name,
|
|
22005
|
+
ACTION.OPEN_SHARESHEET.name,
|
|
22006
|
+
ACTION.REQUEST_PERMISSION_CAMERA.name,
|
|
22007
|
+
ACTION.CHANGE_TITLE_HEADER.name,
|
|
22008
|
+
ACTION.WEBVIEW_CLEARCACHE.name,
|
|
22009
|
+
ACTION.WEBVIEW_CONFIRMCACHE.name,
|
|
22010
|
+
ACTION.WEBVIEW_ISVISIBLE.name,
|
|
22011
|
+
ACTION.WEBVIEW_NETWORKTYPE.name,
|
|
22012
|
+
ACTION.CHANGE_BUTTON_HEADER.name,
|
|
22013
|
+
ACTION.CREATE_OPTIONS_MENU.name,
|
|
22014
|
+
ACTION.CREATE_SHORTCUT.name,
|
|
22015
|
+
ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,
|
|
22016
|
+
ACTION.WINDOW_CLOSE.name,
|
|
22017
|
+
ACTION.WEBVIEW_CHECKRESERROR.name,
|
|
22018
|
+
ACTION.IAP_REQUESTPAYMENT.name,
|
|
22019
|
+
ACTION.ZBROWSER_GETSTATS.name,
|
|
22020
|
+
ACTION.ZBROWSER_JSBRIDGE.name,
|
|
22021
|
+
ACTION.PROMPT_AUTHENTICATION.name,
|
|
22022
|
+
ACTION.CHANGE_ACTIONBAR_COLOR.name,
|
|
22023
|
+
ACTION.PROMPT_AUTHENTICATION_CHECK_STATE.name,
|
|
22024
|
+
ACTION.OPEN_APPSTORE.name,
|
|
22025
|
+
ACTION.GET_LOCATION.name,
|
|
22026
|
+
ACTION.QUERY_LOCATION_HIDE.name,
|
|
22027
|
+
ACTION.SHOW_TOAST.name,
|
|
22028
|
+
ACTION.OPEN_APP.name,
|
|
22029
|
+
ACTION.HIDE_KEYBOARD.name,
|
|
22030
|
+
ACTION.OPEN_PHONE.name,
|
|
22031
|
+
ACTION.OPEN_QR.name,
|
|
22032
|
+
ACTION.OPEN_SMS.name,
|
|
22033
|
+
ACTION.VIEW_MYQR.name,
|
|
22034
|
+
ACTION.KEEP_SCREEN.name,
|
|
22035
|
+
ACTION.CHANGE_AUTOROTATE.name,
|
|
22036
|
+
ACTION.CHECK_APP_INSTALLED.name,
|
|
22037
|
+
ACTION.QUERY_SHOW.name,
|
|
22038
|
+
ACTION.QUERY_HIDE.name,
|
|
22039
|
+
ACTION.OPEN_INAPPRW.name,
|
|
22040
|
+
ACTION.ZALORUN_GETTRACKINGSTATUS.name,
|
|
22041
|
+
ACTION.ZALORUN_SETTRACKINGSTATUS.name,
|
|
22042
|
+
ACTION.ZALORUN_GETDAYSTEP.name,
|
|
22043
|
+
ACTION.ZALORUN_FORCESUBMITDATA.name,
|
|
22044
|
+
ACTION.ZALORUN_SETWEIGHT.name,
|
|
22045
|
+
ACTION.OPEN_PROFILE_EXT.name,
|
|
22046
|
+
ACTION.DOWNLOAD_CATE.name,
|
|
22047
|
+
ACTION.JUMP_LOGIN.name,
|
|
22048
|
+
ACTION.OPEN_ADTIMA_ADS_INTERSTITIAL.name,
|
|
22049
|
+
ACTION.OPEN_ADTIMA_ADS.name,
|
|
22050
|
+
ACTION.GET_ADIDCLIENT.name,
|
|
22051
|
+
ACTION.SCAN_IBEACON.name,
|
|
22052
|
+
ACTION.SAVE_IMAGE_GALLERY.name,
|
|
22053
|
+
ACTION.OPEN_MP.name,
|
|
22054
|
+
ACTION.CHANGE_ACTIONBAR.name,
|
|
22055
|
+
ACTION.INTERACTIVE_VIBRATION.name,
|
|
22056
|
+
ACTION.ZBROWSER_MPDS.name
|
|
22057
|
+
];
|
|
21589
22058
|
|
|
21590
22059
|
const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
|
|
21591
22060
|
const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
|
|
21592
22061
|
const REGEXP_SPACES = new RegExp('\\s', 'g');
|
|
21593
|
-
const debug$2 = src(
|
|
22062
|
+
const debug$2 = src('zmp:utils:common');
|
|
21594
22063
|
/**
|
|
21595
22064
|
* Checks if a url is valid
|
|
21596
22065
|
* @param {string} string URL
|
|
@@ -21690,10 +22159,11 @@
|
|
|
21690
22159
|
const isArrayType = lowerCaseType === 'array' ||
|
|
21691
22160
|
lowerCaseType === 'array<number>' ||
|
|
21692
22161
|
lowerCaseType === 'array<string>';
|
|
21693
|
-
if ((
|
|
21694
|
-
(
|
|
21695
|
-
(lowerCaseType === 'array
|
|
21696
|
-
|
|
22162
|
+
if ((lowerCaseType === 'url' && isValidUrl(argument)) ||
|
|
22163
|
+
(isArrayType &&
|
|
22164
|
+
((lowerCaseType === 'array' && Array.isArray(argument)) ||
|
|
22165
|
+
(lowerCaseType === 'array<number>' && isArrayNumber(argument)) ||
|
|
22166
|
+
(lowerCaseType === 'array<string>' && isArrayString(argument)))) ||
|
|
21697
22167
|
(!Array.isArray(argument) && typeof argument === type)) {
|
|
21698
22168
|
return true;
|
|
21699
22169
|
}
|
|
@@ -21810,7 +22280,7 @@
|
|
|
21810
22280
|
return null;
|
|
21811
22281
|
}
|
|
21812
22282
|
catch (error) {
|
|
21813
|
-
debug$2(error);
|
|
22283
|
+
debug$2('parse json error:', error);
|
|
21814
22284
|
return data;
|
|
21815
22285
|
}
|
|
21816
22286
|
};
|
|
@@ -35665,7 +36135,8 @@
|
|
|
35665
36135
|
COOKIE_NAME: {
|
|
35666
36136
|
ZOAUTH: `h5.zdn.vn_zoauth`,
|
|
35667
36137
|
ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
|
|
35668
|
-
JS_TOKEN: `h5.zdn.vn_zlink3rd
|
|
36138
|
+
JS_TOKEN: `h5.zdn.vn_zlink3rd`,
|
|
36139
|
+
ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
|
|
35669
36140
|
},
|
|
35670
36141
|
APIS: {
|
|
35671
36142
|
GET_USER_INFO: 'https://graph.zalo.me/v2.0/me'
|
|
@@ -36115,6 +36586,7 @@
|
|
|
36115
36586
|
this.message = MESSAGES.NOT_PERMISSION;
|
|
36116
36587
|
break;
|
|
36117
36588
|
case NativeCode.client_not_support:
|
|
36589
|
+
this.code = RESPONSE_CODE.CLIENT_NOT_SUPPORT;
|
|
36118
36590
|
this.message = MESSAGES.CLIENT_NOT_SUPPORT;
|
|
36119
36591
|
break;
|
|
36120
36592
|
case NativeCode.decode_failed:
|
|
@@ -36226,33 +36698,31 @@
|
|
|
36226
36698
|
const fn = (cb) => __awaiter(this, void 0, void 0, function* () {
|
|
36227
36699
|
try {
|
|
36228
36700
|
const error = new NativeError(cb.error_code, `${cb.action}: ${cb.error_message}`);
|
|
36229
|
-
if (
|
|
36230
|
-
|
|
36231
|
-
|
|
36232
|
-
|
|
36701
|
+
if (option === null || option === void 0 ? void 0 : option.callback) {
|
|
36702
|
+
const res = yield option.callback(cb, error);
|
|
36703
|
+
return resolve(res);
|
|
36704
|
+
}
|
|
36705
|
+
else {
|
|
36706
|
+
if (cb && cb.error_code >= 0) {
|
|
36707
|
+
resolve(cb.data || {});
|
|
36233
36708
|
}
|
|
36234
|
-
else {
|
|
36235
|
-
|
|
36236
|
-
|
|
36237
|
-
|
|
36238
|
-
|
|
36239
|
-
|
|
36240
|
-
|
|
36241
|
-
|
|
36242
|
-
|
|
36243
|
-
data: data,
|
|
36244
|
-
rs: cb
|
|
36245
|
-
}
|
|
36246
|
-
});
|
|
36247
|
-
}
|
|
36248
|
-
catch (error) { }
|
|
36249
|
-
reject(error);
|
|
36709
|
+
else if (cb && cb.error_code < 0) {
|
|
36710
|
+
try {
|
|
36711
|
+
window.zmpSentry &&
|
|
36712
|
+
window.zmpSentry.captureMessage(`${action}: call native fail`, {
|
|
36713
|
+
extra: {
|
|
36714
|
+
data: data,
|
|
36715
|
+
rs: cb
|
|
36716
|
+
}
|
|
36717
|
+
});
|
|
36250
36718
|
}
|
|
36719
|
+
catch (error) { }
|
|
36720
|
+
return reject(error);
|
|
36251
36721
|
}
|
|
36252
36722
|
}
|
|
36253
36723
|
}
|
|
36254
36724
|
catch (error) {
|
|
36255
|
-
reject(error);
|
|
36725
|
+
return reject(error);
|
|
36256
36726
|
}
|
|
36257
36727
|
// if (cb && cb.error_code >= 0 && cb.action == action) {
|
|
36258
36728
|
// resolve(cb.data || {});
|
|
@@ -36288,7 +36758,24 @@
|
|
|
36288
36758
|
// }
|
|
36289
36759
|
// }
|
|
36290
36760
|
});
|
|
36291
|
-
|
|
36761
|
+
const key = action
|
|
36762
|
+
.slice(7, action.length)
|
|
36763
|
+
.replace(/\./gi, '_')
|
|
36764
|
+
.toUpperCase();
|
|
36765
|
+
const isAndroid = checkPlatform().isAndroid;
|
|
36766
|
+
const zaloVersion = isAndroid
|
|
36767
|
+
? getZaloVersion() % 100000
|
|
36768
|
+
: getZaloVersion();
|
|
36769
|
+
const isSupportAction = isAndroid
|
|
36770
|
+
? zaloVersion >= ACTION[key].version_live.android
|
|
36771
|
+
: zaloVersion >= ACTION[key].version_live.iOS;
|
|
36772
|
+
if (!isSupportAction) {
|
|
36773
|
+
const error = new NativeError(-5, `${action}: Client isn't support this action`);
|
|
36774
|
+
return reject(error);
|
|
36775
|
+
}
|
|
36776
|
+
else {
|
|
36777
|
+
__classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
|
|
36778
|
+
}
|
|
36292
36779
|
});
|
|
36293
36780
|
}
|
|
36294
36781
|
}
|
|
@@ -36296,14 +36783,17 @@
|
|
|
36296
36783
|
|
|
36297
36784
|
const apiResponse = {
|
|
36298
36785
|
error: {
|
|
36299
|
-
|
|
36300
|
-
|
|
36786
|
+
badRequest: (message) => new CommonError(RESPONSE_CODE.BAD_REQUEST, message),
|
|
36787
|
+
loginFailed: () => new CommonError(RESPONSE_CODE.BAD_REQUEST, MESSAGES.LOGIN_FAILED),
|
|
36788
|
+
loginRequired: () => new CommonError(RESPONSE_CODE.UNAUTHORIZED, MESSAGES.LOGIN_REQUIRED),
|
|
36301
36789
|
missingParam: (params) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Missing required argument: ${params}`),
|
|
36302
|
-
wrongTypeParam: (arg, expected, got) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Wrong type of parameter '${arg}'. Expected ${expected}, but got ${got}`)
|
|
36790
|
+
wrongTypeParam: (arg, expected, got) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Wrong type of parameter '${arg}'. Expected ${expected}, but got ${got}`),
|
|
36791
|
+
cannotGetShareInfo: () => new CommonError(RESPONSE_CODE.INTERNAL_SERVER_ERROR, `Can not get app info to share`),
|
|
36792
|
+
lengthInvalid: (arg) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `${arg} length is invalid.`)
|
|
36303
36793
|
}
|
|
36304
36794
|
};
|
|
36305
36795
|
|
|
36306
|
-
var version = "
|
|
36796
|
+
var version = "2.15.0-rc.1";
|
|
36307
36797
|
|
|
36308
36798
|
class Basics {
|
|
36309
36799
|
/**
|
|
@@ -36408,7 +36898,7 @@
|
|
|
36408
36898
|
*/
|
|
36409
36899
|
static setNavigationBarTitle(object) {
|
|
36410
36900
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36411
|
-
yield this.callNative(ACTION.CHANGE_TITLE_HEADER, {
|
|
36901
|
+
yield this.callNative(ACTION.CHANGE_TITLE_HEADER.name, {
|
|
36412
36902
|
title: object.title
|
|
36413
36903
|
}, {
|
|
36414
36904
|
haveTimeout: false
|
|
@@ -36450,7 +36940,7 @@
|
|
|
36450
36940
|
// if (!_.isEmpty(object.textColor)) {
|
|
36451
36941
|
// dataConfig.textColor = object.textColor;
|
|
36452
36942
|
// }
|
|
36453
|
-
// await this.callNative(ACTION.CHANGE_ACTIONBAR, {
|
|
36943
|
+
// await this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
|
|
36454
36944
|
// actionbarType: 5,
|
|
36455
36945
|
// dataConfig: dataConfig,
|
|
36456
36946
|
// homeConfig: {
|
|
@@ -36470,7 +36960,7 @@
|
|
|
36470
36960
|
// if (!_.isEmpty(object.textColor)) {
|
|
36471
36961
|
// dataConfig.textColor = object.textColor;
|
|
36472
36962
|
// }
|
|
36473
|
-
// await this.callNative(ACTION.CHANGE_ACTIONBAR_COLOR, dataConfig);
|
|
36963
|
+
// await this.callNative(ACTION.CHANGE_ACTIONBAR_COLOR.name, dataConfig);
|
|
36474
36964
|
// }
|
|
36475
36965
|
const dataConfig = {};
|
|
36476
36966
|
if (!lodash.isEmpty(object.color)) {
|
|
@@ -36479,7 +36969,7 @@
|
|
|
36479
36969
|
if (!lodash.isEmpty(object.textColor)) {
|
|
36480
36970
|
dataConfig.textColor = object.textColor;
|
|
36481
36971
|
}
|
|
36482
|
-
yield this.callNative(ACTION.CHANGE_ACTIONBAR, {
|
|
36972
|
+
yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
|
|
36483
36973
|
actionbarType: 5,
|
|
36484
36974
|
dataConfig: dataConfig,
|
|
36485
36975
|
homeConfig: {
|
|
@@ -36499,7 +36989,7 @@
|
|
|
36499
36989
|
if (!lodash.isEmpty(object.textColor)) {
|
|
36500
36990
|
dataConfig.textColor = object.textColor;
|
|
36501
36991
|
}
|
|
36502
|
-
yield this.callNative(ACTION.CHANGE_ACTIONBAR, {
|
|
36992
|
+
yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
|
|
36503
36993
|
actionbarType: 6,
|
|
36504
36994
|
dataConfig: dataConfig
|
|
36505
36995
|
}, {
|
|
@@ -36596,7 +37086,7 @@
|
|
|
36596
37086
|
};
|
|
36597
37087
|
break;
|
|
36598
37088
|
}
|
|
36599
|
-
yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE, Object.assign({}, reqData), {
|
|
37089
|
+
yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name, Object.assign({}, reqData), {
|
|
36600
37090
|
haveTimeout: false
|
|
36601
37091
|
});
|
|
36602
37092
|
});
|
|
@@ -36638,7 +37128,7 @@
|
|
|
36638
37128
|
*/
|
|
36639
37129
|
static setNavigationBarRightButton(object) {
|
|
36640
37130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36641
|
-
yield this.callNative(ACTION.CREATE_OPTIONS_MENU, {
|
|
37131
|
+
yield this.callNative(ACTION.CREATE_OPTIONS_MENU.name, {
|
|
36642
37132
|
supportToolBar: object.supportToolBar,
|
|
36643
37133
|
reset: object.reset,
|
|
36644
37134
|
menuListItems: object.menuListItems,
|
|
@@ -36674,7 +37164,7 @@
|
|
|
36674
37164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36675
37165
|
if (lodash.isString(object.backgroundColor) &&
|
|
36676
37166
|
object.backgroundColor.length > 0) {
|
|
36677
|
-
yield this.callNative(ACTION.CHANGE_ACTIONBAR, {
|
|
37167
|
+
yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
|
|
36678
37168
|
actionbarType: this.isShowNavBar ? 5 : 6,
|
|
36679
37169
|
dataConfig: {
|
|
36680
37170
|
backgroundColor: object.backgroundColor,
|
|
@@ -36786,7 +37276,7 @@
|
|
|
36786
37276
|
*/
|
|
36787
37277
|
static setDeviceOrientation(object) {
|
|
36788
37278
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36789
|
-
yield this.callNative(ACTION.CHANGE_AUTOROTATE, {
|
|
37279
|
+
yield this.callNative(ACTION.CHANGE_AUTOROTATE.name, {
|
|
36790
37280
|
autoRotate: OrientationType[object.rotate]
|
|
36791
37281
|
});
|
|
36792
37282
|
});
|
|
@@ -36810,7 +37300,7 @@
|
|
|
36810
37300
|
*/
|
|
36811
37301
|
static getNetworkType(object) {
|
|
36812
37302
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36813
|
-
const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE, {
|
|
37303
|
+
const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE.name, {
|
|
36814
37304
|
url: window.location.href,
|
|
36815
37305
|
featureId: ''
|
|
36816
37306
|
}).then((data) => {
|
|
@@ -36923,7 +37413,7 @@
|
|
|
36923
37413
|
items: Array.isArray(object === null || object === void 0 ? void 0 : object.items) ? object === null || object === void 0 ? void 0 : object.items : []
|
|
36924
37414
|
}
|
|
36925
37415
|
};
|
|
36926
|
-
yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
|
|
37416
|
+
yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
|
|
36927
37417
|
return true;
|
|
36928
37418
|
});
|
|
36929
37419
|
}
|
|
@@ -36942,7 +37432,7 @@
|
|
|
36942
37432
|
const data = {
|
|
36943
37433
|
subaction: 2
|
|
36944
37434
|
};
|
|
36945
|
-
yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
|
|
37435
|
+
yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
|
|
36946
37436
|
return true;
|
|
36947
37437
|
});
|
|
36948
37438
|
}
|
|
@@ -36963,7 +37453,7 @@
|
|
|
36963
37453
|
const data = {
|
|
36964
37454
|
subaction: 1
|
|
36965
37455
|
};
|
|
36966
|
-
const resData = yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data), {
|
|
37456
|
+
const resData = yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data), {
|
|
36967
37457
|
isMultiCallback: true
|
|
36968
37458
|
}).then((resData) => {
|
|
36969
37459
|
const res = {
|
|
@@ -37185,7 +37675,7 @@
|
|
|
37185
37675
|
*/
|
|
37186
37676
|
static scanQRCode(object) {
|
|
37187
37677
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37188
|
-
return yield this.callNative(ACTION.OPEN_QR, {
|
|
37678
|
+
return yield this.callNative(ACTION.OPEN_QR.name, {
|
|
37189
37679
|
skipOpenLink: true
|
|
37190
37680
|
});
|
|
37191
37681
|
});
|
|
@@ -37199,7 +37689,7 @@
|
|
|
37199
37689
|
*/
|
|
37200
37690
|
static showToast(object) {
|
|
37201
37691
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37202
|
-
yield this.callNative(ACTION.SHOW_TOAST, {
|
|
37692
|
+
yield this.callNative(ACTION.SHOW_TOAST.name, {
|
|
37203
37693
|
toast: object.message
|
|
37204
37694
|
});
|
|
37205
37695
|
});
|
|
@@ -37213,7 +37703,7 @@
|
|
|
37213
37703
|
*/
|
|
37214
37704
|
static hideKeyboard(object) {
|
|
37215
37705
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37216
|
-
yield this.callNative(ACTION.HIDE_KEYBOARD, {});
|
|
37706
|
+
yield this.callNative(ACTION.HIDE_KEYBOARD.name, {});
|
|
37217
37707
|
});
|
|
37218
37708
|
}
|
|
37219
37709
|
/**
|
|
@@ -37225,7 +37715,7 @@
|
|
|
37225
37715
|
*/
|
|
37226
37716
|
static openPhone(object) {
|
|
37227
37717
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37228
|
-
yield this.callNative(ACTION.OPEN_PHONE, {
|
|
37718
|
+
yield this.callNative(ACTION.OPEN_PHONE.name, {
|
|
37229
37719
|
phoneNum: object.phoneNumber,
|
|
37230
37720
|
phoneCode: object.phoneNumber
|
|
37231
37721
|
});
|
|
@@ -37240,7 +37730,7 @@
|
|
|
37240
37730
|
*/
|
|
37241
37731
|
static openSMS(object) {
|
|
37242
37732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37243
|
-
yield this.callNative(ACTION.OPEN_SMS, {
|
|
37733
|
+
yield this.callNative(ACTION.OPEN_SMS.name, {
|
|
37244
37734
|
content: object.content,
|
|
37245
37735
|
phoneCode: object.phoneNumber
|
|
37246
37736
|
});
|
|
@@ -37255,7 +37745,7 @@
|
|
|
37255
37745
|
*/
|
|
37256
37746
|
static keepScreen(object) {
|
|
37257
37747
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37258
|
-
return yield this.callNative(ACTION.KEEP_SCREEN, {
|
|
37748
|
+
return yield this.callNative(ACTION.KEEP_SCREEN.name, {
|
|
37259
37749
|
data: {
|
|
37260
37750
|
keep_screen_on: object.keepScreenOn ? 1 : 0
|
|
37261
37751
|
}
|
|
@@ -37271,7 +37761,7 @@
|
|
|
37271
37761
|
*/
|
|
37272
37762
|
static openBioAuthentication(object) {
|
|
37273
37763
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37274
|
-
return yield this.callNative(ACTION.PROMPT_AUTHENTICATION, {
|
|
37764
|
+
return yield this.callNative(ACTION.PROMPT_AUTHENTICATION.name, {
|
|
37275
37765
|
secret_data: object.secretData,
|
|
37276
37766
|
app_id: this.getZAppId(),
|
|
37277
37767
|
ui: {
|
|
@@ -37310,7 +37800,7 @@
|
|
|
37310
37800
|
*/
|
|
37311
37801
|
static checkStateBioAuthentication(object) {
|
|
37312
37802
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37313
|
-
return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE, {}).then((data) => {
|
|
37803
|
+
return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE.name, {}).then((data) => {
|
|
37314
37804
|
return {
|
|
37315
37805
|
bioState: data === null || data === void 0 ? void 0 : data.bio_state
|
|
37316
37806
|
};
|
|
@@ -37326,7 +37816,7 @@
|
|
|
37326
37816
|
*/
|
|
37327
37817
|
static vibrate(object) {
|
|
37328
37818
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37329
|
-
return yield this.callNative(ACTION.INTERACTIVE_VIBRATION, {
|
|
37819
|
+
return yield this.callNative(ACTION.INTERACTIVE_VIBRATION.name, {
|
|
37330
37820
|
type: VibrateType[object.type],
|
|
37331
37821
|
vibrate_time: object.milliseconds
|
|
37332
37822
|
});
|
|
@@ -37467,7 +37957,7 @@
|
|
|
37467
37957
|
}
|
|
37468
37958
|
get(keys) {
|
|
37469
37959
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37470
|
-
return yield this.callNative(ACTION.ZBROWSER_MPDS, {
|
|
37960
|
+
return yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
|
|
37471
37961
|
mpds_action: 'mpds.get',
|
|
37472
37962
|
mpds_data: {
|
|
37473
37963
|
keys
|
|
@@ -37486,7 +37976,7 @@
|
|
|
37486
37976
|
}
|
|
37487
37977
|
set(data) {
|
|
37488
37978
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37489
|
-
const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
|
|
37979
|
+
const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
|
|
37490
37980
|
mpds_action: 'mpds.set',
|
|
37491
37981
|
mpds_data: {
|
|
37492
37982
|
map: data
|
|
@@ -37506,7 +37996,7 @@
|
|
|
37506
37996
|
}
|
|
37507
37997
|
getInfo() {
|
|
37508
37998
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37509
|
-
const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS, {
|
|
37999
|
+
const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
|
|
37510
38000
|
mpds_action: 'mpds.get.size',
|
|
37511
38001
|
mpds_data: {},
|
|
37512
38002
|
appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
|
|
@@ -37527,7 +38017,7 @@
|
|
|
37527
38017
|
}
|
|
37528
38018
|
remove(keys) {
|
|
37529
38019
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37530
|
-
const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
|
|
38020
|
+
const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
|
|
37531
38021
|
mpds_action: 'mpds.remove.key',
|
|
37532
38022
|
mpds_data: {
|
|
37533
38023
|
keys: keys
|
|
@@ -37547,7 +38037,7 @@
|
|
|
37547
38037
|
}
|
|
37548
38038
|
clear() {
|
|
37549
38039
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37550
|
-
yield this.callNative(ACTION.ZBROWSER_MPDS, {
|
|
38040
|
+
yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
|
|
37551
38041
|
mpds_action: 'mpds.clear.appData',
|
|
37552
38042
|
mpds_data: {},
|
|
37553
38043
|
appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
|
|
@@ -37810,7 +38300,7 @@
|
|
|
37810
38300
|
*/
|
|
37811
38301
|
static getPhoneNumber(object) {
|
|
37812
38302
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37813
|
-
return yield this.callNative(ACTION.MP_GET_NUMBER, {}, {
|
|
38303
|
+
return yield this.callNative(ACTION.MP_GET_NUMBER.name, {}, {
|
|
37814
38304
|
isMultiCallback: true,
|
|
37815
38305
|
callback: (nativeData, error) => {
|
|
37816
38306
|
if (nativeData.error_code === 0) {
|
|
@@ -37839,7 +38329,7 @@
|
|
|
37839
38329
|
*/
|
|
37840
38330
|
static closeApp(object) {
|
|
37841
38331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37842
|
-
yield this.callNative(ACTION.WINDOW_CLOSE, {});
|
|
38332
|
+
yield this.callNative(ACTION.WINDOW_CLOSE.name, {});
|
|
37843
38333
|
});
|
|
37844
38334
|
}
|
|
37845
38335
|
/**
|
|
@@ -37859,7 +38349,7 @@
|
|
|
37859
38349
|
return [key, value].join('=');
|
|
37860
38350
|
})
|
|
37861
38351
|
.join('&');
|
|
37862
|
-
yield this.callNative(ACTION.OPEN_MP, {
|
|
38352
|
+
yield this.callNative(ACTION.OPEN_MP.name, {
|
|
37863
38353
|
mpUrl: `${CONT.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
|
|
37864
38354
|
mpInfo: {
|
|
37865
38355
|
appId: appId
|
|
@@ -37877,7 +38367,7 @@
|
|
|
37877
38367
|
*/
|
|
37878
38368
|
static openWebview(object) {
|
|
37879
38369
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37880
|
-
yield this.callNative(ACTION.OPEN_INAPP, {
|
|
38370
|
+
yield this.callNative(ACTION.OPEN_INAPP.name, {
|
|
37881
38371
|
url: object.url
|
|
37882
38372
|
});
|
|
37883
38373
|
});
|
|
@@ -37902,7 +38392,7 @@
|
|
|
37902
38392
|
*/
|
|
37903
38393
|
static getLocation(object) {
|
|
37904
38394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37905
|
-
return yield this.callNative(ACTION.GET_LOCATION, {
|
|
38395
|
+
return yield this.callNative(ACTION.GET_LOCATION.name, {
|
|
37906
38396
|
silent_request: false,
|
|
37907
38397
|
permission_description: 'Cho phép Zalo truy cập vào vị trí của thiết bị này?'
|
|
37908
38398
|
}, {
|
|
@@ -37940,7 +38430,7 @@
|
|
|
37940
38430
|
*/
|
|
37941
38431
|
static sendLocation(object) {
|
|
37942
38432
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37943
|
-
yield this.callNative(ACTION.QUERY_LOCATION_HIDE, {
|
|
38433
|
+
yield this.callNative(ACTION.QUERY_LOCATION_HIDE.name, {
|
|
37944
38434
|
title: object.title,
|
|
37945
38435
|
touserid: object.toUserId,
|
|
37946
38436
|
zapp: this.getZAppId()
|
|
@@ -37960,7 +38450,7 @@
|
|
|
37960
38450
|
*/
|
|
37961
38451
|
static requestCameraPermission(object) {
|
|
37962
38452
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37963
|
-
return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
|
|
38453
|
+
return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA.name, {}, {
|
|
37964
38454
|
callback: (nativeData, error) => {
|
|
37965
38455
|
if (nativeData.error_code === -2 || nativeData.error_code >= 0) {
|
|
37966
38456
|
return Promise.resolve({
|
|
@@ -37992,7 +38482,7 @@
|
|
|
37992
38482
|
else {
|
|
37993
38483
|
data = Object.assign(Object.assign({}, data), { imageUrl: object.imageUrl });
|
|
37994
38484
|
}
|
|
37995
|
-
return yield this.callNative(ACTION.
|
|
38485
|
+
return yield this.callNative(ACTION.SAVE_IMAGE_GALLERY.name, Object.assign({}, data));
|
|
37996
38486
|
});
|
|
37997
38487
|
}
|
|
37998
38488
|
}
|
|
@@ -38007,7 +38497,7 @@
|
|
|
38007
38497
|
*/
|
|
38008
38498
|
static viewOAQr(object) {
|
|
38009
38499
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38010
|
-
yield this.callNative(ACTION.VIEW_MYQR, {
|
|
38500
|
+
yield this.callNative(ACTION.VIEW_MYQR.name, {
|
|
38011
38501
|
dpn: object.displayName,
|
|
38012
38502
|
uid: object.id,
|
|
38013
38503
|
zapp: this.getZAppId()
|
|
@@ -38026,7 +38516,7 @@
|
|
|
38026
38516
|
*/
|
|
38027
38517
|
static openProfile(object) {
|
|
38028
38518
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38029
|
-
return yield this.callNative(ACTION.OPEN_PROFILE, {
|
|
38519
|
+
return yield this.callNative(ACTION.OPEN_PROFILE.name, {
|
|
38030
38520
|
uId: object.id,
|
|
38031
38521
|
type: ProfileType[object.type],
|
|
38032
38522
|
zapp: this.getZAppId(),
|
|
@@ -38044,7 +38534,7 @@
|
|
|
38044
38534
|
*/
|
|
38045
38535
|
static openChat(object) {
|
|
38046
38536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38047
|
-
return yield this.callNative(ACTION.OPEN_CHAT, {
|
|
38537
|
+
return yield this.callNative(ACTION.OPEN_CHAT.name, {
|
|
38048
38538
|
uId: object.id,
|
|
38049
38539
|
type: ChatType[object.type],
|
|
38050
38540
|
zapp: this.getZAppId(),
|
|
@@ -38085,7 +38575,7 @@
|
|
|
38085
38575
|
};
|
|
38086
38576
|
break;
|
|
38087
38577
|
}
|
|
38088
|
-
return yield this.callNative(ACTION.OPEN_POSTFEED, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
|
|
38578
|
+
return yield this.callNative(ACTION.OPEN_POSTFEED.name, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
|
|
38089
38579
|
return {
|
|
38090
38580
|
status: res.status,
|
|
38091
38581
|
shareType: res.share_type,
|
|
@@ -38104,7 +38594,7 @@
|
|
|
38104
38594
|
*/
|
|
38105
38595
|
static followOA(object) {
|
|
38106
38596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38107
|
-
yield this.callNative(ACTION.FOLLOW_OA, {
|
|
38597
|
+
yield this.callNative(ACTION.FOLLOW_OA.name, {
|
|
38108
38598
|
uid: object.id,
|
|
38109
38599
|
showDialogConfirm: true,
|
|
38110
38600
|
zapp: this.getZAppId()
|
|
@@ -38123,7 +38613,7 @@
|
|
|
38123
38613
|
*/
|
|
38124
38614
|
static unfollowOA(object) {
|
|
38125
38615
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38126
|
-
yield this.callNative(ACTION.UNFOLLOW_OA, {
|
|
38616
|
+
yield this.callNative(ACTION.UNFOLLOW_OA.name, {
|
|
38127
38617
|
uid: object.id,
|
|
38128
38618
|
zapp: this.getZAppId()
|
|
38129
38619
|
}, {
|
|
@@ -38175,8 +38665,51 @@
|
|
|
38175
38665
|
uid: object.data.id
|
|
38176
38666
|
};
|
|
38177
38667
|
break;
|
|
38668
|
+
case 'zmp':
|
|
38669
|
+
const currentUrl = new URL(location.href);
|
|
38670
|
+
const params = new URLSearchParams();
|
|
38671
|
+
const description = {
|
|
38672
|
+
vi: '',
|
|
38673
|
+
en: ''
|
|
38674
|
+
};
|
|
38675
|
+
if (lodash.isString(object.data.description)) {
|
|
38676
|
+
description.en = description.vi = object.data.description;
|
|
38677
|
+
}
|
|
38678
|
+
else if (lodash.isObject(object.data.description)) {
|
|
38679
|
+
description.en = object.data.description.en || '';
|
|
38680
|
+
description.vi = object.data.description.vi || '';
|
|
38681
|
+
}
|
|
38682
|
+
params.append('title', object.data.title);
|
|
38683
|
+
params.append('description', description.vi || description.en);
|
|
38684
|
+
params.append('thumbnail', object.data.thumbnail);
|
|
38685
|
+
params.append('url', `https://zalo.me/app/link${currentUrl.pathname}${currentUrl.search}`);
|
|
38686
|
+
const config = {
|
|
38687
|
+
headers: {
|
|
38688
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
38689
|
+
}
|
|
38690
|
+
};
|
|
38691
|
+
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, config);
|
|
38692
|
+
const resData = res.data;
|
|
38693
|
+
if (!resData || resData.err !== 0) {
|
|
38694
|
+
throw apiResponse.error.cannotGetShareInfo();
|
|
38695
|
+
}
|
|
38696
|
+
reqData = {
|
|
38697
|
+
data: {
|
|
38698
|
+
ZInstantAPIInfo: {
|
|
38699
|
+
url: `${resData.data.zinstantApi}`,
|
|
38700
|
+
zinstantdata_id: `templateId=11412&appId=${this.getAppId()}&shareId=${resData.data.shareId}`
|
|
38701
|
+
},
|
|
38702
|
+
previewMsgText: {
|
|
38703
|
+
msg: {
|
|
38704
|
+
en: description.en,
|
|
38705
|
+
vi: description.vi
|
|
38706
|
+
}
|
|
38707
|
+
},
|
|
38708
|
+
enableReactions: 1
|
|
38709
|
+
}
|
|
38710
|
+
};
|
|
38178
38711
|
}
|
|
38179
|
-
return yield this.callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
|
|
38712
|
+
return yield this.callNative(ACTION.OPEN_SHARESHEET.name, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
|
|
38180
38713
|
haveTimeout: false
|
|
38181
38714
|
}).then((res) => {
|
|
38182
38715
|
return {
|
|
@@ -38197,13 +38730,72 @@
|
|
|
38197
38730
|
*/
|
|
38198
38731
|
static createShortcut(object) {
|
|
38199
38732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38200
|
-
yield this.callNative(ACTION.CREATE_SHORTCUT, {
|
|
38733
|
+
yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
|
|
38201
38734
|
url: `${CONT.MINI_APP_LINK}/${this.getAppId()}/`,
|
|
38202
38735
|
title: document.title,
|
|
38203
38736
|
iconUrl: `https:${getMetaValue('og:image:url')}`
|
|
38204
38737
|
});
|
|
38205
38738
|
});
|
|
38206
38739
|
}
|
|
38740
|
+
/**
|
|
38741
|
+
* Cho phép ứng dụng mở giao diện chọn user và get về list noise id
|
|
38742
|
+
*
|
|
38743
|
+
* @async
|
|
38744
|
+
* @function openProfilePicker
|
|
38745
|
+
* @category Zalo
|
|
38746
|
+
*
|
|
38747
|
+
*/
|
|
38748
|
+
static openProfilePicker(object) {
|
|
38749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38750
|
+
return yield this.callNative(ACTION.MP_OPEN_PROFILE_PICKER.name, {
|
|
38751
|
+
maxProfile: object === null || object === void 0 ? void 0 : object.maxProfile
|
|
38752
|
+
}, {
|
|
38753
|
+
isMultiCallback: true,
|
|
38754
|
+
callback: (nativeData, error) => {
|
|
38755
|
+
if (nativeData.error_code === 0) {
|
|
38756
|
+
const res = {
|
|
38757
|
+
userIDs: nativeData.data
|
|
38758
|
+
};
|
|
38759
|
+
return Promise.resolve(res);
|
|
38760
|
+
}
|
|
38761
|
+
return Promise.reject(error);
|
|
38762
|
+
}
|
|
38763
|
+
});
|
|
38764
|
+
});
|
|
38765
|
+
}
|
|
38766
|
+
/**
|
|
38767
|
+
* Lấy danh sách các action hỗ trợ trong phiên bản zalo ios hiện tại
|
|
38768
|
+
*
|
|
38769
|
+
* @async
|
|
38770
|
+
* @function getActionsSupported
|
|
38771
|
+
* @category Zalo
|
|
38772
|
+
*
|
|
38773
|
+
*/
|
|
38774
|
+
static getActionsSupported(object) {
|
|
38775
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38776
|
+
return yield this.callNative(ACTION.GET_SUPPORTED_ACTIONS.name, {}, {
|
|
38777
|
+
isMultiCallback: false,
|
|
38778
|
+
callback: (nativeData, error) => {
|
|
38779
|
+
const platform = getPlatform();
|
|
38780
|
+
if (Array.isArray(nativeData.actions) &&
|
|
38781
|
+
nativeData.actions.length > 0) {
|
|
38782
|
+
const skipJumpActions = Object.keys(ACTION).filter((item) => ACTION[item].skip_jump);
|
|
38783
|
+
const res = {
|
|
38784
|
+
actions: [...nativeData.actions, ...skipJumpActions]
|
|
38785
|
+
};
|
|
38786
|
+
return Promise.resolve(res);
|
|
38787
|
+
}
|
|
38788
|
+
else if (platform === PlatformType.iOS) {
|
|
38789
|
+
const res = {
|
|
38790
|
+
actions: ZALO_IOS_ACTIONS_SUPPORTED_BEFORE_VER_402
|
|
38791
|
+
};
|
|
38792
|
+
return Promise.resolve(res);
|
|
38793
|
+
}
|
|
38794
|
+
return Promise.reject(error);
|
|
38795
|
+
}
|
|
38796
|
+
});
|
|
38797
|
+
});
|
|
38798
|
+
}
|
|
38207
38799
|
}
|
|
38208
38800
|
|
|
38209
38801
|
class Routing {
|
|
@@ -38238,7 +38830,7 @@
|
|
|
38238
38830
|
*/
|
|
38239
38831
|
static sendDataToPreviousMiniApp(object) {
|
|
38240
38832
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38241
|
-
return yield this.callNative(ACTION.WEBVIEW_SET_RESULT, {
|
|
38833
|
+
return yield this.callNative(ACTION.WEBVIEW_SET_RESULT.name, {
|
|
38242
38834
|
result: stringifyData(object.data)
|
|
38243
38835
|
});
|
|
38244
38836
|
});
|
|
@@ -38263,7 +38855,7 @@
|
|
|
38263
38855
|
}
|
|
38264
38856
|
}
|
|
38265
38857
|
|
|
38266
|
-
var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_loggedIn, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton;
|
|
38858
|
+
var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_zOAuthVrf, _ZaloMiniProgramSDK_firstLogin, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_refreshToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_loggedIn, _ZaloMiniProgramSDK_prevGetTokenTimestamp, _ZaloMiniProgramSDK_tokenExpiresIn, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton, _ZaloMiniProgramSDK_getActionsSupported;
|
|
38267
38859
|
class ZaloMiniProgramSDK extends ZJSBridgeProvider {
|
|
38268
38860
|
constructor() {
|
|
38269
38861
|
super();
|
|
@@ -38271,13 +38863,18 @@
|
|
|
38271
38863
|
_ZaloMiniProgramSDK_appId.set(this, window.APP_ID);
|
|
38272
38864
|
_ZaloMiniProgramSDK_appConfig.set(this, window.APP_CONFIG || {});
|
|
38273
38865
|
_ZaloMiniProgramSDK_zOAuth.set(this, void 0);
|
|
38866
|
+
_ZaloMiniProgramSDK_zOAuthVrf.set(this, void 0);
|
|
38867
|
+
_ZaloMiniProgramSDK_firstLogin.set(this, void 0);
|
|
38274
38868
|
_ZaloMiniProgramSDK_accessToken.set(this, void 0);
|
|
38869
|
+
_ZaloMiniProgramSDK_refreshToken.set(this, void 0);
|
|
38275
38870
|
_ZaloMiniProgramSDK_cache.set(this, {
|
|
38276
38871
|
timer: {
|
|
38277
38872
|
getToken: 0
|
|
38278
38873
|
}
|
|
38279
38874
|
});
|
|
38280
38875
|
_ZaloMiniProgramSDK_loggedIn.set(this, false);
|
|
38876
|
+
_ZaloMiniProgramSDK_prevGetTokenTimestamp.set(this, void 0);
|
|
38877
|
+
_ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
|
|
38281
38878
|
this.events = ZMPEEmitter.getInstance();
|
|
38282
38879
|
_ZaloMiniProgramSDK_configWindow.set(this, () => {
|
|
38283
38880
|
const appConfig = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app || null;
|
|
@@ -38331,6 +38928,7 @@
|
|
|
38331
38928
|
window.ZJSBridge.setJSToken &&
|
|
38332
38929
|
window.ZJSBridge.setJSToken(jsToken.value);
|
|
38333
38930
|
}
|
|
38931
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, true);
|
|
38334
38932
|
resolve(cookies);
|
|
38335
38933
|
})
|
|
38336
38934
|
.catch((error) => {
|
|
@@ -38395,10 +38993,17 @@
|
|
|
38395
38993
|
this.sendDataToPreviousMiniApp = Routing.sendDataToPreviousMiniApp;
|
|
38396
38994
|
this.onCallbackData = Routing.onCallbackData;
|
|
38397
38995
|
this.getPhoneNumber = OpenApi.getPhoneNumber;
|
|
38996
|
+
this.openProfilePicker = Zalo.openProfilePicker;
|
|
38997
|
+
_ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
|
|
38398
38998
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
|
|
38999
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
|
|
38399
39000
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
|
|
39001
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, '');
|
|
38400
39002
|
this.isShowNavBar = true;
|
|
38401
39003
|
this.isShowHomeButton = true;
|
|
39004
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, false);
|
|
39005
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, 0);
|
|
39006
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, 0);
|
|
38402
39007
|
// this.#configApp();
|
|
38403
39008
|
}
|
|
38404
39009
|
static getInstance() {
|
|
@@ -38420,60 +39025,128 @@
|
|
|
38420
39025
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38421
39026
|
const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
|
|
38422
39027
|
const zOAuthCookie = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.ZOAUTH);
|
|
39028
|
+
const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.ZOAUTH_VRF);
|
|
38423
39029
|
if (!lodash.isUndefined(zOAuthCookie) &&
|
|
38424
39030
|
!lodash.isNull(zOAuthCookie) &&
|
|
38425
39031
|
lodash.isString(zOAuthCookie.value)) {
|
|
38426
39032
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, zOAuthCookie.value);
|
|
38427
|
-
/**
|
|
38428
|
-
* Timer get access token after expired
|
|
38429
|
-
**/
|
|
38430
|
-
const runTimer = () => __awaiter(this, void 0, void 0, function* () {
|
|
38431
|
-
if (lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) || lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth))) {
|
|
38432
|
-
clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
|
|
38433
|
-
}
|
|
38434
|
-
return yield axios
|
|
38435
|
-
.get('https://oauth.zaloapp.com/v3/access_token', {
|
|
38436
|
-
params: {
|
|
38437
|
-
app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
|
|
38438
|
-
redirect_uri: `https://h5.zdn.vn/zapps/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
|
|
38439
|
-
code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
|
|
38440
|
-
isSDK: true
|
|
38441
|
-
}
|
|
38442
|
-
})
|
|
38443
|
-
.then((response) => {
|
|
38444
|
-
let resData = response.data;
|
|
38445
|
-
if (resData.access_token) {
|
|
38446
|
-
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
|
|
38447
|
-
const expiredIn = parseInt(resData.expires_in) * 1000;
|
|
38448
|
-
if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken) {
|
|
38449
|
-
__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = window.setInterval(runTimer, expiredIn);
|
|
38450
|
-
}
|
|
38451
|
-
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
|
|
38452
|
-
this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
38453
|
-
window.ZJSBridge.setZAccSession &&
|
|
38454
|
-
window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
38455
|
-
return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
|
|
38456
|
-
}
|
|
38457
|
-
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
|
|
38458
|
-
return null;
|
|
38459
|
-
});
|
|
38460
|
-
});
|
|
38461
39033
|
clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
|
|
38462
|
-
|
|
38463
|
-
|
|
39034
|
+
__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
|
|
39035
|
+
if (!lodash.isUndefined(zOAuthVrfCookie) &&
|
|
39036
|
+
!lodash.isNull(zOAuthVrfCookie) &&
|
|
39037
|
+
lodash.isString(zOAuthVrfCookie.value)) {
|
|
39038
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, zOAuthVrfCookie.value);
|
|
39039
|
+
yield this.loginZaloV4();
|
|
39040
|
+
}
|
|
39041
|
+
else {
|
|
39042
|
+
yield this.loginZaloV3();
|
|
39043
|
+
}
|
|
39044
|
+
if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
|
|
39045
|
+
throw apiResponse.error.loginFailed();
|
|
39046
|
+
}
|
|
39047
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
|
|
38464
39048
|
}
|
|
38465
39049
|
throw apiResponse.error.loginFailed();
|
|
38466
39050
|
});
|
|
38467
39051
|
}
|
|
39052
|
+
loginZaloV3() {
|
|
39053
|
+
const runner = () => __awaiter(this, void 0, void 0, function* () {
|
|
39054
|
+
if (lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) || lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth))) {
|
|
39055
|
+
clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
|
|
39056
|
+
__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
|
|
39057
|
+
return;
|
|
39058
|
+
}
|
|
39059
|
+
return yield axios
|
|
39060
|
+
.get('https://oauth.zaloapp.com/v3/access_token', {
|
|
39061
|
+
params: {
|
|
39062
|
+
app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
|
|
39063
|
+
redirect_uri: `https://h5.zdn.vn/zapps/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
|
|
39064
|
+
code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
|
|
39065
|
+
isSDK: true
|
|
39066
|
+
}
|
|
39067
|
+
})
|
|
39068
|
+
.then((response) => {
|
|
39069
|
+
let resData = response.data;
|
|
39070
|
+
if (resData.access_token) {
|
|
39071
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
|
|
39072
|
+
const expiresIn = parseInt(resData.expires_in) * 1000;
|
|
39073
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
|
|
39074
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
|
|
39075
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
|
|
39076
|
+
this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
39077
|
+
window.ZJSBridge.setZAccSession &&
|
|
39078
|
+
window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
39079
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
|
|
39080
|
+
}
|
|
39081
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
|
|
39082
|
+
return null;
|
|
39083
|
+
});
|
|
39084
|
+
});
|
|
39085
|
+
return runner();
|
|
39086
|
+
}
|
|
39087
|
+
loginZaloV4() {
|
|
39088
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39089
|
+
if (lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) ||
|
|
39090
|
+
lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) ||
|
|
39091
|
+
lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf)) ||
|
|
39092
|
+
lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf))) {
|
|
39093
|
+
clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
|
|
39094
|
+
__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
|
|
39095
|
+
return;
|
|
39096
|
+
}
|
|
39097
|
+
const inputData = new URLSearchParams();
|
|
39098
|
+
inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId));
|
|
39099
|
+
inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth));
|
|
39100
|
+
inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf));
|
|
39101
|
+
if (__classPrivateFieldGet(this, _ZaloMiniProgramSDK_firstLogin)) {
|
|
39102
|
+
inputData.append('grant_type', 'authorization_code');
|
|
39103
|
+
}
|
|
39104
|
+
else {
|
|
39105
|
+
inputData.append('grant_type', 'refresh_token');
|
|
39106
|
+
inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
|
|
39107
|
+
}
|
|
39108
|
+
const config = {
|
|
39109
|
+
headers: {
|
|
39110
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
39111
|
+
}
|
|
39112
|
+
};
|
|
39113
|
+
return yield axios
|
|
39114
|
+
.post('https://h5.zalo.me/openapi/access_token', inputData, config)
|
|
39115
|
+
.then((response) => {
|
|
39116
|
+
const resData = response.data;
|
|
39117
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, false);
|
|
39118
|
+
if (resData.refresh_token) {
|
|
39119
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, resData.refresh_token);
|
|
39120
|
+
}
|
|
39121
|
+
if (resData.access_token) {
|
|
39122
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
|
|
39123
|
+
const expiresIn = parseInt(resData.expires_in) * 1000;
|
|
39124
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
|
|
39125
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
|
|
39126
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
|
|
39127
|
+
this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
39128
|
+
window.ZJSBridge.setZAccSession &&
|
|
39129
|
+
window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
|
|
39130
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
|
|
39131
|
+
}
|
|
39132
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
|
|
39133
|
+
return null;
|
|
39134
|
+
});
|
|
39135
|
+
});
|
|
39136
|
+
}
|
|
38468
39137
|
getAccessToken(object) {
|
|
38469
39138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38470
|
-
|
|
39139
|
+
const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp);
|
|
39140
|
+
if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
|
|
39141
|
+
throw apiResponse.error.loginRequired();
|
|
39142
|
+
}
|
|
39143
|
+
if (deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDK_tokenExpiresIn))
|
|
38471
39144
|
return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
|
|
38472
|
-
|
|
39145
|
+
return yield this.login();
|
|
38473
39146
|
});
|
|
38474
39147
|
}
|
|
38475
39148
|
}
|
|
38476
|
-
_ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_loggedIn = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap();
|
|
39149
|
+
_ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDK_firstLogin = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_refreshToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_loggedIn = new WeakMap(), _ZaloMiniProgramSDK_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDK_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDK_getActionsSupported = new WeakMap();
|
|
38477
39150
|
|
|
38478
39151
|
var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache, _MockSDK_loggedId;
|
|
38479
39152
|
class MockSDK {
|
|
@@ -38776,6 +39449,12 @@
|
|
|
38776
39449
|
number: ''
|
|
38777
39450
|
});
|
|
38778
39451
|
};
|
|
39452
|
+
this.openProfilePicker = () => {
|
|
39453
|
+
console.warn('This api only works on zalo app');
|
|
39454
|
+
return Promise.resolve({
|
|
39455
|
+
userIDs: []
|
|
39456
|
+
});
|
|
39457
|
+
};
|
|
38779
39458
|
}
|
|
38780
39459
|
on(event, fn, context) {
|
|
38781
39460
|
throw new Error('Method not implemented.');
|
|
@@ -40296,6 +40975,36 @@
|
|
|
40296
40975
|
else if (type === 'oa' && isEmpty(object.data.id)) {
|
|
40297
40976
|
throw apiResponse.error.wrongTypeParam('object.data.id', 'valid id', 'empty');
|
|
40298
40977
|
}
|
|
40978
|
+
else if (type === 'zmp') {
|
|
40979
|
+
if (lodash.isNull(object.data.title) || lodash.isNull(object.data.description)) {
|
|
40980
|
+
throw apiResponse.error.missingParam([
|
|
40981
|
+
'data.title',
|
|
40982
|
+
'data.description'
|
|
40983
|
+
]);
|
|
40984
|
+
}
|
|
40985
|
+
else {
|
|
40986
|
+
const title = object.data.title;
|
|
40987
|
+
const description = {
|
|
40988
|
+
vi: '',
|
|
40989
|
+
en: ''
|
|
40990
|
+
};
|
|
40991
|
+
if (lodash.isString(object.data.description)) {
|
|
40992
|
+
description.en = description.vi = object.data.description;
|
|
40993
|
+
}
|
|
40994
|
+
else if (lodash.isObject(object.data.description)) {
|
|
40995
|
+
description.en = object.data.description.en || '';
|
|
40996
|
+
description.vi = object.data.description.vi || '';
|
|
40997
|
+
}
|
|
40998
|
+
else {
|
|
40999
|
+
throw apiResponse.error.wrongTypeParam('data.description', 'string | {vi: string, en: string}', typeof object.data.description);
|
|
41000
|
+
}
|
|
41001
|
+
if (title.length > 100 ||
|
|
41002
|
+
description.vi.length > 400 ||
|
|
41003
|
+
description.en.length > 400)
|
|
41004
|
+
throw apiResponse.error.lengthInvalid(`'title' or 'description'`);
|
|
41005
|
+
object.data.description = description;
|
|
41006
|
+
}
|
|
41007
|
+
}
|
|
40299
41008
|
return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openShareSheet(object);
|
|
40300
41009
|
});
|
|
40301
41010
|
}
|
|
@@ -40434,6 +41143,15 @@
|
|
|
40434
41143
|
return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
|
|
40435
41144
|
});
|
|
40436
41145
|
}
|
|
41146
|
+
openProfilePicker(object) {
|
|
41147
|
+
if (lodash.isUndefined(object.maxProfile) || object.maxProfile < 1) {
|
|
41148
|
+
object.maxProfile = 1;
|
|
41149
|
+
}
|
|
41150
|
+
else if (object.maxProfile > 10) {
|
|
41151
|
+
throw apiResponse.error.badRequest("maxProfile must be in between 1 and 10");
|
|
41152
|
+
}
|
|
41153
|
+
return __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfilePicker(object);
|
|
41154
|
+
}
|
|
40437
41155
|
}
|
|
40438
41156
|
_SDKCreator_sdkManager = new WeakMap();
|
|
40439
41157
|
__decorate([
|
|
@@ -40640,7 +41358,7 @@
|
|
|
40640
41358
|
handleError,
|
|
40641
41359
|
validate,
|
|
40642
41360
|
__param(0, checkType('object', {
|
|
40643
|
-
type: ['image', 'gif', 'video', 'link', 'oa'],
|
|
41361
|
+
type: ['image', 'gif', 'video', 'link', 'oa', 'zmp'],
|
|
40644
41362
|
data: 'object'
|
|
40645
41363
|
})),
|
|
40646
41364
|
__param(0, checkType('object', {
|
|
@@ -40652,7 +41370,9 @@
|
|
|
40652
41370
|
videoUrl: 'string',
|
|
40653
41371
|
link: 'string',
|
|
40654
41372
|
chatOnly: 'boolean',
|
|
40655
|
-
id: 'string'
|
|
41373
|
+
id: 'string',
|
|
41374
|
+
title: 'string',
|
|
41375
|
+
thumbnail: 'url'
|
|
40656
41376
|
}, 'data')),
|
|
40657
41377
|
__param(0, required('type', 'data'))
|
|
40658
41378
|
], SDKCreator.prototype, "openShareSheet", null);
|
|
@@ -40771,6 +41491,13 @@
|
|
|
40771
41491
|
__decorate([
|
|
40772
41492
|
handleError
|
|
40773
41493
|
], SDKCreator.prototype, "getPhoneNumber", null);
|
|
41494
|
+
__decorate([
|
|
41495
|
+
handleError,
|
|
41496
|
+
validate,
|
|
41497
|
+
__param(0, checkType('object', {
|
|
41498
|
+
maxProfile: 'number'
|
|
41499
|
+
}))
|
|
41500
|
+
], SDKCreator.prototype, "openProfilePicker", null);
|
|
40774
41501
|
class ZaloMiniAppSDKCreator extends SDKCreator {
|
|
40775
41502
|
getInstance() {
|
|
40776
41503
|
return ZaloMiniProgramSDK.getInstance();
|