@equinor/subsurface-app-management 4.3.0 → 4.4.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 +0 -11
- package/dist/api/core/OpenAPI.js +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/models/Faq.d.ts +2 -2
- package/dist/api/models/FaqCategory.d.ts +4 -0
- package/dist/api/models/Step.d.ts +1 -0
- package/dist/api/models/StepDto.d.ts +1 -0
- package/dist/api/services/FaqService.d.ts +7 -0
- package/dist/api/services/FaqService.js +1 -1
- package/dist/hooks/useSignalRMessages.js +1 -1
- package/dist/hooks/useTutorialsQuery.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -14,12 +14,6 @@ export type OpenAPIConfig = {
|
|
|
14
14
|
ENCODE_PATH?: (path: string) => string;
|
|
15
15
|
};
|
|
16
16
|
export declare class TokenService {
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated
|
|
19
|
-
* @returns string Success
|
|
20
|
-
* @throws ApiError
|
|
21
|
-
*/
|
|
22
|
-
static getAmplifyPortalToken(): CancelablePromise<string>;
|
|
23
17
|
/**
|
|
24
18
|
* @returns string Success
|
|
25
19
|
* @throws ApiError
|
|
@@ -31,11 +25,6 @@ export declare class TokenService {
|
|
|
31
25
|
*/
|
|
32
26
|
static getSamPortalProductionToken(): CancelablePromise<string>;
|
|
33
27
|
}
|
|
34
|
-
export declare const getJSEmbarkToken: () => Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated - Use getJSEmbarkToken instead
|
|
37
|
-
*/
|
|
38
|
-
export declare const getPortalToken: () => Promise<string>;
|
|
39
28
|
export declare const getSAMToken: () => Promise<string>;
|
|
40
29
|
export declare const OpenAPI_APP: OpenAPIConfig;
|
|
41
30
|
export declare const OpenAPI_SAM: OpenAPIConfig;
|
package/dist/api/core/OpenAPI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as o from"../../utils/environment.js";import{request as t}from"./request.js";import{getLocalStorage as e,updateLocalStorage as r}from"../../utils/localStorage.js";import{jwtDecode as E}from"jwt-decode";const{getEnvironmentName:i,getApiUrl:n}=o,a=i(import.meta.env.VITE_ENVIRONMENT_NAME),m="localhost"===a?"development":a;class S{static getSamPortalToken(){return t(s,{method:"GET",url:"/api/v1/Token/SamPortal"})}static getSamPortalProductionToken(){return t(s,{method:"GET",url:"/api/v1/Token/SamPortal/Production"})}}const d=o=>{if(0===o.length)return!1;try{return!(o=>{const t=E(o),e=(new Date).getTime()/1e3;return t.exp&&e>t.exp})(o)}catch(o){return!1}},c=async(o,t)=>{const E=e(o,"");if(d(E))return E;const i=await t();return r(o,i),i},T=async()=>c(`sam-${a}`,S.getSamPortalToken),s={BASE:n(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},A={BASE:`https://api-sam-backend-${m}.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},u={BASE:"https://api-sam-backend-production.radix.equinor.com",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:async()=>c("sam-production",S.getSamPortalProductionToken),USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};export{s as OpenAPI_APP,A as OpenAPI_SAM,u as OpenAPI_SAM_Prod,S as TokenService,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 { OpenAPI_APP, getSAMToken
|
|
3
|
+
export { OpenAPI_APP, 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';
|
package/dist/api/models/Faq.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import type { Faq } from '../models/Faq';
|
|
|
2
2
|
import type { FaqCategory } from '../models/FaqCategory';
|
|
3
3
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
4
4
|
export declare class FaqService {
|
|
5
|
+
/**
|
|
6
|
+
* Get FAQ categories and related FAQs based on application id
|
|
7
|
+
* @param applicationId
|
|
8
|
+
* @returns FaqCategory OK
|
|
9
|
+
* @throws ApiError
|
|
10
|
+
*/
|
|
11
|
+
static getCategoriesWithFaqsFromApplicationName(applicationName: string): CancelablePromise<Array<FaqCategory>>;
|
|
5
12
|
/**
|
|
6
13
|
* Get FAQ image
|
|
7
14
|
* @param path
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OpenAPI_SAM_Prod as
|
|
1
|
+
import{OpenAPI_SAM_Prod as a}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";class e{static getCategoriesWithFaqsFromApplicationName(e){return t(a,{method:"GET",url:"/api/v1/Faq/faqcategorieswithfaqs/{applicationName}",path:{applicationName:e}})}static getFaqImage(e){return t(a,{method:"GET",url:"/api/v1/Faq/getfaqimage/{path}",path:{path:e},errors:{404:"Not Found"}})}static getFaqCategoriesFromApplicationId(e){return t(a,{method:"GET",url:"/api/v1/Faq/faqcategories/{applicationId}",path:{applicationId:e}})}static getFaqsFromCategoryId(e){return t(a,{method:"GET",url:"/api/v1/Faq/faqs/{categoryId}",path:{categoryId:e}})}static getFaqById(e){return t(a,{method:"GET",url:"/api/v1/Faq/faq/{id}",path:{id:e}})}}export{e as FaqService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useState as r,useMemo as t,useEffect as n}from"react";import*as o from"@microsoft/signalr";import{LogLevel as
|
|
1
|
+
import{useRef as e,useState as r,useMemo as t,useEffect as n}from"react";import*as o from"@microsoft/signalr";import{LogLevel as s}from"@microsoft/signalr";import{useQuery as i}from"@tanstack/react-query";import{getSAMToken as c}from"../api/core/OpenAPI.js";import"../api/models/ApplicationCategory.js";import"../api/models/ServiceNowUrgency.js";import"../api/models/TutorialPosition.js";import{EnvironmentType as a}from"../types/Environment.js";import{getEnvironmentName as u}from"../utils/environment.js";function m(m){const d=e(void 0),[p,l]=r([]),[g,f]=r(),[b,v]=r(),w=e(void 0),S=e(void 0),{data:N}=i({queryKey:["get-sam-token"],queryFn:()=>c()}),y=t((()=>{const e=u(import.meta.env.VITE_ENVIRONMENT_NAME);return`wss://api-sam-backend-${e===a.LOCALHOST?a.DEVELOP:e}.radix.equinor.com`}),[]);n((()=>{(async function(){if(void 0===N||w.current===m&&S.current===N)return;void 0!==d.current&&w.current&&S.current&&(w.current!==m||S.current!==N)&&await d.current.stop(),S.current=N,w.current=m;const e=(new o.HubConnectionBuilder).configureLogging(s.Error).withUrl(`${y}/hubs/notifications`,{accessTokenFactory:()=>N,withCredentials:!1,skipNegotiation:!0,transport:o.HttpTransportType.WebSockets}).withAutomaticReconnect().build();try{await e.start(),e.on("ActiveMessages",((e,r)=>{l(r.map((r=>({...r,Subject:e}))).reverse())})),e.onreconnected((()=>e.invoke("Subscribe",m))),e.on("NewMessage",((e,r)=>{l((t=>[{...r,Subject:e},...t]))})),e.on("UpdateMessage",((e,r)=>{v({...r,Subject:e})})),e.on("Delete",((e,r)=>{f(r)})),e.on("Error",(e=>{throw new Error("Connection error: "+e)})),await e.invoke("Subscribe",m),await e.invoke("PeekMessages")}catch(e){console.error("Connection failed",e)}d.current=e})().catch((e=>{console.error("Error setting up connection",e)}))}),[y,m,N]),n((()=>{if(b){const e=p.findIndex((e=>e.SequenceNumber===b.SequenceNumber)),r=[...p];e>-1&&(r[e]=b,l(r),v(void 0))}}),[b,p]),n((()=>{if(g){const e=p.findIndex((e=>e.SequenceNumber===g)),r=[...p];e>-1&&(r.splice(e,1),l(r),f(void 0))}}),[g,p]);const E=e=>{d.current&&(e.Read=!e.Read,d.current.invoke("PatchMessage",e.SequenceNumber,e).catch((e=>{console.error("Error setting message as read",e)})))},k=t((()=>p.some((e=>!1===e.Read))),[p]);return{messages:p,hasUnreadMessages:k,setMessageAsRead:E,setAllMessagesAsRead:()=>{p.forEach((e=>{e.Read||E(e)}))},deleteMessage:async function(e){d.current&&null!==e.SequenceNumber&&(await d.current.invoke("DeleteMessage",e.SequenceNumber),f(e.SequenceNumber))},closeConnection:async()=>{if(d.current)return await d.current.stop()}}}export{m as useSignalRMessages};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useQuery as
|
|
1
|
+
import{useQuery as r}from"@tanstack/react-query";import"../api/core/OpenAPI.js";import"../api/models/ApplicationCategory.js";import"../api/models/ServiceNowUrgency.js";import"../api/models/TutorialPosition.js";import{TutorialService as t}from"../api/services/TutorialService.js";import{GET_TUTORIALS_FOR_APP as o}from"../constants/queryKeys.js";import{EnvironmentType as e}from"../types/Environment.js";import"../types/ReleaseNotes.js";import{getEnvironmentName as i,getAppName as s}from"../utils/environment.js";function p(){return r({queryKey:[o],queryFn:async()=>{if(i(import.meta.env.VITE_ENVIRONMENT_NAME)===e.PRODUCTION){return(await t.getMyTutorialsForApplication(s(import.meta.env.VITE_NAME),!1)).map((r=>({...r,id:r.tutorialDraftId?r.tutorialDraftId:r.id,steps:r.steps.sort(((r,t)=>(r.orderBy??0)-(t.orderBy??0)))})))}return t.getDraftTutorialsForApplication(s(import.meta.env.VITE_NAME))}})}export{p as useTutorialsQuery};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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{useTutorialsQuery}from"./hooks/useTutorialsQuery.js";export{useTutorialStepImage}from"./hooks/useTutorialStepImage.js";export{useSignalRMessages}from"./hooks/useSignalRMessages.js";export{TutorialProvider,useTutorials}from"./providers/TutorialProvider/TutorialProvider.js";export{ApplicationInsightsProvider}from"./providers/ApplicationInsightsProvider/ApplicationInsightsProvider.js";export{samTrackEvent,samTrackMetric}from"./providers/ApplicationInsightsProvider/ApplicationInsightsProvider.utils.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,
|
|
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{useTutorialsQuery}from"./hooks/useTutorialsQuery.js";export{useTutorialStepImage}from"./hooks/useTutorialStepImage.js";export{useSignalRMessages}from"./hooks/useSignalRMessages.js";export{TutorialProvider,useTutorials}from"./providers/TutorialProvider/TutorialProvider.js";export{ApplicationInsightsProvider}from"./providers/ApplicationInsightsProvider/ApplicationInsightsProvider.js";export{samTrackEvent,samTrackMetric}from"./providers/ApplicationInsightsProvider/ApplicationInsightsProvider.utils.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,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{FaqService}from"./api/services/FaqService.js";export{GET_FEATURE_TOGGLES_FOR_APP,GET_RELEASE_NOTES,GET_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,GET_TUTORIAL_STEP_IMAGE,SAM_QUERIES}from"./constants/queryKeys.js";
|