@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.17.0 → 4.17.1
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/dpr/components/_catalogue/catalogue-list/utils.js +1 -1
- package/dpr/components/_catalogue/catalogue-list/utils.js.map +3 -3
- package/dpr/components/_catalogue/catalogue-list/utils.ts +4 -5
- package/dpr/components/_charts/chart/Buckets.js +1 -1
- package/dpr/components/_charts/chart/Buckets.js.map +3 -3
- package/dpr/components/_charts/chart/Buckets.ts +44 -36
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.js +1 -1
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +2 -2
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.ts +22 -14
- package/dpr/components/_charts/chart/heatmap/types.js +2 -0
- package/dpr/components/_charts/chart/heatmap/types.js.map +7 -0
- package/dpr/components/_charts/chart/heatmap/types.ts +6 -0
- package/dpr/components/_charts/utils.js +1 -1
- package/dpr/components/_charts/utils.js.map +3 -3
- package/dpr/components/_charts/utils.test.ts +10 -7
- package/dpr/components/_charts/utils.ts +57 -50
- package/dpr/components/_dashboards/dashboard/view.njk +1 -1
- package/dpr/components/_dashboards/dashboard-list/utils.js +1 -1
- package/dpr/components/_dashboards/dashboard-list/utils.js.map +2 -2
- package/dpr/components/_dashboards/dashboard-list/utils.test.ts +3 -3
- package/dpr/components/_dashboards/dashboard-list/utils.ts +16 -12
- package/dpr/components/_dashboards/dashboard-section/view.njk +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js +2 -0
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js.map +7 -0
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.ts +40 -0
- package/dpr/components/_dashboards/dashboard-visualisation/types.js +2 -0
- package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +7 -0
- package/dpr/components/_dashboards/dashboard-visualisation/types.ts +102 -0
- package/dpr/components/_dashboards/dashboard-visualisation/view.njk +1 -1
- package/dpr/components/_dashboards/scorecard/Scorecard.js +1 -1
- package/dpr/components/_dashboards/scorecard/Scorecard.js.map +2 -2
- package/dpr/components/_dashboards/scorecard/Scorecard.ts +37 -29
- package/dpr/components/_dashboards/scorecard/types.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/types.ts +1 -0
- package/dpr/components/_dashboards/scorecard/utils.js +1 -1
- package/dpr/components/_dashboards/scorecard/utils.js.map +2 -2
- package/dpr/components/_dashboards/scorecard/utils.test.ts +13 -4
- package/dpr/components/_dashboards/scorecard/utils.ts +6 -5
- package/dpr/components/_dashboards/scorecard/view.njk +6 -5
- package/dpr/components/_dashboards/scorecard-group/view.njk +4 -4
- package/dpr/components/_reports/report-actions/types.d.js.map +1 -1
- package/dpr/components/_reports/report-actions/types.d.ts +1 -1
- package/dpr/components/_reports/report-heading/view.njk +1 -1
- package/dpr/data/dashboardClient.js +1 -1
- package/dpr/data/dashboardClient.js.map +2 -2
- package/dpr/data/dashboardClient.ts +8 -7
- package/dpr/data/reportingClient.js +1 -1
- package/dpr/data/reportingClient.js.map +1 -1
- package/dpr/data/reportingClient.ts +1 -1
- package/dpr/middleware/reportAuthoriser.js +1 -1
- package/dpr/middleware/reportAuthoriser.js.map +3 -3
- package/dpr/middleware/reportAuthoriser.ts +9 -20
- package/dpr/routes/journeys/download-report/controller.js +1 -1
- package/dpr/routes/journeys/download-report/controller.js.map +3 -3
- package/dpr/routes/journeys/download-report/controller.ts +4 -1
- package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.ts +1 -0
- package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/download-report/request-download/form/tests.cy.ts +1 -0
- package/dpr/routes/journeys/download-report/tests.cy.js +1 -1
- package/dpr/routes/journeys/download-report/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/download-report/tests.cy.ts +2 -8
- package/dpr/routes/journeys/download-report/utils.js +1 -1
- package/dpr/routes/journeys/download-report/utils.js.map +3 -3
- package/dpr/routes/journeys/download-report/utils.ts +10 -7
- package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.ts +1 -0
- package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js.map +3 -3
- package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.ts +5 -14
- package/dpr/routes/journeys/my-reports/bookmarks/utils.js +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/utils.js.map +3 -3
- package/dpr/routes/journeys/my-reports/bookmarks/utils.ts +11 -5
- package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js.map +3 -3
- package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.ts +4 -7
- package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.ts +1 -0
- package/dpr/routes/journeys/request-missing-report/form/tests.cy.js +1 -1
- package/dpr/routes/journeys/request-missing-report/form/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/request-missing-report/form/tests.cy.ts +1 -0
- package/dpr/routes/journeys/request-missing-report/tests.cy.js +1 -1
- package/dpr/routes/journeys/request-missing-report/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/request-missing-report/tests.cy.ts +3 -5
- package/dpr/routes/journeys/request-report/filters/tests.cy.js +1 -1
- package/dpr/routes/journeys/request-report/filters/tests.cy.js.map +3 -3
- package/dpr/routes/journeys/request-report/filters/tests.cy.ts +3 -6
- package/dpr/routes/journeys/request-report/filters/utils.js +1 -1
- package/dpr/routes/journeys/request-report/filters/utils.js.map +2 -2
- package/dpr/routes/journeys/request-report/filters/utils.ts +2 -3
- package/dpr/routes/journeys/request-report/status/tests.cy.js +1 -1
- package/dpr/routes/journeys/request-report/status/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/request-report/status/tests.cy.ts +2 -7
- package/dpr/routes/journeys/request-report/tests.cy.js +1 -1
- package/dpr/routes/journeys/request-report/tests.cy.js.map +3 -3
- package/dpr/routes/journeys/request-report/tests.cy.ts +5 -21
- package/dpr/routes/journeys/view-report/async/controller.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/controller.ts +2 -2
- package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.ts +2 -10
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +100 -95
- package/dpr/routes/journeys/view-report/async/report/controller.js +1 -1
- package/dpr/routes/journeys/view-report/async/report/controller.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/report/controller.ts +4 -6
- package/dpr/routes/journeys/view-report/async/report/tests.cy.js +1 -1
- package/dpr/routes/journeys/view-report/async/report/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/tests.cy.ts +8 -19
- package/dpr/routes/journeys/view-report/async/report/types.js +2 -0
- package/dpr/routes/journeys/view-report/async/report/types.js.map +7 -0
- package/dpr/routes/journeys/view-report/async/report/types.ts +31 -0
- package/dpr/routes/journeys/view-report/async/report/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/report/utils.ts +173 -136
- package/dpr/routes/journeys/view-report/sync/tests.cy.js +1 -1
- package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/tests.cy.ts +3 -5
- package/dpr/services/dashboardService.js +1 -1
- package/dpr/services/dashboardService.js.map +2 -2
- package/dpr/services/dashboardService.ts +7 -5
- package/dpr/services/productCollection/productCollectionService.js +1 -1
- package/dpr/services/productCollection/productCollectionService.js.map +2 -2
- package/dpr/services/productCollection/productCollectionService.ts +3 -3
- package/dpr/services/reportingService.js +1 -1
- package/dpr/services/reportingService.js.map +1 -1
- package/dpr/services/reportingService.ts +1 -1
- package/dpr/types/AsyncReportUtils.js.map +1 -1
- package/dpr/types/AsyncReportUtils.ts +3 -4
- package/dpr/types/Charts.js +1 -1
- package/dpr/types/Charts.js.map +3 -3
- package/dpr/types/Charts.ts +0 -82
- package/dpr/types/Metrics.js +1 -1
- package/dpr/types/Metrics.js.map +1 -1
- package/dpr/types/Metrics.ts +7 -0
- package/dpr/types/ReportQuery.js +1 -1
- package/dpr/types/ReportQuery.js.map +3 -3
- package/dpr/types/ReportQuery.ts +24 -15
- package/dpr/types/Services.d.js +1 -1
- package/dpr/types/Services.d.js.map +1 -1
- package/dpr/types/Services.d.ts +2 -0
- package/dpr/types/api.d.js.map +1 -1
- package/dpr/types/api.d.ts +14 -16
- package/dpr/utils/Personalisation/personalisationUtils.js +1 -1
- package/dpr/utils/Personalisation/personalisationUtils.js.map +3 -3
- package/dpr/utils/Personalisation/personalisationUtils.ts +15 -6
- package/dpr/utils/UserStoreItemBuilder.js +1 -1
- package/dpr/utils/UserStoreItemBuilder.js.map +1 -1
- package/dpr/utils/UserStoreItemBuilder.ts +2 -2
- package/dpr/utils/datasetHelper.js +1 -1
- package/dpr/utils/datasetHelper.js.map +3 -3
- package/dpr/utils/datasetHelper.test.ts +11 -11
- package/dpr/utils/datasetHelper.ts +23 -8
- package/dpr/utils/logger.js +1 -1
- package/dpr/utils/logger.js.map +3 -3
- package/dpr/utils/logger.ts +6 -1
- package/package.json +2 -1
- package/dpr/components/_charts/chart/DashboardVisualisation.js +0 -2
- package/dpr/components/_charts/chart/DashboardVisualisation.js.map +0 -7
- package/dpr/components/_charts/chart/DashboardVisualisation.ts +0 -43
- package/dpr/components/_dashboards/dashboard/types.js +0 -2
- package/dpr/components/_dashboards/dashboard/types.js.map +0 -7
- package/dpr/components/_dashboards/dashboard/types.ts +0 -120
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import parseUrl from 'parseurl'
|
|
2
2
|
import { Url } from 'url'
|
|
3
3
|
import { Request, Response } from 'express'
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
// Types
|
|
6
6
|
import type { Columns } from '../../../../../components/_reports/report-columns-form/types'
|
|
7
7
|
import type { AsyncReportUtilsParams } from '../../../../../types/AsyncReportUtils'
|
|
8
8
|
import type { DataTable } from '../../../../../utils/DataTableBuilder/types'
|
|
@@ -10,9 +10,14 @@ import type { components } from '../../../../../types/api'
|
|
|
10
10
|
import type { AsyncSummary, RequestedReport } from '../../../../../types/UserReports'
|
|
11
11
|
import { LoadType, ReportType } from '../../../../../types/UserReports'
|
|
12
12
|
import ReportQuery from '../../../../../types/ReportQuery'
|
|
13
|
+
import type { ChildData } from '../../../../../utils/ParentChildDataTableBuilder/types'
|
|
14
|
+
import type { ExtractedDefinitionData, ExtractedRequestData, ReportUrls } from './types'
|
|
15
|
+
import type { DownloadActionParams } from '../../../../../components/_reports/report-actions/types'
|
|
16
|
+
import { FiltersType } from '../../../../../components/_filters/filtersTypeEnum'
|
|
17
|
+
import type { Services } from '../../../../../types/Services'
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
// Utils
|
|
20
|
+
import definitionUtils from '../../../../../utils/definitionUtils'
|
|
16
21
|
import PaginationUtils from '../../../../../components/_reports/report-pagination/utils'
|
|
17
22
|
import TotalsUtils from '../../../../../components/_reports/report-totals/utils'
|
|
18
23
|
import ReportFiltersUtils from '../../../../../components/_filters/utils'
|
|
@@ -20,11 +25,10 @@ import ColumnUtils from '../../../../../components/_reports/report-columns-form/
|
|
|
20
25
|
import ReportActionsUtils from '../../../../../components/_reports/report-actions/utils'
|
|
21
26
|
import UserReportsUtils from '../../../../../components/user-reports/utils'
|
|
22
27
|
import LocalsHelper from '../../../../../utils/localsHelper'
|
|
23
|
-
import { DownloadActionParams } from '../../../../../components/_reports/report-actions/types'
|
|
24
|
-
import { Services } from '../../../../../types/Services'
|
|
25
|
-
import { ChildData } from '../../../../../utils/ParentChildDataTableBuilder/types'
|
|
26
28
|
import DataTableUtils from '../../../../../components/_reports/report-data-table/utils'
|
|
27
|
-
import
|
|
29
|
+
import RequestedReportService from '../../../my-reports/requested-reports/service'
|
|
30
|
+
|
|
31
|
+
import CollatedSummaryBuilder from '../../../../../utils/CollatedSummaryBuilder/CollatedSummaryBuilder'
|
|
28
32
|
|
|
29
33
|
export const getData = async ({
|
|
30
34
|
res,
|
|
@@ -40,28 +44,35 @@ export const getData = async ({
|
|
|
40
44
|
// Get the definition
|
|
41
45
|
const definition: components['schemas']['SingleVariantReportDefinition'] =
|
|
42
46
|
await services.reportingService.getDefinition(token, reportId, reportVariantId, definitionPath)
|
|
47
|
+
const { variant } = definition
|
|
48
|
+
const { specification } = variant
|
|
49
|
+
|
|
50
|
+
if (!specification) {
|
|
51
|
+
throw new Error('No specification found in variant definition')
|
|
52
|
+
}
|
|
43
53
|
|
|
44
54
|
// Get the request data
|
|
45
|
-
const
|
|
55
|
+
const requestedReportService = <RequestedReportService>services.requestedReportService
|
|
56
|
+
const requestData: RequestedReport | undefined = await requestedReportService.getReportByTableId(tableId, userId)
|
|
46
57
|
|
|
47
58
|
// Get the columns
|
|
48
|
-
const columns = ColumnUtils.getColumns(
|
|
59
|
+
const columns = ColumnUtils.getColumns(specification, req)
|
|
49
60
|
|
|
50
61
|
// initialise report query
|
|
51
|
-
const reportQuery = await initReportQuery(definition, columns, res, req,
|
|
62
|
+
const reportQuery = await initReportQuery(definition, columns, res, req, services, requestData)
|
|
52
63
|
|
|
53
64
|
// Get the reportData
|
|
54
|
-
const reportData = await getReportData({ definition, services, token, req, res,
|
|
65
|
+
const reportData = await getReportData({ definition, services, token, req, res, reportQuery })
|
|
55
66
|
|
|
56
67
|
// Get the summary data, if applicable
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
: await getSummariesData(definition, services, token, req, res)
|
|
68
|
+
const { summaries } = definition.variant
|
|
69
|
+
const summariesData = !summaries ? [] : await getSummariesData(summaries, services, token, req, res)
|
|
60
70
|
|
|
61
71
|
// Get the child data, if applicable
|
|
62
|
-
const
|
|
72
|
+
const { childVariants } = definition.variant
|
|
73
|
+
const childData: ChildData[] = !childVariants
|
|
63
74
|
? []
|
|
64
|
-
: await getChildData(
|
|
75
|
+
: await getChildData(childVariants, services, token, req, res, requestData)
|
|
65
76
|
|
|
66
77
|
return {
|
|
67
78
|
definition,
|
|
@@ -79,8 +90,8 @@ const initReportQuery = async (
|
|
|
79
90
|
columns: Columns,
|
|
80
91
|
res: Response,
|
|
81
92
|
req: Request,
|
|
82
|
-
requestData: RequestedReport,
|
|
83
93
|
services: Services,
|
|
94
|
+
requestData?: RequestedReport,
|
|
84
95
|
) => {
|
|
85
96
|
const { definitionsPath } = LocalsHelper.getValues(res)
|
|
86
97
|
const fields = definitionUtils.getFields(definition)
|
|
@@ -95,8 +106,8 @@ const initReportQuery = async (
|
|
|
95
106
|
})
|
|
96
107
|
|
|
97
108
|
// Sort
|
|
98
|
-
const sortColumn = req.query?.sortColumn || requestData
|
|
99
|
-
const sortedAsc = req.query?.sortedAsc || requestData
|
|
109
|
+
const sortColumn = req.query?.sortColumn || requestData?.query?.data?.sortColumn
|
|
110
|
+
const sortedAsc = req.query?.sortedAsc || requestData?.query?.data?.sortedAsc
|
|
100
111
|
|
|
101
112
|
// Pagination
|
|
102
113
|
const selectedPage = req.query?.selectedPage
|
|
@@ -128,7 +139,6 @@ const getReportData = async (args: {
|
|
|
128
139
|
token: string
|
|
129
140
|
req: Request
|
|
130
141
|
res: Response
|
|
131
|
-
requestData: RequestedReport
|
|
132
142
|
reportQuery: ReportQuery
|
|
133
143
|
}) => {
|
|
134
144
|
const { services, token, req, reportQuery } = args
|
|
@@ -145,7 +155,7 @@ const getReportData = async (args: {
|
|
|
145
155
|
}
|
|
146
156
|
|
|
147
157
|
export const getSummariesData = async (
|
|
148
|
-
|
|
158
|
+
summaries: components['schemas']['ReportSummary'][],
|
|
149
159
|
services: Services,
|
|
150
160
|
token: string,
|
|
151
161
|
req: Request,
|
|
@@ -156,7 +166,7 @@ export const getSummariesData = async (
|
|
|
156
166
|
const reportVariantId = variantId || id
|
|
157
167
|
|
|
158
168
|
return Promise.all(
|
|
159
|
-
|
|
169
|
+
summaries.map(async (summary) => {
|
|
160
170
|
const summaryReport = await services.reportingService.getAsyncSummaryReport(
|
|
161
171
|
token,
|
|
162
172
|
reportId,
|
|
@@ -177,28 +187,38 @@ export const getSummariesData = async (
|
|
|
177
187
|
}
|
|
178
188
|
|
|
179
189
|
export const getChildData = async (
|
|
180
|
-
|
|
190
|
+
childVariants: components['schemas']['ChildVariantDefinition'][],
|
|
181
191
|
services: Services,
|
|
182
192
|
token: string,
|
|
183
193
|
req: Request,
|
|
184
194
|
res: Response,
|
|
185
|
-
requestData
|
|
195
|
+
requestData?: RequestedReport,
|
|
186
196
|
): Promise<ChildData[]> => {
|
|
187
197
|
const { definitionsPath: dataProductDefinitionsPath } = LocalsHelper.getValues(res)
|
|
188
198
|
const { reportId } = req.params
|
|
189
|
-
|
|
199
|
+
const childExecutionData = requestData?.childExecutionData
|
|
200
|
+
if (!childExecutionData) {
|
|
201
|
+
throw new Error('getChildData: No execution data found for child variants')
|
|
202
|
+
}
|
|
190
203
|
return Promise.all(
|
|
191
|
-
|
|
204
|
+
childVariants.map(async (childVariant) => {
|
|
192
205
|
const { specification } = childVariant
|
|
206
|
+
if (!specification) {
|
|
207
|
+
throw new Error('getChildData: No specification found in child variant definition')
|
|
208
|
+
}
|
|
193
209
|
|
|
194
210
|
const query = new ReportQuery({
|
|
195
|
-
fields: specification
|
|
196
|
-
template:
|
|
211
|
+
fields: specification?.fields || [],
|
|
212
|
+
template: specification.template,
|
|
197
213
|
queryParams: req.query,
|
|
198
214
|
definitionsPath: dataProductDefinitionsPath,
|
|
199
215
|
}).toRecordWithFilterPrefix(true)
|
|
200
216
|
|
|
201
|
-
const
|
|
217
|
+
const childData = childExecutionData.find((e) => e.variantId === childVariant.id)
|
|
218
|
+
if (!childData) {
|
|
219
|
+
throw new Error('getChildData: No matching child execution data found')
|
|
220
|
+
}
|
|
221
|
+
const { tableId: childTableId } = childData
|
|
202
222
|
|
|
203
223
|
const childReport = await services.reportingService.getAsyncReport(
|
|
204
224
|
token,
|
|
@@ -250,11 +270,11 @@ export const renderReport = async ({ req, res, services }: AsyncReportUtilsParam
|
|
|
250
270
|
res,
|
|
251
271
|
services,
|
|
252
272
|
definition,
|
|
253
|
-
requestData,
|
|
254
273
|
summariesData,
|
|
255
274
|
dataTable,
|
|
256
275
|
columns,
|
|
257
276
|
reportQuery,
|
|
277
|
+
requestData,
|
|
258
278
|
)
|
|
259
279
|
|
|
260
280
|
const renderData = {
|
|
@@ -262,7 +282,7 @@ export const renderReport = async ({ req, res, services }: AsyncReportUtilsParam
|
|
|
262
282
|
dataTable,
|
|
263
283
|
}
|
|
264
284
|
|
|
265
|
-
if (Object.keys(requestData).length) {
|
|
285
|
+
if (requestData && Object.keys(requestData).length) {
|
|
266
286
|
UserReportsUtils.updateLastViewed({
|
|
267
287
|
req,
|
|
268
288
|
services,
|
|
@@ -280,19 +300,33 @@ const getTemplateData = async (
|
|
|
280
300
|
res: Response,
|
|
281
301
|
services: Services,
|
|
282
302
|
definition: components['schemas']['SingleVariantReportDefinition'],
|
|
283
|
-
requestData: RequestedReport,
|
|
284
303
|
summariesData: AsyncSummary[],
|
|
285
304
|
dataTable: DataTable[],
|
|
286
305
|
columns: Columns,
|
|
287
306
|
reportQuery: ReportQuery,
|
|
307
|
+
requestData?: RequestedReport,
|
|
288
308
|
) => {
|
|
289
309
|
const { nestedBaseUrl } = LocalsHelper.getValues(res)
|
|
310
|
+
|
|
311
|
+
// get url data
|
|
290
312
|
const url = parseUrl(req)
|
|
291
|
-
|
|
313
|
+
if (!url) {
|
|
314
|
+
throw new Error('Unable to set url data from request')
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const urls = url ? setUrls(url, req) : undefined
|
|
318
|
+
|
|
319
|
+
// get from definition
|
|
292
320
|
const definitionData = extractDataFromDefinition(definition)
|
|
293
321
|
const { fields, specification } = definitionData
|
|
294
|
-
|
|
295
|
-
|
|
322
|
+
|
|
323
|
+
// get from requestedData
|
|
324
|
+
const requestedData = requestData ? extractDataFromRequest(requestData) : undefined
|
|
325
|
+
|
|
326
|
+
// Get the count
|
|
327
|
+
const count = await getCount(definition, services, res, req, reportQuery)
|
|
328
|
+
|
|
329
|
+
// Get the filters
|
|
296
330
|
const filterData = await ReportFiltersUtils.getFilters({
|
|
297
331
|
fields,
|
|
298
332
|
req,
|
|
@@ -300,8 +334,12 @@ const getTemplateData = async (
|
|
|
300
334
|
services,
|
|
301
335
|
filtersType: FiltersType.INTERACTIVE,
|
|
302
336
|
})
|
|
303
|
-
|
|
304
|
-
|
|
337
|
+
|
|
338
|
+
// Set the features
|
|
339
|
+
const features = await setFeatures(services, res, req, columns, count, definitionData, requestedData, urls)
|
|
340
|
+
|
|
341
|
+
// Set the extra meta data
|
|
342
|
+
const meta = setMetaData(res, req)
|
|
305
343
|
|
|
306
344
|
let reportSummaries
|
|
307
345
|
if (summariesData.length) {
|
|
@@ -311,7 +349,7 @@ const getTemplateData = async (
|
|
|
311
349
|
|
|
312
350
|
let pagination
|
|
313
351
|
let totals
|
|
314
|
-
if (
|
|
352
|
+
if (definitionData.template === 'list') {
|
|
315
353
|
pagination = PaginationUtils.getPaginationData(url, count, req)
|
|
316
354
|
const { pageSize, currentPage, totalRows } = pagination
|
|
317
355
|
totals = TotalsUtils.getTotals(pageSize, currentPage, totalRows, dataTable[0].rowCount)
|
|
@@ -324,6 +362,7 @@ const getTemplateData = async (
|
|
|
324
362
|
nestedBaseUrl,
|
|
325
363
|
...meta,
|
|
326
364
|
...features,
|
|
365
|
+
...definitionData,
|
|
327
366
|
...requestedData,
|
|
328
367
|
...urls,
|
|
329
368
|
...(pagination && { pagination }),
|
|
@@ -338,32 +377,30 @@ const showColumns = (specification: components['schemas']['Specification']) => {
|
|
|
338
377
|
return !['row-section', 'row-section-child', 'summary', 'summary-section'].includes(template)
|
|
339
378
|
}
|
|
340
379
|
|
|
341
|
-
const setMetaData = (
|
|
342
|
-
const { classification } = definition.variant
|
|
343
|
-
const { template } = definition.variant.specification
|
|
380
|
+
const setMetaData = (res: Response, req: Request) => {
|
|
344
381
|
const { csrfToken } = LocalsHelper.getValues(res)
|
|
382
|
+
const { tableId, reportId, id } = req.params
|
|
345
383
|
|
|
346
384
|
return {
|
|
347
385
|
csrfToken,
|
|
348
|
-
classification,
|
|
349
|
-
template,
|
|
350
386
|
loadType: LoadType.ASYNC,
|
|
351
387
|
type: ReportType.REPORT,
|
|
388
|
+
tableId,
|
|
389
|
+
reportId,
|
|
390
|
+
id,
|
|
352
391
|
}
|
|
353
392
|
}
|
|
354
393
|
|
|
355
|
-
const setUrls = (url: Url, req: Request) => {
|
|
394
|
+
const setUrls = (url: Url, req: Request): ReportUrls => {
|
|
356
395
|
const { search } = url
|
|
357
|
-
const pathname = url.search ? req.originalUrl.split(url.search)[0] : req.originalUrl
|
|
358
|
-
const reportUrl = pathname.replace('/download-disabled', '').replace('/download-disabled?', '')
|
|
359
|
-
const reportSearch = search
|
|
360
396
|
const encodedSearch = search ? encodeURIComponent(search) : undefined
|
|
397
|
+
const pathname = search ? req.originalUrl.split(search)[0] : req.originalUrl
|
|
398
|
+
const reportUrl = pathname.replace('/download-disabled', '').replace('/download-disabled?', '')
|
|
361
399
|
|
|
362
400
|
return {
|
|
363
401
|
reportUrl,
|
|
364
|
-
reportSearch,
|
|
402
|
+
reportSearch: search || undefined,
|
|
365
403
|
encodedSearch,
|
|
366
|
-
search,
|
|
367
404
|
pathname,
|
|
368
405
|
}
|
|
369
406
|
}
|
|
@@ -371,154 +408,154 @@ const setUrls = (url: Url, req: Request) => {
|
|
|
371
408
|
const setFeatures = async (
|
|
372
409
|
services: Services,
|
|
373
410
|
res: Response,
|
|
374
|
-
|
|
375
|
-
definition: components['schemas']['SingleVariantReportDefinition'],
|
|
411
|
+
req: Request,
|
|
376
412
|
columns: Columns,
|
|
377
413
|
count: number,
|
|
378
|
-
|
|
414
|
+
definitionData: ExtractedDefinitionData,
|
|
415
|
+
requestData?: ExtractedRequestData,
|
|
416
|
+
urls?: ReportUrls,
|
|
379
417
|
) => {
|
|
380
418
|
const { csrfToken, dprUser, bookmarkingEnabled, downloadingEnabled } = LocalsHelper.getValues(res)
|
|
381
|
-
const { reportId } =
|
|
382
|
-
const
|
|
383
|
-
const { variant } = definition
|
|
419
|
+
const { reportId, id } = req.params
|
|
420
|
+
const { downloadPermissionService, bookmarkService } = services
|
|
384
421
|
|
|
385
|
-
let canDownload
|
|
386
|
-
if (downloadingEnabled) {
|
|
387
|
-
canDownload = await
|
|
422
|
+
let canDownload = false
|
|
423
|
+
if (downloadingEnabled && downloadPermissionService) {
|
|
424
|
+
canDownload = await downloadPermissionService.downloadEnabled(dprUser.id, reportId, id)
|
|
388
425
|
}
|
|
389
426
|
|
|
390
427
|
let bookmarked
|
|
391
|
-
if (bookmarkingEnabled) {
|
|
392
|
-
bookmarked = await
|
|
428
|
+
if (bookmarkingEnabled && bookmarkService) {
|
|
429
|
+
bookmarked = await bookmarkService.isBookmarked(id, reportId, dprUser.id)
|
|
393
430
|
}
|
|
394
431
|
|
|
395
|
-
const actions = setActions(
|
|
396
|
-
csrfToken,
|
|
397
|
-
variant,
|
|
398
|
-
requestData,
|
|
399
|
-
columns,
|
|
400
|
-
canDownload,
|
|
401
|
-
count,
|
|
402
|
-
urls.pathname,
|
|
403
|
-
urls.search,
|
|
404
|
-
res,
|
|
405
|
-
)
|
|
406
|
-
const { printable } = variant
|
|
432
|
+
const actions = setActions(csrfToken, columns, canDownload, count, res, req, definitionData, requestData, urls)
|
|
407
433
|
|
|
408
434
|
return {
|
|
409
435
|
actions,
|
|
410
436
|
canDownload,
|
|
411
437
|
bookmarked,
|
|
412
|
-
printable,
|
|
413
438
|
}
|
|
414
439
|
}
|
|
415
440
|
|
|
416
441
|
const getCount = async (
|
|
417
442
|
definition: components['schemas']['SingleVariantReportDefinition'],
|
|
418
|
-
requestData: RequestedReport,
|
|
419
443
|
services: Services,
|
|
420
444
|
res: Response,
|
|
445
|
+
req: Request,
|
|
421
446
|
reportQuery: ReportQuery,
|
|
422
447
|
) => {
|
|
423
448
|
const { token } = LocalsHelper.getValues(res)
|
|
424
|
-
const { tableId, reportId } =
|
|
425
|
-
const id = requestData.variantId || requestData.id
|
|
449
|
+
const { tableId, reportId, id } = req.params
|
|
426
450
|
|
|
427
451
|
return !definition.variant.interactive
|
|
428
452
|
? services.reportingService.getAsyncCount(token, tableId)
|
|
429
453
|
: services.reportingService.getAsyncInteractiveCount(token, tableId, reportId, id, reportQuery)
|
|
430
454
|
}
|
|
431
455
|
|
|
432
|
-
const extractDataFromDefinition = (
|
|
433
|
-
|
|
434
|
-
|
|
456
|
+
const extractDataFromDefinition = (
|
|
457
|
+
definition: components['schemas']['SingleVariantReportDefinition'],
|
|
458
|
+
): ExtractedDefinitionData => {
|
|
459
|
+
const { variant, name: reportName, description: reportDescription } = definition
|
|
460
|
+
const { classification, printable, specification, name, description } = variant
|
|
461
|
+
if (!specification) {
|
|
462
|
+
throw new Error('No specification found in variant definition')
|
|
463
|
+
}
|
|
435
464
|
const { template, fields } = specification
|
|
436
|
-
const { interactive } = <components['schemas']['VariantDefinition'] & { interactive?: boolean }>variant
|
|
437
465
|
|
|
438
466
|
return {
|
|
467
|
+
reportName,
|
|
468
|
+
name,
|
|
469
|
+
description: description || reportDescription,
|
|
439
470
|
classification,
|
|
440
|
-
printable,
|
|
471
|
+
printable: Boolean(printable),
|
|
441
472
|
specification,
|
|
442
473
|
template,
|
|
443
|
-
interactive,
|
|
444
474
|
fields,
|
|
445
|
-
variant,
|
|
446
475
|
}
|
|
447
476
|
}
|
|
448
477
|
|
|
449
|
-
const extractDataFromRequest = (requestData: RequestedReport) => {
|
|
478
|
+
const extractDataFromRequest = (requestData: RequestedReport): ExtractedRequestData => {
|
|
479
|
+
const { query, url, timestamp } = requestData
|
|
480
|
+
|
|
450
481
|
return {
|
|
451
|
-
reportName: requestData.reportName,
|
|
452
|
-
name: requestData.name,
|
|
453
|
-
description: requestData.description,
|
|
454
|
-
requestedTimestamp: new Date(requestData.timestamp.requested).toLocaleString(),
|
|
455
|
-
reportId: requestData.reportId,
|
|
456
|
-
tableId: requestData.tableId,
|
|
457
|
-
id: requestData.variantId || requestData.id,
|
|
458
482
|
executionId: requestData.executionId,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
483
|
+
requestedTimestamp: timestamp.requested ? new Date(timestamp.requested).toLocaleString() : undefined,
|
|
484
|
+
querySummary: query?.summary || [],
|
|
485
|
+
queryData: query?.data,
|
|
486
|
+
requestUrl: url?.request,
|
|
487
|
+
defaultQuery: url?.report?.default,
|
|
462
488
|
dataProductDefinitionsPath: requestData.dataProductDefinitionsPath,
|
|
463
489
|
}
|
|
464
490
|
}
|
|
465
491
|
|
|
466
492
|
const setActions = (
|
|
467
493
|
csrfToken: string,
|
|
468
|
-
variant: components['schemas']['VariantDefinition'],
|
|
469
|
-
requestData: RequestedReport,
|
|
470
494
|
columns: Columns,
|
|
471
495
|
canDownload: boolean,
|
|
472
496
|
count: number,
|
|
473
|
-
currentUrl: string,
|
|
474
|
-
currentQueryParams: string,
|
|
475
497
|
res: Response,
|
|
498
|
+
req: Request,
|
|
499
|
+
definitionData: ExtractedDefinitionData,
|
|
500
|
+
requestData?: ExtractedRequestData,
|
|
501
|
+
urls?: ReportUrls,
|
|
476
502
|
) => {
|
|
477
|
-
const { reportName, name,
|
|
478
|
-
|
|
479
|
-
const { nestedBaseUrl } = LocalsHelper.getValues(res)
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
const { reportName, name, printable } = definitionData
|
|
504
|
+
const { tableId, id, reportId } = req.params
|
|
505
|
+
const { nestedBaseUrl, definitionsPath } = LocalsHelper.getValues(res)
|
|
506
|
+
|
|
507
|
+
// DownloadActionParams
|
|
508
|
+
let downloadConfig: DownloadActionParams | undefined
|
|
509
|
+
if (urls) {
|
|
510
|
+
downloadConfig = {
|
|
511
|
+
enabled: count > 0 && canDownload !== undefined,
|
|
512
|
+
name,
|
|
513
|
+
reportName,
|
|
514
|
+
csrfToken,
|
|
515
|
+
reportId,
|
|
516
|
+
id,
|
|
517
|
+
tableId,
|
|
518
|
+
columns: columns.value,
|
|
519
|
+
definitionPath: definitionsPath,
|
|
520
|
+
loadType: LoadType.ASYNC,
|
|
521
|
+
nestedBaseUrl,
|
|
522
|
+
canDownload,
|
|
523
|
+
currentUrl: urls.pathname,
|
|
524
|
+
currentQueryParams: urls.reportSearch,
|
|
525
|
+
...(requestData?.queryData && {
|
|
526
|
+
sortColumn: <string>requestData.queryData.sortColumn,
|
|
527
|
+
sortedAsc: <string>requestData.queryData.sortedAsc,
|
|
528
|
+
}),
|
|
529
|
+
}
|
|
503
530
|
}
|
|
504
531
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
532
|
+
let shareConfig
|
|
533
|
+
let copyConfig
|
|
534
|
+
if (requestData?.requestUrl?.fullUrl) {
|
|
535
|
+
shareConfig = {
|
|
536
|
+
reportName,
|
|
537
|
+
name,
|
|
538
|
+
url: requestData.requestUrl.fullUrl,
|
|
539
|
+
}
|
|
540
|
+
copyConfig = {
|
|
541
|
+
url: requestData.requestUrl.fullUrl,
|
|
542
|
+
}
|
|
509
543
|
}
|
|
510
544
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
545
|
+
let refreshConfig
|
|
546
|
+
if (requestData?.executionId && requestData?.requestUrl?.fullUrl) {
|
|
547
|
+
refreshConfig = {
|
|
548
|
+
url: requestData.requestUrl.fullUrl,
|
|
549
|
+
executionId: requestData.executionId,
|
|
550
|
+
}
|
|
514
551
|
}
|
|
515
552
|
|
|
516
553
|
return ReportActionsUtils.getActions({
|
|
517
|
-
download: downloadConfig,
|
|
554
|
+
...(downloadConfig && { download: downloadConfig }),
|
|
555
|
+
...(shareConfig && { share: shareConfig }),
|
|
556
|
+
...(refreshConfig && { refresh: refreshConfig }),
|
|
557
|
+
...(copyConfig && { copy: copyConfig }),
|
|
518
558
|
print: { enabled: printable },
|
|
519
|
-
share: shareConfig,
|
|
520
|
-
refresh: refreshConfig,
|
|
521
|
-
copy: { url: requestUrl },
|
|
522
559
|
})
|
|
523
560
|
}
|
|
524
561
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
context("Platform sync tests",()=>{const t="/embedded/platform/";describe("Sync tests from the platform",()=>{before(()=>{
|
|
1
|
+
var e=require("../../../../../../cypress-tests/cypressUtils");context("Platform sync tests",()=>{const t="/embedded/platform/";describe("Sync tests from the platform",()=>{before(()=>{(0,e.executeReportStubs)(),cy.task("stubDefinitionSyncReport"),cy.task("stubRequestSuccessResult20"),cy.task("stubSyncRequestDataSuccess"),cy.task("stubSyncRequestDataSuccessCount")}),it("should load a sync report",()=>{cy.visit(t),cy.findByLabelText(/Reports catalogue.*/i).within(()=>{cy.findByRole("row",{name:(c,s)=>s.textContent.includes("This is an sync report")}).within(()=>{cy.findByRole("link",{name:/Load report/}).click()})}),cy.findByRole("heading",{name:/Sync report/,level:1}).should("be.visible")})})});
|
|
2
2
|
//# sourceMappingURL=tests.cy.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/dpr/routes/journeys/view-report/sync/tests.cy.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "AAAA,QAAQ,sBAAuB,IAAM,CACnC,
|
|
6
|
-
"names": ["path", "_", "element"]
|
|
4
|
+
"sourcesContent": ["import { executeReportStubs } from '../../../../../../cypress-tests/cypressUtils'\n\ncontext('Platform sync tests', () => {\n const path = '/embedded/platform/'\n\n describe('Sync tests from the platform', () => {\n before(() => {\n executeReportStubs()\n cy.task('stubDefinitionSyncReport')\n cy.task('stubRequestSuccessResult20')\n cy.task('stubSyncRequestDataSuccess')\n cy.task('stubSyncRequestDataSuccessCount')\n })\n it('should load a sync report', () => {\n cy.visit(path)\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return element.textContent.includes('This is an sync report')\n },\n }).within(() => {\n cy.findByRole('link', { name: /Load report/ }).click()\n })\n })\n\n cy.findByRole('heading', { name: /Sync report/, level: 1 }).should('be.visible')\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,IAAAA,EAAmC,wDAEnC,QAAQ,sBAAuB,IAAM,CACnC,MAAMC,EAAO,sBAEb,SAAS,+BAAgC,IAAM,CAC7C,OAAO,IAAM,IACX,sBAAmB,EACnB,GAAG,KAAK,0BAA0B,EAClC,GAAG,KAAK,4BAA4B,EACpC,GAAG,KAAK,4BAA4B,EACpC,GAAG,KAAK,iCAAiC,CAC3C,CAAC,EACD,GAAG,4BAA6B,IAAM,CACpC,GAAG,MAAMA,CAAI,EAEb,GAAG,gBAAgB,sBAAsB,EAAE,OAAO,IAAM,CACtD,GAAG,WAAW,MAAO,CACnB,KAAM,CAACC,EAAGC,IACDA,EAAQ,YAAY,SAAS,wBAAwB,CAEhE,CAAC,EAAE,OAAO,IAAM,CACd,GAAG,WAAW,OAAQ,CAAE,KAAM,aAAc,CAAC,EAAE,MAAM,CACvD,CAAC,CACH,CAAC,EAED,GAAG,WAAW,UAAW,CAAE,KAAM,cAAe,MAAO,CAAE,CAAC,EAAE,OAAO,YAAY,CACjF,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_cypressUtils", "path", "_", "element"]
|
|
7
7
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import { executeReportStubs } from '../../../../../../cypress-tests/cypressUtils'
|
|
2
|
+
|
|
1
3
|
context('Platform sync tests', () => {
|
|
2
4
|
const path = '/embedded/platform/'
|
|
3
5
|
|
|
4
6
|
describe('Sync tests from the platform', () => {
|
|
5
7
|
before(() => {
|
|
6
|
-
|
|
7
|
-
cy.task('resetRedis')
|
|
8
|
-
cy.task('stubDefinitions')
|
|
9
|
-
cy.task('stubGetProductCollections')
|
|
8
|
+
executeReportStubs()
|
|
10
9
|
cy.task('stubDefinitionSyncReport')
|
|
11
10
|
cy.task('stubRequestSuccessResult20')
|
|
12
|
-
cy.task('stubReportsFinishedStatus')
|
|
13
11
|
cy.task('stubSyncRequestDataSuccess')
|
|
14
12
|
cy.task('stubSyncRequestDataSuccessCount')
|
|
15
13
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var h=Object.create;var a=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var
|
|
1
|
+
var h=Object.create;var a=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var u=(t,s)=>{for(var r in s)a(t,r,{get:s[r],enumerable:!0})},g=(t,s,r,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of b(s))!l.call(t,n)&&n!==r&&a(t,n,{get:()=>s[n],enumerable:!(i=D(s,n))||i.enumerable});return t};var y=(t,s,r)=>(r=t!=null?h(m(t)):{},g(s||!t||!t.__esModule?a(r,"default",{value:t,enumerable:!0}):r,t)),p=t=>g(a({},"__esModule",{value:!0}),t);var A={};u(A,{DashboardService:()=>o,default:()=>f});module.exports=p(A);var c=y(require("../utils/logger"));class o{constructor(s){this.dashboardClient=s;this.dashboardClient=s,c.default.info("Service created: DashboardService")}async getDefinition(s,r,i,n){return this.dashboardClient.getDefinition(s,i,r,n)}async requestAsyncDashboard(s,r,i,n){return this.dashboardClient.requestAsyncDashboard(s,r,i,n)}async cancelAsyncRequest(s,r,i,n,e){return this.dashboardClient.cancelAsyncRequest(s,r,i,n,e)}async getAsyncStatus(s,r,i,n,e,d){return this.dashboardClient.getAsyncStatus(s,r,i,n,e,d)}async getAsyncDashboard(s,r,i,n,e){return this.dashboardClient.getAsyncDashboard(s,i,r,n,e)}}var f=o;0&&(module.exports={DashboardService});
|
|
2
2
|
//# sourceMappingURL=dashboardService.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dpr/services/dashboardService.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "6iBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,
|
|
4
|
+
"sourcesContent": ["import Dict = NodeJS.Dict\nimport logger from '../utils/logger'\nimport DashboardClient from '../data/dashboardClient'\nimport { components } from '../types/api'\nimport { DashboardDataResponse } from '../types/Metrics'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nclass DashboardService {\n constructor(private readonly dashboardClient: DashboardClient) {\n this.dashboardClient = dashboardClient\n logger.info('Service created: DashboardService')\n }\n\n async getDefinition(\n token: string,\n dpdId: string,\n id: string,\n dataProductDefinitionsPath?: string,\n ): Promise<components['schemas']['DashboardDefinition']> {\n return this.dashboardClient.getDefinition(token, id, dpdId, dataProductDefinitionsPath)\n }\n\n async requestAsyncDashboard(\n token: string,\n reportId: string,\n dashboardId: string,\n query: Record<string, string | boolean | number>,\n ): Promise<Dict<string>> {\n return this.dashboardClient.requestAsyncDashboard(token, reportId, dashboardId, query)\n }\n\n async cancelAsyncRequest(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n return this.dashboardClient.cancelAsyncRequest(\n token,\n reportId,\n dashboardId,\n executionId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncStatus(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n tableId?: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n return this.dashboardClient.getAsyncStatus(\n token,\n reportId,\n dashboardId,\n executionId,\n tableId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncDashboard(\n token: string,\n dashboardId: string,\n reportId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n ): Promise<DashboardDataResponse[][]> {\n return this.dashboardClient.getAsyncDashboard(token, reportId, dashboardId, tableId, query)\n }\n}\n\nexport { DashboardService }\nexport default DashboardService\n"],
|
|
5
|
+
"mappings": "6iBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAmB,8BAMnB,MAAMH,CAAiB,CACrB,YAA6BI,EAAkC,CAAlC,qBAAAA,EAC3B,KAAK,gBAAkBA,EACvB,EAAAC,QAAO,KAAK,mCAAmC,CACjD,CAEA,MAAM,cACJC,EACAC,EACAC,EACAC,EACuD,CACvD,OAAO,KAAK,gBAAgB,cAAcH,EAAOE,EAAID,EAAOE,CAA0B,CACxF,CAEA,MAAM,sBACJH,EACAI,EACAC,EACAC,EACuB,CACvB,OAAO,KAAK,gBAAgB,sBAAsBN,EAAOI,EAAUC,EAAaC,CAAK,CACvF,CAEA,MAAM,mBACJN,EACAI,EACAC,EACAE,EACAJ,EACuB,CACvB,OAAO,KAAK,gBAAgB,mBAC1BH,EACAI,EACAC,EACAE,EACAJ,CACF,CACF,CAEA,MAAM,eACJH,EACAI,EACAC,EACAE,EACAC,EACAL,EACuB,CACvB,OAAO,KAAK,gBAAgB,eAC1BH,EACAI,EACAC,EACAE,EACAC,EACAL,CACF,CACF,CAEA,MAAM,kBACJH,EACAK,EACAD,EACAI,EACAF,EACoC,CACpC,OAAO,KAAK,gBAAgB,kBAAkBN,EAAOI,EAAUC,EAAaG,EAASF,CAAK,CAC5F,CACF,CAGA,IAAOX,EAAQD",
|
|
6
6
|
"names": ["dashboardService_exports", "__export", "DashboardService", "dashboardService_default", "__toCommonJS", "import_logger", "dashboardClient", "logger", "token", "dpdId", "id", "dataProductDefinitionsPath", "reportId", "dashboardId", "query", "executionId", "tableId"]
|
|
7
7
|
}
|