@equinor/subsurface-app-management 5.2.3 → 5.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.
Files changed (46) hide show
  1. package/dist/api/index.d.ts +23 -0
  2. package/dist/api/models/AnswerId.d.ts +3 -0
  3. package/dist/api/models/AnswerQuestionCommandDto.d.ts +26 -0
  4. package/dist/api/models/AnswerVm.d.ts +8 -0
  5. package/dist/api/models/BugSeverity.d.ts +5 -0
  6. package/dist/api/models/BugSeverity.js +1 -0
  7. package/dist/api/models/OptionId.d.ts +3 -0
  8. package/dist/api/models/QuestionId.d.ts +3 -0
  9. package/dist/api/models/QuestionOptionDto.d.ts +16 -0
  10. package/dist/api/models/QuestionType.d.ts +5 -0
  11. package/dist/api/models/QuestionType.js +1 -0
  12. package/dist/api/models/QuestionVm.d.ts +27 -0
  13. package/dist/api/models/SamWorkItemState.d.ts +6 -0
  14. package/dist/api/models/SamWorkItemState.js +1 -0
  15. package/dist/api/models/StartSurveyDto.d.ts +8 -0
  16. package/dist/api/models/SurveyId.d.ts +3 -0
  17. package/dist/api/models/SurveyResponseId.d.ts +3 -0
  18. package/dist/api/models/SurveyResponseStatus.d.ts +6 -0
  19. package/dist/api/models/SurveyResponseStatus.js +1 -0
  20. package/dist/api/models/SurveyType.d.ts +7 -0
  21. package/dist/api/models/SurveyType.js +1 -0
  22. package/dist/api/models/UserSurveyVm.d.ts +18 -0
  23. package/dist/api/models/WorkItem.d.ts +24 -0
  24. package/dist/api/models/WorkItemAttachment.d.ts +12 -0
  25. package/dist/api/models/WorkItemType.d.ts +4 -0
  26. package/dist/api/models/WorkItemType.js +1 -0
  27. package/dist/api/services/SurveysPublicService.d.ts +40 -0
  28. package/dist/api/services/SurveysPublicService.js +1 -0
  29. package/dist/api/services/WorkItemsService.d.ts +30 -0
  30. package/dist/api/services/WorkItemsService.js +1 -0
  31. package/dist/components/Feature/Feature.js +1 -1
  32. package/dist/constants/queryKeys.d.ts +1 -0
  33. package/dist/constants/queryKeys.js +1 -1
  34. package/dist/hooks/index.d.ts +3 -0
  35. package/dist/hooks/useActiveSurvey.d.ts +27 -0
  36. package/dist/hooks/useActiveSurvey.js +1 -0
  37. package/dist/hooks/useAnswerQuestionActiveSurvey.d.ts +5 -0
  38. package/dist/hooks/useAnswerQuestionActiveSurvey.js +1 -0
  39. package/dist/hooks/useRespondActiveSurvey.d.ts +2 -0
  40. package/dist/hooks/useRespondActiveSurvey.js +1 -0
  41. package/dist/hooks/useSignalRMessages.js +1 -1
  42. package/dist/hooks/useTutorialsQuery.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/providers/TutorialProvider/TutorialProvider.js +1 -1
  45. package/dist/providers/TutorialProvider/hooks/usePrefetchTutorialStepImages.js +1 -1
  46. package/package.json +1 -1
@@ -10,6 +10,7 @@ export type { AccessRoles } from './models/AccessRoles';
10
10
  export type { FeatureAPIType } from './models/FeatureAPIType';
11
11
  export type { FeatureToggleDto } from './models/FeatureToggleDto';
12
12
  export type { GraphUser } from './models/GraphUser';
13
+ export type { GraphAppRole } from './models/GraphAppRole';
13
14
  export type { ImpersonateUserDto } from './models/ImpersonateUserDto';
14
15
  export type { ImpersonateUserUpdateDto } from './models/ImpersonateUserUpdateDto';
15
16
  export type { ReleaseNote } from './models/ReleaseNote';
@@ -25,10 +26,30 @@ export type { MyFeatureDto } from './models/MyFeatureDto';
25
26
  export type { Faq } from './models/Faq';
26
27
  export type { FaqDto } from './models/FaqDto';
27
28
  export type { FaqCategoriesWithFaqDto } from './models/FaqCategoriesWithFaqDto';
29
+ export type { AnswerId } from './models/AnswerId';
30
+ export type { AnswerVm } from './models/AnswerVm';
31
+ export type { AnswerQuestionCommandDto } from './models/AnswerQuestionCommandDto';
32
+ export type { ObjectServiceResponse } from './models/ObjectServiceResponse';
33
+ export type { OptionId } from './models/OptionId';
34
+ export type { QuestionId } from './models/QuestionId';
35
+ export type { QuestionVm } from './models/QuestionVm';
36
+ export { QuestionType } from './models/QuestionType';
37
+ export type { QuestionOptionDto } from './models/QuestionOptionDto';
38
+ export type { StartSurveyDto } from './models/StartSurveyDto';
39
+ export type { SurveyId } from './models/SurveyId';
40
+ export { SurveyType } from './models/SurveyType';
41
+ export type { SurveyResponseId } from './models/SurveyResponseId';
42
+ export { SurveyResponseStatus } from './models/SurveyResponseStatus';
43
+ export type { UserSurveyVm } from './models/UserSurveyVm';
28
44
  export type { ImpactMetric } from './models/ImpactMetric';
29
45
  export type { ImpactMetricDto } from './models/ImpactMetricDto';
30
46
  export type { ImpactUrl } from './models/ImpactUrl';
31
47
  export type { ImpactUrlDto } from './models/ImpactUrlDto';
48
+ export type { WorkItem } from './models/WorkItem';
49
+ export type { WorkItemAttachment } from './models/WorkItemAttachment';
50
+ export { WorkItemType } from './models/WorkItemType';
51
+ export { BugSeverity } from './models/BugSeverity';
52
+ export { SamWorkItemState } from './models/SamWorkItemState';
32
53
  export { AmplifyApplicationService } from './services/AmplifyApplicationService';
33
54
  export { FeatureToggleService } from './services/FeatureToggleService';
34
55
  export { ImpersonateUserService } from './services/ImpersonateUserService';
@@ -38,3 +59,5 @@ export { SlackService } from './services/SlackService';
38
59
  export { TutorialService } from './services/TutorialService';
39
60
  export { FaqService } from './services/FaqService';
40
61
  export { AppAnalyticsService } from './services/AppAnalyticsService';
62
+ export { SurveysPublicService } from './services/SurveysPublicService';
63
+ export { WorkItemsService } from './services/WorkItemsService';
@@ -0,0 +1,3 @@
1
+ export type AnswerId = {
2
+ value: string;
3
+ };
@@ -0,0 +1,26 @@
1
+ import type { AnswerId } from './AnswerId';
2
+ import type { OptionId } from './OptionId';
3
+ import type { QuestionId } from './QuestionId';
4
+ /**
5
+ * Represents an answer to a survey question.
6
+ * Used for public survey responses.
7
+ */
8
+ export type AnswerQuestionCommandDto = {
9
+ id: QuestionId;
10
+ answerId?: AnswerId;
11
+ /**
12
+ * The text answer provided for text questions.
13
+ * Only populated if the question type is Text.
14
+ */
15
+ textAnswer?: string | null;
16
+ /**
17
+ * The numeric answer provided for numeric questions.
18
+ * Only populated if the question type is LinearScale.
19
+ */
20
+ numericAnswer?: number | null;
21
+ /**
22
+ * The list of selected option IDs for multiple choice questions.
23
+ * Only populated if the question type is MultipleChoice.
24
+ */
25
+ selectedOptionIds?: Array<OptionId>;
26
+ };
@@ -0,0 +1,8 @@
1
+ import type { AnswerId } from './AnswerId';
2
+ import type { OptionId } from './OptionId';
3
+ export type AnswerVm = {
4
+ answerId: AnswerId;
5
+ textAnswer?: string | null;
6
+ numericAnswer?: number | null;
7
+ selectedOptions?: Array<OptionId> | null;
8
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum BugSeverity {
2
+ UNABLE_TO_WORK = "UnableToWork",
3
+ DOES_NOT_AFFECT_ME = "DoesNotAffectMe",
4
+ IMPEDES_MY_PROGRESS = "ImpedesMyProgress"
5
+ }
@@ -0,0 +1 @@
1
+ var e;!function(e){e.UNABLE_TO_WORK="UnableToWork",e.DOES_NOT_AFFECT_ME="DoesNotAffectMe",e.IMPEDES_MY_PROGRESS="ImpedesMyProgress"}(e||(e={}));export{e as BugSeverity};
@@ -0,0 +1,3 @@
1
+ export type OptionId = {
2
+ value: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ export type QuestionId = {
2
+ value: string;
3
+ };
@@ -0,0 +1,16 @@
1
+ import type { OptionId } from './OptionId';
2
+ /**
3
+ * Represents a option with all its properties.
4
+ * Used for administering surveys.
5
+ */
6
+ export type QuestionOptionDto = {
7
+ id: OptionId;
8
+ /**
9
+ * The text of the option displayed to respondents.
10
+ */
11
+ optionText: string;
12
+ /**
13
+ * Display order of the option within the question.
14
+ */
15
+ order: number;
16
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum QuestionType {
2
+ TEXT = "Text",
3
+ LINEAR_SCALE = "LinearScale",
4
+ CHOICE = "Choice"
5
+ }
@@ -0,0 +1 @@
1
+ var e;!function(e){e.TEXT="Text",e.LINEAR_SCALE="LinearScale",e.CHOICE="Choice"}(e||(e={}));export{e as QuestionType};
@@ -0,0 +1,27 @@
1
+ import type { AnswerVm } from './AnswerVm';
2
+ import type { QuestionId } from './QuestionId';
3
+ import type { QuestionOptionDto } from './QuestionOptionDto';
4
+ import type { QuestionType } from './QuestionType';
5
+ export type QuestionVm = {
6
+ questionId: QuestionId;
7
+ type: QuestionType;
8
+ order: number;
9
+ /**
10
+ * The text answer provided for text questions.
11
+ * Only populated if the question type is Text.
12
+ */
13
+ text: string;
14
+ /**
15
+ * The list of selected option IDs for choice questions.
16
+ * Only populated if the question type is MultipleChoice.
17
+ */
18
+ options?: Array<QuestionOptionDto> | null;
19
+ maxSelections?: number | null;
20
+ linearScaleConfig?: {
21
+ min: number;
22
+ max: number;
23
+ minLabel: string;
24
+ maxLabel: string;
25
+ };
26
+ answer?: AnswerVm;
27
+ };
@@ -0,0 +1,6 @@
1
+ export declare enum SamWorkItemState {
2
+ NEW = "New",
3
+ IN_PROGRESS = "InProgress",
4
+ CLOSED = "Closed",
5
+ REJECTED = "Rejected"
6
+ }
@@ -0,0 +1 @@
1
+ var e;!function(e){e.NEW="New",e.IN_PROGRESS="InProgress",e.CLOSED="Closed",e.REJECTED="Rejected"}(e||(e={}));export{e as SamWorkItemState};
@@ -0,0 +1,8 @@
1
+ import type { SurveyId } from './SurveyId';
2
+ export type StartSurveyDto = {
3
+ surveyId: SurveyId;
4
+ /**
5
+ * When true, the user opts out of participating in the survey.
6
+ */
7
+ optOut: boolean;
8
+ };
@@ -0,0 +1,3 @@
1
+ export type SurveyId = {
2
+ value: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ export type SurveyResponseId = {
2
+ value: string;
3
+ };
@@ -0,0 +1,6 @@
1
+ export declare enum SurveyResponseStatus {
2
+ NOT_STARTED = "NotStarted",
3
+ IN_PROGRESS = "InProgress",
4
+ COMPLETED = "Completed",
5
+ OPTED_OUT = "OptedOut"
6
+ }
@@ -0,0 +1 @@
1
+ var t;!function(t){t.NOT_STARTED="NotStarted",t.IN_PROGRESS="InProgress",t.COMPLETED="Completed",t.OPTED_OUT="OptedOut"}(t||(t={}));export{t as SurveyResponseStatus};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Defines the types of surveys available in the system.
3
+ */
4
+ export declare enum SurveyType {
5
+ DEFAULT = "Default",
6
+ UMUX = "Umux"
7
+ }
@@ -0,0 +1 @@
1
+ var U;!function(U){U.DEFAULT="Default",U.UMUX="Umux"}(U||(U={}));export{U as SurveyType};
@@ -0,0 +1,18 @@
1
+ import type { QuestionVm } from './QuestionVm';
2
+ import type { SurveyId } from './SurveyId';
3
+ import type { SurveyResponseId } from './SurveyResponseId';
4
+ import type { SurveyResponseStatus } from './SurveyResponseStatus';
5
+ import { SurveyType } from './SurveyType';
6
+ export type UserSurveyVm = {
7
+ surveyId: SurveyId;
8
+ surveyResponseId?: SurveyResponseId;
9
+ status: SurveyResponseStatus;
10
+ surveyType: SurveyType;
11
+ applicationId: string;
12
+ title: string;
13
+ description: string;
14
+ startAt: string;
15
+ endAt: string;
16
+ showConfettiOnComplete: boolean;
17
+ questions: Array<QuestionVm>;
18
+ };
@@ -0,0 +1,24 @@
1
+ import type { BugSeverity } from './BugSeverity';
2
+ import type { SamWorkItemState } from './SamWorkItemState';
3
+ import type { WorkItemAttachment } from './WorkItemAttachment';
4
+ import type { WorkItemType } from './WorkItemType';
5
+ export type WorkItem = {
6
+ updatedBy?: string | null;
7
+ updatedByName?: string | null;
8
+ updatedDate?: string | null;
9
+ createdBy: string;
10
+ createdByName: string;
11
+ createdDate: string;
12
+ title: string;
13
+ description: string;
14
+ applicationName: string;
15
+ browser?: string | null;
16
+ field?: string | null;
17
+ handler?: string | null;
18
+ severity?: BugSeverity;
19
+ workItemType: WorkItemType;
20
+ id: string;
21
+ state: SamWorkItemState;
22
+ userStoryUrl?: string | null;
23
+ attachments: Array<WorkItemAttachment>;
24
+ };
@@ -0,0 +1,12 @@
1
+ export type WorkItemAttachment = {
2
+ updatedBy?: string | null;
3
+ updatedByName?: string | null;
4
+ updatedDate?: string | null;
5
+ createdBy: string;
6
+ createdByName: string;
7
+ createdDate: string;
8
+ id: string;
9
+ fkWorkItemId: string;
10
+ fileName: string;
11
+ filePath: string;
12
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum WorkItemType {
2
+ SUGGESTION = "Suggestion",
3
+ BUG = "Bug"
4
+ }
@@ -0,0 +1 @@
1
+ var g;!function(g){g.SUGGESTION="Suggestion",g.BUG="Bug"}(g||(g={}));export{g as WorkItemType};
@@ -0,0 +1,40 @@
1
+ import type { AnswerId } from '../models/AnswerId';
2
+ import type { AnswerQuestionCommandDto } from '../models/AnswerQuestionCommandDto';
3
+ import type { StartSurveyDto } from '../models/StartSurveyDto';
4
+ import type { SurveyResponseId } from '../models/SurveyResponseId';
5
+ import type { UserSurveyVm } from '../models/UserSurveyVm';
6
+ import type { CancelablePromise } from '../core/CancelablePromise';
7
+ export declare class SurveysPublicService {
8
+ /**
9
+ * Begins a new survey response for the authenticated user for the specified survey.
10
+ * @param surveyId
11
+ * @param requestBody
12
+ * @returns SurveyResponseId OK
13
+ * @throws ApiError
14
+ */
15
+ static createSurveyResponse(surveyId: string, requestBody?: StartSurveyDto): CancelablePromise<SurveyResponseId>;
16
+ /**
17
+ * Returns the active survey for the application that the user has not yet answered for that application.
18
+ * Only returns an Sam.Api.Enums.Surveys.SurveyState.Active survey for the application that the authenticated user has not completed or opted out of.
19
+ * @param applicationName The name of the application.
20
+ * @returns UserSurveyVm The active survey for the application to prompt the user with. Null if no active survey is available.
21
+ * @throws ApiError
22
+ */
23
+ static getActiveSurveyForApplication(applicationName: string): CancelablePromise<UserSurveyVm | null>;
24
+ /**
25
+ * Updates or creates the authenticated user's answer to the question.
26
+ * ## Business Rules:
27
+ * One answer per user per question.
28
+ *
29
+ * ## Restrictions:
30
+ * - The OptionIds listed must exist for that question
31
+ * - The number of OptionIds listed cannot exceed Sam.Api.Models.Dto.SurveyPublic.Response.QuestionPublicDto.MaxSelections for the question.
32
+ * - Survey must be Sam.Api.Enums.Surveys.SurveyState.Active
33
+ * - User cannot have Sam.Api.Enums.Surveys.SurveyResponseStatus.Completed the survey or Sam.Api.Enums.Surveys.SurveyResponseStatus.OptedOut.
34
+ * @param surveyResponseId
35
+ * @param requestBody
36
+ * @returns AnswerId The updated answer.
37
+ * @throws ApiError
38
+ */
39
+ static upsertSurveyResponse(surveyResponseId: string, requestBody?: AnswerQuestionCommandDto): CancelablePromise<AnswerId>;
40
+ }
@@ -0,0 +1 @@
1
+ import{OpenAPI_SAM as e}from"../core/OpenAPI.js";import{request as s}from"../core/request.js";class t{static createSurveyResponse(t,r){return s(e,{method:"POST",url:"/api/v1/surveys/{surveyId}/survey/me",path:{surveyId:t},body:r,mediaType:"application/json",errors:{404:"Not Found",409:"Conflict",422:"Unprocessable Content"}})}static getActiveSurveyForApplication(t){return s(e,{method:"GET",url:"/api/v1/surveys/applications/{applicationName}/me",path:{applicationName:t}})}static upsertSurveyResponse(t,r){return s(e,{method:"PUT",url:"/api/v1/surveys/{surveyResponseId}/responses/me",path:{surveyResponseId:t},body:r,mediaType:"application/json",errors:{404:"Survey or question with the specified ID was not found or survey is not active.",409:"Cannot update answer due to status being completed or opted out.",422:"The provided answer data is invalid."}})}}export{t as SurveysPublicService};
@@ -0,0 +1,30 @@
1
+ import type { BugSeverity } from '../models/BugSeverity';
2
+ import type { WorkItem } from '../models/WorkItem';
3
+ import type { WorkItemType } from '../models/WorkItemType';
4
+ import type { CancelablePromise } from '../core/CancelablePromise';
5
+ export declare class WorkItemsService {
6
+ /**
7
+ * Creates a workItem in SAM, and creates a userstory or bug in Azure devops.
8
+ * Slack comment is always forwarding the slack message first, and then saves in db and creates userstory.
9
+ * Information can be found in the SAM Azure Devops wiki, in the Upscaling wiki.
10
+ * @param slackComment Creates a slack comment in the feedback channel. If empty, no message will be sent.
11
+ * @param attachmentComment Creates a comment to one of the attachments. If empty, no message will be sent.
12
+ * @param formData
13
+ * @returns WorkItem OK
14
+ * @throws ApiError
15
+ */
16
+ static createWorkItemWithAttachment(slackComment?: string, attachmentComment?: string, formData?: {
17
+ /**
18
+ * Files to attach to the user stories.
19
+ */
20
+ fileList?: Array<Blob>;
21
+ Title?: string;
22
+ Description?: string;
23
+ ApplicationName?: string;
24
+ Browser?: string;
25
+ Field?: string;
26
+ IssueUrl?: string;
27
+ Severity?: BugSeverity;
28
+ WorkItemType?: WorkItemType;
29
+ }): CancelablePromise<WorkItem>;
30
+ }
@@ -0,0 +1 @@
1
+ import{OpenAPI_SAM as t}from"../core/OpenAPI.js";import{request as e}from"../core/request.js";class m{static createWorkItemWithAttachment(m,r,a){return e(t,{method:"POST",url:"/api/v1/WorkItems/workitem-with-attachment",query:{slackComment:m,attachmentComment:r},formData:a,mediaType:"multipart/form-data"})}}export{m as WorkItemsService};
@@ -1 +1 @@
1
- import{jsx as o,Fragment as r}from"react/jsx-runtime";import"../../providers/FeatureToggleProvider.js";import{useFeatureToggling as e}from"../../hooks/useFeatureToggling.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import"../../types/Environment.js";import"../../types/ReleaseNotes.js";import"react";import"@microsoft/signalr";const t=({children:t,fallback:i,...s})=>{const{showContent:p}=e({...s});return p?o(r,{children:t}):void 0===i?null:o(r,{children:i})};export{t as Feature};
1
+ import{jsx as o,Fragment as e}from"react/jsx-runtime";import"../../providers/FeatureToggleProvider.js";import{useFeatureToggling as r}from"../../hooks/useFeatureToggling.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import"../../api/models/QuestionType.js";import"../../api/models/SurveyType.js";import"../../api/models/SurveyResponseStatus.js";import"../../api/models/WorkItemType.js";import"../../api/models/BugSeverity.js";import"../../api/models/SamWorkItemState.js";import"../../types/Environment.js";import"../../types/ReleaseNotes.js";import"react";import"@microsoft/signalr";const t=({children:t,fallback:i,...s})=>{const{showContent:p}=r({...s});return p?o(e,{children:t}):void 0===i?null:o(e,{children:i})};export{t as Feature};
@@ -3,4 +3,5 @@ export declare const GET_TUTORIALS_FOR_APP = "getTutorialsForApp";
3
3
  export declare const GET_TUTORIALS_SAS_TOKEN = "getTutorialsSasToken";
4
4
  export declare const GET_RELEASE_NOTES = "getReleaseNotes";
5
5
  export declare const GET_TUTORIAL_STEP_IMAGE = "getTutorialStepImage";
6
+ export declare const GET_SURVEY_FOR_APP = "getSurveyForApp";
6
7
  export declare const SAM_QUERIES: string[];
@@ -1 +1 @@
1
- const e="getFeatureToggleFromAppName",t="getTutorialsForApp",o="getTutorialsSasToken",a="getReleaseNotes",g="getTutorialStepImage",r=[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 GET_TUTORIAL_STEP_IMAGE,r as SAM_QUERIES};
1
+ const e="getFeatureToggleFromAppName",t="getTutorialsForApp",o="getTutorialsSasToken",g="getReleaseNotes",r="getTutorialStepImage",a="getSurveyForApp",p=[e,t,o,g,a];export{e as GET_FEATURE_TOGGLES_FOR_APP,g as GET_RELEASE_NOTES,a as GET_SURVEY_FOR_APP,t as GET_TUTORIALS_FOR_APP,o as GET_TUTORIALS_SAS_TOKEN,r as GET_TUTORIAL_STEP_IMAGE,p as SAM_QUERIES};
@@ -4,3 +4,6 @@ export { useReleaseNotesQuery } from './useReleaseNotesQuery';
4
4
  export { useTutorialsQuery } from './useTutorialsQuery';
5
5
  export { useTutorialStepImage } from './useTutorialStepImage';
6
6
  export { useSignalRMessages } from './useSignalRMessages';
7
+ export { useActiveSurvey } from './useActiveSurvey';
8
+ export { useRespondActiveSurvey } from './useRespondActiveSurvey';
9
+ export { useAnswerQuestionActiveSurvey } from './useAnswerQuestionActiveSurvey';
@@ -0,0 +1,27 @@
1
+ export declare function useActiveSurvey(): import("@tanstack/react-query").UseQueryResult<{
2
+ questions: {
3
+ options: import("../api").QuestionOptionDto[] | undefined;
4
+ questionId: import("../api").QuestionId;
5
+ type: import("../api").QuestionType;
6
+ order: number;
7
+ text: string;
8
+ maxSelections?: number | null;
9
+ linearScaleConfig?: {
10
+ min: number;
11
+ max: number;
12
+ minLabel: string;
13
+ maxLabel: string;
14
+ };
15
+ answer?: import("../api").AnswerVm;
16
+ }[];
17
+ surveyId: import("../api").SurveyId;
18
+ surveyResponseId?: import("../api").SurveyResponseId;
19
+ status: import("../api").SurveyResponseStatus;
20
+ surveyType: import("../api").SurveyType;
21
+ applicationId: string;
22
+ title: string;
23
+ description: string;
24
+ startAt: string;
25
+ endAt: string;
26
+ showConfettiOnComplete: boolean;
27
+ } | null, Error>;
@@ -0,0 +1 @@
1
+ import{useQuery as e}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"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import"../types/Environment.js";import"../types/ReleaseNotes.js";import{SurveysPublicService as o}from"../api/services/SurveysPublicService.js";import{GET_SURVEY_FOR_APP as r}from"../constants/queryKeys.js";import{getAppName as t}from"../utils/environment.js";function i(){return e({queryKey:[r],queryFn:()=>o.getActiveSurveyForApplication(t(import.meta.env.VITE_NAME)),select:e=>null===e?null:{...e,questions:e.questions.toSorted(((e,o)=>e.order-o.order)).map((e=>({...e,options:e.options?.toSorted(((e,o)=>e.order-o.order))})))}})}export{i as useActiveSurvey};
@@ -0,0 +1,5 @@
1
+ import { AnswerQuestionCommandDto } from '../api';
2
+ export declare function useAnswerQuestionActiveSurvey(): import("@tanstack/react-query").UseMutationResult<import("../api").AnswerId, Error, {
3
+ surveyResponseId: string;
4
+ body: AnswerQuestionCommandDto;
5
+ }, unknown>;
@@ -0,0 +1 @@
1
+ import{useMutation as e}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"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import"../types/Environment.js";import"../types/ReleaseNotes.js";import{SurveysPublicService as o}from"../api/services/SurveysPublicService.js";function s(){return e({mutationFn:({surveyResponseId:e,body:s})=>o.upsertSurveyResponse(e,s)})}export{s as useAnswerQuestionActiveSurvey};
@@ -0,0 +1,2 @@
1
+ import { StartSurveyDto } from '../api';
2
+ export declare function useRespondActiveSurvey(): import("@tanstack/react-query").UseMutationResult<import("../api").SurveyResponseId, Error, StartSurveyDto, unknown>;
@@ -0,0 +1 @@
1
+ import{useQueryClient as e,useMutation as t}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"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import{SurveyResponseStatus as o}from"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import"../types/Environment.js";import"../types/ReleaseNotes.js";import{SurveysPublicService as s}from"../api/services/SurveysPublicService.js";import{GET_SURVEY_FOR_APP as r}from"../constants/queryKeys.js";function i(){const i=e();return t({mutationFn:async e=>{const t=await s.createSurveyResponse(e.surveyId.value,e);return i.setQueryData([r],(s=>s?e.optOut?void 0:{...s,surveyResponseId:t,status:o.IN_PROGRESS}:s)),t}})}export{i as useRespondActiveSurvey};
@@ -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 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"../types/ReleaseNotes.js";import{getEnvironmentName as u}from"../utils/environment.js";function m(m){const p=e(void 0),[d,l]=r([]),[g,f]=r(),[b,v]=r(),w=e(void 0),N=e(void 0),{data:S}=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===S||w.current===m&&N.current===S)return;void 0!==p.current&&w.current&&N.current&&(w.current!==m||N.current!==S)&&await p.current.stop(),N.current=S,w.current=m;const e=(new o.HubConnectionBuilder).configureLogging(s.Error).withUrl(`${y}/hubs/notifications`,{accessTokenFactory:()=>S,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)}p.current=e})().catch((e=>{console.error("Error setting up connection",e)}))}),[y,m,S]),n((()=>{if(b){const e=d.findIndex((e=>e.SequenceNumber===b.SequenceNumber)),r=[...d];e>-1&&(r[e]=b,l(r),v(void 0))}}),[b,d]),n((()=>{if(g){const e=d.findIndex((e=>e.SequenceNumber===g)),r=[...d];e>-1&&(r.splice(e,1),l(r),f(void 0))}}),[g,d]);const E=e=>{p.current&&(e.Read=!e.Read,p.current.invoke("PatchMessage",e.SequenceNumber,e).catch((e=>{console.error("Error setting message as read",e)})))},k=t((()=>d.some((e=>!1===e.Read))),[d]);return{messages:d,hasUnreadMessages:k,setMessageAsRead:E,setAllMessagesAsRead:()=>{d.forEach((e=>{e.Read||E(e)}))},deleteMessage:async function(e){p.current&&null!==e.SequenceNumber&&(await p.current.invoke("DeleteMessage",e.SequenceNumber),f(e.SequenceNumber))},closeConnection:async()=>{if(p.current)return await p.current.stop()}}}export{m as useSignalRMessages};
1
+ import{useRef as e,useState as r,useMemo as t,useEffect as o}from"react";import*as n from"@microsoft/signalr";import{LogLevel as s}from"@microsoft/signalr";import{useQuery as i}from"@tanstack/react-query";import{getSAMToken as a}from"../api/core/OpenAPI.js";import"../api/models/ApplicationCategory.js";import"../api/models/ServiceNowUrgency.js";import"../api/models/TutorialPosition.js";import"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import{EnvironmentType as c}from"../types/Environment.js";import"../types/ReleaseNotes.js";import{getEnvironmentName as u}from"../utils/environment.js";function m(m){const p=e(void 0),[d,l]=r([]),[g,f]=r(),[v,S]=r(),y=e(void 0),b=e(void 0),{data:j}=i({queryKey:["get-sam-token"],queryFn:()=>a()}),w=t((()=>{const e=u(import.meta.env.VITE_ENVIRONMENT_NAME);return`wss://api-sam-backend-${e===c.LOCALHOST?c.DEVELOP:e}.radix.equinor.com`}),[]);o((()=>{(async function(){if(void 0===j||y.current===m&&b.current===j)return;void 0!==p.current&&y.current&&b.current&&(y.current!==m||b.current!==j)&&await p.current.stop(),b.current=j,y.current=m;const e=(new n.HubConnectionBuilder).configureLogging(s.Error).withUrl(`${w}/hubs/notifications`,{accessTokenFactory:()=>j,withCredentials:!1,skipNegotiation:!0,transport:n.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)=>{S({...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)}p.current=e})().catch((e=>{console.error("Error setting up connection",e)}))}),[w,m,j]),o((()=>{if(v){const e=d.findIndex((e=>e.SequenceNumber===v.SequenceNumber)),r=[...d];e>-1&&(r[e]=v,l(r),S(void 0))}}),[v,d]),o((()=>{if(g){const e=d.findIndex((e=>e.SequenceNumber===g)),r=[...d];e>-1&&(r.splice(e,1),l(r),f(void 0))}}),[g,d]);const N=e=>{p.current&&(e.Read=!e.Read,p.current.invoke("PatchMessage",e.SequenceNumber,e).catch((e=>{console.error("Error setting message as read",e)})))},k=t((()=>d.some((e=>!1===e.Read))),[d]);return{messages:d,hasUnreadMessages:k,setMessageAsRead:N,setAllMessagesAsRead:()=>{d.forEach((e=>{e.Read||N(e)}))},deleteMessage:async function(e){p.current&&null!==e.SequenceNumber&&(await p.current.invoke("DeleteMessage",e.SequenceNumber),f(e.SequenceNumber))},closeConnection:async()=>{if(p.current)return await p.current.stop()}}}export{m as useSignalRMessages};
@@ -1 +1 @@
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{EnvironmentType as t}from"../types/Environment.js";import"../types/ReleaseNotes.js";import{TutorialService as e}from"../api/services/TutorialService.js";import{GET_TUTORIALS_FOR_APP as o}from"../constants/queryKeys.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)===t.PRODUCTION){return(await e.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(await e.getDraftTutorialsForApplication(s(import.meta.env.VITE_NAME))).map((r=>({...r,steps:r.steps.sort(((r,t)=>(r.orderBy??0)-(t.orderBy??0)))})))}})}export{p as useTutorialsQuery};
1
+ import{useQuery as t}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"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import{EnvironmentType as r}from"../types/Environment.js";import"../types/ReleaseNotes.js";import{TutorialService as e}from"../api/services/TutorialService.js";import{GET_TUTORIALS_FOR_APP as o}from"../constants/queryKeys.js";import{getEnvironmentName as i,getAppName as s}from"../utils/environment.js";function p(){return t({queryKey:[o],queryFn:async()=>{if(i(import.meta.env.VITE_ENVIRONMENT_NAME)===r.PRODUCTION){return(await e.getMyTutorialsForApplication(s(import.meta.env.VITE_NAME),!1)).map((t=>({...t,id:t.tutorialDraftId?t.tutorialDraftId:t.id,steps:t.steps.sort(((t,r)=>(t.orderBy??0)-(r.orderBy??0)))})))}return(await e.getDraftTutorialsForApplication(s(import.meta.env.VITE_NAME))).map((t=>({...t,steps:t.steps.sort(((t,r)=>(t.orderBy??0)-(r.orderBy??0)))})))}})}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{EnvironmentToggleFeatures,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{AppAnalyticsService}from"./api/services/AppAnalyticsService.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";export{ENVIRONMENT_TOGGLE_KEY}from"./constants/environmentToggle.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{useActiveSurvey}from"./hooks/useActiveSurvey.js";export{useRespondActiveSurvey}from"./hooks/useRespondActiveSurvey.js";export{useAnswerQuestionActiveSurvey}from"./hooks/useAnswerQuestionActiveSurvey.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{EnvironmentToggleFeatures,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{QuestionType}from"./api/models/QuestionType.js";export{SurveyType}from"./api/models/SurveyType.js";export{SurveyResponseStatus}from"./api/models/SurveyResponseStatus.js";export{WorkItemType}from"./api/models/WorkItemType.js";export{BugSeverity}from"./api/models/BugSeverity.js";export{SamWorkItemState}from"./api/models/SamWorkItemState.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{AppAnalyticsService}from"./api/services/AppAnalyticsService.js";export{SurveysPublicService}from"./api/services/SurveysPublicService.js";export{WorkItemsService}from"./api/services/WorkItemsService.js";export{GET_FEATURE_TOGGLES_FOR_APP,GET_RELEASE_NOTES,GET_SURVEY_FOR_APP,GET_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,GET_TUTORIAL_STEP_IMAGE,SAM_QUERIES}from"./constants/queryKeys.js";export{ENVIRONMENT_TOGGLE_KEY}from"./constants/environmentToggle.js";
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{createContext as r,useState as t,useMemo as i,useContext as e}from"react";import{useMatchRoute as s}from"@tanstack/react-router";import{useSeenTutorials as a}from"./useSeenTutorials.js";import"../FeatureToggleProvider.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import{useTutorialsQuery as n}from"../../hooks/useTutorialsQuery.js";import"../../types/Environment.js";import"../../types/ReleaseNotes.js";import"@microsoft/signalr";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import{usePrefetchTutorialStepImages as u}from"./hooks/usePrefetchTutorialStepImages.js";const p=r(void 0);function l(){const o=e(p);if(void 0===o)throw new Error("'useTutorials' must be used within provider");return o}const d=({children:r})=>{const{data:e=[]}=n(),[l,d]=t(void 0),[m,c]=t(void 0),[v,f]=a();u();const T=s(),h=e?.filter((o=>!!T({to:o.path}))),w=i((()=>h?.filter((o=>!v.includes(o.id)&&o.willPopUp))),[v,h]);return o(p.Provider,{value:{allTutorials:e,tutorialsOnThisPage:h,unseenTutorialsOnThisPage:w,activeTutorial:l,activeStep:m,seenTutorialIDs:v,startTutorial:o=>{if(!e?.some((r=>o===r.id)))throw new Error("Tutorial not found");d(e.find((r=>o===r.id))),c(0)},skipTutorial:o=>{l&&l.id===o&&(d(void 0),c(void 0)),f(o)},goToNextStep:()=>{if(!l)throw new Error("No currently active tutorial!");if(void 0===m)throw new Error("activeStep is undefined!");m+1>=l.steps.length?(f(l.id),d(void 0),c(void 0)):c(m+1)},goToPreviousStep:()=>{if(!l)throw new Error("No currently active tutorial!");if(void 0===m)throw new Error("activeStep is undefined!");0===m?(d(void 0),c(void 0)):c(m-1)}},children:r})};export{p as TutorialDataContext,d as TutorialProvider,l as useTutorials};
1
+ import{jsx as o}from"react/jsx-runtime";import{createContext as r,useState as t,useMemo as i,useContext as e}from"react";import{useMatchRoute as s}from"@tanstack/react-router";import{useSeenTutorials as a}from"./useSeenTutorials.js";import"../FeatureToggleProvider.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import{useTutorialsQuery as p}from"../../hooks/useTutorialsQuery.js";import"../../types/Environment.js";import"../../types/ReleaseNotes.js";import"@microsoft/signalr";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import"../../api/models/QuestionType.js";import"../../api/models/SurveyType.js";import"../../api/models/SurveyResponseStatus.js";import"../../api/models/WorkItemType.js";import"../../api/models/BugSeverity.js";import"../../api/models/SamWorkItemState.js";import{usePrefetchTutorialStepImages as n}from"./hooks/usePrefetchTutorialStepImages.js";const m=r(void 0);function u(){const o=e(m);if(void 0===o)throw new Error("'useTutorials' must be used within provider");return o}const l=({children:r})=>{const{data:e=[]}=p(),[u,l]=t(void 0),[d,c]=t(void 0),[v,f]=a();n();const T=s(),j=e?.filter((o=>!!T({to:o.path}))),h=i((()=>j?.filter((o=>!v.includes(o.id)&&o.willPopUp))),[v,j]);return o(m.Provider,{value:{allTutorials:e,tutorialsOnThisPage:j,unseenTutorialsOnThisPage:h,activeTutorial:u,activeStep:d,seenTutorialIDs:v,startTutorial:o=>{if(!e?.some((r=>o===r.id)))throw new Error("Tutorial not found");l(e.find((r=>o===r.id))),c(0)},skipTutorial:o=>{u&&u.id===o&&(l(void 0),c(void 0)),f(o)},goToNextStep:()=>{if(!u)throw new Error("No currently active tutorial!");if(void 0===d)throw new Error("activeStep is undefined!");d+1>=u.steps.length?(f(u.id),l(void 0),c(void 0)):c(d+1)},goToPreviousStep:()=>{if(!u)throw new Error("No currently active tutorial!");if(void 0===d)throw new Error("activeStep is undefined!");0===d?(l(void 0),c(void 0)):c(d-1)}},children:r})};export{m as TutorialDataContext,l as TutorialProvider,u as useTutorials};
@@ -1 +1 @@
1
- import{useRef as r,useEffect as o}from"react";import{useQueryClient as e}from"@tanstack/react-query";import{TutorialService as t}from"../../../api/services/TutorialService.js";import{GET_TUTORIAL_STEP_IMAGE as i}from"../../../constants/queryKeys.js";import"../../FeatureToggleProvider.js";import"../../../api/core/OpenAPI.js";import{useTutorialsQuery as s}from"../../../hooks/useTutorialsQuery.js";import"@microsoft/signalr";import"../../../api/models/ApplicationCategory.js";import"../../../api/models/ServiceNowUrgency.js";import"../../../api/models/TutorialPosition.js";import"../../../types/Environment.js";import"../../../types/ReleaseNotes.js";function m(){const{data:m=[]}=s(),p=e(),a=r([]);o((()=>{const r=r=>{for(const o of r.steps)o.imgUrl&&p.prefetchQuery({queryKey:[i,o.imgUrl],queryFn:()=>t.getTutorialImage(o.imgUrl),staleTime:1/0,gcTime:1/0})};for(const o of m)a.current.includes(o.id)||(a.current.push(o.id),r(o))}),[p,m])}export{m as usePrefetchTutorialStepImages};
1
+ import{useRef as e,useEffect as o}from"react";import{useQueryClient as r}from"@tanstack/react-query";import{TutorialService as t}from"../../../api/services/TutorialService.js";import{GET_TUTORIAL_STEP_IMAGE as i}from"../../../constants/queryKeys.js";import"../../FeatureToggleProvider.js";import"../../../api/core/OpenAPI.js";import{useTutorialsQuery as s}from"../../../hooks/useTutorialsQuery.js";import"@microsoft/signalr";import"../../../api/models/ApplicationCategory.js";import"../../../api/models/ServiceNowUrgency.js";import"../../../api/models/TutorialPosition.js";import"../../../api/models/QuestionType.js";import"../../../api/models/SurveyType.js";import"../../../api/models/SurveyResponseStatus.js";import"../../../api/models/WorkItemType.js";import"../../../api/models/BugSeverity.js";import"../../../api/models/SamWorkItemState.js";import"../../../types/Environment.js";import"../../../types/ReleaseNotes.js";function m(){const{data:m=[]}=s(),p=r(),a=e([]);o((()=>{const e=e=>{for(const o of e.steps)o.imgUrl&&p.prefetchQuery({queryKey:[i,o.imgUrl],queryFn:()=>t.getTutorialImage(o.imgUrl),staleTime:1/0,gcTime:1/0})};for(const o of m)a.current.includes(o.id)||(a.current.push(o.id),e(o))}),[p,m])}export{m as usePrefetchTutorialStepImages};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "5.2.3",
3
+ "version": "5.4.0",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",