zmp-sdk 2.21.1 → 2.22.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/CHANGELOG.json +14501 -0
- package/changelog/changelog-setup.js +20 -0
- package/changelog/changelog-template.hbs +30 -0
- package/changelog/dist/changelog-setup.dev.js +24 -0
- package/dist/browser.min.js +31 -7
- package/dist/index.es.js +31 -7
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/src/apis/index.d.ts +3 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/services/mock-mp-service.d.ts +3 -1
- package/dist/types/src/services/zalo-mp-service.d.ts +2 -0
- package/dist/types/src/types/entity.d.ts +7 -0
- package/dist/types/src/types/interface.d.ts +2 -1
- package/package.json +8 -11
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = function (Handlebars) {
|
|
2
|
+
Handlebars.registerHelper('validTag', function (tag, commits, options) {
|
|
3
|
+
if (!tag || tag.indexOf('-') >=0 || commits.length <= 0) return false;
|
|
4
|
+
var version = tag.split('v')[1];
|
|
5
|
+
return version.localeCompare('2.21.2', undefined, { numeric: true, sensitivity: 'base' }) > 0;
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
Handlebars.registerHelper('commitFormat', function (options) {
|
|
9
|
+
const string = options.fn(this);
|
|
10
|
+
var mapObj = {
|
|
11
|
+
'breaking change:': '',
|
|
12
|
+
'fix:': '',
|
|
13
|
+
'feat:': ''
|
|
14
|
+
};
|
|
15
|
+
return string.replace(/('breaking change:|fix:|feat:)(.*)/gi, function (matched, a, b) {
|
|
16
|
+
const g2 = b.trim()
|
|
17
|
+
return `${mapObj[a]}${g2.charAt(0).toUpperCase() + g2.slice(1)}`;
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[npm history][1]
|
|
2
|
+
|
|
3
|
+
[1]: https://www.npmjs.com/package/zmp-sdk?activeTab=versions
|
|
4
|
+
|
|
5
|
+
{{#each releases}}
|
|
6
|
+
{{#if (validTag tag commits)}}
|
|
7
|
+
## {{title}} ({{date}})
|
|
8
|
+
|
|
9
|
+
{{! List commits with `Breaking change: ` somewhere in the message }}
|
|
10
|
+
{{#commit-list commits heading='### ⚠ BREAKING CHANGES' message='breaking change: '}}
|
|
11
|
+
* {{#commitFormat}}{{subject}}{{/commitFormat}}
|
|
12
|
+
{{/commit-list}}
|
|
13
|
+
|
|
14
|
+
{{#commit-list commits heading='### Features' message='feat: '}}
|
|
15
|
+
* {{#commitFormat}}{{subject}}{{/commitFormat}}
|
|
16
|
+
{{/commit-list}}
|
|
17
|
+
|
|
18
|
+
{{#commit-list commits heading='### Bug Fixes' exclude='feat: ' exclude='breaking change: '}}
|
|
19
|
+
* {{#commitFormat}}{{subject}}{{/commitFormat}}
|
|
20
|
+
{{/commit-list}}
|
|
21
|
+
|
|
22
|
+
{{/if}}
|
|
23
|
+
|
|
24
|
+
{{/each}}
|
|
25
|
+
|
|
26
|
+
## v2.21.2 (14-07-2022)
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **openShareSheet**: error when share image (Zalo iOS version 22.06.02)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = function (Handlebars) {
|
|
4
|
+
Handlebars.registerHelper('validTag', function (tag, commits, options) {
|
|
5
|
+
if (!tag || tag.indexOf('-') >= 0 || commits.length <= 0) return false;
|
|
6
|
+
var version = tag.split('v')[1];
|
|
7
|
+
return version.localeCompare('2.21.2', undefined, {
|
|
8
|
+
numeric: true,
|
|
9
|
+
sensitivity: 'base'
|
|
10
|
+
}) > 0;
|
|
11
|
+
});
|
|
12
|
+
Handlebars.registerHelper('commitFormat', function (options) {
|
|
13
|
+
var string = options.fn(this);
|
|
14
|
+
var mapObj = {
|
|
15
|
+
'breaking change:': '',
|
|
16
|
+
'fix:': '',
|
|
17
|
+
'feat:': ''
|
|
18
|
+
};
|
|
19
|
+
return string.replace(/('breaking change:|fix:|feat:)(.*)/gi, function (matched, a, b) {
|
|
20
|
+
var g2 = b.trim();
|
|
21
|
+
return "".concat(mapObj[a]).concat(g2.charAt(0).toUpperCase() + g2.slice(1));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
package/dist/browser.min.js
CHANGED
|
@@ -2243,7 +2243,9 @@
|
|
|
2243
2243
|
ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
|
|
2244
2244
|
JS_TOKEN: `h5.zdn.vn_zlink3rd`,
|
|
2245
2245
|
ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`,
|
|
2246
|
-
DEVICE_ID: `h5.zdn.vn_deviceID
|
|
2246
|
+
DEVICE_ID: `h5.zdn.vn_deviceID`,
|
|
2247
|
+
CONTEXT_ID: `h5.zdn.vn_contextID`,
|
|
2248
|
+
CONTEXT_TYPE: `h5.zdn.vn_contextType`,
|
|
2247
2249
|
};
|
|
2248
2250
|
const APIS = {
|
|
2249
2251
|
GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
|
|
@@ -2781,7 +2783,7 @@
|
|
|
2781
2783
|
unknown: 0
|
|
2782
2784
|
};
|
|
2783
2785
|
const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
|
|
2784
|
-
android:
|
|
2786
|
+
android: 12100641,
|
|
2785
2787
|
iOS: 460,
|
|
2786
2788
|
wp: 0,
|
|
2787
2789
|
unknown: 0
|
|
@@ -3741,7 +3743,7 @@
|
|
|
3741
3743
|
}
|
|
3742
3744
|
}
|
|
3743
3745
|
|
|
3744
|
-
var version = "2.
|
|
3746
|
+
var version = "2.22.1";
|
|
3745
3747
|
|
|
3746
3748
|
class Basics {
|
|
3747
3749
|
/**
|
|
@@ -6241,7 +6243,7 @@
|
|
|
6241
6243
|
}
|
|
6242
6244
|
}
|
|
6243
6245
|
|
|
6244
|
-
var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
|
|
6246
|
+
var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_context, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
|
|
6245
6247
|
class ZaloMiniProgramSDKService {
|
|
6246
6248
|
constructor() {
|
|
6247
6249
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -6261,6 +6263,7 @@
|
|
|
6261
6263
|
_ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
|
|
6262
6264
|
_ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
|
|
6263
6265
|
_ZaloMiniProgramSDKService_deviceId.set(this, void 0);
|
|
6266
|
+
_ZaloMiniProgramSDKService_context.set(this, void 0);
|
|
6264
6267
|
this.events = ZMPEEmitter.getInstance();
|
|
6265
6268
|
this.isIOS = checkPlatform().isIOS;
|
|
6266
6269
|
_ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
|
|
@@ -6340,6 +6343,7 @@
|
|
|
6340
6343
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0, "f");
|
|
6341
6344
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0, "f");
|
|
6342
6345
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, '', "f");
|
|
6346
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, null, "f");
|
|
6343
6347
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_bridge, ZaloJSBridge.getInstance(), "f");
|
|
6344
6348
|
const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
|
|
6345
6349
|
((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
|
|
@@ -6387,16 +6391,31 @@
|
|
|
6387
6391
|
getDeviceId() {
|
|
6388
6392
|
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_deviceId, "f");
|
|
6389
6393
|
}
|
|
6394
|
+
getContext() {
|
|
6395
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_context, "f");
|
|
6396
|
+
}
|
|
6390
6397
|
getJSBridge() {
|
|
6391
6398
|
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f");
|
|
6392
6399
|
}
|
|
6393
6400
|
login(object) {
|
|
6394
6401
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6402
|
+
const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, "f");
|
|
6403
|
+
if (__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f") && deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, "f")) {
|
|
6404
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f");
|
|
6405
|
+
}
|
|
6395
6406
|
const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
|
|
6396
6407
|
const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
|
|
6408
|
+
const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);
|
|
6409
|
+
const contextType = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_TYPE);
|
|
6397
6410
|
if (deviceId) {
|
|
6398
6411
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, deviceId.value, "f");
|
|
6399
6412
|
}
|
|
6413
|
+
if (contextID && contextType) {
|
|
6414
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, {
|
|
6415
|
+
id: contextID.value,
|
|
6416
|
+
type: contextType.value
|
|
6417
|
+
}, "f");
|
|
6418
|
+
}
|
|
6400
6419
|
const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
|
|
6401
6420
|
const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
|
|
6402
6421
|
if (!_.isUndefined(zOAuthCookie) &&
|
|
@@ -6487,7 +6506,7 @@
|
|
|
6487
6506
|
});
|
|
6488
6507
|
}
|
|
6489
6508
|
}
|
|
6490
|
-
_ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
|
|
6509
|
+
_ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_context = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
|
|
6491
6510
|
|
|
6492
6511
|
var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
|
|
6493
6512
|
class MockSDKService {
|
|
@@ -6812,6 +6831,9 @@
|
|
|
6812
6831
|
return Promise.resolve();
|
|
6813
6832
|
};
|
|
6814
6833
|
}
|
|
6834
|
+
getContext() {
|
|
6835
|
+
return null;
|
|
6836
|
+
}
|
|
6815
6837
|
on(event, fn, context) {
|
|
6816
6838
|
throw new Error('Method not implemented.');
|
|
6817
6839
|
}
|
|
@@ -6827,10 +6849,9 @@
|
|
|
6827
6849
|
openMediaPicker(type, serverUpload, maxItemSize, editView, silentRequest, maxSelectItem) {
|
|
6828
6850
|
console.warn('This api only works on zalo app');
|
|
6829
6851
|
return Promise.resolve({
|
|
6830
|
-
data:
|
|
6852
|
+
data: ''
|
|
6831
6853
|
});
|
|
6832
6854
|
}
|
|
6833
|
-
;
|
|
6834
6855
|
}
|
|
6835
6856
|
_MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
|
|
6836
6857
|
|
|
@@ -7518,6 +7539,9 @@
|
|
|
7518
7539
|
getDeviceId() {
|
|
7519
7540
|
return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getDeviceId();
|
|
7520
7541
|
}
|
|
7542
|
+
getContext() {
|
|
7543
|
+
return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getContext();
|
|
7544
|
+
}
|
|
7521
7545
|
};
|
|
7522
7546
|
_SDKCreator_sdkService = new WeakMap();
|
|
7523
7547
|
__decorate([
|
package/dist/index.es.js
CHANGED
|
@@ -2240,7 +2240,9 @@ const COOKIE_NAME = {
|
|
|
2240
2240
|
ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
|
|
2241
2241
|
JS_TOKEN: `h5.zdn.vn_zlink3rd`,
|
|
2242
2242
|
ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`,
|
|
2243
|
-
DEVICE_ID: `h5.zdn.vn_deviceID
|
|
2243
|
+
DEVICE_ID: `h5.zdn.vn_deviceID`,
|
|
2244
|
+
CONTEXT_ID: `h5.zdn.vn_contextID`,
|
|
2245
|
+
CONTEXT_TYPE: `h5.zdn.vn_contextType`,
|
|
2244
2246
|
};
|
|
2245
2247
|
const APIS = {
|
|
2246
2248
|
GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
|
|
@@ -2778,7 +2780,7 @@ const ZALO_SUPPORT_STORAGE_VERSION = {
|
|
|
2778
2780
|
unknown: 0
|
|
2779
2781
|
};
|
|
2780
2782
|
const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
|
|
2781
|
-
android:
|
|
2783
|
+
android: 12100641,
|
|
2782
2784
|
iOS: 460,
|
|
2783
2785
|
wp: 0,
|
|
2784
2786
|
unknown: 0
|
|
@@ -3738,7 +3740,7 @@ class ZMPEEmitter extends eventemitter3 {
|
|
|
3738
3740
|
}
|
|
3739
3741
|
}
|
|
3740
3742
|
|
|
3741
|
-
var version$1 = "2.
|
|
3743
|
+
var version$1 = "2.22.1";
|
|
3742
3744
|
|
|
3743
3745
|
class Basics {
|
|
3744
3746
|
/**
|
|
@@ -6238,7 +6240,7 @@ class Routing {
|
|
|
6238
6240
|
}
|
|
6239
6241
|
}
|
|
6240
6242
|
|
|
6241
|
-
var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
|
|
6243
|
+
var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_context, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
|
|
6242
6244
|
class ZaloMiniProgramSDKService {
|
|
6243
6245
|
constructor() {
|
|
6244
6246
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -6258,6 +6260,7 @@ class ZaloMiniProgramSDKService {
|
|
|
6258
6260
|
_ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
|
|
6259
6261
|
_ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
|
|
6260
6262
|
_ZaloMiniProgramSDKService_deviceId.set(this, void 0);
|
|
6263
|
+
_ZaloMiniProgramSDKService_context.set(this, void 0);
|
|
6261
6264
|
this.events = ZMPEEmitter.getInstance();
|
|
6262
6265
|
this.isIOS = checkPlatform().isIOS;
|
|
6263
6266
|
_ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
|
|
@@ -6337,6 +6340,7 @@ class ZaloMiniProgramSDKService {
|
|
|
6337
6340
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0, "f");
|
|
6338
6341
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0, "f");
|
|
6339
6342
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, '', "f");
|
|
6343
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, null, "f");
|
|
6340
6344
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_bridge, ZaloJSBridge.getInstance(), "f");
|
|
6341
6345
|
const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
|
|
6342
6346
|
((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
|
|
@@ -6384,16 +6388,31 @@ class ZaloMiniProgramSDKService {
|
|
|
6384
6388
|
getDeviceId() {
|
|
6385
6389
|
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_deviceId, "f");
|
|
6386
6390
|
}
|
|
6391
|
+
getContext() {
|
|
6392
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_context, "f");
|
|
6393
|
+
}
|
|
6387
6394
|
getJSBridge() {
|
|
6388
6395
|
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f");
|
|
6389
6396
|
}
|
|
6390
6397
|
login(object) {
|
|
6391
6398
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6399
|
+
const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, "f");
|
|
6400
|
+
if (__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f") && deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, "f")) {
|
|
6401
|
+
return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f");
|
|
6402
|
+
}
|
|
6392
6403
|
const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
|
|
6393
6404
|
const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
|
|
6405
|
+
const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);
|
|
6406
|
+
const contextType = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_TYPE);
|
|
6394
6407
|
if (deviceId) {
|
|
6395
6408
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, deviceId.value, "f");
|
|
6396
6409
|
}
|
|
6410
|
+
if (contextID && contextType) {
|
|
6411
|
+
__classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, {
|
|
6412
|
+
id: contextID.value,
|
|
6413
|
+
type: contextType.value
|
|
6414
|
+
}, "f");
|
|
6415
|
+
}
|
|
6397
6416
|
const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
|
|
6398
6417
|
const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
|
|
6399
6418
|
if (!_.isUndefined(zOAuthCookie) &&
|
|
@@ -6484,7 +6503,7 @@ class ZaloMiniProgramSDKService {
|
|
|
6484
6503
|
});
|
|
6485
6504
|
}
|
|
6486
6505
|
}
|
|
6487
|
-
_ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
|
|
6506
|
+
_ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_context = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
|
|
6488
6507
|
|
|
6489
6508
|
var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
|
|
6490
6509
|
class MockSDKService {
|
|
@@ -6809,6 +6828,9 @@ class MockSDKService {
|
|
|
6809
6828
|
return Promise.resolve();
|
|
6810
6829
|
};
|
|
6811
6830
|
}
|
|
6831
|
+
getContext() {
|
|
6832
|
+
return null;
|
|
6833
|
+
}
|
|
6812
6834
|
on(event, fn, context) {
|
|
6813
6835
|
throw new Error('Method not implemented.');
|
|
6814
6836
|
}
|
|
@@ -6824,10 +6846,9 @@ class MockSDKService {
|
|
|
6824
6846
|
openMediaPicker(type, serverUpload, maxItemSize, editView, silentRequest, maxSelectItem) {
|
|
6825
6847
|
console.warn('This api only works on zalo app');
|
|
6826
6848
|
return Promise.resolve({
|
|
6827
|
-
data:
|
|
6849
|
+
data: ''
|
|
6828
6850
|
});
|
|
6829
6851
|
}
|
|
6830
|
-
;
|
|
6831
6852
|
}
|
|
6832
6853
|
_MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
|
|
6833
6854
|
|
|
@@ -8873,6 +8894,9 @@ let SDKCreator = class SDKCreator {
|
|
|
8873
8894
|
getDeviceId() {
|
|
8874
8895
|
return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getDeviceId();
|
|
8875
8896
|
}
|
|
8897
|
+
getContext() {
|
|
8898
|
+
return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getContext();
|
|
8899
|
+
}
|
|
8876
8900
|
};
|
|
8877
8901
|
_SDKCreator_sdkService = new WeakMap();
|
|
8878
8902
|
__decorate([
|