@equinor/subsurface-app-management 1.1.21 → 2.0.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/dist/api/core/OpenAPI.d.ts +16 -3
- package/dist/api/core/OpenAPI.js +1 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/models/MyFeatureDto.d.ts +3 -0
- package/dist/api/services/AmplifyApplicationService.js +1 -1
- package/dist/api/services/FeatureToggleService.d.ts +4 -4
- package/dist/api/services/FeatureToggleService.js +1 -1
- package/dist/api/services/ImpersonateUserService.js +1 -1
- package/dist/api/services/ReleaseNotesService.d.ts +7 -0
- package/dist/api/services/ReleaseNotesService.js +1 -1
- package/dist/api/services/ServiceNowService.js +1 -1
- package/dist/api/services/SlackService.js +1 -1
- package/dist/api/services/TutorialService.js +1 -1
- package/dist/components/Feature/Feature.d.ts +4 -5
- package/dist/components/Feature/Feature.js +1 -1
- package/dist/components/FeatureRoute/FeatureRoute.d.ts +12 -0
- package/dist/components/FeatureRoute/FeatureRoute.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/constants/queryKeys.d.ts +1 -0
- package/dist/constants/queryKeys.js +1 -1
- package/dist/hooks/useFeatureToggling.d.ts +8 -5
- package/dist/hooks/useFeatureToggling.js +1 -1
- package/dist/hooks/useReleaseNotesQuery.js +1 -1
- package/dist/index.js +1 -1
- package/dist/providers/FeatureToggleProvider.d.ts +3 -5
- package/dist/providers/FeatureToggleProvider.js +1 -1
- package/dist/providers/TutorialProvider/TutorialProvider.styles.d.ts +3 -5
- package/dist/tests/test-utils.d.ts +2 -1
- package/dist/types/ReleaseNotes.d.ts +3 -5
- package/package.json +46 -49
|
@@ -24,9 +24,22 @@ export declare class TokenService {
|
|
|
24
24
|
* @throws ApiError
|
|
25
25
|
*/
|
|
26
26
|
static getAmplifyPortalProductionToken(): CancelablePromise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* @returns string Success
|
|
29
|
+
* @throws ApiError
|
|
30
|
+
*/
|
|
31
|
+
static getSamPortalToken(): CancelablePromise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* @returns string Success
|
|
34
|
+
* @throws ApiError
|
|
35
|
+
*/
|
|
36
|
+
static getSamPortalProductionToken(): CancelablePromise<string>;
|
|
27
37
|
}
|
|
28
|
-
export declare const
|
|
38
|
+
export declare const getJSEmbarkToken: () => Promise<string>;
|
|
39
|
+
export declare const getSAMToken: () => Promise<string>;
|
|
40
|
+
export declare const OpenAPI_APP: OpenAPIConfig;
|
|
41
|
+
export declare const OpenAPI_JSEMBARK: OpenAPIConfig;
|
|
42
|
+
export declare const OpenAPI_JSEMBARK_Prod: OpenAPIConfig;
|
|
29
43
|
export declare const OpenAPI_SAM: OpenAPIConfig;
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const OpenAPI_Portal_Prod: OpenAPIConfig;
|
|
44
|
+
export declare const OpenAPI_SAM_Prod: OpenAPIConfig;
|
|
32
45
|
export {};
|
package/dist/api/core/OpenAPI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"../../utils/environment.js";import{request as t}from"./request.js";import{getLocalStorage as i,updateLocalStorage as r}from"../../utils/localStorage.js";import{jwtDecode as
|
|
1
|
+
import*as o from"../../utils/environment.js";import{request as t}from"./request.js";import{getLocalStorage as i,updateLocalStorage as r}from"../../utils/localStorage.js";import{jwtDecode as E}from"jwt-decode";const{getEnvironmentName:e,getApiUrl:a}=o,n=e(import.meta.env.VITE_ENVIRONMENT_NAME),d="localhost"===n?"development":n;class l{static getAmplifyPortalToken(){return t(p,{method:"GET",url:"/api/v1/Token/AmplifyPortal"})}static getAmplifyPortalProductionToken(){return t(p,{method:"GET",url:"/api/v1/Token/AmplifyPortal/Production"})}static getSamPortalToken(){return t(p,{method:"GET",url:"/api/v1/Token/SamPortal"})}static getSamPortalProductionToken(){return t(p,{method:"GET",url:"/api/v1/Token/SamPortal/Production"})}}const S=o=>{if(0===o.length)return!1;try{return!(o=>{const t=E(o),i=(new Date).getTime()/1e3;return t.exp&&i>t.exp})(o)}catch(o){return!1}},m=async(o,t)=>{const E=i(o,"");if(S(E))return E;const e=await t();return r(o,e),e},A=async()=>m(`amplify-portal-${n}`,l.getAmplifyPortalToken),T=async()=>m(`sam-${n}`,l.getSamPortalToken),p={BASE:a(import.meta.env.VITE_API_URL),VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},c={BASE:`https://api-amplify-portal-${d}.radix.equinor.com`,VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:A,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},u={BASE:"https://api-amplify-portal-production.radix.equinor.com",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:async()=>m("amplify-portal-production",l.getAmplifyPortalProductionToken),USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},N={BASE:`https://api-sam-backend-${d}.radix.equinor.com`,VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:T,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},s={BASE:"https://api-sam-backend-production.radix.equinor.com",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:async()=>m("sam-production",l.getAmplifyPortalProductionToken),USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};export{p as OpenAPI_APP,c as OpenAPI_JSEMBARK,u as OpenAPI_JSEMBARK_Prod,N as OpenAPI_SAM,s as OpenAPI_SAM_Prod,l as TokenService,A as getJSEmbarkToken,T as getSAMToken};
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ApiError } from './core/ApiError';
|
|
2
2
|
export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
|
3
|
-
export {
|
|
3
|
+
export { OpenAPI_APP, getJSEmbarkToken, getSAMToken } from './core/OpenAPI';
|
|
4
4
|
export { request } from './core/request';
|
|
5
5
|
export type { OpenAPIConfig } from './core/OpenAPI';
|
|
6
6
|
export type { AmplifyApplication } from './models/AmplifyApplication';
|
|
@@ -19,6 +19,7 @@ export { ServiceNowUrgency } from './models/ServiceNowUrgency';
|
|
|
19
19
|
export type { Step } from './models/Step';
|
|
20
20
|
export type { Tutorial } from './models/Tutorial';
|
|
21
21
|
export { TutorialPosition } from './models/TutorialPosition';
|
|
22
|
+
export type { MyFeatureDto } from './models/MyFeatureDto';
|
|
22
23
|
export { AmplifyApplicationService } from './services/AmplifyApplicationService';
|
|
23
24
|
export { FeatureToggleService } from './services/FeatureToggleService';
|
|
24
25
|
export { ImpersonateUserService } from './services/ImpersonateUserService';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_JSEMBARK_Prod as p,OpenAPI_JSEMBARK as r}from"../core/OpenAPI.js";import{request as i}from"../core/request.js";class t{static userApplications(){return i(p,{method:"GET",url:"/api/v1/AmplifyApplication/userapplications",errors:{400:"Bad Request",500:"Server Error"}})}static getAllAppRoles(p){return i(r,{method:"GET",url:"/api/v1/AmplifyApplication/application/{applicationId}/appRoles",path:{applicationId:p}})}}export{t as AmplifyApplicationService};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { CancelablePromise,
|
|
1
|
+
import type { CancelablePromise, MyFeatureDto } from './..';
|
|
2
2
|
export declare class FeatureToggleService {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Get my features
|
|
5
5
|
* @param applicationName name
|
|
6
|
-
* @returns
|
|
6
|
+
* @returns MyFeatureDto OK
|
|
7
7
|
* @throws ApiError
|
|
8
8
|
*/
|
|
9
|
-
static
|
|
9
|
+
static getMyFeatures(applicationName: string): CancelablePromise<Array<MyFeatureDto>>;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_SAM_Prod as e}from"../core/OpenAPI.js";import{request as r}from"../core/request.js";class t{static getMyFeatures(t){return r(e,{method:"GET",url:"/api/v1/FeatureToggle/{applicationName}/myfeatures",path:{applicationName:t},errors:{400:"Bad Request",404:"Not Found",500:"Internal Server Error"}})}}export{t as FeatureToggleService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_SAM_Prod as e,OpenAPI_JSEMBARK_Prod as r}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";class s{static getApiV1ImpersonateUser(){return t(e,{method:"GET",url:"/api/v1/ImpersonateUser",errors:{400:"Bad Request",500:"Server Error"}})}static createImpersonateUser(r){return t(e,{method:"POST",url:"/api/v1/ImpersonateUser",body:r,mediaType:"application/json-patch+json",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static putImpersonateUser(r){return t(e,{method:"PUT",url:"/api/v1/ImpersonateUser",body:r,mediaType:"application/json-patch+json",errors:{400:"Bad Request"}})}static getApiV1ImpersonateUserGetImpersonateUserForApp(e){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/GetImpersonateUserForApp/{appName}",path:{appName:e},errors:{400:"Bad Request",500:"Server Error"}})}static getAllActiveUsers(){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUsers",errors:{400:"Bad Request",500:"Server Error"}})}static getActiveUser(){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUser",errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserById(e){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUser",query:{id:e},errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserByUserName(e){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUserByUserName",query:{username:e},errors:{400:"Bad Request",500:"Server Error"}})}static canImpersonate(){return t(r,{method:"GET",url:"/api/v1/ImpersonateUser/CanImpersonate",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static startImpersonating(e){return t(r,{method:"PUT",url:"/api/v1/ImpersonateUser/StartImpersonating",query:{username:e},errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static stopImpersonating(){return t(r,{method:"PUT",url:"/api/v1/ImpersonateUser/StopImpersonating",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static deleteImpersonationUser(e){return t(r,{method:"DELETE",url:"/api/v1/ImpersonateUser/DeleteImpersonationUser",query:{impersonationUserId:e},errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}}export{s as ImpersonateUserService};
|
|
@@ -26,4 +26,11 @@ export declare class ReleaseNotesService {
|
|
|
26
26
|
* @throws ApiError
|
|
27
27
|
*/
|
|
28
28
|
static getContainerSasUri(): CancelablePromise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Get release note image
|
|
31
|
+
* @param path
|
|
32
|
+
* @returns string OK
|
|
33
|
+
* @throws ApiError
|
|
34
|
+
*/
|
|
35
|
+
static getReleaseNoteImage(path: string): CancelablePromise<string>;
|
|
29
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_SAM as e}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";class a{static getReleasenoteList(a,r,s){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes",query:{applicationName:a,version:r,tags:s}})}static getMyReleasenotes(a){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/myreleasenotes",query:{tags:a}})}static getReleasenote(a,r){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/{applicationName}/{releaseId}",path:{applicationName:a,releaseId:r}})}static getContainerSasUri(){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/GetContainerSasUri",errors:{401:"Unauthorized"}})}static getReleaseNoteImage(a){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/getreleasenoteimage/{path}",path:{path:a},errors:{404:"Not Found"}})}}export{a as ReleaseNotesService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_JSEMBARK as e}from"../core/OpenAPI.js";import{request as r}from"../core/request.js";class t{static createIncident(t){return r(e,{method:"POST",url:"/api/v1/ServiceNow/incident",body:t})}}export{t as ServiceNowService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_JSEMBARK as e}from"../core/OpenAPI.js";import{request as o}from"../core/request.js";class r{static fileUpload(r){return o(e,{method:"POST",url:"/api/v1/Slack/fileUpload",body:r})}static postmessage(r){return o(e,{method:"POST",url:"/api/v1/Slack/postmessage",body:r})}}export{r as SlackService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{OpenAPI_JSEMBARK_Prod as t}from"../core/OpenAPI.js";import{request as o}from"../core/request.js";class r{static getTutorialsForApplication(r){return o(t,{method:"GET",url:"/api/v1/Tutorial/{applicationName}",path:{applicationName:r}})}static getTutorialSasToken(){return o(t,{method:"GET",url:"/api/v1/Tutorial/SASToken"})}}export{r as TutorialService};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { UseFeatureTogglingOptions } from '../../hooks/useFeatureToggling';
|
|
3
|
+
interface FeatureProps extends UseFeatureTogglingOptions {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
fallback?:
|
|
6
|
-
showIfKeyIsMissing?: boolean;
|
|
5
|
+
fallback?: ReactNode;
|
|
7
6
|
}
|
|
8
7
|
export declare const Feature: FC<FeatureProps>;
|
|
9
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as e}from"react/jsx-runtime";import"../../providers/FeatureToggleProvider.js";import{useFeatureToggling as o}from"../../hooks/useFeatureToggling.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";const t=({children:t,fallback:i,...n})=>{const{showContent:s}=o({...n});return s?r(e,{children:t}):void 0===i?null:r(e,{children:i})};export{t as Feature};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { UseFeatureTogglingOptions } from '../../hooks/useFeatureToggling';
|
|
3
|
+
interface CommonFeatureRouteProps extends UseFeatureTogglingOptions {
|
|
4
|
+
element: ReactNode;
|
|
5
|
+
redirectPath?: string;
|
|
6
|
+
}
|
|
7
|
+
interface FeatureRouteWithFallbackProps extends CommonFeatureRouteProps {
|
|
8
|
+
redirectPath?: undefined;
|
|
9
|
+
fallback: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const FeatureRoute: FC<CommonFeatureRouteProps | FeatureRouteWithFallbackProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Navigate as t}from"react-router-dom";import{useFeatureToggling as e}from"../../hooks/useFeatureToggling.js";const o=({element:o,...n})=>{const{showContent:i}=e({...n});if(i)return o;if("fallback"in n)return n.fallback;const a="redirectPath"in n&&n.redirectPath?n.redirectPath:"/";return r(t,{replace:!0,to:a})};export{o as FeatureRoute};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const GET_FEATURE_TOGGLES_FOR_APP = "getFeatureToggleFromAppName";
|
|
2
2
|
export declare const GET_TUTORIALS_FOR_APP = "getTutorialsForApp";
|
|
3
3
|
export declare const GET_TUTORIALS_SAS_TOKEN = "getTutorialsSasToken";
|
|
4
|
+
export declare const GET_RELEASE_NOTES = "getReleaseNotes";
|
|
4
5
|
export declare const SAM_QUERIES: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="getFeatureToggleFromAppName",
|
|
1
|
+
const e="getFeatureToggleFromAppName",t="getTutorialsForApp",o="getTutorialsSasToken",a="getReleaseNotes",g=[e,t,o,a];export{e as GET_FEATURE_TOGGLES_FOR_APP,a as GET_RELEASE_NOTES,t as GET_TUTORIALS_FOR_APP,o as GET_TUTORIALS_SAS_TOKEN,g as SAM_QUERIES};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
interface UseFeatureTogglingOptions {
|
|
2
|
-
|
|
3
|
-
username?: string;
|
|
1
|
+
export interface UseFeatureTogglingOptions {
|
|
2
|
+
featureUuid: string;
|
|
4
3
|
showIfKeyIsMissing?: boolean;
|
|
5
4
|
showIfIsLoading?: boolean;
|
|
6
5
|
}
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param featureUuid - The uuid of the feature-toggle
|
|
8
|
+
* @param showIfKeyIsMissing - Show/hide if the key was not found/has been deleted. Defaults to true
|
|
9
|
+
* @param ShowIfIsLoading - Show/hide if the feature toggles are still loading. Defaults to false
|
|
10
|
+
*/
|
|
11
|
+
export declare function useFeatureToggling({ featureUuid, showIfKeyIsMissing, showIfIsLoading, }: UseFeatureTogglingOptions): {
|
|
8
12
|
showContent: boolean;
|
|
9
13
|
};
|
|
10
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as e}from"react";import{useFeatureToggleContext as
|
|
1
|
+
import{useMemo as e}from"react";import{useFeatureToggleContext as o}from"../providers/FeatureToggleProvider.js";function r({featureUuid:r,showIfKeyIsMissing:t=!0,showIfIsLoading:s=!1}){const{features:i,isError:n,isLoading:u}=o();t||console.warn(`[FeatureToggle] Feature: ${r} will not show when the feature toggle is removed! Was this intentional?`);return{showContent:e((()=>{if(!s&&u||n)return!1;const e=i?.some((e=>e.uuid===r));return!!e||t}),[s,u,n,i,t,r])}}export{r as useFeatureToggling};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useQuery as e}from"@tanstack/react-query";import{ReleaseNotesService as t}from"../api/services/ReleaseNotesService.js";import
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import{ReleaseNotesService as t}from"../api/services/ReleaseNotesService.js";import{GET_RELEASE_NOTES as r}from"../constants/queryKeys.js";import*as o from"../utils/environment.js";const{getAppName:s}=o;function n(o){const n=o?.overrideAppName??s(import.meta.env.VITE_NAME);return e({queryKey:[r],queryFn:()=>t.getReleasenoteList(n),enabled:o?.enabled??!0})}export{n as useReleaseNotesQuery};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Feature}from"./components/Feature/Feature.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{useTutorial}from"./providers/TutorialProvider/TutorialProvider.hooks.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";import*as e from"./utils/environment.js";export{e as environment};export{ApiError}from"./api/core/ApiError.js";export{CancelError,CancelablePromise}from"./api/core/CancelablePromise.js";export{
|
|
1
|
+
export{Feature}from"./components/Feature/Feature.js";export{FeatureRoute}from"./components/FeatureRoute/FeatureRoute.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{useTutorial}from"./providers/TutorialProvider/TutorialProvider.hooks.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";import*as e from"./utils/environment.js";export{e as environment};export{ApiError}from"./api/core/ApiError.js";export{CancelError,CancelablePromise}from"./api/core/CancelablePromise.js";export{OpenAPI_APP,getJSEmbarkToken,getSAMToken}from"./api/core/OpenAPI.js";export{request}from"./api/core/request.js";export{ApplicationCategory}from"./api/models/ApplicationCategory.js";export{ServiceNowUrgency}from"./api/models/ServiceNowUrgency.js";export{TutorialPosition}from"./api/models/TutorialPosition.js";export{AmplifyApplicationService}from"./api/services/AmplifyApplicationService.js";export{FeatureToggleService}from"./api/services/FeatureToggleService.js";export{ImpersonateUserService}from"./api/services/ImpersonateUserService.js";export{ReleaseNotesService}from"./api/services/ReleaseNotesService.js";export{ServiceNowService}from"./api/services/ServiceNowService.js";export{SlackService}from"./api/services/SlackService.js";export{TutorialService}from"./api/services/TutorialService.js";export{GET_FEATURE_TOGGLES_FOR_APP,GET_RELEASE_NOTES,GET_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,SAM_QUERIES}from"./constants/queryKeys.js";
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { FC,
|
|
2
|
-
import {
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { MyFeatureDto } from '../api';
|
|
3
3
|
import { EnvironmentType } from '../types';
|
|
4
|
-
export declare const isUserInActiveUserArray: (username: string | undefined, activeUsers: GraphUser[] | undefined | null) => boolean;
|
|
5
4
|
interface FeatureToggleContextType {
|
|
6
5
|
isLoading: boolean;
|
|
7
6
|
isError: boolean;
|
|
8
7
|
environmentName: EnvironmentType;
|
|
9
|
-
features?:
|
|
8
|
+
features?: MyFeatureDto[] | null;
|
|
10
9
|
}
|
|
11
10
|
export declare function useFeatureToggleContext(): FeatureToggleContextType;
|
|
12
11
|
interface FeatureToggleProviderProps {
|
|
13
12
|
children: ReactNode;
|
|
14
|
-
loadingComponent?: ReactElement;
|
|
15
13
|
overrideAppName?: string;
|
|
16
14
|
overrideEnvironment?: EnvironmentType;
|
|
17
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as e,useContext as t}from"react";import{useQuery as o}from"@tanstack/react-query";import{FeatureToggleService as i}from"../api/services/FeatureToggleService.js";import{GET_FEATURE_TOGGLES_FOR_APP as n}from"../constants/queryKeys.js";import*as s from"../utils/environment.js";import{getEnvironmentName as m}from"../utils/environment.js";const{getAppName:a}=s,u=e(void 0);function p(){const r=t(u);if(void 0===r)throw new Error("'useFeatureToggleContext' must be used within provider");return r}const c=({children:e,overrideAppName:t,overrideEnvironment:s})=>{const p=t??a(import.meta.env.VITE_NAME),c=s??m(import.meta.env.VITE_ENVIRONMENT_NAME),{data:v=[],isLoading:d,isError:f}=o({queryKey:[n],queryFn:async()=>i.getMyFeatures(p)});return r(u.Provider,{value:{features:v,isLoading:d,isError:f,environmentName:c},children:e})};export{c as FeatureToggleProvider,p as useFeatureToggleContext};
|
|
@@ -4,18 +4,16 @@ export declare const StyledTutorialDialog: import("styled-components/dist/types"
|
|
|
4
4
|
export declare const DialogContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
5
|
export declare const DialogTypography: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<({
|
|
6
6
|
as?: import("react").ElementType | undefined;
|
|
7
|
-
} & (import("@equinor/eds-core-react").TypographyProps & Omit<any, "token" | "id" | "children" | "bold" | "link" | "group" | "
|
|
7
|
+
} & (import("@equinor/eds-core-react").TypographyProps & Omit<any, "token" | "id" | "children" | "bold" | "link" | "style" | "slot" | "title" | "variant" | "group" | "italic" | "color" | "lines" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture">)) & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("@equinor/eds-utils").OverridableComponent<import("@equinor/eds-core-react").TypographyProps, HTMLElement>, keyof import("react").Component<any, {}, any>>;
|
|
8
8
|
export declare const DialogImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
9
9
|
export declare const DialogActions: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
10
|
export declare const NavigateSteps: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
-
export declare const TutorialErrorDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<
|
|
11
|
+
export declare const TutorialErrorDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<{
|
|
12
12
|
isDismissable?: boolean;
|
|
13
13
|
open: boolean;
|
|
14
14
|
onClose?: () => void;
|
|
15
15
|
dialogRef?: import("react").ForwardedRef<HTMLDialogElement>;
|
|
16
|
-
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>,
|
|
17
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
-
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<{
|
|
16
|
+
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<{
|
|
19
17
|
isDismissable?: boolean;
|
|
20
18
|
open: boolean;
|
|
21
19
|
onClose?: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { render, RenderOptions } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
|
+
declare const renderWithProviders: (ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
4
5
|
declare const customRender: (ui: ReactElement, options?: RenderOptions) => ReturnType<typeof render>;
|
|
5
6
|
export * from '@testing-library/react';
|
|
6
|
-
export { customRender as render, userEvent };
|
|
7
|
+
export { customRender as render, renderWithProviders, userEvent };
|
|
@@ -3,11 +3,9 @@ declare enum ReleaseNoteType {
|
|
|
3
3
|
IMPROVEMENT = "Improvement",
|
|
4
4
|
BUG_FIX = "Bug fix"
|
|
5
5
|
}
|
|
6
|
-
type ReleaseNoteTypeInformation = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
};
|
|
6
|
+
type ReleaseNoteTypeInformation = Record<ReleaseNoteType, {
|
|
7
|
+
dotColor: string;
|
|
8
|
+
}>;
|
|
11
9
|
declare const RELEASENOTE_TYPES_INFORMATION: ReleaseNoteTypeInformation;
|
|
12
10
|
interface ReleaseNotesTypesProps {
|
|
13
11
|
name: ReleaseNoteType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/subsurface-app-management",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "React Typescript components/hooks to communicate with equinor/sam",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -20,16 +20,17 @@
|
|
|
20
20
|
],
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"scripts": {
|
|
23
|
-
"start": "
|
|
24
|
-
"build-storybook": "
|
|
23
|
+
"start": "storybook dev -p 6006",
|
|
24
|
+
"build-storybook": "storybook build",
|
|
25
25
|
"setup": "npm install",
|
|
26
26
|
"pretty": "prettier --check ./src",
|
|
27
27
|
"pretty:fix": "prettier --write ./src",
|
|
28
|
-
"lint": "eslint ./src
|
|
29
|
-
"lint:fix": "eslint ./src
|
|
28
|
+
"lint": "eslint ./src ./.storybook",
|
|
29
|
+
"lint:fix": "eslint ./src ./.storybook --fix",
|
|
30
30
|
"test": "vitest watch",
|
|
31
31
|
"test:ci": "vitest run",
|
|
32
32
|
"test:coverage": "vitest run --coverage",
|
|
33
|
+
"test:coverage-ci": "CI=true vitest run --coverage --coverage.reporter=json --coverage.reporter=json-summary --silent",
|
|
33
34
|
"setup-husky": "husky install",
|
|
34
35
|
"precommit": "npx lint-staged",
|
|
35
36
|
"build": "rollup -c && tsc --project tsconfig.build.json && resolve-tspaths --project tsconfig.build.json",
|
|
@@ -48,69 +49,62 @@
|
|
|
48
49
|
"last 1 safari version"
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@azure/msal-browser": "3.26.1",
|
|
53
|
-
"@azure/msal-react": "2.1.1",
|
|
54
|
-
"jwt-decode": "^4.0.0"
|
|
55
|
-
},
|
|
56
52
|
"devDependencies": {
|
|
57
|
-
"@faker-js/faker": "^9.0
|
|
58
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
59
|
-
"@rollup/plugin-node-resolve": "^
|
|
53
|
+
"@faker-js/faker": "^9.3.0",
|
|
54
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
55
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
60
56
|
"@rollup/plugin-terser": "^0.4.4",
|
|
61
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
62
|
-
"@storybook/addon-actions": "^8.
|
|
63
|
-
"@storybook/addon-designs": "^8.0.
|
|
64
|
-
"@storybook/addon-docs": "^8.
|
|
65
|
-
"@storybook/addon-essentials": "^8.
|
|
66
|
-
"@storybook/addon-links": "^8.
|
|
67
|
-
"@storybook/components": "^8.
|
|
68
|
-
"@storybook/manager-api": "^8.
|
|
69
|
-
"@storybook/preview-api": "^8.
|
|
70
|
-
"@storybook/react": "^8.
|
|
71
|
-
"@storybook/react-vite": "^8.
|
|
72
|
-
"@tanstack/react-query": "^5.
|
|
57
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
58
|
+
"@storybook/addon-actions": "^8.4.7",
|
|
59
|
+
"@storybook/addon-designs": "^8.0.4",
|
|
60
|
+
"@storybook/addon-docs": "^8.4.7",
|
|
61
|
+
"@storybook/addon-essentials": "^8.4.7",
|
|
62
|
+
"@storybook/addon-links": "^8.4.7",
|
|
63
|
+
"@storybook/components": "^8.4.7",
|
|
64
|
+
"@storybook/manager-api": "^8.4.7",
|
|
65
|
+
"@storybook/preview-api": "^8.4.7",
|
|
66
|
+
"@storybook/react": "^8.4.7",
|
|
67
|
+
"@storybook/react-vite": "^8.4.7",
|
|
68
|
+
"@tanstack/react-query": "^5.62.7",
|
|
73
69
|
"@testing-library/dom": "^10.4.0",
|
|
74
|
-
"@testing-library/jest-dom": "^6.6.
|
|
75
|
-
"@testing-library/react": "^16.0
|
|
70
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
71
|
+
"@testing-library/react": "^16.1.0",
|
|
76
72
|
"@testing-library/user-event": "^14.5.2",
|
|
77
73
|
"@types/lodash-es": "^4.17.12",
|
|
78
|
-
"@types/mocha": "^10.0.
|
|
79
|
-
"@types/node": "^22.
|
|
80
|
-
"@types/react": "^
|
|
81
|
-
"@types/react-dom": "^
|
|
74
|
+
"@types/mocha": "^10.0.10",
|
|
75
|
+
"@types/node": "^22.10.2",
|
|
76
|
+
"@types/react": "^19.0.1",
|
|
77
|
+
"@types/react-dom": "^19.0.2",
|
|
82
78
|
"@types/react-router-dom": "^5.3.3",
|
|
83
79
|
"@types/styled-components": "^5.1.34",
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"
|
|
87
|
-
"@vitest/coverage-v8": "^2.1.3",
|
|
88
|
-
"eslint": "^8.56.0",
|
|
80
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
81
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
82
|
+
"eslint": "^9.17.0",
|
|
89
83
|
"eslint-plugin-react": "^7.37.2",
|
|
90
|
-
"eslint-plugin-react-hooks": "^5.
|
|
84
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
91
85
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
92
|
-
"eslint-plugin-storybook": "^0.
|
|
86
|
+
"eslint-plugin-storybook": "^0.11.1",
|
|
93
87
|
"jest-styled-components": "^7.2.0",
|
|
94
88
|
"jsdom": "^25.0.1",
|
|
95
|
-
"lint-staged": "^15.2.
|
|
96
|
-
"ora": "^8.1.
|
|
97
|
-
"prettier": "^3.
|
|
89
|
+
"lint-staged": "^15.2.11",
|
|
90
|
+
"ora": "^8.1.1",
|
|
91
|
+
"prettier": "^3.4.2",
|
|
98
92
|
"react": "^18.3.1",
|
|
99
93
|
"react-dom": "^18.3.1",
|
|
100
94
|
"react-router": "^6.27.0",
|
|
101
95
|
"react-router-dom": "^6.27.0",
|
|
102
|
-
"resolve-tspaths": "^0.8.
|
|
103
|
-
"rollup": "^4.
|
|
96
|
+
"resolve-tspaths": "^0.8.23",
|
|
97
|
+
"rollup": "^4.28.1",
|
|
104
98
|
"rollup-plugin-delete": "^2.1.0",
|
|
105
|
-
"rollup-plugin-import-css": "^3.5.
|
|
106
|
-
"storybook": "^8.
|
|
99
|
+
"rollup-plugin-import-css": "^3.5.8",
|
|
100
|
+
"storybook": "^8.4.7",
|
|
107
101
|
"storybook-addon-react-docgen": "^1.2.44",
|
|
108
|
-
"storybook-addon-remix-react-router": "^3.0.
|
|
109
|
-
"typescript": "^5.
|
|
102
|
+
"storybook-addon-remix-react-router": "^3.0.2",
|
|
103
|
+
"typescript": "^5.7.2",
|
|
104
|
+
"typescript-eslint": "^8.18.1",
|
|
110
105
|
"vite": "^5.4.10",
|
|
111
|
-
"vite-plugin-svgr": "^4.2.0",
|
|
112
106
|
"vite-tsconfig-paths": "^5.0.1",
|
|
113
|
-
"vitest": "^2.1.
|
|
107
|
+
"vitest": "^2.1.8"
|
|
114
108
|
},
|
|
115
109
|
"peerDependencies": {
|
|
116
110
|
"@equinor/eds-core-react": "*",
|
|
@@ -122,5 +116,8 @@
|
|
|
122
116
|
"react-router": "^6.11.1",
|
|
123
117
|
"react-router-dom": "^6.11.1",
|
|
124
118
|
"styled-components": "^6.1.8"
|
|
119
|
+
},
|
|
120
|
+
"dependencies": {
|
|
121
|
+
"jwt-decode": "^4.0.0"
|
|
125
122
|
}
|
|
126
123
|
}
|