{"version":3,"sources":["webpack:///./src/services/ReportingPeriodService.ts","webpack:///./src/services/StatePlanReportService.ts","webpack:///./src/services/OrganizationUserService.ts","webpack:///./src/services/fetch.ts","webpack:///./src/services/CentralPlanReportService.ts","webpack:///external \"jQuery\"","webpack:///./src/signalrwrapper.ts","webpack:///./src/services/ZonePlanReportService.ts","webpack:///external \"toastr\"","webpack:///external \"moment\"","webpack:///./src/services/OrganizationService.ts","webpack:///./src/services/UnitPlanReportService.ts","webpack:///./src/utils/browserStorage.ts","webpack:///./src/services/AllKpiReportsService.ts","webpack:///./src/services/AllReportsService.ts","webpack:///./src/services/AdminService.ts"],"names":["reportingPeriodServiceUrl","apiBaseUrl","getReportingPeriodsToCreatePlan","organizationId","getNextReportingPeriod","reportId","statePlanReportServiceUrl","getPlan","planId","includeKpi","this","updatePlan","planData","JSON","stringify","createPlan","organizationReference","year","reportingTerm","createPlan2","reportingFrequency","copy","copyFrom","organization","submitPlan","updateReportLastPeriodFromModel","getReport","updateReport","reportData","updateReportLastPeriod","reportLastPeriodUpdateData","submitReport","unsubmitReport","downloadReport","excelReportType","resetPlan","resetYPlanFromQ","resetReport","resetYReportFromQ","recalculatePlan","recalculateYPlanFromQ","recalculateReport","recalculateYReportFromQ","delete","organizationUserServiceUrl","search","organizationUserSearchTerms","toQry","searchAllRecords","create","username","organizationRoleType","encodeURIComponent","organizationUserId","fetchWithAccessToken","url","authservice","instance","get","headers","Headers","set","getAccessToken","fetch","then","response","status","json","toastr","error","statusText","Error","fetchPostWithAccessToken","jsonBody","signalrwrapper","signalrConnection","id","method","body","console","log","fetchFileWithAccessToken","blob","centralPlanReportServiceUrl","module","exports","jQuery","SignalrConnectionState","eventName","callback","dispose","undefined","eventHandlers","onDisconnected","disposeConnectionStateChangedEventHandler","stop","window","setTimeout","start","subscribeToHubEvents","unsubscribeFromHubEvents","i","length","eventHandler","reportingModuleHubProxy","off","on","auth0","base","returnTo","hubConnection","useDefaultPath","createHubProxy","done","state","logging","fail","connectionStateChangedEventHandler","getConnectionStateChangedEventHandler","stateChanged","handler","h","cancelled","change","cancel","newState","disconnected","forEach","push","SignalREventHandler","eventHandlerToRemoveIndex","eventHandlerToRemove","splice","invoke","methodName","newArgs","concat","args","apply","zonePlanReportServiceUrl","moment","organizationServiceUrl","organizationSearchTerms","myorganizations","description","details","organizationType","parents","ok","catch","message","update","getOrganization","getAvailableParents","excludeOrgId","searchTerms","result","items","filter","org","map","unitPlanReportServiceUrl","bucketName","settings","canUseStorage","storage","setItem","removeItem","e","noop","getBucketKey","bucket","key","setInternal","value","getInternal","parse","removeInternal","clearInternal","l","keys","split","k2","localStorage","a","b","_","remove","clear","kpiReportServiceUrl","report","reportSearchTerms","reportServiceUrl","download","pingServiceUrl","ping","updateAllOrganizationUnitCounts","forceRecalculation"],"mappings":"8FACA,4DAGA,wBACI,KAAAA,0BAA+B,IAAIC,WAAU,gCAE7C,KAAAC,gCAAkC,SAACC,GAC/B,OAAO,YAAwB,EAAKH,0BAAyB,kCAAkCG,IAGnG,KAAAC,uBAAyB,SAACC,GACtB,OAAO,YAAwB,EAAKL,0BAAyB,kBAAkBK,M,oCCZvF,4DAaA,0BACI,KAAAC,0BAA+B,IAAIL,WAAU,sBA+FjD,OA7FI,YAAAM,QAAA,SAAQC,EAAgBC,GACpB,YADoB,IAAAA,OAAA,GACb,YAAwBC,KAAKJ,0BAAyB,SAASE,EAAM,eAAeC,IAG/F,YAAAE,WAAA,SAAWR,EAAwBK,EAAgBI,GAC/C,OAAO,YAA4BF,KAAKJ,0BAAyB,+BAA+BH,EAAc,WAAWK,EACrHK,KAAKC,UAAUF,KAGvB,YAAAG,WAAA,SAAWC,EAA8CC,EAAcC,GACnE,OAAO,YAA4BR,KAAKJ,0BAAyB,qBAAqBW,EAAI,kBAAkBC,EACxGL,KAAKC,UAAUE,KAGvB,YAAAG,YAAA,SAAYH,EAA8CC,EAAcC,EAA8BE,GAClG,OAAO,YAA4BV,KAAKJ,0BAAyB,sBAAsBW,EAAI,kBAA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EAAKC,iBAAgB,aAAaD,EAAkBhJ,Y,kCCd/F,4DAGA,0BACI,KAAAmJ,eAAoB,IAAIjM,WAAU,qBAUtC,OARI,YAAAkM,KAAA,SAAK7C,GACD,OAAO,YAAyB5I,KAAKwL,eAAgB5C,IAGzD,YAAA8C,gCAAA,SAAgCC,QAAA,IAAAA,OAAA,GAC5B,IAAM9I,EAAS,IAAItD,WAAU,iFAAiFoM,EAC9G,OAAO,YAAyB9I,EAAK,OAE7C,EAXA,K","file":"app~e3f5d840.a7d4fc272f01582b1bd4.chunk.js","sourcesContent":["import { ReportingPeriodViewModel } from \"models/ReportingPeriodViewModel\";\r\nimport { fetchWithAccessToken } from \"./fetch\";\r\nimport env from \"../environment\";\r\n\r\nexport class ReportingPeriodService {\r\n reportingPeriodServiceUrl = `${env.apiBaseUrl}/reporting/v1/reportingperiod`;\r\n\r\n getReportingPeriodsToCreatePlan = (organizationId: number): Promise => {\r\n return fetchWithAccessToken(`${this.reportingPeriodServiceUrl}/oforganization?organizationId=${organizationId}`);\r\n }\r\n\r\n getNextReportingPeriod = (reportId: number): Promise => {\r\n return fetchWithAccessToken(`${this.reportingPeriodServiceUrl}/next?reportId=${reportId}`);\r\n }\r\n}","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { StatePlanViewModelDto } from \"../models/StatePlanViewModelDto\";\r\nimport { StateReportViewModelDto } from \"../models/StateReportViewModelDto\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\n\r\nexport class StatePlanReportService {\r\n statePlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/state`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.statePlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`,\r\n JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.statePlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n \r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n \r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.statePlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","import env from \"../environment\";\r\nimport { OrganizationUserSearchTerms } from \"models/OrganizationUserSearchTerms\";\r\nimport { OrganizationUserViewModelDto } from \"models/OrganizationUserViewModelDto\";\r\nimport { OrganizationRoleType } from \"models/OrganizationRoleType\";\r\nimport { EntityReference } from \"models/EntityReference\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\n\r\nexport class OrganizationUserService {\r\n organizationUserServiceUrl = `${env.apiBaseUrl}/reporting/v1/organization/user`;\r\n\r\n search = (organizationUserSearchTerms: OrganizationUserSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.organizationUserServiceUrl}/search?${organizationUserSearchTerms.toQry()}`);\r\n }\r\n\r\n searchAllRecords = (organizationUserSearchTerms: OrganizationUserSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationUserServiceUrl}/search?`);\r\n }\r\n\r\n create(username: string, organizationRoleType: OrganizationRoleType, organization: EntityReference): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationUserServiceUrl}/create?username=${encodeURIComponent(username)}&organizationRoleType=${organizationRoleType}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n delete(organizationUserId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationUserServiceUrl}/delete?organizationUserId=${organizationUserId}`);\r\n }\r\n}\r\n","import { Container } from \"aurelia-framework\";\r\nimport { AuthService } from \"../auth-service\";\r\nimport { SignalrWrapper } from \"signalrwrapper\";\r\n\r\nexport function fetchWithAccessToken(url: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n \r\n return fetch(url, {\r\n headers: headers\r\n })\r\n .then(response => {\r\n if (response.status === 200) {\r\n return response.json();\r\n }\r\n toastr.error(response.statusText);\r\n throw new Error(response.statusText);\r\n }, error => {\r\n throw error;\r\n });\r\n}\r\n\r\nexport function fetchPostWithAccessToken(url: string, jsonBody?: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n \r\n return fetch(url, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: jsonBody,\r\n })\r\n .then(response => {\r\n console.log(response);\r\n if (response.status === 200) {\r\n return;\r\n }\r\n if(response.status === 404) {\r\n throw Error(\"Not Found\");\r\n }\r\n }, error => {\r\n console.log(error);\r\n throw error;\r\n });\r\n}\r\n\r\nexport function fetchFileWithAccessToken(url: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n \r\n return fetch(url, {\r\n headers: headers\r\n })\r\n .then(response => {\r\n if (response.status === 200) {\r\n return response.blob();\r\n }\r\n }, error => {\r\n console.log(error);\r\n throw error;\r\n });\r\n}","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { CentralPlanViewModelDto } from \"models/CentralPlanViewModelDto\";\r\nimport { CentralReportViewModelDto } from \"models/CentralReportViewModelDto\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class CentralPlanReportService {\r\n centralPlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/central`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`, JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`, JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.centralPlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`, JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.centralPlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","module.exports = jQuery;","import $ from \"jquery\";\r\nimport env from \"./environment\";\r\n\r\nexport class SignalREventHandler {\r\n constructor(public eventName: string, public callback: (...msg: any[]) => void) {}\r\n dispose() {\r\n this.callback = undefined;\r\n }\r\n}\r\n\r\nexport enum SignalrConnectionState {\r\n connecting= 0,\r\n connected= 1,\r\n reconnecting= 2,\r\n disconnected= 4\r\n}\r\n\r\n// url without generated proxy - https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-server#signalrurl\r\n// signalr javascript client guide - https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client\r\nexport class SignalrWrapper {\r\n\r\n signalrConnection: SignalR.Hub.Connection;\r\n reportingModuleHubProxy: SignalR.Hub.Proxy;\r\n eventHandlers: SignalREventHandler[] = [];\r\n connectionStateChangedEventHandler : {\r\n cancelled: boolean;\r\n handler: (change: SignalR.StateChanged) => void,\r\n cancel: () => void,\r\n onDisconnected: () => void\r\n };\r\n\r\n start() {\r\n console.log(`env.apiBaseUrl is: ${env.apiBaseUrl}, env.auth0.base is: ${env.auth0.base}, env.auth0.returnTo is: ${env.auth0.returnTo}`);\r\n this.signalrConnection = $.hubConnection(`${env.apiBaseUrl}/signalr`, {useDefaultPath: false});\r\n // this.signalrConnection.logging = true; // use a feature toggle here\r\n this.reportingModuleHubProxy = this.signalrConnection.createHubProxy('reportingModuleHub');\r\n this.reportingModuleHubProxy.on(\"dummyFunc\", () => {});\r\n window.setTimeout(() => {\r\n return this.signalrConnection.start()\r\n .done(() => {\r\n console.log([\"SignalR connected, connection ID:state:logging \",\r\n this.signalrConnection.id, SignalrConnectionState[this.signalrConnection.state], this.signalrConnection.logging]);\r\n })\r\n .fail(function () {\r\n console.log(\"Could not connect SignalR\");\r\n });\r\n }, 0);\r\n this.connectionStateChangedEventHandler = this.getConnectionStateChangedEventHandler();\r\n this.signalrConnection.stateChanged(this.connectionStateChangedEventHandler.handler);\r\n }\r\n \r\n getConnectionStateChangedEventHandler() {\r\n const h = {\r\n cancelled: false,\r\n handler: (change: SignalR.StateChanged) => {},\r\n cancel: () => {},\r\n onDisconnected: this.onDisconnected\r\n };\r\n\r\n h.handler = (change: SignalR.StateChanged) => {\r\n console.log(`Connection state is: ${change.newState}, enum is: ${SignalrConnectionState[change.newState]}`);\r\n if(h.cancelled){\r\n console.log(\"disconnected\");\r\n return;\r\n }\r\n if(change.newState === SignalrConnectionState.disconnected) {\r\n h.onDisconnected();\r\n }\r\n };\r\n\r\n h.cancel = () => {\r\n h.cancelled = true;\r\n h.onDisconnected = undefined;\r\n };\r\n\r\n return h;\r\n }\r\n\r\n onDisconnected = (): void => {\r\n console.log(\"onDisconnected Cleanup\");\r\n this.disposeConnectionStateChangedEventHandler();\r\n console.log(\"onDisconnected stop previous connection\");\r\n this.signalrConnection.stop();\r\n console.log(\"onDisconnected call start in 5 seconds\");\r\n window.setTimeout(() => {\r\n console.log(\"onDisconnected calling start\");\r\n this.start();\r\n console.log(\"onDisconnected re-subscribe event handlers\");\r\n this.subscribeToHubEvents();\r\n }, 5000);\r\n }\r\n\r\n unsubscribeFromHubEvents = () => {\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n const eventHandler = this.eventHandlers[i];\r\n this.reportingModuleHubProxy.off(eventHandler.eventName, eventHandler.callback);\r\n }\r\n }\r\n\r\n subscribeToHubEvents = () => {\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n const eventHandler = this.eventHandlers[i];\r\n this.reportingModuleHubProxy.on(eventHandler.eventName, eventHandler.callback);\r\n }\r\n }\r\n\r\n disposeConnectionStateChangedEventHandler() {\r\n this.connectionStateChangedEventHandler.cancel();\r\n this.unsubscribeFromHubEvents();\r\n this.reportingModuleHubProxy = undefined;\r\n }\r\n\r\n dispose() {\r\n this.disposeConnectionStateChangedEventHandler();\r\n this.connectionStateChangedEventHandler = undefined;\r\n this.eventHandlers.forEach(eventHandler => eventHandler.dispose());\r\n }\r\n\r\n on(eventName: string, callback: (...msg: any[]) => void): void {\r\n this.eventHandlers.push(new SignalREventHandler(eventName, callback));\r\n this.reportingModuleHubProxy.on(eventName, callback);\r\n }\r\n\r\n off(eventName: string, callback: (...msg: any[]) => void): void {\r\n let eventHandlerToRemoveIndex = -1;\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n if (this.eventHandlers[i].eventName === eventName && this.eventHandlers[i].callback === callback) {\r\n eventHandlerToRemoveIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n if (eventHandlerToRemoveIndex !== -1) {\r\n const eventHandlerToRemove = this.eventHandlers[eventHandlerToRemoveIndex];\r\n this.reportingModuleHubProxy.off(eventName, callback);\r\n eventHandlerToRemove.dispose();\r\n this.eventHandlers.splice(eventHandlerToRemoveIndex, 1);\r\n }\r\n }\r\n\r\n invoke(methodName: string, ...args: any[]): JQueryPromise {\r\n const newArgs = [methodName].concat(args);\r\n return this.reportingModuleHubProxy.invoke.apply(this.reportingModuleHubProxy, newArgs);\r\n } \r\n}","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ZonePlanViewModelDto } from \"models/ZonePlanViewModelDto\";\r\nimport { ZoneReportViewModelDto } from \"models/ZoneReportViewModelDto\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class ZonePlanReportService {\r\n zonePlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/zone`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`, JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`, JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.zonePlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`, JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.zonePlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","module.exports = toastr;","module.exports = moment;","import env from \"../environment\";\r\nimport { OrganizationSearchTerms } from \"models/OrganizationSearchTerms\";\r\nimport { OrganizationViewModelDto } from \"models/OrganizationViewModelDto\";\r\nimport { EntityReference } from \"models/EntityReference\";\r\nimport { OrganizationType } from \"models/OrganizationType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { Container } from \"aurelia-framework\";\r\nimport { AuthService } from \"../auth-service\";\r\nimport { SignalrWrapper } from \"signalrwrapper\";\r\n\r\n\r\nexport class OrganizationService {\r\n organizationServiceUrl = `${env.apiBaseUrl}/reporting/v1/organization`;\r\n\r\n search = (organizationSearchTerms: OrganizationSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/search?${organizationSearchTerms.toQry()}`);\r\n }\r\n\r\n searchAllRecords = (organizationSearchTerms: OrganizationSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/search?`);\r\n }\r\n\r\n myorganizations = (): Promise => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/myorganizations`);\r\n }\r\n /**\r\n * Creates a new organization with support for multiple parent organizations.\r\n *\r\n * @param description - The organization name/description\r\n * @param details - Additional details about the organization\r\n * @param organizationType - The type of organization\r\n * @param reportingFrequency - How often the organization reports\r\n * @param parents - Array of parent organization references (supports multiple parents)\r\n * @returns Promise that resolves when the organization is created\r\n * @throws Error with message 'Cycle detected in organization hierarchy' when a 400 Bad Request occurs due to circular parent-child relationships\r\n * @throws Error for other failure cases\r\n */\r\n async create(description: string, details: string, organizationType: OrganizationType, reportingFrequency: ReportingFrequency, parents: EntityReference[]): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n\r\n const response = await fetch(`${this.organizationServiceUrl}/create?description=${description}&details=${details}&organizationType=${organizationType}&reportingFrequency=${reportingFrequency}`, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: JSON.stringify(parents),\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 400) {\r\n const error = await response.json().catch(() => ({ message: null }));\r\n throw new Error(error.message || 'Cycle detected in organization hierarchy');\r\n }\r\n throw new Error(`Failed to create organization: ${response.statusText}`);\r\n }\r\n }\r\n\r\n /**\r\n * Updates an existing organization with support for multiple parent organizations.\r\n *\r\n * @param organizationId - The ID of the organization to update\r\n * @param description - The organization name/description\r\n * @param details - Additional details about the organization\r\n * @param organizationType - The type of organization\r\n * @param reportingFrequency - How often the organization reports\r\n * @param parents - Array of parent organization references (supports multiple parents)\r\n * @returns Promise that resolves when the organization is updated\r\n * @throws Error with message 'Cycle detected in organization hierarchy' when a 400 Bad Request occurs due to circular parent-child relationships\r\n * @throws Error for other failure cases\r\n */\r\n async update(organizationId: number, description: string, details: string, organizationType: OrganizationType, reportingFrequency: ReportingFrequency, parents: EntityReference[]): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n\r\n const response = await fetch(`${this.organizationServiceUrl}/update?organizationId=${organizationId}&description=${description}&details=${details}&organizationType=${organizationType}&reportingFrequency=${reportingFrequency}`, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: JSON.stringify(parents),\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 400) {\r\n const error = await response.json().catch(() => ({ message: null }));\r\n throw new Error(error.message || 'Cycle detected in organization hierarchy');\r\n }\r\n throw new Error(`Failed to update organization: ${response.statusText}`);\r\n }\r\n }\r\n\r\n delete(organizationId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationServiceUrl}/delete?organizationId=${organizationId}`);\r\n }\r\n\r\n getOrganization(organizationId: number): Promise {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/id?organizationId=${organizationId}`);\r\n }\r\n\r\n /**\r\n * Gets a list of organizations that can be selected as parents.\r\n *\r\n * @param excludeOrgId - Optional organization ID to exclude from results (typically the current organization being edited to prevent self-selection)\r\n * @returns Promise resolving to an array of organization references that can be used as parents\r\n */\r\n async getAvailableParents(excludeOrgId?: number): Promise {\r\n const searchTerms = new OrganizationSearchTerms();\r\n const result = await this.searchAllRecords(searchTerms);\r\n\r\n // Filter out the excluded organization if provided\r\n if (excludeOrgId !== undefined) {\r\n return result.items\r\n .filter(org => org.id !== excludeOrgId)\r\n .map(org => ({ id: org.id, description: org.description } as EntityReference));\r\n }\r\n\r\n return result.items.map(org => ({ id: org.id, description: org.description } as EntityReference));\r\n }\r\n}","import env from \"../environment\";\r\nimport { fetchWithAccessToken, fetchPostWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { UnitPlanViewModelDto } from \"models/UnitPlanViewModelDto\";\r\nimport { PlanData } from \"models/PlanData\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { UnitReportViewModelDto } from \"models/UnitReportViewModelDto\";\r\nimport { ReportUpdateData } from \"models/ReportUpdateData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class UnitPlanReportService {\r\n unitPlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/unit`;\r\n \r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`,\r\n JSON.stringify(planData));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.unitPlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/update?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/updateLastPeriod?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.unitPlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","export class BrowserStorage {\r\n bucket: string;\r\n storage: Storage;\r\n set: (key: string, value: any) => void;\r\n get: (key: string) => any;\r\n remove: (key: string) => void;\r\n clear: () => void;\r\n\r\n constructor(bucketName, settings: any = null) {\r\n let bucket = bucketName,\r\n storage = settings ? settings.storage : window.localStorage;\r\n\r\n if (!this.canUseStorage(storage)) {\r\n console.log(\"Storage is full or not supported\");\r\n this.set = (a, b) => { this.noop(); };\r\n this.get = (_) => { return this.noop(); };\r\n this.remove = (_) => { this.noop(); };\r\n this.clear = () => { this.noop(); };\r\n return;\r\n }\r\n\r\n this.set = (key, value) => { this.setInternal(storage, bucket, key, value); };\r\n this.get = (key) => { return this.getInternal(storage, bucket, key); };\r\n this.remove = (key) => { this.removeInternal(storage, bucket, key); };\r\n this.clear = () => { this.clearInternal(storage, bucket); };\r\n };\r\n\r\n private canUseStorage = (storage: Storage) => {\r\n if (!storage) {\r\n return false;\r\n }\r\n try {\r\n storage.setItem(\"rmtest\", \"abc\");\r\n storage.removeItem(\"rmtest\");\r\n return true;\r\n } catch (e) {\r\n console.log(\"Storage unavailable: \" + e);\r\n return false;\r\n }\r\n };\r\n\r\n private noop = function () {\r\n console.log(\"Storage is full or not supported\");\r\n return null;\r\n };\r\n\r\n private getBucketKey = (bucket: string, key: string) => {\r\n return bucket ? bucket + \"|\" + key : key;\r\n };\r\n\r\n private setInternal = (storage: Storage, bucket: string, key: string, value: any) => {\r\n storage[this.getBucketKey(bucket, key)] = JSON.stringify(value);\r\n };\r\n\r\n private getInternal = (storage: Storage, bucket: string, key: string) => {\r\n let value = storage[this.getBucketKey(bucket, key)];\r\n return value ? JSON.parse(value) : null;\r\n };\r\n\r\n private removeInternal = (storage: Storage, bucket: string, key: string) => {\r\n storage.removeItem(this.getBucketKey(bucket, key));\r\n };\r\n\r\n private clearInternal = (storage: Storage, bucket: string) => {\r\n let i = 0, l = storage.length, keys: string[] = [], key: string;\r\n for (i; i < l; i++) {\r\n key = storage.key(i);\r\n if (key && key.split(\"|\")[0] === bucket) {\r\n keys.push(key);\r\n }\r\n }\r\n keys.forEach(function (k2) { storage.removeItem(k2); });\r\n };\r\n}\r\n","import env from \"../environment\";\r\nimport { ReportSearchTerms } from \"models/ReportSearchTerms\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { ReportViewModelDto } from \"models/ReportViewModelDto\";\r\nimport { fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\nexport class AllKpiReportService {\r\n kpiReportServiceUrl = `${env.apiBaseUrl}/kpi/v1/all`;\r\n\r\n report = (reportSearchTerms: ReportSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.kpiReportServiceUrl}/report?${reportSearchTerms.toQry()}`);\r\n }\r\n\r\n}\r\n","import env from \"../environment\";\r\nimport { ReportSearchTerms } from \"models/ReportSearchTerms\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { ReportViewModelDto } from \"models/ReportViewModelDto\";\r\nimport { fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\nexport class AllReportService {\r\n reportServiceUrl = `${env.apiBaseUrl}/reporting/v1/all`;\r\n\r\n search = (reportSearchTerms: ReportSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.reportServiceUrl}/search?${reportSearchTerms.toQry()}`);\r\n }\r\n\r\n download = (reportSearchTerms: ReportSearchTerms): Promise => { \r\n return fetchFileWithAccessToken(`${this.reportServiceUrl}/download?${reportSearchTerms.toQry()}`);\r\n } \r\n}\r\n","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken } from \"./fetch\";\r\n\r\nexport class AdminService {\r\n pingServiceUrl = `${env.apiBaseUrl}/reporting/v1/ping`;\r\n\r\n ping(message: string): Promise {\r\n return fetchPostWithAccessToken(this.pingServiceUrl, message);\r\n }\r\n\r\n updateAllOrganizationUnitCounts(forceRecalculation: boolean = true): Promise {\r\n const url = `${env.apiBaseUrl}/reporting/v1/organization/updateallorganizationunitcounts?forceRecalculation=${forceRecalculation}`;\r\n return fetchPostWithAccessToken(url, null);\r\n }\r\n}"],"sourceRoot":""}