diff --git a/package-lock.json b/package-lock.json index f719b5c0df..0db37bb402 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,7 +69,9 @@ "@types/file-saver": "^2.0.3", "@types/hammerjs": "^2.0.41", "@types/jasmine": "~3.8.2", + "@types/json-query": "^2.2.3", "@types/lodash": "^4.14.168", + "@types/md5": "^2.3.2", "@types/node": "^14.14.31", "@types/pouchdb": "^6.4.0", "@types/uuid": "^8.3.4", @@ -7741,6 +7743,12 @@ "integrity": "sha512-u5h7dqzy2XpXTzhOzSNQUQpKGFvROF8ElNX9P/TJvsHnTg/JvsAseVsGWQAQQldqanYaM+5kwxW909BBFAUYsg==", "dev": true }, + "node_modules/@types/json-query": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@types/json-query/-/json-query-2.2.3.tgz", + "integrity": "sha512-ygE4p8lyKzTBo9LF2K/u6MHnxPxbHY6wGvwM7TdAKhbP3SvEf+Y9aeVWedDiP8SMIPowTl9R/6awQYjiUTHz2g==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", @@ -7764,6 +7772,12 @@ "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.2.tgz", "integrity": "sha512-auNrZ/c0w6wsM9DccwVxWHssrMDezHUAXNesdp2RQrCVCyrQbOiSq7yqdJKrUQQpw9VTm7CGYJH2A/YG7jjrjQ==" }, + "node_modules/@types/md5": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/md5/-/md5-2.3.2.tgz", + "integrity": "sha512-v+JFDu96+UYJ3/UWzB0mEglIS//MZXgRaJ4ubUPwOM0gvLc/kcQ3TWNYwENEK7/EcXGQVrW8h/XqednSjBd/Og==", + "dev": true + }, "node_modules/@types/mdast": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", @@ -37086,6 +37100,12 @@ "integrity": "sha512-u5h7dqzy2XpXTzhOzSNQUQpKGFvROF8ElNX9P/TJvsHnTg/JvsAseVsGWQAQQldqanYaM+5kwxW909BBFAUYsg==", "dev": true }, + "@types/json-query": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@types/json-query/-/json-query-2.2.3.tgz", + "integrity": "sha512-ygE4p8lyKzTBo9LF2K/u6MHnxPxbHY6wGvwM7TdAKhbP3SvEf+Y9aeVWedDiP8SMIPowTl9R/6awQYjiUTHz2g==", + "dev": true + }, "@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", @@ -37109,6 +37129,12 @@ "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.2.tgz", "integrity": "sha512-auNrZ/c0w6wsM9DccwVxWHssrMDezHUAXNesdp2RQrCVCyrQbOiSq7yqdJKrUQQpw9VTm7CGYJH2A/YG7jjrjQ==" }, + "@types/md5": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/md5/-/md5-2.3.2.tgz", + "integrity": "sha512-v+JFDu96+UYJ3/UWzB0mEglIS//MZXgRaJ4ubUPwOM0gvLc/kcQ3TWNYwENEK7/EcXGQVrW8h/XqednSjBd/Og==", + "dev": true + }, "@types/mdast": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", diff --git a/package.json b/package.json index 2589c6c35e..69dcf3d3fe 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,9 @@ "@types/file-saver": "^2.0.3", "@types/hammerjs": "^2.0.41", "@types/jasmine": "~3.8.2", + "@types/json-query": "^2.2.3", "@types/lodash": "^4.14.168", + "@types/md5": "^2.3.2", "@types/node": "^14.14.31", "@types/pouchdb": "^6.4.0", "@types/uuid": "^8.3.4", diff --git a/src/app/core/analytics/analytics.service.ts b/src/app/core/analytics/analytics.service.ts index 652403a890..e2cb8d03e4 100644 --- a/src/app/core/analytics/analytics.service.ts +++ b/src/app/core/analytics/analytics.service.ts @@ -8,8 +8,7 @@ import { UsageAnalyticsConfig, } from "./usage-analytics-config"; import { Angulartics2 } from "angulartics2"; - -const md5 = require("md5"); +import md5 from "md5"; /** * Track usage analytics data and report it to a backend server like Matomo. @@ -20,7 +19,7 @@ const md5 = require("md5"); providedIn: "root", }) export class AnalyticsService { - private static getUserHash(username: string) { + private static getUserHash(username: string): string { return md5(AppConfig.settings?.site_name + username); } diff --git a/src/app/features/reporting/query.service.ts b/src/app/features/reporting/query.service.ts index e925a32e08..5c9434a24b 100644 --- a/src/app/features/reporting/query.service.ts +++ b/src/app/features/reporting/query.service.ts @@ -10,8 +10,7 @@ import { ChildSchoolRelation } from "../../child-dev-project/children/model/chil import { ChildrenService } from "../../child-dev-project/children/children.service"; import { AttendanceService } from "../../child-dev-project/attendance/attendance.service"; import { EventAttendance } from "../../child-dev-project/attendance/model/event-attendance"; - -const jsonQuery = require("json-query"); +import jsonQuery from "json-query"; /** * A query service which uses the json-query library (https://github.com/auditassistant/json-query).