@equinor/subsurface-app-management 1.0.2 → 1.0.3

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.
@@ -1,5 +1,5 @@
1
1
  import type { ApiRequestOptions } from './ApiRequestOptions';
2
- import { CancelablePromise } from './CancelablePromise';
2
+ import { CancelablePromise } from './..';
3
3
  type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
4
4
  type Headers = Record<string, string>;
5
5
  export type OpenAPIConfig = {
@@ -3,7 +3,7 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
3
3
  export { OpenAPI } from './core/OpenAPI';
4
4
  export { request } from './core/request';
5
5
  export type { OpenAPIConfig } from './core/OpenAPI';
6
- export type { Feature } from './models/Feature';
6
+ export type { FeatureAPIType } from './models/FeatureAPIType';
7
7
  export type { CustomTutorialStep } from './models/CustomTutorialStep';
8
8
  export type { GenericTutorialStep } from './models/GenericTutorialStep';
9
9
  export type { Tutorial } from './models/Tutorial';
@@ -1,5 +1,5 @@
1
1
  import type { GraphUser } from './GraphUser';
2
- export type Feature = {
2
+ export type FeatureAPIType = {
3
3
  uuid: string;
4
4
  featureKey: string;
5
5
  description: string;
@@ -1,5 +1,5 @@
1
- import type { Feature } from './Feature';
1
+ import type { FeatureAPIType } from './FeatureAPIType';
2
2
  export type FeatureToggleDto = {
3
3
  applicationName: string;
4
- features: Array<Feature>;
4
+ features: Array<FeatureAPIType>;
5
5
  };
@@ -0,0 +1,15 @@
1
+ export type * from './AccessRole';
2
+ export type * from './Applications';
3
+ export type * from './CustomTutorialStep';
4
+ export type * from './FeatureAPIType';
5
+ export type * from './FeatureToggleDto';
6
+ export type * from './GenericTutorialStep';
7
+ export type * from './GraphUser';
8
+ export type * from './ReleaseNote';
9
+ export type * from './ReleaseNotePatch';
10
+ export type * from './ServiceNowIncidentAttachmentResponse';
11
+ export type * from './ServiceNowIncidentResponse';
12
+ export type * from './ServiceNowUrgency';
13
+ export type * from './Tutorial';
14
+ export type * from './TutorialPosition';
15
+ export type * from './TutorialStepBase';
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './hooks';
3
3
  export * from './providers';
4
4
  export * from './types';
5
5
  export * from './utils';
6
+ export { PortalService } from './api/services/PortalService';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Feature}from"./components/Feature/Feature.js";export{default as AuthProvider,useAuth}from"./providers/AuthProvider/AuthProvider.js";export{default as ReleaseNotesProvider,useReleaseNotes}from"./providers/ReleaseNotesProvider.js";export{default as TutorialStepsProvider,useTutorialSteps}from"./providers/TutorialStepsProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{useSignalRMessages}from"./hooks/useSignalRMessages.js";export{default as TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{default as FeatureToggleProvider}from"./providers/FeatureToggleProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";export{auth,environment}from"./utils/auth_environment.js";
1
+ export{Feature}from"./components/Feature/Feature.js";export{default as AuthProvider,useAuth}from"./providers/AuthProvider/AuthProvider.js";export{default as ReleaseNotesProvider,useReleaseNotes}from"./providers/ReleaseNotesProvider.js";export{default as TutorialStepsProvider,useTutorialSteps}from"./providers/TutorialStepsProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{useSignalRMessages}from"./hooks/useSignalRMessages.js";export{default as TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{default as FeatureToggleProvider}from"./providers/FeatureToggleProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";export{auth,environment}from"./utils/auth_environment.js";export{PortalService}from"./api/services/PortalService.js";
@@ -1,10 +1,10 @@
1
1
  import { FC, ReactNode } from 'react';
2
- import { Feature, GraphUser } from '../api';
2
+ import { FeatureAPIType, GraphUser } from '../api';
3
3
  export declare const isUserInActiveUserArray: (username: string, activeUsers: GraphUser[] | undefined | null) => boolean;
4
4
  interface FeatureToggleContextType {
5
5
  isLoading: boolean;
6
6
  isError: boolean;
7
- features?: Feature[] | null;
7
+ features?: FeatureAPIType[] | null;
8
8
  }
9
9
  export declare function useFeatureToggleContext(): FeatureToggleContextType;
10
10
  interface FeatureToggleProviderProps {
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{createContext as r,useContext as t}from"react";import{FullPageSpinner as o}from"@equinor/amplify-components";import{useQuery as i}from"@tanstack/react-query";import{PortalService as a}from"../api/services/PortalService.js";import{environment as n}from"../utils/auth_environment.js";const{getAppName:m}=n,s=(e,r)=>!!(r&&r.length>0)&&r.map((e=>e.mail.toLowerCase())).includes(e.toLowerCase()),u=r(void 0);function p(){const e=t(u);if(void 0===e)throw new Error("'useFeatureToggleContext' must be used within provider");return e}const c=({children:r})=>{const t=m(import.meta.env.VITE_NAME),{data:n,isLoading:s,isError:p}=i({queryKey:["getFeatureToggleFromAppName"],queryFn:async()=>a.getFeatureToggleFromApplicationName(t)});return s?e(o,{variant:"equinor",withoutScrim:!0}):e(u.Provider,{value:{features:n?.features,isLoading:s,isError:p},children:r})};export{c as default,s as isUserInActiveUserArray,p as useFeatureToggleContext};
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as r,useContext as t}from"react";import{FullPageSpinner as o}from"@equinor/amplify-components";import{useQuery as i}from"@tanstack/react-query";import{environment as a}from"../utils/auth_environment.js";import{PortalService as n}from"../api/services/PortalService.js";const{getAppName:m}=a,s=(e,r)=>!!(r&&r.length>0)&&r.map((e=>e.mail.toLowerCase())).includes(e.toLowerCase()),u=r(void 0);function p(){const e=t(u);if(void 0===e)throw new Error("'useFeatureToggleContext' must be used within provider");return e}const c=({children:r})=>{const t=m(import.meta.env.VITE_NAME),{data:a,isLoading:s,isError:p}=i({queryKey:["getFeatureToggleFromAppName"],queryFn:async()=>n.getFeatureToggleFromApplicationName(t)});return s?e(o,{variant:"equinor",withoutScrim:!0}):e(u.Provider,{value:{features:a?.features,isLoading:s,isError:p},children:r})};export{c as default,s as isUserInActiveUserArray,p as useFeatureToggleContext};
@@ -1,3 +1,3 @@
1
- export declare const useGetTutorialsForApp: () => import("@tanstack/react-query").UseQueryResult<import("../../api").Tutorial[], Error>;
1
+ export declare const useGetTutorialsForApp: () => import("@tanstack/react-query").UseQueryResult<import("../..").Tutorial[], Error>;
2
2
  export declare const useGetTutorialSasToken: () => import("@tanstack/react-query").UseQueryResult<string, Error>;
3
3
  export declare const useTutorial: () => import("./TutorialProvider").TutorialContextType;
@@ -1,2 +1,3 @@
1
1
  export * from './Environment';
2
2
  export * from './ReleaseNotes';
3
+ export type * from '../api/models';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",