@authing/guard-shim-react18 4.5.40-alpha.0 → 4.5.40-alpha.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/guard.min.js +2 -2
- package/dist/typings/src/Guard/core/hooks/useMultipleAccounts.d.ts +2 -2
- package/dist/typings/src/Login/hooks/useLoginMultiple.d.ts +2 -2
- package/dist/typings/src/_utils/compute.d.ts +2 -2
- package/dist/typings/src/_utils/config/index.d.ts +1 -1
- package/dist/typings/src/_utils/context.d.ts +1 -1
- package/package.json +1 -1
package/dist/guard.min.js
CHANGED
|
@@ -22482,7 +22482,7 @@ e.VERIFY_CODE="VERIFY_CODE"}(Oc||(Oc={})),function(e){e.Day="DAY",e.Month="MONTH
|
|
|
22482
22482
|
// EXTERNAL MODULE: ./node_modules/ua-parser-js/src/ua-parser.js
|
|
22483
22483
|
var Mc=i(1763),Dc=i.n(Mc),Lc=i(1935),Fc=i.n(Lc),jc=function(){return"undefined"==typeof navigator?null:/MicroMessenger/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&!/wxwork/i.test(navigator.userAgent)},Bc=function(){return"undefined"==typeof navigator?null:/Lark/i.test(navigator.userAgent)},Uc=function(){return"undefined"==typeof navigator?null:/dingtalk/i.test(navigator.userAgent)},qc=function(e){var t;
|
|
22484
22484
|
// 1. 首先筛选出一定是特殊浏览器的 UA
|
|
22485
|
-
if(void 0===e&&(e=[]),jc()
|
|
22485
|
+
if(void 0===e&&(e=[]),jc()||"undefined"!=typeof navigator&&/wxwork/i.test(navigator.userAgent)||Bc()||Uc()||"undefined"!=typeof navigator&&/QtWebEngine/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MiuiBrowser/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MQQBrowser/i.test(navigator.userAgent)||function(){if("undefined"!=typeof window)return window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}()||"undefined"!=typeof navigator&&/webview/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/ldclient/i.test(navigator.userAgent))return!0;
|
|
22486
22486
|
// 2. 服务级别配置的特殊浏览器
|
|
22487
22487
|
if(e.some((function(e){return new RegExp(e,"i").test(navigator.userAgent)})))return!0;
|
|
22488
22488
|
// 3. 利用 ua-parser-js 进一步判断,筛选出很可能不是特殊浏览器的 UA
|
|
@@ -27482,7 +27482,7 @@ var $D=i(4232),HD=i(4631),WD=i(1062),GD=i(8787),KD={zhCN:$D/* default */.Z,enUS:
|
|
|
27482
27482
|
* 多账号 状态
|
|
27483
27483
|
*/
|
|
27484
27484
|
multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isSpecialBrowser:!1},nL=y().createContext(tL),rL=y().createContext({spin:!1,spinChange:function(){}}),oL=function(){return XD(rL)},iL=function(){return XD(nL).publicConfig},aL=function(){return XD(nL).httpClient},sL=function(){return XD(nL).isSpecialBrowser},cL=function(){return XD(nL).appId},lL=function(){return XD(nL).tenantId};function uL(){return XD(nL).initData}var dL=function(){return XD(nL).currentModule},fL=function(){return XD(nL).events},pL=function(){var e=XD(nL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},hL=function(){return XD(nL).finallyConfig},mL=function(){return XD(nL).isAuthFlow},vL=function(){return XD(nL).multipleInstance},gL=function(){return XD(nL).phoneRegex},yL=function(){return XD(nL).defaultLanguageConfig},bL=function(){var e=iL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},wL=function(e){var t,n,r=iL(),o=r.loginSmsConfig,i=r.registerSmsConfig,a=!1;switch(e){case"login":a="ON"===(null===(t=null==o?void 0:o.robot)||void 0===t?void 0:t.switch);break;case"register":a="ON"===(null===(n=null==i?void 0:i.robot)||void 0===n?void 0:n.switch)}return a},CL=y().useMemo,EL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},kL=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=_u().i18n,i=XD(nL).guardPageConfig,a=hL(),s=CL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=CL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=CL((function(){return Object.keys(EL).includes(o.resolvedLanguage)?o.resolvedLanguage:ud(o.resolvedLanguage)[0]||"en-US"}),[o.resolvedLanguage]),u=CL((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,EL[l].label))}),[l]),d=CL((function(){return Object.keys(EL).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:EL[e].label}}))}),[n]);if(!c||0===n.length)return null;var f={items:d,onClick:function(e){l!==e.key&&(o.changeLanguage(e.key),null==r||r(e.key))}};return y().createElement("div",{className:"g2-change-language-container"},y().createElement(CP,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"authing-g2-change-language-menu"},y().createElement("span",{className:s},u,y().createElement(JD,{type:"authing-arrow-down-s-fill",className:"down-fill-svg"}))))};// CONCATENATED MODULE: ./package.json
|
|
27485
|
-
const SL=JSON.parse('{"i8":"4.5.40-alpha.
|
|
27485
|
+
const SL=JSON.parse('{"i8":"4.5.40-alpha.1"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
|
|
27486
27486
|
function xL(){return SL.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
|
|
27487
27487
|
var _L,PL=function(){return _L},TL=function(e){_L=e},OL=function(){return OL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},OL.apply(this,arguments)},NL=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IL=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},AL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RL=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},ML=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return NL(void 0,void 0,void 0,(function(){return IL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,RL([],AL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},DL=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};ML.get=function(e,t,n){return void 0===t&&(t={}),NL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return IL(this,(function(c){switch(c.label){case 0:r=OL(OL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[ML.langHeader]=PX(),s)),""!==ML.tenantId&&(r[ML.tenantHeader]=ML.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ha().CancelToken,i=o.source(),[4/*yield*/,Promise.race([DL(i.cancel),ha()("".concat(ML.baseUrl).concat(e).concat(Fc().stringify(t,{addQueryPrefix:!0})),OL(OL({method:"GET"},n),{withCredentials:!0,headers:r,cancelToken:i.token}))])];case 2:return[2/*return*/,null==(a=c.sent())?void 0:a.data];case 3:return c.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},ML.post=function(e,t,n){return NL(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return IL(this,(function(l){switch(l.label){case 0:r=OL(OL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[ML.langHeader]=su.resolvedLanguage,s)),""!==ML.tenantId&&(r[ML.tenantHeader]=ML.tenantId),l.label=1;case 1:return l.trys.push([1,3,,4]),o=ha().CancelToken,i=o.source(),[4/*yield*/,Promise.race([DL(i.cancel),ha()("".concat(ML.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:OL(OL({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[ML.langHeader]=PX(),c))})])];case 2:return[2/*return*/,null==(a=l.sent())?void 0:a.data];case 3:return l.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},ML.postForm=function(e,t,n){return NL(void 0,void 0,void 0,(function(){var r,o,i,a;return IL(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=ha().CancelToken,o=r.source(),[4/*yield*/,Promise.race([DL(o.cancel),ha()("".concat(ML.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:OL(OL({},null==n?void 0:n.headers),(a={},a[ML.langHeader]=PX(),a))})])];case 1:return[2/*return*/,null==(i=s.sent())?void 0:i.data];case 2:return s.sent(),[2/*return*/,Promise.resolve({code:-2})];case 3:return[2/*return*/]}}))}))},ML.baseUrl="",ML.setBaseUrl=function(e){ML.baseUrl=e.replace(/\/$/,"")};var LL,FL="x-authing-lang";ML.langHeader=FL,ML.tenantHeader="x-authing-app-tenant-idåå",ML.tenantId="",ML.setLangHeader=function(e){ML.langHeader=e||FL},ML.setTenantHeader=function(e){ML.tenantHeader=e||FL},ML.setTenantId=function(e){ML.tenantId=e},function(e){e.ERROR="error",e.LOGIN="login",e.REGISTER="register",e.MFA="mfa",e.FORGET_PWD="forgetPassword",e.FORCED_PASSWORD_RESET="forcedPasswordReset",e.NOTICE_PASSWORD_RESET="noticePasswordReset",e.FIRST_LOGIN_PASSWORD="firstLoginPassword",e.UNSAFE_PASSWORD_RESET="unsafePasswordReset",e.DOWNLOAD_AT="downloadAT",e.BIND_TOTP="bindTotp",e.ANY_QUESTIONS="anyQuestions",e.LOGIN_COMPLETE_INFO="loginCompleteInfo",e.REGISTER_PASSWORD="registerPassword",e.REGISTER_COMPLETE_INFO="registerCompleteInfo",e.RECOVERY_CODE="recoveryCode",e.SUBMIT_SUCCESS="submitSuccess",e.IDENTITY_BINDING_ASK="identityBindingAsk",e.IDENTITY_BINDING="identityBinding",e.IDENTITY_BINDING_NO_ASK="identityBindingNoAsk",e.SELF_UNLOCK="selfUnlock",e.FLOW_SELECT_ACCOUNT="flowSelectAccount",
|
|
27488
27488
|
/** 多租户门户选择页 */
|
|
@@ -250,7 +250,7 @@ declare class MultipleAccount {
|
|
|
250
250
|
id: string;
|
|
251
251
|
loginAccount?: string | undefined;
|
|
252
252
|
usertype?: string | undefined;
|
|
253
|
-
}, "
|
|
253
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
254
254
|
setLoginWayByHttpData: (account: string, data: {
|
|
255
255
|
username?: string | undefined;
|
|
256
256
|
phone?: string | undefined;
|
|
@@ -294,7 +294,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
|
|
|
294
294
|
id: string;
|
|
295
295
|
loginAccount?: string | undefined;
|
|
296
296
|
usertype?: string | undefined;
|
|
297
|
-
}, "
|
|
297
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
298
298
|
setLoginWayByHttpData: (account: string, data: {
|
|
299
299
|
username?: string | undefined;
|
|
300
300
|
phone?: string | undefined;
|
|
@@ -39,7 +39,7 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
|
|
|
39
39
|
id: string;
|
|
40
40
|
loginAccount?: string | undefined;
|
|
41
41
|
usertype?: string | undefined;
|
|
42
|
-
}, "
|
|
42
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
43
43
|
setLoginWayByHttpData: (account: string, data: {
|
|
44
44
|
username?: string | undefined;
|
|
45
45
|
phone?: string | undefined;
|
|
@@ -61,7 +61,7 @@ declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
|
|
|
61
61
|
getOriginAccount: () => string;
|
|
62
62
|
getOriginWay: () => string;
|
|
63
63
|
} | undefined;
|
|
64
|
-
referMultipleState: ((type: "
|
|
64
|
+
referMultipleState: ((type: "multiple" | "login") => void) | undefined;
|
|
65
65
|
backfillData: BackFillMultipleState | undefined;
|
|
66
66
|
defaultQrWay: string | undefined;
|
|
67
67
|
};
|
|
@@ -14,8 +14,8 @@ export declare const isEdgeBrowser: () => boolean;
|
|
|
14
14
|
export declare const isWeiboBrowser: () => boolean | null;
|
|
15
15
|
export declare const isAlipayBrowser: () => boolean | null;
|
|
16
16
|
export declare const isBaiduBrowser: () => boolean | null;
|
|
17
|
-
export declare const isWeComeBrowser: () => boolean;
|
|
18
|
-
export declare const isMobile: () => RegExpMatchArray | null;
|
|
17
|
+
export declare const isWeComeBrowser: () => boolean | null;
|
|
18
|
+
export declare const isMobile: () => RegExpMatchArray | null | undefined;
|
|
19
19
|
export declare const isWebview: () => boolean | null;
|
|
20
20
|
export declare const isLenovoNetdisk: () => boolean | null;
|
|
21
21
|
export declare const computeIsSpecialBrowser: (specialBrowserSymbol?: string[]) => boolean;
|
|
@@ -53,7 +53,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
53
53
|
loginMethods?: LoginMethods[] | undefined;
|
|
54
54
|
passwordLoginMethods?: string[] | undefined;
|
|
55
55
|
socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
|
|
56
|
-
socialConnectionsBtnShape?: "button" | "
|
|
56
|
+
socialConnectionsBtnShape?: "button" | "icon" | "default" | undefined;
|
|
57
57
|
enterpriseConnections?: string[] | undefined;
|
|
58
58
|
qrCodeScanOptions?: {
|
|
59
59
|
extIdpConnId?: string | undefined;
|
|
@@ -123,7 +123,7 @@ export declare const useGuardAccountSelectInstance: () => {
|
|
|
123
123
|
id: string;
|
|
124
124
|
loginAccount?: string | undefined;
|
|
125
125
|
usertype?: string | undefined;
|
|
126
|
-
}, "
|
|
126
|
+
}, "tab" | "way" | "phoneCountryCode">) => void;
|
|
127
127
|
setLoginWayByHttpData: (account: string, data: {
|
|
128
128
|
username?: string | undefined;
|
|
129
129
|
phone?: string | undefined;
|
package/package.json
CHANGED