@equinor/subsurface-app-management 5.4.5 → 5.4.7

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.
@@ -37,4 +37,13 @@ export declare class SurveysPublicService {
37
37
  * @throws ApiError
38
38
  */
39
39
  static upsertSurveyResponse(surveyResponseId: string, requestBody?: AnswerQuestionCommandDto): CancelablePromise<AnswerId>;
40
+ /**
41
+ * Finalizes the survey response
42
+ * ## Business Rules:
43
+ * All questions must be answered before finalizing
44
+ * @param surveyResponseId
45
+ * @returns void
46
+ * @throws ApiError
47
+ */
48
+ static finalizeSurveyResponse(surveyResponseId: string): CancelablePromise<void>;
40
49
  }
@@ -1 +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};
1
+ import{OpenAPI_SAM as e}from"../core/OpenAPI.js";import{request as s}from"../core/request.js";class r{static createSurveyResponse(r,t){return s(e,{method:"POST",url:"/api/v1/surveys/{surveyId}/survey/me",path:{surveyId:r},body:t,mediaType:"application/json",errors:{404:"Not Found",409:"Conflict",422:"Unprocessable Content"}})}static getActiveSurveyForApplication(r){return s(e,{method:"GET",url:"/api/v1/surveys/applications/{applicationName}/me",path:{applicationName:r}})}static upsertSurveyResponse(r,t){return s(e,{method:"PUT",url:"/api/v1/surveys/{surveyResponseId}/responses/me",path:{surveyResponseId:r},body:t,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."}})}static finalizeSurveyResponse(r){return s(e,{method:"PUT",url:"/api/v1/surveys/{surveyResponseId}/responses/me/finalize",path:{surveyResponseId:r},errors:{404:"Survey or question with the specified ID was not found or survey is not active.",409:"Conflict"}})}}export{r as SurveysPublicService};
@@ -7,3 +7,4 @@ export { useSignalRMessages } from './useSignalRMessages';
7
7
  export { useActiveSurvey } from './useActiveSurvey';
8
8
  export { useRespondActiveSurvey } from './useRespondActiveSurvey';
9
9
  export { useAnswerQuestionActiveSurvey } from './useAnswerQuestionActiveSurvey';
10
+ export { useCompleteActiveSurvey } from './useCompleteActiveSurvey';
@@ -1,11 +1,13 @@
1
1
  export declare function useActiveSurvey(): import("@tanstack/react-query").UseQueryResult<{
2
2
  questions: {
3
- options: import("../api").QuestionOptionDto[] | undefined;
3
+ multipleChoiceVm: {
4
+ maxSelectableOptions: number;
5
+ options: import("../api").QuestionOptionDto[];
6
+ } | undefined;
4
7
  questionId: import("../api").QuestionId;
5
8
  type: import("../api").QuestionType;
6
9
  questionText: string;
7
10
  linearScaleVm?: import("../api/models/LinearScaleVm").LinearScaleVm;
8
- multipleChoiceVm?: import("../api/models/MultipleChoiceVm").MultipleChoiceVm;
9
11
  order: number;
10
12
  answer?: import("../api").AnswerVm;
11
13
  }[];
@@ -1 +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 t}from"../constants/queryKeys.js";import{getAppName as r}from"../utils/environment.js";function i(){return e({queryKey:[t],queryFn:()=>o.getActiveSurveyForApplication(r(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.multipleChoiceVm?.options.toSorted(((e,o)=>e.order-o.order))})))}})}export{i as useActiveSurvey};
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 t}from"../constants/queryKeys.js";import{getAppName as i}from"../utils/environment.js";function r(){return e({queryKey:[t],queryFn:()=>o.getActiveSurveyForApplication(i(import.meta.env.VITE_NAME)),select:e=>null===e?null:{...e,questions:e.questions.toSorted(((e,o)=>e.order-o.order)).map((e=>({...e,multipleChoiceVm:e.multipleChoiceVm?{maxSelectableOptions:e.multipleChoiceVm.maxSelectableOptions,options:e.multipleChoiceVm?.options.toSorted(((e,o)=>e.order-o.order))}:void 0})))}})}export{r as useActiveSurvey};
@@ -0,0 +1 @@
1
+ export declare function useCompleteActiveSurvey(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
@@ -0,0 +1 @@
1
+ import{useQueryClient as e,useMutation as o}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 s}from"../api/services/SurveysPublicService.js";import{GET_SURVEY_FOR_APP as t}from"../constants/queryKeys.js";function i(){const i=e();return o({mutationFn:e=>s.finalizeSurveyResponse(e),onSuccess:()=>{i.setQueryData([t],void 0)}})}export{i as useCompleteActiveSurvey};
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{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
+ 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{useCompleteActiveSurvey}from"./hooks/useCompleteActiveSurvey.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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "5.4.5",
3
+ "version": "5.4.7",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",