zmp-sdk 2.14.1 → 2.15.0-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 +244 -89
- package/dist/index.es.js +244 -89
- package/dist/index.js +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/controller/index.d.ts +2 -1
- 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 +1 -0
- package/dist/types/src/services/zalo.d.ts +9 -0
- package/dist/types/src/types/callbackData.d.ts +7 -0
- package/dist/types/src/types/enum.d.ts +2 -1
- package/dist/types/src/types/inputData.d.ts +3 -0
- package/dist/types/src/utils/common.d.ts +1 -0
- package/dist/types/src/utils/response.d.ts +2 -0
- package/package.json +1 -1
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["zmp"] = "zmp";
|
|
21369
21370
|
})(ShareSheetType || (ShareSheetType = {}));
|
|
21370
21371
|
var OrientationType;
|
|
21371
21372
|
(function (OrientationType) {
|
|
@@ -21539,7 +21540,8 @@
|
|
|
21539
21540
|
INTERACTIVE_VIBRATION: 'action.interactive.vibration',
|
|
21540
21541
|
ZBROWSER_MPDS: 'action.zbrowser.mpds',
|
|
21541
21542
|
WEBVIEW_SET_RESULT: "action.webview.set.result",
|
|
21542
|
-
MP_GET_NUMBER: "action.mp.get.number"
|
|
21543
|
+
MP_GET_NUMBER: "action.mp.get.number",
|
|
21544
|
+
MP_OPEN_PROFILE_PICKER: "action.mp.open.profile.picker"
|
|
21543
21545
|
};
|
|
21544
21546
|
const ACTION_HAVE_CALLBACK = [
|
|
21545
21547
|
ACTION.GET_DOWNLOADED_STICKER,
|
|
@@ -21565,6 +21567,7 @@
|
|
|
21565
21567
|
];
|
|
21566
21568
|
const RESPONSE_CODE = {
|
|
21567
21569
|
BAD_REQUEST: -1400,
|
|
21570
|
+
INTERNAL_SERVER_ERROR: -1500,
|
|
21568
21571
|
UNAUTHORIZED: -1401,
|
|
21569
21572
|
FORBIDDEN: -1403
|
|
21570
21573
|
};
|
|
@@ -21590,7 +21593,7 @@
|
|
|
21590
21593
|
const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
|
|
21591
21594
|
const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
|
|
21592
21595
|
const REGEXP_SPACES = new RegExp('\\s', 'g');
|
|
21593
|
-
const debug$2 = src(
|
|
21596
|
+
const debug$2 = src('zmp:utils:common');
|
|
21594
21597
|
/**
|
|
21595
21598
|
* Checks if a url is valid
|
|
21596
21599
|
* @param {string} string URL
|
|
@@ -21690,10 +21693,11 @@
|
|
|
21690
21693
|
const isArrayType = lowerCaseType === 'array' ||
|
|
21691
21694
|
lowerCaseType === 'array<number>' ||
|
|
21692
21695
|
lowerCaseType === 'array<string>';
|
|
21693
|
-
if ((
|
|
21694
|
-
(
|
|
21695
|
-
(lowerCaseType === 'array
|
|
21696
|
-
|
|
21696
|
+
if ((lowerCaseType === 'url' && isValidUrl(argument)) ||
|
|
21697
|
+
(isArrayType &&
|
|
21698
|
+
((lowerCaseType === 'array' && Array.isArray(argument)) ||
|
|
21699
|
+
(lowerCaseType === 'array<number>' && isArrayNumber(argument)) ||
|
|
21700
|
+
(lowerCaseType === 'array<string>' && isArrayString(argument)))) ||
|
|
21697
21701
|
(!Array.isArray(argument) && typeof argument === type)) {
|
|
21698
21702
|
return true;
|
|
21699
21703
|
}
|
|
@@ -21813,6 +21817,23 @@
|
|
|
21813
21817
|
console.log(error);
|
|
21814
21818
|
return data;
|
|
21815
21819
|
}
|
|
21820
|
+
};
|
|
21821
|
+
const showUserInfoPermissionModal = (acceptHandler, denyHandler) => {
|
|
21822
|
+
const userInfoPermissionModal = document.getElementById('zmp-permission-container');
|
|
21823
|
+
const buttonAccept = document.getElementById('button-accept');
|
|
21824
|
+
const buttonDeny = document.getElementById('button-deny');
|
|
21825
|
+
if (!userInfoPermissionModal || !buttonAccept || !buttonDeny)
|
|
21826
|
+
return;
|
|
21827
|
+
// show modal
|
|
21828
|
+
userInfoPermissionModal.style.display = 'block';
|
|
21829
|
+
buttonAccept.onclick = () => {
|
|
21830
|
+
acceptHandler && acceptHandler();
|
|
21831
|
+
userInfoPermissionModal.style.display = 'none';
|
|
21832
|
+
};
|
|
21833
|
+
buttonDeny.onclick = () => {
|
|
21834
|
+
denyHandler && denyHandler();
|
|
21835
|
+
userInfoPermissionModal.style.display = 'none';
|
|
21836
|
+
};
|
|
21816
21837
|
};
|
|
21817
21838
|
|
|
21818
21839
|
/*! *****************************************************************************
|
|
@@ -34674,38 +34695,51 @@
|
|
|
34674
34695
|
'default': zlib$1
|
|
34675
34696
|
});
|
|
34676
34697
|
|
|
34677
|
-
var
|
|
34678
|
-
var
|
|
34679
|
-
var
|
|
34680
|
-
var
|
|
34681
|
-
var
|
|
34682
|
-
|
|
34683
|
-
start: "node ./sandbox/server.js",
|
|
34684
|
-
build: "NODE_ENV=production grunt build",
|
|
34685
|
-
preversion: "npm test",
|
|
34686
|
-
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
34687
|
-
postversion: "git push && git push --tags",
|
|
34688
|
-
examples: "node ./examples/server.js",
|
|
34689
|
-
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
34690
|
-
fix: "eslint --fix lib/**/*.js"
|
|
34698
|
+
var _from = "axios@0.21.1";
|
|
34699
|
+
var _id = "axios@0.21.1";
|
|
34700
|
+
var _inBundle = false;
|
|
34701
|
+
var _integrity = "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==";
|
|
34702
|
+
var _location = "/zmp-sdk/axios";
|
|
34703
|
+
var _phantomChildren = {
|
|
34691
34704
|
};
|
|
34692
|
-
var
|
|
34693
|
-
type: "
|
|
34694
|
-
|
|
34705
|
+
var _requested = {
|
|
34706
|
+
type: "version",
|
|
34707
|
+
registry: true,
|
|
34708
|
+
raw: "axios@0.21.1",
|
|
34709
|
+
name: "axios",
|
|
34710
|
+
escapedName: "axios",
|
|
34711
|
+
rawSpec: "0.21.1",
|
|
34712
|
+
saveSpec: null,
|
|
34713
|
+
fetchSpec: "0.21.1"
|
|
34695
34714
|
};
|
|
34696
|
-
var
|
|
34697
|
-
"
|
|
34698
|
-
"http",
|
|
34699
|
-
"ajax",
|
|
34700
|
-
"promise",
|
|
34701
|
-
"node"
|
|
34715
|
+
var _requiredBy = [
|
|
34716
|
+
"/zmp-sdk"
|
|
34702
34717
|
];
|
|
34703
|
-
var
|
|
34704
|
-
var
|
|
34718
|
+
var _resolved = "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz";
|
|
34719
|
+
var _shasum = "22563481962f4d6bde9a76d516ef0e5d3c09b2b8";
|
|
34720
|
+
var _spec = "axios@0.21.1";
|
|
34721
|
+
var _where = "/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction";
|
|
34722
|
+
var author = {
|
|
34723
|
+
name: "Matt Zabriskie"
|
|
34724
|
+
};
|
|
34725
|
+
var browser = {
|
|
34726
|
+
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
34727
|
+
};
|
|
34705
34728
|
var bugs = {
|
|
34706
34729
|
url: "https://github.com/axios/axios/issues"
|
|
34707
34730
|
};
|
|
34708
|
-
var
|
|
34731
|
+
var bundleDependencies = false;
|
|
34732
|
+
var bundlesize = [
|
|
34733
|
+
{
|
|
34734
|
+
path: "./dist/axios.min.js",
|
|
34735
|
+
threshold: "5kB"
|
|
34736
|
+
}
|
|
34737
|
+
];
|
|
34738
|
+
var dependencies = {
|
|
34739
|
+
"follow-redirects": "^1.10.0"
|
|
34740
|
+
};
|
|
34741
|
+
var deprecated = false;
|
|
34742
|
+
var description = "Promise based HTTP client for the browser and node.js";
|
|
34709
34743
|
var devDependencies = {
|
|
34710
34744
|
bundlesize: "^0.17.0",
|
|
34711
34745
|
coveralls: "^3.0.0",
|
|
@@ -34743,62 +34777,105 @@
|
|
|
34743
34777
|
webpack: "^1.13.1",
|
|
34744
34778
|
"webpack-dev-server": "^1.14.1"
|
|
34745
34779
|
};
|
|
34746
|
-
var
|
|
34747
|
-
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
34748
|
-
};
|
|
34780
|
+
var homepage = "https://github.com/axios/axios";
|
|
34749
34781
|
var jsdelivr = "dist/axios.min.js";
|
|
34750
|
-
var
|
|
34751
|
-
|
|
34752
|
-
|
|
34753
|
-
"
|
|
34754
|
-
|
|
34755
|
-
|
|
34756
|
-
{
|
|
34757
|
-
path: "./dist/axios.min.js",
|
|
34758
|
-
threshold: "5kB"
|
|
34759
|
-
}
|
|
34782
|
+
var keywords = [
|
|
34783
|
+
"xhr",
|
|
34784
|
+
"http",
|
|
34785
|
+
"ajax",
|
|
34786
|
+
"promise",
|
|
34787
|
+
"node"
|
|
34760
34788
|
];
|
|
34789
|
+
var license = "MIT";
|
|
34790
|
+
var main = "index.js";
|
|
34791
|
+
var name = "axios";
|
|
34792
|
+
var repository = {
|
|
34793
|
+
type: "git",
|
|
34794
|
+
url: "git+https://github.com/axios/axios.git"
|
|
34795
|
+
};
|
|
34796
|
+
var scripts = {
|
|
34797
|
+
build: "NODE_ENV=production grunt build",
|
|
34798
|
+
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
34799
|
+
examples: "node ./examples/server.js",
|
|
34800
|
+
fix: "eslint --fix lib/**/*.js",
|
|
34801
|
+
postversion: "git push && git push --tags",
|
|
34802
|
+
preversion: "npm test",
|
|
34803
|
+
start: "node ./sandbox/server.js",
|
|
34804
|
+
test: "grunt test && bundlesize",
|
|
34805
|
+
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"
|
|
34806
|
+
};
|
|
34807
|
+
var typings = "./index.d.ts";
|
|
34808
|
+
var unpkg = "dist/axios.min.js";
|
|
34809
|
+
var version$1 = "0.21.1";
|
|
34761
34810
|
var _package = {
|
|
34762
|
-
|
|
34763
|
-
|
|
34764
|
-
|
|
34765
|
-
|
|
34766
|
-
|
|
34767
|
-
|
|
34768
|
-
|
|
34811
|
+
_from: _from,
|
|
34812
|
+
_id: _id,
|
|
34813
|
+
_inBundle: _inBundle,
|
|
34814
|
+
_integrity: _integrity,
|
|
34815
|
+
_location: _location,
|
|
34816
|
+
_phantomChildren: _phantomChildren,
|
|
34817
|
+
_requested: _requested,
|
|
34818
|
+
_requiredBy: _requiredBy,
|
|
34819
|
+
_resolved: _resolved,
|
|
34820
|
+
_shasum: _shasum,
|
|
34821
|
+
_spec: _spec,
|
|
34822
|
+
_where: _where,
|
|
34769
34823
|
author: author,
|
|
34770
|
-
|
|
34824
|
+
browser: browser,
|
|
34771
34825
|
bugs: bugs,
|
|
34772
|
-
|
|
34826
|
+
bundleDependencies: bundleDependencies,
|
|
34827
|
+
bundlesize: bundlesize,
|
|
34828
|
+
dependencies: dependencies,
|
|
34829
|
+
deprecated: deprecated,
|
|
34830
|
+
description: description,
|
|
34773
34831
|
devDependencies: devDependencies,
|
|
34774
|
-
|
|
34832
|
+
homepage: homepage,
|
|
34775
34833
|
jsdelivr: jsdelivr,
|
|
34776
|
-
|
|
34834
|
+
keywords: keywords,
|
|
34835
|
+
license: license,
|
|
34836
|
+
main: main,
|
|
34837
|
+
name: name,
|
|
34838
|
+
repository: repository,
|
|
34839
|
+
scripts: scripts,
|
|
34777
34840
|
typings: typings,
|
|
34778
|
-
|
|
34779
|
-
|
|
34841
|
+
unpkg: unpkg,
|
|
34842
|
+
version: version$1
|
|
34780
34843
|
};
|
|
34781
34844
|
|
|
34782
34845
|
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
34783
34846
|
__proto__: null,
|
|
34784
|
-
|
|
34785
|
-
|
|
34786
|
-
|
|
34787
|
-
|
|
34788
|
-
|
|
34789
|
-
|
|
34790
|
-
|
|
34847
|
+
_from: _from,
|
|
34848
|
+
_id: _id,
|
|
34849
|
+
_inBundle: _inBundle,
|
|
34850
|
+
_integrity: _integrity,
|
|
34851
|
+
_location: _location,
|
|
34852
|
+
_phantomChildren: _phantomChildren,
|
|
34853
|
+
_requested: _requested,
|
|
34854
|
+
_requiredBy: _requiredBy,
|
|
34855
|
+
_resolved: _resolved,
|
|
34856
|
+
_shasum: _shasum,
|
|
34857
|
+
_spec: _spec,
|
|
34858
|
+
_where: _where,
|
|
34791
34859
|
author: author,
|
|
34792
|
-
|
|
34860
|
+
browser: browser,
|
|
34793
34861
|
bugs: bugs,
|
|
34794
|
-
|
|
34862
|
+
bundleDependencies: bundleDependencies,
|
|
34863
|
+
bundlesize: bundlesize,
|
|
34864
|
+
dependencies: dependencies,
|
|
34865
|
+
deprecated: deprecated,
|
|
34866
|
+
description: description,
|
|
34795
34867
|
devDependencies: devDependencies,
|
|
34796
|
-
|
|
34868
|
+
homepage: homepage,
|
|
34797
34869
|
jsdelivr: jsdelivr,
|
|
34798
|
-
|
|
34870
|
+
keywords: keywords,
|
|
34871
|
+
license: license,
|
|
34872
|
+
main: main,
|
|
34873
|
+
name: name,
|
|
34874
|
+
repository: repository,
|
|
34875
|
+
scripts: scripts,
|
|
34799
34876
|
typings: typings,
|
|
34800
|
-
|
|
34801
|
-
|
|
34877
|
+
unpkg: unpkg,
|
|
34878
|
+
version: version$1,
|
|
34802
34879
|
'default': _package
|
|
34803
34880
|
});
|
|
34804
34881
|
|
|
@@ -36184,11 +36261,13 @@
|
|
|
36184
36261
|
loginFailed: () => new CommonError(RESPONSE_CODE.UNAUTHORIZED, MESSAGES.LOGIN_FAILED),
|
|
36185
36262
|
loginRequired: () => new CommonError(RESPONSE_CODE.BAD_REQUEST, MESSAGES.LOGIN_REQUIRED),
|
|
36186
36263
|
missingParam: (params) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Missing required argument: ${params}`),
|
|
36187
|
-
wrongTypeParam: (arg, expected, got) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Wrong type of parameter '${arg}'. Expected ${expected}, but got ${got}`)
|
|
36264
|
+
wrongTypeParam: (arg, expected, got) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `Wrong type of parameter '${arg}'. Expected ${expected}, but got ${got}`),
|
|
36265
|
+
cannotGetShareInfo: () => new CommonError(RESPONSE_CODE.INTERNAL_SERVER_ERROR, `Can not get app info to share`),
|
|
36266
|
+
lengthInvalid: (arg) => new CommonError(RESPONSE_CODE.BAD_REQUEST, `${arg} length is invalid.`)
|
|
36188
36267
|
}
|
|
36189
36268
|
};
|
|
36190
36269
|
|
|
36191
|
-
var version = "2.
|
|
36270
|
+
var version = "2.15.0-1";
|
|
36192
36271
|
|
|
36193
36272
|
class Basics {
|
|
36194
36273
|
/**
|
|
@@ -38058,6 +38137,28 @@
|
|
|
38058
38137
|
uid: object.data.id
|
|
38059
38138
|
};
|
|
38060
38139
|
break;
|
|
38140
|
+
case 'zmp':
|
|
38141
|
+
const currentUrl = new URL(location.href);
|
|
38142
|
+
const params = new URLSearchParams();
|
|
38143
|
+
params.append('title', object.data.title);
|
|
38144
|
+
params.append('description', object.data.description);
|
|
38145
|
+
params.append('thumbnail', object.data.thumbnail);
|
|
38146
|
+
params.append('url', `https://zalo.me/app/link${currentUrl.pathname}${currentUrl.search}`);
|
|
38147
|
+
const config = {
|
|
38148
|
+
headers: {
|
|
38149
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
38150
|
+
}
|
|
38151
|
+
};
|
|
38152
|
+
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, config);
|
|
38153
|
+
const resData = res.data;
|
|
38154
|
+
if (!resData || resData.err !== 0) {
|
|
38155
|
+
throw apiResponse.error.cannotGetShareInfo();
|
|
38156
|
+
}
|
|
38157
|
+
object.type = 'link';
|
|
38158
|
+
reqData = {
|
|
38159
|
+
link: resData.data.shareUrl,
|
|
38160
|
+
chatOnly: object.data.chatOnly ? 1 : 0
|
|
38161
|
+
};
|
|
38061
38162
|
}
|
|
38062
38163
|
return yield this.callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
|
|
38063
38164
|
haveTimeout: false
|
|
@@ -38087,6 +38188,33 @@
|
|
|
38087
38188
|
});
|
|
38088
38189
|
});
|
|
38089
38190
|
}
|
|
38191
|
+
/**
|
|
38192
|
+
* Cho phép ứng dụng mở giao diện chọn user và get về list noise id
|
|
38193
|
+
*
|
|
38194
|
+
* @async
|
|
38195
|
+
* @function openProfilePicker
|
|
38196
|
+
* @category Zalo
|
|
38197
|
+
*
|
|
38198
|
+
*/
|
|
38199
|
+
static openProfilePicker(object) {
|
|
38200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38201
|
+
return new Promise((resolve, reject) => {
|
|
38202
|
+
this.callNative(ACTION.MP_OPEN_PROFILE_PICKER, {}, {
|
|
38203
|
+
isMultiCallback: true,
|
|
38204
|
+
callback: (nativeData, error) => {
|
|
38205
|
+
if (error)
|
|
38206
|
+
reject(error);
|
|
38207
|
+
if (nativeData.error_code === 0) {
|
|
38208
|
+
const res = {
|
|
38209
|
+
userIDs: nativeData.data
|
|
38210
|
+
};
|
|
38211
|
+
resolve(res);
|
|
38212
|
+
}
|
|
38213
|
+
}
|
|
38214
|
+
});
|
|
38215
|
+
});
|
|
38216
|
+
});
|
|
38217
|
+
}
|
|
38090
38218
|
}
|
|
38091
38219
|
|
|
38092
38220
|
class Routing {
|
|
@@ -38204,19 +38332,23 @@
|
|
|
38204
38332
|
});
|
|
38205
38333
|
_ZaloMiniProgramSDK_callJump.set(this, () => {
|
|
38206
38334
|
return new Promise((resolve, reject) => {
|
|
38207
|
-
|
|
38208
|
-
.
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
window.ZJSBridge.setJSToken
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38219
|
-
|
|
38335
|
+
showUserInfoPermissionModal(() => {
|
|
38336
|
+
this.callNative('action.jump.login', {})
|
|
38337
|
+
.then((data) => {
|
|
38338
|
+
const cookies = (data && data.cookiesOAuthLogins) || [];
|
|
38339
|
+
const jsToken = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.JS_TOKEN);
|
|
38340
|
+
if (jsToken) {
|
|
38341
|
+
this.setJSToken(jsToken.value);
|
|
38342
|
+
window.ZJSBridge.setJSToken &&
|
|
38343
|
+
window.ZJSBridge.setJSToken(jsToken.value);
|
|
38344
|
+
}
|
|
38345
|
+
resolve(cookies);
|
|
38346
|
+
})
|
|
38347
|
+
.catch((error) => {
|
|
38348
|
+
reject(error);
|
|
38349
|
+
});
|
|
38350
|
+
}, () => {
|
|
38351
|
+
reject(new Error("User denied!"));
|
|
38220
38352
|
});
|
|
38221
38353
|
});
|
|
38222
38354
|
});
|
|
@@ -38277,6 +38409,7 @@
|
|
|
38277
38409
|
this.sendDataToPreviousMiniApp = Routing.sendDataToPreviousMiniApp;
|
|
38278
38410
|
this.onCallbackData = Routing.onCallbackData;
|
|
38279
38411
|
this.getPhoneNumber = OpenApi.getPhoneNumber;
|
|
38412
|
+
this.openProfilePicker = Zalo.openProfilePicker;
|
|
38280
38413
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
|
|
38281
38414
|
__classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
|
|
38282
38415
|
this.isShowNavBar = true;
|
|
@@ -38648,6 +38781,12 @@
|
|
|
38648
38781
|
number: ''
|
|
38649
38782
|
});
|
|
38650
38783
|
};
|
|
38784
|
+
this.openProfilePicker = () => {
|
|
38785
|
+
console.warn('This api only works on zalo app');
|
|
38786
|
+
return Promise.resolve({
|
|
38787
|
+
userIDs: []
|
|
38788
|
+
});
|
|
38789
|
+
};
|
|
38651
38790
|
}
|
|
38652
38791
|
on(event, fn, context) {
|
|
38653
38792
|
throw new Error('Method not implemented.');
|
|
@@ -40166,6 +40305,9 @@
|
|
|
40166
40305
|
else if (type === 'oa' && isEmpty(object.data.id)) {
|
|
40167
40306
|
throw apiResponse.error.wrongTypeParam('object.data.id', 'valid id', 'empty');
|
|
40168
40307
|
}
|
|
40308
|
+
else if (type === 'zmp' && (object.data.title.length > 100 || object.data.description.length > 400)) {
|
|
40309
|
+
throw apiResponse.error.lengthInvalid(`'title' or 'description'`);
|
|
40310
|
+
}
|
|
40169
40311
|
return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openShareSheet(object);
|
|
40170
40312
|
});
|
|
40171
40313
|
}
|
|
@@ -40302,6 +40444,9 @@
|
|
|
40302
40444
|
getPhoneNumber(object) {
|
|
40303
40445
|
return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
|
|
40304
40446
|
}
|
|
40447
|
+
openProfilePicker(object) {
|
|
40448
|
+
return __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfilePicker();
|
|
40449
|
+
}
|
|
40305
40450
|
}
|
|
40306
40451
|
_SDKCreator_sdkManager = new WeakMap();
|
|
40307
40452
|
__decorate([
|
|
@@ -40390,7 +40535,11 @@
|
|
|
40390
40535
|
handleError
|
|
40391
40536
|
], SDKCreator.prototype, "clearStorage", null);
|
|
40392
40537
|
__decorate([
|
|
40393
|
-
handleError
|
|
40538
|
+
handleError,
|
|
40539
|
+
validate,
|
|
40540
|
+
__param(0, checkType('object', {
|
|
40541
|
+
avatarType: ['small', 'normal', 'large']
|
|
40542
|
+
}))
|
|
40394
40543
|
], SDKCreator.prototype, "getUserInfo", null);
|
|
40395
40544
|
__decorate([
|
|
40396
40545
|
handleError
|
|
@@ -40501,7 +40650,7 @@
|
|
|
40501
40650
|
handleError,
|
|
40502
40651
|
validate,
|
|
40503
40652
|
__param(0, checkType('object', {
|
|
40504
|
-
type: ['image', 'gif', 'video', 'link', 'oa'],
|
|
40653
|
+
type: ['image', 'gif', 'video', 'link', 'oa', 'zmp'],
|
|
40505
40654
|
data: 'object'
|
|
40506
40655
|
})),
|
|
40507
40656
|
__param(0, checkType('object', {
|
|
@@ -40513,7 +40662,10 @@
|
|
|
40513
40662
|
videoUrl: 'string',
|
|
40514
40663
|
link: 'string',
|
|
40515
40664
|
chatOnly: 'boolean',
|
|
40516
|
-
id: 'string'
|
|
40665
|
+
id: 'string',
|
|
40666
|
+
title: 'string',
|
|
40667
|
+
description: 'string',
|
|
40668
|
+
thumbnail: 'url'
|
|
40517
40669
|
}, 'data')),
|
|
40518
40670
|
__param(0, required('type', 'data'))
|
|
40519
40671
|
], SDKCreator.prototype, "openShareSheet", null);
|
|
@@ -40632,6 +40784,9 @@
|
|
|
40632
40784
|
__decorate([
|
|
40633
40785
|
handleError
|
|
40634
40786
|
], SDKCreator.prototype, "getPhoneNumber", null);
|
|
40787
|
+
__decorate([
|
|
40788
|
+
handleError
|
|
40789
|
+
], SDKCreator.prototype, "openProfilePicker", null);
|
|
40635
40790
|
class ZaloMiniAppSDKCreator extends SDKCreator {
|
|
40636
40791
|
getInstance() {
|
|
40637
40792
|
return ZaloMiniProgramSDK.getInstance();
|