@equinor/echo-cli 0.13.11 → 0.13.12
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/README.md +18 -17
- package/lib/coc/.env +0 -0
- package/lib/coc/.gitattributes +3 -0
- package/lib/coc/echoModule.config.json +22 -0
- package/lib/coc/echoModuleId.json +3 -0
- package/lib/coc/env.sh +54 -0
- package/lib/coc/package-lock.json +14205 -0
- package/lib/coc/package.json +36 -0
- package/lib/coc/readme.md +47 -0
- package/lib/coc/src/app.module.css +5 -0
- package/lib/coc/src/app.tsx +30 -0
- package/lib/coc/src/index.ts +6 -0
- package/lib/coc/tsconfig.json +25 -0
- package/lib/coc2/.env +47 -0
- package/lib/coc2/.gitattributes +3 -0
- package/lib/coc2/build/assets/vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js +3 -0
- package/lib/coc2/build/assets/vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js.LICENSE.txt +35 -0
- package/lib/coc2/build/assets/vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js.map +1 -0
- package/lib/coc2/build/d2d97a9feca22f12a8c8c7413d7867ac.jpg +0 -0
- package/lib/coc2/build/echoModuleManifest.json +12 -0
- package/lib/coc2/build/env-config.js +2 -0
- package/lib/coc2/build/index.css +60 -0
- package/lib/coc2/build/index.html +21 -0
- package/lib/coc2/build/index.js +136 -0
- package/lib/coc2/build/index.js.map +1 -0
- package/lib/coc2/build/main.echo.bundle.js +3 -0
- package/lib/coc2/build/main.echo.bundle.js.LICENSE.txt +171 -0
- package/lib/coc2/build/main.echo.bundle.js.map +1 -0
- package/lib/coc2/build/vendors-node_modules_react-dom_client_js-node_modules_babel_polyfill_lib_index_js-node_module-cb4c76.echo.bundle.js +3 -0
- package/lib/coc2/build/vendors-node_modules_react-dom_client_js-node_modules_babel_polyfill_lib_index_js-node_module-cb4c76.echo.bundle.js.LICENSE.txt +9175 -0
- package/lib/coc2/build/vendors-node_modules_react-dom_client_js-node_modules_babel_polyfill_lib_index_js-node_module-cb4c76.echo.bundle.js.map +1 -0
- package/lib/coc2/echoModule.config.json +22 -0
- package/lib/coc2/echoModuleId.json +3 -0
- package/lib/coc2/env-config.js +24 -0
- package/lib/coc2/env.sh +54 -0
- package/lib/coc2/package-lock.json +14205 -0
- package/lib/coc2/package.json +36 -0
- package/lib/coc2/readme.md +47 -0
- package/lib/coc2/src/app.module.css +5 -0
- package/lib/coc2/src/app.tsx +30 -0
- package/lib/coc2/src/index.ts +6 -0
- package/lib/coc2/tsconfig.json +25 -0
- package/lib/echo-publish.d.ts +6 -0
- package/lib/echo-publish.js +15 -0
- package/lib/echo-publish.js.map +1 -0
- package/lib/tools/buildScripts/webpackBuilds.js +10 -7
- package/lib/tools/buildScripts/webpackBuilds.js.map +1 -1
- package/lib/tools/publish/publish-config.d.ts +0 -0
- package/lib/tools/publish/publish-config.js +2 -0
- package/lib/tools/publish/publish-config.js.map +1 -0
- package/lib/tools/publish/publish.d.ts +1 -0
- package/lib/tools/publish/publish.js +33 -0
- package/lib/tools/publish/publish.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@equinor/echo-coc",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"source": "src/index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "echo-build -c && npm run env",
|
|
9
|
+
"env": "bash ./env.sh",
|
|
10
|
+
"start": "echo-build -s -d",
|
|
11
|
+
"start-admin": "echo-build -s -d -a"
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
17
|
+
"@equinor/echo-components": ">= 0.11.1 < 0.12.0",
|
|
18
|
+
"@equinor/echo-core": ">= 0.9.8 < 0.10.0",
|
|
19
|
+
"@equinor/echo-search": ">= 0.15.3 < 0.16.0",
|
|
20
|
+
"@equinor/echo-utils": ">= 0.4.1 < 0.5.0",
|
|
21
|
+
"react": ">= 17.0.2",
|
|
22
|
+
"react-dom": ">= 17.0.2"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@equinor/echo-base": "0.7.0",
|
|
26
|
+
"@equinor/echo-components": "0.11.6",
|
|
27
|
+
"@equinor/echo-core": "0.9.8",
|
|
28
|
+
"@equinor/echo-search": "0.15.3",
|
|
29
|
+
"@equinor/echo-utils": "0.4.1",
|
|
30
|
+
"@equinor/echo-cli": "0.13.11",
|
|
31
|
+
"@types/react": "18.0.27",
|
|
32
|
+
"@types/react-dom": "18.0.10",
|
|
33
|
+
"react": "18.2.0",
|
|
34
|
+
"react-dom": "18.2.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Echo - coc
|
|
4
|
+
|
|
5
|
+
This module has been bootstrapped by EchoCli.
|
|
6
|
+
|
|
7
|
+
### NPM
|
|
8
|
+
|
|
9
|
+
```sh-session
|
|
10
|
+
$ npm install @equinor/echo-module- coc --save
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
# Development
|
|
14
|
+
|
|
15
|
+
First time usage, run following command first:
|
|
16
|
+
|
|
17
|
+
```sh-session
|
|
18
|
+
$ npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
you may need to ude the legacy peer deps flag.
|
|
22
|
+
|
|
23
|
+
```sh-session
|
|
24
|
+
$ npm install --legacy-peer-deps
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### NPM build
|
|
28
|
+
|
|
29
|
+
```sh-session
|
|
30
|
+
$ npm run build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### NPM build watch
|
|
34
|
+
|
|
35
|
+
```sh-session
|
|
36
|
+
$ npm run start
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Publish
|
|
40
|
+
|
|
41
|
+
For now the only way to include a module to echo is to publish the package to npmjs.com or npm.equinor.com
|
|
42
|
+
|
|
43
|
+
For npmjs use:
|
|
44
|
+
|
|
45
|
+
```sh-session
|
|
46
|
+
$ npm run publish
|
|
47
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import EchoCore, { EchoEnv } from '@equinor/echo-core';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import style from './app.module.css';
|
|
4
|
+
|
|
5
|
+
const baseApiUrl = EchoEnv.env().REACT_APP_API_URL;
|
|
6
|
+
|
|
7
|
+
async function getVersion(): Promise<string> {
|
|
8
|
+
const data = await EchoCore.EchoClient.fetch(`${baseApiUrl}/Version`);
|
|
9
|
+
return await data.text();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const App: React.FC = (): JSX.Element => {
|
|
13
|
+
const [echoVersion, setEchoVersion] = useState('');
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
getVersion().then((version: string) => {
|
|
17
|
+
setEchoVersion(version);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className={style.wrapper}>
|
|
23
|
+
<h1>Echo App Template</h1>
|
|
24
|
+
<p>This is an app template for Echo Applications</p>
|
|
25
|
+
<h6>Echo v{echoVersion}</h6>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default App;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["src"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"noImplicitAny": false,
|
|
6
|
+
"module": "ES2015",
|
|
7
|
+
"target": "es5",
|
|
8
|
+
"lib": [
|
|
9
|
+
"esnext",
|
|
10
|
+
"dom",
|
|
11
|
+
"dom.iterable"
|
|
12
|
+
],
|
|
13
|
+
"removeComments": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"jsx": "react",
|
|
16
|
+
"allowJs": true,
|
|
17
|
+
"baseUrl": "./src",
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"downlevelIteration": true,
|
|
22
|
+
"types": ["@equinor/echo-scripts"],
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
package/lib/coc2/.env
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
Never use PROCESS.ENV/process.env use env() instead. (Except for process.env.NODE_ENV)
|
|
4
|
+
---------------------------------
|
|
5
|
+
|
|
6
|
+
Based on: https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
|
|
7
|
+
|
|
8
|
+
All variables in this files are converted to env() during build, and values here are replaced
|
|
9
|
+
by environment variables if they exists. This is done by running the env.sh bash script before the
|
|
10
|
+
build.
|
|
11
|
+
|
|
12
|
+
env.sh generates env-config.js containing all the variables, which is included in index.html,
|
|
13
|
+
and appended to Window._env_. env() is a shortcut for Window._env_ and should be used in code.
|
|
14
|
+
|
|
15
|
+
NOTE: Seems like window._env_ is not available in a worker
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
HTTPS=true
|
|
19
|
+
GENERATE_SOURCEMAP=true
|
|
20
|
+
INLINE_RUNTIME_CHUNK=false
|
|
21
|
+
WEBSITE_HOSTNAME=localhost:3000;
|
|
22
|
+
REACT_APP_DEFAULT_CACHE_LOCATION=localstorage
|
|
23
|
+
REACT_APP_API_URL=https://dt-echopedia-api-dev.azurewebsites.net
|
|
24
|
+
REACT_APP_WEB_URL=https://dt-echopedia-web-dev.azurewebsites.net
|
|
25
|
+
REACT_APP_WEB_PROD_URL=https://echo.equinor.com
|
|
26
|
+
REACT_APP_AZURE_AD_TENNANT=StatoilSRM.onmicrosoft.com
|
|
27
|
+
REACT_APP_AZURE_AD_TENNANT_ID=3aa4a235-b6e2-48d5-9195-7fcf05b459b0
|
|
28
|
+
REACT_APP_AZURE_AD_CLIENT_ID=751d2504-0b66-4b78-9807-4b60525a14c6
|
|
29
|
+
REACT_APP_API_CLIENT_ID=aef35d97-53d4-4fd0-adaf-c5a514b38436
|
|
30
|
+
REACT_APP_PROCOSYS_API_APP_ID=2d0ed80f-3013-422d-b8bd-2b8ac70b2ce1
|
|
31
|
+
REACT_APP_PROCOSYS_API_URL=https://procosyswebapitest.equinor.com/api
|
|
32
|
+
REACT_APP_APPINSIGHTS_INSTRUMENTATIONKEY=e5299075-a00d-4012-96f9-42861e8d8a9e
|
|
33
|
+
REACT_APP_AZURE_BUILD_NUMBER=0.8.dev.9
|
|
34
|
+
REACT_APP_LOGGER_ACTIVE=false
|
|
35
|
+
REACT_APP_ECHO_3D_WEB_URL=https://echo3dweb-main.equinor.com
|
|
36
|
+
REACT_APP_ECHO_3D_WEB_ENABLED=true
|
|
37
|
+
REACT_APP_ECHOMAP_WEB_URL=https://echomaps.equinor.com
|
|
38
|
+
REACT_APP_ECHOMAP_WEB_ENABLED=true
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Nx 18 enables using plugins to infer targets by default
|
|
42
|
+
# This is disabled for existing workspaces to maintain compatibility
|
|
43
|
+
# For more info, see: https://nx.dev/concepts/inferred-tasks
|
|
44
|
+
NX_ADD_PLUGINS=false
|
|
45
|
+
|
|
46
|
+
# Moved from nx.json config file: use it if we want to utilize nx cloud
|
|
47
|
+
# "nxCloudAccessToken": "NzgwMjliNDItYjk5MC00ZmIxLWE4OTktODcyOTQxNGZlZTdlfHJlYWQtd3JpdGU="
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_equinor_echo_client=self.webpackChunk_equinor_echo_client||[]).push([["vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs"],{"./node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs":(e,t,r)=>{r.r(t),r.d(t,{NestedAppAuthController:()=>l});var o=r("./node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs"),n=r("./node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.mjs"),s=r("./node_modules/@azure/msal-common/dist/utils/TimeUtils.mjs"),a=r("./node_modules/@azure/msal-browser/dist/utils/BrowserConstants.mjs"),i=r("./node_modules/@azure/msal-browser/dist/crypto/CryptoOps.mjs"),d=r("./node_modules/@azure/msal-browser/dist/naa/mapping/NestedAppAuthAdapter.mjs"),u=r("./node_modules/@azure/msal-browser/dist/error/NestedAppAuthError.mjs"),c=r("./node_modules/@azure/msal-browser/dist/event/EventHandler.mjs"),p=r("./node_modules/@azure/msal-browser/dist/event/EventType.mjs");class l{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(void 0===t)throw new Error("unexpected: bridgeProxy is undefined");this.bridgeProxy=t,this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new i.CryptoOps(this.logger,this.performanceClient):o.DEFAULT_CRYPTO_IMPLEMENTATION,this.eventHandler=new c.EventHandler(this.logger,this.browserCrypto),this.nestedAppAuthAdapter=new d.NestedAppAuthAdapter(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger)}getBrowserStorage(){throw u.NestedAppAuthError.createUnsupportedError()}getEventHandler(){return this.eventHandler}static async createController(e){const t=new l(e);return Promise.resolve(t)}initialize(){return Promise.resolve()}async acquireTokenInteractive(e){this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_START,a.InteractionType.Popup,e);const t=this.performanceClient.startMeasurement(n.PerformanceEvents.AcquireTokenPopup,e.correlationId);t?.add({nestedAppAuthRequest:!0});try{const r=this.nestedAppAuthAdapter.toNaaTokenRequest(e),o=s.nowSeconds(),n=await this.bridgeProxy.getTokenInteractive(r),i=this.nestedAppAuthAdapter.fromNaaTokenResponse(r,n,o);return this.operatingContext.setActiveAccount(i.account),this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_SUCCESS,a.InteractionType.Popup,i),t.add({accessTokenSize:i.accessToken.length,idTokenSize:i.idToken.length}),t.end({success:!0,requestId:i.requestId}),i}catch(e){const r=this.nestedAppAuthAdapter.fromBridgeError(e);throw this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_FAILURE,a.InteractionType.Popup,null,e),t.end({errorCode:r.errorCode,subErrorCode:r.subError,success:!1}),r}}async acquireTokenSilentInternal(e){this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_START,a.InteractionType.Silent,e);const t=this.performanceClient.startMeasurement(n.PerformanceEvents.SsoSilent,e.correlationId);t?.increment({visibilityChangeCount:0}),t?.add({nestedAppAuthRequest:!0});try{const r=this.nestedAppAuthAdapter.toNaaTokenRequest(e),o=s.nowSeconds(),n=await this.bridgeProxy.getTokenSilent(r),i=this.nestedAppAuthAdapter.fromNaaTokenResponse(r,n,o);return this.operatingContext.setActiveAccount(i.account),this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_SUCCESS,a.InteractionType.Silent,i),t?.add({accessTokenSize:i.accessToken.length,idTokenSize:i.idToken.length}),t?.end({success:!0,requestId:i.requestId}),i}catch(e){const r=this.nestedAppAuthAdapter.fromBridgeError(e);throw this.eventHandler.emitEvent(p.EventType.ACQUIRE_TOKEN_FAILURE,a.InteractionType.Silent,null,e),t?.end({errorCode:r.errorCode,subErrorCode:r.subError,success:!1}),r}}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw u.NestedAppAuthError.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw u.NestedAppAuthError.createUnsupportedError()}acquireTokenNative(e,t,r){throw u.NestedAppAuthError.createUnsupportedError()}acquireTokenByRefreshToken(e,t){throw u.NestedAppAuthError.createUnsupportedError()}addEventCallback(e){return this.eventHandler.addEventCallback(e)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw u.NestedAppAuthError.createUnsupportedError()}removePerformanceCallback(e){throw u.NestedAppAuthError.createUnsupportedError()}enableAccountStorageEvents(){throw u.NestedAppAuthError.createUnsupportedError()}disableAccountStorageEvents(){throw u.NestedAppAuthError.createUnsupportedError()}getAccount(e){throw u.NestedAppAuthError.createUnsupportedError()}getAccountByHomeId(e){const t=this.operatingContext.getActiveAccount();return void 0!==t&&t.homeAccountId===e?this.nestedAppAuthAdapter.fromNaaAccountInfo(t):null}getAccountByLocalId(e){const t=this.operatingContext.getActiveAccount();return void 0!==t&&t.localAccountId===e?this.nestedAppAuthAdapter.fromNaaAccountInfo(t):null}getAccountByUsername(e){const t=this.operatingContext.getActiveAccount();return void 0!==t&&t.username===e?this.nestedAppAuthAdapter.fromNaaAccountInfo(t):null}getAllAccounts(){const e=this.operatingContext.getActiveAccount();return void 0!==e?[this.nestedAppAuthAdapter.fromNaaAccountInfo(e)]:[]}handleRedirectPromise(e){throw u.NestedAppAuthError.createUnsupportedError()}loginPopup(e){if(void 0!==e)return this.acquireTokenInteractive(e);throw u.NestedAppAuthError.createUnsupportedError()}loginRedirect(e){throw u.NestedAppAuthError.createUnsupportedError()}logout(e){throw u.NestedAppAuthError.createUnsupportedError()}logoutRedirect(e){throw u.NestedAppAuthError.createUnsupportedError()}logoutPopup(e){throw u.NestedAppAuthError.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getTokenCache(){throw u.NestedAppAuthError.createUnsupportedError()}getLogger(){return this.logger}setLogger(e){this.logger=e}setActiveAccount(e){this.logger.warning("nestedAppAuth does not support setActiveAccount")}getActiveAccount(){const e=this.operatingContext.getActiveAccount();return void 0!==e?this.nestedAppAuthAdapter.fromNaaAccountInfo(e):null}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("setNavigationClient is not supported in nested app auth")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw u.NestedAppAuthError.createUnsupportedError()}getRedirectResponse(){throw u.NestedAppAuthError.createUnsupportedError()}preflightBrowserEnvironmentCheck(e,t){throw u.NestedAppAuthError.createUnsupportedError()}async clearCache(e){throw u.NestedAppAuthError.createUnsupportedError()}async hydrateCache(e,t){throw u.NestedAppAuthError.createUnsupportedError()}}},"./node_modules/@azure/msal-browser/dist/error/NestedAppAuthError.mjs":(e,t,r)=>{r.r(t),r.d(t,{NestedAppAuthError:()=>s,NestedAppAuthErrorMessage:()=>n});var o=r("./node_modules/@azure/msal-common/dist/error/AuthError.mjs");const n={unsupportedMethod:{code:"unsupported_method",desc:"The PKCE code challenge and verifier could not be generated."}};class s extends o.AuthError{constructor(e,t){super(e,t),Object.setPrototypeOf(this,s.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new s(n.unsupportedMethod.code,n.unsupportedMethod.desc)}}},"./node_modules/@azure/msal-browser/dist/naa/BridgeError.mjs":(e,t,r)=>{function o(e){return void 0!==e.status}r.r(t),r.d(t,{isBridgeError:()=>o})},"./node_modules/@azure/msal-browser/dist/naa/mapping/NestedAppAuthAdapter.mjs":(e,t,r)=>{r.r(t),r.d(t,{NestedAppAuthAdapter:()=>A});var o=r("./node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.mjs"),n=r("./node_modules/@azure/msal-common/dist/utils/StringUtils.mjs"),s=r("./node_modules/@azure/msal-common/dist/utils/Constants.mjs"),a=r("./node_modules/@azure/msal-common/dist/error/ClientAuthError.mjs"),i=r("./node_modules/@azure/msal-common/dist/error/ClientAuthErrorCodes.mjs"),d=r("./node_modules/@azure/msal-common/dist/account/AuthToken.mjs"),u=r("./node_modules/@azure/msal-common/dist/error/ServerError.mjs"),c=r("./node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.mjs"),p=r("./node_modules/@azure/msal-common/dist/error/AuthError.mjs"),l=r("./node_modules/@azure/msal-browser/dist/naa/BridgeError.mjs"),h=r("./node_modules/@azure/msal-browser/dist/naa/BridgeStatusCode.mjs");class A{constructor(e,t,r,o){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=o}toNaaTokenRequest(e){let t;t=void 0===e.extraQueryParameters?new Map:new Map(Object.entries(e.extraQueryParameters));const r=(new o.RequestParameterBuilder).addClientCapabilitiesToClaims(e.claims,this.clientCapabilities);return{platformBrokerId:e.account?.homeAccountId,clientId:this.clientId,authority:e.authority,scope:e.scopes.join(" "),correlationId:void 0!==e.correlationId?e.correlationId:this.crypto.createNewGuid(),claims:n.StringUtils.isEmptyObj(r)?void 0:r,state:e.state,authenticationScheme:e.authenticationScheme||s.AuthenticationScheme.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw(0,a.createClientAuthError)(i.nullOrEmptyToken);const o=new Date(1e3*(r+(t.token.expires_in||0))),n=d.extractTokenClaims(t.token.id_token,this.crypto.base64Decode),u=this.fromNaaAccountInfo(t.account,n),c=t.token.scope||e.scope;return{authority:t.token.authority||u.environment,uniqueId:u.localAccountId,tenantId:u.tenantId,scopes:c.split(" "),account:u,idToken:t.token.id_token,idTokenClaims:n,accessToken:t.token.access_token,fromCache:!0,expiresOn:o,tokenType:e.authenticationScheme||s.AuthenticationScheme.BEARER,correlationId:e.correlationId,extExpiresOn:o,state:e.state}}fromNaaAccountInfo(e,t){const r=t||e.idTokenClaims,o=e.localAccountId||r?.oid||r?.sub||"",n=e.tenantId||r?.tid||"",s=e.homeAccountId||`${o}.${n}`,a=e.username||r?.preferred_username||"",i=e.name||r?.name;return{homeAccountId:s,environment:e.environment,tenantId:n,username:a,localAccountId:o,name:i,idToken:e.idToken,idTokenClaims:r}}fromBridgeError(e){if(!(0,l.isBridgeError)(e))return new p.AuthError("unknown_error","An unknown error occurred");switch(e.status){case h.BridgeStatusCode.UserCancel:return new a.ClientAuthError(i.userCanceled);case h.BridgeStatusCode.NoNetwork:return new a.ClientAuthError(i.noNetworkConnectivity);case h.BridgeStatusCode.AccountUnavailable:return new a.ClientAuthError(i.noAccountFound);case h.BridgeStatusCode.Disabled:return new a.ClientAuthError(i.nestedAppAuthBridgeDisabled);case h.BridgeStatusCode.NestedAppAuthUnavailable:return new a.ClientAuthError(e.code||i.nestedAppAuthBridgeDisabled,e.description);case h.BridgeStatusCode.TransientError:case h.BridgeStatusCode.PersistentError:return new u.ServerError(e.code,e.description);case h.BridgeStatusCode.UserInteractionRequired:return new c.InteractionRequiredAuthError(e.code,e.description);default:return new p.AuthError(e.code,e.description)}}}}}]);
|
|
3
|
+
//# sourceMappingURL=vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*! ../BridgeError.mjs */
|
|
2
|
+
|
|
3
|
+
/*! ../BridgeStatusCode.mjs */
|
|
4
|
+
|
|
5
|
+
/*! ../crypto/CryptoOps.mjs */
|
|
6
|
+
|
|
7
|
+
/*! ../error/NestedAppAuthError.mjs */
|
|
8
|
+
|
|
9
|
+
/*! ../event/EventHandler.mjs */
|
|
10
|
+
|
|
11
|
+
/*! ../event/EventType.mjs */
|
|
12
|
+
|
|
13
|
+
/*! ../naa/mapping/NestedAppAuthAdapter.mjs */
|
|
14
|
+
|
|
15
|
+
/*! ../utils/BrowserConstants.mjs */
|
|
16
|
+
|
|
17
|
+
/*! @azure/msal-browser v3.10.0 2024-02-17 */
|
|
18
|
+
|
|
19
|
+
/*! @azure/msal-common */
|
|
20
|
+
|
|
21
|
+
/*!*******************************************************************!*\
|
|
22
|
+
!*** ./node_modules/@azure/msal-browser/dist/naa/BridgeError.mjs ***!
|
|
23
|
+
\*******************************************************************/
|
|
24
|
+
|
|
25
|
+
/*!****************************************************************************!*\
|
|
26
|
+
!*** ./node_modules/@azure/msal-browser/dist/error/NestedAppAuthError.mjs ***!
|
|
27
|
+
\****************************************************************************/
|
|
28
|
+
|
|
29
|
+
/*!************************************************************************************!*\
|
|
30
|
+
!*** ./node_modules/@azure/msal-browser/dist/naa/mapping/NestedAppAuthAdapter.mjs ***!
|
|
31
|
+
\************************************************************************************/
|
|
32
|
+
|
|
33
|
+
/*!***************************************************************************************!*\
|
|
34
|
+
!*** ./node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs ***!
|
|
35
|
+
\***************************************************************************************/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets/vendors-node_modules_azure_msal-browser_dist_controllers_NestedAppAuthController_mjs.67f514ed2d9b83f4a735.chunk.js","mappings":";g+BAcA,MAAMA,EACF,WAAAC,CAAYC,GACRC,KAAKD,iBAAmBA,EACxB,MAAME,EAAQD,KAAKD,iBAAiBG,iBACpC,QAAcC,IAAVF,EAIA,MAAM,IAAIG,MAAM,wCAHhBJ,KAAKK,YAAcJ,EAMvBD,KAAKM,OAASP,EAAiBQ,YAE/BP,KAAKQ,OAASR,KAAKD,iBAAiBU,YAEpCT,KAAKU,kBAAoBV,KAAKM,OAAOK,UAAUC,OAE/CZ,KAAKa,cAAgBd,EAAiBe,uBAChC,IAAI,EAAAC,UAAUf,KAAKQ,OAAQR,KAAKU,mBAChC,EAAAM,8BACNhB,KAAKiB,aAAe,IAAI,EAAAC,aAAalB,KAAKQ,OAAQR,KAAKa,eACvDb,KAAKmB,qBAAuB,IAAI,EAAAC,qBAAqBpB,KAAKM,OAAOe,KAAKC,SAAUtB,KAAKM,OAAOe,KAAKE,mBAAoBvB,KAAKa,cAAeb,KAAKQ,OAClJ,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IAAI,EAAAC,gBAAgB,gBAC/B,KAAK,EAAAF,iBAAiBG,UAClB,OAAO,IAAI,EAAAD,gBAAgB,yBAC/B,KAAK,EAAAF,iBAAiBI,mBAClB,OAAO,IAAI,EAAAF,gBAAgB,kBAC/B,KAAK,EAAAF,iBAAiBK,SAClB,OAAO,IAAI,EAAAH,gBAAgB,+BAC/B,KAAK,EAAAF,iBAAiBM,yBAClB,OAAO,IAAI,EAAAJ,gBAAgBlI,EAAM0E,MAC7B,8BAAkD1E,EAAMuI,aAChE,KAAK,EAAAP,iBAAiBQ,eACtB,KAAK,EAAAR,iBAAiBS,gBAClB,OAAO,IAAI,EAAAC,YAAY1I,EAAM0E,KAAM1E,EAAMuI,aAC7C,KAAK,EAAAP,iBAAiBW,wBAClB,OAAO,IAAI,EAAAC,6BAA6B5I,EAAM0E,KAAM1E,EAAMuI,aAC9D,QACI,OAAO,IAAI,EAAA3D,UAAU5E,EAAM0E,KAAM1E,EAAMuI,aAMvD","sources":["webpack://@equinor/echo-client/./node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs","webpack://@equinor/echo-client/./node_modules/@azure/msal-browser/dist/error/NestedAppAuthError.mjs","webpack://@equinor/echo-client/./node_modules/@azure/msal-browser/dist/naa/BridgeError.mjs","webpack://@equinor/echo-client/./node_modules/@azure/msal-browser/dist/naa/mapping/NestedAppAuthAdapter.mjs"],"sourcesContent":["/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, PerformanceEvents, TimeUtils } from '@azure/msal-common';\nimport { InteractionType } from '../utils/BrowserConstants.mjs';\nimport { CryptoOps } from '../crypto/CryptoOps.mjs';\nimport { NestedAppAuthAdapter } from '../naa/mapping/NestedAppAuthAdapter.mjs';\nimport { NestedAppAuthError } from '../error/NestedAppAuthError.mjs';\nimport { EventHandler } from '../event/EventHandler.mjs';\nimport { EventType } from '../event/EventType.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass NestedAppAuthController {\n constructor(operatingContext) {\n this.operatingContext = operatingContext;\n const proxy = this.operatingContext.getBridgeProxy();\n if (proxy !== undefined) {\n this.bridgeProxy = proxy;\n }\n else {\n throw new Error(\"unexpected: bridgeProxy is undefined\");\n }\n // Set the configuration.\n this.config = operatingContext.getConfig();\n // Initialize logger\n this.logger = this.operatingContext.getLogger();\n // Initialize performance client\n this.performanceClient = this.config.telemetry.client;\n // Initialize the crypto class.\n this.browserCrypto = operatingContext.isBrowserEnvironment()\n ? new CryptoOps(this.logger, this.performanceClient)\n : DEFAULT_CRYPTO_IMPLEMENTATION;\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);\n }\n getBrowserStorage() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n getEventHandler() {\n return this.eventHandler;\n }\n static async createController(operatingContext) {\n const controller = new NestedAppAuthController(operatingContext);\n return Promise.resolve(controller);\n }\n initialize() {\n // do nothing not required by this controller\n return Promise.resolve();\n }\n async acquireTokenInteractive(request) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, request.correlationId);\n atPopupMeasurement?.add({ nestedAppAuthRequest: true });\n try {\n const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.bridgeProxy.getTokenInteractive(naaRequest);\n const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);\n this.operatingContext.setActiveAccount(result.account);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n atPopupMeasurement.add({\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n });\n atPopupMeasurement.end({\n success: true,\n requestId: result.requestId,\n });\n return result;\n }\n catch (e) {\n const error = this.nestedAppAuthAdapter.fromBridgeError(e);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n atPopupMeasurement.end({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false,\n });\n throw error;\n }\n }\n async acquireTokenSilentInternal(request) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\n const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, request.correlationId);\n ssoSilentMeasurement?.increment({\n visibilityChangeCount: 0,\n });\n ssoSilentMeasurement?.add({\n nestedAppAuthRequest: true,\n });\n try {\n const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(request);\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.bridgeProxy.getTokenSilent(naaRequest);\n const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);\n this.operatingContext.setActiveAccount(result.account);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);\n ssoSilentMeasurement?.add({\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n });\n ssoSilentMeasurement?.end({\n success: true,\n requestId: result.requestId,\n });\n return result;\n }\n catch (e) {\n const error = this.nestedAppAuthAdapter.fromBridgeError(e);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, e);\n ssoSilentMeasurement?.end({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false,\n });\n throw error;\n }\n }\n async acquireTokenPopup(request) {\n return this.acquireTokenInteractive(request);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n acquireTokenRedirect(request) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n async acquireTokenSilent(silentRequest) {\n return this.acquireTokenSilentInternal(silentRequest);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n acquireTokenByCode(request // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n acquireTokenNative(request, apiId, // eslint-disable-line @typescript-eslint/no-unused-vars\n accountId // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n acquireTokenByRefreshToken(commonRequest, // eslint-disable-line @typescript-eslint/no-unused-vars\n silentRequest // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback) {\n return this.eventHandler.addEventCallback(callback);\n }\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId) {\n this.eventHandler.removeEventCallback(callbackId);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n addPerformanceCallback(callback) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n removePerformanceCallback(callbackId) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n enableAccountStorageEvents() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n disableAccountStorageEvents() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getAccount(accountFilter) {\n throw NestedAppAuthError.createUnsupportedError();\n // TODO: Look at standard implementation\n }\n getAccountByHomeId(homeAccountId) {\n const currentAccount = this.operatingContext.getActiveAccount();\n if (currentAccount !== undefined) {\n if (currentAccount.homeAccountId === homeAccountId) {\n return this.nestedAppAuthAdapter.fromNaaAccountInfo(currentAccount);\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n }\n getAccountByLocalId(localId) {\n const currentAccount = this.operatingContext.getActiveAccount();\n if (currentAccount !== undefined) {\n if (currentAccount.localAccountId === localId) {\n return this.nestedAppAuthAdapter.fromNaaAccountInfo(currentAccount);\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n }\n getAccountByUsername(userName) {\n const currentAccount = this.operatingContext.getActiveAccount();\n if (currentAccount !== undefined) {\n if (currentAccount.username === userName) {\n return this.nestedAppAuthAdapter.fromNaaAccountInfo(currentAccount);\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n }\n getAllAccounts() {\n const currentAccount = this.operatingContext.getActiveAccount();\n if (currentAccount !== undefined) {\n return [\n this.nestedAppAuthAdapter.fromNaaAccountInfo(currentAccount),\n ];\n }\n else {\n return [];\n }\n }\n handleRedirectPromise(hash // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n loginPopup(request // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n if (request !== undefined) {\n return this.acquireTokenInteractive(request);\n }\n else {\n throw NestedAppAuthError.createUnsupportedError();\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n loginRedirect(request) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n logout(logoutRequest) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n logoutRedirect(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n logoutPopup(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n ssoSilent(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n request) {\n return this.acquireTokenSilentInternal(request);\n }\n getTokenCache() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n /**\n * Returns the logger instance\n */\n getLogger() {\n return this.logger;\n }\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger) {\n this.logger = logger;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setActiveAccount(account) {\n /*\n * StandardController uses this to allow the developer to set the active account\n * in the nested app auth scenario the active account is controlled by the app hosting the nested app\n */\n this.logger.warning(\"nestedAppAuth does not support setActiveAccount\");\n return;\n }\n getActiveAccount() {\n const currentAccount = this.operatingContext.getActiveAccount();\n if (currentAccount !== undefined) {\n return this.nestedAppAuthAdapter.fromNaaAccountInfo(currentAccount);\n }\n else {\n return null;\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n initializeWrapperLibrary(sku, version) {\n /*\n * Standard controller uses this to set the sku and version of the wrapper library in the storage\n * we do nothing here\n */\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setNavigationClient(navigationClient) {\n this.logger.warning(\"setNavigationClient is not supported in nested app auth\");\n }\n getConfiguration() {\n return this.config;\n }\n isBrowserEnv() {\n return this.operatingContext.isBrowserEnvironment();\n }\n getBrowserCrypto() {\n return this.browserCrypto;\n }\n getPerformanceClient() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n getRedirectResponse() {\n throw NestedAppAuthError.createUnsupportedError();\n }\n preflightBrowserEnvironmentCheck(interactionType, // eslint-disable-line @typescript-eslint/no-unused-vars\n setInteractionInProgress // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async clearCache(logoutRequest) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async hydrateCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n result, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n request) {\n throw NestedAppAuthError.createUnsupportedError();\n }\n}\n\nexport { NestedAppAuthController };\n//# sourceMappingURL=NestedAppAuthController.mjs.map\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AuthError } from '@azure/msal-common';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * NestedAppAuthErrorMessage class containing string constants used by error codes and messages.\n */\nconst NestedAppAuthErrorMessage = {\n unsupportedMethod: {\n code: \"unsupported_method\",\n desc: \"The PKCE code challenge and verifier could not be generated.\",\n },\n};\nclass NestedAppAuthError extends AuthError {\n constructor(errorCode, errorMessage) {\n super(errorCode, errorMessage);\n Object.setPrototypeOf(this, NestedAppAuthError.prototype);\n this.name = \"NestedAppAuthError\";\n }\n static createUnsupportedError() {\n return new NestedAppAuthError(NestedAppAuthErrorMessage.unsupportedMethod.code, NestedAppAuthErrorMessage.unsupportedMethod.desc);\n }\n}\n\nexport { NestedAppAuthError, NestedAppAuthErrorMessage };\n//# sourceMappingURL=NestedAppAuthError.mjs.map\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nfunction isBridgeError(error) {\n return error.status !== undefined;\n}\n\nexport { isBridgeError };\n//# sourceMappingURL=BridgeError.mjs.map\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { RequestParameterBuilder, StringUtils, AuthenticationScheme, createClientAuthError, ClientAuthErrorCodes, AuthToken, AuthError, InteractionRequiredAuthError, ServerError, ClientAuthError } from '@azure/msal-common';\nimport { isBridgeError } from '../BridgeError.mjs';\nimport { BridgeStatusCode } from '../BridgeStatusCode.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass NestedAppAuthAdapter {\n constructor(clientId, clientCapabilities, crypto, logger) {\n this.clientId = clientId;\n this.clientCapabilities = clientCapabilities;\n this.crypto = crypto;\n this.logger = logger;\n }\n toNaaTokenRequest(request) {\n let extraParams;\n if (request.extraQueryParameters === undefined) {\n extraParams = new Map();\n }\n else {\n extraParams = new Map(Object.entries(request.extraQueryParameters));\n }\n const requestBuilder = new RequestParameterBuilder();\n const claims = requestBuilder.addClientCapabilitiesToClaims(request.claims, this.clientCapabilities);\n const tokenRequest = {\n platformBrokerId: request.account?.homeAccountId,\n clientId: this.clientId,\n authority: request.authority,\n scope: request.scopes.join(\" \"),\n correlationId: request.correlationId !== undefined\n ? request.correlationId\n : this.crypto.createNewGuid(),\n claims: !StringUtils.isEmptyObj(claims) ? claims : undefined,\n state: request.state,\n authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,\n extraParameters: extraParams,\n };\n return tokenRequest;\n }\n fromNaaTokenResponse(request, response, reqTimestamp) {\n if (!response.token.id_token || !response.token.access_token) {\n throw createClientAuthError(ClientAuthErrorCodes.nullOrEmptyToken);\n }\n const expiresOn = new Date((reqTimestamp + (response.token.expires_in || 0)) * 1000);\n const idTokenClaims = AuthToken.extractTokenClaims(response.token.id_token, this.crypto.base64Decode);\n const account = this.fromNaaAccountInfo(response.account, idTokenClaims);\n const scopes = response.token.scope || request.scope;\n const authenticationResult = {\n authority: response.token.authority || account.environment,\n uniqueId: account.localAccountId,\n tenantId: account.tenantId,\n scopes: scopes.split(\" \"),\n account,\n idToken: response.token.id_token,\n idTokenClaims,\n accessToken: response.token.access_token,\n fromCache: true,\n expiresOn: expiresOn,\n tokenType: request.authenticationScheme || AuthenticationScheme.BEARER,\n correlationId: request.correlationId,\n extExpiresOn: expiresOn,\n state: request.state,\n };\n return authenticationResult;\n }\n /*\n * export type AccountInfo = {\n * homeAccountId: string;\n * environment: string;\n * tenantId: string;\n * username: string;\n * localAccountId: string;\n * name?: string;\n * idToken?: string;\n * idTokenClaims?: TokenClaims & {\n * [key: string]:\n * | string\n * | number\n * | string[]\n * | object\n * | undefined\n * | unknown;\n * };\n * nativeAccountId?: string;\n * authorityType?: string;\n * };\n */\n fromNaaAccountInfo(fromAccount, idTokenClaims) {\n const effectiveIdTokenClaims = idTokenClaims || fromAccount.idTokenClaims;\n const localAccountId = fromAccount.localAccountId ||\n effectiveIdTokenClaims?.oid ||\n effectiveIdTokenClaims?.sub ||\n \"\";\n const tenantId = fromAccount.tenantId || effectiveIdTokenClaims?.tid || \"\";\n const homeAccountId = fromAccount.homeAccountId || `${localAccountId}.${tenantId}`;\n const username = fromAccount.username ||\n effectiveIdTokenClaims?.preferred_username ||\n \"\";\n const name = fromAccount.name || effectiveIdTokenClaims?.name;\n const account = {\n homeAccountId,\n environment: fromAccount.environment,\n tenantId,\n username,\n localAccountId,\n name,\n idToken: fromAccount.idToken,\n idTokenClaims: effectiveIdTokenClaims,\n };\n return account;\n }\n /**\n *\n * @param error BridgeError\n * @returns AuthError, ClientAuthError, ClientConfigurationError, ServerError, InteractionRequiredError\n */\n fromBridgeError(error) {\n if (isBridgeError(error)) {\n switch (error.status) {\n case BridgeStatusCode.UserCancel:\n return new ClientAuthError(ClientAuthErrorCodes.userCanceled);\n case BridgeStatusCode.NoNetwork:\n return new ClientAuthError(ClientAuthErrorCodes.noNetworkConnectivity);\n case BridgeStatusCode.AccountUnavailable:\n return new ClientAuthError(ClientAuthErrorCodes.noAccountFound);\n case BridgeStatusCode.Disabled:\n return new ClientAuthError(ClientAuthErrorCodes.nestedAppAuthBridgeDisabled);\n case BridgeStatusCode.NestedAppAuthUnavailable:\n return new ClientAuthError(error.code ||\n ClientAuthErrorCodes.nestedAppAuthBridgeDisabled, error.description);\n case BridgeStatusCode.TransientError:\n case BridgeStatusCode.PersistentError:\n return new ServerError(error.code, error.description);\n case BridgeStatusCode.UserInteractionRequired:\n return new InteractionRequiredAuthError(error.code, error.description);\n default:\n return new AuthError(error.code, error.description);\n }\n }\n else {\n return new AuthError(\"unknown_error\", \"An unknown error occurred\");\n }\n }\n}\n\nexport { NestedAppAuthAdapter };\n//# sourceMappingURL=NestedAppAuthAdapter.mjs.map\n"],"names":["NestedAppAuthController","constructor","operatingContext","this","proxy","getBridgeProxy","undefined","Error","bridgeProxy","config","getConfig","logger","getLogger","performanceClient","telemetry","client","browserCrypto","isBrowserEnvironment","CryptoOps","DEFAULT_CRYPTO_IMPLEMENTATION","eventHandler","EventHandler","nestedAppAuthAdapter","NestedAppAuthAdapter","auth","clientId","clientCapabilities","getBrowserStorage","NestedAppAuthError","createUnsupportedError","getEventHandler","createController","controller","Promise","resolve","initialize","acquireTokenInteractive","request","emitEvent","EventType","ACQUIRE_TOKEN_START","InteractionType","Popup","atPopupMeasurement","startMeasurement","PerformanceEvents","AcquireTokenPopup","correlationId","add","nestedAppAuthRequest","naaRequest","toNaaTokenRequest","reqTimestamp","response","getTokenInteractive","result","fromNaaTokenResponse","setActiveAccount","account","ACQUIRE_TOKEN_SUCCESS","accessTokenSize","accessToken","length","idTokenSize","idToken","end","success","requestId","e","error","fromBridgeError","ACQUIRE_TOKEN_FAILURE","errorCode","subErrorCode","subError","acquireTokenSilentInternal","Silent","ssoSilentMeasurement","SsoSilent","increment","visibilityChangeCount","getTokenSilent","acquireTokenPopup","acquireTokenRedirect","acquireTokenSilent","silentRequest","acquireTokenByCode","acquireTokenNative","apiId","accountId","acquireTokenByRefreshToken","commonRequest","addEventCallback","callback","removeEventCallback","callbackId","addPerformanceCallback","removePerformanceCallback","enableAccountStorageEvents","disableAccountStorageEvents","getAccount","accountFilter","getAccountByHomeId","homeAccountId","currentAccount","getActiveAccount","fromNaaAccountInfo","getAccountByLocalId","localId","localAccountId","getAccountByUsername","userName","username","getAllAccounts","handleRedirectPromise","hash","loginPopup","loginRedirect","logout","logoutRequest","logoutRedirect","logoutPopup","ssoSilent","getTokenCache","setLogger","warning","initializeWrapperLibrary","sku","version","setNavigationClient","navigationClient","getConfiguration","isBrowserEnv","getBrowserCrypto","getPerformanceClient","getRedirectResponse","preflightBrowserEnvironmentCheck","interactionType","setInteractionInProgress","clearCache","hydrateCache","NestedAppAuthErrorMessage","unsupportedMethod","code","desc","AuthError","errorMessage","super","Object","setPrototypeOf","prototype","name","isBridgeError","status","crypto","extraParams","extraQueryParameters","Map","entries","claims","RequestParameterBuilder","addClientCapabilitiesToClaims","platformBrokerId","authority","scope","scopes","join","createNewGuid","StringUtils","isEmptyObj","state","authenticationScheme","AuthenticationScheme","BEARER","extraParameters","token","id_token","access_token","createClientAuthError","expiresOn","Date","expires_in","idTokenClaims","base64Decode","environment","uniqueId","tenantId","split","fromCache","tokenType","extExpiresOn","fromAccount","effectiveIdTokenClaims","oid","sub","tid","preferred_username","BridgeStatusCode","UserCancel","ClientAuthError","NoNetwork","AccountUnavailable","Disabled","NestedAppAuthUnavailable","description","TransientError","PersistentError","ServerError","UserInteractionRequired","InteractionRequiredAuthError"],"sourceRoot":""}
|
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
body {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
margin: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.highlightedText {
|
|
7
|
+
background: yellow;
|
|
8
|
+
color: black;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
#rootloading {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
color: #ff1243;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
text-align: center;
|
|
19
|
+
position: absolute;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.loaderContainer {
|
|
25
|
+
margin: 8px auto;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
padding-top: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.productLogo {
|
|
32
|
+
flex: 1;
|
|
33
|
+
margin-bottom: 4rem;
|
|
34
|
+
text-align: left;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.productLogoImg {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
vertical-align: baseline;
|
|
40
|
+
width: 122px;
|
|
41
|
+
animation: fadeIn 0.5s;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.equinorLogo {
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
display: inline-block;
|
|
47
|
+
vertical-align: baseline;
|
|
48
|
+
width: 64px;
|
|
49
|
+
height: 64px;
|
|
50
|
+
animation: fadeIn 0.5s;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes fadeIn {
|
|
54
|
+
0% {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
100% {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<script type="application/javascript" src="./env-config.js"></script>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
+
<meta
|
|
8
|
+
name="viewport"
|
|
9
|
+
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"
|
|
10
|
+
/>
|
|
11
|
+
<link href="./index.css" rel="stylesheet" />
|
|
12
|
+
<link rel="stylesheet" href="https://cdn.eds.equinor.com/font/equinor-font.css" />
|
|
13
|
+
<link rel="preconnect" href="https://login.microsoftonline.com" />
|
|
14
|
+
<link rel="preconnect" href="https://dc.services.visualstudio.com" />
|
|
15
|
+
<link rel="preconnect" href="https://cdn.eds.equinor.com" />
|
|
16
|
+
<title>Echo | Development</title>
|
|
17
|
+
<script defer src="/vendors-node_modules_react-dom_client_js-node_modules_babel_polyfill_lib_index_js-node_module-cb4c76.echo.bundle.js"></script><script defer src="/main.echo.bundle.js"></script></head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="root"></div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
|
|
2
|
+
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
3
|
+
(function(g,f){function define(d, f){typeof document !== "undefined" && (document.currentScript.module = {});f(document.currentScript.module, ...d.filter((d) => d !== "exports").map(window["echoDepLoader"]));}define.amd = !0;typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('@equinor/echo-core'),require('react')):typeof define==='function'&&define.amd?define(['exports','@equinor/echo-core','react'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g["echo-module"]={},g[">= 0"]["9"]["8 < 0"]["10"]["0"],g[">= 17"]["0"]["2"]));})(this,(function(exports,EchoCore,React){'use strict';/******************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
21
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function __generator(thisArg, body) {
|
|
31
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
+
function step(op) {
|
|
35
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
+
switch (op[0]) {
|
|
40
|
+
case 0: case 1: t = op; break;
|
|
41
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
+
default:
|
|
45
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
+
if (t[2]) _.ops.pop();
|
|
50
|
+
_.trys.pop(); continue;
|
|
51
|
+
}
|
|
52
|
+
op = body.call(thisArg, _);
|
|
53
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function __read(o, n) {
|
|
59
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
60
|
+
if (!m) return o;
|
|
61
|
+
var i = m.call(o), r, ar = [], e;
|
|
62
|
+
try {
|
|
63
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
64
|
+
}
|
|
65
|
+
catch (error) { e = { error: error }; }
|
|
66
|
+
finally {
|
|
67
|
+
try {
|
|
68
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
69
|
+
}
|
|
70
|
+
finally { if (e) throw e.error; }
|
|
71
|
+
}
|
|
72
|
+
return ar;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
76
|
+
var e = new Error(message);
|
|
77
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
78
|
+
};function styleInject(css, ref) {
|
|
79
|
+
if ( ref === void 0 ) ref = {};
|
|
80
|
+
var insertAt = ref.insertAt;
|
|
81
|
+
|
|
82
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
83
|
+
|
|
84
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
85
|
+
var style = document.createElement('style');
|
|
86
|
+
style.type = 'text/css';
|
|
87
|
+
|
|
88
|
+
if (insertAt === 'top') {
|
|
89
|
+
if (head.firstChild) {
|
|
90
|
+
head.insertBefore(style, head.firstChild);
|
|
91
|
+
} else {
|
|
92
|
+
head.appendChild(style);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
head.appendChild(style);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (style.styleSheet) {
|
|
99
|
+
style.styleSheet.cssText = css;
|
|
100
|
+
} else {
|
|
101
|
+
style.appendChild(document.createTextNode(css));
|
|
102
|
+
}
|
|
103
|
+
}var css_248z = ".app-module_wrapper__-eXbe{margin-top:150px;padding:16px;text-align:center}";
|
|
104
|
+
var style = {"wrapper":"app-module_wrapper__-eXbe"};
|
|
105
|
+
styleInject(css_248z);var baseApiUrl = EchoCore.EchoEnv.env().REACT_APP_API_URL;
|
|
106
|
+
function getVersion() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var data;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
return [4, EchoCore.EchoClient.fetch("".concat(baseApiUrl, "/Version"))];
|
|
113
|
+
case 1:
|
|
114
|
+
data = _a.sent();
|
|
115
|
+
return [4, data.text()];
|
|
116
|
+
case 2:
|
|
117
|
+
return [2, _a.sent()];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
var App = function App() {
|
|
123
|
+
var _a = __read(React.useState(''), 2),
|
|
124
|
+
echoVersion = _a[0],
|
|
125
|
+
setEchoVersion = _a[1];
|
|
126
|
+
React.useEffect(function () {
|
|
127
|
+
getVersion().then(function (version) {
|
|
128
|
+
setEchoVersion(version);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: style.wrapper
|
|
133
|
+
}, /*#__PURE__*/React.createElement("h1", null, "Echo App Template"), /*#__PURE__*/React.createElement("p", null, "This is an app template for Echo Applications"), /*#__PURE__*/React.createElement("h6", null, "Echo v", echoVersion));
|
|
134
|
+
};function setup(api) {
|
|
135
|
+
api.registerApp(App);
|
|
136
|
+
}exports.setup=setup;}));//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/app.tsx","../src/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import EchoCore, { EchoEnv } from '@equinor/echo-core';\r\nimport React, { useEffect, useState } from 'react';\r\nimport style from './app.module.css';\r\n\r\nconst baseApiUrl = EchoEnv.env().REACT_APP_API_URL;\r\n\r\nasync function getVersion(): Promise<string> {\r\n const data = await EchoCore.EchoClient.fetch(`${baseApiUrl}/Version`);\r\n return await data.text();\r\n}\r\n\r\nconst App: React.FC = (): JSX.Element => {\r\n const [echoVersion, setEchoVersion] = useState('');\r\n\r\n useEffect(() => {\r\n getVersion().then((version: string) => {\r\n setEchoVersion(version);\r\n });\r\n });\r\n\r\n return (\r\n <div className={style.wrapper}>\r\n <h1>Echo App Template</h1>\r\n <p>This is an app template for Echo Applications</p>\r\n <h6>Echo v{echoVersion}</h6>\r\n </div>\r\n );\r\n};\r\n\r\nexport default App;\r\n","import { EchoModuleApi } from '@equinor/echo-core';\r\nimport App from './app';\r\n\r\nexport function setup(api: EchoModuleApi): void {\r\n api.registerApp(App);\r\n}\r\n"],"names":["baseApiUrl","EchoEnv","env","REACT_APP_API_URL","getVersion","EchoCore","EchoClient","fetch","concat","data","_a","sent","text","App","__read","useState","echoVersion","setEchoVersion","useEffect","then","version","React","createElement","className","style","wrapper","setup","api","registerApp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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