@cloudbase/oauth 3.0.0 → 3.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/cjs/auth/apis.d.ts +22 -4
- package/dist/cjs/auth/apis.js +255 -66
- package/dist/cjs/auth/auth-error.d.ts +6 -0
- package/dist/cjs/auth/auth-error.js +32 -0
- package/dist/cjs/auth/consts.d.ts +22 -0
- package/dist/cjs/auth/consts.js +24 -2
- package/dist/cjs/auth/models.d.ts +13 -4
- package/dist/cjs/auth/models.js +1 -1
- package/dist/cjs/captcha/captcha-dom.d.ts +3 -0
- package/dist/cjs/captcha/captcha-dom.js +223 -0
- package/dist/cjs/captcha/captcha.d.ts +3 -1
- package/dist/cjs/captcha/captcha.js +11 -102
- package/dist/cjs/index.d.ts +12 -2
- package/dist/cjs/index.js +27 -4
- package/dist/cjs/oauth2client/interface.d.ts +1 -1
- package/dist/cjs/oauth2client/interface.js +1 -1
- package/dist/cjs/oauth2client/models.d.ts +15 -1
- package/dist/cjs/oauth2client/models.js +1 -1
- package/dist/cjs/oauth2client/oauth2client.d.ts +62 -3
- package/dist/cjs/oauth2client/oauth2client.js +426 -131
- package/dist/cjs/utils/base64.d.ts +5 -0
- package/dist/cjs/utils/base64.js +15 -2
- package/dist/cjs/utils/encryptlong/index.js +22 -16
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/mp.js +4 -4
- package/dist/cjs/utils/urlSearchParams.js +1 -1
- package/dist/esm/auth/apis.d.ts +22 -4
- package/dist/esm/auth/apis.js +130 -10
- package/dist/esm/auth/auth-error.d.ts +6 -0
- package/dist/esm/auth/auth-error.js +9 -0
- package/dist/esm/auth/consts.d.ts +22 -0
- package/dist/esm/auth/consts.js +22 -0
- package/dist/esm/auth/models.d.ts +13 -4
- package/dist/esm/captcha/captcha-dom.d.ts +3 -0
- package/dist/esm/captcha/captcha-dom.js +129 -0
- package/dist/esm/captcha/captcha.d.ts +3 -1
- package/dist/esm/captcha/captcha.js +14 -97
- package/dist/esm/index.d.ts +12 -2
- package/dist/esm/index.js +20 -3
- package/dist/esm/oauth2client/interface.d.ts +1 -1
- package/dist/esm/oauth2client/models.d.ts +15 -1
- package/dist/esm/oauth2client/oauth2client.d.ts +62 -3
- package/dist/esm/oauth2client/oauth2client.js +200 -55
- package/dist/esm/utils/base64.d.ts +5 -0
- package/dist/esm/utils/base64.js +12 -0
- package/dist/esm/utils/encryptlong/index.js +21 -15
- package/dist/esm/utils/mp.js +3 -3
- package/dist/miniprogram/index.js +1 -1
- package/package.json +10 -4
- package/src/auth/apis.ts +222 -17
- package/src/auth/auth-error.ts +21 -0
- package/src/auth/consts.ts +28 -0
- package/src/auth/models.ts +13 -4
- package/src/captcha/captcha-dom.ts +178 -0
- package/src/captcha/captcha.ts +25 -114
- package/src/index.ts +54 -4
- package/src/oauth2client/interface.ts +1 -1
- package/src/oauth2client/models.ts +29 -1
- package/src/oauth2client/oauth2client.ts +308 -55
- package/src/utils/base64.ts +12 -0
- package/src/utils/encryptlong/index.js +20 -14
- package/src/utils/index.ts +1 -0
- package/src/utils/mp.ts +3 -3
- package/src/utils/urlSearchParams.ts +2 -0
- package/tsconfig.json +1 -0
- package/dist/cjs/utils/cloudbase-adapter-wx_mp.d.ts +0 -1
- package/dist/cjs/utils/cloudbase-adapter-wx_mp.js +0 -40
- package/dist/esm/utils/cloudbase-adapter-wx_mp.d.ts +0 -1
- package/dist/esm/utils/cloudbase-adapter-wx_mp.js +0 -35
- package/src/utils/cloudbase-adapter-wx_mp.ts +0 -42
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMatch = void 0;
|
|
4
|
-
function isMatch() {
|
|
5
|
-
if (typeof wx === 'undefined') {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
if (typeof Page === 'undefined') {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
if (!wx.getSystemInfoSync) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (!wx.getStorageSync) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (!wx.setStorageSync) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
if (!wx.connectSocket) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (!wx.request) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
if (!wx.getSystemInfoSync()) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
if (wx.getSystemInfoSync().AppPlatform === 'qq') {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
exports.isMatch = isMatch;
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvdWRiYXNlLWFkYXB0ZXItd3hfbXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbHMvY2xvdWRiYXNlLWFkYXB0ZXItd3hfbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBS0EsU0FBZ0IsT0FBTztJQUNyQixJQUFJLE9BQU8sRUFBRSxLQUFLLFdBQVcsRUFBRTtRQUM3QixPQUFPLEtBQUssQ0FBQTtLQUNiO0lBQ0QsSUFBSSxPQUFPLElBQUksS0FBSyxXQUFXLEVBQUU7UUFDL0IsT0FBTyxLQUFLLENBQUE7S0FDYjtJQUNELElBQUksQ0FBQyxFQUFFLENBQUMsaUJBQWlCLEVBQUU7UUFDekIsT0FBTyxLQUFLLENBQUE7S0FDYjtJQUNELElBQUksQ0FBQyxFQUFFLENBQUMsY0FBYyxFQUFFO1FBQ3RCLE9B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XG4gICAgcmV0dXJuIGZhbHNlXG4gIH1cbiAgaWYgKCF3eC5zZXRTdG9yYWdlU3luYykge1xuICAgIHJldHVybiBmYWxzZVxuICB9XG4gIGlmICghd3guY29ubmVjdFNvY2tldCkge1xuICAgIHJldHVybiBmYWxzZVxuICB9XG4gIGlmICghd3gucmVxdWVzdCkge1xuICAgIHJldHVybiBmYWxzZVxuICB9XG5cbiAgdHJ5IHtcbiAgICBpZiAoIXd4LmdldFN5c3RlbUluZm9TeW5jKCkpIHtcbiAgICAgIHJldHVybiBmYWxzZVxuICAgIH1cblxuICAgIGlmICh3eC5nZXRTeXN0ZW1JbmZvU3luYygpLkFwcFBsYXRmb3JtID09PSAncXEnKSB7XG4gICAgICByZXR1cm4gZmFsc2VcbiAgICB9XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICByZXR1cm4gZmFsc2VcbiAgfVxuXG4gIHJldHVybiB0cnVlXG59XG4iXX0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isMatch(): boolean;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export function isMatch() {
|
|
2
|
-
if (typeof wx === 'undefined') {
|
|
3
|
-
return false;
|
|
4
|
-
}
|
|
5
|
-
if (typeof Page === 'undefined') {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
if (!wx.getSystemInfoSync) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
if (!wx.getStorageSync) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (!wx.setStorageSync) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (!wx.connectSocket) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
if (!wx.request) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
if (!wx.getSystemInfoSync()) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (wx.getSystemInfoSync().AppPlatform === 'qq') {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断是否为小程序runtime
|
|
3
|
-
*/
|
|
4
|
-
declare const wx
|
|
5
|
-
declare const Page
|
|
6
|
-
export function isMatch(): boolean {
|
|
7
|
-
if (typeof wx === 'undefined') {
|
|
8
|
-
return false
|
|
9
|
-
}
|
|
10
|
-
if (typeof Page === 'undefined') {
|
|
11
|
-
return false
|
|
12
|
-
}
|
|
13
|
-
if (!wx.getSystemInfoSync) {
|
|
14
|
-
return false
|
|
15
|
-
}
|
|
16
|
-
if (!wx.getStorageSync) {
|
|
17
|
-
return false
|
|
18
|
-
}
|
|
19
|
-
if (!wx.setStorageSync) {
|
|
20
|
-
return false
|
|
21
|
-
}
|
|
22
|
-
if (!wx.connectSocket) {
|
|
23
|
-
return false
|
|
24
|
-
}
|
|
25
|
-
if (!wx.request) {
|
|
26
|
-
return false
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
if (!wx.getSystemInfoSync()) {
|
|
31
|
-
return false
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (wx.getSystemInfoSync().AppPlatform === 'qq') {
|
|
35
|
-
return false
|
|
36
|
-
}
|
|
37
|
-
} catch (e) {
|
|
38
|
-
return false
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return true
|
|
42
|
-
}
|