@frontegg/redux-store 7.50.0-alpha.0 → 7.50.0
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/index.js
CHANGED
package/node/index.js
CHANGED
|
@@ -7,13 +7,13 @@ exports.default = void 0;
|
|
|
7
7
|
class FronteggNativeModule {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.loginWithSSO = email => {
|
|
10
|
-
if (this.
|
|
10
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
11
11
|
var _window$webkit, _window$webkit$messag, _window$webkit$messag2;
|
|
12
12
|
(_window$webkit = window.webkit) == null ? void 0 : (_window$webkit$messag = _window$webkit.messageHandlers) == null ? void 0 : (_window$webkit$messag2 = _window$webkit$messag.FronteggNativeBridge) == null ? void 0 : _window$webkit$messag2.postMessage(JSON.stringify({
|
|
13
13
|
action: 'loginWithSSO',
|
|
14
14
|
payload: email
|
|
15
15
|
}));
|
|
16
|
-
} else if (this.
|
|
16
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
17
17
|
var _window$FronteggNativ;
|
|
18
18
|
(_window$FronteggNativ = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ.loginWithSSO(email);
|
|
19
19
|
} else {
|
|
@@ -21,13 +21,13 @@ class FronteggNativeModule {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
this.loginWithSocialLogin = url => {
|
|
24
|
-
if (this.
|
|
24
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
25
25
|
var _window$webkit2, _window$webkit2$messa, _window$webkit2$messa2;
|
|
26
26
|
(_window$webkit2 = window.webkit) == null ? void 0 : (_window$webkit2$messa = _window$webkit2.messageHandlers) == null ? void 0 : (_window$webkit2$messa2 = _window$webkit2$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit2$messa2.postMessage(JSON.stringify({
|
|
27
27
|
action: 'loginWithSocialLogin',
|
|
28
28
|
payload: url
|
|
29
29
|
}));
|
|
30
|
-
} else if (this.
|
|
30
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
31
31
|
var _window$FronteggNativ2;
|
|
32
32
|
(_window$FronteggNativ2 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ2.loginWithSocialLogin(url);
|
|
33
33
|
} else {
|
|
@@ -35,13 +35,13 @@ class FronteggNativeModule {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
this.loginWithSocialLoginProvider = provider => {
|
|
38
|
-
if (this.
|
|
38
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
39
39
|
var _window$webkit3, _window$webkit3$messa, _window$webkit3$messa2;
|
|
40
40
|
(_window$webkit3 = window.webkit) == null ? void 0 : (_window$webkit3$messa = _window$webkit3.messageHandlers) == null ? void 0 : (_window$webkit3$messa2 = _window$webkit3$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit3$messa2.postMessage(JSON.stringify({
|
|
41
41
|
action: 'loginWithSocialLoginProvider',
|
|
42
42
|
payload: provider
|
|
43
43
|
}));
|
|
44
|
-
} else if (this.
|
|
44
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
45
45
|
var _window$FronteggNativ3;
|
|
46
46
|
(_window$FronteggNativ3 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ3.loginWithSocialLoginProvider(provider);
|
|
47
47
|
} else {
|
|
@@ -49,13 +49,13 @@ class FronteggNativeModule {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
this.loginWithCustomSocialLoginProvider = providerId => {
|
|
52
|
-
if (this.
|
|
52
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
53
53
|
var _window$webkit4, _window$webkit4$messa, _window$webkit4$messa2;
|
|
54
54
|
(_window$webkit4 = window.webkit) == null ? void 0 : (_window$webkit4$messa = _window$webkit4.messageHandlers) == null ? void 0 : (_window$webkit4$messa2 = _window$webkit4$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit4$messa2.postMessage(JSON.stringify({
|
|
55
55
|
action: 'loginWithCustomSocialLoginProvider',
|
|
56
56
|
payload: providerId
|
|
57
57
|
}));
|
|
58
|
-
} else if (this.
|
|
58
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
59
59
|
var _window$FronteggNativ4;
|
|
60
60
|
(_window$FronteggNativ4 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ4.loginWithCustomSocialLoginProvider(providerId);
|
|
61
61
|
} else {
|
|
@@ -63,7 +63,7 @@ class FronteggNativeModule {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
this.suggestSavePassword = (email, password) => {
|
|
66
|
-
if (this.
|
|
66
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
67
67
|
var _window$webkit5, _window$webkit5$messa, _window$webkit5$messa2;
|
|
68
68
|
(_window$webkit5 = window.webkit) == null ? void 0 : (_window$webkit5$messa = _window$webkit5.messageHandlers) == null ? void 0 : (_window$webkit5$messa2 = _window$webkit5$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit5$messa2.postMessage(JSON.stringify({
|
|
69
69
|
action: 'suggestSavePassword',
|
|
@@ -72,7 +72,7 @@ class FronteggNativeModule {
|
|
|
72
72
|
password
|
|
73
73
|
})
|
|
74
74
|
}));
|
|
75
|
-
} else if (this.
|
|
75
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
76
76
|
var _window$FronteggNativ5;
|
|
77
77
|
(_window$FronteggNativ5 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ5.suggestSavePassword(email, password);
|
|
78
78
|
} else {
|
|
@@ -84,11 +84,11 @@ class FronteggNativeModule {
|
|
|
84
84
|
return (_window$FronteggNativ6 = (_window$FronteggNativ7 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ7['shouldPromptSocialLoginConsent']) != null ? _window$FronteggNativ6 : false;
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
isIOSNativeBridgeAvailable() {
|
|
88
88
|
var _window$webkit6, _window$webkit6$messa;
|
|
89
89
|
return ((_window$webkit6 = window.webkit) == null ? void 0 : (_window$webkit6$messa = _window$webkit6.messageHandlers) == null ? void 0 : _window$webkit6$messa.FronteggNativeBridge) != null;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
isAndroidNativeBridgeAvailable() {
|
|
92
92
|
return window.FronteggNativeBridge != null;
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -111,7 +111,7 @@ class FronteggNativeModule {
|
|
|
111
111
|
return this.isAvailable('suggestSavePassword');
|
|
112
112
|
}
|
|
113
113
|
isAvailable(method) {
|
|
114
|
-
if (this.
|
|
114
|
+
if (this.isIOSNativeBridgeAvailable() || this.isAndroidNativeBridgeAvailable()) {
|
|
115
115
|
var _window$FronteggNativ8, _window$FronteggNativ9;
|
|
116
116
|
return (_window$FronteggNativ8 = (_window$FronteggNativ9 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ9[method]) != null ? _window$FronteggNativ8 : false;
|
|
117
117
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.50.0
|
|
3
|
+
"version": "7.50.0",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.50.0
|
|
10
|
+
"@frontegg/rest-api": "7.50.0",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|
|
@@ -19,8 +19,8 @@ declare global {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
declare class FronteggNativeModule {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
isIOSNativeBridgeAvailable(): boolean;
|
|
23
|
+
isAndroidNativeBridgeAvailable(): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* @deprecated use isSocialLoginProviderAvailable instead for pkce flow in mobile
|
|
26
26
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
class FronteggNativeModule {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loginWithSSO = email => {
|
|
4
|
-
if (this.
|
|
4
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
5
5
|
var _window$webkit, _window$webkit$messag, _window$webkit$messag2;
|
|
6
6
|
(_window$webkit = window.webkit) == null ? void 0 : (_window$webkit$messag = _window$webkit.messageHandlers) == null ? void 0 : (_window$webkit$messag2 = _window$webkit$messag.FronteggNativeBridge) == null ? void 0 : _window$webkit$messag2.postMessage(JSON.stringify({
|
|
7
7
|
action: 'loginWithSSO',
|
|
8
8
|
payload: email
|
|
9
9
|
}));
|
|
10
|
-
} else if (this.
|
|
10
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
11
11
|
var _window$FronteggNativ;
|
|
12
12
|
(_window$FronteggNativ = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ.loginWithSSO(email);
|
|
13
13
|
} else {
|
|
@@ -15,13 +15,13 @@ class FronteggNativeModule {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
this.loginWithSocialLogin = url => {
|
|
18
|
-
if (this.
|
|
18
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
19
19
|
var _window$webkit2, _window$webkit2$messa, _window$webkit2$messa2;
|
|
20
20
|
(_window$webkit2 = window.webkit) == null ? void 0 : (_window$webkit2$messa = _window$webkit2.messageHandlers) == null ? void 0 : (_window$webkit2$messa2 = _window$webkit2$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit2$messa2.postMessage(JSON.stringify({
|
|
21
21
|
action: 'loginWithSocialLogin',
|
|
22
22
|
payload: url
|
|
23
23
|
}));
|
|
24
|
-
} else if (this.
|
|
24
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
25
25
|
var _window$FronteggNativ2;
|
|
26
26
|
(_window$FronteggNativ2 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ2.loginWithSocialLogin(url);
|
|
27
27
|
} else {
|
|
@@ -29,13 +29,13 @@ class FronteggNativeModule {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
this.loginWithSocialLoginProvider = provider => {
|
|
32
|
-
if (this.
|
|
32
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
33
33
|
var _window$webkit3, _window$webkit3$messa, _window$webkit3$messa2;
|
|
34
34
|
(_window$webkit3 = window.webkit) == null ? void 0 : (_window$webkit3$messa = _window$webkit3.messageHandlers) == null ? void 0 : (_window$webkit3$messa2 = _window$webkit3$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit3$messa2.postMessage(JSON.stringify({
|
|
35
35
|
action: 'loginWithSocialLoginProvider',
|
|
36
36
|
payload: provider
|
|
37
37
|
}));
|
|
38
|
-
} else if (this.
|
|
38
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
39
39
|
var _window$FronteggNativ3;
|
|
40
40
|
(_window$FronteggNativ3 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ3.loginWithSocialLoginProvider(provider);
|
|
41
41
|
} else {
|
|
@@ -43,13 +43,13 @@ class FronteggNativeModule {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
this.loginWithCustomSocialLoginProvider = providerId => {
|
|
46
|
-
if (this.
|
|
46
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
47
47
|
var _window$webkit4, _window$webkit4$messa, _window$webkit4$messa2;
|
|
48
48
|
(_window$webkit4 = window.webkit) == null ? void 0 : (_window$webkit4$messa = _window$webkit4.messageHandlers) == null ? void 0 : (_window$webkit4$messa2 = _window$webkit4$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit4$messa2.postMessage(JSON.stringify({
|
|
49
49
|
action: 'loginWithCustomSocialLoginProvider',
|
|
50
50
|
payload: providerId
|
|
51
51
|
}));
|
|
52
|
-
} else if (this.
|
|
52
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
53
53
|
var _window$FronteggNativ4;
|
|
54
54
|
(_window$FronteggNativ4 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ4.loginWithCustomSocialLoginProvider(providerId);
|
|
55
55
|
} else {
|
|
@@ -57,7 +57,7 @@ class FronteggNativeModule {
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
this.suggestSavePassword = (email, password) => {
|
|
60
|
-
if (this.
|
|
60
|
+
if (this.isIOSNativeBridgeAvailable()) {
|
|
61
61
|
var _window$webkit5, _window$webkit5$messa, _window$webkit5$messa2;
|
|
62
62
|
(_window$webkit5 = window.webkit) == null ? void 0 : (_window$webkit5$messa = _window$webkit5.messageHandlers) == null ? void 0 : (_window$webkit5$messa2 = _window$webkit5$messa.FronteggNativeBridge) == null ? void 0 : _window$webkit5$messa2.postMessage(JSON.stringify({
|
|
63
63
|
action: 'suggestSavePassword',
|
|
@@ -66,7 +66,7 @@ class FronteggNativeModule {
|
|
|
66
66
|
password
|
|
67
67
|
})
|
|
68
68
|
}));
|
|
69
|
-
} else if (this.
|
|
69
|
+
} else if (this.isAndroidNativeBridgeAvailable()) {
|
|
70
70
|
var _window$FronteggNativ5;
|
|
71
71
|
(_window$FronteggNativ5 = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ5.suggestSavePassword(email, password);
|
|
72
72
|
} else {
|
|
@@ -78,11 +78,11 @@ class FronteggNativeModule {
|
|
|
78
78
|
return (_window$FronteggNativ6 = (_window$FronteggNativ7 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ7['shouldPromptSocialLoginConsent']) != null ? _window$FronteggNativ6 : false;
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
isIOSNativeBridgeAvailable() {
|
|
82
82
|
var _window$webkit6, _window$webkit6$messa;
|
|
83
83
|
return ((_window$webkit6 = window.webkit) == null ? void 0 : (_window$webkit6$messa = _window$webkit6.messageHandlers) == null ? void 0 : _window$webkit6$messa.FronteggNativeBridge) != null;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
isAndroidNativeBridgeAvailable() {
|
|
86
86
|
return window.FronteggNativeBridge != null;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -105,7 +105,7 @@ class FronteggNativeModule {
|
|
|
105
105
|
return this.isAvailable('suggestSavePassword');
|
|
106
106
|
}
|
|
107
107
|
isAvailable(method) {
|
|
108
|
-
if (this.
|
|
108
|
+
if (this.isIOSNativeBridgeAvailable() || this.isAndroidNativeBridgeAvailable()) {
|
|
109
109
|
var _window$FronteggNativ8, _window$FronteggNativ9;
|
|
110
110
|
return (_window$FronteggNativ8 = (_window$FronteggNativ9 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ9[method]) != null ? _window$FronteggNativ8 : false;
|
|
111
111
|
}
|