@equinor/subsurface-app-management 1.1.2 → 1.1.4

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.
@@ -4,6 +4,9 @@ export { OpenAPI_SAM, getPortalToken } 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';
7
+ export { ApplicationCategory } from './models/ApplicationCategory';
8
+ export type { ContentTab } from './models/ContentTab';
9
+ export type { AccessRoles } from './models/AccessRoles';
7
10
  export type { FeatureAPIType } from './models/FeatureAPIType';
8
11
  export type { FeatureToggleDto } from './models/FeatureToggleDto';
9
12
  export type { GraphUser } from './models/GraphUser';
@@ -0,0 +1 @@
1
+ var n;!function(n){n.JSDigitalFrontrunner="JS Digital Frontrunner",n.Upscaling="Upscaling",n.Toolbox="Toolbox",n.External="External"}(n||(n={}));export{n as ApplicationCategory};
@@ -0,0 +1 @@
1
+ export type JToken = Array<JToken>;
@@ -1,5 +1,6 @@
1
1
  import type { AmplifyApplication } from '../models/AmplifyApplication';
2
2
  import type { CancelablePromise } from '../core/CancelablePromise';
3
+ import { JToken } from '../models/JToken';
3
4
  export declare class AmplifyApplicationService {
4
5
  /**
5
6
  * Get all applications that user has access to
@@ -7,4 +8,10 @@ export declare class AmplifyApplicationService {
7
8
  * @throws ApiError
8
9
  */
9
10
  static userApplications(): CancelablePromise<Array<AmplifyApplication>>;
11
+ /**
12
+ * @param appClientId
13
+ * @returns JToken Success
14
+ * @throws ApiError
15
+ */
16
+ static getAllAppRoles(appClientId: string): CancelablePromise<Array<JToken>>;
10
17
  }
@@ -1 +1 @@
1
- import{OpenAPI_Portal_Prod as r}from"../core/OpenAPI.js";import{request as e}from"../core/request.js";class o{static userApplications(){return e(r,{method:"GET",url:"/api/v1/AmplifyApplication/userapplications",errors:{400:"Bad Request",500:"Server Error"}})}}export{o as AmplifyApplicationService};
1
+ import{OpenAPI_Portal_Prod as p,OpenAPI_Portal as r}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";class e{static userApplications(){return t(p,{method:"GET",url:"/api/v1/AmplifyApplication/userapplications",errors:{400:"Bad Request",500:"Server Error"}})}static getAllAppRoles(p){return t(r,{method:"GET",url:"/api/v1/AmplifyApplication/application/{appClientId}/groups",path:{appClientId:p}})}}export{e as AmplifyApplicationService};
@@ -1,4 +1,5 @@
1
- import { CancelablePromise, ImpersonateUser } from './..';
1
+ import type { ImpersonateUser } from '../models/ImpersonateUser';
2
+ import type { CancelablePromise } from '../core/CancelablePromise';
2
3
  export declare class ImpersonateUserService {
3
4
  /**
4
5
  * Get all impersonate users
@@ -46,6 +47,11 @@ export declare class ImpersonateUserService {
46
47
  * @throws ApiError
47
48
  */
48
49
  static getImpersonateUserByUserName(username?: string): CancelablePromise<ImpersonateUser>;
50
+ /**
51
+ * @returns boolean Success
52
+ * @throws ApiError
53
+ */
54
+ static canImpersonate(): CancelablePromise<boolean>;
49
55
  /**
50
56
  * @param username
51
57
  * @returns ImpersonateUser Success
@@ -1 +1 @@
1
- import{OpenAPI_Portal as e}from"../core/OpenAPI.js";import{request as r}from"../core/request.js";class t{static getApiV1ImpersonateUser(){return r(e,{method:"GET",url:"/api/v1/ImpersonateUser",errors:{400:"Bad Request",500:"Server Error"}})}static createImpersonateUser(t){return r(e,{method:"POST",url:"/api/v1/ImpersonateUser",body:t,mediaType:"application/json-patch+json",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static putImpersonateUser(t){return r(e,{method:"PUT",url:"/api/v1/ImpersonateUser",body:t,mediaType:"application/json-patch+json",errors:{400:"Bad Request"}})}static getAllActiveUsers(){return r(e,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUsers",errors:{400:"Bad Request",500:"Server Error"}})}static getActiveUserByUsername(t){return r(e,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUserByUsername",query:{username:t},errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserById(t){return r(e,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUser",query:{id:t},errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserByUserName(t){return r(e,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUserByUserName",query:{username:t},errors:{400:"Bad Request",500:"Server Error"}})}static startImpersonating(t){return r(e,{method:"PUT",url:"/api/v1/ImpersonateUser/StartImpersonating",query:{username:t},errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static stopImpersonating(){return r(e,{method:"PUT",url:"/api/v1/ImpersonateUser/StopImpersonating",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}}export{t as ImpersonateUserService};
1
+ import{OpenAPI_Portal as r}from"../core/OpenAPI.js";import{request as e}from"../core/request.js";class t{static getApiV1ImpersonateUser(){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser",errors:{400:"Bad Request",500:"Server Error"}})}static createImpersonateUser(t){return e(r,{method:"POST",url:"/api/v1/ImpersonateUser",body:t,mediaType:"application/json-patch+json",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static putImpersonateUser(t){return e(r,{method:"PUT",url:"/api/v1/ImpersonateUser",body:t,mediaType:"application/json-patch+json",errors:{400:"Bad Request"}})}static getAllActiveUsers(){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUsers",errors:{400:"Bad Request",500:"Server Error"}})}static getActiveUserByUsername(t){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser/ActiveUserByUsername",query:{username:t},errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserById(t){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUser",query:{id:t},errors:{400:"Bad Request",500:"Server Error"}})}static getImpersonateUserByUserName(t){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser/ImpersonateUserByUserName",query:{username:t},errors:{400:"Bad Request",500:"Server Error"}})}static canImpersonate(){return e(r,{method:"GET",url:"/api/v1/ImpersonateUser/CanImpersonate",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static startImpersonating(t){return e(r,{method:"PUT",url:"/api/v1/ImpersonateUser/StartImpersonating",query:{username:t},errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static stopImpersonating(){return e(r,{method:"PUT",url:"/api/v1/ImpersonateUser/StopImpersonating",errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}}export{t as ImpersonateUserService};
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{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_SAM,getPortalToken}from"./api/core/OpenAPI.js";export{request}from"./api/core/request.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";
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{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_SAM,getPortalToken}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";
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Typography as o,Button as n}from"@equinor/eds-core-react";import{DIALOG_EDGE_MARGIN as a,TUTORIAL_LOCALSTORAGE_VALUE_STRING as l}from"./TutorialProvider.const.js";import{useGetTutorialSasToken as s,useTutorial as m}from"./TutorialProvider.hooks.js";import{DialogImage as c,DialogWrapper as p,StyledTutorialDialog as d,DialogContent as u,DialogActions as g,NavigateSteps as T}from"./TutorialProvider.styles.js";import{getBestPositionWithoutOverlap as h}from"./TutorialProvider.utils.js";import f from"./TutorialStepIndicator.js";import"../../api/core/OpenAPI.js";import"../../api/models/ServiceNowUrgency.js";import{TutorialPosition as v}from"../../api/models/TutorialPosition.js";const P=()=>{const{data:P}=s(),{activeTutorial:x,currentStep:S,setCurrentStep:j,setActiveTutorial:k,dialogRef:y,allElementsToHighlight:O,customStepComponents:$,isLastStep:R,currentStepObject:C,setAllElementsToHighlight:B,shortNameFromParams:E,viewportWidth:I,clearSearchParam:w}=m(),H=i((()=>{if(C)return C.key&&$?$.find((t=>t.key===C.key))?.element:void 0===C.key||null===C.key?t(r,{children:[e(o,{children:C.title}),e(o,{children:C.body}),C.imgUrl&&P&&e(c,{"data-testid":"tutorial-image",alt:"tutorial-image",src:`${C.imgUrl}?${P}`})]}):void 0}),[C,$,P]),L=i((()=>{if(x&&I&&O&&y.current)return x.steps[S].position?x.steps[S].position:x.dynamicPositioning?h(O[S].getBoundingClientRect(),y.current.getBoundingClientRect()):v.BOTTOM_RIGHT}),[x,I,O,y,S]),N=i((()=>{if(L&&L!==v.CENTER)switch(L){case v.TOP_LEFT:return{marginTop:`${a}px`,marginLeft:`${a}px`};case v.TOP_RIGHT:return{marginTop:`${a}px`,marginRight:`${a}px`};case v.BOTTOM_LEFT:return{marginBottom:`${a}px`,marginLeft:`${a}px`};case v.BOTTOM_RIGHT:default:return{marginBottom:`${a}px`,marginRight:`${a}px`}}}),[L]),_=()=>{E&&w(),x&&(window.localStorage.setItem(x?.shortName,l),k(void 0),y.current?.close(),j(0),B(void 0))};return e(p,{children:e(d,{"data-testid":"tutorial-dialog",ref:y,style:N??void 0,children:t(u,{children:[H,e(f,{steps:x?.steps??[],currentStep:S}),t(g,{children:[e(n,{variant:"ghost",onClick:()=>{_()},children:"Skip"}),t(T,{children:[S&&0!==S?e(n,{variant:"ghost",onClick:()=>{j((t=>t-1))},children:"Previous"}):null,e(n,{variant:"outlined",onClick:()=>{R?_():j((t=>t+1))},children:R?"Done":"Next"})]})]})]})})})};export{P as default};
1
+ import{jsxs as t,Fragment as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Typography as o,Button as n}from"@equinor/eds-core-react";import{DIALOG_EDGE_MARGIN as a,TUTORIAL_LOCALSTORAGE_VALUE_STRING as l}from"./TutorialProvider.const.js";import{useGetTutorialSasToken as s,useTutorial as m}from"./TutorialProvider.hooks.js";import{DialogImage as c,DialogWrapper as p,StyledTutorialDialog as d,DialogContent as u,DialogActions as g,NavigateSteps as T}from"./TutorialProvider.styles.js";import{getBestPositionWithoutOverlap as h}from"./TutorialProvider.utils.js";import f from"./TutorialStepIndicator.js";import"../../api/core/OpenAPI.js";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import{TutorialPosition as v}from"../../api/models/TutorialPosition.js";const P=()=>{const{data:P}=s(),{activeTutorial:j,currentStep:x,setCurrentStep:y,setActiveTutorial:S,dialogRef:k,allElementsToHighlight:O,customStepComponents:$,isLastStep:C,currentStepObject:R,setAllElementsToHighlight:B,shortNameFromParams:E,viewportWidth:I,clearSearchParam:w}=m(),H=i((()=>{if(R)return R.key&&$?$.find((t=>t.key===R.key))?.element:void 0===R.key||null===R.key?t(r,{children:[e(o,{children:R.title}),e(o,{children:R.body}),R.imgUrl&&P&&e(c,{"data-testid":"tutorial-image",alt:"tutorial-image",src:`${R.imgUrl}?${P}`})]}):void 0}),[R,$,P]),L=i((()=>{if(j&&I&&O&&k.current)return j.steps[x].position?j.steps[x].position:j.dynamicPositioning?h(O[x].getBoundingClientRect(),k.current.getBoundingClientRect()):v.BOTTOM_RIGHT}),[j,I,O,k,x]),N=i((()=>{if(L&&L!==v.CENTER)switch(L){case v.TOP_LEFT:return{marginTop:`${a}px`,marginLeft:`${a}px`};case v.TOP_RIGHT:return{marginTop:`${a}px`,marginRight:`${a}px`};case v.BOTTOM_LEFT:return{marginBottom:`${a}px`,marginLeft:`${a}px`};case v.BOTTOM_RIGHT:default:return{marginBottom:`${a}px`,marginRight:`${a}px`}}}),[L]),_=()=>{E&&w(),j&&(window.localStorage.setItem(j?.shortName,l),S(void 0),k.current?.close(),y(0),B(void 0))};return e(p,{children:e(d,{"data-testid":"tutorial-dialog",ref:k,style:N??void 0,children:t(u,{children:[H,e(f,{steps:j?.steps??[],currentStep:x}),t(g,{children:[e(n,{variant:"ghost",onClick:()=>{_()},children:"Skip"}),t(T,{children:[x&&0!==x?e(n,{variant:"ghost",onClick:()=>{y((t=>t-1))},children:"Previous"}):null,e(n,{variant:"outlined",onClick:()=>{C?_():y((t=>t+1))},children:C?"Done":"Next"})]})]})]})})})};export{P as default};
@@ -1 +1 @@
1
- import{DIALOG_EDGE_MARGIN as T}from"./TutorialProvider.const.js";import"../../api/core/OpenAPI.js";import"../../api/models/ServiceNowUrgency.js";import{TutorialPosition as t}from"../../api/models/TutorialPosition.js";const o=(T,t)=>!(T.top>t.bottom||T.bottom<t.top||T.right<t.left||T.left>t.right),e=(o,e)=>{const i=e===t.BOTTOM_RIGHT||e===t.BOTTOM_LEFT,O=e===t.TOP_RIGHT||e===t.BOTTOM_RIGHT,r=innerWidth-T-o.width,m=innerHeight-T-o.height;return new DOMRect(O?r:T,i?m:T,o.width,o.height)},i=(T,i)=>o(T,e(i,t.BOTTOM_RIGHT))?o(T,e(i,t.BOTTOM_LEFT))?o(T,e(i,t.TOP_RIGHT))?o(T,e(i,t.TOP_LEFT))?t.BOTTOM_RIGHT:t.TOP_LEFT:t.TOP_RIGHT:t.BOTTOM_LEFT:t.BOTTOM_RIGHT,O=T=>T.steps.map(((t,o)=>document.getElementById(`${T.shortName}-${o}`)));export{O as getAllElementsToHighlight,i as getBestPositionWithoutOverlap};
1
+ import{DIALOG_EDGE_MARGIN as t}from"./TutorialProvider.const.js";import"../../api/core/OpenAPI.js";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import{TutorialPosition as T}from"../../api/models/TutorialPosition.js";const o=(t,T)=>!(t.top>T.bottom||t.bottom<T.top||t.right<T.left||t.left>T.right),e=(o,e)=>{const i=e===T.BOTTOM_RIGHT||e===T.BOTTOM_LEFT,r=e===T.TOP_RIGHT||e===T.BOTTOM_RIGHT,O=innerWidth-t-o.width,p=innerHeight-t-o.height;return new DOMRect(r?O:t,i?p:t,o.width,o.height)},i=(t,i)=>o(t,e(i,T.BOTTOM_RIGHT))?o(t,e(i,T.BOTTOM_LEFT))?o(t,e(i,T.TOP_RIGHT))?o(t,e(i,T.TOP_LEFT))?T.BOTTOM_RIGHT:T.TOP_LEFT:T.TOP_RIGHT:T.BOTTOM_LEFT:T.BOTTOM_RIGHT,r=t=>t.steps.map(((T,o)=>document.getElementById(`${t.shortName}-${o}`)));export{r as getAllElementsToHighlight,i as getBestPositionWithoutOverlap};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",