From 040c4d9dabc2bf82badc1e1f109e2dabb295c7ab Mon Sep 17 00:00:00 2001 From: Matt Crowson <60104344+matt-crowson-moj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:53:01 +0000 Subject: [PATCH] BAVL-550 removing now redundant legacy BVLS email code/configuration. (#2818) --- backend/config.ts | 51 ------------ backend/setupNotifyClient.ts | 9 --- backend/shared/notifyClient.ts | 10 --- cypress.env | 2 - .../digital-prison-services/values.yaml | 15 ---- package-lock.json | 78 ------------------- package.json | 1 - 7 files changed, 166 deletions(-) delete mode 100644 backend/setupNotifyClient.ts delete mode 100644 backend/shared/notifyClient.ts diff --git a/backend/config.ts b/backend/config.ts index 75bf70602..0e31f76b6 100644 --- a/backend/config.ts +++ b/backend/config.ts @@ -269,55 +269,6 @@ export const apis = { ui_url: process.env.CHANGE_SOMEONES_CELL_URL || 'http://localhost:3002', }, } -export const notifications = { - enabled: process.env.NOTIFY_ENABLED ? process.env.NOTIFY_ENABLED === 'true' : true, - notifyKey: process.env.NOTIFY_API_KEY || '', - confirmBookingPrisonTemplateId: '391bb0e0-89b3-4aef-b11e-c6550b71fee8', - emails: { - WWI: { - omu: process.env.WANDSWORTH_OMU_EMAIL, - }, - TSI: { - omu: process.env.THAMESIDE_OMU_EMAIL, - }, - HEI: { - omu: process.env.HEWELL_OMU_EMAIL, - }, - BWI: { - omu: process.env.BERWYN_OMU_EMAIL, - }, - NMI: { - omu: process.env.NOTTINGHAM_OMU_EMAIL, - }, - EYI: { - omu: process.env.ELMLEY_OMU_EMAIL, - }, - BNI: { - omu: process.env.BULLINGDON_OMU_EMAIL, - }, - PBI: { - omu: process.env.PETERBOROUGH_OMU_EMAIL, - }, - BMI: { - omu: process.env.BIRMINGHAM_OMU_EMAIL, - }, - NWI: { - omu: process.env.NORWICH_OMU_EMAIL, - }, - PNI: { - omu: process.env.PRESTON_OMU_EMAIL, - }, - BZI: { - omu: process.env.BRONZEFIELD_OMU_EMAIL, - }, - PVI: { - omu: process.env.PENTONVILLE_OMU_EMAIL, - }, - EXI: { - omu: process.env.EXETER_OMU_EMAIL, - }, - }, -} export const phaseName = process.env.SYSTEM_PHASE @@ -326,8 +277,6 @@ export default { analytics, hmppsCookie, redis, - applications, apis, - notifications, phaseName, } diff --git a/backend/setupNotifyClient.ts b/backend/setupNotifyClient.ts deleted file mode 100644 index 196d2b5aa..000000000 --- a/backend/setupNotifyClient.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NotifyClient } from 'notifications-node-client' -import config from './config' - -// @ts-expect-error ts-migrate(2339) FIXME: Property 'notifyClient' does not exist on type '{ ... Remove this comment to see the full error message -const notifyClient = config.notifyClient.enabled ? new NotifyClient(config.notifications.notifyKey) : { sendEmail() {} } - -export default { - notifyClient, -} diff --git a/backend/shared/notifyClient.ts b/backend/shared/notifyClient.ts deleted file mode 100644 index e8d665778..000000000 --- a/backend/shared/notifyClient.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NotifyClient } from 'notifications-node-client' -import config from '../config' - -export const notifyClient = config.notifications.enabled - ? new NotifyClient(config.notifications.notifyKey) - : { sendEmail() {} } - -export default { - notifyClient, -} diff --git a/cypress.env b/cypress.env index 402852ad0..5cf97689b 100644 --- a/cypress.env +++ b/cypress.env @@ -25,7 +25,6 @@ ALERTS_API_URL=http://localhost:9191/alerts-api/ MOIC_URL=http://omic-ui API_CLIENT_ID=dev -WANDSWORTH_OMU_EMAIL=test@local SOC_API_URL=http://localhost:9191/ SOC_UI_URL=http://soc/ USE_OF_FORCE_URL=http://use-of-force @@ -44,7 +43,6 @@ MERCURY_SUBMIT_LIVE_ENABLED_DATE= MANAGE_RESTRICTED_PATIENTS_URL=https://manage-restricted-patients TOKENVERIFICATION_API_ENABLED=true -NOTIFY_ENABLED=false DISPLAY_RETENTION_LINK=true SOC_API_ENABLED=true ESWE_ENABLED=true diff --git a/helm_deploy/digital-prison-services/values.yaml b/helm_deploy/digital-prison-services/values.yaml index c7e7d6f6f..f01489343 100644 --- a/helm_deploy/digital-prison-services/values.yaml +++ b/helm_deploy/digital-prison-services/values.yaml @@ -52,21 +52,6 @@ generic-service: GOOGLE_ANALYTICS_GA4_ID: "GOOGLE_ANALYTICS_GA4_ID" GOOGLE_TAG_MANAGER_ID: "GOOGLE_TAG_MANAGER_ID" SESSION_COOKIE_SECRET: "SESSION_COOKIE_SECRET" - NOTIFY_API_KEY: "NOTIFY_API_KEY" - WANDSWORTH_OMU_EMAIL: "WANDSWORTH_OMU_EMAIL" - THAMESIDE_OMU_EMAIL: "THAMESIDE_OMU_EMAIL" - HEWELL_OMU_EMAIL: "HEWELL_OMU_EMAIL" - BERWYN_OMU_EMAIL: "BERWYN_OMU_EMAIL" - ELMLEY_OMU_EMAIL: "ELMLEY_OMU_EMAIL" - NOTTINGHAM_OMU_EMAIL: "NOTTINGHAM_OMU_EMAIL" - BULLINGDON_OMU_EMAIL: "BULLINGDON_OMU_EMAIL" - PETERBOROUGH_OMU_EMAIL: "PETERBOROUGH_OMU_EMAIL" - BIRMINGHAM_OMU_EMAIL: "BIRMINGHAM_OMU_EMAIL" - NORWICH_OMU_EMAIL: "NORWICH_OMU_EMAIL" - PRESTON_OMU_EMAIL: "PRESTON_OMU_EMAIL" - BRONZEFIELD_OMU_EMAIL: "BRONZEFIELD_OMU_EMAIL" - PENTONVILLE_OMU_EMAIL: "PENTONVILLE_OMU_EMAIL" - EXETER_OMU_EMAIL: "EXETER_OMU_EMAIL" dps-redis: REDIS_HOST: "REDIS_HOST" diff --git a/package-lock.json b/package-lock.json index 7f1cb0e2a..e55fa78e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,6 @@ "nanoid": "^3.3.7", "nocache": "^2.1.0", "nock": "^13.3.8", - "notifications-node-client": "^7.0.6", "nunjucks": "^3.2.4", "passport": "^0.6.0", "passport-oauth2": "^1.7.0", @@ -15102,47 +15101,6 @@ "node": ">=0.10.0" } }, - "node_modules/notifications-node-client": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/notifications-node-client/-/notifications-node-client-7.0.6.tgz", - "integrity": "sha512-qo6eZMGdyaQnj/bkOnPb/d0a0sHIjiBzXlmICLPXYSD4pB3LYa537OhuZGuaFcSnkrM4NzbQhbQHAYX1NnbQgw==", - "dependencies": { - "axios": "^1.6.1", - "jsonwebtoken": "^9.0.0" - }, - "engines": { - "node": ">=14.17.3", - "npm": ">=6.14.13" - } - }, - "node_modules/notifications-node-client/node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/notifications-node-client/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/notifications-node-client/node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -30819,42 +30777,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, - "notifications-node-client": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/notifications-node-client/-/notifications-node-client-7.0.6.tgz", - "integrity": "sha512-qo6eZMGdyaQnj/bkOnPb/d0a0sHIjiBzXlmICLPXYSD4pB3LYa537OhuZGuaFcSnkrM4NzbQhbQHAYX1NnbQgw==", - "requires": { - "axios": "^1.6.1", - "jsonwebtoken": "^9.0.0" - }, - "dependencies": { - "axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", - "requires": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - } - } - }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", diff --git a/package.json b/package.json index 369684285..cd0c81eab 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "nanoid": "^3.3.7", "nocache": "^2.1.0", "nock": "^13.3.8", - "notifications-node-client": "^7.0.6", "nunjucks": "^3.2.4", "passport": "^0.6.0", "passport-oauth2": "^1.7.0",