@ministryofjustice/hmpps-digital-prison-reporting-frontend 3.8.1 → 3.8.2
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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class ReportingService {
|
|
4
|
+
constructor(reportingClient) {
|
|
5
|
+
this.reportingClient = reportingClient;
|
|
6
|
+
}
|
|
7
|
+
async getCount(resourceName, token, listRequest) {
|
|
8
|
+
return this.reportingClient.getCount(resourceName, token, listRequest);
|
|
9
|
+
}
|
|
10
|
+
async getList(resourceName, token, listRequest) {
|
|
11
|
+
return this.reportingClient.getList(resourceName, token, listRequest);
|
|
12
|
+
}
|
|
13
|
+
async getDefinitions(token, dataProductDefinitionsPath) {
|
|
14
|
+
return this.reportingClient.getDefinitions(token, dataProductDefinitionsPath);
|
|
15
|
+
}
|
|
16
|
+
async requestAsyncReport(token, reportId, variantId, query) {
|
|
17
|
+
return this.reportingClient.requestAsyncReport(token, reportId, variantId, query);
|
|
18
|
+
}
|
|
19
|
+
async getAsyncReport(token, reportId, variantId, tableId, query) {
|
|
20
|
+
return this.reportingClient.getAsyncReport(token, reportId, variantId, tableId, query);
|
|
21
|
+
}
|
|
22
|
+
async getAsyncReportStatus(token, reportId, variantId, executionId) {
|
|
23
|
+
return this.reportingClient.getAsyncReportStatus(token, reportId, variantId, executionId);
|
|
24
|
+
}
|
|
25
|
+
async getAsyncCount(token, tableId) {
|
|
26
|
+
return this.reportingClient.getAsyncCount(token, tableId);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = ReportingService;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { components } from '../types/api'
|
|
2
|
+
import type ReportingClient from '../data/reportingClient'
|
|
3
|
+
import ReportQuery from '../types/ReportQuery'
|
|
4
|
+
import Dict = NodeJS.Dict
|
|
5
|
+
|
|
6
|
+
export default class ReportingService {
|
|
7
|
+
constructor(private readonly reportingClient: ReportingClient) {}
|
|
8
|
+
|
|
9
|
+
async getCount(resourceName: string, token: string, listRequest: ReportQuery): Promise<number> {
|
|
10
|
+
return this.reportingClient.getCount(resourceName, token, listRequest)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async getList(resourceName: string, token: string, listRequest: ReportQuery): Promise<Array<NodeJS.Dict<string>>> {
|
|
14
|
+
return this.reportingClient.getList(resourceName, token, listRequest)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async getDefinitions(
|
|
18
|
+
token: string,
|
|
19
|
+
dataProductDefinitionsPath?: string,
|
|
20
|
+
): Promise<Array<components['schemas']['ReportDefinitionSummary']>> {
|
|
21
|
+
return this.reportingClient.getDefinitions(token, dataProductDefinitionsPath)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async requestAsyncReport(
|
|
25
|
+
token: string,
|
|
26
|
+
reportId: string,
|
|
27
|
+
variantId: string,
|
|
28
|
+
query: Record<string, string | boolean | number>,
|
|
29
|
+
): Promise<Dict<string>> {
|
|
30
|
+
return this.reportingClient.requestAsyncReport(token, reportId, variantId, query)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getAsyncReport(
|
|
34
|
+
token: string,
|
|
35
|
+
reportId: string,
|
|
36
|
+
variantId: string,
|
|
37
|
+
tableId: string,
|
|
38
|
+
query: Dict<string | number>,
|
|
39
|
+
): Promise<Array<Dict<string>>> {
|
|
40
|
+
return this.reportingClient.getAsyncReport(token, reportId, variantId, tableId, query)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async getAsyncReportStatus(
|
|
44
|
+
token: string,
|
|
45
|
+
reportId: string,
|
|
46
|
+
variantId: string,
|
|
47
|
+
executionId: string,
|
|
48
|
+
): Promise<Dict<string>> {
|
|
49
|
+
return this.reportingClient.getAsyncReportStatus(token, reportId, variantId, executionId)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async getAsyncCount(token: string, tableId: string): Promise<number> {
|
|
53
|
+
return this.reportingClient.getAsyncCount(token, tableId)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Response, Request, NextFunction } from 'express'
|
|
2
2
|
import AsyncReportStoreService from '../services/requestedReportsService'
|
|
3
|
-
import
|
|
3
|
+
import ReportingService from '../services/reportingService'
|
|
4
4
|
|
|
5
5
|
export interface AsyncReportUtilsParams {
|
|
6
6
|
req?: Request
|
|
7
7
|
res: Response
|
|
8
8
|
next?: NextFunction
|
|
9
|
-
dataSources?:
|
|
9
|
+
dataSources?: ReportingService
|
|
10
10
|
asyncReportsStore?: AsyncReportStoreService
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
|
|
3
3
|
"description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
|
|
4
|
-
"version": "3.8.
|
|
4
|
+
"version": "3.8.2",
|
|
5
5
|
"main": "dpr/assets/js/all.mjs",
|
|
6
6
|
"sass": "dpr/all.scss",
|
|
7
7
|
"engines": {
|
package/package.zip
CHANGED
|
Binary file
|