@equinor/subsurface-app-management 4.1.0 → 4.2.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/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.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,getPortalToken,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,GET_TUTORIAL_STEP_IMAGE,SAM_QUERIES}from"./constants/queryKeys.js";
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,getJSEmbarkToken,getPortalToken,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,GET_TUTORIAL_STEP_IMAGE,SAM_QUERIES}from"./constants/queryKeys.js";
@@ -1,4 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { ApplicationInsights } from '@microsoft/applicationinsights-web';
3
+ export declare const appInsights: ApplicationInsights | undefined;
2
4
  interface ApplicationInsightsProviderProps {
3
5
  children: ReactNode;
4
6
  }
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import{useEffect as e}from"react";import{ClickAnalyticsPlugin as n}from"@microsoft/applicationinsights-clickanalytics-js";import{ReactPlugin as o,AppInsightsContext as t}from"@microsoft/applicationinsights-react-js";import{ApplicationInsights as s}from"@microsoft/applicationinsights-web";import{getApplicationInsightsConnectionString as r}from"../../utils/environment.js";import{l as a}from"../../_virtual/lodash.js";const d=new o,c=new n,p=12e5,m=r(import.meta.env.VITE_APPLICATION_INSIGHTS_CONNECTION_STRING),l=m?new s({config:{connectionString:m,extensions:[d,c],extensionConfig:{[c.identifier]:{autoCapture:!0,dropInvalidEvents:!0}},autoTrackPageVisitTime:!0,enableAutoRouteTracking:!0,sessionRenewalMs:p,sessionExpirationMs:p}}):void 0;l?.loadAppInsights();const w=a.debounce((()=>{l?l.trackEvent({name:"Resolution",properties:{"Window Resolution":window.innerWidth+"x"+window.innerHeight,"Screen Resolution":screen.width+"x"+screen.height}}):console.warn('[SAM]: ApplicationInsightsProvider - "appInsights" is undefined, did you set APPLICATION_INSIGHTS_CONNECTION_STRING?')}),5e3),I=({children:n})=>(e((()=>(window.addEventListener("load",w),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),window.removeEventListener("load",w)})),[]),i(t,{value:d,children:n}));export{I as ApplicationInsightsProvider,l as appInsights};
@@ -0,0 +1,3 @@
1
+ import { ICustomProperties, IEventTelemetry, IMetricTelemetry } from '@microsoft/applicationinsights-web';
2
+ export declare function samTrackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void;
3
+ export declare function samTrackMetric(metric: IMetricTelemetry, customProperties?: ICustomProperties): void;
@@ -0,0 +1 @@
1
+ import{appInsights as i}from"./ApplicationInsightsProvider.js";function n(n,t){i?i.trackEvent(n,t):console.warn('[SAM]: ApplicationInsightsProvider - "appInsights" is undefined, did you set APPLICATION_INSIGHTS_CONNECTION_STRING?')}function t(n,t){i?i.trackMetric(n,t):console.warn('[SAM]: ApplicationInsightsProvider - "appInsights" is undefined, did you set APPLICATION_INSIGHTS_CONNECTION_STRING?')}export{n as samTrackEvent,t as samTrackMetric};
@@ -1,3 +1,4 @@
1
1
  export { FeatureToggleProvider } from './FeatureToggleProvider';
2
2
  export { TutorialProvider, useTutorials, } from './TutorialProvider/TutorialProvider';
3
- export { ApplicationInsightsProvider } from './ApplicationInsightsProvider';
3
+ export { ApplicationInsightsProvider } from './ApplicationInsightsProvider/ApplicationInsightsProvider';
4
+ export * from './ApplicationInsightsProvider/ApplicationInsightsProvider.utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{jsx as i}from"react/jsx-runtime";import{useEffect as e}from"react";import{ClickAnalyticsPlugin as n}from"@microsoft/applicationinsights-clickanalytics-js";import{ReactPlugin as o,AppInsightsContext as t}from"@microsoft/applicationinsights-react-js";import{ApplicationInsights as s}from"@microsoft/applicationinsights-web";import{getApplicationInsightsConnectionString as r}from"../utils/environment.js";import{l as a}from"../_virtual/lodash.js";const d=new o,c=new n,p=12e5,m=r(import.meta.env.VITE_APPLICATION_INSIGHTS_CONNECTION_STRING),l=m?new s({config:{connectionString:m,extensions:[d,c],extensionConfig:{[c.identifier]:{autoCapture:!0,dropInvalidEvents:!0}},autoTrackPageVisitTime:!0,enableAutoRouteTracking:!0,sessionRenewalMs:p,sessionExpirationMs:p}}):void 0;l?.loadAppInsights();const w=a.debounce((()=>{l?l.trackEvent({name:"Resolution",properties:{"Window Resolution":window.innerWidth+"x"+window.innerHeight,"Screen Resolution":screen.width+"x"+screen.height}}):console.warn('[SAM]: ApplicationInsightsProvider - "appInsights" is undefined, did you set APPLICATION_INSIGHTS_CONNECTION_STRING?')}),5e3),I=({children:n})=>(e((()=>(window.addEventListener("load",w),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),window.removeEventListener("load",w)})),[]),i(t,{value:d,children:n}));export{I as ApplicationInsightsProvider};