@influenzanet/case-web-app-core 2.7.5-staging.12 → 2.7.5-staging.20

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/CHANGELOG.md CHANGED
@@ -9,9 +9,14 @@
9
9
  ## Added
10
10
 
11
11
  - Thunks available to be used in your application
12
+
12
13
  - `enterStudiesThunk` : used to simplify the assignment of a profile to new studies.
13
14
  It also make sure to fetch new surveys associated to the newly assigned studies.
14
15
 
16
+ - `getReportsForUser` : now support the `limit` parameter. NOTE: it only properly works with versions of the
17
+ study service supporting the parameter server side, otherwise it gets ignored and all results are returned.
18
+ Check study service changelog to see which version supports this new parameter
19
+
15
20
  ## Changed
16
21
 
17
22
  - SurveyList component rework
@@ -1,8 +1,8 @@
1
- import { SurveyReferenceReq, SurveyAndContextMsg, SurveyResponseReq, AssignedSurveys, Studies, SurveyInfos, StudiesForUser, ConvertTempParticipantReq, ReportHistory } from './types/studyAPI';
1
+ import { SurveyReferenceReq, SurveyAndContextMsg, SurveyResponseReq, AssignedSurveys, Studies, SurveyInfos, StudiesForUser, ConvertTempParticipantReq, ReportHistory } from "./types/studyAPI";
2
2
  export declare const getStudiesForUserReq: () => Promise<import("axios").AxiosResponse<StudiesForUser, any>>;
3
3
  export declare const getAllAvailableStudiesReq: () => Promise<import("axios").AxiosResponse<Studies, any>>;
4
4
  export declare const getSurveyInfosForStudyReq: (studyKey: string) => Promise<import("axios").AxiosResponse<SurveyInfos, any>>;
5
- export declare const getReportsForUser: (onlyForStudies?: string[] | undefined, onlyForProfiles?: string[] | undefined, reportKey?: string | undefined, from?: number | undefined, until?: number | undefined, ignoreReports?: string[] | undefined) => Promise<import("axios").AxiosResponse<ReportHistory, any>>;
5
+ export declare const getReportsForUser: (onlyForStudies?: string[] | undefined, onlyForProfiles?: string[] | undefined, reportKey?: string | undefined, from?: number | undefined, until?: number | undefined, ignoreReports?: string[] | undefined, limit?: number | undefined) => Promise<import("axios").AxiosResponse<ReportHistory, any>>;
6
6
  export declare const enterStudyReq: (studyKey: string, profileId: string) => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
7
7
  export declare const leaveStudyRequest: (studyKey: string, profileId: string) => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
8
8
  export declare const getAllAssignedSurveysReq: () => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
package/build/index.es.js CHANGED
@@ -21873,41 +21873,72 @@ var parseGRPCTimestamp = function (grpcValue) {
21873
21873
  };
21874
21874
 
21875
21875
  // Study API
21876
- var getStudiesForUserReq = function () { return authApiInstance.get('/v1/studies/for-user-profiles'); };
21877
- var getAllAvailableStudiesReq = function () { return authApiInstance.get('/v1/studies/active'); };
21878
- var getSurveyInfosForStudyReq = function (studyKey) { return authApiInstance.get("/v1/study/".concat(studyKey, "/survey-infos")); };
21879
- var getReportsForUser = function (onlyForStudies, onlyForProfiles, reportKey, from, until, ignoreReports) { return authApiInstance.get('/v1/reports', {
21880
- params: {
21881
- studies: onlyForStudies ? onlyForStudies.join(',') : undefined,
21882
- profileIds: onlyForProfiles ? onlyForProfiles.join(',') : undefined,
21883
- reportKey: reportKey,
21884
- from: from,
21885
- until: until,
21886
- ignoreReports: ignoreReports ? ignoreReports.join(',') : undefined,
21887
- }
21888
- }); };
21876
+ var getStudiesForUserReq = function () {
21877
+ return authApiInstance.get("/v1/studies/for-user-profiles");
21878
+ };
21879
+ var getAllAvailableStudiesReq = function () {
21880
+ return authApiInstance.get("/v1/studies/active");
21881
+ };
21882
+ var getSurveyInfosForStudyReq = function (studyKey) {
21883
+ return authApiInstance.get("/v1/study/".concat(studyKey, "/survey-infos"));
21884
+ };
21885
+ var getReportsForUser = function (onlyForStudies, onlyForProfiles, reportKey, from, until, ignoreReports, limit) {
21886
+ return authApiInstance.get("/v1/reports", {
21887
+ params: {
21888
+ studies: onlyForStudies ? onlyForStudies.join(",") : undefined,
21889
+ profileIds: onlyForProfiles ? onlyForProfiles.join(",") : undefined,
21890
+ reportKey: reportKey,
21891
+ from: from,
21892
+ until: until,
21893
+ ignoreReports: ignoreReports ? ignoreReports.join(",") : undefined,
21894
+ limit: limit,
21895
+ },
21896
+ });
21897
+ };
21889
21898
  // Study flow
21890
- var enterStudyReq = function (studyKey, profileId) { return authApiInstance.post("/v1/study/".concat(studyKey, "/enter"), { studyKey: studyKey, profileId: profileId }); };
21891
- var leaveStudyRequest = function (studyKey, profileId) { return authApiInstance.post("/v1/study/".concat(studyKey, "/leave"), { studyKey: studyKey, profileId: profileId }); };
21892
- var getAllAssignedSurveysReq = function () { return authApiInstance.get('/v1/studies/all-assigned-surveys'); };
21893
- var getAssignedSurveyRequest = function (payload) { return authApiInstance.get("/v1/study/".concat(payload.studyKey, "/survey/").concat(payload.surveyKey, "?pid=").concat(payload.profileId)); };
21894
- var submitSurveyResponseRequest = function (payload) { return authApiInstance.post("/v1/study/".concat(payload.studyKey, "/submit-response"), payload); };
21899
+ var enterStudyReq = function (studyKey, profileId) {
21900
+ return authApiInstance.post("/v1/study/".concat(studyKey, "/enter"), {
21901
+ studyKey: studyKey,
21902
+ profileId: profileId,
21903
+ });
21904
+ };
21905
+ var leaveStudyRequest = function (studyKey, profileId) {
21906
+ return authApiInstance.post("/v1/study/".concat(studyKey, "/leave"), {
21907
+ studyKey: studyKey,
21908
+ profileId: profileId,
21909
+ });
21910
+ };
21911
+ var getAllAssignedSurveysReq = function () {
21912
+ return authApiInstance.get("/v1/studies/all-assigned-surveys");
21913
+ };
21914
+ var getAssignedSurveyRequest = function (payload) {
21915
+ return authApiInstance.get("/v1/study/".concat(payload.studyKey, "/survey/").concat(payload.surveyKey, "?pid=").concat(payload.profileId));
21916
+ };
21917
+ var submitSurveyResponseRequest = function (payload) {
21918
+ return authApiInstance.post("/v1/study/".concat(payload.studyKey, "/submit-response"), payload);
21919
+ };
21895
21920
  var uploadParticipantFileRequest = function (studyKey, payload) {
21896
21921
  var formdata = new FormData();
21897
- formdata.append('file', payload);
21922
+ formdata.append("file", payload);
21898
21923
  return authApiInstance.post("/v1/study/".concat(studyKey, "/file-upload"), formdata, {
21899
21924
  headers: {
21900
- 'Content-Type': 'multipart/form-data'
21901
- }
21925
+ "Content-Type": "multipart/form-data",
21926
+ },
21927
+ });
21928
+ };
21929
+ var deleteParticipantFilesRequest = function (studyKey, fileIds) {
21930
+ return authApiInstance.post("/v1/study/".concat(studyKey, "/delete-files"), {
21931
+ fileIds: fileIds,
21902
21932
  });
21903
21933
  };
21904
- var deleteParticipantFilesRequest = function (studyKey, fileIds) { return authApiInstance.post("/v1/study/".concat(studyKey, "/delete-files"), { fileIds: fileIds }); };
21905
21934
  // Temporary participants:
21906
21935
  var registerTempParticipantReq = function (params) { return apiInstance.get("/v1/temp-participant/register", { params: params }); };
21907
21936
  var getSurveysForTempParticipantReq = function (params) { return apiInstance.get("/v1/temp-participant/surveys", { params: params }); };
21908
21937
  var getSurveyWithoutLoginReq = function (params) { return apiInstance.get("/v1/temp-participant/survey", { params: params }); };
21909
21938
  var submitSurveyResponseForTempParticipantRequest = function (payload) { return apiInstance.post("/v1/temp-participant/submit-response", payload); };
21910
- var assumeTempParticipantReq = function (payload) { return authApiInstance.post("/v1/study/".concat(payload.studyKey, "/assume-temp-participant"), payload); };
21939
+ var assumeTempParticipantReq = function (payload) {
21940
+ return authApiInstance.post("/v1/study/".concat(payload.studyKey, "/assume-temp-participant"), payload);
21941
+ };
21911
21942
 
21912
21943
  var studyAPI = /*#__PURE__*/Object.freeze({
21913
21944
  __proto__: null,