diff --git a/bun.lockb b/bun.lockb index 11a0b2e..7e2fbc0 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b8b57ac..2cc918c 100644 --- a/package.json +++ b/package.json @@ -48,11 +48,6 @@ "last 1 safari version" ] }, - "dependencies": { - "@azure/msal-browser": "3.26.1", - "@azure/msal-react": "2.1.1", - "jwt-decode": "^4.0.0" - }, "devDependencies": { "@faker-js/faker": "^9.0.3", "@rollup/plugin-commonjs": "^28.0.1", @@ -113,14 +108,10 @@ "vitest": "^2.1.3" }, "peerDependencies": { - "@equinor/eds-core-react": "*", - "@equinor/eds-icons": "*", "@tanstack/react-query": "*", - "framer-motion": "*", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router": "^6.11.1", - "react-router-dom": "^6.11.1", - "styled-components": "^6.1.8" + "react-router-dom": "^6.11.1" } } diff --git a/src/api/core/OpenAPI.ts b/src/api/core/OpenAPI.ts index df69708..3baf09a 100644 --- a/src/api/core/OpenAPI.ts +++ b/src/api/core/OpenAPI.ts @@ -54,6 +54,28 @@ export class TokenService { url: '/api/v1/Token/AmplifyPortal/Production', }); } + + /** + * @returns string Success + * @throws ApiError + */ + public static getSamPortalToken(): CancelablePromise { + return __request(OpenAPI_APP, { + method: 'GET', + url: '/api/v1/Token/SamPortal', + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static getSamPortalProductionToken(): CancelablePromise { + return __request(OpenAPI_APP, { + method: 'GET', + url: '/api/v1/Token/SamPortal/Production', + }); + } } const isJwtTokenExpired = (token: string) => { @@ -99,7 +121,7 @@ const getJSEmbarkProdToken = async () => { }; export const getSAMToken = async (): Promise => { - return getToken(`sam-${environmentName}`, TokenService.getAmplifyPortalToken); + return getToken(`sam-${environmentName}`, TokenService.getSamPortalToken); }; const getSAMProdToken = async () => { diff --git a/src/api/index.ts b/src/api/index.ts index cdee96d..5e1d959 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -4,7 +4,7 @@ /* eslint-disable */ export { ApiError } from './core/ApiError'; export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI_APP, getJSEmbarkToken } from './core/OpenAPI'; +export { OpenAPI_APP, getJSEmbarkToken, getSAMToken } from './core/OpenAPI'; export { request } from './core/request'; export type { OpenAPIConfig } from './core/OpenAPI'; diff --git a/src/providers/providers.stories.tsx b/src/providers/providers.stories.tsx index 4bfc4a9..6aed16b 100644 --- a/src/providers/providers.stories.tsx +++ b/src/providers/providers.stories.tsx @@ -1,18 +1,8 @@ -import { Typography } from '@equinor/eds-core-react'; import { Meta } from '@storybook/react'; import styled from 'styled-components'; const providersList = [ - { - name: 'AuthProvider', - body: 'MSAL authentication provider', - code: ` - {children} -`, - }, { name: 'TutorialStepsProvider', body: 'Provider needed to use tutorial hook', @@ -64,14 +54,14 @@ const Divider = styled.hr` export const Docs = () => (
- List of all providers +

List of all providers

{providersList.map((provider) => (
- {provider.name}- - {provider.body} +

{provider.name}

- +

{provider.body}

{provider.code}