From e02477ab45e8fa865a0e88c7c58904b5dff304a3 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:44:44 -0600 Subject: [PATCH 001/112] WIP - POC for durable functions Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/functions/package-lock.json | 1259 ++++------------- backend/functions/package.json | 1 + backend/functions/poc/dfClient.function.ts | 23 + backend/functions/poc/getConsolidations.ts | 13 + backend/functions/poc/getPageCount.ts | 13 + backend/functions/poc/model.ts | 15 + backend/functions/poc/orchestrator.ts | 27 + backend/functions/poc/sub-orchestrator-etl.ts | 25 + .../functions/poc/sub-orchestrator-paging.ts | 25 + 9 files changed, 400 insertions(+), 1001 deletions(-) create mode 100644 backend/functions/poc/dfClient.function.ts create mode 100644 backend/functions/poc/getConsolidations.ts create mode 100644 backend/functions/poc/getPageCount.ts create mode 100644 backend/functions/poc/model.ts create mode 100644 backend/functions/poc/orchestrator.ts create mode 100644 backend/functions/poc/sub-orchestrator-etl.ts create mode 100644 backend/functions/poc/sub-orchestrator-paging.ts diff --git a/backend/functions/package-lock.json b/backend/functions/package-lock.json index 1bef5fc47..faf5848c0 100644 --- a/backend/functions/package-lock.json +++ b/backend/functions/package-lock.json @@ -17,6 +17,7 @@ "@okta/okta-sdk-nodejs": "^7.1.1", "applicationinsights": "^3.4.0", "dotenv": "^16.4.7", + "durable-functions": "^3.1.0", "jsonwebtoken": "^9.0.2", "mongodb": "^6.11.0", "mssql": "^10.0.4" @@ -46,7 +47,6 @@ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -59,7 +59,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, @@ -71,7 +70,6 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.9.0.tgz", "integrity": "sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.11.0", @@ -85,7 +83,6 @@ "version": "1.9.2", "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.9.2.tgz", "integrity": "sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.4.0", @@ -103,7 +100,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.1.2.tgz", "integrity": "sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-client": "^1.3.0", @@ -117,7 +113,6 @@ "version": "2.7.2", "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz", "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.2.0", @@ -132,7 +127,6 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz", "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==", - "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, @@ -144,7 +138,6 @@ "version": "1.18.1", "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.18.1.tgz", "integrity": "sha512-/wS73UEDrxroUEVywEm7J0p2c+IIiVxyfigCGfsKvCxxCET4V/Hef2aURqltrXMRjNmdmt5IuOgIpl8f6xdO5A==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.8.0", @@ -163,7 +156,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.2.0.tgz", "integrity": "sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==", - "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, @@ -175,7 +167,6 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.11.0.tgz", "integrity": "sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "tslib": "^2.6.2" @@ -188,7 +179,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-4.2.0.tgz", "integrity": "sha512-acfAQTYLxgB/iZK7XvTVYe9NPk6DECEgcIXDQhyn7Uo4dGxeeW5D3YqLjLJrrzND5Iawer3eUQ5/iiLWvTGAxQ==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.7.1", @@ -209,7 +199,6 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.0.tgz", "integrity": "sha512-vGq9jXlgrJ3KaI8bepgfpk26zVY8vFZsQukF85qjjKTAR90eFOOBNaa+mc/0ViDY2lcdrU2fL/o1pQyZUtTDsw==", - "license": "MIT", "dependencies": { "cookie": "^0.7.0", "long": "^4.0.0", @@ -224,7 +213,6 @@ "version": "3.5.1", "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-3.5.1.tgz", "integrity": "sha512-6UltvJiuVpvHSwLcK/Zc6NfUwlkDLOFFx97BHCJzlWNsfiWwzwmTsxJXg4kE/LemKTHxPpfoPE+kOJ8hAdiKFQ==", - "license": "MIT", "dependencies": { "iconv-lite": "^0.6.3", "long": "^4.0.0", @@ -235,7 +223,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.5.0.tgz", "integrity": "sha512-EknvVmtBuSIic47xkOqyNabAme0RYTw52BTMz8eBgU1ysTyMrD1uOoM+JdS0J/4Yfp98IBT3osqq3BfwSaNaGQ==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.9.0", @@ -260,7 +247,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/@azure/keyvault-common/-/keyvault-common-2.0.0.tgz", "integrity": "sha512-wRLVaroQtOqfg60cxkzUkGKrKMsCP6uYXAOomOIysSMyt1/YM0eUn9LqieAWM8DLcU4+07Fio2YGpPeqUbpP9w==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.3.0", @@ -279,7 +265,6 @@ "version": "4.9.0", "resolved": "https://registry.npmjs.org/@azure/keyvault-keys/-/keyvault-keys-4.9.0.tgz", "integrity": "sha512-ZBP07+K4Pj3kS4TF4XdkqFcspWwBHry3vJSOFM5k5ZABvf7JfiMonvaFk2nBF6xjlEbMpz5PE1g45iTMme0raQ==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.3.0", @@ -302,7 +287,6 @@ "version": "4.9.0", "resolved": "https://registry.npmjs.org/@azure/keyvault-secrets/-/keyvault-secrets-4.9.0.tgz", "integrity": "sha512-XkLsuzxFdhVIOVcELhso8OhQgY2lSWZcZn6fqjE848FwP9lJemJhu7nxYy8Q1nns6XqPB0WsTPmEkR8eu852vA==", - "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.3.0", @@ -325,7 +309,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.4.tgz", "integrity": "sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==", - "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, @@ -337,7 +320,6 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry/-/monitor-opentelemetry-1.8.0.tgz", "integrity": "sha512-hrHbz17zgoePPcS5PyXU/8j8kQv+TfFt7UF235htxb4VnbiSBcgsGquuI+Dv4DDVGL03UVJ8x/NvPY4qnkKdnA==", - "license": "MIT", "dependencies": { "@azure/core-auth": "^1.3.0", "@azure/core-client": "^1.0.0", @@ -377,7 +359,6 @@ "version": "1.0.0-beta.27", "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry-exporter/-/monitor-opentelemetry-exporter-1.0.0-beta.27.tgz", "integrity": "sha512-21iXu9ubtPB7iO3ghnzMMdB0KwHpz7Zl1a9xSBR3Gl8IDUlXOBjMn6OT9+ycj9VZrTyEKiV59T9VTf0IlokPYQ==", - "license": "MIT", "dependencies": { "@azure/core-auth": "^1.3.0", "@azure/core-client": "^1.0.0", @@ -400,7 +381,6 @@ "version": "3.27.0", "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.27.0.tgz", "integrity": "sha512-+b4ZKSD8+vslCtVRVetkegEhOFMLP3rxDWJY212ct+2r6jVg6OSQKc1Qz3kCoXo0FgwaXkb+76TMZfpHp8QtgA==", - "license": "MIT", "dependencies": { "@azure/msal-common": "14.16.0" }, @@ -412,7 +392,6 @@ "version": "14.16.0", "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", - "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -421,7 +400,6 @@ "version": "2.16.2", "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", - "license": "MIT", "dependencies": { "@azure/msal-common": "14.16.0", "jsonwebtoken": "^9.0.0", @@ -435,7 +413,6 @@ "version": "1.0.0-beta.7", "resolved": "https://registry.npmjs.org/@azure/opentelemetry-instrumentation-azure-sdk/-/opentelemetry-instrumentation-azure-sdk-1.0.0-beta.7.tgz", "integrity": "sha512-boG33EDRcbw0Jo2cRgB6bccSirKOzYdYFMdcSsnOajLCLfJ8WIve3vxUMi7YZKxM8txZX/0cwzUU6crXmYxXZg==", - "license": "MIT", "dependencies": { "@azure/core-tracing": "^1.2.0", "@azure/logger": "^1.0.0", @@ -453,7 +430,6 @@ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", @@ -468,7 +444,6 @@ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -478,7 +453,6 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, - "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -509,7 +483,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -519,7 +492,6 @@ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/parser": "^7.26.2", "@babel/types": "^7.26.0", @@ -536,7 +508,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/compat-data": "^7.25.9", "@babel/helper-validator-option": "^7.25.9", @@ -553,7 +524,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -563,7 +533,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" @@ -577,7 +546,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9", @@ -595,7 +563,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -605,7 +572,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -615,7 +581,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -625,7 +590,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -635,7 +599,6 @@ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/template": "^7.25.9", "@babel/types": "^7.26.0" @@ -649,7 +612,6 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/types": "^7.26.0" }, @@ -665,7 +627,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -678,7 +639,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -691,7 +651,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -704,7 +663,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -720,7 +678,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, @@ -736,7 +693,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -749,7 +705,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -762,7 +717,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, @@ -778,7 +732,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -791,7 +744,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -804,7 +756,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -817,7 +768,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -830,7 +780,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -843,7 +792,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -856,7 +804,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -872,7 +819,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -888,7 +834,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, @@ -904,7 +849,6 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.25.9", "@babel/parser": "^7.25.9", @@ -919,7 +863,6 @@ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.25.9", "@babel/generator": "^7.25.9", @@ -938,7 +881,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -948,7 +890,6 @@ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -961,14 +902,12 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@colors/colors": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "license": "MIT", "engines": { "node": ">=0.1.90" } @@ -978,7 +917,6 @@ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, - "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -997,7 +935,6 @@ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -1007,7 +944,6 @@ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1031,7 +967,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1048,7 +983,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1058,15 +992,13 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1079,7 +1011,6 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, - "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1095,7 +1026,6 @@ "url": "https://opencollective.com/fakerjs" } ], - "license": "MIT", "engines": { "node": ">=18.0.0", "npm": ">=9.0.0" @@ -1105,16 +1035,14 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/@grpc/grpc-js": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.12.3.tgz", - "integrity": "sha512-iaxAZnANdCwMNpJlyhkI1W1jQZIDZKFNtU2OpQDdgd+pBcU3t7G+PT7svobkW4WSZTdis+CVV6y8KIwu83HDYQ==", - "license": "Apache-2.0", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.12.2.tgz", + "integrity": "sha512-bgxdZmgTrJZX50OjyVwz3+mNEnCTNkh3cIqGPWVNeW9jX6bn1ZkU80uPd+67/ZpIJIjRQ9qaHCjhavyoWYxumg==", "dependencies": { "@grpc/proto-loader": "^0.7.13", "@js-sdsl/ordered-map": "^4.4.2" @@ -1127,7 +1055,6 @@ "version": "0.7.13", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", - "license": "Apache-2.0", "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", @@ -1144,8 +1071,7 @@ "node_modules/@grpc/proto-loader/node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "license": "Apache-2.0" + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", @@ -1153,7 +1079,6 @@ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, - "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -1168,7 +1093,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1179,7 +1103,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1192,7 +1115,6 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -1206,15 +1128,13 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", - "dev": true, - "license": "BSD-3-Clause" + "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, - "license": "ISC", "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -1231,7 +1151,6 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } @@ -1241,7 +1160,6 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -1255,7 +1173,6 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -1269,7 +1186,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -1282,7 +1198,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -1298,7 +1213,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -1311,7 +1225,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1320,15 +1233,13 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" + "dev": true }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1338,7 +1249,6 @@ "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -1356,7 +1266,6 @@ "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", @@ -1404,7 +1313,6 @@ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", @@ -1420,7 +1328,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, - "license": "MIT", "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" @@ -1434,7 +1341,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, - "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3" }, @@ -1447,7 +1353,6 @@ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", @@ -1465,7 +1370,6 @@ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -1481,7 +1385,6 @@ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, - "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", @@ -1525,7 +1428,6 @@ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, - "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -1538,7 +1440,6 @@ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -1553,7 +1454,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", @@ -1569,7 +1469,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", @@ -1585,7 +1484,6 @@ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -1612,7 +1510,6 @@ "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -1630,7 +1527,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -1645,7 +1541,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -1655,7 +1550,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -1664,15 +1558,13 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -1681,14 +1573,12 @@ "node_modules/@js-joda/core": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.6.3.tgz", - "integrity": "sha512-T1rRxzdqkEXcou0ZprN1q9yDRlvzCPLqmlNt5IIsGBzoEVgLCCYrKEwc84+TvsXuAc95VAZwtWD2zVsKPY4bcA==", - "license": "BSD-3-Clause" + "integrity": "sha512-T1rRxzdqkEXcou0ZprN1q9yDRlvzCPLqmlNt5IIsGBzoEVgLCCYrKEwc84+TvsXuAc95VAZwtWD2zVsKPY4bcA==" }, "node_modules/@js-sdsl/ordered-map": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/js-sdsl" @@ -1697,14 +1587,12 @@ "node_modules/@launchdarkly/js-sdk-common": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/@launchdarkly/js-sdk-common/-/js-sdk-common-2.12.0.tgz", - "integrity": "sha512-HIDxvgo1vksC9hsYy3517sgW0Ql+iW3fgwlq/CEigeBNmaa9/J1Pxo7LrKPzezEA0kaGedmt/DCzVVxVBmxSsQ==", - "license": "Apache-2.0" + "integrity": "sha512-HIDxvgo1vksC9hsYy3517sgW0Ql+iW3fgwlq/CEigeBNmaa9/J1Pxo7LrKPzezEA0kaGedmt/DCzVVxVBmxSsQ==" }, "node_modules/@launchdarkly/js-server-sdk-common": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@launchdarkly/js-server-sdk-common/-/js-server-sdk-common-2.10.0.tgz", "integrity": "sha512-zbqpmEFQW/ZElZnRYX6N4gMZMpviE0F75/IyxcifLAFsjGNouxllpOOPbdtrLiJnJ0ixzt5vbtnem4tbhlYNOw==", - "license": "Apache-2.0", "dependencies": { "@launchdarkly/js-sdk-common": "2.12.0", "semver": "7.5.4" @@ -1714,7 +1602,6 @@ "version": "9.7.2", "resolved": "https://registry.npmjs.org/@launchdarkly/node-server-sdk/-/node-server-sdk-9.7.2.tgz", "integrity": "sha512-gcRarEh0yQrlwbWDORwbfTk19M/FtZje60EIo/c4298D/sqJ906MYq0J2MmyklEuIdQx/V4qPK+ss9LCCLpm/Q==", - "license": "Apache-2.0", "dependencies": { "@launchdarkly/js-server-sdk-common": "2.10.0", "https-proxy-agent": "^5.0.1", @@ -1725,7 +1612,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", "dependencies": { "debug": "4" }, @@ -1737,7 +1623,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", "dependencies": { "agent-base": "6", "debug": "4" @@ -1749,14 +1634,12 @@ "node_modules/@microsoft/applicationinsights-web-snippet": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-snippet/-/applicationinsights-web-snippet-1.2.1.tgz", - "integrity": "sha512-+Cy9zFqdQgdAbMK1dpm7B+3DUnrByai0Tq6XG9v737HJpW6G1EiNNbTuFeXdPWyGaq6FIx9jxm/SUcxA6/Rxxg==", - "license": "MIT" + "integrity": "sha512-+Cy9zFqdQgdAbMK1dpm7B+3DUnrByai0Tq6XG9v737HJpW6G1EiNNbTuFeXdPWyGaq6FIx9jxm/SUcxA6/Rxxg==" }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", - "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" } @@ -1766,7 +1649,6 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1780,7 +1662,6 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } @@ -1790,7 +1671,6 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1803,7 +1683,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@okta/jwt-verifier/-/jwt-verifier-4.0.1.tgz", "integrity": "sha512-U9d8BDiR0LhRw2dyXVJwnc4eeudBc1VPn1b1hoOuKi1/kJpEoheB++/Lvi3rQjMGXgE6KtKN7hosILzw8bBB6w==", - "license": "Apache-2.0", "dependencies": { "jwks-rsa": "^3.1.0", "njwt": "^2.0.1" @@ -1816,7 +1695,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/@okta/okta-sdk-nodejs/-/okta-sdk-nodejs-7.1.1.tgz", "integrity": "sha512-sY6y749Lo7NAchp+aV+0Px9Yj4Zsz7CJGfQEJBHAHjnNnRk3+XQkiJobal1w4xATsgHTZrNHFMqYp8yRiLWerA==", - "license": "Apache-2.0", "dependencies": { "@types/node-forge": "^1.3.1", "deep-copy": "^1.4.2", @@ -1840,7 +1718,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", "dependencies": { "debug": "4" }, @@ -1852,7 +1729,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", "dependencies": { "agent-base": "6", "debug": "4" @@ -1865,7 +1741,6 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", - "license": "Apache-2.0", "engines": { "node": ">=8.0.0" } @@ -1874,7 +1749,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -1886,7 +1760,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.28.0.tgz", "integrity": "sha512-igcl4Ve+F1N2063PJUkesk/GkYyuGIWinYkSyAFTnIj3gzrOgvOA4k747XNdL47HRRL1w/qh7UW8NDuxOLvKFA==", - "license": "Apache-2.0", "engines": { "node": ">=14" }, @@ -1898,7 +1771,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.28.0.tgz", "integrity": "sha512-ZLwRMV+fNDpVmF2WYUdBHlq0eOWtEaUJSusrzjGnBt7iSRvfjFE3RXYUZJrqou/wIDWV0DwQ5KIfYe9WXg9Xqw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -1913,7 +1785,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -1922,7 +1793,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-grpc/-/exporter-logs-otlp-grpc-0.53.0.tgz", "integrity": "sha512-x5ygAQgWAQOI+UOhyV3z9eW7QU2dCfnfOuIBiyYmC2AWr74f6x/3JBnP27IAcEx6aihpqBYWKnpoUTztkVPAZw==", - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.26.0", @@ -1941,7 +1811,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -1956,7 +1825,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -1965,7 +1833,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.53.0.tgz", "integrity": "sha512-cSRKgD/n8rb+Yd+Cif6EnHEL/VZg1o8lEcEwFji1lwene6BdH51Zh3feAD9p2TyVoBKrl6Q9Zm2WltSp2k9gWQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", @@ -1984,7 +1851,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -1999,7 +1865,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2008,7 +1873,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-proto/-/exporter-logs-otlp-proto-0.53.0.tgz", "integrity": "sha512-jhEcVL1deeWNmTUP05UZMriZPSWUBcfg94ng7JuBb1q2NExgnADQFl1VQQ+xo62/JepK+MxQe4xAwlsDQFbISA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", @@ -2029,7 +1893,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2044,7 +1907,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2060,7 +1922,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2077,7 +1938,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2086,7 +1946,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.53.0.tgz", "integrity": "sha512-nvZtOk23pZOrTW10Za2WPd9pk4tWDvL6ALlHRFfInpcTjtOgCrv+fQDxpzosa5PeXvYeFFUO5aYCTnwiCX4Dzg==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/otlp-exporter-base": "0.53.0", @@ -2105,7 +1964,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2120,7 +1978,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2136,7 +1993,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0" @@ -2152,7 +2008,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2161,7 +2016,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.53.0.tgz", "integrity": "sha512-m6KSh6OBDwfDjpzPVbuJbMgMbkoZfpxYH2r262KckgX9cMYvooWXEKzlJYsNDC6ADr28A1rtRoUVRwNfIN4tUg==", - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.26.0", @@ -2181,7 +2035,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2196,7 +2049,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2212,7 +2064,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2229,7 +2080,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2238,7 +2088,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.53.0.tgz", "integrity": "sha512-m7F5ZTq+V9mKGWYpX8EnZ7NjoqAU7VemQ1E2HAG+W/u0wpY1x0OmbxAXfGKFHCspdJk8UKlwPGrpcB8nay3P8A==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/otlp-exporter-base": "0.53.0", @@ -2257,7 +2106,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2272,7 +2120,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2288,7 +2135,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2305,7 +2151,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2314,7 +2159,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.53.0.tgz", "integrity": "sha512-T/bdXslwRKj23S96qbvGtaYOdfyew3TjPEKOk5mHjkCmkVl1O9C/YMdejwSsdLdOq2YW30KjR9kVi0YMxZushQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/otlp-exporter-base": "0.53.0", @@ -2333,7 +2177,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2348,7 +2191,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2364,7 +2206,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2381,7 +2222,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2390,7 +2230,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.26.0.tgz", "integrity": "sha512-PW5R34n3SJHO4t0UetyHKiXL6LixIqWN6lWncg3eRXhKuT30x+b7m5sDJS0kEWRfHeS+kG7uCw2vBzmB2lk3Dw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2408,7 +2247,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2423,7 +2261,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2439,7 +2276,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2456,7 +2292,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2465,7 +2300,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@types/shimmer": "^1.2.0", @@ -2485,7 +2319,6 @@ "version": "0.41.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-bunyan/-/instrumentation-bunyan-0.41.0.tgz", "integrity": "sha512-NoQS+gcwQ7pzb2PZFyra6bAxDAVXBMmpKxBblEuXJWirGrAksQllg9XTdmqhrwT/KxUYrbVca/lMams7e51ysg==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "^0.53.0", "@opentelemetry/instrumentation": "^0.53.0", @@ -2502,7 +2335,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.53.0.tgz", "integrity": "sha512-H74ErMeDuZfj7KgYCTOFGWF5W9AfaPnqLQQxeFq85+D29wwV2yqHbz2IKLYpkOh7EI6QwDEl7rZCIxjJLyc/CQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/instrumentation": "0.53.0", @@ -2520,7 +2352,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2535,7 +2366,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2544,7 +2374,6 @@ "version": "0.47.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.47.0.tgz", "integrity": "sha512-yqyXRx2SulEURjgOQyJzhCECSh5i1uM49NUaq9TqLd6fA7g26OahyJfsr9NE38HFqGRHpi4loyrnfYGdrsoVjQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.53.0", "@opentelemetry/sdk-metrics": "^1.9.1", @@ -2561,7 +2390,6 @@ "version": "0.41.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.41.0.tgz", "integrity": "sha512-jnvrV6BsQWyHS2qb2fkfbfSb1R/lmYwqEZITwufuRl37apTopswu9izc0b1CYRp/34tUG/4k/V39PND6eyiNvw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.53.0", "@opentelemetry/semantic-conventions": "^1.27.0", @@ -2578,7 +2406,6 @@ "version": "0.45.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.45.1.tgz", "integrity": "sha512-GHUvPv7CQEK3RKHH3YAj6mjgJ3nZb6wRQS+t0yaRgKZzX2ggGsLN6OhRT04+IjqmMg9aIRUy1CzqwzgqAxjYbw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.26.0", "@opentelemetry/instrumentation": "^0.53.0", @@ -2598,7 +2425,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2607,7 +2433,6 @@ "version": "0.42.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.42.0.tgz", "integrity": "sha512-jZBoqve0rEC51q0HuhjtZVq1DtUvJHzEJ3YKGvzGar2MU1J4Yt5+pQAQYh1W4jSoDyKeaI4hyeUdWM5N0c2lqA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.53.0", "@opentelemetry/redis-common": "^0.36.2", @@ -2624,7 +2449,6 @@ "version": "0.42.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.42.1.tgz", "integrity": "sha512-xm17LJhDfQzQo4wkM/zFwh6wk3SNN/FBFGkscI9Kj4efrb/o5p8Z3yE6ldBPNdIZ6RAwg2p3DL7fvE3DuUDJWA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.53.0", "@opentelemetry/redis-common": "^0.36.2", @@ -2641,7 +2465,6 @@ "version": "0.40.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-winston/-/instrumentation-winston-0.40.0.tgz", "integrity": "sha512-eMk2tKl86YJ8/yHvtDbyhrE35/R0InhO9zuHTflPx8T0+IvKVUhPV71MsJr32sImftqeOww92QHt4Jd+a5db4g==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "^0.53.0", "@opentelemetry/instrumentation": "^0.53.0" @@ -2657,7 +2480,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.53.0.tgz", "integrity": "sha512-UCWPreGQEhD6FjBaeDuXhiMf6kkBODF0ZQzrk/tuQcaVDJ+dDQ/xhJp192H9yWnKxVpEjFrSSLnpqmX4VwX+eA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/otlp-transformer": "0.53.0" @@ -2673,7 +2495,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2688,7 +2509,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2697,7 +2517,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.53.0.tgz", "integrity": "sha512-F7RCN8VN+lzSa4fGjewit8Z5fEUpY/lmMVy5EWn2ZpbAabg3EE3sCLuTNfOiooNGnmvzimUPruoeqeko/5/TzQ==", - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.26.0", @@ -2715,7 +2534,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2730,7 +2548,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2739,7 +2556,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.53.0.tgz", "integrity": "sha512-rM0sDA9HD8dluwuBxLetUmoqGJKSAbWenwD65KY9iZhUxdBHRLrIdrABfNDP7aiTjcgK8XFyTn5fhDz7N+W6DA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", @@ -2760,7 +2576,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2775,7 +2590,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2791,7 +2605,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0" @@ -2807,7 +2620,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -2824,7 +2636,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2833,7 +2644,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.28.0.tgz", "integrity": "sha512-Q7HVDIMwhN5RxL4bECMT4BdbyYSAKkC6U/RGn4NpO/cbqP6ZRg+BS7fPo/pGZi2w8AHfpIGQFXQmE8d2PC5xxQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.28.0" }, @@ -2848,7 +2658,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.28.0.tgz", "integrity": "sha512-wKJ94+s8467CnIRgoSRh0yXm/te0QMOwTq9J01PfG/RzYZvlvN8aRisN2oZ9SznB45dDGnMj3BhUlchSA9cEKA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.28.0" }, @@ -2863,7 +2672,6 @@ "version": "0.36.2", "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2872,7 +2680,6 @@ "version": "0.2.12", "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-azure/-/resource-detector-azure-0.2.12.tgz", "integrity": "sha512-iIarQu6MiCjEEp8dOzmBvCSlRITPFTinFB2oNKAjU6xhx8d7eUcjNOKhBGQTvuCriZrxrEvDaEEY9NfrPQ6uYQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.25.1", "@opentelemetry/resources": "^1.10.1", @@ -2889,7 +2696,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.28.0.tgz", "integrity": "sha512-cIyXSVJjGeTICENN40YSvLDAq4Y2502hGK3iN7tfdynQLKWb3XWZQEkPc+eSx47kiy11YeFAlYkEfXwR1w8kfw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.28.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2905,7 +2711,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2914,7 +2719,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.53.0.tgz", "integrity": "sha512-dhSisnEgIj/vJZXZV6f6KcTnyLDx/VuQ6l3ejuZpMpPlh9S1qMHiZU9NMmOkVkwwHkMy3G6mEBwdP23vUZVr4g==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", @@ -2931,7 +2735,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -2946,7 +2749,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -2962,7 +2764,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2971,7 +2772,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.28.0.tgz", "integrity": "sha512-43tqMK/0BcKTyOvm15/WQ3HLr0Vu/ucAl/D84NO7iSlv6O4eOprxSHa3sUtmYkaZWHqdDJV0AHVz/R6u4JALVQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.28.0", "@opentelemetry/resources": "1.28.0" @@ -2987,7 +2787,6 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.53.0.tgz", "integrity": "sha512-0hsxfq3BKy05xGktwG8YdGdxV978++x40EAKyKr1CaHZRh8uqVlXnclnl7OMi9xLMJEcXUw7lGhiRlArFcovyg==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", @@ -3017,7 +2816,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz", "integrity": "sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg==", - "license": "Apache-2.0", "engines": { "node": ">=14" }, @@ -3029,7 +2827,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -3044,7 +2841,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.26.0.tgz", "integrity": "sha512-vvVkQLQ/lGGyEy9GT8uFnI047pajSOVnZI2poJqVGD3nJ+B9sFGdlHNnQKophE3lHfnIH0pw2ubrCTjZCgIj+Q==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0" }, @@ -3059,7 +2855,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.26.0.tgz", "integrity": "sha512-DelFGkCdaxA1C/QA0Xilszfr0t4YbGd3DjxiCDPh34lfnFr+VkkrjV9S8ZTJvAzfdKERXhfOxIKBoGPJwoSz7Q==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0" }, @@ -3074,7 +2869,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -3090,7 +2884,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0" @@ -3106,7 +2899,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", @@ -3123,7 +2915,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.26.0.tgz", "integrity": "sha512-Fj5IVKrj0yeUwlewCRwzOVcr5avTuNnMHWf7GPc1t6WaT78J6CJyF3saZ/0RkZfdeNO8IcBl/bNcWMVZBMRW8Q==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/context-async-hooks": "1.26.0", "@opentelemetry/core": "1.26.0", @@ -3143,7 +2934,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -3152,7 +2942,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.28.0.tgz", "integrity": "sha512-ceUVWuCpIao7Y5xE02Xs3nQi0tOGmMea17ecBdwtCvdo9ekmO+ijc9RFDgfifMl7XCBf41zne/1POM3LqSTZDA==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.28.0", "@opentelemetry/resources": "1.28.0", @@ -3169,7 +2958,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -3178,7 +2966,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.28.0.tgz", "integrity": "sha512-N0sYfYXvHpP0FNIyc+UfhLnLSTOuZLytV0qQVrDWIlABeD/DWJIGttS7nYeR14gQLXch0M1DW8zm3VeN6Opwtg==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/context-async-hooks": "1.28.0", "@opentelemetry/core": "1.28.0", @@ -3198,7 +2985,6 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -3207,7 +2993,6 @@ "version": "0.40.1", "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.1.0" }, @@ -3222,7 +3007,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/@opentelemetry/winston-transport/-/winston-transport-0.6.0.tgz", "integrity": "sha512-paYrOThvm8cjSB3fQYdRzx+RVTcnTfzqInUH68SEX8frBLyn3FS0KDJJQc3Q3bamfec2J9KEkubHcAzq6OkEVw==", - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "^0.53.0", "winston-transport": "4.*" @@ -3236,7 +3020,6 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -3247,32 +3030,27 @@ "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "license": "BSD-3-Clause" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "license": "BSD-3-Clause" + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "license": "BSD-3-Clause" + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "license": "BSD-3-Clause" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -3281,53 +3059,45 @@ "node_modules/@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "license": "BSD-3-Clause" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "license": "BSD-3-Clause" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "license": "BSD-3-Clause" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "license": "BSD-3-Clause" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "license": "BSD-3-Clause" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" } @@ -3337,7 +3107,6 @@ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.0" } @@ -3345,15 +3114,13 @@ "node_modules/@tediousjs/connection-string": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-0.5.0.tgz", - "integrity": "sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==", - "license": "MIT" + "integrity": "sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==" }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -3367,7 +3134,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/types": "^7.0.0" } @@ -3377,7 +3143,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, - "license": "MIT", "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -3388,7 +3153,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/types": "^7.20.7" } @@ -3397,7 +3161,6 @@ "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -3407,7 +3170,6 @@ "version": "1.8.9", "resolved": "https://registry.npmjs.org/@types/bunyan/-/bunyan-1.8.9.tgz", "integrity": "sha512-ZqS9JGpBxVOvsawzmVt30sP++gSQMTejCkIAQ3VdadOcRE8izTyW66hufvwLeH+YEGP6Js2AW7Gz+RMyvrEbmw==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3416,7 +3178,6 @@ "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3425,7 +3186,6 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", - "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -3437,7 +3197,6 @@ "version": "4.19.6", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", - "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -3450,7 +3209,6 @@ "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3458,22 +3216,19 @@ "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "license": "MIT" + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, - "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -3483,7 +3238,6 @@ "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } @@ -3493,7 +3247,6 @@ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, - "license": "MIT", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -3503,14 +3256,12 @@ "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/jsonwebtoken": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", "integrity": "sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3518,15 +3269,13 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "license": "MIT" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/mssql": { "version": "9.1.5", "resolved": "https://registry.npmjs.org/@types/mssql/-/mssql-9.1.5.tgz", "integrity": "sha512-Q9EsgXwuRoX5wvUSu24YfbKMbFChv7pZ/jeCzPkj47ehcuXYsBcfogwrtVFosSjinD4Q/MY2YPGk9Yy1cM2Ywg==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*", "@types/tedious": "*", @@ -3537,7 +3286,6 @@ "version": "2.15.26", "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz", "integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3546,7 +3294,6 @@ "version": "22.10.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", "dependencies": { "undici-types": "~6.20.0" } @@ -3555,7 +3302,6 @@ "version": "1.3.11", "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3564,7 +3310,6 @@ "version": "8.6.1", "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", - "license": "MIT", "dependencies": { "@types/node": "*", "pg-protocol": "*", @@ -3575,7 +3320,6 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.6.tgz", "integrity": "sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==", - "license": "MIT", "dependencies": { "@types/pg": "*" } @@ -3583,20 +3327,17 @@ "node_modules/@types/qs": { "version": "6.9.17", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", - "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==", - "license": "MIT" + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "license": "MIT" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/readable-stream": { "version": "4.0.18", "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.18.tgz", "integrity": "sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==", - "license": "MIT", "dependencies": { "@types/node": "*", "safe-buffer": "~5.1.1" @@ -3605,14 +3346,12 @@ "node_modules/@types/readable-stream/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "license": "MIT", "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3622,7 +3361,6 @@ "version": "1.15.7", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", - "license": "MIT", "dependencies": { "@types/http-errors": "*", "@types/node": "*", @@ -3632,22 +3370,19 @@ "node_modules/@types/shimmer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", - "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==", - "license": "MIT" + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/tedious": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3655,20 +3390,17 @@ "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "license": "MIT" + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", - "license": "MIT" + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" }, "node_modules/@types/whatwg-url": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "license": "MIT", "dependencies": { "@types/webidl-conversions": "*" } @@ -3678,7 +3410,6 @@ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, - "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } @@ -3687,15 +3418,13 @@ "version": "21.0.3", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.18.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "7.18.0", @@ -3729,7 +3458,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "7.18.0", @@ -3759,7 +3487,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, - "license": "MIT", "dependencies": { "@typescript-eslint/types": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0" @@ -3777,7 +3504,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, - "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "7.18.0", "@typescript-eslint/utils": "7.18.0", @@ -3805,7 +3531,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -3819,7 +3544,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0", @@ -3848,7 +3572,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3861,7 +3584,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "7.18.0", @@ -3884,7 +3606,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, - "license": "MIT", "dependencies": { "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" @@ -3901,14 +3622,12 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -3920,7 +3639,6 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3932,7 +3650,6 @@ "version": "1.9.5", "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -3942,7 +3659,6 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -3951,15 +3667,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/acorn-jsx-walk/-/acorn-jsx-walk-2.0.0.tgz", "integrity": "sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/acorn-loose": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/acorn-loose/-/acorn-loose-8.4.0.tgz", "integrity": "sha512-M0EUka6rb+QC4l9Z3T0nJEzNOO7JcoJlYMrBlyBCiFSXRyxjLKayd4TbQs2FDRWQU1h9FR7QVNHt+PEaoNL5rQ==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -3972,7 +3686,6 @@ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -3984,7 +3697,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -3997,7 +3709,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -4014,7 +3725,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -4030,7 +3740,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -4042,7 +3751,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", "engines": { "node": ">=8" } @@ -4051,7 +3759,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4067,7 +3774,6 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -4081,7 +3787,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -4093,7 +3798,6 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-3.4.0.tgz", "integrity": "sha512-mbloAWSUO9tLStk9skPjtEzy9C6h9iwL31RIaNDQLkxlHwGcG0xyETLaSCjteQJ5nmZ8OB2mXQN0AJqrgoL6dg==", - "license": "MIT", "dependencies": { "@azure/core-auth": "^1.3.0", "@azure/core-client": "^1.0.0", @@ -4127,14 +3831,12 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -4151,7 +3853,6 @@ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -4172,7 +3873,6 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4182,7 +3882,6 @@ "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -4203,7 +3902,6 @@ "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -4222,7 +3920,6 @@ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -4240,7 +3937,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.5", @@ -4262,20 +3958,17 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -4286,19 +3979,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axios": { + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/azure-function-context-mock": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/azure-function-context-mock/-/azure-function-context-mock-0.0.7.tgz", "integrity": "sha512-tucjk+THQhcjuwcDJyJH/SE4yUmnZ34SOddq15t73KEhjKW6xUP1cyQeqJ0L7F/7eMdNOU3JnRLrRffT+JGnew==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", @@ -4320,7 +4021,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -4337,7 +4037,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -4354,7 +4053,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -4364,7 +4062,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -4380,7 +4077,6 @@ "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -4407,7 +4103,6 @@ "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, - "license": "MIT", "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -4423,8 +4118,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -4443,14 +4137,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/bl": { "version": "6.0.16", "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.16.tgz", "integrity": "sha512-V/kz+z2Mx5/6qDfRCilmrukUXcXuCoXKg3/3hDvzKKoSUx8CJKudfIoT29XZc3UE9xBvxs5qictiHdprwtteEg==", - "license": "MIT", "dependencies": { "@types/readable-stream": "^4.0.0", "buffer": "^6.0.3", @@ -4463,7 +4155,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -4473,7 +4164,6 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, - "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -4500,7 +4190,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "caniuse-lite": "^1.0.30001669", "electron-to-chromium": "^1.5.41", @@ -4519,7 +4208,6 @@ "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, - "license": "MIT", "dependencies": { "fast-json-stable-stringify": "2.x" }, @@ -4532,16 +4220,14 @@ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "node-int64": "^0.4.0" } }, "node_modules/bson": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz", - "integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==", - "license": "Apache-2.0", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.0.tgz", + "integrity": "sha512-ROchNosXMJD2cbQGm84KoP7vOGPO6/bOAW0veMMbzhXLqoZptcaYRVLitwvuhwhjjpU1qP4YZRWLhgETdgqUQw==", "engines": { "node": ">=16.20.1" } @@ -4564,7 +4250,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -4573,22 +4258,19 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "license": "BSD-3-Clause" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -4601,7 +4283,6 @@ "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.0.0" } @@ -4610,7 +4291,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4630,7 +4310,6 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -4640,15 +4319,14 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001686", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz", - "integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==", + "version": "1.0.30001685", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001685.tgz", + "integrity": "sha512-e/kJN1EMyHQzgcMEEgoo+YTCO1NGCmIYHk5Qk8jT6AazWemS5QFKJ5ShCJlH3GZrNIdZofcNCEwZqbMjjKzmnA==", "dev": true, "funding": [ { @@ -4663,15 +4341,13 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4688,7 +4364,6 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } @@ -4704,7 +4379,6 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], - "license": "MIT", "engines": { "node": ">=8" } @@ -4712,14 +4386,12 @@ "node_modules/cjs-module-lexer": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz", - "integrity": "sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==", - "license": "MIT" + "integrity": "sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==" }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -4734,7 +4406,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, - "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -4744,14 +4415,12 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -4762,14 +4431,12 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4782,7 +4449,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } @@ -4791,21 +4457,18 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/cookie": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4815,7 +4478,6 @@ "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -4837,7 +4499,6 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -4851,7 +4512,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -4868,7 +4528,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -4885,7 +4544,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -4902,7 +4560,6 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -4920,7 +4577,6 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, - "license": "MIT", "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -4934,7 +4590,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/deep-copy/-/deep-copy-1.4.2.tgz", "integrity": "sha512-VxZwQ/1+WGQPl5nE67uLhh7OqdrmqI1OazrraO9Bbw/M8Bt6Mol/RxzDA6N6ZgRXpsG/W9PgUj8E1LHHBEq2GQ==", - "license": "MIT", "engines": { "node": ">=4.0.0" } @@ -4943,15 +4598,13 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4960,7 +4613,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4977,7 +4629,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "license": "MIT", "engines": { "node": ">=8" } @@ -4986,7 +4637,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -5003,7 +4653,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -5013,7 +4662,6 @@ "resolved": "https://registry.npmjs.org/dependency-cruiser/-/dependency-cruiser-16.7.0.tgz", "integrity": "sha512-522LLjHINl9r0RIZ8/6s6TqIHTuEJG3XDU2WPSm9dG0rvLUYVyQwE9ID31tDFs4OOyEhdOPaqAaAG1jRv/Zwbg==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", @@ -5055,7 +4703,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-6.0.2.tgz", "integrity": "sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } @@ -5065,7 +4712,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -5078,7 +4724,6 @@ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -5087,7 +4732,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz", "integrity": "sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==", - "license": "MIT", "dependencies": { "semver": "^7.5.3" } @@ -5096,7 +4740,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.8.tgz", "integrity": "sha512-HmSm9hXxSPxA9BaLGY98QU1zsdjeCk113KjAYGPCen1ZP6mhVaTPzHd6UYv5r21DnWANi+f+NyPOHruGT9jpqQ==", - "license": "MIT", "peerDependencies": { "diagnostic-channel": "*" } @@ -5106,7 +4749,6 @@ "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, - "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -5116,7 +4758,6 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, - "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -5129,7 +4770,6 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5141,7 +4781,6 @@ "version": "16.4.7", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -5149,11 +4788,49 @@ "url": "https://dotenvx.com" } }, + "node_modules/durable-functions": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/durable-functions/-/durable-functions-3.1.0.tgz", + "integrity": "sha512-baSkW45/VrVvl1e27qvxEZX2z5vApiINaGUTIxx0c4H5E2Lr22QnogZrebqIhyfspZ466XKhp245nyS0HSkAYg==", + "dependencies": { + "@azure/functions": "^4.0.0", + "axios": "^1.6.1", + "debug": "~2.6.9", + "lodash": "^4.17.15", + "moment": "^2.29.2", + "uuid": "~3.3.2", + "validator": "~13.7.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/durable-functions/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/durable-functions/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/durable-functions/node_modules/uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } @@ -5162,7 +4839,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.1.tgz", "integrity": "sha512-auWyk/k8oSkVHaD4RxkPadKsLUcIwKgr/h8F7UZEueFDBO7BsE4y+H6IMUDbfqKIFPg/9MxV6KcBdJCmVVcxSA==", - "license": "MPL-2.0", "bin": { "eckles": "bin/eckles.js" } @@ -5172,7 +4848,6 @@ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -5184,18 +4859,16 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.68", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz", - "integrity": "sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ==", - "dev": true, - "license": "ISC" + "version": "1.5.67", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.67.tgz", + "integrity": "sha512-nz88NNBsD7kQSAGGJyp8hS6xSPtWwqNogA0mjtc2nUYeEf3nURK9qpV18TuBdDmEDgVWotS8Wkzf+V52dSQ/LQ==", + "dev": true }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -5206,15 +4879,13 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/enhanced-resolve": { "version": "5.17.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -5228,7 +4899,6 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } @@ -5237,7 +4907,6 @@ "version": "1.23.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", @@ -5297,7 +4966,6 @@ "version": "1.0.13", "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.13.tgz", "integrity": "sha512-KkzhUUuD2CUMqEc8JEqsXEMDHzDPE8RCjZeUBitsnB1eNcAJWQPiciKsMXe3Yytj4Flw1XLl46Qcf9OxvZha7A==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "define-properties": "^1.2.1", @@ -5319,7 +4987,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -5331,7 +4998,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -5340,7 +5006,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -5352,7 +5017,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4", "has-tostringtag": "^1.0.2", @@ -5367,7 +5031,6 @@ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, - "license": "MIT", "dependencies": { "hasown": "^2.0.0" } @@ -5376,7 +5039,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", - "license": "MIT", "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", @@ -5393,7 +5055,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", "engines": { "node": ">=6" } @@ -5403,7 +5064,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -5417,7 +5077,6 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5473,7 +5132,6 @@ "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.4" }, @@ -5489,7 +5147,6 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, - "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -5502,7 +5159,6 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -5514,7 +5170,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -5524,7 +5179,6 @@ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^3.2.7" }, @@ -5542,7 +5196,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -5556,7 +5209,6 @@ "https://github.com/sponsors/ota-meshi", "https://opencollective.com/eslint" ], - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.1.2", "@eslint-community/regexpp": "^4.11.0", @@ -5574,7 +5226,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, - "license": "MIT", "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -5608,7 +5259,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5619,7 +5269,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -5629,7 +5278,6 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5642,7 +5290,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5655,7 +5302,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -5665,7 +5311,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz", "integrity": "sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", @@ -5694,7 +5339,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5705,7 +5349,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5718,7 +5361,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", "dev": true, - "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.9.1" @@ -5749,7 +5391,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz", "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", "dev": true, - "license": "ISC", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -5765,7 +5406,6 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -5782,7 +5422,6 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -5795,7 +5434,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5812,7 +5450,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5822,15 +5459,13 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5843,7 +5478,6 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -5861,7 +5495,6 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -5875,7 +5508,6 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -5888,7 +5520,6 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -5901,7 +5532,6 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -5911,7 +5541,6 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -5920,7 +5549,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "license": "MIT", "engines": { "node": ">=6" } @@ -5929,7 +5557,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "license": "MIT", "engines": { "node": ">=0.8.x" } @@ -5939,7 +5566,6 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -5972,7 +5598,6 @@ "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -5988,22 +5613,19 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true, - "license": "Apache-2.0" + "dev": true }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -6020,7 +5642,6 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -6031,29 +5652,25 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "license": "MIT" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/fast-uri": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", - "dev": true, - "license": "BSD-3-Clause" + "dev": true }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, - "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -6063,7 +5680,6 @@ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "bser": "2.1.1" } @@ -6071,15 +5687,13 @@ "node_modules/fecha": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "license": "MIT" + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, - "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" }, @@ -6092,7 +5706,6 @@ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } @@ -6102,7 +5715,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6115,7 +5727,6 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, - "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6128,7 +5739,6 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -6145,7 +5755,6 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, - "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -6159,14 +5768,31 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", - "dev": true, - "license": "ISC" + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } @@ -6175,7 +5801,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -6189,29 +5814,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } + "dev": true }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6220,7 +5828,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -6238,7 +5845,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6248,7 +5854,6 @@ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -6257,7 +5862,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -6266,7 +5870,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -6286,7 +5889,6 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -6296,7 +5898,6 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -6308,7 +5909,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "es-errors": "^1.3.0", @@ -6326,7 +5926,6 @@ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", "dev": true, - "license": "MIT", "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -6340,7 +5939,6 @@ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -6361,7 +5959,6 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -6374,7 +5971,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6385,7 +5981,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6398,7 +5993,6 @@ "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", "dev": true, - "license": "MIT", "dependencies": { "ini": "4.1.1" }, @@ -6414,7 +6008,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -6429,7 +6022,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -6446,7 +6038,6 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, - "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -6466,7 +6057,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.1.0.tgz", "integrity": "sha512-FQoVQnqcdk4hVM4JN1eromaun4iuS34oStkdlLENLdpULsuQcTyXj8w7ayhuUfPwEYZ1ZOooOTT6fdA9Vmx/RA==", - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -6481,21 +6071,18 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6505,7 +6092,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -6514,7 +6100,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -6526,7 +6111,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -6538,10 +6122,9 @@ } }, "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "engines": { "node": ">= 0.4" }, @@ -6553,7 +6136,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -6568,7 +6150,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -6580,14 +6161,12 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/http-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "license": "MIT", "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" @@ -6600,7 +6179,6 @@ "version": "7.0.5", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", - "license": "MIT", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -6614,7 +6192,6 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } @@ -6623,7 +6200,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -6648,15 +6224,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } @@ -6666,7 +6240,6 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -6682,7 +6255,6 @@ "version": "1.11.2", "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.2.tgz", "integrity": "sha512-gK6Rr6EykBcc6cVWRSBR5TWf8nn6hZMYSRYqCcHa0l0d1fPK7JSYo6+Mlmck76jIX9aL/IZ71c06U2VpFwl1zA==", - "license": "Apache-2.0", "dependencies": { "acorn": "^8.8.2", "acorn-import-attributes": "^1.9.5", @@ -6695,7 +6267,6 @@ "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, - "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -6715,7 +6286,6 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -6726,7 +6296,6 @@ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -6735,15 +6304,13 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "dev": true, - "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -6752,7 +6319,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -6767,7 +6333,6 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.13.0" } @@ -6776,7 +6341,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -6792,14 +6356,12 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/is-async-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6811,15 +6373,11 @@ } }, "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "license": "MIT", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" + "has-bigints": "^1.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6829,7 +6387,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.0.tgz", "integrity": "sha512-kR5g0+dXf/+kXnqI+lu0URKYPKgICtHGGNCDSB10AaUFj3o/HkB3u7WfpRBJGFopxxY0oH3ux7ZsDjLtK7xqvw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -6846,7 +6403,6 @@ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, - "license": "MIT", "dependencies": { "builtin-modules": "^3.3.0" }, @@ -6861,7 +6417,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -6873,7 +6428,6 @@ "version": "2.15.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -6888,7 +6442,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", - "license": "MIT", "dependencies": { "is-typed-array": "^1.1.13" }, @@ -6903,7 +6456,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6918,7 +6470,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -6934,7 +6485,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6943,7 +6493,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz", "integrity": "sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -6958,7 +6507,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", "engines": { "node": ">=8" } @@ -6968,7 +6516,6 @@ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -6977,7 +6524,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6993,7 +6539,6 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -7006,7 +6551,6 @@ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-1.0.0.tgz", "integrity": "sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==", "dev": true, - "license": "MIT", "dependencies": { "global-directory": "^4.0.1", "is-path-inside": "^4.0.0" @@ -7023,7 +6567,6 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -7035,7 +6578,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7047,7 +6589,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7060,7 +6601,6 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -7069,7 +6609,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.0.tgz", "integrity": "sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -7086,7 +6625,6 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -7095,7 +6633,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.0.tgz", "integrity": "sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "gopd": "^1.1.0", @@ -7113,7 +6650,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7125,7 +6661,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -7141,7 +6676,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -7153,7 +6687,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.0.tgz", "integrity": "sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -7166,14 +6699,11 @@ } }, "node_modules/is-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.0.tgz", - "integrity": "sha512-qS8KkNNXUZ/I+nX6QT8ZS1/Yx0A444yhzdTKxCzKkNjQ9sHErBxJnJAgh+f5YhusYECEcjo4XcyH87hn6+ks0A==", - "license": "MIT", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dependencies": { - "call-bind": "^1.0.7", - "has-symbols": "^1.0.3", - "safe-regex-test": "^1.0.3" + "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -7186,7 +6716,6 @@ "version": "1.1.13", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", - "license": "MIT", "dependencies": { "which-typed-array": "^1.1.14" }, @@ -7201,7 +6730,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7213,7 +6741,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -7225,7 +6752,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4" @@ -7241,7 +6767,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "license": "MIT", "dependencies": { "is-docker": "^2.0.0" }, @@ -7252,22 +6777,19 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=8" } @@ -7277,7 +6799,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", @@ -7294,7 +6815,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -7309,7 +6829,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -7324,7 +6843,6 @@ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -7338,7 +6856,6 @@ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -7357,7 +6874,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7368,7 +6884,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -7381,7 +6896,6 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -7408,7 +6922,6 @@ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, - "license": "MIT", "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", @@ -7423,7 +6936,6 @@ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -7455,7 +6967,6 @@ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", @@ -7489,7 +7000,6 @@ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", @@ -7535,7 +7045,6 @@ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -7551,7 +7060,6 @@ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, - "license": "MIT", "dependencies": { "detect-newline": "^3.0.0" }, @@ -7564,7 +7072,6 @@ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -7581,7 +7088,6 @@ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -7599,7 +7105,6 @@ "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, - "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -7609,7 +7114,6 @@ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -7635,7 +7139,6 @@ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, - "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" @@ -7649,7 +7152,6 @@ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -7665,7 +7167,6 @@ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -7686,7 +7187,6 @@ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -7701,7 +7201,6 @@ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -7719,7 +7218,6 @@ "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, - "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -7729,7 +7227,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", @@ -7750,7 +7247,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, - "license": "MIT", "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" @@ -7764,7 +7260,6 @@ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", @@ -7797,7 +7292,6 @@ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -7831,7 +7325,6 @@ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", @@ -7863,7 +7356,6 @@ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -7881,7 +7373,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -7894,7 +7385,6 @@ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -7912,7 +7402,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -7925,7 +7414,6 @@ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", @@ -7945,7 +7433,6 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -7961,7 +7448,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -7976,7 +7462,6 @@ "version": "4.15.9", "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" } @@ -7984,21 +7469,18 @@ "node_modules/js-md4": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz", - "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==", - "license": "MIT" + "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==" }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -8009,15 +7491,13 @@ "node_modules/jsbi": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.0.tgz", - "integrity": "sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==", - "license": "Apache-2.0" + "integrity": "sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==" }, "node_modules/jsesc": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, - "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -8029,36 +7509,31 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -8070,7 +7545,6 @@ "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "license": "MIT", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -8092,7 +7566,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -8103,7 +7576,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -8113,7 +7585,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -8124,7 +7595,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", - "license": "MIT", "dependencies": { "@types/express": "^4.17.17", "@types/jsonwebtoken": "^9.0.2", @@ -8141,7 +7611,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "license": "MIT", "dependencies": { "jwa": "^2.0.0", "safe-buffer": "^5.0.1" @@ -8152,7 +7621,6 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, - "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -8162,7 +7630,6 @@ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -8171,7 +7638,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/launchdarkly-eventsource/-/launchdarkly-eventsource-2.0.3.tgz", "integrity": "sha512-VhFjppK7jXlcEKaS7bxdoibB5j01NKyeDR7a8XfssdDGNWCTsbF0/5IExSmPi44eDncPhkoPNxlSZhEZvrbD5w==", - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -8181,7 +7647,6 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -8191,7 +7656,6 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -8209,15 +7673,13 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -8231,82 +7693,69 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT" + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "license": "MIT" + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", - "license": "MIT" + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", - "license": "MIT" + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" }, "node_modules/lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", - "license": "MIT" + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" }, "node_modules/lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", - "license": "MIT" + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "license": "MIT" + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "license": "MIT" + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "license": "MIT" + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" }, "node_modules/logform": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "license": "MIT", "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -8322,15 +7771,13 @@ "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "license": "Apache-2.0" + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -8339,7 +7786,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", - "license": "MIT", "dependencies": { "lodash.clonedeep": "^4.5.0", "lru-cache": "6.0.0" @@ -8349,7 +7795,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -8360,15 +7805,13 @@ "node_modules/lru-memoizer/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -8383,15 +7826,13 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "tmpl": "1.0.5" } @@ -8401,7 +7842,6 @@ "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.0.0.tgz", "integrity": "sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==", "dev": true, - "license": "MIT", "dependencies": { "mimic-function": "^5.0.0" }, @@ -8415,22 +7855,19 @@ "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "license": "MIT" + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } @@ -8440,7 +7877,6 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, - "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -8454,7 +7890,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -8466,7 +7901,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8475,7 +7909,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -8488,7 +7921,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -8498,7 +7930,6 @@ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" }, @@ -8511,7 +7942,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -8527,7 +7957,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8535,14 +7964,20 @@ "node_modules/module-details-from-path": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "license": "MIT" + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==" + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "engines": { + "node": "*" + } }, "node_modules/mongodb": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.11.0.tgz", "integrity": "sha512-yVbPw0qT268YKhG241vAMLaDQAPbRyTgo++odSgGc9kXnzOujQI60Iyj23B9sQQFPSvmNPvMZ3dsFz0aN55KgA==", - "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.9", "bson": "^6.10.0", @@ -8588,7 +8023,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", - "license": "Apache-2.0", "dependencies": { "@types/whatwg-url": "^11.0.2", "whatwg-url": "^13.0.0" @@ -8597,14 +8031,12 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mssql": { "version": "10.0.4", "resolved": "https://registry.npmjs.org/mssql/-/mssql-10.0.4.tgz", "integrity": "sha512-MhX5IcJ75/q+dUiOe+1ajpqjEe96ZKqMchYYPUIDU+Btqhwt4gbFeZhcGUZaRCEMV9uF+G8kLvaNSFaEzL9OXQ==", - "license": "MIT", "dependencies": { "@tediousjs/connection-string": "^0.5.0", "commander": "^11.0.0", @@ -8624,7 +8056,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "license": "MIT", "engines": { "node": ">=16" } @@ -8632,21 +8063,18 @@ "node_modules/native-duplexpair": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/native-duplexpair/-/native-duplexpair-1.0.0.tgz", - "integrity": "sha512-E7QQoM+3jvNtlmyfqRZ0/U75VFgCls+fSkbml2MpgWkWyz3ox8Y58gNhfuziuQYGNNQAbFZJQck55LHCnCK6CA==", - "license": "MIT" + "integrity": "sha512-E7QQoM+3jvNtlmyfqRZ0/U75VFgCls+fSkbml2MpgWkWyz3ox8Y58gNhfuziuQYGNNQAbFZJQck55LHCnCK6CA==" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/njwt": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/njwt/-/njwt-2.0.1.tgz", "integrity": "sha512-HwFeZsPJ1aOhIjMjqT9Qv7BOsQbkxjRVPPSdFXNOTEkfKpr9+O6OX+dSN6TxxIErSYSqrmlDR4H2zOGOpEbZLA==", - "license": "Apache-2.0", "dependencies": { "@types/node": "^15.0.1", "ecdsa-sig-formatter": "^1.0.5", @@ -8659,20 +8087,17 @@ "node_modules/njwt/node_modules/@types/node": { "version": "15.14.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-15.14.9.tgz", - "integrity": "sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==", - "license": "MIT" + "integrity": "sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==" }, "node_modules/node-abort-controller": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", - "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", - "license": "MIT" + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -8691,20 +8116,17 @@ "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -8714,22 +8136,19 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/node-releases": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8739,7 +8158,6 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -8751,7 +8169,6 @@ "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8763,7 +8180,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -8772,7 +8188,6 @@ "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -8791,7 +8206,6 @@ "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -8810,7 +8224,6 @@ "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -8825,7 +8238,6 @@ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -8843,7 +8255,6 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } @@ -8853,7 +8264,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -8868,7 +8278,6 @@ "version": "8.4.2", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "license": "MIT", "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -8886,7 +8295,6 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, - "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -8904,7 +8312,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -8920,7 +8327,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -8936,7 +8342,6 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -8946,7 +8351,6 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -8959,7 +8363,6 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -8977,7 +8380,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-2.0.0.tgz", "integrity": "sha512-xjU87V0VyHZybn2RrCX5TIFGxTVZE6zqqZWMPlIKiSKuWh/X5WZdt+w1Ki1nXB+8L/KtL+nZ4iq+sfI6MrhhMw==", - "license": "MIT", "dependencies": { "xtend": "~4.0.1" } @@ -8987,7 +8389,6 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -8997,7 +8398,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9007,7 +8407,6 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9015,15 +8414,13 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "license": "MIT" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9032,7 +8429,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "license": "ISC", "engines": { "node": ">=4.0.0" } @@ -9040,14 +8436,12 @@ "node_modules/pg-protocol": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz", - "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==", - "license": "MIT" + "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==" }, "node_modules/pg-types": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "license": "MIT", "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", @@ -9063,15 +8457,13 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picomatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -9084,7 +8476,6 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 6" } @@ -9094,7 +8485,6 @@ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -9107,7 +8497,6 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -9121,7 +8510,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -9134,7 +8522,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -9150,7 +8537,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -9162,7 +8548,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -9171,7 +8556,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "license": "MIT", "engines": { "node": ">=4" } @@ -9180,7 +8564,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9189,7 +8572,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9198,7 +8580,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -9211,7 +8592,6 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -9221,7 +8601,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -9237,7 +8616,6 @@ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, - "license": "MIT", "dependencies": { "fast-diff": "^1.1.2" }, @@ -9250,7 +8628,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -9265,7 +8642,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -9276,14 +8652,12 @@ "node_modules/priorityqueuejs": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-2.0.0.tgz", - "integrity": "sha512-19BMarhgpq3x4ccvVi8k2QpJZcymo/iFUcrhPd4V96kYGovOdTsWwy7fxChYi4QY+m2EnGBWSX9Buakz+tWNQQ==", - "license": "MIT" + "integrity": "sha512-19BMarhgpq3x4ccvVi8k2QpJZcymo/iFUcrhPd4V96kYGovOdTsWwy7fxChYi4QY+m2EnGBWSX9Buakz+tWNQQ==" }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "license": "MIT", "engines": { "node": ">= 0.6.0" } @@ -9293,7 +8667,6 @@ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, - "license": "MIT", "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -9307,7 +8680,6 @@ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -9329,14 +8701,17 @@ "node_modules/protobufjs/node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "license": "Apache-2.0" + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "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/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", "engines": { "node": ">=6" } @@ -9355,14 +8730,12 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ], - "license": "MIT" + ] }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "license": "MIT" + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -9382,14 +8755,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/rasha": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.5.tgz", "integrity": "sha512-KxtX+/fBk+wM7O3CNgwjSh5elwFilLvqWajhr6wFr2Hd63JnKTTi43Tw+Jb1hxJQWOwoya+NZWR2xztn3hCrTw==", - "license": "MPL-2.0", "bin": { "rasha": "bin/rasha.js" } @@ -9398,14 +8769,12 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/readable-stream": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -9422,7 +8791,6 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dev": true, - "license": "MIT", "dependencies": { "resolve": "^1.20.0" }, @@ -9434,7 +8802,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz", "integrity": "sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9456,7 +8823,6 @@ "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, - "license": "MIT", "bin": { "regexp-tree": "bin/regexp-tree" } @@ -9465,7 +8831,6 @@ "version": "1.5.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9483,7 +8848,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9493,7 +8857,6 @@ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9502,7 +8865,6 @@ "version": "7.4.0", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.4.0.tgz", "integrity": "sha512-X34iHADNbNDfr6OTStIAHWSAvvKQRYgLO6duASaVf7J2VA3lvmNYboAHOuLC2huav1IwgZJtyEcJCKVzFxOSMQ==", - "license": "MIT", "dependencies": { "debug": "^4.3.5", "module-details-from-path": "^1.0.3", @@ -9515,14 +8877,12 @@ "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "license": "MIT" + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -9540,7 +8900,6 @@ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, - "license": "MIT", "dependencies": { "resolve-from": "^5.0.0" }, @@ -9553,7 +8912,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9563,7 +8921,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -9573,17 +8930,15 @@ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } @@ -9593,7 +8948,6 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, - "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -9602,8 +8956,7 @@ "node_modules/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", - "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "license": "MIT" + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" }, "node_modules/rimraf": { "version": "3.0.2", @@ -9611,7 +8964,6 @@ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, - "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -9641,7 +8993,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -9650,7 +9001,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4", @@ -9681,21 +9031,18 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/safe-flat": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/safe-flat/-/safe-flat-2.1.0.tgz", - "integrity": "sha512-qr5iVWMYuN21dkijya23k6apc2BV1hiCG75vjToKDTzWlbR4SLbLbCnowPJ2pngnwGT2nMEeZKOglBE4pksj6g==", - "license": "MIT" + "integrity": "sha512-qr5iVWMYuN21dkijya23k6apc2BV1hiCG75vjToKDTzWlbR4SLbLbCnowPJ2pngnwGT2nMEeZKOglBE4pksj6g==" }, "node_modules/safe-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", "dev": true, - "license": "MIT", "dependencies": { "regexp-tree": "~0.1.1" } @@ -9704,7 +9051,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -9721,7 +9067,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", - "license": "MIT", "engines": { "node": ">=10" } @@ -9729,8 +9074,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semaphore": { "version": "1.1.0", @@ -9744,7 +9088,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -9759,7 +9102,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -9770,14 +9112,12 @@ "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -9794,7 +9134,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -9810,7 +9149,6 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -9823,7 +9161,6 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9831,14 +9168,12 @@ "node_modules/shimmer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "license": "BSD-2-Clause" + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -9856,22 +9191,19 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9881,7 +9213,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -9891,7 +9222,6 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -9901,7 +9231,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "license": "MIT", "dependencies": { "memory-pager": "^1.0.2" } @@ -9909,15 +9238,13 @@ "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "license": "BSD-3-Clause" + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -9930,7 +9257,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -9939,7 +9265,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", - "license": "MIT", "engines": { "node": ">=4", "npm": ">=6" @@ -9949,7 +9274,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } @@ -9959,7 +9283,6 @@ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, - "license": "MIT", "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -9972,7 +9295,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -9986,7 +9308,6 @@ "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -10004,7 +9325,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -10018,7 +9338,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -10035,7 +9354,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -10048,7 +9366,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -10058,7 +9375,6 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -10068,7 +9384,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -10081,7 +9396,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -10093,7 +9407,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10106,7 +9419,6 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", "dev": true, - "license": "MIT", "dependencies": { "@pkgr/core": "^0.1.0", "tslib": "^2.6.2" @@ -10123,7 +9435,6 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -10132,7 +9443,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz", "integrity": "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==", - "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -10141,14 +9451,12 @@ "version": "0.1.14", "resolved": "https://registry.npmjs.org/teamcity-service-messages/-/teamcity-service-messages-0.1.14.tgz", "integrity": "sha512-29aQwaHqm8RMX74u2o/h1KbMLP89FjNiMxD9wbF2BbWOnbM+q+d1sCEC+MqCc4QW3NJykn77OMpTFw/xTHIc0w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/tedious": { "version": "16.7.1", "resolved": "https://registry.npmjs.org/tedious/-/tedious-16.7.1.tgz", "integrity": "sha512-NmedZS0NJiTv3CoYnf1FtjxIDUgVYzEmavrc8q2WHRb+lP4deI9BpQfmNnBZZaWusDbP5FVFZCcvzb3xOlNVlQ==", - "license": "MIT", "dependencies": { "@azure/identity": "^3.4.1", "@azure/keyvault-keys": "^4.4.0", @@ -10171,7 +9479,6 @@ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, - "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -10186,7 +9493,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -10197,7 +9503,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10209,22 +9514,19 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true, - "license": "BSD-3-Clause" + "dev": true }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -10236,7 +9538,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "license": "MIT", "dependencies": { "punycode": "^2.3.0" }, @@ -10248,7 +9549,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "license": "MIT", "engines": { "node": ">= 14.0.0" } @@ -10258,7 +9558,6 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" }, @@ -10271,7 +9570,6 @@ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dev": true, - "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "ejs": "^3.1.10", @@ -10320,7 +9618,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -10333,7 +9630,6 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, - "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -10346,7 +9642,6 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.2.0.tgz", "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.0", "enhanced-resolve": "^5.7.0", @@ -10362,7 +9657,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -10372,7 +9666,6 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", "dev": true, - "license": "MIT", "dependencies": { "json5": "^2.2.2", "minimist": "^1.2.6", @@ -10387,7 +9680,6 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -10400,7 +9692,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -10408,15 +9699,13 @@ "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, - "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -10429,7 +9718,6 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -10439,7 +9727,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -10451,7 +9738,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -10465,7 +9751,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -10484,7 +9769,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz", "integrity": "sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==", - "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -10505,7 +9789,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -10526,7 +9809,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -10539,7 +9821,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -10554,7 +9835,6 @@ "version": "5.28.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "license": "MIT", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -10565,8 +9845,7 @@ "node_modules/undici-types": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, "node_modules/update-browserslist-db": { "version": "1.1.1", @@ -10587,7 +9866,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.0" @@ -10604,7 +9882,6 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -10613,7 +9890,6 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -10622,14 +9898,12 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -10639,7 +9913,6 @@ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, - "license": "ISC", "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -10649,22 +9922,28 @@ "node": ">=10.12.0" } }, + "node_modules/validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "makeerror": "1.0.12" } }, "node_modules/watskeburt": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/watskeburt/-/watskeburt-4.2.2.tgz", - "integrity": "sha512-AOCg1UYxWpiHW1tUwqpJau8vzarZYTtzl2uu99UptBmbzx6kOzCGMfRLF6KIRX4PYekmryn89MzxlRNkL66YyA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/watskeburt/-/watskeburt-4.1.1.tgz", + "integrity": "sha512-6eghVVn6VlfYnlg23I2wABhXQFNdVdDzbXRTj0PKnDAgYJMuBcDt4fiHNAFMoBzLqM/fjFYj9QxTDfFskB3+Xg==", "dev": true, - "license": "MIT", "bin": { "watskeburt": "dist/run-cli.js" }, @@ -10676,7 +9955,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "license": "BSD-2-Clause", "engines": { "node": ">=12" } @@ -10685,7 +9963,6 @@ "version": "13.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", - "license": "MIT", "dependencies": { "tr46": "^4.1.1", "webidl-conversions": "^7.0.0" @@ -10699,7 +9976,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -10711,19 +9987,15 @@ } }, "node_modules/which-boxed-primitive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz", - "integrity": "sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng==", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.0", - "is-number-object": "^1.1.0", - "is-string": "^1.1.0", - "is-symbol": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10733,7 +10005,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.0.tgz", "integrity": "sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "function.prototype.name": "^1.1.6", @@ -10760,7 +10031,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "license": "MIT", "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -10778,7 +10048,6 @@ "version": "1.1.16", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.16.tgz", "integrity": "sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ==", - "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -10797,7 +10066,6 @@ "version": "4.9.0", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "license": "MIT", "dependencies": { "logform": "^2.7.0", "readable-stream": "^3.6.2", @@ -10811,7 +10079,6 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -10826,7 +10093,6 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -10835,7 +10101,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -10852,15 +10117,13 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -10873,7 +10136,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "license": "MIT", "engines": { "node": ">=0.4" } @@ -10882,7 +10144,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "license": "ISC", "engines": { "node": ">=10" } @@ -10891,14 +10152,12 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -10916,7 +10175,6 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "license": "ISC", "engines": { "node": ">=12" } @@ -10926,7 +10184,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, diff --git a/backend/functions/package.json b/backend/functions/package.json index 181e8dfd3..ec0ebc375 100644 --- a/backend/functions/package.json +++ b/backend/functions/package.json @@ -31,6 +31,7 @@ "@okta/okta-sdk-nodejs": "^7.1.1", "applicationinsights": "^3.4.0", "dotenv": "^16.4.7", + "durable-functions": "^3.1.0", "jsonwebtoken": "^9.0.2", "mongodb": "^6.11.0", "mssql": "^10.0.4" diff --git a/backend/functions/poc/dfClient.function.ts b/backend/functions/poc/dfClient.function.ts new file mode 100644 index 000000000..fa610d718 --- /dev/null +++ b/backend/functions/poc/dfClient.function.ts @@ -0,0 +1,23 @@ +import * as df from 'durable-functions'; +import { app, HttpRequest, HttpResponse, InvocationContext } from '@azure/functions'; + +export default async function httpStart( + request: HttpRequest, + context: InvocationContext, +): Promise { + const client = df.getClient(context); + const body: unknown = await request.json(); + const instanceId: string = await client.startNew('orchestrator', { + input: body, + }); + + context.log(`Started orchestration with ID = '${instanceId}'.`); + + return client.createCheckStatusResponse(request, instanceId); +} + +app.http('dfClient', { + route: 'orchestrators/orchestrator', + extraInputs: [df.input.durableClient()], + handler: httpStart, +}); diff --git a/backend/functions/poc/getConsolidations.ts b/backend/functions/poc/getConsolidations.ts new file mode 100644 index 000000000..ef60d13e9 --- /dev/null +++ b/backend/functions/poc/getConsolidations.ts @@ -0,0 +1,13 @@ +import * as df from 'durable-functions'; +import { InvocationContext } from '@azure/functions'; +import { PredicateAndPage } from './model'; + +export default async function handler(input: PredicateAndPage, context: InvocationContext) { + // Do some stuff + context.log('GetConsolidations', JSON.stringify(input)); +} + +df.app.activity('getConsolidationsFromACMS', { + // extraOutputs: [blobOutput], + handler, +}); diff --git a/backend/functions/poc/getPageCount.ts b/backend/functions/poc/getPageCount.ts new file mode 100644 index 000000000..7c695dcdb --- /dev/null +++ b/backend/functions/poc/getPageCount.ts @@ -0,0 +1,13 @@ +import * as df from 'durable-functions'; +import { InvocationContext } from '@azure/functions'; +import { PredicateAndPage } from './model'; + +export default async function handler(input: PredicateAndPage, context: InvocationContext) { + // Do some stuff + context.log('GetPageCount', JSON.stringify(input)); + return 4; +} + +df.app.activity('getPageCountFromACMS', { + handler, +}); diff --git a/backend/functions/poc/model.ts b/backend/functions/poc/model.ts new file mode 100644 index 000000000..7e84fd0d5 --- /dev/null +++ b/backend/functions/poc/model.ts @@ -0,0 +1,15 @@ +export type Bounds = { + divisionCodes: string[]; + chapters: string[]; + dateRange: [string, string]; +}; + +export type Predicate = { + divisionCode: string; + chapter: string; + dateRange: [string, string]; +}; + +export type PredicateAndPage = Predicate & { + pageNumber: number; +}; diff --git a/backend/functions/poc/orchestrator.ts b/backend/functions/poc/orchestrator.ts new file mode 100644 index 000000000..707f525e1 --- /dev/null +++ b/backend/functions/poc/orchestrator.ts @@ -0,0 +1,27 @@ +import { Bounds } from './model'; + +import * as df from 'durable-functions'; + +df.app.orchestration('orchestrator', function* (context) { + const bounds: Bounds = context.df.getInput(); + + context.log('orchestrator', JSON.stringify(bounds)); + + const provisioningTasks = []; + + const { divisionCodes, chapters, dateRange } = bounds; + for (const divisionCode of divisionCodes) { + for (const chapter of chapters) { + const predicate = { + divisionCode, + chapter, + dateRange, + }; + const child_id = context.df.instanceId + `:${divisionCode}:${chapter}:`; + provisioningTasks.push( + context.df.callSubOrchestrator('subOrchestrator', predicate, child_id), + ); + } + } + yield context.df.Task.all(provisioningTasks); +}); diff --git a/backend/functions/poc/sub-orchestrator-etl.ts b/backend/functions/poc/sub-orchestrator-etl.ts new file mode 100644 index 000000000..001118126 --- /dev/null +++ b/backend/functions/poc/sub-orchestrator-etl.ts @@ -0,0 +1,25 @@ +import { PredicateAndPage } from './model'; + +import * as df from 'durable-functions'; + +df.app.orchestration('subOrchestratorETL', function* (context) { + const predicateAndPage: PredicateAndPage = context.df.getInput(); + + context.log('subOrchestratorETL', JSON.stringify(predicateAndPage)); + + const consolidatedOrdersPage = yield context.df.callActivity( + 'getConsolidationsFromACMS', + predicateAndPage, + ); + + const parallelTasks = []; + for (let i = 0; i < consolidatedOrdersPage.length; i++) { + parallelTasks.push(context.df.callActivity('transformAndLoad', consolidatedOrdersPage[i])); + } + + yield context.df.Task.all(parallelTasks); + + // DO we need to fan in?? + // const sum = parallelTasks.reduce((prev, curr) => prev + curr, 0); + // yield context.df.callActivity('finalResults??', sum); +}); diff --git a/backend/functions/poc/sub-orchestrator-paging.ts b/backend/functions/poc/sub-orchestrator-paging.ts new file mode 100644 index 000000000..4df64f373 --- /dev/null +++ b/backend/functions/poc/sub-orchestrator-paging.ts @@ -0,0 +1,25 @@ +import { Predicate, PredicateAndPage } from './model'; + +import * as df from 'durable-functions'; + +df.app.orchestration('subOrchestratorPaging', function* (context) { + const predicate: Predicate = context.df.getInput(); + + context.log('subOrchestratorPaging', JSON.stringify(predicate)); + + const pageCount = yield context.df.callActivity('getPageCountFromACMS', predicate); + + const provisioningTasks = []; + for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { + const predicateAndPage: PredicateAndPage = { + ...predicate, + pageNumber, + }; + const child_id = context.df.instanceId + `:${pageNumber}`; + provisioningTasks.push( + context.df.callSubOrchestrator('subOrchestrator', predicateAndPage, child_id), + ); + } + + yield context.df.Task.all(provisioningTasks); +}); From 1098d86928435567054f4ba281d35ad32e4984f2 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:39:36 -0600 Subject: [PATCH 002/112] Finish durable function proof of concept The POC runs locally, logging the expected output through multiple orchestrators and activities. Jira ticket: CAMS-461 --- backend/functions/poc/getConsolidations.ts | 4 ++++ backend/functions/poc/getPageCount.ts | 2 +- backend/functions/poc/model.ts | 5 +++++ backend/functions/poc/orchestrator.ts | 2 +- backend/functions/poc/sub-orchestrator-etl.ts | 7 ++++++- .../functions/poc/sub-orchestrator-paging.ts | 7 ++++--- backend/functions/poc/transformAndLoad.ts | 18 ++++++++++++++++++ 7 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 backend/functions/poc/transformAndLoad.ts diff --git a/backend/functions/poc/getConsolidations.ts b/backend/functions/poc/getConsolidations.ts index ef60d13e9..dacdf5299 100644 --- a/backend/functions/poc/getConsolidations.ts +++ b/backend/functions/poc/getConsolidations.ts @@ -5,6 +5,10 @@ import { PredicateAndPage } from './model'; export default async function handler(input: PredicateAndPage, context: InvocationContext) { // Do some stuff context.log('GetConsolidations', JSON.stringify(input)); + return [ + { orderId: '53rs2', caseId: '071-23-012345' }, + { orderId: '426gh', caseId: '071-23-43215' }, + ]; } df.app.activity('getConsolidationsFromACMS', { diff --git a/backend/functions/poc/getPageCount.ts b/backend/functions/poc/getPageCount.ts index 7c695dcdb..81290c804 100644 --- a/backend/functions/poc/getPageCount.ts +++ b/backend/functions/poc/getPageCount.ts @@ -4,7 +4,7 @@ import { PredicateAndPage } from './model'; export default async function handler(input: PredicateAndPage, context: InvocationContext) { // Do some stuff - context.log('GetPageCount', JSON.stringify(input)); + context.log('#################GetPageCount', JSON.stringify(input)); return 4; } diff --git a/backend/functions/poc/model.ts b/backend/functions/poc/model.ts index 7e84fd0d5..f82079f14 100644 --- a/backend/functions/poc/model.ts +++ b/backend/functions/poc/model.ts @@ -13,3 +13,8 @@ export type Predicate = { export type PredicateAndPage = Predicate & { pageNumber: number; }; + +export type AcmsConsolidation = { + orderId: string; + caseId: string; +}; diff --git a/backend/functions/poc/orchestrator.ts b/backend/functions/poc/orchestrator.ts index 707f525e1..2dec06418 100644 --- a/backend/functions/poc/orchestrator.ts +++ b/backend/functions/poc/orchestrator.ts @@ -19,7 +19,7 @@ df.app.orchestration('orchestrator', function* (context) { }; const child_id = context.df.instanceId + `:${divisionCode}:${chapter}:`; provisioningTasks.push( - context.df.callSubOrchestrator('subOrchestrator', predicate, child_id), + context.df.callSubOrchestrator('subOrchestratorPaging', predicate, child_id), ); } } diff --git a/backend/functions/poc/sub-orchestrator-etl.ts b/backend/functions/poc/sub-orchestrator-etl.ts index 001118126..66f539df7 100644 --- a/backend/functions/poc/sub-orchestrator-etl.ts +++ b/backend/functions/poc/sub-orchestrator-etl.ts @@ -5,13 +5,18 @@ import * as df from 'durable-functions'; df.app.orchestration('subOrchestratorETL', function* (context) { const predicateAndPage: PredicateAndPage = context.df.getInput(); - context.log('subOrchestratorETL', JSON.stringify(predicateAndPage)); + context.log( + '#################subOrchestratorETL:', + context.df.instanceId, + JSON.stringify(predicateAndPage), + ); const consolidatedOrdersPage = yield context.df.callActivity( 'getConsolidationsFromACMS', predicateAndPage, ); + context.log('#################length', consolidatedOrdersPage.length); const parallelTasks = []; for (let i = 0; i < consolidatedOrdersPage.length; i++) { parallelTasks.push(context.df.callActivity('transformAndLoad', consolidatedOrdersPage[i])); diff --git a/backend/functions/poc/sub-orchestrator-paging.ts b/backend/functions/poc/sub-orchestrator-paging.ts index 4df64f373..3ed9f2773 100644 --- a/backend/functions/poc/sub-orchestrator-paging.ts +++ b/backend/functions/poc/sub-orchestrator-paging.ts @@ -5,10 +5,10 @@ import * as df from 'durable-functions'; df.app.orchestration('subOrchestratorPaging', function* (context) { const predicate: Predicate = context.df.getInput(); - context.log('subOrchestratorPaging', JSON.stringify(predicate)); + context.log('#################subOrchestratorPaging', JSON.stringify(predicate)); const pageCount = yield context.df.callActivity('getPageCountFromACMS', predicate); - + context.log('#################pageCount', pageCount); const provisioningTasks = []; for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { const predicateAndPage: PredicateAndPage = { @@ -17,9 +17,10 @@ df.app.orchestration('subOrchestratorPaging', function* (context) { }; const child_id = context.df.instanceId + `:${pageNumber}`; provisioningTasks.push( - context.df.callSubOrchestrator('subOrchestrator', predicateAndPage, child_id), + context.df.callSubOrchestrator('subOrchestratorETL', predicateAndPage, child_id), ); } + context.log('#################results', JSON.stringify(provisioningTasks)); yield context.df.Task.all(provisioningTasks); }); diff --git a/backend/functions/poc/transformAndLoad.ts b/backend/functions/poc/transformAndLoad.ts new file mode 100644 index 000000000..0fbd02822 --- /dev/null +++ b/backend/functions/poc/transformAndLoad.ts @@ -0,0 +1,18 @@ +import * as df from 'durable-functions'; +import { InvocationContext } from '@azure/functions'; +import { AcmsConsolidation } from './model'; +import { randomUUID } from 'crypto'; + +export default async function handler(input: AcmsConsolidation, context: InvocationContext) { + // Do some stuff + context.log('#################Transform and load', JSON.stringify(input)); + const newOrder = { + ...input, + camsId: randomUUID(), + }; + context.log(`Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`); +} + +df.app.activity('transformAndLoad', { + handler, +}); From 3073d0c10a6defe1fb991ff8baba91a698351fd0 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Fri, 15 Nov 2024 16:08:00 -0700 Subject: [PATCH 003/112] Initial Refactor of POC Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../poc/activity/getConsolidations.ts | 15 ++++++++++ .../functions/poc/activity/getPageCount.ts | 12 ++++++++ .../poc/{ => activity}/transformAndLoad.ts | 11 ++++--- .../poc/{ => client}/dfClient.function.ts | 11 ++----- backend/functions/poc/getConsolidations.ts | 17 ----------- backend/functions/poc/getPageCount.ts | 13 -------- backend/functions/poc/loadConsolidations.ts | 30 +++++++++++++++++++ backend/functions/poc/model.ts | 1 + .../poc/{ => orchestration}/orchestrator.ts | 15 +++++----- .../poc/orchestration/sub-orchestrator-etl.ts | 23 ++++++++++++++ .../orchestration/sub-orchestrator-paging.ts | 22 ++++++++++++++ backend/functions/poc/sub-orchestrator-etl.ts | 30 ------------------- .../functions/poc/sub-orchestrator-paging.ts | 26 ---------------- 13 files changed, 118 insertions(+), 108 deletions(-) create mode 100644 backend/functions/poc/activity/getConsolidations.ts create mode 100644 backend/functions/poc/activity/getPageCount.ts rename backend/functions/poc/{ => activity}/transformAndLoad.ts (60%) rename backend/functions/poc/{ => client}/dfClient.function.ts (58%) delete mode 100644 backend/functions/poc/getConsolidations.ts delete mode 100644 backend/functions/poc/getPageCount.ts create mode 100644 backend/functions/poc/loadConsolidations.ts rename backend/functions/poc/{ => orchestration}/orchestrator.ts (61%) create mode 100644 backend/functions/poc/orchestration/sub-orchestrator-etl.ts create mode 100644 backend/functions/poc/orchestration/sub-orchestrator-paging.ts delete mode 100644 backend/functions/poc/sub-orchestrator-etl.ts delete mode 100644 backend/functions/poc/sub-orchestrator-paging.ts diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/poc/activity/getConsolidations.ts new file mode 100644 index 000000000..80404d37a --- /dev/null +++ b/backend/functions/poc/activity/getConsolidations.ts @@ -0,0 +1,15 @@ +import { InvocationContext } from '@azure/functions'; +import { PredicateAndPage } from '../model'; + +async function getConsolidations(input: PredicateAndPage, context: InvocationContext) { + // Do some stuff + context.log('GetConsolidations', JSON.stringify(input)); + return [ + { orderId: '53rs2', caseId: '071-23-012345' }, + { orderId: '426gh', caseId: '071-23-43215' }, + ]; +} + +export default { + handler: getConsolidations, +}; diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts new file mode 100644 index 000000000..0a2f45a02 --- /dev/null +++ b/backend/functions/poc/activity/getPageCount.ts @@ -0,0 +1,12 @@ +import { InvocationContext } from '@azure/functions'; +import { PredicateAndPage } from '../model'; + +async function getPageCount(input: PredicateAndPage, context: InvocationContext) { + // Do some stuff + context.log('#################GetPageCount', JSON.stringify(input)); + return 4; +} + +export default { + handler: getPageCount, +}; diff --git a/backend/functions/poc/transformAndLoad.ts b/backend/functions/poc/activity/transformAndLoad.ts similarity index 60% rename from backend/functions/poc/transformAndLoad.ts rename to backend/functions/poc/activity/transformAndLoad.ts index 0fbd02822..fedaf52b7 100644 --- a/backend/functions/poc/transformAndLoad.ts +++ b/backend/functions/poc/activity/transformAndLoad.ts @@ -1,9 +1,8 @@ -import * as df from 'durable-functions'; import { InvocationContext } from '@azure/functions'; -import { AcmsConsolidation } from './model'; +import { AcmsConsolidation } from '../model'; import { randomUUID } from 'crypto'; -export default async function handler(input: AcmsConsolidation, context: InvocationContext) { +async function transformAndLoad(input: AcmsConsolidation, context: InvocationContext) { // Do some stuff context.log('#################Transform and load', JSON.stringify(input)); const newOrder = { @@ -13,6 +12,6 @@ export default async function handler(input: AcmsConsolidation, context: Invocat context.log(`Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`); } -df.app.activity('transformAndLoad', { - handler, -}); +export default { + handler: transformAndLoad, +}; diff --git a/backend/functions/poc/dfClient.function.ts b/backend/functions/poc/client/dfClient.function.ts similarity index 58% rename from backend/functions/poc/dfClient.function.ts rename to backend/functions/poc/client/dfClient.function.ts index fa610d718..4bd2e8d0d 100644 --- a/backend/functions/poc/dfClient.function.ts +++ b/backend/functions/poc/client/dfClient.function.ts @@ -1,5 +1,6 @@ import * as df from 'durable-functions'; -import { app, HttpRequest, HttpResponse, InvocationContext } from '@azure/functions'; +import { HttpRequest, HttpResponse, InvocationContext } from '@azure/functions'; +import { MAIN_ORCHESTRATOR } from '../loadConsolidations'; export default async function httpStart( request: HttpRequest, @@ -7,7 +8,7 @@ export default async function httpStart( ): Promise { const client = df.getClient(context); const body: unknown = await request.json(); - const instanceId: string = await client.startNew('orchestrator', { + const instanceId: string = await client.startNew(MAIN_ORCHESTRATOR, { input: body, }); @@ -15,9 +16,3 @@ export default async function httpStart( return client.createCheckStatusResponse(request, instanceId); } - -app.http('dfClient', { - route: 'orchestrators/orchestrator', - extraInputs: [df.input.durableClient()], - handler: httpStart, -}); diff --git a/backend/functions/poc/getConsolidations.ts b/backend/functions/poc/getConsolidations.ts deleted file mode 100644 index dacdf5299..000000000 --- a/backend/functions/poc/getConsolidations.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as df from 'durable-functions'; -import { InvocationContext } from '@azure/functions'; -import { PredicateAndPage } from './model'; - -export default async function handler(input: PredicateAndPage, context: InvocationContext) { - // Do some stuff - context.log('GetConsolidations', JSON.stringify(input)); - return [ - { orderId: '53rs2', caseId: '071-23-012345' }, - { orderId: '426gh', caseId: '071-23-43215' }, - ]; -} - -df.app.activity('getConsolidationsFromACMS', { - // extraOutputs: [blobOutput], - handler, -}); diff --git a/backend/functions/poc/getPageCount.ts b/backend/functions/poc/getPageCount.ts deleted file mode 100644 index 81290c804..000000000 --- a/backend/functions/poc/getPageCount.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as df from 'durable-functions'; -import { InvocationContext } from '@azure/functions'; -import { PredicateAndPage } from './model'; - -export default async function handler(input: PredicateAndPage, context: InvocationContext) { - // Do some stuff - context.log('#################GetPageCount', JSON.stringify(input)); - return 4; -} - -df.app.activity('getPageCountFromACMS', { - handler, -}); diff --git a/backend/functions/poc/loadConsolidations.ts b/backend/functions/poc/loadConsolidations.ts new file mode 100644 index 000000000..4ad5ec7da --- /dev/null +++ b/backend/functions/poc/loadConsolidations.ts @@ -0,0 +1,30 @@ +import * as df from 'durable-functions'; +import { app } from '@azure/functions'; + +import httpStart from './client/dfClient.function'; +import { main } from './orchestration/orchestrator'; +import { subOrchestratorETL } from './orchestration/sub-orchestrator-etl'; +import { subOrchestratorPaging } from './orchestration/sub-orchestrator-paging'; +import getConsolidations from './activity/getConsolidations'; +import getPageCount from './activity/getPageCount'; +import transformAndLoad from './activity/transformAndLoad'; + +export const SUB_ORCHESTRATOR_ETL = 'SubOrchestratorETL'; +export const SUB_ORCHESTRATOR_PAGING = 'SubOrchestratorPaging'; +export const MAIN_ORCHESTRATOR = 'orchestrator'; +export const PAGE_COUNT_ACTIVITY = 'getPageCountFromACMS'; +export const CONSOLIDATIONS_FROM_ACMS = 'getConsolidationsFromACMS'; +export const TRANSFORM_AND_LOAD = 'transformAndLoad'; + +df.app.orchestration(MAIN_ORCHESTRATOR, main); +df.app.orchestration(SUB_ORCHESTRATOR_ETL, subOrchestratorETL); +df.app.orchestration(SUB_ORCHESTRATOR_PAGING, subOrchestratorPaging); +df.app.activity(CONSOLIDATIONS_FROM_ACMS, getConsolidations); +df.app.activity(PAGE_COUNT_ACTIVITY, getPageCount); +df.app.activity(TRANSFORM_AND_LOAD, transformAndLoad); + +app.http('dfClient', { + route: 'orchestrators/orchestrator', + extraInputs: [df.input.durableClient()], + handler: httpStart, +}); diff --git a/backend/functions/poc/model.ts b/backend/functions/poc/model.ts index f82079f14..39446224b 100644 --- a/backend/functions/poc/model.ts +++ b/backend/functions/poc/model.ts @@ -14,6 +14,7 @@ export type PredicateAndPage = Predicate & { pageNumber: number; }; +// properties here are temporary. Need to figure out what this type should look like. export type AcmsConsolidation = { orderId: string; caseId: string; diff --git a/backend/functions/poc/orchestrator.ts b/backend/functions/poc/orchestration/orchestrator.ts similarity index 61% rename from backend/functions/poc/orchestrator.ts rename to backend/functions/poc/orchestration/orchestrator.ts index 2dec06418..060a1e698 100644 --- a/backend/functions/poc/orchestrator.ts +++ b/backend/functions/poc/orchestration/orchestrator.ts @@ -1,15 +1,14 @@ -import { Bounds } from './model'; +import { Bounds } from '../model'; +import { SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; +import { OrchestrationContext } from 'durable-functions'; -import * as df from 'durable-functions'; - -df.app.orchestration('orchestrator', function* (context) { +export function* main(context: OrchestrationContext) { const bounds: Bounds = context.df.getInput(); - context.log('orchestrator', JSON.stringify(bounds)); - const provisioningTasks = []; const { divisionCodes, chapters, dateRange } = bounds; + // TODO: Add an activity to flatten the arrays for (const divisionCode of divisionCodes) { for (const chapter of chapters) { const predicate = { @@ -19,9 +18,9 @@ df.app.orchestration('orchestrator', function* (context) { }; const child_id = context.df.instanceId + `:${divisionCode}:${chapter}:`; provisioningTasks.push( - context.df.callSubOrchestrator('subOrchestratorPaging', predicate, child_id), + context.df.callSubOrchestrator(SUB_ORCHESTRATOR_PAGING, predicate, child_id), ); } } yield context.df.Task.all(provisioningTasks); -}); +} diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts new file mode 100644 index 000000000..3dee221dc --- /dev/null +++ b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts @@ -0,0 +1,23 @@ +import { CONSOLIDATIONS_FROM_ACMS, TRANSFORM_AND_LOAD } from '../loadConsolidations'; +import { PredicateAndPage } from '../model'; +import { OrchestrationContext } from 'durable-functions'; + +export function* subOrchestratorETL(context: OrchestrationContext) { + const predicateAndPage: PredicateAndPage = context.df.getInput(); + + const consolidatedOrdersPage = yield context.df.callActivity( + CONSOLIDATIONS_FROM_ACMS, + predicateAndPage, + ); + + const parallelTasks = []; + for (let i = 0; i < consolidatedOrdersPage.length; i++) { + parallelTasks.push(context.df.callActivity(TRANSFORM_AND_LOAD, consolidatedOrdersPage[i])); + } + + yield context.df.Task.all(parallelTasks); + + // DO we need to fan in?? + // const sum = parallelTasks.reduce((prev, curr) => prev + curr, 0); + // yield context.df.callActivity('finalResults??', sum); +} diff --git a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts new file mode 100644 index 000000000..0d69584cc --- /dev/null +++ b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts @@ -0,0 +1,22 @@ +import { Predicate, PredicateAndPage } from '../model'; +import { OrchestrationContext } from 'durable-functions'; +import { PAGE_COUNT_ACTIVITY, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; + +export function* subOrchestratorPaging(context: OrchestrationContext) { + const predicate: Predicate = context.df.getInput(); + + const pageCount = yield context.df.callActivity(PAGE_COUNT_ACTIVITY, predicate); + const provisioningTasks = []; + for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { + const predicateAndPage: PredicateAndPage = { + ...predicate, + pageNumber, + }; + const child_id = context.df.instanceId + `:${pageNumber}`; + provisioningTasks.push( + context.df.callSubOrchestrator(SUB_ORCHESTRATOR_ETL, predicateAndPage, child_id), + ); + } + + yield context.df.Task.all(provisioningTasks); +} diff --git a/backend/functions/poc/sub-orchestrator-etl.ts b/backend/functions/poc/sub-orchestrator-etl.ts deleted file mode 100644 index 66f539df7..000000000 --- a/backend/functions/poc/sub-orchestrator-etl.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { PredicateAndPage } from './model'; - -import * as df from 'durable-functions'; - -df.app.orchestration('subOrchestratorETL', function* (context) { - const predicateAndPage: PredicateAndPage = context.df.getInput(); - - context.log( - '#################subOrchestratorETL:', - context.df.instanceId, - JSON.stringify(predicateAndPage), - ); - - const consolidatedOrdersPage = yield context.df.callActivity( - 'getConsolidationsFromACMS', - predicateAndPage, - ); - - context.log('#################length', consolidatedOrdersPage.length); - const parallelTasks = []; - for (let i = 0; i < consolidatedOrdersPage.length; i++) { - parallelTasks.push(context.df.callActivity('transformAndLoad', consolidatedOrdersPage[i])); - } - - yield context.df.Task.all(parallelTasks); - - // DO we need to fan in?? - // const sum = parallelTasks.reduce((prev, curr) => prev + curr, 0); - // yield context.df.callActivity('finalResults??', sum); -}); diff --git a/backend/functions/poc/sub-orchestrator-paging.ts b/backend/functions/poc/sub-orchestrator-paging.ts deleted file mode 100644 index 3ed9f2773..000000000 --- a/backend/functions/poc/sub-orchestrator-paging.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Predicate, PredicateAndPage } from './model'; - -import * as df from 'durable-functions'; - -df.app.orchestration('subOrchestratorPaging', function* (context) { - const predicate: Predicate = context.df.getInput(); - - context.log('#################subOrchestratorPaging', JSON.stringify(predicate)); - - const pageCount = yield context.df.callActivity('getPageCountFromACMS', predicate); - context.log('#################pageCount', pageCount); - const provisioningTasks = []; - for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { - const predicateAndPage: PredicateAndPage = { - ...predicate, - pageNumber, - }; - const child_id = context.df.instanceId + `:${pageNumber}`; - provisioningTasks.push( - context.df.callSubOrchestrator('subOrchestratorETL', predicateAndPage, child_id), - ); - } - - context.log('#################results', JSON.stringify(provisioningTasks)); - yield context.df.Task.all(provisioningTasks); -}); From 48c1a6c0e0264479c98d51ecdcc5217a55cd0269 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Fri, 15 Nov 2024 19:45:44 -0700 Subject: [PATCH 004/112] Started work on use cases Jira ticket: CAMS-461 --- .../functions/lib/use-cases/orders/orders.ts | 33 ++++++++++++++- .../functions/poc/activity/getPageCount.ts | 42 +++++++++++++++++-- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 5cd3a9295..f702f3919 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -64,6 +64,8 @@ export interface SyncOrdersStatus { maxTxId: string; } +export interface ImportConsolidationOptions {} + export class OrdersUseCase { private readonly casesRepo: CasesRepository; private readonly casesGateway: CasesInterface; @@ -169,12 +171,41 @@ export class OrdersUseCase { } } + public async getConsolidationPageCount( + context: ApplicationContext, + _options?: ImportConsolidationOptions, + ): Promise { + try { + //const pageCount = await this.legacyDatabaseRepo.read('', ''); + //context.logger.info(MODULE_NAME, 'Got page count for import from repo.', pageCount); + //return pageCount; + } catch (error) { + const message = 'Failed to get page count for consolidation import from repo.'; + context.logger.info(MODULE_NAME, message, error); + throw new CamsError(MODULE_NAME, { message }); + } + return 0; + } + + public async importConsolidationData( + context: ApplicationContext, + _options?: ImportConsolidationOptions, + ): Promise { + try { + //const consolidations = await this.legacyDatabaseRepo.read('', ''); + } catch (error) { + const message = 'Failed to get consolidation data from repo.'; + context.logger.info(MODULE_NAME, message, error); + throw new CamsError(MODULE_NAME, { message }); + } + return; + } + public async syncOrders( context: ApplicationContext, options?: SyncOrdersOptions, ): Promise { let initialSyncState: OrderSyncState; - try { initialSyncState = await this.runtimeStateRepo.read('ORDERS_SYNC_STATE', ''); context.logger.info( diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts index 0a2f45a02..202f0033c 100644 --- a/backend/functions/poc/activity/getPageCount.ts +++ b/backend/functions/poc/activity/getPageCount.ts @@ -1,10 +1,44 @@ import { InvocationContext } from '@azure/functions'; import { PredicateAndPage } from '../model'; +import { OrdersUseCase } from '../../lib/use-cases/orders/orders'; +import { + getCasesRepository, + getCasesGateway, + getOrdersRepository, + getOrdersGateway, + getRuntimeStateRepository, + getConsolidationOrdersRepository, + getStorageGateway, +} from '../../lib/factory'; +import { OrderSyncState } from '../../lib/use-cases/gateways.types'; +import ContextCreator from '../../azure/application-context-creator'; +import { CamsError } from '../../lib/common-errors/cams-error'; -async function getPageCount(input: PredicateAndPage, context: InvocationContext) { - // Do some stuff - context.log('#################GetPageCount', JSON.stringify(input)); - return 4; +const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; + +async function getPageCount(input: PredicateAndPage, invocationContext: InvocationContext) { + const logger = ContextCreator.getLogger(invocationContext); + try { + const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + + // Do some stuff + console.log('#################GetPageCount', JSON.stringify(input)); + // TODO: This seems silly to have to supply all of these repos and gateways. + // Are we going to add yet another for ACMS? + const orders = new OrdersUseCase( + getCasesRepository(context), + getCasesGateway(context), + getOrdersRepository(context), + getOrdersGateway(context), + getRuntimeStateRepository(context), + getConsolidationOrdersRepository(context), + getStorageGateway(context), + ); + + return orders.getConsolidationPageCount(context, {}); + } catch (originalError) { + throw new CamsError(MODULE_NAME, { originalError }); + } } export default { From 5286f990e74f863cbb256cdbc6dbf35e11eb3a30 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:23:56 -0600 Subject: [PATCH 005/112] Move transform and load to use case Jira ticket: CAMS-461 --- .../controllers/orders/orders.controller.ts | 8 +++++++ .../functions/lib/use-cases/orders/orders.ts | 19 +++++++++++++++ .../poc/activity/flattenBoundingArrays.ts | 23 ++++++++++++++++++ .../poc/activity/transformAndLoad.ts | 15 ++++++------ backend/functions/poc/loadConsolidations.ts | 3 +++ .../poc/orchestration/orchestrator.ts | 24 +++++++------------ .../orchestration/sub-orchestrator-paging.ts | 2 +- 7 files changed, 69 insertions(+), 25 deletions(-) create mode 100644 backend/functions/poc/activity/flattenBoundingArrays.ts diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index 6150fb767..492a5cc48 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -27,6 +27,7 @@ import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; import { OrderSyncState } from '../../use-cases/gateways.types'; import { closeDeferred } from '../../defer-close'; +import { AcmsConsolidation } from '../../../poc/model'; const MODULE_NAME = 'ORDERS-CONTROLLER'; @@ -85,6 +86,13 @@ export class OrdersController implements CamsController, CamsTimerController { } } + public async handleMigration( + context: ApplicationContext, + existing: AcmsConsolidation, + ): Promise { + return this.useCase.migrateExistingConsolidation(existing, context); + } + private async handleOrders(context: ApplicationContext) { let response; if (context.request.method === 'GET') { diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index f702f3919..48f3d519f 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -48,6 +48,8 @@ import { createAuditRecord } from '../../../../../common/src/cams/auditable'; import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; import { isNotFoundError } from '../../common-errors/not-found-error'; import { StorageGateway } from '../../adapters/types/storage'; +import { AcmsConsolidation } from '../../../poc/model'; +import { randomUUID } from 'crypto'; const MODULE_NAME = 'ORDERS_USE_CASE'; @@ -552,4 +554,21 @@ export class OrdersUseCase { }); return consolidationsByJobId; } + + public async migrateExistingConsolidation( + existing: AcmsConsolidation, + context: ApplicationContext, + ): Promise { + // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. + context.logger.info(MODULE_NAME, 'Transform and load', existing); + const newOrder = { + ...existing, + camsId: randomUUID(), + }; + context.logger.info( + MODULE_NAME, + `Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`, + ); + return newOrder as unknown as ConsolidationOrder; + } } diff --git a/backend/functions/poc/activity/flattenBoundingArrays.ts b/backend/functions/poc/activity/flattenBoundingArrays.ts new file mode 100644 index 000000000..6e8d16d63 --- /dev/null +++ b/backend/functions/poc/activity/flattenBoundingArrays.ts @@ -0,0 +1,23 @@ +import { Bounds, Predicate } from '../model'; +import { InvocationContext } from '@azure/functions'; + +async function flattenBoundingArrays( + bounds: Bounds, + _context: InvocationContext, +): Promise { + const predicates: Predicate[] = []; + for (const chapter in bounds.chapters) { + for (const divisionCode in bounds.divisionCodes) { + predicates.push({ + divisionCode, + chapter, + dateRange: bounds.dateRange, + }); + } + } + return predicates; +} + +export default { + handler: flattenBoundingArrays, +}; diff --git a/backend/functions/poc/activity/transformAndLoad.ts b/backend/functions/poc/activity/transformAndLoad.ts index fedaf52b7..fc2a671aa 100644 --- a/backend/functions/poc/activity/transformAndLoad.ts +++ b/backend/functions/poc/activity/transformAndLoad.ts @@ -1,15 +1,14 @@ import { InvocationContext } from '@azure/functions'; import { AcmsConsolidation } from '../model'; -import { randomUUID } from 'crypto'; +import ContextCreator from '../../azure/application-context-creator'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -async function transformAndLoad(input: AcmsConsolidation, context: InvocationContext) { +async function transformAndLoad(input: AcmsConsolidation, invocationContext: InvocationContext) { // Do some stuff - context.log('#################Transform and load', JSON.stringify(input)); - const newOrder = { - ...input, - camsId: randomUUID(), - }; - context.log(`Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`); + const logger = ContextCreator.getLogger(invocationContext); + const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); + const controller = new OrdersController(appContext); + return controller.handleMigration(appContext, input); } export default { diff --git a/backend/functions/poc/loadConsolidations.ts b/backend/functions/poc/loadConsolidations.ts index 4ad5ec7da..3f5915d0a 100644 --- a/backend/functions/poc/loadConsolidations.ts +++ b/backend/functions/poc/loadConsolidations.ts @@ -8,6 +8,7 @@ import { subOrchestratorPaging } from './orchestration/sub-orchestrator-paging'; import getConsolidations from './activity/getConsolidations'; import getPageCount from './activity/getPageCount'; import transformAndLoad from './activity/transformAndLoad'; +import flattenBoundingArrays from './activity/flattenBoundingArrays'; export const SUB_ORCHESTRATOR_ETL = 'SubOrchestratorETL'; export const SUB_ORCHESTRATOR_PAGING = 'SubOrchestratorPaging'; @@ -15,6 +16,7 @@ export const MAIN_ORCHESTRATOR = 'orchestrator'; export const PAGE_COUNT_ACTIVITY = 'getPageCountFromACMS'; export const CONSOLIDATIONS_FROM_ACMS = 'getConsolidationsFromACMS'; export const TRANSFORM_AND_LOAD = 'transformAndLoad'; +export const FLATTEN_BOUNDING_ARRAYS = 'flattenBoundingArrays'; df.app.orchestration(MAIN_ORCHESTRATOR, main); df.app.orchestration(SUB_ORCHESTRATOR_ETL, subOrchestratorETL); @@ -22,6 +24,7 @@ df.app.orchestration(SUB_ORCHESTRATOR_PAGING, subOrchestratorPaging); df.app.activity(CONSOLIDATIONS_FROM_ACMS, getConsolidations); df.app.activity(PAGE_COUNT_ACTIVITY, getPageCount); df.app.activity(TRANSFORM_AND_LOAD, transformAndLoad); +df.app.activity(FLATTEN_BOUNDING_ARRAYS, flattenBoundingArrays); app.http('dfClient', { route: 'orchestrators/orchestrator', diff --git a/backend/functions/poc/orchestration/orchestrator.ts b/backend/functions/poc/orchestration/orchestrator.ts index 060a1e698..54657abf6 100644 --- a/backend/functions/poc/orchestration/orchestrator.ts +++ b/backend/functions/poc/orchestration/orchestrator.ts @@ -1,5 +1,5 @@ -import { Bounds } from '../model'; -import { SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; +import { Bounds, Predicate } from '../model'; +import { FLATTEN_BOUNDING_ARRAYS, SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; export function* main(context: OrchestrationContext) { @@ -7,20 +7,12 @@ export function* main(context: OrchestrationContext) { const provisioningTasks = []; - const { divisionCodes, chapters, dateRange } = bounds; - // TODO: Add an activity to flatten the arrays - for (const divisionCode of divisionCodes) { - for (const chapter of chapters) { - const predicate = { - divisionCode, - chapter, - dateRange, - }; - const child_id = context.df.instanceId + `:${divisionCode}:${chapter}:`; - provisioningTasks.push( - context.df.callSubOrchestrator(SUB_ORCHESTRATOR_PAGING, predicate, child_id), - ); - } + const partitions: Predicate[] = yield context.df.callActivity(FLATTEN_BOUNDING_ARRAYS, bounds); + for (const partition of partitions) { + const child_id = context.df.instanceId + `:${partition.divisionCode}:${partition.chapter}:`; + provisioningTasks.push( + context.df.callSubOrchestrator(SUB_ORCHESTRATOR_PAGING, partition, child_id), + ); } yield context.df.Task.all(provisioningTasks); } diff --git a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts index 0d69584cc..7dc10803c 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts @@ -5,7 +5,7 @@ import { PAGE_COUNT_ACTIVITY, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations export function* subOrchestratorPaging(context: OrchestrationContext) { const predicate: Predicate = context.df.getInput(); - const pageCount = yield context.df.callActivity(PAGE_COUNT_ACTIVITY, predicate); + const pageCount: number = yield context.df.callActivity(PAGE_COUNT_ACTIVITY, predicate); const provisioningTasks = []; for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { const predicateAndPage: PredicateAndPage = { From 872a5569edbe894256e29059766a30a0fd686753 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:03:07 -0600 Subject: [PATCH 006/112] WIP - Move to using the controller Jira ticket: CAMS-461 --- .../controllers/orders/orders.controller.ts | 10 +++++- .../functions/lib/use-cases/orders/orders.ts | 3 ++ .../functions/poc/activity/getPageCount.ts | 36 ++++++++----------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index 492a5cc48..ed740f6a2 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -27,7 +27,7 @@ import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; import { OrderSyncState } from '../../use-cases/gateways.types'; import { closeDeferred } from '../../defer-close'; -import { AcmsConsolidation } from '../../../poc/model'; +import { AcmsConsolidation, PredicateAndPage } from '../../../poc/model'; const MODULE_NAME = 'ORDERS-CONTROLLER'; @@ -93,6 +93,14 @@ export class OrdersController implements CamsController, CamsTimerController { return this.useCase.migrateExistingConsolidation(existing, context); } + public async handlePageCount( + context: ApplicationContext, + predicate: PredicateAndPage, + ): Promise { + // TODO: Reconcile the argument type + return this.useCase.getConsolidationPageCount(context, predicate); + } + private async handleOrders(context: ApplicationContext) { let response; if (context.request.method === 'GET') { diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 48f3d519f..53afb75f5 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -173,6 +173,9 @@ export class OrdersUseCase { } } + // TODO: Reconcile the argument type. For migrateExistingConsolidation I went with bringing in the + // AcmsConsolidation type, but it would be better for the type to be owned by the use case. I'm + // not sure we want one Options type for all related methods though. public async getConsolidationPageCount( context: ApplicationContext, _options?: ImportConsolidationOptions, diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts index 202f0033c..0eef6eecb 100644 --- a/backend/functions/poc/activity/getPageCount.ts +++ b/backend/functions/poc/activity/getPageCount.ts @@ -1,18 +1,8 @@ import { InvocationContext } from '@azure/functions'; import { PredicateAndPage } from '../model'; -import { OrdersUseCase } from '../../lib/use-cases/orders/orders'; -import { - getCasesRepository, - getCasesGateway, - getOrdersRepository, - getOrdersGateway, - getRuntimeStateRepository, - getConsolidationOrdersRepository, - getStorageGateway, -} from '../../lib/factory'; -import { OrderSyncState } from '../../lib/use-cases/gateways.types'; import ContextCreator from '../../azure/application-context-creator'; import { CamsError } from '../../lib/common-errors/cams-error'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; @@ -23,19 +13,21 @@ async function getPageCount(input: PredicateAndPage, invocationContext: Invocati // Do some stuff console.log('#################GetPageCount', JSON.stringify(input)); + const controller = new OrdersController(context); + return controller.handlePageCount(context, input); // TODO: This seems silly to have to supply all of these repos and gateways. // Are we going to add yet another for ACMS? - const orders = new OrdersUseCase( - getCasesRepository(context), - getCasesGateway(context), - getOrdersRepository(context), - getOrdersGateway(context), - getRuntimeStateRepository(context), - getConsolidationOrdersRepository(context), - getStorageGateway(context), - ); - - return orders.getConsolidationPageCount(context, {}); + // const orders = new OrdersUseCase( + // getCasesRepository(context), + // getCasesGateway(context), + // getOrdersRepository(context), + // getOrdersGateway(context), + // getRuntimeStateRepository(context), + // getConsolidationOrdersRepository(context), + // getStorageGateway(context), + // ); + // + // return orders.getConsolidationPageCount(context, {}); } catch (originalError) { throw new CamsError(MODULE_NAME, { originalError }); } From e42a7c25765b8c1e8db7db2edaf28742fa905553 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:27:31 -0500 Subject: [PATCH 007/112] Refactor factory to return singleton references Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../controllers/orders/orders.controller.ts | 20 +-- backend/functions/lib/factory.test.ts | 116 ++++++++++++------ backend/functions/lib/factory.ts | 78 +++++++++--- .../orders-consolidation-approval.test.ts | 30 +---- .../orders/orders-local-gateway.test.ts | 65 ++-------- .../lib/use-cases/orders/orders.test.ts | 40 ++---- .../functions/lib/use-cases/orders/orders.ts | 116 ++++++++---------- 7 files changed, 221 insertions(+), 244 deletions(-) diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index ed740f6a2..07b31e107 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -1,15 +1,6 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { isCamsError } from '../../common-errors/cams-error'; import { UnknownError } from '../../common-errors/unknown-error'; -import { - getCasesGateway, - getCasesRepository, - getConsolidationOrdersRepository, - getOrdersGateway, - getOrdersRepository, - getRuntimeStateRepository, - getStorageGateway, -} from '../../factory'; import { OrdersUseCase, SyncOrdersOptions, SyncOrdersStatus } from '../../use-cases/orders/orders'; import { ConsolidationOrder, @@ -25,7 +16,6 @@ import { getCamsError } from '../../common-errors/error-utilities'; import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; -import { OrderSyncState } from '../../use-cases/gateways.types'; import { closeDeferred } from '../../defer-close'; import { AcmsConsolidation, PredicateAndPage } from '../../../poc/model'; @@ -41,15 +31,7 @@ export class OrdersController implements CamsController, CamsTimerController { private readonly useCase: OrdersUseCase; constructor(context: ApplicationContext) { - this.useCase = new OrdersUseCase( - getCasesRepository(context), - getCasesGateway(context), - getOrdersRepository(context), - getOrdersGateway(context), - getRuntimeStateRepository(context), - getConsolidationOrdersRepository(context), - getStorageGateway(context), - ); + this.useCase = new OrdersUseCase(context); } public async handleTimer(context: ApplicationContext): Promise { diff --git a/backend/functions/lib/factory.test.ts b/backend/functions/lib/factory.test.ts index f7f313789..bf0821176 100644 --- a/backend/functions/lib/factory.test.ts +++ b/backend/functions/lib/factory.test.ts @@ -1,29 +1,59 @@ -import CasesDxtrGateway from './adapters/gateways/dxtr/cases.dxtr.gateway'; -import OfficesDxtrGateway from './adapters/gateways/dxtr/offices.dxtr.gateway'; -import { DxtrOrdersGateway } from './adapters/gateways/dxtr/orders.dxtr.gateway'; -import { CasesLocalGateway } from './adapters/gateways/cases.local.gateway'; -import { RuntimeStateMongoRepository } from './adapters/gateways/mongo/runtime-state.mongo.repository'; import { ApplicationContext } from './adapters/types/basic'; -import { - getAssignmentRepository, - getCaseDocketUseCase, - getCasesGateway, - getOfficesGateway, - getOrdersGateway, - getOrdersRepository, - getRuntimeStateRepository, -} from './factory'; import { createMockApplicationContext } from './testing/testing-utilities'; -import { CaseDocketUseCase } from './use-cases/case-docket/case-docket'; -import { MockOrdersGateway } from './testing/mock-gateways/mock.orders.gateway'; -import { MockOfficesGateway } from './testing/mock-gateways/mock.offices.gateway'; -import { CaseAssignmentMongoRepository } from './adapters/gateways/mongo/case-assignment.mongo.repository'; -import { OrdersMongoRepository } from './adapters/gateways/mongo/orders.mongo.repository'; -import { MockMongoRepository } from './testing/mock-gateways/mock-mongo.repository'; describe('Factory functions', () => { let dbContext: ApplicationContext; let mockDbContext: ApplicationContext; + let factory; + + let RuntimeStateMongoRepository; + let MockMongoRepository; + let OrdersMongoRepository; + let CaseAssignmentMongoRepository; + let MockOfficesGateway; + let MockOrdersGateway; + let DxtrOrdersGateway; + let OfficesDxtrGateway; + let CaseDocketUseCase; + let CasesLocalGateway; + let CasesDxtrGateway; + + beforeEach(async () => { + await jest.isolateModulesAsync(async () => { + factory = await import('./factory'); + + RuntimeStateMongoRepository = ( + await import('./adapters/gateways/mongo/runtime-state.mongo.repository') + ).RuntimeStateMongoRepository; + + MockMongoRepository = (await import('./testing/mock-gateways/mock-mongo.repository')) + .MockMongoRepository; + + OrdersMongoRepository = (await import('./adapters/gateways/mongo/orders.mongo.repository')) + .OrdersMongoRepository; + + MockOfficesGateway = (await import('./testing/mock-gateways/mock.offices.gateway')) + .MockOfficesGateway; + + MockOrdersGateway = (await import('./testing/mock-gateways/mock.orders.gateway')) + .MockOrdersGateway; + + DxtrOrdersGateway = (await import('./adapters/gateways/dxtr/orders.dxtr.gateway')) + .DxtrOrdersGateway; + + CaseDocketUseCase = (await import('./use-cases/case-docket/case-docket')).CaseDocketUseCase; + + OfficesDxtrGateway = (await import('./adapters/gateways/dxtr/offices.dxtr.gateway')).default; + + CasesLocalGateway = (await import('./adapters/gateways/cases.local.gateway')) + .CasesLocalGateway; + + CasesDxtrGateway = (await import('./adapters/gateways/dxtr/cases.dxtr.gateway')).default; + CaseAssignmentMongoRepository = ( + await import('./adapters/gateways/mongo/case-assignment.mongo.repository') + ).CaseAssignmentMongoRepository; + }); + }); beforeAll(async () => { dbContext = await createMockApplicationContext({ @@ -36,57 +66,67 @@ describe('Factory functions', () => { }); test('getAttorneyGateway', async () => { - const obj = getCaseDocketUseCase(dbContext); + const obj = factory.getCaseDocketUseCase(dbContext); expect(obj).toBeInstanceOf(CaseDocketUseCase); }); - test('getCasesGateway', async () => { - const mockObj = getCasesGateway(mockDbContext); + test('getCasesGateway mock', async () => { + const mockObj = factory.getCasesGateway(mockDbContext); expect(mockObj).toBeInstanceOf(CasesLocalGateway); + }); - const obj = getCasesGateway(dbContext); + test('getCasesGateway DXTR', async () => { + const obj = factory.getCasesGateway(dbContext); expect(obj).toBeInstanceOf(CasesDxtrGateway); }); test('getAssignmentRepository', async () => { - const obj = getAssignmentRepository(dbContext); + const obj = factory.getAssignmentRepository(dbContext); expect(obj).toBeInstanceOf(CaseAssignmentMongoRepository); }); - test('getCaseDocketUseCase', async () => { - const mockObj = getCaseDocketUseCase(mockDbContext); + test('getCaseDocketUseCase mock', async () => { + const mockObj = factory.getCaseDocketUseCase(mockDbContext); expect(mockObj).toBeInstanceOf(CaseDocketUseCase); + }); - const obj = getCaseDocketUseCase(dbContext); + test('getCaseDocketUseCase DXTR', async () => { + const obj = factory.getCaseDocketUseCase(dbContext); expect(obj).toBeInstanceOf(CaseDocketUseCase); }); - test('getOrdersGateway', async () => { - const mockObj = getOrdersGateway(mockDbContext); + test('getOrdersGateway mock', async () => { + const mockObj = factory.getOrdersGateway(mockDbContext); expect(mockObj).toBeInstanceOf(MockOrdersGateway); + }); - const obj = getOrdersGateway(dbContext); + test('getOrdersGateway DXTR', async () => { + const obj = factory.getOrdersGateway(dbContext); expect(obj).toBeInstanceOf(DxtrOrdersGateway); }); - test('getOfficesGateway', async () => { - const mockObj = getOfficesGateway(mockDbContext); + test('getOfficesGateway mock', async () => { + const mockObj = factory.getOfficesGateway(mockDbContext); expect(mockObj).toBeInstanceOf(MockOfficesGateway); + }); - const obj = getOfficesGateway(dbContext); + test('getOfficesGateway DXTR', async () => { + const obj = factory.getOfficesGateway(dbContext); expect(obj).toBeInstanceOf(OfficesDxtrGateway); }); - test('getOrdersRepository', async () => { - const mockObj = getOrdersRepository(mockDbContext); + test('getOrdersRepository mock', async () => { + const mockObj = factory.getOrdersRepository(mockDbContext); expect(mockObj).toBeInstanceOf(MockMongoRepository); + }); - const obj = getOrdersRepository(dbContext); + test('getOrdersRepository DXTR', async () => { + const obj = factory.getOrdersRepository(dbContext); expect(obj).toBeInstanceOf(OrdersMongoRepository); }); test('getRuntimeStateRepository', async () => { - const obj = getRuntimeStateRepository(dbContext); + const obj = factory.getRuntimeStateRepository(dbContext); expect(obj).toBeInstanceOf(RuntimeStateMongoRepository); }); }); diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index 97d2e7250..85131fb86 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -15,6 +15,7 @@ import { OfficesRepository, OrdersGateway, OrdersRepository, + OrderSyncState, RuntimeState, RuntimeStateRepository, UserSessionCacheRepository, @@ -43,16 +44,27 @@ import { RuntimeStateMongoRepository } from './adapters/gateways/mongo/runtime-s import { UserSessionCacheMongoRepository } from './adapters/gateways/mongo/user-session-cache.mongo.repository'; import { MockOfficesRepository } from './testing/mock-gateways/mock.offices.repository'; +let casesRepo: CasesRepository; +let casesGateway: CasesInterface; +let ordersGateway: OrdersGateway; +let ordersRepo: OrdersRepository; +let consolidationsRepo: ConsolidationOrdersRepository; +let orderSyncStateRepo: RuntimeStateRepository; +let storageGateway: StorageGateway; + export const getAttorneyGateway = (): AttorneyGatewayInterface => { return MockAttorneysGateway; }; export const getCasesGateway = (applicationContext: ApplicationContext): CasesInterface => { - if (applicationContext.config.get('dbMock')) { - return new CasesLocalGateway(); - } else { - return new CasesDxtrGateway(); + if (!casesGateway) { + if (applicationContext.config.get('dbMock')) { + casesGateway = new CasesLocalGateway(); + } else { + casesGateway = new CasesDxtrGateway(); + } } + return casesGateway; }; export const getAssignmentRepository = ( @@ -80,11 +92,14 @@ export const getSqlConnection = (databaseConfig: IDbConfig) => { }; export const getOrdersGateway = (applicationContext: ApplicationContext): OrdersGateway => { - if (applicationContext.config.get('dbMock')) { - return new MockOrdersGateway(); - } else { - return new DxtrOrdersGateway(); + if (!ordersGateway) { + if (applicationContext.config.get('dbMock')) { + ordersGateway = new MockOrdersGateway(); + } else { + ordersGateway = new DxtrOrdersGateway(); + } } + return ordersGateway; }; export const getOfficesGateway = (applicationContext: ApplicationContext): OfficesGateway => { @@ -104,20 +119,38 @@ export const getOfficesRepository = (applicationContext: ApplicationContext): Of // transfer orders export const getOrdersRepository = (applicationContext: ApplicationContext): OrdersRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return new OrdersMongoRepository(applicationContext); + if (!ordersRepo) { + if (applicationContext.config.get('dbMock')) { + ordersRepo = new MockMongoRepository(); + } else { + ordersRepo = new OrdersMongoRepository(applicationContext); + } + } + return ordersRepo; }; export const getConsolidationOrdersRepository = ( applicationContext: ApplicationContext, ): ConsolidationOrdersRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return new ConsolidationOrdersMongoRepository(applicationContext); + if (!consolidationsRepo) { + if (applicationContext.config.get('dbMock')) { + consolidationsRepo = new MockMongoRepository(); + } else { + consolidationsRepo = new ConsolidationOrdersMongoRepository(applicationContext); + } + } + return consolidationsRepo; }; export const getCasesRepository = (applicationContext: ApplicationContext): CasesRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return new CasesMongoRepository(applicationContext); + if (!casesRepo) { + if (applicationContext.config.get('dbMock')) { + casesRepo = new MockMongoRepository(); + } else { + casesRepo = new CasesMongoRepository(applicationContext); + } + } + return casesRepo; }; export const getRuntimeStateRepository = ( @@ -127,6 +160,15 @@ export const getRuntimeStateRepository = ( return new RuntimeStateMongoRepository(applicationContext); }; +export const getOrderSyncStateRepo = ( + context: ApplicationContext, +): RuntimeStateRepository => { + if (!orderSyncStateRepo) { + orderSyncStateRepo = getRuntimeStateRepository(context); + } + return orderSyncStateRepo; +}; + export const getAuthorizationGateway = (context: ApplicationContext): OpenIdConnectGateway => { if (context.config.authConfig.provider === 'okta') return OktaGateway; if (context.config.authConfig.provider === 'mock') return MockOpenIdConnectGateway; @@ -148,7 +190,10 @@ export const getUserSessionCacheRepository = ( }; export const getStorageGateway = (_context: ApplicationContext): StorageGateway => { - return LocalStorageGateway; + if (!storageGateway) { + storageGateway = LocalStorageGateway; + } + return storageGateway; }; export const getUserGroupGateway = (_context: ApplicationContext): UserGroupGateway => { @@ -166,6 +211,7 @@ export const Factory = { getOfficesGateway, getOfficesRepository, getOrdersRepository, + getOrderSyncStateRepo, getConsolidationOrdersRepository, getCasesRepository, getRuntimeStateRepository, @@ -175,3 +221,5 @@ export const Factory = { getStorageGateway, getUserGroupGateway, }; + +export default Factory; diff --git a/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts b/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts index 5807268ba..5db22292c 100644 --- a/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts +++ b/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts @@ -3,15 +3,7 @@ import { createMockApplicationContextSession, } from '../../testing/testing-utilities'; import { OrdersUseCase } from './orders'; -import { - getOrdersGateway, - getOrdersRepository, - getRuntimeStateRepository, - getCasesRepository, - getCasesGateway, - getConsolidationOrdersRepository, - getStorageGateway, -} from '../../factory'; +import { getCasesRepository } from '../../factory'; import { ConsolidationOrderActionApproval, getCaseSummaryFromConsolidationOrderCase, @@ -28,12 +20,7 @@ import { MockMongoRepository } from '../../testing/mock-gateways/mock-mongo.repo describe('Orders use case', () => { let mockContext; - let ordersGateway; - let ordersRepo; let casesRepo; - let runtimeStateRepo; - let casesGateway; - let consolidationRepo; let useCase: OrdersUseCase; const courtDivisionCode = '081'; const authorizedUser = MockData.getCamsUser({ @@ -44,21 +31,8 @@ describe('Orders use case', () => { beforeEach(async () => { mockContext = await createMockApplicationContext(); mockContext.session = await createMockApplicationContextSession({ user: authorizedUser }); - ordersGateway = getOrdersGateway(mockContext); - runtimeStateRepo = getRuntimeStateRepository(mockContext); - ordersRepo = getOrdersRepository(mockContext); casesRepo = getCasesRepository(mockContext); - casesGateway = getCasesGateway(mockContext); - consolidationRepo = getConsolidationOrdersRepository(mockContext); - useCase = new OrdersUseCase( - casesRepo, - casesGateway, - ordersRepo, - ordersGateway, - runtimeStateRepo, - consolidationRepo, - getStorageGateway(mockContext), - ); + useCase = new OrdersUseCase(mockContext); }); afterEach(() => { diff --git a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts b/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts index 36b819ce8..2632891eb 100644 --- a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts +++ b/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts @@ -1,22 +1,11 @@ -import { LocalCasesRepository } from '../../testing/local-data/local-cases-repository'; -import { LocalConsolidationOrdersRepository } from '../../testing/local-data/local-consolidation-orders-repository'; import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; import { ConsolidationOrder, ConsolidationOrderActionApproval, } from '../../../../../common/src/cams/orders'; -import { OrdersUseCase } from './orders'; -import * as FactoryModule from '../../factory'; -import { - getCasesGateway, - getOrdersGateway, - getOrdersRepository, - getRuntimeStateRepository, - getStorageGateway, -} from '../../factory'; +import { Factory } from '../../factory'; import { CasesRepository, ConsolidationOrdersRepository } from '../gateways.types'; -import { ApplicationContext } from '../../adapters/types/basic'; import { ConsolidationFrom, ConsolidationTo } from '../../../../../common/src/cams/events'; import { createMockApplicationContext, @@ -24,14 +13,12 @@ import { } from '../../testing/testing-utilities'; import { CamsRole } from '../../../../../common/src/cams/roles'; import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { LocalCasesRepository } from '../../testing/local-data/local-cases-repository'; +import { LocalConsolidationOrdersRepository } from '../../testing/local-data/local-consolidation-orders-repository'; +import { OrdersUseCase } from './orders'; -// TODO: This could be a testing library functions. function setupCasesRepoMock(repo: CasesRepository) { - jest - .spyOn(FactoryModule, 'getCasesRepository') - .mockImplementation((_context: ApplicationContext): CasesRepository => { - return repo; - }); + jest.spyOn(Factory, 'getCasesRepository').mockReturnValue(repo); return { createCaseHistory: jest.spyOn(repo, 'createCaseHistory'), createConsolidationTo: jest.spyOn(repo, 'createConsolidationTo'), @@ -44,13 +31,8 @@ function setupCasesRepoMock(repo: CasesRepository) { }; } -// TODO: This could be a testing library functions. function setupConsolidationsRepoMock(repo: ConsolidationOrdersRepository) { - jest - .spyOn(FactoryModule, 'getConsolidationOrdersRepository') - .mockImplementation((_context: ApplicationContext): ConsolidationOrdersRepository => { - return repo; - }); + jest.spyOn(Factory, 'getConsolidationOrdersRepository').mockReturnValue(repo); return { put: jest.spyOn(repo, 'create'), delete: jest.spyOn(repo, 'delete'), @@ -83,7 +65,6 @@ const pendingConsolidation = MockData.getConsolidationOrder({ // TODO: This could be a library function to setup a repo, be it local or cosmos. async function setupConsolidationCaseReferences( - context: ApplicationContext, repo: CasesRepository, order: ConsolidationOrder, ): Promise { @@ -112,7 +93,6 @@ async function setupConsolidationCaseReferences( // TODO: This could be a library function to setup a repo, be it local or cosmos. async function setupConsolidationOrder( - context: ApplicationContext, repo: ConsolidationOrdersRepository, order: ConsolidationOrder, ): Promise { @@ -122,11 +102,6 @@ async function setupConsolidationOrder( describe('orders use case tests', () => { let mockContext; - let ordersGateway; - let ordersRepo; - let runtimeStateRepo; - let casesGateway; - let storageGateway; const authorizedUser = MockData.getCamsUser({ roles: [CamsRole.DataVerifier], @@ -136,35 +111,23 @@ describe('orders use case tests', () => { beforeEach(async () => { mockContext = await createMockApplicationContext(); mockContext.session = await createMockApplicationContextSession({ user: authorizedUser }); - ordersGateway = getOrdersGateway(mockContext); - runtimeStateRepo = getRuntimeStateRepository(mockContext); - ordersRepo = getOrdersRepository(mockContext); - casesGateway = getCasesGateway(mockContext); - storageGateway = getStorageGateway(mockContext); }); - test('should not create a second lead case for an existing consolidation', async () => { + test.only('should not create a second lead case for an existing consolidation', async () => { // Spy/mock the factory functions so we can return a LOCAL database of our choosing for the test. // We need a generic LOCAL gateway implementation that we return via the mocked factory function. const localCasesRepo = new LocalCasesRepository(); const localConsolidationsRepo = new LocalConsolidationOrdersRepository(); - await setupConsolidationCaseReferences(mockContext, localCasesRepo, approvedConsolidation); - await setupConsolidationOrder(mockContext, localConsolidationsRepo, approvedConsolidation); - await setupConsolidationOrder(mockContext, localConsolidationsRepo, pendingConsolidation); + await setupConsolidationCaseReferences(localCasesRepo, approvedConsolidation); + await setupConsolidationOrder(localConsolidationsRepo, approvedConsolidation); + await setupConsolidationOrder(localConsolidationsRepo, pendingConsolidation); // Do not add the mock until the local data has been setup. const casesRepoSpy = setupCasesRepoMock(localCasesRepo); const consolidationSpy = setupConsolidationsRepoMock(localConsolidationsRepo); - const useCase = new OrdersUseCase( - localCasesRepo, - casesGateway, - ordersRepo, - ordersGateway, - runtimeStateRepo, - localConsolidationsRepo, - storageGateway, - ); + + const useCase = new OrdersUseCase(mockContext); // attempt to set up a consolidation with a different lead case const incorrectLeadCase = MockData.getCaseSummary(); @@ -176,10 +139,8 @@ describe('orders use case tests', () => { leadCase: incorrectLeadCase, }; - const expectedErrorMessage = - 'Cannot consolidate order. A child case has already been consolidated.'; await expect(useCase.approveConsolidation(mockContext, approval)).rejects.toThrow( - expectedErrorMessage, + 'Cannot consolidate order. A child case has already been consolidated.', ); // verify that the attempt fails (hint, it won't currently) diff --git a/backend/functions/lib/use-cases/orders/orders.test.ts b/backend/functions/lib/use-cases/orders/orders.test.ts index de9e6b9a9..bceff338e 100644 --- a/backend/functions/lib/use-cases/orders/orders.test.ts +++ b/backend/functions/lib/use-cases/orders/orders.test.ts @@ -4,15 +4,11 @@ import { } from '../../testing/testing-utilities'; import { OrdersUseCase } from './orders'; import { - getOrdersGateway, getOrdersRepository, - getRuntimeStateRepository, getCasesRepository, getCasesGateway, getConsolidationOrdersRepository, - getStorageGateway, } from '../../factory'; -import * as factory from '../../factory'; import { OrderSyncState } from '../gateways.types'; import { ConsolidationOrder, @@ -48,13 +44,10 @@ import { UstpDivisionMeta } from '../../../../../common/src/cams/offices'; describe('Orders use case', () => { const CASE_ID = '000-11-22222'; let mockContext; - let ordersGateway; let ordersRepo; let casesRepo; - let runtimeStateRepo; let casesGateway; let consolidationRepo; - let storageGateway; let useCase: OrdersUseCase; const authorizedUser = MockData.getCamsUser({ @@ -66,22 +59,11 @@ describe('Orders use case', () => { beforeEach(async () => { mockContext = await createMockApplicationContext(); mockContext.session = await createMockApplicationContextSession({ user: authorizedUser }); - ordersGateway = getOrdersGateway(mockContext); - runtimeStateRepo = getRuntimeStateRepository(mockContext); ordersRepo = getOrdersRepository(mockContext); casesRepo = getCasesRepository(mockContext); casesGateway = getCasesGateway(mockContext); consolidationRepo = getConsolidationOrdersRepository(mockContext); - storageGateway = getStorageGateway(mockContext); - useCase = new OrdersUseCase( - casesRepo, - casesGateway, - ordersRepo, - ordersGateway, - runtimeStateRepo, - consolidationRepo, - storageGateway, - ); + useCase = new OrdersUseCase(mockContext); }); afterEach(() => { @@ -649,7 +631,15 @@ describe('Orders use case', () => { test('should fail to update to a legacy office', async () => { const courtDivisionCode = '000'; - jest.spyOn(factory, 'getStorageGateway').mockImplementation(() => { + + let Factory; + await jest.isolateModulesAsync(async () => { + Factory = await import('../../factory'); + ordersRepo = Factory.getOrdersRepository(mockContext); + casesRepo = Factory.getCasesRepository(mockContext); + }); + + jest.spyOn(Factory, 'getStorageGateway').mockImplementation(() => { return { get: jest.fn(), getRoleMapping: jest.fn(), @@ -660,15 +650,7 @@ describe('Orders use case', () => { }; }); - const localUseCase = new OrdersUseCase( - casesRepo, - casesGateway, - ordersRepo, - ordersGateway, - runtimeStateRepo, - consolidationRepo, - factory.getStorageGateway(mockContext), - ); + const localUseCase = new OrdersUseCase(mockContext); const newCase = MockData.getCaseSummary({ override: { courtDivisionCode } }); const order: TransferOrder = MockData.getTransferOrder({ diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 53afb75f5..63e3f1cfc 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -1,11 +1,4 @@ -import { - OrderSyncState, - OrdersGateway, - RuntimeStateRepository, - CasesRepository, - ConsolidationOrdersRepository, - OrdersRepository, -} from '../gateways.types'; +import { OrderSyncState } from '../gateways.types'; import { ApplicationContext } from '../../adapters/types/basic'; import { ConsolidationOrder, @@ -29,7 +22,6 @@ import { TransferTo, } from '../../../../../common/src/cams/events'; import { CaseSummary } from '../../../../../common/src/cams/cases'; -import { CasesInterface } from '../cases.interface'; import { CamsError } from '../../common-errors/cams-error'; import { sortDates, sortDatesReverse } from '../../../../../common/src/date-helper'; import * as crypto from 'crypto'; @@ -47,9 +39,9 @@ import { UnauthorizedError } from '../../common-errors/unauthorized-error'; import { createAuditRecord } from '../../../../../common/src/cams/auditable'; import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; import { isNotFoundError } from '../../common-errors/not-found-error'; -import { StorageGateway } from '../../adapters/types/storage'; import { AcmsConsolidation } from '../../../poc/model'; import { randomUUID } from 'crypto'; +import { Factory } from '../../factory'; const MODULE_NAME = 'ORDERS_USE_CASE'; @@ -69,48 +61,32 @@ export interface SyncOrdersStatus { export interface ImportConsolidationOptions {} export class OrdersUseCase { - private readonly casesRepo: CasesRepository; - private readonly casesGateway: CasesInterface; - private readonly ordersGateway: OrdersGateway; - private readonly ordersRepo: OrdersRepository; - private readonly consolidationsRepo: ConsolidationOrdersRepository; - private readonly runtimeStateRepo: RuntimeStateRepository; - private readonly storageGateway: StorageGateway; - - constructor( - casesRepo: CasesRepository, - casesGateway: CasesInterface, - ordersRepo: OrdersRepository, - ordersGateway: OrdersGateway, - runtimeRepo: RuntimeStateRepository, - consolidationRepo: ConsolidationOrdersRepository, - storageGateway: StorageGateway, - ) { - this.casesRepo = casesRepo; - this.casesGateway = casesGateway; - this.ordersRepo = ordersRepo; - this.ordersGateway = ordersGateway; - this.runtimeStateRepo = runtimeRepo; - this.consolidationsRepo = consolidationRepo; - this.storageGateway = storageGateway; + private readonly context: ApplicationContext; + + constructor(context: ApplicationContext) { + this.context = context; } public async getOrders(context: ApplicationContext): Promise> { + const ordersRepo = Factory.getOrdersRepository(this.context); + const consolidationsRepo = Factory.getConsolidationOrdersRepository(this.context); + let predicate: OrdersSearchPredicate = undefined; if (context.session) { const divisionCodes = getCourtDivisionCodes(context.session.user); predicate = { divisionCodes }; } - const transferOrders = await this.ordersRepo.search(predicate); - const consolidationOrders = await this.consolidationsRepo.search(predicate); + const transferOrders = await ordersRepo.search(predicate); + const consolidationOrders = await consolidationsRepo.search(predicate); return transferOrders .concat(consolidationOrders) .sort((a, b) => sortDates(a.orderDate, b.orderDate)); } public async getSuggestedCases(context: ApplicationContext): Promise> { + const casesGateway = Factory.getCasesGateway(this.context); const caseId = context.request.params.caseId; - return this.casesGateway.getSuggestedCases(context, caseId); + return casesGateway.getSuggestedCases(context, caseId); } public async updateTransferOrder( @@ -122,7 +98,11 @@ export class OrdersUseCase { throw new UnauthorizedError(MODULE_NAME); } - const divisionMeta = this.storageGateway.getUstpDivisionMeta(); + const storageGateway = Factory.getStorageGateway(this.context); + const ordersRepo = Factory.getOrdersRepository(this.context); + const casesRepo = Factory.getCasesRepository(this.context); + + const divisionMeta = storageGateway.getUstpDivisionMeta(); const divisionCodeMaybe = data['newCase'] ? data['newCase'].courtDivisionCode : null; if ( divisionCodeMaybe && @@ -135,11 +115,11 @@ export class OrdersUseCase { } context.logger.info(MODULE_NAME, 'Updating transfer order:', data); - const initialOrder = await this.ordersRepo.read(id, data.caseId); + const initialOrder = await ordersRepo.read(id, data.caseId); let order: Order; if (isTransferOrder(initialOrder)) { - await this.ordersRepo.update(data); - order = await this.ordersRepo.read(id, data.caseId); + await ordersRepo.update(data); + order = await ordersRepo.read(id, data.caseId); } if (isTransferOrder(order)) { if (order.status === 'approved') { @@ -157,8 +137,8 @@ export class OrdersUseCase { documentType: 'TRANSFER_TO', }; - await this.casesRepo.createTransferFrom(transferFrom); - await this.casesRepo.createTransferTo(transferTo); + await casesRepo.createTransferFrom(transferFrom); + await casesRepo.createTransferTo(transferTo); } const caseHistory = createAuditRecord( { @@ -169,7 +149,7 @@ export class OrdersUseCase { }, context.session?.user, ); - await this.casesRepo.createCaseHistory(caseHistory); + await casesRepo.createCaseHistory(caseHistory); } } @@ -211,8 +191,14 @@ export class OrdersUseCase { options?: SyncOrdersOptions, ): Promise { let initialSyncState: OrderSyncState; + const runtimeStateRepo = Factory.getOrderSyncStateRepo(context); + const ordersGateway = Factory.getOrdersGateway(context); + const ordersRepo = Factory.getOrdersRepository(context); + const casesRepo = Factory.getCasesRepository(context); + const consolidationsRepo = Factory.getConsolidationOrdersRepository(context); + try { - initialSyncState = await this.runtimeStateRepo.read('ORDERS_SYNC_STATE', ''); + initialSyncState = await runtimeStateRepo.read('ORDERS_SYNC_STATE', ''); context.logger.info( MODULE_NAME, 'Got initial runtime state from repo (Cosmos).', @@ -235,7 +221,7 @@ export class OrdersUseCase { documentType: 'ORDERS_SYNC_STATE', txId: options.txIdOverride, }; - initialSyncState = await this.runtimeStateRepo.upsert(initialSyncState); + initialSyncState = await runtimeStateRepo.upsert(initialSyncState); context.logger.info( MODULE_NAME, 'Wrote new runtime state to repo (Cosmos).', @@ -247,12 +233,12 @@ export class OrdersUseCase { } const startingTxId = options?.txIdOverride ?? initialSyncState.txId; - const { consolidations, transfers, maxTxId } = await this.ordersGateway.getOrderSync( + const { consolidations, transfers, maxTxId } = await ordersGateway.getOrderSync( context, startingTxId, ); - const writtenTransfers = await this.ordersRepo.createMany(transfers); + const writtenTransfers = await ordersRepo.createMany(transfers); for (const order of writtenTransfers) { if (isTransferOrder(order)) { @@ -265,7 +251,7 @@ export class OrdersUseCase { }, context.session?.user, ); - await this.casesRepo.createCaseHistory(caseHistory); + await casesRepo.createCaseHistory(caseHistory); } } @@ -275,7 +261,7 @@ export class OrdersUseCase { }); const consolidationsByJobId = await this.mapConsolidations(context, consolidations); - await this.consolidationsRepo.createMany(Array.from(consolidationsByJobId.values())); + await consolidationsRepo.createMany(Array.from(consolidationsByJobId.values())); for (const order of consolidations) { const history: ConsolidationOrderSummary = { @@ -291,11 +277,11 @@ export class OrdersUseCase { }, context.session?.user, ); - await this.casesRepo.createCaseHistory(caseHistory); + await casesRepo.createCaseHistory(caseHistory); } const finalSyncState = { ...initialSyncState, txId: maxTxId }; - await this.runtimeStateRepo.upsert(finalSyncState); + await runtimeStateRepo.upsert(finalSyncState); context.logger.info(MODULE_NAME, 'Updated runtime state in repo (Cosmos)', finalSyncState); return { @@ -345,7 +331,8 @@ export class OrdersUseCase { if (leadCase) after.leadCase = leadCase; let before; try { - const fullHistory = await this.casesRepo.getCaseHistory(bCase.caseId); + const casesRepo = Factory.getCasesRepository(context); + const fullHistory = await casesRepo.getCaseHistory(bCase.caseId); before = fullHistory .filter((h) => h.documentType === 'AUDIT_CONSOLIDATION') .sort((a, b) => sortDatesReverse(a.updatedOn, b.updatedOn)) @@ -384,16 +371,18 @@ export class OrdersUseCase { includedCases.includes(c.caseId), ); + const casesRepo = Factory.getCasesRepository(context); + const consolidationsRepo = Factory.getConsolidationOrdersRepository(context); if (status === 'approved') { for (const caseId of includedCases) { - const references = await this.casesRepo.getConsolidation(caseId); + const references = await casesRepo.getConsolidation(caseId); if (references.length > 0) { throw new BadRequestError(MODULE_NAME, { message: `Cannot consolidate order. A child case has already been consolidated.`, }); } } - const leadCaseReferences = await this.casesRepo.getConsolidation(leadCase.caseId); + const leadCaseReferences = await casesRepo.getConsolidation(leadCase.caseId); const isLeadCaseAChildCase = leadCaseReferences .filter((reference) => reference.caseId === leadCase.caseId) .reduce((isChildCase, reference) => { @@ -429,19 +418,19 @@ export class OrdersUseCase { childCases: remainingChildCases, id: undefined, }; - const updatedRemainingOrder = await this.consolidationsRepo.create(remainingOrder); + const updatedRemainingOrder = await consolidationsRepo.create(remainingOrder); response.push(updatedRemainingOrder as ConsolidationOrder); } - await this.consolidationsRepo.delete(provisionalOrder.id); + await consolidationsRepo.delete(provisionalOrder.id); - const createdConsolidation = await this.consolidationsRepo.create(newConsolidation); + const createdConsolidation = await consolidationsRepo.create(newConsolidation); response.push(createdConsolidation as ConsolidationOrder); for (const childCase of newConsolidation.childCases) { if (!leadCase || childCase.caseId !== leadCase.caseId) { const caseHistory = await this.buildHistory(context, childCase, status, [], leadCase); - await this.casesRepo.createCaseHistory(caseHistory); + await casesRepo.createCaseHistory(caseHistory); } } @@ -466,7 +455,7 @@ export class OrdersUseCase { consolidationType: newConsolidation.consolidationType, documentType: 'CONSOLIDATION_TO', }; - await this.casesRepo.createConsolidationTo(consolidationTo); + await casesRepo.createConsolidationTo(consolidationTo); // Add the reference to the child case to the lead case. const consolidationFrom: ConsolidationFrom = { @@ -476,7 +465,7 @@ export class OrdersUseCase { consolidationType: newConsolidation.consolidationType, documentType: 'CONSOLIDATION_FROM', }; - await this.casesRepo.createConsolidationFrom(consolidationFrom); + await casesRepo.createConsolidationFrom(consolidationFrom); // Assign lead case attorneys to the child case. await assignmentUseCase.createTrialAttorneyAssignments( @@ -500,7 +489,7 @@ export class OrdersUseCase { status, childCaseSummaries, ); - await this.casesRepo.createCaseHistory(leadCaseHistory); + await casesRepo.createCaseHistory(leadCaseHistory); } return response; @@ -524,7 +513,8 @@ export class OrdersUseCase { const maybeLeadCaseId = order.leadCaseIdHint ?? undefined; if (maybeLeadCaseId && !caseMap.has(maybeLeadCaseId) && !notFound.has(maybeLeadCaseId)) { try { - const maybeLeadCase = await this.casesGateway.getCaseSummary(context, maybeLeadCaseId); + const casesGateway = Factory.getCasesGateway(context); + const maybeLeadCase = await casesGateway.getCaseSummary(context, maybeLeadCaseId); if (maybeLeadCase) { caseMap.set(maybeLeadCaseId, { ...maybeLeadCase, From 62ea22792cb6fe6911f6d0e70ce46d0c89a0c918 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Mon, 18 Nov 2024 17:34:59 -0700 Subject: [PATCH 008/112] WIP: Fleshing out implementation of Acms Consolidations Building out use case, controllers, and Acms Gateway and tests Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../adapters/gateways/acms/acms.gateway.ts | 26 ++++++ .../orders/orders.controller.test.ts | 65 +++++++++++++++ .../controllers/orders/orders.controller.ts | 23 ++++-- backend/functions/lib/factory.ts | 11 +++ .../use-cases/acms-orders/acms-orders.test.ts | 82 +++++++++++++++++++ .../lib/use-cases/acms-orders/acms-orders.ts | 62 ++++++++++++++ .../functions/lib/use-cases/gateways.types.ts | 9 ++ .../functions/lib/use-cases/orders/orders.ts | 54 ------------ .../poc/activity/flattenBoundingArrays.ts | 2 +- .../poc/activity/getConsolidations.ts | 2 +- .../functions/poc/activity/getPageCount.ts | 2 +- .../poc/activity/transformAndLoad.ts | 2 +- backend/functions/poc/model.ts | 21 ----- .../poc/orchestration/orchestrator.ts | 2 +- .../poc/orchestration/sub-orchestrator-etl.ts | 2 +- .../orchestration/sub-orchestrator-paging.ts | 2 +- 16 files changed, 279 insertions(+), 88 deletions(-) create mode 100644 backend/functions/lib/adapters/gateways/acms/acms.gateway.ts create mode 100644 backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts create mode 100644 backend/functions/lib/use-cases/acms-orders/acms-orders.ts delete mode 100644 backend/functions/poc/model.ts diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts new file mode 100644 index 000000000..7648d2b8d --- /dev/null +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -0,0 +1,26 @@ +import { + Predicate, + PredicateAndPage, + AcmsConsolidation, +} from '../../../use-cases/acms-orders/acms-orders'; +import { AcmsGateway } from '../../../use-cases/gateways.types'; +import { ApplicationContext } from '../../types/basic'; + +const _MODULE_NAME = 'ACMS_GATEWAY'; + +export class AcmsGatewayImpl implements AcmsGateway { + constructor(_context: ApplicationContext) { + // TODO: setup database connection + } + + async getPageCount(_context: ApplicationContext, _predicate: Predicate): Promise { + throw Error('getPageCount Not Implemented'); + } + + async getConsolidationOrders( + _context: ApplicationContext, + _predicateAndPage: PredicateAndPage, + ): Promise { + throw Error('getConsolidationOrders Not Implemented'); + } +} diff --git a/backend/functions/lib/controllers/orders/orders.controller.test.ts b/backend/functions/lib/controllers/orders/orders.controller.test.ts index 875b54e4c..01dcdec80 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.test.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.test.ts @@ -22,6 +22,7 @@ import { ResponseBody } from '../../../../../common/src/api/response'; import { NotFoundError } from '../../common-errors/not-found-error'; import { BadRequestError } from '../../common-errors/bad-request'; import * as crypto from 'crypto'; +import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; const syncResponse: SyncOrdersStatus = { options: { @@ -255,6 +256,70 @@ describe('orders controller tests', () => { await expect(controller.approveConsolidation(applicationContext)).rejects.toThrow(CamsError); }); + + test('should return ACMS Order Consolidations page count', async () => { + jest.spyOn(AcmsOrders.prototype, 'getPageCount').mockResolvedValue(5); + const predicate: Predicate = { + divisionCode: '000', + chapter: '00', + dateRange: ['2020-01-01', '2021-01-01'], + }; + + const controller = new OrdersController(applicationContext); + + const actual = await controller.handlePageCount(applicationContext, predicate); + + expect(actual).toEqual(5); + }); + + test('should return ACMS Order Consolidation array when calling getConsolidationOrders', async () => { + const mockAcmsConsolidationArray = MockData.buildArray( + () => ({ + orderId: MockData.randomCaseId(), + caseId: MockData.randomCaseId(), + }), + 3, + ); + const predicate: PredicateAndPage = { + divisionCode: '000', + chapter: '00', + dateRange: ['2020-01-01', '2021-01-01'], + pageNumber: 1, + }; + + jest + .spyOn(AcmsOrders.prototype, 'getConsolidationOrders') + .mockResolvedValue(mockAcmsConsolidationArray); + + const controller = new OrdersController(applicationContext); + + const actual = await controller.handleGetLegacyConsolidationOrders( + applicationContext, + predicate, + ); + + expect(actual).toEqual(mockAcmsConsolidationArray); + }); + + test('should return Order Consolidation with camsId', async () => { + const originalOrder = { + orderId: '123', + caseId: '12-34567', + }; + const newOrder = { + ...originalOrder, + camsId: crypto.randomUUID(), + }; + jest + .spyOn(AcmsOrders.prototype, 'migrateExistingConsolidation') + .mockResolvedValue(newOrder as unknown as ConsolidationOrder); + + const controller = new OrdersController(applicationContext); + + const actual = await controller.handleMigration(applicationContext, originalOrder); + + expect(actual).toEqual(newOrder); + }); }); describe('orders controller exception tests', () => { diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index 07b31e107..b8f4e691c 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -17,7 +17,11 @@ import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; import { closeDeferred } from '../../defer-close'; -import { AcmsConsolidation, PredicateAndPage } from '../../../poc/model'; +import AcmsOrders, { + AcmsConsolidation, + Predicate, + PredicateAndPage, +} from '../../use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'ORDERS-CONTROLLER'; @@ -72,15 +76,22 @@ export class OrdersController implements CamsController, CamsTimerController { context: ApplicationContext, existing: AcmsConsolidation, ): Promise { - return this.useCase.migrateExistingConsolidation(existing, context); + const useCase = new AcmsOrders(); + return useCase.migrateExistingConsolidation(existing, context); } - public async handlePageCount( + public async handlePageCount(context: ApplicationContext, predicate: Predicate): Promise { + // TODO: Reconcile the argument type + const useCase = new AcmsOrders(); + return useCase.getPageCount(context, predicate); + } + + public async handleGetLegacyConsolidationOrders( context: ApplicationContext, predicate: PredicateAndPage, - ): Promise { - // TODO: Reconcile the argument type - return this.useCase.getConsolidationPageCount(context, predicate); + ): Promise { + const useCase = new AcmsOrders(); + return useCase.getConsolidationOrders(context, predicate); } private async handleOrders(context: ApplicationContext) { diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index 85131fb86..3d07fc091 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -9,6 +9,7 @@ import { DxtrCaseDocketGateway } from './adapters/gateways/dxtr/case-docket.dxtr import { MockCaseDocketGateway } from './adapters/gateways/dxtr/case-docket.mock.gateway'; import { ConnectionPool, config } from 'mssql'; import { + AcmsGateway, CaseAssignmentRepository, CasesRepository, ConsolidationOrdersRepository, @@ -43,6 +44,7 @@ import { MockMongoRepository } from './testing/mock-gateways/mock-mongo.reposito import { RuntimeStateMongoRepository } from './adapters/gateways/mongo/runtime-state.mongo.repository'; import { UserSessionCacheMongoRepository } from './adapters/gateways/mongo/user-session-cache.mongo.repository'; import { MockOfficesRepository } from './testing/mock-gateways/mock.offices.repository'; +import { AcmsGatewayImpl } from './adapters/gateways/acms/acms.gateway'; let casesRepo: CasesRepository; let casesGateway: CasesInterface; @@ -51,6 +53,7 @@ let ordersRepo: OrdersRepository; let consolidationsRepo: ConsolidationOrdersRepository; let orderSyncStateRepo: RuntimeStateRepository; let storageGateway: StorageGateway; +let acmsGateway: AcmsGateway; export const getAttorneyGateway = (): AttorneyGatewayInterface => { return MockAttorneysGateway; @@ -200,7 +203,15 @@ export const getUserGroupGateway = (_context: ApplicationContext): UserGroupGate return OktaUserGroupGateway; }; +const getAcmsGateway = (applicationContext: ApplicationContext): AcmsGateway => { + if (!acmsGateway) { + acmsGateway = new AcmsGatewayImpl(applicationContext); + } + return acmsGateway; +}; + export const Factory = { + getAcmsGateway, getAttorneyGateway, getCasesGateway, getAssignmentRepository, diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts new file mode 100644 index 000000000..2ebb107a0 --- /dev/null +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -0,0 +1,82 @@ +import Factory from '../../factory'; +import { createMockApplicationContext } from '../../testing/testing-utilities'; +import { AcmsGateway } from '../gateways.types'; +import AcmsOrders, { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders'; + +const mockAcmsGateway: AcmsGateway = { + getPageCount: function (..._ignore): Promise { + throw new Error('Function not implemented.'); + }, + getConsolidationOrders: function (..._ignore): Promise { + throw new Error('Function not implemented.'); + }, +}; + +describe('ACMS Orders', () => { + let context; + + beforeAll(async () => { + context = createMockApplicationContext(); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + test('should return a page count', async () => { + const expected = 5; + const getPageCount = jest.spyOn(mockAcmsGateway, 'getPageCount').mockResolvedValue(expected); + jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); + + const predicate: Predicate = { + divisionCode: '000', + chapter: '00', + dateRange: ['2020-01-01', '2021-01-01'], + }; + const useCase = new AcmsOrders(); + const actual = await useCase.getPageCount(context, predicate); + + expect(getPageCount).toHaveBeenCalledWith(context, predicate); + expect(actual).toEqual(expected); + }); + + test('should return a page of consolidation orders', async () => { + const expected: AcmsConsolidation[] = [{ caseId: '00-00000', orderId: '' }]; + const getConsolidationOrders = jest + .spyOn(mockAcmsGateway, 'getConsolidationOrders') + .mockResolvedValue(expected); + jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); + + const predicateAndPage: PredicateAndPage = { + divisionCode: '000', + chapter: '00', + dateRange: ['2020-01-01', '2021-01-01'], + pageNumber: 1, + }; + + const useCase = new AcmsOrders(); + const actual = await useCase.getConsolidationOrders(context, predicateAndPage); + + expect(getConsolidationOrders).toHaveBeenCalledWith(context, predicateAndPage); + expect(actual).toEqual(expected); + }); + + test('should handle exceptions', async () => { + jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); + const useCase = new AcmsOrders(); + + const predicate: Predicate = { + divisionCode: '000', + chapter: '00', + dateRange: ['2020-01-01', '2021-01-01'], + }; + + const predicateAndPage: PredicateAndPage = { + ...predicate, + pageNumber: 1, + }; + + await expect(useCase.getPageCount(context, predicate)).rejects.toThrow(); + await expect(useCase.getConsolidationOrders(context, predicateAndPage)).rejects.toThrow(); + }); +}); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts new file mode 100644 index 000000000..157e4e0c7 --- /dev/null +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -0,0 +1,62 @@ +import { ApplicationContext } from '../../adapters/types/basic'; +import Factory from '../../factory'; +import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; +import { randomUUID } from 'crypto'; + +const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; + +export type Bounds = { + divisionCodes: string[]; + chapters: string[]; + dateRange: [string, string]; +}; + +export type Predicate = { + divisionCode: string; + chapter: string; + dateRange: [string, string]; +}; + +export type PredicateAndPage = Predicate & { + pageNumber: number; +}; + +// properties here are temporary. Need to figure out what this type should look like. +export type AcmsConsolidation = { + orderId: string; + caseId: string; +}; + +export class AcmsOrders { + public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + const gateway = Factory.getAcmsGateway(context); + return gateway.getPageCount(context, predicate); + } + + public async getConsolidationOrders( + context: ApplicationContext, + predicateAndPage: PredicateAndPage, + ): Promise { + const gateway = Factory.getAcmsGateway(context); + return gateway.getConsolidationOrders(context, predicateAndPage); + } + + public async migrateExistingConsolidation( + existing: AcmsConsolidation, + context: ApplicationContext, + ): Promise { + // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. + context.logger.info(MODULE_NAME, 'Transform and load', existing); + const newOrder = { + ...existing, + camsId: randomUUID(), + }; + context.logger.info( + MODULE_NAME, + `Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`, + ); + return newOrder as unknown as ConsolidationOrder; + } +} + +export default AcmsOrders; diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index 3ac1f0d87..30821abd5 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -19,6 +19,7 @@ import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; +import { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders/acms-orders'; interface Creates { create(data: T): Promise; @@ -89,6 +90,14 @@ export interface OrdersGateway { getOrderSync(context: ApplicationContext, txId: string): Promise; } +export interface AcmsGateway { + getPageCount(context: ApplicationContext, predicate: Predicate): Promise; + getConsolidationOrders( + context: ApplicationContext, + predicateAndPage: PredicateAndPage, + ): Promise; +} + export interface CasesRepository { createTransferFrom(reference: TransferFrom): Promise; createTransferTo(reference: TransferTo): Promise; diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 63e3f1cfc..d4197dfdb 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -39,8 +39,6 @@ import { UnauthorizedError } from '../../common-errors/unauthorized-error'; import { createAuditRecord } from '../../../../../common/src/cams/auditable'; import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; import { isNotFoundError } from '../../common-errors/not-found-error'; -import { AcmsConsolidation } from '../../../poc/model'; -import { randomUUID } from 'crypto'; import { Factory } from '../../factory'; const MODULE_NAME = 'ORDERS_USE_CASE'; @@ -58,8 +56,6 @@ export interface SyncOrdersStatus { maxTxId: string; } -export interface ImportConsolidationOptions {} - export class OrdersUseCase { private readonly context: ApplicationContext; @@ -153,39 +149,6 @@ export class OrdersUseCase { } } - // TODO: Reconcile the argument type. For migrateExistingConsolidation I went with bringing in the - // AcmsConsolidation type, but it would be better for the type to be owned by the use case. I'm - // not sure we want one Options type for all related methods though. - public async getConsolidationPageCount( - context: ApplicationContext, - _options?: ImportConsolidationOptions, - ): Promise { - try { - //const pageCount = await this.legacyDatabaseRepo.read('', ''); - //context.logger.info(MODULE_NAME, 'Got page count for import from repo.', pageCount); - //return pageCount; - } catch (error) { - const message = 'Failed to get page count for consolidation import from repo.'; - context.logger.info(MODULE_NAME, message, error); - throw new CamsError(MODULE_NAME, { message }); - } - return 0; - } - - public async importConsolidationData( - context: ApplicationContext, - _options?: ImportConsolidationOptions, - ): Promise { - try { - //const consolidations = await this.legacyDatabaseRepo.read('', ''); - } catch (error) { - const message = 'Failed to get consolidation data from repo.'; - context.logger.info(MODULE_NAME, message, error); - throw new CamsError(MODULE_NAME, { message }); - } - return; - } - public async syncOrders( context: ApplicationContext, options?: SyncOrdersOptions, @@ -547,21 +510,4 @@ export class OrdersUseCase { }); return consolidationsByJobId; } - - public async migrateExistingConsolidation( - existing: AcmsConsolidation, - context: ApplicationContext, - ): Promise { - // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - context.logger.info(MODULE_NAME, 'Transform and load', existing); - const newOrder = { - ...existing, - camsId: randomUUID(), - }; - context.logger.info( - MODULE_NAME, - `Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`, - ); - return newOrder as unknown as ConsolidationOrder; - } } diff --git a/backend/functions/poc/activity/flattenBoundingArrays.ts b/backend/functions/poc/activity/flattenBoundingArrays.ts index 6e8d16d63..27c1ced43 100644 --- a/backend/functions/poc/activity/flattenBoundingArrays.ts +++ b/backend/functions/poc/activity/flattenBoundingArrays.ts @@ -1,5 +1,5 @@ -import { Bounds, Predicate } from '../model'; import { InvocationContext } from '@azure/functions'; +import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; async function flattenBoundingArrays( bounds: Bounds, diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/poc/activity/getConsolidations.ts index 80404d37a..b9f73e663 100644 --- a/backend/functions/poc/activity/getConsolidations.ts +++ b/backend/functions/poc/activity/getConsolidations.ts @@ -1,5 +1,5 @@ import { InvocationContext } from '@azure/functions'; -import { PredicateAndPage } from '../model'; +import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; async function getConsolidations(input: PredicateAndPage, context: InvocationContext) { // Do some stuff diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts index 0eef6eecb..883f6c642 100644 --- a/backend/functions/poc/activity/getPageCount.ts +++ b/backend/functions/poc/activity/getPageCount.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; -import { PredicateAndPage } from '../model'; import ContextCreator from '../../azure/application-context-creator'; import { CamsError } from '../../lib/common-errors/cams-error'; import { OrdersController } from '../../lib/controllers/orders/orders.controller'; +import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; diff --git a/backend/functions/poc/activity/transformAndLoad.ts b/backend/functions/poc/activity/transformAndLoad.ts index fc2a671aa..13cee9211 100644 --- a/backend/functions/poc/activity/transformAndLoad.ts +++ b/backend/functions/poc/activity/transformAndLoad.ts @@ -1,7 +1,7 @@ import { InvocationContext } from '@azure/functions'; -import { AcmsConsolidation } from '../model'; import ContextCreator from '../../azure/application-context-creator'; import { OrdersController } from '../../lib/controllers/orders/orders.controller'; +import { AcmsConsolidation } from '../../lib/use-cases/acms-orders/acms-orders'; async function transformAndLoad(input: AcmsConsolidation, invocationContext: InvocationContext) { // Do some stuff diff --git a/backend/functions/poc/model.ts b/backend/functions/poc/model.ts deleted file mode 100644 index 39446224b..000000000 --- a/backend/functions/poc/model.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type Bounds = { - divisionCodes: string[]; - chapters: string[]; - dateRange: [string, string]; -}; - -export type Predicate = { - divisionCode: string; - chapter: string; - dateRange: [string, string]; -}; - -export type PredicateAndPage = Predicate & { - pageNumber: number; -}; - -// properties here are temporary. Need to figure out what this type should look like. -export type AcmsConsolidation = { - orderId: string; - caseId: string; -}; diff --git a/backend/functions/poc/orchestration/orchestrator.ts b/backend/functions/poc/orchestration/orchestrator.ts index 54657abf6..5c2fe7f84 100644 --- a/backend/functions/poc/orchestration/orchestrator.ts +++ b/backend/functions/poc/orchestration/orchestrator.ts @@ -1,4 +1,4 @@ -import { Bounds, Predicate } from '../model'; +import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; import { FLATTEN_BOUNDING_ARRAYS, SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts index 3dee221dc..202eab4a5 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts @@ -1,5 +1,5 @@ +import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import { CONSOLIDATIONS_FROM_ACMS, TRANSFORM_AND_LOAD } from '../loadConsolidations'; -import { PredicateAndPage } from '../model'; import { OrchestrationContext } from 'durable-functions'; export function* subOrchestratorETL(context: OrchestrationContext) { diff --git a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts index 7dc10803c..dedc59d79 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts @@ -1,6 +1,6 @@ -import { Predicate, PredicateAndPage } from '../model'; import { OrchestrationContext } from 'durable-functions'; import { PAGE_COUNT_ACTIVITY, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; +import { Predicate, PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; export function* subOrchestratorPaging(context: OrchestrationContext) { const predicate: Predicate = context.df.getInput(); From 0fb14502d82bd9cd71eef86fa648b2464f96e5d9 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:04:51 -0500 Subject: [PATCH 009/112] WIP - Implement ACMS Gateway Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/acms/acms.gateway.test.ts | 38 +++++ .../adapters/gateways/acms/acms.gateway.ts | 53 +++++- .../functions/lib/adapters/gateways/mssql.ts | 112 +++++++++++++ .../lib/configs/application-configuration.ts | 54 ++++++- .../acms-orders.controller.test.ts | 1 + .../acms-orders/acms-orders.controller.ts | 32 ++++ .../orders/orders.controller.test.ts | 2 - .../controllers/orders/orders.controller.ts | 27 ---- .../use-cases/acms-orders/acms-orders.test.ts | 3 - .../lib/use-cases/acms-orders/acms-orders.ts | 8 +- .../poc/activity/flattenBoundingArrays.ts | 1 - .../poc/activity/getConsolidations.ts | 13 +- .../functions/poc/activity/getPageCount.ts | 6 +- .../poc/orchestration/sub-orchestrator-etl.ts | 13 +- ops/cloud-deployment/backend-api-deploy.bicep | 151 ++++++++++-------- 15 files changed, 385 insertions(+), 129 deletions(-) create mode 100644 backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts create mode 100644 backend/functions/lib/adapters/gateways/mssql.ts create mode 100644 backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts create mode 100644 backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts new file mode 100644 index 000000000..05b484aa5 --- /dev/null +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -0,0 +1,38 @@ +import { AbstractDbClient } from '../mssql'; +import { AcmsGatewayImpl } from './acms.gateway'; +import { createMockApplicationContext } from '../../../testing/testing-utilities'; +import { Predicate } from '../../../use-cases/acms-orders/acms-orders'; + +describe('ACMS gateway tests', () => { + const pageCountCases = [ + { leadCaseCount: 245, pageCount: 5 }, + { leadCaseCount: 250, pageCount: 5 }, + { leadCaseCount: 251, pageCount: 6 }, + ]; + test.each(pageCountCases)( + 'should execute query and calculate page count for $leadCaseCount consolidations', + async (params: { leadCaseCount: number; pageCount: number }) => { + const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + success: true, + results: [{ leadCaseCount: params.leadCaseCount }], + message: '', + }); + const predicate: Predicate = { + chapter: '15', + divisionCode: '081', + }; + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + const result = await gateway.getPageCount(context, predicate); + expect(spy).toHaveBeenCalledWith( + context, + expect.any(String), + expect.arrayContaining([ + expect.objectContaining({ name: 'chapter', value: predicate.chapter }), + expect.objectContaining({ name: 'divisionCode', value: predicate.divisionCode }), + ]), + ); + expect(result).toEqual(params.pageCount); + }, + ); +}); diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 7648d2b8d..acc097269 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -1,3 +1,4 @@ +import * as mssql from 'mssql'; import { Predicate, PredicateAndPage, @@ -5,16 +6,56 @@ import { } from '../../../use-cases/acms-orders/acms-orders'; import { AcmsGateway } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; +import { AbstractDbClient } from '../mssql'; +import { getCamsError } from '../../../common-errors/error-utilities'; +import { DbTableFieldSpec } from '../../types/database'; -const _MODULE_NAME = 'ACMS_GATEWAY'; +const MODULE_NAME = 'ACMS_GATEWAY'; +const PAGE_SIZE = 50; -export class AcmsGatewayImpl implements AcmsGateway { - constructor(_context: ApplicationContext) { - // TODO: setup database connection +export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { + constructor(context: ApplicationContext) { + // The context carries different database connection configurations. + // We pick off the configuration specific to this ACMS gateway. + const config = context.config.acmsDbConfig; + super(context, config, MODULE_NAME); } - async getPageCount(_context: ApplicationContext, _predicate: Predicate): Promise { - throw Error('getPageCount Not Implemented'); + async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + const input: DbTableFieldSpec[] = []; + + // TODO: map from string chapters that accept numbers to be two character strings + // 09, 11, 12, 13, 15, 7A, 7N, AC + input.push({ + name: 'chapter', + type: mssql.VarChar, + value: predicate.chapter, + }); + + input.push({ + name: 'divisionCode', + type: mssql.VarChar, + value: predicate.divisionCode, + }); + + type ResultType = { + leadCaseCount: number; + }; + + const query = `SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) as leadCaseCount + from CMMDB + where CURR_CASE_CHAPT = @chapter + and CASE_DIV = @divisionCode + and CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' + and CONSOLIDATED_CASE_NUMBER != '0'`; + + try { + const results = await this.executeQuery(context, query, input); + const result = results.results[0]; + return result.leadCaseCount ? Math.ceil(result.leadCaseCount / PAGE_SIZE) : 0; + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } } async getConsolidationOrders( diff --git a/backend/functions/lib/adapters/gateways/mssql.ts b/backend/functions/lib/adapters/gateways/mssql.ts new file mode 100644 index 000000000..2dc0c840b --- /dev/null +++ b/backend/functions/lib/adapters/gateways/mssql.ts @@ -0,0 +1,112 @@ +import { config, ConnectionError, ConnectionPool, MSSQLError, IResult } from 'mssql'; +import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; +import { Closable, deferClose } from '../../defer-close'; +import { ApplicationContext } from '../types/basic'; + +export abstract class AbstractDbClient implements Closable { + private connectionPool: ConnectionPool; + private readonly moduleName: string; + + protected constructor(context: ApplicationContext, config: IDbConfig, childModuleName: string) { + this.moduleName = `MSSQL-ABSTRACT-DB-CLIENT (${childModuleName})`; + this.setupConnectionPool(config); + deferClose(context, this); + } + + private setupConnectionPool = (databaseConfig: IDbConfig) => { + this.connectionPool = new ConnectionPool(databaseConfig as config); + }; + + async executeQuery( + context: ApplicationContext, + query: string, + input?: DbTableFieldSpec[], + ): Promise { + // we should do some sanitization here to eliminate sql injection issues + try { + const connection = await this.connectionPool.connect(); + const request = connection.request(); + + if (typeof input != 'undefined') { + input.forEach((item) => { + request.input(item.name, item.type, item.value); + }); + } + const result = (await request.query(query)) as IResult; + + const queryResults: QueryResults = { + results: result.recordset, + message: '', + success: true, + }; + + context.logger.info(this.moduleName, 'Closing connection.'); + + await connection.close(); + + return queryResults; + } catch (error) { + if (isConnectionError(error)) { + const errorMessages = []; + // No recursive function here. Limiting this to just 2 "errors" lists deep. + if (isAggregateError(error.originalError)) { + error.originalError.errors.reduce((acc, e) => { + if (isAggregateError(e)) { + e.errors.forEach((lowestE) => { + acc.push(lowestE.message); + }); + } else { + acc.push(e.message); + } + return acc; + }, errorMessages); + } + errorMessages.push(error.message); + context.logger.error(this.moduleName, 'ConnectionError', { errorMessages }); + } else if (isMssqlError(error)) { + context.logger.error(this.moduleName, 'MssqlError', { + error: { + name: error.name, // RequestError + description: error.message, // Timeout: Request failed to complete in 15000ms + }, + originalError: { + name: error.originalError.name, + description: error.originalError.name, + }, + query, + input, + }); + } else { + context.logger.error(this.moduleName, error.message, { error, query, input }); + } + + // TODO May want to refactor to throw CamsError and remove returning QueryResults + const queryResult: QueryResults = { + results: {}, + message: (error as Error).message, + success: false, + }; + return queryResult; + } + } + + public async close(): Promise { + this.connectionPool.close(); + } +} + +function isMssqlError(e): e is MSSQLError { + return e instanceof MSSQLError; +} + +function isConnectionError(e): e is ConnectionError { + return e instanceof ConnectionError; +} + +type AggregateError = Error & { + errors?: Error[]; +}; + +function isAggregateError(e: unknown): e is AggregateError { + return e && 'errors' in (e as object); +} diff --git a/backend/functions/lib/configs/application-configuration.ts b/backend/functions/lib/configs/application-configuration.ts index 249e7b5b0..031621a7b 100644 --- a/backend/functions/lib/configs/application-configuration.ts +++ b/backend/functions/lib/configs/application-configuration.ts @@ -10,6 +10,7 @@ dotenv.config(); export class ApplicationConfiguration { public readonly server: ServerType; public readonly dxtrDbConfig: IDbConfig; + public readonly acmsDbConfig: IDbConfig; public readonly dbMock: boolean; public readonly documentDbConfig: DocumentDbConfig; public readonly featureFlagKey: string; @@ -19,7 +20,8 @@ export class ApplicationConfiguration { constructor() { this.dbMock = process.env.DATABASE_MOCK?.toLowerCase() === 'true'; this.server = this.getAppServerConfig(); - this.dxtrDbConfig = this.getDbConfig(process.env.MSSQL_DATABASE_DXTR); + this.dxtrDbConfig = this.getDxtrDbConfig(process.env.MSSQL_DATABASE_DXTR); + this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_DATABASE); this.documentDbConfig = this.getDocumentDbConfig(); this.featureFlagKey = process.env.FEATURE_FLAG_SDK_KEY; this.authConfig = getAuthorizationConfig(); @@ -33,7 +35,7 @@ export class ApplicationConfiguration { }; } - private getDbConfig(database: string): IDbConfig { + private getDxtrDbConfig(database: string): IDbConfig { const server = process.env.MSSQL_HOST; const port: number = Number(process.env.MSSQL_PORT) || 1433; const encrypt: boolean = Boolean(process.env.MSSQL_ENCRYPT); @@ -80,6 +82,54 @@ export class ApplicationConfiguration { return config; } + // TODO: This and getDxtrDbConfig are gross. Refactor when we feel we really want to clean this up. + private getAcmsDbConfig(database: string): IDbConfig { + const server = process.env.ACMS_HOST; + const port: number = Number(process.env.ACMS_PORT) || 1433; + const encrypt: boolean = Boolean(process.env.ACMS_ENCRYPT); + const trustServerCertificate: boolean = Boolean(process.env.ACMS_TRUST_UNSIGNED_CERT); + const authType = process.env.ACMS_AUTH_TYPE || 'azure-active-directory-default'; + const user = process.env.ACMS_USER; + const password = process.env.ACMS_PASS; + const identityClientId = process.env.ACMS_CLIENT_ID; + const requestTimeout = parseInt(process.env.ACMS_REQUEST_TIMEOUT ?? '15000'); + + const config: IDbConfig = { + server, + port, + database, + requestTimeout, + }; + + const useSqlAuth = user && password; + if (useSqlAuth) { + config.user = user; + config.password = password; + } else { + config.authentication = { + type: authType, + }; + + // If client id is not set here, ensure that AZURE_CLIENT_ID is set when using DefaultAzureCredential + if (identityClientId) { + config.authentication.options = { clientId: identityClientId }; + } + } + + config.pool = { + max: 10, + min: 0, + idleTimeoutMillis: 30 * 1000, + }; + + config.options = { + encrypt, + trustServerCertificate, + }; + + return config; + } + private getDocumentDbConfig(): DocumentDbConfig { return { databaseName: process.env.COSMOS_DATABASE_NAME, diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts new file mode 100644 index 000000000..97d6d2e21 --- /dev/null +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -0,0 +1 @@ +describe('AcmsOrdersController', () => {}); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts new file mode 100644 index 000000000..a54bff141 --- /dev/null +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -0,0 +1,32 @@ +import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; +import { ApplicationContext } from '../../adapters/types/basic'; +import AcmsOrders, { + AcmsConsolidation, + Predicate, + PredicateAndPage, +} from '../../use-cases/acms-orders/acms-orders'; +class AcmsOrdersController { + public async migrateExistingConsolidation( + context: ApplicationContext, + existing: AcmsConsolidation, + ): Promise { + const useCase = new AcmsOrders(); + return useCase.migrateExistingConsolidation(context, existing); + } + + public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + // TODO: Reconcile the argument type + const useCase = new AcmsOrders(); + return useCase.getPageCount(context, predicate); + } + + public async getConsolidationOrders( + context: ApplicationContext, + predicate: PredicateAndPage, + ): Promise { + const useCase = new AcmsOrders(); + return useCase.getConsolidationOrders(context, predicate); + } +} + +export default AcmsOrdersController; diff --git a/backend/functions/lib/controllers/orders/orders.controller.test.ts b/backend/functions/lib/controllers/orders/orders.controller.test.ts index 01dcdec80..c7ed1e430 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.test.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.test.ts @@ -262,7 +262,6 @@ describe('orders controller tests', () => { const predicate: Predicate = { divisionCode: '000', chapter: '00', - dateRange: ['2020-01-01', '2021-01-01'], }; const controller = new OrdersController(applicationContext); @@ -283,7 +282,6 @@ describe('orders controller tests', () => { const predicate: PredicateAndPage = { divisionCode: '000', chapter: '00', - dateRange: ['2020-01-01', '2021-01-01'], pageNumber: 1, }; diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index b8f4e691c..cf8d08c9f 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -17,11 +17,6 @@ import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; import { closeDeferred } from '../../defer-close'; -import AcmsOrders, { - AcmsConsolidation, - Predicate, - PredicateAndPage, -} from '../../use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'ORDERS-CONTROLLER'; @@ -72,28 +67,6 @@ export class OrdersController implements CamsController, CamsTimerController { } } - public async handleMigration( - context: ApplicationContext, - existing: AcmsConsolidation, - ): Promise { - const useCase = new AcmsOrders(); - return useCase.migrateExistingConsolidation(existing, context); - } - - public async handlePageCount(context: ApplicationContext, predicate: Predicate): Promise { - // TODO: Reconcile the argument type - const useCase = new AcmsOrders(); - return useCase.getPageCount(context, predicate); - } - - public async handleGetLegacyConsolidationOrders( - context: ApplicationContext, - predicate: PredicateAndPage, - ): Promise { - const useCase = new AcmsOrders(); - return useCase.getConsolidationOrders(context, predicate); - } - private async handleOrders(context: ApplicationContext) { let response; if (context.request.method === 'GET') { diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 2ebb107a0..16726ab4e 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -31,7 +31,6 @@ describe('ACMS Orders', () => { const predicate: Predicate = { divisionCode: '000', chapter: '00', - dateRange: ['2020-01-01', '2021-01-01'], }; const useCase = new AcmsOrders(); const actual = await useCase.getPageCount(context, predicate); @@ -50,7 +49,6 @@ describe('ACMS Orders', () => { const predicateAndPage: PredicateAndPage = { divisionCode: '000', chapter: '00', - dateRange: ['2020-01-01', '2021-01-01'], pageNumber: 1, }; @@ -68,7 +66,6 @@ describe('ACMS Orders', () => { const predicate: Predicate = { divisionCode: '000', chapter: '00', - dateRange: ['2020-01-01', '2021-01-01'], }; const predicateAndPage: PredicateAndPage = { diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 157e4e0c7..fbff7bace 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -8,13 +8,11 @@ const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; export type Bounds = { divisionCodes: string[]; chapters: string[]; - dateRange: [string, string]; }; export type Predicate = { divisionCode: string; chapter: string; - dateRange: [string, string]; }; export type PredicateAndPage = Predicate & { @@ -42,13 +40,13 @@ export class AcmsOrders { } public async migrateExistingConsolidation( - existing: AcmsConsolidation, context: ApplicationContext, + consolidation: AcmsConsolidation, ): Promise { // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - context.logger.info(MODULE_NAME, 'Transform and load', existing); + context.logger.info(MODULE_NAME, 'Transform and load', consolidation); const newOrder = { - ...existing, + ...consolidation, camsId: randomUUID(), }; context.logger.info( diff --git a/backend/functions/poc/activity/flattenBoundingArrays.ts b/backend/functions/poc/activity/flattenBoundingArrays.ts index 27c1ced43..d7a60a6d6 100644 --- a/backend/functions/poc/activity/flattenBoundingArrays.ts +++ b/backend/functions/poc/activity/flattenBoundingArrays.ts @@ -11,7 +11,6 @@ async function flattenBoundingArrays( predicates.push({ divisionCode, chapter, - dateRange: bounds.dateRange, }); } } diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/poc/activity/getConsolidations.ts index b9f73e663..6339cd9cc 100644 --- a/backend/functions/poc/activity/getConsolidations.ts +++ b/backend/functions/poc/activity/getConsolidations.ts @@ -1,13 +1,14 @@ import { InvocationContext } from '@azure/functions'; import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import ContextCreator from '../../azure/application-context-creator'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -async function getConsolidations(input: PredicateAndPage, context: InvocationContext) { +async function getConsolidations(input: PredicateAndPage, invocationContext: InvocationContext) { // Do some stuff - context.log('GetConsolidations', JSON.stringify(input)); - return [ - { orderId: '53rs2', caseId: '071-23-012345' }, - { orderId: '426gh', caseId: '071-23-43215' }, - ]; + const logger = ContextCreator.getLogger(invocationContext); + const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + const controller = new AcmsOrdersController(); + return controller.getConsolidationOrders(context, input); } export default { diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts index 883f6c642..32d8115b9 100644 --- a/backend/functions/poc/activity/getPageCount.ts +++ b/backend/functions/poc/activity/getPageCount.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; import { CamsError } from '../../lib/common-errors/cams-error'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; @@ -13,8 +13,8 @@ async function getPageCount(input: PredicateAndPage, invocationContext: Invocati // Do some stuff console.log('#################GetPageCount', JSON.stringify(input)); - const controller = new OrdersController(context); - return controller.handlePageCount(context, input); + const controller = new AcmsOrdersController(); + return controller.getPageCount(context, input); // TODO: This seems silly to have to supply all of these repos and gateways. // Are we going to add yet another for ACMS? // const orders = new OrdersUseCase( diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts index 202eab4a5..73efd8b64 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts @@ -5,17 +5,14 @@ import { OrchestrationContext } from 'durable-functions'; export function* subOrchestratorETL(context: OrchestrationContext) { const predicateAndPage: PredicateAndPage = context.df.getInput(); - const consolidatedOrdersPage = yield context.df.callActivity( - CONSOLIDATIONS_FROM_ACMS, - predicateAndPage, - ); + const leadCaseIds = yield context.df.callActivity(CONSOLIDATIONS_FROM_ACMS, predicateAndPage); - const parallelTasks = []; - for (let i = 0; i < consolidatedOrdersPage.length; i++) { - parallelTasks.push(context.df.callActivity(TRANSFORM_AND_LOAD, consolidatedOrdersPage[i])); + const etlTasks = []; + for (let i = 0; i < leadCaseIds.length; i++) { + etlTasks.push(context.df.callActivity(TRANSFORM_AND_LOAD, leadCaseIds[i])); } - yield context.df.Task.all(parallelTasks); + yield context.df.Task.all(etlTasks); // DO we need to fan in?? // const sum = parallelTasks.reduce((prev, curr) => prev + curr, 0); diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index c31286242..ed7928777 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -47,7 +47,6 @@ param privateEndpointSubnetId string param mssqlRequestTimeout string - @description('Azure functions runtime environment') @allowed([ 'java' @@ -172,20 +171,18 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { } } -module appInsights './lib/app-insights/app-insights.bicep' = - if (createApplicationInsights) { - name: '${functionName}-application-insights-module' - params: { - location: location - kind: 'web' - appInsightsName: 'appi-${functionName}' - applicationType: 'web' - workspaceResourceId: analyticsWorkspaceId - } +module appInsights './lib/app-insights/app-insights.bicep' = if (createApplicationInsights) { + name: '${functionName}-application-insights-module' + params: { + location: location + kind: 'web' + appInsightsName: 'appi-${functionName}' + applicationType: 'web' + workspaceResourceId: analyticsWorkspaceId } +} -module diagnosticSettings './lib/app-insights/diagnostics-settings-func.bicep' = -if(createApplicationInsights) { +module diagnosticSettings './lib/app-insights/diagnostics-settings-func.bicep' = if (createApplicationInsights) { name: '${functionName}-diagnostic-settings-module' params: { functionAppName: functionName @@ -197,45 +194,42 @@ if(createApplicationInsights) { ] } -module healthAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = - if (createAlerts) { - name: '${functionName}-healthcheck-alert-rule-module' - params: { - alertName: '${functionName}-health-check-alert' - appId: functionApp.id - timeAggregation: 'Average' - operator: 'LessThan' - targetResourceType: 'Microsoft.Web/sites' - metricName: 'HealthCheckStatus' - severity: 2 - threshold: 100 - actionGroupName: actionGroupName - actionGroupResourceGroupName: actionGroupResourceGroupName - } +module healthAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { + name: '${functionName}-healthcheck-alert-rule-module' + params: { + alertName: '${functionName}-health-check-alert' + appId: functionApp.id + timeAggregation: 'Average' + operator: 'LessThan' + targetResourceType: 'Microsoft.Web/sites' + metricName: 'HealthCheckStatus' + severity: 2 + threshold: 100 + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName } +} -module httpAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = - if (createAlerts) { - name: '${functionName}-http-error-alert-rule-module' - params: { - alertName: '${functionName}-http-error-alert' - appId: functionApp.id - timeAggregation: 'Total' - operator: 'GreaterThanOrEqual' - targetResourceType: 'Microsoft.Web/sites' - metricName: 'Http5xx' - severity: 1 - threshold: 1 - actionGroupName: actionGroupName - actionGroupResourceGroupName: actionGroupResourceGroupName - } +module httpAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { + name: '${functionName}-http-error-alert-rule-module' + params: { + alertName: '${functionName}-http-error-alert' + appId: functionApp.id + timeAggregation: 'Total' + operator: 'GreaterThanOrEqual' + targetResourceType: 'Microsoft.Web/sites' + metricName: 'Http5xx' + severity: 1 + threshold: 1 + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName } +} /* Create functionapp */ - var userAssignedIdentities = union( { '${appConfigIdentity.id}': {} @@ -330,6 +324,34 @@ var applicationSettings = concat( name: 'MSSQL_TRUST_UNSIGNED_CERT' value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-TRUST-UNSIGNED-CERT)' } + { + name: 'MSSQL_REQUEST_TIMEOUT' + value: mssqlRequestTimeout + } + { + name: 'ACMS_HOST' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-HOST)' + } + { + name: 'ACMS_DATABASE' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-DATABASE)' + } + { + name: 'ACMS_CLIENT_ID' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-CLIENT-ID)' + } + { + name: 'ACMS_ENCRYPT' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-ENCRYPT)' + } + { + name: 'ACMS_TRUST_UNSIGNED_CERT' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-TRUST-UNSIGNED-CERT)' + } + { + name: 'ACMS_REQUEST_TIMEOUT' + value: mssqlRequestTimeout + } { name: 'FEATURE_FLAG_SDK_KEY' value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=FEATURE-FLAG-SDK-KEY)' @@ -342,16 +364,15 @@ var applicationSettings = concat( name: 'OKTA_API_KEY' value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=OKTA-API-KEY)' } - { - name: 'MSSQL_REQUEST_TIMEOUT' - value: mssqlRequestTimeout - } ], createApplicationInsights ? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: appInsights.outputs.connectionString }] : [], isUstpDeployment - ? [{ name: 'MSSQL_USER', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-USER)' }, { name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-PASS)' }] + ? [ + { name: 'MSSQL_USER', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-USER)' } + { name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-PASS)' } + ] : [{ name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-CLIENT-ID)' }] ) @@ -426,16 +447,15 @@ module privateEndpoint './lib/network/subnet-private-endpoint.bicep' = { var createSqlServerVnetRule = !empty(sqlServerResourceGroupName) && !empty(sqlServerName) && !isUstpDeployment -module setSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = - if (createSqlServerVnetRule) { - scope: resourceGroup(sqlServerResourceGroupName) - name: '${functionName}-sql-vnet-rule-module' - params: { - stackName: functionName - sqlServerName: sqlServerName - subnetId: functionSubnetId - } +module setSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = if (createSqlServerVnetRule) { + scope: resourceGroup(sqlServerResourceGroupName) + name: '${functionName}-sql-vnet-rule-module' + params: { + stackName: functionName + sqlServerName: sqlServerName + subnetId: functionSubnetId } +} // Creates a managed identity that would be used to grant access to functionapp instance var sqlIdentityName = !empty(sqlServerIdentityName) ? sqlServerIdentityName : 'id-sql-${functionName}-readonly' @@ -443,15 +463,14 @@ var sqlIdentityRG = !empty(sqlServerIdentityResourceGroupName) ? sqlServerIdentityResourceGroupName : sqlServerResourceGroupName -module sqlManagedIdentity './lib/identity/managed-identity.bicep' = - if (createSqlServerVnetRule) { - scope: resourceGroup(sqlIdentityRG) - name: '${functionName}-sql-identity-module' - params: { - managedIdentityName: sqlIdentityName - location: location - } +module sqlManagedIdentity './lib/identity/managed-identity.bicep' = if (createSqlServerVnetRule) { + scope: resourceGroup(sqlIdentityRG) + name: '${functionName}-sql-identity-module' + params: { + managedIdentityName: sqlIdentityName + location: location } +} resource sqlIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { name: sqlIdentityName From 2bc10b32aa32a4dd031d7c4e39f10e34591a25a7 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:42:06 -0500 Subject: [PATCH 010/112] Apply consistent naming to consolidation migration Jira ticket: CAMS-461 --- .../adapters/gateways/acms/acms.gateway.ts | 2 +- .../acms-orders/acms-orders.controller.ts | 16 +++++------- .../use-cases/acms-orders/acms-orders.test.ts | 6 ++--- .../lib/use-cases/acms-orders/acms-orders.ts | 6 ++--- .../functions/lib/use-cases/gateways.types.ts | 2 +- .../poc/activity/getConsolidations.ts | 11 ++++++-- .../functions/poc/activity/getPageCount.ts | 24 ++++------------- .../poc/activity/migrateConsolidation.ts | 26 +++++++++++++++++++ .../poc/activity/transformAndLoad.ts | 16 ------------ backend/functions/poc/loadConsolidations.ts | 14 +++++----- .../poc/orchestration/sub-orchestrator-etl.ts | 6 ++--- .../orchestration/sub-orchestrator-paging.ts | 4 +-- 12 files changed, 67 insertions(+), 66 deletions(-) create mode 100644 backend/functions/poc/activity/migrateConsolidation.ts delete mode 100644 backend/functions/poc/activity/transformAndLoad.ts diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index acc097269..241b33da3 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -58,7 +58,7 @@ export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { } } - async getConsolidationOrders( + async getConsolidations( _context: ApplicationContext, _predicateAndPage: PredicateAndPage, ): Promise { diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index a54bff141..fd4cfa0cd 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -6,26 +6,24 @@ import AcmsOrders, { PredicateAndPage, } from '../../use-cases/acms-orders/acms-orders'; class AcmsOrdersController { - public async migrateExistingConsolidation( + private readonly useCase = new AcmsOrders(); + + public async migrateConsolidation( context: ApplicationContext, existing: AcmsConsolidation, ): Promise { - const useCase = new AcmsOrders(); - return useCase.migrateExistingConsolidation(context, existing); + return this.useCase.migrateConsolidation(context, existing); } public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { - // TODO: Reconcile the argument type - const useCase = new AcmsOrders(); - return useCase.getPageCount(context, predicate); + return this.useCase.getPageCount(context, predicate); } - public async getConsolidationOrders( + public async getConsolidations( context: ApplicationContext, predicate: PredicateAndPage, ): Promise { - const useCase = new AcmsOrders(); - return useCase.getConsolidationOrders(context, predicate); + return this.useCase.getConsolidations(context, predicate); } } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 16726ab4e..8bec23f32 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -7,7 +7,7 @@ const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, - getConsolidationOrders: function (..._ignore): Promise { + getConsolidations: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, }; @@ -53,7 +53,7 @@ describe('ACMS Orders', () => { }; const useCase = new AcmsOrders(); - const actual = await useCase.getConsolidationOrders(context, predicateAndPage); + const actual = await useCase.getConsolidations(context, predicateAndPage); expect(getConsolidationOrders).toHaveBeenCalledWith(context, predicateAndPage); expect(actual).toEqual(expected); @@ -74,6 +74,6 @@ describe('ACMS Orders', () => { }; await expect(useCase.getPageCount(context, predicate)).rejects.toThrow(); - await expect(useCase.getConsolidationOrders(context, predicateAndPage)).rejects.toThrow(); + await expect(useCase.getConsolidations(context, predicateAndPage)).rejects.toThrow(); }); }); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index fbff7bace..08620c4e4 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -31,15 +31,15 @@ export class AcmsOrders { return gateway.getPageCount(context, predicate); } - public async getConsolidationOrders( + public async getConsolidations( context: ApplicationContext, predicateAndPage: PredicateAndPage, ): Promise { const gateway = Factory.getAcmsGateway(context); - return gateway.getConsolidationOrders(context, predicateAndPage); + return gateway.getConsolidations(context, predicateAndPage); } - public async migrateExistingConsolidation( + public async migrateConsolidation( context: ApplicationContext, consolidation: AcmsConsolidation, ): Promise { diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index 30821abd5..a3c8bb6e1 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -92,7 +92,7 @@ export interface OrdersGateway { export interface AcmsGateway { getPageCount(context: ApplicationContext, predicate: Predicate): Promise; - getConsolidationOrders( + getConsolidations( context: ApplicationContext, predicateAndPage: PredicateAndPage, ): Promise; diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/poc/activity/getConsolidations.ts index 6339cd9cc..b3e09a7ad 100644 --- a/backend/functions/poc/activity/getConsolidations.ts +++ b/backend/functions/poc/activity/getConsolidations.ts @@ -2,13 +2,20 @@ import { InvocationContext } from '@azure/functions'; import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import ContextCreator from '../../azure/application-context-creator'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../lib/common-errors/error-utilities'; + +const MODULE_NAME = 'IMPORT_ACTION_GET_CONSOLIDATIONS'; async function getConsolidations(input: PredicateAndPage, invocationContext: InvocationContext) { - // Do some stuff const logger = ContextCreator.getLogger(invocationContext); const context = await ContextCreator.applicationContextCreator(invocationContext, logger); const controller = new AcmsOrdersController(); - return controller.getConsolidationOrders(context, input); + + try { + return controller.getConsolidations(context, input); + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } } export default { diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/poc/activity/getPageCount.ts index 32d8115b9..64a707ef1 100644 --- a/backend/functions/poc/activity/getPageCount.ts +++ b/backend/functions/poc/activity/getPageCount.ts @@ -1,35 +1,21 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; -import { CamsError } from '../../lib/common-errors/cams-error'; import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; async function getPageCount(input: PredicateAndPage, invocationContext: InvocationContext) { const logger = ContextCreator.getLogger(invocationContext); - try { - const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + const controller = new AcmsOrdersController(); - // Do some stuff + try { console.log('#################GetPageCount', JSON.stringify(input)); - const controller = new AcmsOrdersController(); return controller.getPageCount(context, input); - // TODO: This seems silly to have to supply all of these repos and gateways. - // Are we going to add yet another for ACMS? - // const orders = new OrdersUseCase( - // getCasesRepository(context), - // getCasesGateway(context), - // getOrdersRepository(context), - // getOrdersGateway(context), - // getRuntimeStateRepository(context), - // getConsolidationOrdersRepository(context), - // getStorageGateway(context), - // ); - // - // return orders.getConsolidationPageCount(context, {}); } catch (originalError) { - throw new CamsError(MODULE_NAME, { originalError }); + throw getCamsError(originalError, MODULE_NAME); } } diff --git a/backend/functions/poc/activity/migrateConsolidation.ts b/backend/functions/poc/activity/migrateConsolidation.ts new file mode 100644 index 000000000..385d08153 --- /dev/null +++ b/backend/functions/poc/activity/migrateConsolidation.ts @@ -0,0 +1,26 @@ +import { InvocationContext } from '@azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { AcmsConsolidation } from '../../lib/use-cases/acms-orders/acms-orders'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../lib/common-errors/error-utilities'; + +const MODULE_NAME = 'IMPORT_ACTION_MIGRATE_CONSOLIDATION'; + +async function migrateConsolidation( + input: AcmsConsolidation, + invocationContext: InvocationContext, +) { + const logger = ContextCreator.getLogger(invocationContext); + const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); + const controller = new AcmsOrdersController(); + + try { + return controller.migrateConsolidation(appContext, input); + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } +} + +export default { + handler: migrateConsolidation, +}; diff --git a/backend/functions/poc/activity/transformAndLoad.ts b/backend/functions/poc/activity/transformAndLoad.ts deleted file mode 100644 index 13cee9211..000000000 --- a/backend/functions/poc/activity/transformAndLoad.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { InvocationContext } from '@azure/functions'; -import ContextCreator from '../../azure/application-context-creator'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { AcmsConsolidation } from '../../lib/use-cases/acms-orders/acms-orders'; - -async function transformAndLoad(input: AcmsConsolidation, invocationContext: InvocationContext) { - // Do some stuff - const logger = ContextCreator.getLogger(invocationContext); - const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); - const controller = new OrdersController(appContext); - return controller.handleMigration(appContext, input); -} - -export default { - handler: transformAndLoad, -}; diff --git a/backend/functions/poc/loadConsolidations.ts b/backend/functions/poc/loadConsolidations.ts index 3f5915d0a..9dbab8124 100644 --- a/backend/functions/poc/loadConsolidations.ts +++ b/backend/functions/poc/loadConsolidations.ts @@ -7,23 +7,23 @@ import { subOrchestratorETL } from './orchestration/sub-orchestrator-etl'; import { subOrchestratorPaging } from './orchestration/sub-orchestrator-paging'; import getConsolidations from './activity/getConsolidations'; import getPageCount from './activity/getPageCount'; -import transformAndLoad from './activity/transformAndLoad'; +import migrateConsolidation from './activity/migrateConsolidation'; import flattenBoundingArrays from './activity/flattenBoundingArrays'; export const SUB_ORCHESTRATOR_ETL = 'SubOrchestratorETL'; export const SUB_ORCHESTRATOR_PAGING = 'SubOrchestratorPaging'; export const MAIN_ORCHESTRATOR = 'orchestrator'; -export const PAGE_COUNT_ACTIVITY = 'getPageCountFromACMS'; -export const CONSOLIDATIONS_FROM_ACMS = 'getConsolidationsFromACMS'; -export const TRANSFORM_AND_LOAD = 'transformAndLoad'; +export const GET_PAGE_COUNT = 'getPageCount'; +export const GET_CONSOLIDATIONS = 'getConsolidations'; +export const MIGRATE_CONSOLIDATION = 'migrateConsolidation'; export const FLATTEN_BOUNDING_ARRAYS = 'flattenBoundingArrays'; df.app.orchestration(MAIN_ORCHESTRATOR, main); df.app.orchestration(SUB_ORCHESTRATOR_ETL, subOrchestratorETL); df.app.orchestration(SUB_ORCHESTRATOR_PAGING, subOrchestratorPaging); -df.app.activity(CONSOLIDATIONS_FROM_ACMS, getConsolidations); -df.app.activity(PAGE_COUNT_ACTIVITY, getPageCount); -df.app.activity(TRANSFORM_AND_LOAD, transformAndLoad); +df.app.activity(GET_CONSOLIDATIONS, getConsolidations); +df.app.activity(GET_PAGE_COUNT, getPageCount); +df.app.activity(MIGRATE_CONSOLIDATION, migrateConsolidation); df.app.activity(FLATTEN_BOUNDING_ARRAYS, flattenBoundingArrays); app.http('dfClient', { diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts index 73efd8b64..18a75a1c1 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts @@ -1,15 +1,15 @@ import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; -import { CONSOLIDATIONS_FROM_ACMS, TRANSFORM_AND_LOAD } from '../loadConsolidations'; +import { GET_CONSOLIDATIONS, MIGRATE_CONSOLIDATION } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; export function* subOrchestratorETL(context: OrchestrationContext) { const predicateAndPage: PredicateAndPage = context.df.getInput(); - const leadCaseIds = yield context.df.callActivity(CONSOLIDATIONS_FROM_ACMS, predicateAndPage); + const leadCaseIds = yield context.df.callActivity(GET_CONSOLIDATIONS, predicateAndPage); const etlTasks = []; for (let i = 0; i < leadCaseIds.length; i++) { - etlTasks.push(context.df.callActivity(TRANSFORM_AND_LOAD, leadCaseIds[i])); + etlTasks.push(context.df.callActivity(MIGRATE_CONSOLIDATION, leadCaseIds[i])); } yield context.df.Task.all(etlTasks); diff --git a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts index dedc59d79..b6ab33a5c 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-paging.ts @@ -1,11 +1,11 @@ import { OrchestrationContext } from 'durable-functions'; -import { PAGE_COUNT_ACTIVITY, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; +import { GET_PAGE_COUNT, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; import { Predicate, PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; export function* subOrchestratorPaging(context: OrchestrationContext) { const predicate: Predicate = context.df.getInput(); - const pageCount: number = yield context.df.callActivity(PAGE_COUNT_ACTIVITY, predicate); + const pageCount: number = yield context.df.callActivity(GET_PAGE_COUNT, predicate); const provisioningTasks = []; for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { const predicateAndPage: PredicateAndPage = { From 50dfa70c1e540482bfefa2585f7f8b1fcef7c073 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:29:58 -0500 Subject: [PATCH 011/112] WIP - Migrate consolidations - Add leadCaseId query Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/acms/acms.gateway.test.ts | 30 ++++++++- .../adapters/gateways/acms/acms.gateway.ts | 63 ++++++++++++++++--- .../acms-orders/acms-orders.controller.ts | 2 +- .../use-cases/acms-orders/acms-orders.test.ts | 6 +- .../lib/use-cases/acms-orders/acms-orders.ts | 20 +++--- .../functions/lib/use-cases/gateways.types.ts | 6 +- 6 files changed, 96 insertions(+), 31 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 05b484aa5..674c6643d 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -1,7 +1,7 @@ import { AbstractDbClient } from '../mssql'; import { AcmsGatewayImpl } from './acms.gateway'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; -import { Predicate } from '../../../use-cases/acms-orders/acms-orders'; +import { Predicate, PredicateAndPage } from '../../../use-cases/acms-orders/acms-orders'; describe('ACMS gateway tests', () => { const pageCountCases = [ @@ -35,4 +35,32 @@ describe('ACMS gateway tests', () => { expect(result).toEqual(params.pageCount); }, ); + + test('should return a page of consolidation lead case numbers', async () => { + const databaseResult = [ + { leadCaseId: '11-00000' }, + { leadCaseId: '11-11111' }, + { leadCaseId: '11-22222' }, + ]; + const expectedResult = databaseResult.map((record) => record.leadCaseId); + + const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + success: true, + results: databaseResult, + message: '', + }); + + const predicate: PredicateAndPage = { + chapter: '15', + divisionCode: '081', + pageNumber: 1, + }; + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + const result = await gateway.getLeadCaseIds(context, predicate); + + expect(spy); + expect(result).toEqual(expectedResult); + }); }); diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 241b33da3..88500309c 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -1,9 +1,5 @@ import * as mssql from 'mssql'; -import { - Predicate, - PredicateAndPage, - AcmsConsolidation, -} from '../../../use-cases/acms-orders/acms-orders'; +import { Predicate, PredicateAndPage } from '../../../use-cases/acms-orders/acms-orders'; import { AcmsGateway } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; import { AbstractDbClient } from '../mssql'; @@ -58,10 +54,57 @@ export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { } } - async getConsolidations( - _context: ApplicationContext, - _predicateAndPage: PredicateAndPage, - ): Promise { - throw Error('getConsolidationOrders Not Implemented'); + async getLeadCaseIds( + context: ApplicationContext, + predicateAndPage: PredicateAndPage, + ): Promise { + const input: DbTableFieldSpec[] = []; + + // TODO: map from string chapters that accept numbers to be two character strings + // 09, 11, 12, 13, 15, 7A, 7N, AC + input.push({ + name: 'chapter', + type: mssql.VarChar, + value: predicateAndPage.chapter, + }); + + input.push({ + name: 'divisionCode', + type: mssql.VarChar, + value: predicateAndPage.divisionCode, + }); + + input.push({ + name: `limit`, + type: mssql.Int, + value: PAGE_SIZE, + }); + + input.push({ + name: `offset`, + type: mssql.Int, + value: PAGE_SIZE * (predicateAndPage.pageNumber - 1), + }); + + const query = `SELECT DISTINCT RIGHT(CONCAT('000', CAST(CONSOLIDATED_CASE_NUMBER AS VARCHAR)), 10) as leadCaseId + from CMMDB + where CURR_CASE_CHAPT = @chapter + and CASE_DIV = @divisionCode + and CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' + and CONSOLIDATED_CASE_NUMBER != '0' + ORDER BY CONSOLIDATED_CASE_NUMBER DESC OFFSET @offset ROWS FETCH NEXT @limit ROWS ONLY`; + + type ResultType = { + leadCaseId: string; + }; + + try { + const results = await this.executeQuery(context, query, input); + // TODO: Fix this. + const theFrackingList = results.results as ResultType[]; + return theFrackingList.map((record) => record.leadCaseId); + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } } } diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index fd4cfa0cd..675d45793 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -23,7 +23,7 @@ class AcmsOrdersController { context: ApplicationContext, predicate: PredicateAndPage, ): Promise { - return this.useCase.getConsolidations(context, predicate); + return this.useCase.getLeadCaseIds(context, predicate); } } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 8bec23f32..51e73b7a5 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -7,7 +7,7 @@ const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, - getConsolidations: function (..._ignore): Promise { + getLeadCaseIds: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, }; @@ -53,7 +53,7 @@ describe('ACMS Orders', () => { }; const useCase = new AcmsOrders(); - const actual = await useCase.getConsolidations(context, predicateAndPage); + const actual = await useCase.getLeadCaseIds(context, predicateAndPage); expect(getConsolidationOrders).toHaveBeenCalledWith(context, predicateAndPage); expect(actual).toEqual(expected); @@ -74,6 +74,6 @@ describe('ACMS Orders', () => { }; await expect(useCase.getPageCount(context, predicate)).rejects.toThrow(); - await expect(useCase.getConsolidations(context, predicateAndPage)).rejects.toThrow(); + await expect(useCase.getLeadCaseIds(context, predicateAndPage)).rejects.toThrow(); }); }); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 08620c4e4..5a6f3c6d9 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -19,39 +19,33 @@ export type PredicateAndPage = Predicate & { pageNumber: number; }; -// properties here are temporary. Need to figure out what this type should look like. -export type AcmsConsolidation = { - orderId: string; - caseId: string; -}; - export class AcmsOrders { public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { const gateway = Factory.getAcmsGateway(context); return gateway.getPageCount(context, predicate); } - public async getConsolidations( + public async getLeadCaseIds( context: ApplicationContext, predicateAndPage: PredicateAndPage, - ): Promise { + ): Promise { const gateway = Factory.getAcmsGateway(context); - return gateway.getConsolidations(context, predicateAndPage); + return gateway.getLeadCaseIds(context, predicateAndPage); } public async migrateConsolidation( context: ApplicationContext, - consolidation: AcmsConsolidation, + leadCaseId: string, ): Promise { // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - context.logger.info(MODULE_NAME, 'Transform and load', consolidation); + context.logger.info(MODULE_NAME, 'Transform and load', leadCaseId); const newOrder = { - ...consolidation, + leadCaseId, camsId: randomUUID(), }; context.logger.info( MODULE_NAME, - `Persisting ACMS consolidation ${newOrder.orderId} to CAMS ${newOrder.camsId}.`, + `Persisting ACMS consolidation ${newOrder.leadCaseId} to CAMS ${newOrder.camsId}.`, ); return newOrder as unknown as ConsolidationOrder; } diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index a3c8bb6e1..20d1abe98 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -19,7 +19,7 @@ import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; -import { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders/acms-orders'; +import { Predicate, PredicateAndPage } from './acms-orders/acms-orders'; interface Creates { create(data: T): Promise; @@ -92,10 +92,10 @@ export interface OrdersGateway { export interface AcmsGateway { getPageCount(context: ApplicationContext, predicate: Predicate): Promise; - getConsolidations( + getLeadCaseIds( context: ApplicationContext, predicateAndPage: PredicateAndPage, - ): Promise; + ): Promise; } export interface CasesRepository { From 3a9cfd890b23ed9d318d038d574b233f0d1c538f Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:38:59 -0600 Subject: [PATCH 012/112] WIP - migrate consolidations - transform and load logic Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/acms/acms.gateway.test.ts | 98 ++++++++++++++++--- .../adapters/gateways/acms/acms.gateway.ts | 84 +++++++++++++--- .../acms-orders.controller.test.ts | 59 ++++++++++- .../acms-orders/acms-orders.controller.ts | 14 +-- .../orders/orders.controller.test.ts | 63 ------------ .../use-cases/acms-orders/acms-orders.test.ts | 19 +++- .../lib/use-cases/acms-orders/acms-orders.ts | 65 +++++++++--- .../functions/lib/use-cases/gateways.types.ts | 6 +- .../poc/activity/getConsolidations.ts | 2 +- 9 files changed, 290 insertions(+), 120 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 674c6643d..8784487d2 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -1,7 +1,14 @@ import { AbstractDbClient } from '../mssql'; import { AcmsGatewayImpl } from './acms.gateway'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; -import { Predicate, PredicateAndPage } from '../../../use-cases/acms-orders/acms-orders'; +import { + AcmsConsolidation, + AcmsConsolidationChildCase, + Predicate, + PredicateAndPage, +} from '../../../use-cases/acms-orders/acms-orders'; + +const PAGE_SIZE = 50; describe('ACMS gateway tests', () => { const pageCountCases = [ @@ -36,13 +43,76 @@ describe('ACMS gateway tests', () => { }, ); - test('should return a page of consolidation lead case numbers', async () => { - const databaseResult = [ - { leadCaseId: '11-00000' }, - { leadCaseId: '11-11111' }, - { leadCaseId: '11-22222' }, + const pageNumber = [1, 3, 5]; + test.each(pageNumber)( + 'should return page number %s of consolidation lead case numbers', + async (pageNumber) => { + const databaseResult = [ + { leadCaseId: '811100000' }, + { leadCaseId: '1231111111' }, + { leadCaseId: '711122222' }, + ]; + const expectedResult = databaseResult.map((record) => record.leadCaseId); + + const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + success: true, + results: databaseResult, + message: '', + }); + + const predicate: PredicateAndPage = { + chapter: '15', + divisionCode: '081', + pageNumber, + }; + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + const result = await gateway.getLeadCaseIds(context, predicate); + + expect(spy).toHaveBeenCalledWith( + context, + expect.any(String), + expect.arrayContaining([ + expect.objectContaining({ name: 'chapter', value: predicate.chapter }), + expect.objectContaining({ name: 'divisionCode', value: predicate.divisionCode }), + expect.objectContaining({ name: 'offset', value: PAGE_SIZE * (pageNumber - 1) }), + expect.objectContaining({ name: 'limit', value: PAGE_SIZE }), + ]), + ); + expect(result).toEqual(expectedResult); + }, + ); + + test('should get consolidation details from ACMS', async () => { + const leadCaseId = '0000000000'; + const databaseResult: AcmsConsolidationChildCase[] = [ + { + caseId: '000-00-11111', + consolidationDate: '20240201', + consolidationType: 'S', + }, + { + caseId: '000-00-22222', + consolidationDate: '20240201', + consolidationType: 'S', + }, ]; - const expectedResult = databaseResult.map((record) => record.leadCaseId); + const expectedResult: AcmsConsolidation = { + leadCaseId: '000-00-00000', + childCases: [ + { + caseId: '000-00-11111', + consolidationDate: '2024-02-01', + consolidationType: 'substantive', + }, + { + caseId: '000-00-22222', + consolidationDate: '2024-02-01', + consolidationType: 'substantive', + }, + ], + }; const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ success: true, @@ -50,17 +120,15 @@ describe('ACMS gateway tests', () => { message: '', }); - const predicate: PredicateAndPage = { - chapter: '15', - divisionCode: '081', - pageNumber: 1, - }; - const context = await createMockApplicationContext(); const gateway = new AcmsGatewayImpl(context); - const result = await gateway.getLeadCaseIds(context, predicate); + const result = await gateway.getConsolidationDetails(context, leadCaseId); - expect(spy); + expect(spy).toHaveBeenCalledWith( + context, + expect.any(String), + expect.arrayContaining([expect.objectContaining({ name: 'leadCaseId', value: leadCaseId })]), + ); expect(result).toEqual(expectedResult); }); }); diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 88500309c..3507b2197 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -1,5 +1,10 @@ import * as mssql from 'mssql'; -import { Predicate, PredicateAndPage } from '../../../use-cases/acms-orders/acms-orders'; +import { + AcmsConsolidation, + AcmsConsolidationChildCase, + Predicate, + PredicateAndPage, +} from '../../../use-cases/acms-orders/acms-orders'; import { AcmsGateway } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; import { AbstractDbClient } from '../mssql'; @@ -38,12 +43,13 @@ export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { leadCaseCount: number; }; - const query = `SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) as leadCaseCount - from CMMDB - where CURR_CASE_CHAPT = @chapter - and CASE_DIV = @divisionCode - and CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' - and CONSOLIDATED_CASE_NUMBER != '0'`; + const query = ` + SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) AS leadCaseCount + FROM CMMDB + WHERE CURR_CASE_CHAPT = @chapter + AND CASE_DIV = @divisionCode + AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' + AND CONSOLIDATED_CASE_NUMBER != '0'`; try { const results = await this.executeQuery(context, query, input); @@ -86,12 +92,14 @@ export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { value: PAGE_SIZE * (predicateAndPage.pageNumber - 1), }); - const query = `SELECT DISTINCT RIGHT(CONCAT('000', CAST(CONSOLIDATED_CASE_NUMBER AS VARCHAR)), 10) as leadCaseId - from CMMDB - where CURR_CASE_CHAPT = @chapter - and CASE_DIV = @divisionCode - and CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' - and CONSOLIDATED_CASE_NUMBER != '0' + // RIGHT(CONCAT('000', CAST(CONSOLIDATED_CASE_NUMBER AS VARCHAR)), 10) + const query = ` + SELECT DISTINCT CONSOLIDATED_CASE_NUMBER AS leadCaseId + FROM CMMDB + WHERE CURR_CASE_CHAPT = @chapter + AND CASE_DIV = @divisionCode + AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' + AND CONSOLIDATED_CASE_NUMBER != '0' ORDER BY CONSOLIDATED_CASE_NUMBER DESC OFFSET @offset ROWS FETCH NEXT @limit ROWS ONLY`; type ResultType = { @@ -107,4 +115,54 @@ export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { throw getCamsError(originalError, MODULE_NAME); } } + + public async getConsolidationDetails( + context: ApplicationContext, + leadCaseId: string, + ): Promise { + const input: DbTableFieldSpec[] = []; + input.push({ + name: `leadCaseId`, + type: mssql.Int, + value: leadCaseId, + }); + + const query = ` + SELECT + CONCAT( + RIGHT('000' + CAST(CASE_DIV AS VARCHAR), 3), + '-', + RIGHT('00' + CAST(CASE_YEAR AS VARCHAR), 2), + '-', + RIGHT('00000' + CAST(CASE_NUMBER AS VARCHAR), 5) + ) AS caseId, + CONSOLIDATION_DATE as consolidationDate, + CONSOLIDATION_TYPE as consolidationType, + FROM CMMDB + WHERE CONSOLIDATED_CASE_NUMBER = @leadCaseId`; + + try { + const results = await this.executeQuery(context, query, input); + const rawResults = results.results as AcmsConsolidationChildCase[]; + const childCases = rawResults.map((bCase) => { + const date = String(bCase.consolidationDate); + return { + ...bCase, + consolidationType: bCase.consolidationType === 'S' ? 'substantive' : 'administrative', + consolidationDate: `${date.slice(0, 4)}-${date.slice(4, 6)}-${date.slice(6)}`, + }; + }); + return { + leadCaseId: this.formatCaseId(leadCaseId), + childCases, + }; + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } + } + + private formatCaseId(caseId: string): string { + const padded = caseId.padStart(10, '0'); + return `${padded.slice(0, 3)}-${padded.slice(3, 5)}-${padded.slice(5)}`; + } } diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts index 97d6d2e21..1801fc0d3 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -1 +1,58 @@ -describe('AcmsOrdersController', () => {}); +import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; +import AcmsOrdersController from './acms-orders.controller'; +import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; +import { ApplicationContext } from '../../adapters/types/basic'; +import { createMockApplicationContext } from '../../testing/testing-utilities'; + +describe('AcmsOrdersController', () => { + let context: ApplicationContext; + + beforeEach(async () => { + context = await createMockApplicationContext(); + }); + + test('should return ACMS Order Consolidations page count', async () => { + jest.spyOn(AcmsOrders.prototype, 'getPageCount').mockResolvedValue(5); + const predicate: Predicate = { + divisionCode: '000', + chapter: '00', + }; + + const controller = new AcmsOrdersController(); + const actual = await controller.getPageCount(context, predicate); + + expect(actual).toEqual(5); + }); + + test('should return array of lead case ids when calling getConsolidationOrders', async () => { + const leadCaseIds = ['811100000', '1231111111']; + const predicate: PredicateAndPage = { + divisionCode: '000', + chapter: '00', + pageNumber: 1, + }; + + jest.spyOn(AcmsOrders.prototype, 'getLeadCaseIds').mockResolvedValue(leadCaseIds); + + const controller = new AcmsOrdersController(); + const actual = await controller.getLeadCaseIds(context, predicate); + + expect(actual).toEqual(leadCaseIds); + }); + + test('should return Order Consolidation with camsId', async () => { + const leadCaseId = '811100000'; + const newOrder = { + leadCaseId, + camsId: crypto.randomUUID(), + }; + jest + .spyOn(AcmsOrders.prototype, 'migrateConsolidation') + .mockResolvedValue(newOrder as unknown as ConsolidationOrder); + + const controller = new AcmsOrdersController(); + const actual = await controller.migrateConsolidation(context, leadCaseId); + + expect(actual).toEqual(newOrder); + }); +}); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index 675d45793..83b97fbd1 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,28 +1,24 @@ import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; import { ApplicationContext } from '../../adapters/types/basic'; -import AcmsOrders, { - AcmsConsolidation, - Predicate, - PredicateAndPage, -} from '../../use-cases/acms-orders/acms-orders'; +import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; class AcmsOrdersController { private readonly useCase = new AcmsOrders(); public async migrateConsolidation( context: ApplicationContext, - existing: AcmsConsolidation, + leadCaseId: string, ): Promise { - return this.useCase.migrateConsolidation(context, existing); + return this.useCase.migrateConsolidation(context, leadCaseId); } public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { return this.useCase.getPageCount(context, predicate); } - public async getConsolidations( + public async getLeadCaseIds( context: ApplicationContext, predicate: PredicateAndPage, - ): Promise { + ): Promise { return this.useCase.getLeadCaseIds(context, predicate); } } diff --git a/backend/functions/lib/controllers/orders/orders.controller.test.ts b/backend/functions/lib/controllers/orders/orders.controller.test.ts index c7ed1e430..875b54e4c 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.test.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.test.ts @@ -22,7 +22,6 @@ import { ResponseBody } from '../../../../../common/src/api/response'; import { NotFoundError } from '../../common-errors/not-found-error'; import { BadRequestError } from '../../common-errors/bad-request'; import * as crypto from 'crypto'; -import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; const syncResponse: SyncOrdersStatus = { options: { @@ -256,68 +255,6 @@ describe('orders controller tests', () => { await expect(controller.approveConsolidation(applicationContext)).rejects.toThrow(CamsError); }); - - test('should return ACMS Order Consolidations page count', async () => { - jest.spyOn(AcmsOrders.prototype, 'getPageCount').mockResolvedValue(5); - const predicate: Predicate = { - divisionCode: '000', - chapter: '00', - }; - - const controller = new OrdersController(applicationContext); - - const actual = await controller.handlePageCount(applicationContext, predicate); - - expect(actual).toEqual(5); - }); - - test('should return ACMS Order Consolidation array when calling getConsolidationOrders', async () => { - const mockAcmsConsolidationArray = MockData.buildArray( - () => ({ - orderId: MockData.randomCaseId(), - caseId: MockData.randomCaseId(), - }), - 3, - ); - const predicate: PredicateAndPage = { - divisionCode: '000', - chapter: '00', - pageNumber: 1, - }; - - jest - .spyOn(AcmsOrders.prototype, 'getConsolidationOrders') - .mockResolvedValue(mockAcmsConsolidationArray); - - const controller = new OrdersController(applicationContext); - - const actual = await controller.handleGetLegacyConsolidationOrders( - applicationContext, - predicate, - ); - - expect(actual).toEqual(mockAcmsConsolidationArray); - }); - - test('should return Order Consolidation with camsId', async () => { - const originalOrder = { - orderId: '123', - caseId: '12-34567', - }; - const newOrder = { - ...originalOrder, - camsId: crypto.randomUUID(), - }; - jest - .spyOn(AcmsOrders.prototype, 'migrateExistingConsolidation') - .mockResolvedValue(newOrder as unknown as ConsolidationOrder); - - const controller = new OrdersController(applicationContext); - - const actual = await controller.handleMigration(applicationContext, originalOrder); - - expect(actual).toEqual(newOrder); - }); }); describe('orders controller exception tests', () => { diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 51e73b7a5..dc8574d50 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -7,7 +7,10 @@ const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, - getLeadCaseIds: function (..._ignore): Promise { + getLeadCaseIds: function (..._ignore): Promise { + throw new Error('Function not implemented.'); + }, + getConsolidationDetails: function (..._ignore): Promise { throw new Error('Function not implemented.'); }, }; @@ -40,9 +43,9 @@ describe('ACMS Orders', () => { }); test('should return a page of consolidation orders', async () => { - const expected: AcmsConsolidation[] = [{ caseId: '00-00000', orderId: '' }]; + const expected: string[] = ['811100000', '1231111111']; const getConsolidationOrders = jest - .spyOn(mockAcmsGateway, 'getConsolidationOrders') + .spyOn(mockAcmsGateway, 'getLeadCaseIds') .mockResolvedValue(expected); jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); @@ -59,6 +62,16 @@ describe('ACMS Orders', () => { expect(actual).toEqual(expected); }); + test('should write case references for consolidations to the cases repo', async () => { + const createConsolidationFrom = jest.fn(); + const createConsolidationTo = jest.fn(); + jest.spyOn(Factory, 'getCasesRepository').mockImplementation(() => { + createConsolidationFrom, + createConsolidationTo, + + }); + }); + test('should handle exceptions', async () => { jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); const useCase = new AcmsOrders(); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 5a6f3c6d9..7c0f5a5c8 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -1,9 +1,9 @@ import { ApplicationContext } from '../../adapters/types/basic'; import Factory from '../../factory'; -import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; -import { randomUUID } from 'crypto'; +import { ConsolidationFrom, ConsolidationTo } from '../../../../../common/src/cams/events'; +import { ConsolidationType } from '../../../../../common/src/cams/orders'; -const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; +const _MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; export type Bounds = { divisionCodes: string[]; @@ -19,6 +19,17 @@ export type PredicateAndPage = Predicate & { pageNumber: number; }; +export type AcmsConsolidationChildCase = { + caseId: string; + consolidationType: string; + consolidationDate: string; +}; + +export type AcmsConsolidation = { + leadCaseId: string; + childCases: AcmsConsolidationChildCase[]; +}; + export class AcmsOrders { public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { const gateway = Factory.getAcmsGateway(context); @@ -36,18 +47,44 @@ export class AcmsOrders { public async migrateConsolidation( context: ApplicationContext, leadCaseId: string, - ): Promise { + ): Promise { // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - context.logger.info(MODULE_NAME, 'Transform and load', leadCaseId); - const newOrder = { - leadCaseId, - camsId: randomUUID(), - }; - context.logger.info( - MODULE_NAME, - `Persisting ACMS consolidation ${newOrder.leadCaseId} to CAMS ${newOrder.camsId}.`, - ); - return newOrder as unknown as ConsolidationOrder; + + const casesRepo = Factory.getCasesRepository(context); + const dxtr = Factory.getCasesGateway(context); + const acms = Factory.getAcmsGateway(context); + const basics = await acms.getConsolidationDetails(context, leadCaseId); + + // TODO: Consider if there is a better way to get the order date. + const _orderDate = basics.childCases[0].consolidationDate; + + const leadCase = await dxtr.getCaseSummary(context, leadCaseId); + + for (const childCase of basics.childCases) { + const consolidationType = childCase.consolidationType as ConsolidationType; + + const toLink: ConsolidationTo = { + caseId: childCase.caseId, + consolidationType, + documentType: 'CONSOLIDATION_TO', + orderDate: childCase.consolidationDate, + otherCase: leadCase, + }; + + const otherCase = await dxtr.getCaseSummary(context, childCase.caseId); + const fromLink: ConsolidationFrom = { + caseId: leadCaseId, + consolidationType, + documentType: 'CONSOLIDATION_FROM', + orderDate: childCase.consolidationDate, + otherCase, + }; + + await casesRepo.createConsolidationFrom(fromLink); + await casesRepo.createConsolidationTo(toLink); + + // TODO: Write the audit record to the cases repo too. + } } } diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index 20d1abe98..ce3df67e3 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -19,7 +19,7 @@ import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; -import { Predicate, PredicateAndPage } from './acms-orders/acms-orders'; +import { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders/acms-orders'; interface Creates { create(data: T): Promise; @@ -96,6 +96,10 @@ export interface AcmsGateway { context: ApplicationContext, predicateAndPage: PredicateAndPage, ): Promise; + getConsolidationDetails( + context: ApplicationContext, + leadCaseId: string, + ): Promise; } export interface CasesRepository { diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/poc/activity/getConsolidations.ts index b3e09a7ad..5f01fcb69 100644 --- a/backend/functions/poc/activity/getConsolidations.ts +++ b/backend/functions/poc/activity/getConsolidations.ts @@ -12,7 +12,7 @@ async function getConsolidations(input: PredicateAndPage, invocationContext: Inv const controller = new AcmsOrdersController(); try { - return controller.getConsolidations(context, input); + return controller.getLeadCaseIds(context, input); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } From 65981293a872da59f97627cd4686847e94a9c4bb Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:53:52 -0600 Subject: [PATCH 013/112] WIP - Associate cases from ACMS consolidations Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../acms-orders.controller.test.ts | 13 +-- .../acms-orders/acms-orders.controller.ts | 3 +- .../use-cases/acms-orders/acms-orders.test.ts | 84 +++++++++++++++++-- 3 files changed, 81 insertions(+), 19 deletions(-) diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts index 1801fc0d3..f0b3eabdd 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -1,6 +1,5 @@ import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; import AcmsOrdersController from './acms-orders.controller'; -import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; import { ApplicationContext } from '../../adapters/types/basic'; import { createMockApplicationContext } from '../../testing/testing-utilities'; @@ -42,17 +41,11 @@ describe('AcmsOrdersController', () => { test('should return Order Consolidation with camsId', async () => { const leadCaseId = '811100000'; - const newOrder = { - leadCaseId, - camsId: crypto.randomUUID(), - }; - jest - .spyOn(AcmsOrders.prototype, 'migrateConsolidation') - .mockResolvedValue(newOrder as unknown as ConsolidationOrder); + const spy = jest.spyOn(AcmsOrders.prototype, 'migrateConsolidation').mockResolvedValue(); const controller = new AcmsOrdersController(); - const actual = await controller.migrateConsolidation(context, leadCaseId); + await controller.migrateConsolidation(context, leadCaseId); - expect(actual).toEqual(newOrder); + expect(spy).toHaveBeenCalled(); }); }); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index 83b97fbd1..052789d68 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,4 +1,3 @@ -import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; import { ApplicationContext } from '../../adapters/types/basic'; import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; class AcmsOrdersController { @@ -7,7 +6,7 @@ class AcmsOrdersController { public async migrateConsolidation( context: ApplicationContext, leadCaseId: string, - ): Promise { + ): Promise { return this.useCase.migrateConsolidation(context, leadCaseId); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index dc8574d50..0a2bd663d 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -2,6 +2,12 @@ import Factory from '../../factory'; import { createMockApplicationContext } from '../../testing/testing-utilities'; import { AcmsGateway } from '../gateways.types'; import AcmsOrders, { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders'; +import { CasesMongoRepository } from '../../adapters/gateways/mongo/cases.mongo.repository'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import { AcmsGatewayImpl } from '../../adapters/gateways/acms/acms.gateway'; +import CasesDxtrGateway from '../../adapters/gateways/dxtr/cases.dxtr.gateway'; +import { CaseSummary } from '../../../../../common/src/cams/cases'; +import { ConsolidationType } from '../../../../../common/src/cams/orders'; const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { @@ -19,7 +25,7 @@ describe('ACMS Orders', () => { let context; beforeAll(async () => { - context = createMockApplicationContext(); + context = await createMockApplicationContext({ env: { DATABASE_MOCK: 'false' } }); }); afterEach(() => { @@ -63,12 +69,76 @@ describe('ACMS Orders', () => { }); test('should write case references for consolidations to the cases repo', async () => { - const createConsolidationFrom = jest.fn(); - const createConsolidationTo = jest.fn(); - jest.spyOn(Factory, 'getCasesRepository').mockImplementation(() => { - createConsolidationFrom, - createConsolidationTo, - + const createConsolidationFromSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationFrom') + .mockResolvedValue(MockData.getConsolidationFrom()); + const createConsolidationToSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationTo') + .mockResolvedValue(MockData.getConsolidationTo()); + + const leadCase = MockData.getCaseSummary(); + const childCases = [MockData.getCaseSummary(), MockData.getCaseSummary()]; + const details: AcmsConsolidation = { + leadCaseId: leadCase.caseId, + childCases: [ + { + caseId: childCases[0].caseId, + consolidationDate: '2024-01-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[1].caseId, + consolidationDate: '2024-02-01', + consolidationType: 'administrative', + }, + ], + }; + + const caseSummaryMap = new Map([ + [leadCase.caseId, leadCase], + [childCases[0].caseId, childCases[0]], + [childCases[1].caseId, childCases[1]], + ]); + const expectedFromLinks = details.childCases.map((bCase) => { + const caseId = leadCase.caseId; + const orderDate = bCase.consolidationDate; + const consolidationType = bCase.consolidationType as ConsolidationType; + return MockData.getConsolidationFrom({ + override: { + caseId, + consolidationType, + orderDate, + otherCase: caseSummaryMap.get(bCase.caseId), + }, + }); + }); + + const expectedToLinks = details.childCases.map((bCase) => { + const caseId = bCase.caseId; + const orderDate = bCase.consolidationDate; + const consolidationType = bCase.consolidationType as ConsolidationType; + return MockData.getConsolidationTo({ + override: { caseId, consolidationType, orderDate, otherCase: leadCase }, + }); + }); + + jest.spyOn(AcmsGatewayImpl.prototype, 'getConsolidationDetails').mockResolvedValue(details); + jest + .spyOn(CasesDxtrGateway.prototype, 'getCaseSummary') + .mockImplementation((_context, caseId) => { + return Promise.resolve(caseSummaryMap.get(caseId)); + }); + const useCase = new AcmsOrders(); + await useCase.migrateConsolidation(context, leadCase.caseId); + + expect(createConsolidationToSpy).toHaveBeenCalledTimes(childCases.length); + expect(createConsolidationFromSpy).toHaveBeenCalledTimes(childCases.length); + + expectedFromLinks.forEach((fromLink) => { + expect(createConsolidationFromSpy).toHaveBeenCalledWith(fromLink); + }); + expectedToLinks.forEach((toLink) => { + expect(createConsolidationToSpy).toHaveBeenCalledWith(toLink); }); }); From f56e7cf031d456fb2a5b4a1361b8fe8e28c95bc6 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Thu, 21 Nov 2024 07:32:24 -0500 Subject: [PATCH 014/112] Write ACMS consolidation histories to CAMS Jira ticket: CAMS-461 --- .../use-cases/acms-orders/acms-orders.test.ts | 30 +++++++++++++++++- .../lib/use-cases/acms-orders/acms-orders.ts | 31 ++++++++++++++----- common/src/cams/auditable.ts | 1 + 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 0a2bd663d..22759c454 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -8,6 +8,8 @@ import { AcmsGatewayImpl } from '../../adapters/gateways/acms/acms.gateway'; import CasesDxtrGateway from '../../adapters/gateways/dxtr/cases.dxtr.gateway'; import { CaseSummary } from '../../../../../common/src/cams/cases'; import { ConsolidationType } from '../../../../../common/src/cams/orders'; +import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; +import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { @@ -75,6 +77,9 @@ describe('ACMS Orders', () => { const createConsolidationToSpy = jest .spyOn(CasesMongoRepository.prototype, 'createConsolidationTo') .mockResolvedValue(MockData.getConsolidationTo()); + const createCaseHistorySpy = jest + .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') + .mockResolvedValue(); const leadCase = MockData.getCaseSummary(); const childCases = [MockData.getCaseSummary(), MockData.getCaseSummary()]; @@ -99,6 +104,7 @@ describe('ACMS Orders', () => { [childCases[0].caseId, childCases[0]], [childCases[1].caseId, childCases[1]], ]); + const expectedFromLinks = details.childCases.map((bCase) => { const caseId = leadCase.caseId; const orderDate = bCase.consolidationDate; @@ -113,6 +119,23 @@ describe('ACMS Orders', () => { }); }); + const expectedHistory: CaseConsolidationHistory[] = []; + const allCaseIds = Array.from(caseSummaryMap.keys()); + allCaseIds.forEach((caseId) => { + expectedHistory.push({ + caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases, + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-01-01', + }); + }); + const expectedToLinks = details.childCases.map((bCase) => { const caseId = bCase.caseId; const orderDate = bCase.consolidationDate; @@ -133,6 +156,7 @@ describe('ACMS Orders', () => { expect(createConsolidationToSpy).toHaveBeenCalledTimes(childCases.length); expect(createConsolidationFromSpy).toHaveBeenCalledTimes(childCases.length); + expect(createCaseHistorySpy).toHaveBeenCalledTimes(expectedHistory.length); expectedFromLinks.forEach((fromLink) => { expect(createConsolidationFromSpy).toHaveBeenCalledWith(fromLink); @@ -140,9 +164,12 @@ describe('ACMS Orders', () => { expectedToLinks.forEach((toLink) => { expect(createConsolidationToSpy).toHaveBeenCalledWith(toLink); }); + expectedHistory.forEach((history) => { + expect(createCaseHistorySpy).toHaveBeenCalledWith(history); + }); }); - test('should handle exceptions', async () => { + test('should throw exceptions', async () => { jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); const useCase = new AcmsOrders(); @@ -158,5 +185,6 @@ describe('ACMS Orders', () => { await expect(useCase.getPageCount(context, predicate)).rejects.toThrow(); await expect(useCase.getLeadCaseIds(context, predicateAndPage)).rejects.toThrow(); + await expect(useCase.migrateConsolidation(context, '000-11-22222')).rejects.toThrow(); }); }); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 7c0f5a5c8..bb98347a2 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -2,6 +2,9 @@ import { ApplicationContext } from '../../adapters/types/basic'; import Factory from '../../factory'; import { ConsolidationFrom, ConsolidationTo } from '../../../../../common/src/cams/events'; import { ConsolidationType } from '../../../../../common/src/cams/orders'; +import { CaseSummary } from '../../../../../common/src/cams/cases'; +import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; +import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; const _MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; @@ -48,19 +51,16 @@ export class AcmsOrders { context: ApplicationContext, leadCaseId: string, ): Promise { - // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - const casesRepo = Factory.getCasesRepository(context); const dxtr = Factory.getCasesGateway(context); const acms = Factory.getAcmsGateway(context); - const basics = await acms.getConsolidationDetails(context, leadCaseId); - - // TODO: Consider if there is a better way to get the order date. - const _orderDate = basics.childCases[0].consolidationDate; + const basics = await acms.getConsolidationDetails(context, leadCaseId); const leadCase = await dxtr.getCaseSummary(context, leadCaseId); + const childCaseSummaries: CaseSummary[] = []; for (const childCase of basics.childCases) { + // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. const consolidationType = childCase.consolidationType as ConsolidationType; const toLink: ConsolidationTo = { @@ -79,11 +79,28 @@ export class AcmsOrders { orderDate: childCase.consolidationDate, otherCase, }; + childCaseSummaries.push(otherCase); await casesRepo.createConsolidationFrom(fromLink); await casesRepo.createConsolidationTo(toLink); + } - // TODO: Write the audit record to the cases repo too. + const caseHistory: Omit = { + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: childCaseSummaries, + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: basics.childCases[0].consolidationDate, + }; + + // TODO: Consider the case history will be different if the consolidation date is not the same for all child cases. + const allCaseIds = [leadCaseId, ...basics.childCases.map((bCase) => bCase.caseId)]; + for (const caseId of allCaseIds) { + await casesRepo.createCaseHistory({ ...caseHistory, caseId }); } } } diff --git a/common/src/cams/auditable.ts b/common/src/cams/auditable.ts index 6f05a8c31..94d4cf81e 100644 --- a/common/src/cams/auditable.ts +++ b/common/src/cams/auditable.ts @@ -7,6 +7,7 @@ export type Auditable = { }; export const SYSTEM_USER_REFERENCE: CamsUserReference = { id: 'SYSTEM', name: 'SYSTEM' }; +export const ACMS_SYSTEM_USER_REFERENCE: CamsUserReference = { id: 'ACMS', name: 'ACMS' }; /** * Decorates and returns the record with the Auditable properties. Any necessary overriding of the properties must be From 7fef171f8694f0925688bdd9ff43ed24863ca7ba Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Thu, 21 Nov 2024 07:59:31 -0500 Subject: [PATCH 015/112] Fix input parameter to migrateConsolidation Jira ticket: CAMS-461 --- backend/functions/poc/activity/migrateConsolidation.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/functions/poc/activity/migrateConsolidation.ts b/backend/functions/poc/activity/migrateConsolidation.ts index 385d08153..020acd869 100644 --- a/backend/functions/poc/activity/migrateConsolidation.ts +++ b/backend/functions/poc/activity/migrateConsolidation.ts @@ -1,21 +1,17 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; -import { AcmsConsolidation } from '../../lib/use-cases/acms-orders/acms-orders'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import { getCamsError } from '../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT_ACTION_MIGRATE_CONSOLIDATION'; -async function migrateConsolidation( - input: AcmsConsolidation, - invocationContext: InvocationContext, -) { +async function migrateConsolidation(leadCaseId: string, invocationContext: InvocationContext) { const logger = ContextCreator.getLogger(invocationContext); const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); try { - return controller.migrateConsolidation(appContext, input); + return controller.migrateConsolidation(appContext, leadCaseId); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } From 5053f1e1b1a96948e209d6c8fef5e80887b37a2a Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:52:02 -0600 Subject: [PATCH 016/112] Add a todo for using upsert Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- backend/functions/lib/use-cases/acms-orders/acms-orders.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index bb98347a2..0ffbbf21f 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -81,6 +81,7 @@ export class AcmsOrders { }; childCaseSummaries.push(otherCase); + // TODO: convert these functions to upsert because this _may_ run more than once await casesRepo.createConsolidationFrom(fromLink); await casesRepo.createConsolidationTo(toLink); } From 02748261524691c0da7de9505d686f521d768e1c Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:15:29 -0500 Subject: [PATCH 017/112] Stub processing report for migrateConsolidation Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../acms-orders.controller.test.ts | 14 ++- .../acms-orders/acms-orders.controller.ts | 8 +- .../use-cases/acms-orders/acms-orders.test.ts | 10 +- .../lib/use-cases/acms-orders/acms-orders.ts | 113 ++++++++++-------- 4 files changed, 89 insertions(+), 56 deletions(-) diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts index f0b3eabdd..0b4ff84be 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -1,4 +1,8 @@ -import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; +import AcmsOrders, { + AcmsConsolidationReport, + Predicate, + PredicateAndPage, +} from '../../use-cases/acms-orders/acms-orders'; import AcmsOrdersController from './acms-orders.controller'; import { ApplicationContext } from '../../adapters/types/basic'; import { createMockApplicationContext } from '../../testing/testing-utilities'; @@ -39,9 +43,13 @@ describe('AcmsOrdersController', () => { expect(actual).toEqual(leadCaseIds); }); - test('should return Order Consolidation with camsId', async () => { + test('should return processing report from migrateConsolidation', async () => { const leadCaseId = '811100000'; - const spy = jest.spyOn(AcmsOrders.prototype, 'migrateConsolidation').mockResolvedValue(); + const report: AcmsConsolidationReport = { + leadCaseId, + success: true, + }; + const spy = jest.spyOn(AcmsOrders.prototype, 'migrateConsolidation').mockResolvedValue(report); const controller = new AcmsOrdersController(); await controller.migrateConsolidation(context, leadCaseId); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index 052789d68..103192d15 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,12 +1,16 @@ import { ApplicationContext } from '../../adapters/types/basic'; -import AcmsOrders, { Predicate, PredicateAndPage } from '../../use-cases/acms-orders/acms-orders'; +import AcmsOrders, { + AcmsConsolidationReport, + Predicate, + PredicateAndPage, +} from '../../use-cases/acms-orders/acms-orders'; class AcmsOrdersController { private readonly useCase = new AcmsOrders(); public async migrateConsolidation( context: ApplicationContext, leadCaseId: string, - ): Promise { + ): Promise { return this.useCase.migrateConsolidation(context, leadCaseId); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 22759c454..24949a74b 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -185,6 +185,14 @@ describe('ACMS Orders', () => { await expect(useCase.getPageCount(context, predicate)).rejects.toThrow(); await expect(useCase.getLeadCaseIds(context, predicateAndPage)).rejects.toThrow(); - await expect(useCase.migrateConsolidation(context, '000-11-22222')).rejects.toThrow(); + }); + + test('should not throw exceptions', async () => { + jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); + const useCase = new AcmsOrders(); + + await expect(useCase.migrateConsolidation(context, '000-11-22222')).resolves.toEqual( + expect.objectContaining({ success: false }), + ); }); }); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 0ffbbf21f..78c7260af 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -33,6 +33,12 @@ export type AcmsConsolidation = { childCases: AcmsConsolidationChildCase[]; }; +export type AcmsConsolidationReport = { + leadCaseId: string; + success: boolean; + error?: unknown; +}; + export class AcmsOrders { public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { const gateway = Factory.getAcmsGateway(context); @@ -50,59 +56,66 @@ export class AcmsOrders { public async migrateConsolidation( context: ApplicationContext, leadCaseId: string, - ): Promise { - const casesRepo = Factory.getCasesRepository(context); - const dxtr = Factory.getCasesGateway(context); - const acms = Factory.getAcmsGateway(context); - - const basics = await acms.getConsolidationDetails(context, leadCaseId); - const leadCase = await dxtr.getCaseSummary(context, leadCaseId); - - const childCaseSummaries: CaseSummary[] = []; - for (const childCase of basics.childCases) { - // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. - const consolidationType = childCase.consolidationType as ConsolidationType; - - const toLink: ConsolidationTo = { - caseId: childCase.caseId, - consolidationType, - documentType: 'CONSOLIDATION_TO', - orderDate: childCase.consolidationDate, - otherCase: leadCase, + ): Promise { + const report: AcmsConsolidationReport = { leadCaseId, success: true }; + try { + const casesRepo = Factory.getCasesRepository(context); + const dxtr = Factory.getCasesGateway(context); + const acms = Factory.getAcmsGateway(context); + + const basics = await acms.getConsolidationDetails(context, leadCaseId); + const leadCase = await dxtr.getCaseSummary(context, leadCaseId); + + const childCaseSummaries: CaseSummary[] = []; + for (const childCase of basics.childCases) { + // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. + const consolidationType = childCase.consolidationType as ConsolidationType; + + const toLink: ConsolidationTo = { + caseId: childCase.caseId, + consolidationType, + documentType: 'CONSOLIDATION_TO', + orderDate: childCase.consolidationDate, + otherCase: leadCase, + }; + + const otherCase = await dxtr.getCaseSummary(context, childCase.caseId); + const fromLink: ConsolidationFrom = { + caseId: leadCaseId, + consolidationType, + documentType: 'CONSOLIDATION_FROM', + orderDate: childCase.consolidationDate, + otherCase, + }; + childCaseSummaries.push(otherCase); + + // TODO: convert these functions to upsert because this _may_ run more than once + await casesRepo.createConsolidationFrom(fromLink); + await casesRepo.createConsolidationTo(toLink); + } + + const caseHistory: Omit = { + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: childCaseSummaries, + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: basics.childCases[0].consolidationDate, }; - const otherCase = await dxtr.getCaseSummary(context, childCase.caseId); - const fromLink: ConsolidationFrom = { - caseId: leadCaseId, - consolidationType, - documentType: 'CONSOLIDATION_FROM', - orderDate: childCase.consolidationDate, - otherCase, - }; - childCaseSummaries.push(otherCase); - - // TODO: convert these functions to upsert because this _may_ run more than once - await casesRepo.createConsolidationFrom(fromLink); - await casesRepo.createConsolidationTo(toLink); - } - - const caseHistory: Omit = { - documentType: 'AUDIT_CONSOLIDATION', - before: null, - after: { - status: 'approved', - leadCase, - childCases: childCaseSummaries, - }, - updatedBy: ACMS_SYSTEM_USER_REFERENCE, - updatedOn: basics.childCases[0].consolidationDate, - }; - - // TODO: Consider the case history will be different if the consolidation date is not the same for all child cases. - const allCaseIds = [leadCaseId, ...basics.childCases.map((bCase) => bCase.caseId)]; - for (const caseId of allCaseIds) { - await casesRepo.createCaseHistory({ ...caseHistory, caseId }); + // TODO: Consider the case history will be different if the consolidation date is not the same for all child cases. + const allCaseIds = [leadCaseId, ...basics.childCases.map((bCase) => bCase.caseId)]; + for (const caseId of allCaseIds) { + await casesRepo.createCaseHistory({ ...caseHistory, caseId }); + } + } catch (error) { + report.success = false; + report.error = error; } + return report; } } From 9590c9b6cb98682b087066958a001d77a84a79cc Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Fri, 22 Nov 2024 10:02:29 -0500 Subject: [PATCH 018/112] corrected ACMS naming and access for USTP environment updated keyvaults with proper secrets Jira ticket: CAMS-461 Co-authored-by: Stanley Smith <8822118+governmentSponsored@users.noreply.github.com> --- .../lib/configs/application-configuration.ts | 16 +++++----- ops/cloud-deployment/backend-api-deploy.bicep | 31 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/backend/functions/lib/configs/application-configuration.ts b/backend/functions/lib/configs/application-configuration.ts index 031621a7b..dfa0009f2 100644 --- a/backend/functions/lib/configs/application-configuration.ts +++ b/backend/functions/lib/configs/application-configuration.ts @@ -21,7 +21,7 @@ export class ApplicationConfiguration { this.dbMock = process.env.DATABASE_MOCK?.toLowerCase() === 'true'; this.server = this.getAppServerConfig(); this.dxtrDbConfig = this.getDxtrDbConfig(process.env.MSSQL_DATABASE_DXTR); - this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_DATABASE); + this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_MSSQL_DATABASE); this.documentDbConfig = this.getDocumentDbConfig(); this.featureFlagKey = process.env.FEATURE_FLAG_SDK_KEY; this.authConfig = getAuthorizationConfig(); @@ -84,15 +84,15 @@ export class ApplicationConfiguration { // TODO: This and getDxtrDbConfig are gross. Refactor when we feel we really want to clean this up. private getAcmsDbConfig(database: string): IDbConfig { - const server = process.env.ACMS_HOST; + const server = process.env.ACMS_MSSQL_HOST; const port: number = Number(process.env.ACMS_PORT) || 1433; - const encrypt: boolean = Boolean(process.env.ACMS_ENCRYPT); - const trustServerCertificate: boolean = Boolean(process.env.ACMS_TRUST_UNSIGNED_CERT); + const encrypt: boolean = Boolean(process.env.ACMS_MSSQL_ENCRYPT); + const trustServerCertificate: boolean = Boolean(process.env.ACMS_MSSQL_TRUST_UNSIGNED_CERT); const authType = process.env.ACMS_AUTH_TYPE || 'azure-active-directory-default'; - const user = process.env.ACMS_USER; - const password = process.env.ACMS_PASS; - const identityClientId = process.env.ACMS_CLIENT_ID; - const requestTimeout = parseInt(process.env.ACMS_REQUEST_TIMEOUT ?? '15000'); + const user = process.env.ACMS_MSSQL_USER; + const password = process.env.ACMS_MSSQL_PASS; + const identityClientId = process.env.ACMS_MSSQL_CLIENT_ID; + const requestTimeout = parseInt(process.env.ACMS_MSSQL_REQUEST_TIMEOUT ?? '15000'); const config: IDbConfig = { server, diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index ed7928777..c3aa23055 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -258,6 +258,8 @@ resource functionApp 'Microsoft.Web/sites@2022-09-01' = { ] } +//TODO: Clear segregation with DXTR vs ACMS variable/secret naming in GitHub and ADO secret libraries + var applicationSettings = concat( [ { @@ -329,27 +331,23 @@ var applicationSettings = concat( value: mssqlRequestTimeout } { - name: 'ACMS_HOST' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-HOST)' - } - { - name: 'ACMS_DATABASE' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-DATABASE)' + name: 'ACMS_MSSQL_HOST' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-HOST)' } { - name: 'ACMS_CLIENT_ID' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-CLIENT-ID)' + name: 'ACMS_MSSQL_DATABASE' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-DATABASE)' } { - name: 'ACMS_ENCRYPT' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-ENCRYPT)' + name: 'ACMS_MSSQL_ENCRYPT' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-ENCRYPT)' } { - name: 'ACMS_TRUST_UNSIGNED_CERT' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-TRUST-UNSIGNED-CERT)' + name: 'ACMS_MSSQL_TRUST_UNSIGNED_CERT' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-TRUST-UNSIGNED-CERT)' } { - name: 'ACMS_REQUEST_TIMEOUT' + name: 'ACMS_MSSQL_REQUEST_TIMEOUT' value: mssqlRequestTimeout } { @@ -372,8 +370,13 @@ var applicationSettings = concat( ? [ { name: 'MSSQL_USER', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-USER)' } { name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-PASS)' } + { name: 'ACMS_MSSQL_USER', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-USER)' } + { name: 'ACMS_MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-PASS)' } + ] + : [ + { name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-CLIENT-ID)' } + { name: 'ACMS_MSSQL_CLIENT_ID', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ACMS-MSSQL-CLIENT-ID)'} ] - : [{ name: 'MSSQL_PASS', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-CLIENT-ID)' }] ) var ipSecurityRestrictionsRules = concat( From 2bddd0dd77aa02f430f65ab99b4db9646c754001 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:19:49 -0500 Subject: [PATCH 019/112] Implement rudimentary fan-in for migration process Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../poc/activity/migrateConsolidation.ts | 6 ++++- .../poc/orchestration/sub-orchestrator-etl.ts | 23 +++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/backend/functions/poc/activity/migrateConsolidation.ts b/backend/functions/poc/activity/migrateConsolidation.ts index 020acd869..b1d3c8d3d 100644 --- a/backend/functions/poc/activity/migrateConsolidation.ts +++ b/backend/functions/poc/activity/migrateConsolidation.ts @@ -2,10 +2,14 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import { getCamsError } from '../../lib/common-errors/error-utilities'; +import { AcmsConsolidationReport } from '../../lib/use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'IMPORT_ACTION_MIGRATE_CONSOLIDATION'; -async function migrateConsolidation(leadCaseId: string, invocationContext: InvocationContext) { +async function migrateConsolidation( + leadCaseId: string, + invocationContext: InvocationContext, +): Promise { const logger = ContextCreator.getLogger(invocationContext); const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts index 18a75a1c1..e3a903d67 100644 --- a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/poc/orchestration/sub-orchestrator-etl.ts @@ -1,4 +1,7 @@ -import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { + AcmsConsolidationReport, + PredicateAndPage, +} from '../../lib/use-cases/acms-orders/acms-orders'; import { GET_CONSOLIDATIONS, MIGRATE_CONSOLIDATION } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; @@ -14,7 +17,19 @@ export function* subOrchestratorETL(context: OrchestrationContext) { yield context.df.Task.all(etlTasks); - // DO we need to fan in?? - // const sum = parallelTasks.reduce((prev, curr) => prev + curr, 0); - // yield context.df.callActivity('finalResults??', sum); + const finalResults = etlTasks.reduce( + (acc, task) => { + const taskResponse = task as AcmsConsolidationReport; + if (taskResponse.success) { + acc.successful += 1; + } else { + acc.failed += 1; + } + return acc; + }, + { successful: 0, failed: 0 }, + ); + context.log( + `ACMS Consolidation Migration ETL: successful: ${finalResults.successful}, failures: ${finalResults.failed}`, + ); } From f14c14e2a368465c78b735281f465c536c2bd425 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Fri, 22 Nov 2024 09:28:01 -0700 Subject: [PATCH 020/112] Added error logging to the migration process Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../lib/use-cases/acms-orders/acms-orders.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 78c7260af..0794b80cd 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -5,8 +5,9 @@ import { ConsolidationType } from '../../../../../common/src/cams/orders'; import { CaseSummary } from '../../../../../common/src/cams/cases'; import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; +import { getCamsError } from '../../common-errors/error-utilities'; -const _MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; +const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; export type Bounds = { divisionCodes: string[]; @@ -36,7 +37,6 @@ export type AcmsConsolidation = { export type AcmsConsolidationReport = { leadCaseId: string; success: boolean; - error?: unknown; }; export class AcmsOrders { @@ -113,7 +113,12 @@ export class AcmsOrders { } } catch (error) { report.success = false; - report.error = error; + const camsError = getCamsError( + error, + MODULE_NAME, + `Transformation failed for lead case ${leadCaseId}`, + ); + context.logger.camsError(camsError); } return report; } From 690428c6ad45bd99c4bf58e1a2e1f07e9d6e0709 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:01:34 -0500 Subject: [PATCH 021/112] Remove test.only Jira ticket: CAMS-461 --- .../functions/lib/use-cases/orders/orders-local-gateway.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts b/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts index 2632891eb..bdd542b3b 100644 --- a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts +++ b/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts @@ -113,7 +113,7 @@ describe('orders use case tests', () => { mockContext.session = await createMockApplicationContextSession({ user: authorizedUser }); }); - test.only('should not create a second lead case for an existing consolidation', async () => { + test('should not create a second lead case for an existing consolidation', async () => { // Spy/mock the factory functions so we can return a LOCAL database of our choosing for the test. // We need a generic LOCAL gateway implementation that we return via the mocked factory function. const localCasesRepo = new LocalCasesRepository(); From a6a7570b9f72959db49ad21f9e0f8dc134a8b1f5 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:15:20 -0600 Subject: [PATCH 022/112] WIP - Begin testing orchestrator Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../functions/lib/adapters/utils/feature-flag.ts | 2 +- .../activity/flattenBoundingArrays.ts | 0 .../activity/getConsolidations.ts | 0 .../{poc => migration}/activity/getPageCount.ts | 0 .../activity/migrateConsolidation.ts | 0 .../client/trigger.function.ts} | 0 .../{poc => migration}/loadConsolidations.ts | 2 +- backend/functions/migration/migration.test.ts | 14 ++++++++++++++ .../orchestration/orchestrator.ts | 0 .../orchestration/sub-orchestrator-etl.ts | 0 .../orchestration/sub-orchestrator-paging.ts | 0 11 files changed, 16 insertions(+), 2 deletions(-) rename backend/functions/{poc => migration}/activity/flattenBoundingArrays.ts (100%) rename backend/functions/{poc => migration}/activity/getConsolidations.ts (100%) rename backend/functions/{poc => migration}/activity/getPageCount.ts (100%) rename backend/functions/{poc => migration}/activity/migrateConsolidation.ts (100%) rename backend/functions/{poc/client/dfClient.function.ts => migration/client/trigger.function.ts} (100%) rename backend/functions/{poc => migration}/loadConsolidations.ts (96%) create mode 100644 backend/functions/migration/migration.test.ts rename backend/functions/{poc => migration}/orchestration/orchestrator.ts (100%) rename backend/functions/{poc => migration}/orchestration/sub-orchestrator-etl.ts (100%) rename backend/functions/{poc => migration}/orchestration/sub-orchestrator-paging.ts (100%) diff --git a/backend/functions/lib/adapters/utils/feature-flag.ts b/backend/functions/lib/adapters/utils/feature-flag.ts index c596e056c..0a5788554 100644 --- a/backend/functions/lib/adapters/utils/feature-flag.ts +++ b/backend/functions/lib/adapters/utils/feature-flag.ts @@ -14,7 +14,7 @@ export async function getFeatureFlags(config: ApplicationConfiguration): Promise await client.waitForInitialization(); const state = await client.allFlagsState({ kind: 'user', - key: 'feature-flag-poc', + key: 'feature-flag-migration', anonymous: true, }); await client.flush(); diff --git a/backend/functions/poc/activity/flattenBoundingArrays.ts b/backend/functions/migration/activity/flattenBoundingArrays.ts similarity index 100% rename from backend/functions/poc/activity/flattenBoundingArrays.ts rename to backend/functions/migration/activity/flattenBoundingArrays.ts diff --git a/backend/functions/poc/activity/getConsolidations.ts b/backend/functions/migration/activity/getConsolidations.ts similarity index 100% rename from backend/functions/poc/activity/getConsolidations.ts rename to backend/functions/migration/activity/getConsolidations.ts diff --git a/backend/functions/poc/activity/getPageCount.ts b/backend/functions/migration/activity/getPageCount.ts similarity index 100% rename from backend/functions/poc/activity/getPageCount.ts rename to backend/functions/migration/activity/getPageCount.ts diff --git a/backend/functions/poc/activity/migrateConsolidation.ts b/backend/functions/migration/activity/migrateConsolidation.ts similarity index 100% rename from backend/functions/poc/activity/migrateConsolidation.ts rename to backend/functions/migration/activity/migrateConsolidation.ts diff --git a/backend/functions/poc/client/dfClient.function.ts b/backend/functions/migration/client/trigger.function.ts similarity index 100% rename from backend/functions/poc/client/dfClient.function.ts rename to backend/functions/migration/client/trigger.function.ts diff --git a/backend/functions/poc/loadConsolidations.ts b/backend/functions/migration/loadConsolidations.ts similarity index 96% rename from backend/functions/poc/loadConsolidations.ts rename to backend/functions/migration/loadConsolidations.ts index 9dbab8124..e19d32605 100644 --- a/backend/functions/poc/loadConsolidations.ts +++ b/backend/functions/migration/loadConsolidations.ts @@ -1,7 +1,7 @@ import * as df from 'durable-functions'; import { app } from '@azure/functions'; -import httpStart from './client/dfClient.function'; +import httpStart from './client/trigger.function'; import { main } from './orchestration/orchestrator'; import { subOrchestratorETL } from './orchestration/sub-orchestrator-etl'; import { subOrchestratorPaging } from './orchestration/sub-orchestrator-paging'; diff --git a/backend/functions/migration/migration.test.ts b/backend/functions/migration/migration.test.ts new file mode 100644 index 000000000..ead9ef8a0 --- /dev/null +++ b/backend/functions/migration/migration.test.ts @@ -0,0 +1,14 @@ +import httpStart from './client/trigger.function'; +import { HttpRequest, InvocationContext } from '@azure/functions'; + +describe.skip('migration tests', () => { + test('should call things', async () => { + const context = new InvocationContext(); + const request = new HttpRequest({ + body: { string: '{"chapters":["12","15"],"divisionCodes":["071","081"]}' }, + url: 'http://localhost:7071/migration', + method: 'POST', + }); + await httpStart(request, context); + }); +}); diff --git a/backend/functions/poc/orchestration/orchestrator.ts b/backend/functions/migration/orchestration/orchestrator.ts similarity index 100% rename from backend/functions/poc/orchestration/orchestrator.ts rename to backend/functions/migration/orchestration/orchestrator.ts diff --git a/backend/functions/poc/orchestration/sub-orchestrator-etl.ts b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts similarity index 100% rename from backend/functions/poc/orchestration/sub-orchestrator-etl.ts rename to backend/functions/migration/orchestration/sub-orchestrator-etl.ts diff --git a/backend/functions/poc/orchestration/sub-orchestrator-paging.ts b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts similarity index 100% rename from backend/functions/poc/orchestration/sub-orchestrator-paging.ts rename to backend/functions/migration/orchestration/sub-orchestrator-paging.ts From fb8aed4b3b9be1a0d36452c63b33484d37c6699d Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:07:47 -0500 Subject: [PATCH 023/112] Add history to migrated ACMS consolidations Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../use-cases/acms-orders/acms-orders.test.ts | 166 +++++++++++++++++- .../lib/use-cases/acms-orders/acms-orders.ts | 68 +++++-- 2 files changed, 216 insertions(+), 18 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 24949a74b..36eb2ac41 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -93,7 +93,7 @@ describe('ACMS Orders', () => { }, { caseId: childCases[1].caseId, - consolidationDate: '2024-02-01', + consolidationDate: '2024-01-01', consolidationType: 'administrative', }, ], @@ -123,7 +123,6 @@ describe('ACMS Orders', () => { const allCaseIds = Array.from(caseSummaryMap.keys()); allCaseIds.forEach((caseId) => { expectedHistory.push({ - caseId, documentType: 'AUDIT_CONSOLIDATION', before: null, after: { @@ -133,6 +132,7 @@ describe('ACMS Orders', () => { }, updatedBy: ACMS_SYSTEM_USER_REFERENCE, updatedOn: '2024-01-01', + caseId, }); }); @@ -169,6 +169,168 @@ describe('ACMS Orders', () => { }); }); + test('should histories for consolidations over a date range', async () => { + jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationFrom') + .mockResolvedValue(MockData.getConsolidationFrom()); + jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationTo') + .mockResolvedValue(MockData.getConsolidationTo()); + const createCaseHistorySpy = jest + .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') + .mockResolvedValue(); + + const leadCase = MockData.getCaseSummary(); + const childCases = MockData.buildArray(MockData.getCaseSummary, 4); + const details: AcmsConsolidation = { + leadCaseId: leadCase.caseId, + childCases: [ + { + caseId: childCases[0].caseId, + consolidationDate: '2024-01-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[1].caseId, + consolidationDate: '2024-01-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[2].caseId, + consolidationDate: '2024-02-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[3].caseId, + consolidationDate: '2024-03-01', + consolidationType: 'substantive', + }, + ], + }; + + const caseSummaryMap = new Map([ + [leadCase.caseId, leadCase], + [childCases[0].caseId, childCases[0]], + [childCases[1].caseId, childCases[1]], + [childCases[2].caseId, childCases[2]], + [childCases[3].caseId, childCases[3]], + ]); + + // History for lead case and 2 child cases on '2024-01-01' + const allHistories: CaseConsolidationHistory[] = []; + allHistories.push({ + caseId: childCases[0].caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-01-01', + }); + allHistories.push({ + caseId: childCases[1].caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-01-01', + }); + allHistories.push({ + caseId: leadCase.caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-01-01', + }); + + // History for lead case and next child case on '2024-02-01' + allHistories.push({ + caseId: childCases[2].caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [childCases[2]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-02-01', + }); + allHistories.push({ + caseId: leadCase.caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1]], + }, + after: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1], childCases[2]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-02-01', + }); + + // History for lead case and next child case on '2024-03-01' + allHistories.push({ + caseId: childCases[3].caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [childCases[3]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-03-01', + }); + allHistories.push({ + caseId: leadCase.caseId, + documentType: 'AUDIT_CONSOLIDATION', + before: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1], childCases[2]], + }, + after: { + status: 'approved', + leadCase, + childCases: [childCases[0], childCases[1], childCases[2], childCases[3]], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-03-01', + }); + + jest.spyOn(AcmsGatewayImpl.prototype, 'getConsolidationDetails').mockResolvedValue(details); + jest + .spyOn(CasesDxtrGateway.prototype, 'getCaseSummary') + .mockImplementation((_context, caseId) => { + return Promise.resolve(caseSummaryMap.get(caseId)); + }); + const useCase = new AcmsOrders(); + await useCase.migrateConsolidation(context, leadCase.caseId); + + console.log(JSON.stringify(allHistories)); + expect(createCaseHistorySpy).toHaveBeenCalledTimes(allHistories.length); + allHistories.forEach((history) => { + expect(createCaseHistorySpy).toHaveBeenCalledWith(history); + }); + }); + test('should throw exceptions', async () => { jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); const useCase = new AcmsOrders(); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 0794b80cd..6930bb2d5 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -58,6 +58,7 @@ export class AcmsOrders { leadCaseId: string, ): Promise { const report: AcmsConsolidationReport = { leadCaseId, success: true }; + const alltheHistory = []; try { const casesRepo = Factory.getCasesRepository(context); const dxtr = Factory.getCasesGateway(context); @@ -66,7 +67,7 @@ export class AcmsOrders { const basics = await acms.getConsolidationDetails(context, leadCaseId); const leadCase = await dxtr.getCaseSummary(context, leadCaseId); - const childCaseSummaries: CaseSummary[] = []; + const childCaseSummaries = new Map(); for (const childCase of basics.childCases) { // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. const consolidationType = childCase.consolidationType as ConsolidationType; @@ -87,30 +88,65 @@ export class AcmsOrders { orderDate: childCase.consolidationDate, otherCase, }; - childCaseSummaries.push(otherCase); + childCaseSummaries.set(otherCase.caseId, otherCase); // TODO: convert these functions to upsert because this _may_ run more than once await casesRepo.createConsolidationFrom(fromLink); await casesRepo.createConsolidationTo(toLink); } - const caseHistory: Omit = { - documentType: 'AUDIT_CONSOLIDATION', - before: null, - after: { + // Partition history by date. + const historyDateMap = new Map(); + basics.childCases.forEach((bCase) => { + if (historyDateMap.has(bCase.consolidationDate)) { + historyDateMap.get(bCase.consolidationDate).push(childCaseSummaries.get(bCase.caseId)); + } else { + historyDateMap.set(bCase.consolidationDate, [childCaseSummaries.get(bCase.caseId)]); + } + }); + + const consolidationDates = Array.from(historyDateMap.keys()).sort(); + let leadCaseHistoryBefore: CaseConsolidationHistory['before'] | null = null; + for (const consolidationDate of consolidationDates) { + const caseHistory: Omit = { + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: [...historyDateMap.get(consolidationDate)], + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: consolidationDate, + }; + + // Write the history for the child cases. + const caseIds = [...historyDateMap.get(consolidationDate).map((bCase) => bCase.caseId)]; + for (const caseId of caseIds) { + const childCaseHistory = { caseId, ...caseHistory }; + await casesRepo.createCaseHistory(childCaseHistory); + alltheHistory.push(childCaseHistory); + } + + // Write the history for the lead case. + const leadCaseHistoryAfter: CaseConsolidationHistory['after'] = { status: 'approved', leadCase, - childCases: childCaseSummaries, - }, - updatedBy: ACMS_SYSTEM_USER_REFERENCE, - updatedOn: basics.childCases[0].consolidationDate, - }; - - // TODO: Consider the case history will be different if the consolidation date is not the same for all child cases. - const allCaseIds = [leadCaseId, ...basics.childCases.map((bCase) => bCase.caseId)]; - for (const caseId of allCaseIds) { - await casesRepo.createCaseHistory({ ...caseHistory, caseId }); + childCases: leadCaseHistoryBefore + ? [...leadCaseHistoryBefore.childCases, ...historyDateMap.get(consolidationDate)] + : [...historyDateMap.get(consolidationDate)], + }; + const leadCaseHistory: CaseConsolidationHistory = { + caseId: leadCase.caseId, + ...caseHistory, + before: leadCaseHistoryBefore ? { ...leadCaseHistoryBefore } : null, + after: leadCaseHistoryAfter, + }; + await casesRepo.createCaseHistory(leadCaseHistory); + leadCaseHistoryBefore = leadCaseHistoryAfter; + alltheHistory.push(leadCaseHistory); } + console.log(JSON.stringify(alltheHistory)); } catch (error) { report.success = false; const camsError = getCamsError( From 12cb0d351e0a64bca1390576aeeaeca30f8a0959 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:12:02 -0500 Subject: [PATCH 024/112] Remove console.log Jira ticket: CAMS-461 --- .../functions/lib/use-cases/acms-orders/acms-orders.test.ts | 1 - backend/functions/lib/use-cases/acms-orders/acms-orders.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 36eb2ac41..aeaf20c4e 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -324,7 +324,6 @@ describe('ACMS Orders', () => { const useCase = new AcmsOrders(); await useCase.migrateConsolidation(context, leadCase.caseId); - console.log(JSON.stringify(allHistories)); expect(createCaseHistorySpy).toHaveBeenCalledTimes(allHistories.length); allHistories.forEach((history) => { expect(createCaseHistorySpy).toHaveBeenCalledWith(history); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 6930bb2d5..10dc044b9 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -58,7 +58,6 @@ export class AcmsOrders { leadCaseId: string, ): Promise { const report: AcmsConsolidationReport = { leadCaseId, success: true }; - const alltheHistory = []; try { const casesRepo = Factory.getCasesRepository(context); const dxtr = Factory.getCasesGateway(context); @@ -125,7 +124,6 @@ export class AcmsOrders { for (const caseId of caseIds) { const childCaseHistory = { caseId, ...caseHistory }; await casesRepo.createCaseHistory(childCaseHistory); - alltheHistory.push(childCaseHistory); } // Write the history for the lead case. @@ -144,9 +142,7 @@ export class AcmsOrders { }; await casesRepo.createCaseHistory(leadCaseHistory); leadCaseHistoryBefore = leadCaseHistoryAfter; - alltheHistory.push(leadCaseHistory); } - console.log(JSON.stringify(alltheHistory)); } catch (error) { report.success = false; const camsError = getCamsError( From eab0a27e36a8429310ca4a7a3accb4bf845c4f13 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:40:16 -0500 Subject: [PATCH 025/112] Add logic to not migrate previously migrated cases Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../lib/use-cases/acms-orders/acms-orders.ts | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 10dc044b9..6f9d14f22 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -57,6 +57,7 @@ export class AcmsOrders { context: ApplicationContext, leadCaseId: string, ): Promise { + // TODO: Add child case count to the report?? const report: AcmsConsolidationReport = { leadCaseId, success: true }; try { const casesRepo = Factory.getCasesRepository(context); @@ -66,9 +67,43 @@ export class AcmsOrders { const basics = await acms.getConsolidationDetails(context, leadCaseId); const leadCase = await dxtr.getCaseSummary(context, leadCaseId); + // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. + // Check if exported child cases have already been migrated. + const existingConsolidations = await casesRepo.getConsolidation(leadCaseId); + const existingChildCaseIds = existingConsolidations + .filter((link) => link.documentType === 'CONSOLIDATION_FROM') + .map((link) => link.otherCase.caseId) + .reduce((acc, caseId) => { + acc.add(caseId); + return acc; + }, new Set()); + + const exportedChildCaseIds = basics.childCases + .map((bCase) => bCase.caseId) + .reduce((acc, caseId) => { + acc.add(caseId); + return acc; + }, new Set()); + + const unimportedChildCaseIds = new Set(); + exportedChildCaseIds.forEach((caseId) => { + if (!existingChildCaseIds.has(caseId)) { + unimportedChildCaseIds.add(caseId); + } + }); + + // Return early if there is no work to do. + if (unimportedChildCaseIds.size === 0) { + return report; + } + + // Load any child cases that have not been migrated. const childCaseSummaries = new Map(); - for (const childCase of basics.childCases) { - // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. + const filteredBasicsChildCases = basics.childCases.filter((bCase) => + unimportedChildCaseIds.has(bCase.caseId), + ); + + for (const childCase of filteredBasicsChildCases) { const consolidationType = childCase.consolidationType as ConsolidationType; const toLink: ConsolidationTo = { @@ -89,14 +124,13 @@ export class AcmsOrders { }; childCaseSummaries.set(otherCase.caseId, otherCase); - // TODO: convert these functions to upsert because this _may_ run more than once await casesRepo.createConsolidationFrom(fromLink); await casesRepo.createConsolidationTo(toLink); } // Partition history by date. const historyDateMap = new Map(); - basics.childCases.forEach((bCase) => { + filteredBasicsChildCases.forEach((bCase) => { if (historyDateMap.has(bCase.consolidationDate)) { historyDateMap.get(bCase.consolidationDate).push(childCaseSummaries.get(bCase.caseId)); } else { From a56d8a1793252c1b3d1e2b1d1c5e624853febb28 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:38:25 -0600 Subject: [PATCH 026/112] Ignore orchestrators and client Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/functions/jest.config.js | 3 +++ backend/functions/lib/adapters/gateways/mssql.ts | 2 +- ...ction.ts => acms-migration-trigger.function.ts} | 0 backend/functions/migration/loadConsolidations.ts | 2 +- backend/functions/migration/migration.test.ts | 14 -------------- 5 files changed, 5 insertions(+), 16 deletions(-) rename backend/functions/migration/client/{trigger.function.ts => acms-migration-trigger.function.ts} (100%) delete mode 100644 backend/functions/migration/migration.test.ts diff --git a/backend/functions/jest.config.js b/backend/functions/jest.config.js index 2e88d2edb..ff284ec8a 100644 --- a/backend/functions/jest.config.js +++ b/backend/functions/jest.config.js @@ -28,6 +28,9 @@ module.exports = { 'lib/testing/testing-utilities.ts', 'jest.*config.js', 'lib/adapters/gateways/okta/HumbleVerifier.ts', + 'migration/client/', + 'migration/orchestration/', + 'migration/loadConsolidations.ts', ], testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)', '!**/?(*.)+(integration).(spec|test).[jt]s?(x)'], }; diff --git a/backend/functions/lib/adapters/gateways/mssql.ts b/backend/functions/lib/adapters/gateways/mssql.ts index 2dc0c840b..23a04c7a3 100644 --- a/backend/functions/lib/adapters/gateways/mssql.ts +++ b/backend/functions/lib/adapters/gateways/mssql.ts @@ -91,7 +91,7 @@ export abstract class AbstractDbClient implements Closable { } public async close(): Promise { - this.connectionPool.close(); + await this.connectionPool.close(); } } diff --git a/backend/functions/migration/client/trigger.function.ts b/backend/functions/migration/client/acms-migration-trigger.function.ts similarity index 100% rename from backend/functions/migration/client/trigger.function.ts rename to backend/functions/migration/client/acms-migration-trigger.function.ts diff --git a/backend/functions/migration/loadConsolidations.ts b/backend/functions/migration/loadConsolidations.ts index e19d32605..d27decf07 100644 --- a/backend/functions/migration/loadConsolidations.ts +++ b/backend/functions/migration/loadConsolidations.ts @@ -1,7 +1,7 @@ import * as df from 'durable-functions'; import { app } from '@azure/functions'; -import httpStart from './client/trigger.function'; +import httpStart from './client/acms-migration-trigger.function'; import { main } from './orchestration/orchestrator'; import { subOrchestratorETL } from './orchestration/sub-orchestrator-etl'; import { subOrchestratorPaging } from './orchestration/sub-orchestrator-paging'; diff --git a/backend/functions/migration/migration.test.ts b/backend/functions/migration/migration.test.ts deleted file mode 100644 index ead9ef8a0..000000000 --- a/backend/functions/migration/migration.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import httpStart from './client/trigger.function'; -import { HttpRequest, InvocationContext } from '@azure/functions'; - -describe.skip('migration tests', () => { - test('should call things', async () => { - const context = new InvocationContext(); - const request = new HttpRequest({ - body: { string: '{"chapters":["12","15"],"divisionCodes":["071","081"]}' }, - url: 'http://localhost:7071/migration', - method: 'POST', - }); - await httpStart(request, context); - }); -}); From 7fd0e016bcd91f15c5cc312c72074a59581dce9f Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:00:12 -0500 Subject: [PATCH 027/112] Add additional tests for acms orders use case Jira ticket: CAMS-461 --- .../use-cases/acms-orders/acms-orders.test.ts | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index aeaf20c4e..6245fd70e 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -10,6 +10,7 @@ import { CaseSummary } from '../../../../../common/src/cams/cases'; import { ConsolidationType } from '../../../../../common/src/cams/orders'; import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; +import { ConsolidationFrom } from '../../../../../common/src/cams/events'; const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { @@ -80,6 +81,9 @@ describe('ACMS Orders', () => { const createCaseHistorySpy = jest .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') .mockResolvedValue(); + const getConsolidationSpy = jest + .spyOn(CasesMongoRepository.prototype, 'getConsolidation') + .mockResolvedValue([]); const leadCase = MockData.getCaseSummary(); const childCases = [MockData.getCaseSummary(), MockData.getCaseSummary()]; @@ -154,6 +158,7 @@ describe('ACMS Orders', () => { const useCase = new AcmsOrders(); await useCase.migrateConsolidation(context, leadCase.caseId); + expect(getConsolidationSpy).toHaveBeenCalled(); expect(createConsolidationToSpy).toHaveBeenCalledTimes(childCases.length); expect(createConsolidationFromSpy).toHaveBeenCalledTimes(childCases.length); expect(createCaseHistorySpy).toHaveBeenCalledTimes(expectedHistory.length); @@ -179,6 +184,7 @@ describe('ACMS Orders', () => { const createCaseHistorySpy = jest .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') .mockResolvedValue(); + jest.spyOn(CasesMongoRepository.prototype, 'getConsolidation').mockResolvedValue([]); const leadCase = MockData.getCaseSummary(); const childCases = MockData.buildArray(MockData.getCaseSummary, 4); @@ -330,6 +336,199 @@ describe('ACMS Orders', () => { }); }); + test('should not write links for links that have already been written', async () => { + const createConsolidationFromSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationFrom') + .mockResolvedValue(MockData.getConsolidationFrom()); + const createConsolidationToSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationTo') + .mockResolvedValue(MockData.getConsolidationTo()); + const createCaseHistorySpy = jest + .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') + .mockResolvedValue(); + + const leadCase = MockData.getCaseSummary(); + const childCases = [MockData.getCaseSummary(), MockData.getCaseSummary()]; + const details: AcmsConsolidation = { + leadCaseId: leadCase.caseId, + childCases: [ + { + caseId: childCases[0].caseId, + consolidationDate: '2024-01-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[1].caseId, + consolidationDate: '2024-02-01', + consolidationType: 'substantive', + }, + ], + }; + + // Create a single existing link for the first record coming back from ACMS + const existingToLink: ConsolidationFrom = { + consolidationType: 'substantive', + caseId: leadCase.caseId, + documentType: 'CONSOLIDATION_FROM', + orderDate: '2024-01-01', + otherCase: childCases[0], + }; + const existingChildCaseId = childCases[0].caseId; + jest + .spyOn(CasesMongoRepository.prototype, 'getConsolidation') + .mockResolvedValue([existingToLink]); + + const caseSummaryMap = new Map([ + [leadCase.caseId, leadCase], + [childCases[0].caseId, childCases[0]], + [childCases[1].caseId, childCases[1]], + ]); + + const filterExistingCase = (bCase) => bCase.caseId !== existingChildCaseId; + + const expectedFromLinks = details.childCases.filter(filterExistingCase).map((bCase) => { + const caseId = leadCase.caseId; + const orderDate = bCase.consolidationDate; + const consolidationType = bCase.consolidationType as ConsolidationType; + return MockData.getConsolidationFrom({ + override: { + caseId, + consolidationType, + orderDate, + otherCase: caseSummaryMap.get(bCase.caseId), + }, + }); + }); + + const expectedHistory: CaseConsolidationHistory[] = []; + expectedHistory.push({ + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: childCases.filter(filterExistingCase), + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-02-01', + caseId: childCases[1].caseId, + }); + expectedHistory.push({ + documentType: 'AUDIT_CONSOLIDATION', + before: null, + after: { + status: 'approved', + leadCase, + childCases: childCases.filter(filterExistingCase), + }, + updatedBy: ACMS_SYSTEM_USER_REFERENCE, + updatedOn: '2024-02-01', + caseId: leadCase.caseId, + }); + + const expectedToLinks = details.childCases.filter(filterExistingCase).map((bCase) => { + const caseId = bCase.caseId; + const orderDate = bCase.consolidationDate; + const consolidationType = bCase.consolidationType as ConsolidationType; + return MockData.getConsolidationTo({ + override: { caseId, consolidationType, orderDate, otherCase: leadCase }, + }); + }); + + jest.spyOn(AcmsGatewayImpl.prototype, 'getConsolidationDetails').mockResolvedValue(details); + jest + .spyOn(CasesDxtrGateway.prototype, 'getCaseSummary') + .mockImplementation((_context, caseId) => { + return Promise.resolve(caseSummaryMap.get(caseId)); + }); + const useCase = new AcmsOrders(); + await useCase.migrateConsolidation(context, leadCase.caseId); + + expect(createConsolidationToSpy).toHaveBeenCalledTimes(expectedToLinks.length); + expect(createConsolidationFromSpy).toHaveBeenCalledTimes(expectedFromLinks.length); + expect(createCaseHistorySpy).toHaveBeenCalledTimes(expectedHistory.length); + + expectedFromLinks.forEach((fromLink) => { + expect(createConsolidationFromSpy).toHaveBeenCalledWith(fromLink); + }); + expectedToLinks.forEach((toLink) => { + expect(createConsolidationToSpy).toHaveBeenCalledWith(toLink); + }); + expectedHistory.forEach((history) => { + expect(createCaseHistorySpy).toHaveBeenCalledWith(history); + }); + }); + + test('should not do anything if consolidations from ACMS are already in the cases repo', async () => { + const createConsolidationFromSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationFrom') + .mockResolvedValue(MockData.getConsolidationFrom()); + const createConsolidationToSpy = jest + .spyOn(CasesMongoRepository.prototype, 'createConsolidationTo') + .mockResolvedValue(MockData.getConsolidationTo()); + const createCaseHistorySpy = jest + .spyOn(CasesMongoRepository.prototype, 'createCaseHistory') + .mockResolvedValue(); + + const leadCase = MockData.getCaseSummary(); + const childCases = [MockData.getCaseSummary(), MockData.getCaseSummary()]; + const details: AcmsConsolidation = { + leadCaseId: leadCase.caseId, + childCases: [ + { + caseId: childCases[0].caseId, + consolidationDate: '2024-01-01', + consolidationType: 'substantive', + }, + { + caseId: childCases[1].caseId, + consolidationDate: '2024-02-01', + consolidationType: 'substantive', + }, + ], + }; + + // Create a single existing link for the first record coming back from ACMS + const existingToLinks: ConsolidationFrom[] = [ + { + consolidationType: 'substantive', + caseId: leadCase.caseId, + documentType: 'CONSOLIDATION_FROM', + orderDate: '2024-01-01', + otherCase: childCases[0], + }, + { + consolidationType: 'substantive', + caseId: leadCase.caseId, + documentType: 'CONSOLIDATION_FROM', + orderDate: '2024-01-01', + otherCase: childCases[1], + }, + ]; + jest + .spyOn(CasesMongoRepository.prototype, 'getConsolidation') + .mockResolvedValue(existingToLinks); + + const caseSummaryMap = new Map([ + [leadCase.caseId, leadCase], + [childCases[0].caseId, childCases[0]], + [childCases[1].caseId, childCases[1]], + ]); + + jest.spyOn(AcmsGatewayImpl.prototype, 'getConsolidationDetails').mockResolvedValue(details); + jest + .spyOn(CasesDxtrGateway.prototype, 'getCaseSummary') + .mockImplementation((_context, caseId) => { + return Promise.resolve(caseSummaryMap.get(caseId)); + }); + const useCase = new AcmsOrders(); + await useCase.migrateConsolidation(context, leadCase.caseId); + + expect(createConsolidationToSpy).not.toHaveBeenCalled(); + expect(createConsolidationFromSpy).not.toHaveBeenCalled(); + expect(createCaseHistorySpy).not.toHaveBeenCalled(); + }); + test('should throw exceptions', async () => { jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); const useCase = new AcmsOrders(); From 21b4a27bcfaf0e8b9696ebf3d85b7dda50dbefdc Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Mon, 25 Nov 2024 15:57:33 -0700 Subject: [PATCH 028/112] WIP: Test coverage. Need to bring coverage for mssql module up to standard. Currently 10% branch coverage. Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../lib/adapters/gateways/mssql.test.ts | 75 +++++++++++++++++++ backend/functions/lib/factory.test.ts | 65 +++++++++++++++- backend/functions/lib/factory.ts | 7 +- .../activity/flattenBoundingArrays.test.ts | 21 ++++++ .../activity/flattenBoundingArrays.ts | 4 +- .../activity/getConsolidations.test.ts | 44 +++++++++++ .../migration/activity/getConsolidations.ts | 4 +- .../migration/activity/getPageCount.test.ts | 44 +++++++++++ .../migration/activity/getPageCount.ts | 5 +- .../activity/migrateConsolidation.ts | 2 +- .../activity/migrateConsolidations.test.ts | 37 +++++++++ 11 files changed, 293 insertions(+), 15 deletions(-) create mode 100644 backend/functions/lib/adapters/gateways/mssql.test.ts create mode 100644 backend/functions/migration/activity/flattenBoundingArrays.test.ts create mode 100644 backend/functions/migration/activity/getConsolidations.test.ts create mode 100644 backend/functions/migration/activity/getPageCount.test.ts create mode 100644 backend/functions/migration/activity/migrateConsolidations.test.ts diff --git a/backend/functions/lib/adapters/gateways/mssql.test.ts b/backend/functions/lib/adapters/gateways/mssql.test.ts new file mode 100644 index 000000000..0f137b7dd --- /dev/null +++ b/backend/functions/lib/adapters/gateways/mssql.test.ts @@ -0,0 +1,75 @@ +import { QueryResults, IDbConfig } from '../types/database'; +import { createMockApplicationContext } from '../../testing/testing-utilities'; +import { AbstractDbClient } from './mssql'; +import { ApplicationContext } from '../types/basic'; +import { IResult } from 'mssql'; + +type sqlConnect = { + request: () => void; + close: () => void; + query: () => void; +}; + +jest.mock('mssql', () => { + return { + ConnectionPool: jest.fn().mockImplementation(() => { + return { + connect: jest.fn().mockImplementation( + (): Promise => + Promise.resolve({ + request: jest.fn().mockImplementation(() => ({ + input: jest.fn(), + query: jest + .fn() + .mockImplementation( + (): Promise> => + Promise.resolve({ recordset: 'test string' } as unknown as IResult), + ), + })), + close: jest.fn(), + query: jest + .fn() + .mockImplementation( + (): Promise => + Promise.resolve("this is not the string you're looking for"), + ), + }), + ), + }; + }), + }; +}); + +describe('Abstract MS-SQL client', () => { + test('should get appropriate results', async () => { + const applicationContext = await createMockApplicationContext(); + // setup test + // execute method under test + const context = applicationContext; + const query = 'SELECT * FROM foo WHERE data = @param1 AND name=@param2'; + const input = [ + { + name: 'param1', + type: null, + value: 'dataValue', + }, + { + name: 'param2', + type: null, + value: 'nameValue', + }, + ]; + + // execute method under test + class TestDbClient extends AbstractDbClient { + constructor(context: ApplicationContext, config: IDbConfig, childModuleName: string) { + super(context, config, childModuleName); + } + } + const client = new TestDbClient(context, context.config.dxtrDbConfig, 'TEST_MODULE'); + const queryResult: QueryResults = await client.executeQuery(context, query, input); + + // assert + expect(queryResult).toEqual({ results: 'test string', message: '', success: true }); + }); +}); diff --git a/backend/functions/lib/factory.test.ts b/backend/functions/lib/factory.test.ts index bf0821176..265166247 100644 --- a/backend/functions/lib/factory.test.ts +++ b/backend/functions/lib/factory.test.ts @@ -9,14 +9,19 @@ describe('Factory functions', () => { let RuntimeStateMongoRepository; let MockMongoRepository; let OrdersMongoRepository; + let ConsolidationOrdersMongoRepository; let CaseAssignmentMongoRepository; let MockOfficesGateway; let MockOrdersGateway; let DxtrOrdersGateway; let OfficesDxtrGateway; + let OfficesMongoRepository; let CaseDocketUseCase; let CasesLocalGateway; let CasesDxtrGateway; + let UserSessionCacheRepository; + let UserSessionUseCase; + let OktaGateway; beforeEach(async () => { await jest.isolateModulesAsync(async () => { @@ -32,6 +37,14 @@ describe('Factory functions', () => { OrdersMongoRepository = (await import('./adapters/gateways/mongo/orders.mongo.repository')) .OrdersMongoRepository; + UserSessionCacheRepository = ( + await import('./adapters/gateways/mongo/user-session-cache.mongo.repository') + ).UserSessionCacheMongoRepository; + + ConsolidationOrdersMongoRepository = ( + await import('./adapters/gateways/mongo/consolidations.mongo.repository') + ).default; + MockOfficesGateway = (await import('./testing/mock-gateways/mock.offices.gateway')) .MockOfficesGateway; @@ -49,15 +62,25 @@ describe('Factory functions', () => { .CasesLocalGateway; CasesDxtrGateway = (await import('./adapters/gateways/dxtr/cases.dxtr.gateway')).default; + CaseAssignmentMongoRepository = ( await import('./adapters/gateways/mongo/case-assignment.mongo.repository') ).CaseAssignmentMongoRepository; + + OfficesMongoRepository = (await import('./adapters/gateways/mongo/offices.mongo.repository')) + .OfficesMongoRepository; + + UserSessionUseCase = (await import('./use-cases/user-session/user-session')) + .UserSessionUseCase; + + OktaGateway = (await import('./adapters/gateways/okta/okta-gateway')).default; }); }); beforeAll(async () => { dbContext = await createMockApplicationContext({ env: { + CAMS_LOGIN_PROVIDER: 'okta', DATABASE_MOCK: 'false', COSMOS_ENDPOINT: 'https://cosmos-ustp-cams-dev.documents.azure.us:443/', }, @@ -105,6 +128,14 @@ describe('Factory functions', () => { expect(obj).toBeInstanceOf(DxtrOrdersGateway); }); + test('getOfficesRepository', async () => { + const context = { ...dbContext }; + context.config.authConfig.provider = 'okta'; + + const obj = factory.getOfficesRepository(context); + expect(obj).toBeInstanceOf(OfficesMongoRepository); + }); + test('getOfficesGateway mock', async () => { const mockObj = factory.getOfficesGateway(mockDbContext); expect(mockObj).toBeInstanceOf(MockOfficesGateway); @@ -120,7 +151,17 @@ describe('Factory functions', () => { expect(mockObj).toBeInstanceOf(MockMongoRepository); }); - test('getOrdersRepository DXTR', async () => { + test('getConsolidationOrdersRepository', async () => { + const obj = factory.getConsolidationOrdersRepository(dbContext); + expect(obj).toBeInstanceOf(ConsolidationOrdersMongoRepository); + }); + + test('getUserSessionCacheRepository', async () => { + const obj = factory.getUserSessionCacheRepository(dbContext); + expect(obj).toBeInstanceOf(UserSessionCacheRepository); + }); + + test('getOrdersRepository', async () => { const obj = factory.getOrdersRepository(dbContext); expect(obj).toBeInstanceOf(OrdersMongoRepository); }); @@ -129,4 +170,26 @@ describe('Factory functions', () => { const obj = factory.getRuntimeStateRepository(dbContext); expect(obj).toBeInstanceOf(RuntimeStateMongoRepository); }); + + test('getAuthorizationGateway should return null if no recognized provider', async () => { + const contextWithInvalidProvider = { ...dbContext }; + contextWithInvalidProvider.config.authConfig.provider = 'test'; + const result = factory.getAuthorizationGateway(contextWithInvalidProvider); + expect(result).toBeNull(); + }); + + test('getAuthorizationGateway should return real gateway', async () => { + const contextWithOkta = { ...dbContext }; + contextWithOkta.config.authConfig.provider = 'okta'; + const result = factory.getAuthorizationGateway(contextWithOkta); + expect(result).toEqual(OktaGateway); + }); + + test('getUserSessionUseCase', async () => { + const context = { ...dbContext }; + context.config.authConfig.provider = 'okta'; + + const obj = factory.getUserSessionUseCase(context); + expect(obj).toBeInstanceOf(UserSessionUseCase); + }); }); diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index 3d07fc091..fdafe83bf 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -3,7 +3,7 @@ import { CasesInterface } from './use-cases/cases.interface'; import { ApplicationContext } from './adapters/types/basic'; import { CasesLocalGateway } from './adapters/gateways/cases.local.gateway'; import CasesDxtrGateway from './adapters/gateways/dxtr/cases.dxtr.gateway'; -import { DocumentDbConfig, IDbConfig } from './adapters/types/database'; +import { IDbConfig } from './adapters/types/database'; import { CaseDocketUseCase } from './use-cases/case-docket/case-docket'; import { DxtrCaseDocketGateway } from './adapters/gateways/dxtr/case-docket.dxtr.gateway'; import { MockCaseDocketGateway } from './adapters/gateways/dxtr/case-docket.mock.gateway'; @@ -77,10 +77,6 @@ export const getAssignmentRepository = ( return new CaseAssignmentMongoRepository(applicationContext); }; -export const getCosmosConfig = (applicationContext: ApplicationContext): DocumentDbConfig => { - return applicationContext.config.get('cosmosConfig'); -}; - export const getCaseDocketUseCase = (context: ApplicationContext): CaseDocketUseCase => { const gateway = context.config.get('dbMock') ? new MockCaseDocketGateway() @@ -215,7 +211,6 @@ export const Factory = { getAttorneyGateway, getCasesGateway, getAssignmentRepository, - getCosmosConfig, getCaseDocketUseCase, getSqlConnection, getOrdersGateway, diff --git a/backend/functions/migration/activity/flattenBoundingArrays.test.ts b/backend/functions/migration/activity/flattenBoundingArrays.test.ts new file mode 100644 index 000000000..acaacbeeb --- /dev/null +++ b/backend/functions/migration/activity/flattenBoundingArrays.test.ts @@ -0,0 +1,21 @@ +import { InvocationContext } from '@azure/functions'; +import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import module from './flattenBoundingArrays'; + +describe('Flatten bounding arrays activity', () => { + test('should transform bounding arrays into predicates', async () => { + const context = {} as InvocationContext; + const bounds: Bounds = { + chapters: ['11', '15'], + divisionCodes: ['000', '111'], + }; + const expectedOuput: Predicate[] = [ + { chapter: '11', divisionCode: '000' }, + { chapter: '11', divisionCode: '111' }, + { chapter: '15', divisionCode: '000' }, + { chapter: '15', divisionCode: '111' }, + ]; + const output = await module.handler(bounds, context); + expect(output).toEqual(expectedOuput); + }); +}); diff --git a/backend/functions/migration/activity/flattenBoundingArrays.ts b/backend/functions/migration/activity/flattenBoundingArrays.ts index d7a60a6d6..4eb21c0d2 100644 --- a/backend/functions/migration/activity/flattenBoundingArrays.ts +++ b/backend/functions/migration/activity/flattenBoundingArrays.ts @@ -6,8 +6,8 @@ async function flattenBoundingArrays( _context: InvocationContext, ): Promise { const predicates: Predicate[] = []; - for (const chapter in bounds.chapters) { - for (const divisionCode in bounds.divisionCodes) { + for (const chapter of bounds.chapters) { + for (const divisionCode of bounds.divisionCodes) { predicates.push({ divisionCode, chapter, diff --git a/backend/functions/migration/activity/getConsolidations.test.ts b/backend/functions/migration/activity/getConsolidations.test.ts new file mode 100644 index 000000000..a9ad3f527 --- /dev/null +++ b/backend/functions/migration/activity/getConsolidations.test.ts @@ -0,0 +1,44 @@ +import { InvocationContext } from '@azure/functions'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import module from './getConsolidations'; +import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; +import { CamsError } from '../../lib/common-errors/cams-error'; + +describe('getConsolidations test', () => { + afterEach(() => { + jest.restoreAllMocks(); + }); + + test('should call getLeadCaseIds controller method', async () => { + const expected = ['000-11-22222', '333-44-55555']; + const getLeadCaseIdsSpy = jest + .spyOn(AcmsOrdersController.prototype, 'getLeadCaseIds') + .mockResolvedValue(expected); + + const context = createMockAzureFunctionContext(); + const input: PredicateAndPage = { + divisionCode: '101', + chapter: '15', + pageNumber: 1, + }; + + const actual = await module.handler(input, context); + expect(getLeadCaseIdsSpy).toHaveBeenCalledWith(expect.anything(), input); + expect(actual).toEqual(expected); + }); + + test('should properly handle error when getLeadCaseIds controller throws an error', async () => { + const error = new CamsError('TEST_MODULE', { message: 'getConsolidation Error' }); + jest.spyOn(AcmsOrdersController.prototype, 'getLeadCaseIds').mockRejectedValue(error); + + const context: InvocationContext = {} as InvocationContext; + const input: PredicateAndPage = { + divisionCode: '101', + chapter: '15', + pageNumber: 1, + }; + + await expect(module.handler(input, context)).rejects.toThrow(error); + }); +}); diff --git a/backend/functions/migration/activity/getConsolidations.ts b/backend/functions/migration/activity/getConsolidations.ts index 5f01fcb69..f51be13a4 100644 --- a/backend/functions/migration/activity/getConsolidations.ts +++ b/backend/functions/migration/activity/getConsolidations.ts @@ -8,11 +8,11 @@ const MODULE_NAME = 'IMPORT_ACTION_GET_CONSOLIDATIONS'; async function getConsolidations(input: PredicateAndPage, invocationContext: InvocationContext) { const logger = ContextCreator.getLogger(invocationContext); - const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + const context = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); try { - return controller.getLeadCaseIds(context, input); + return await controller.getLeadCaseIds(context, input); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } diff --git a/backend/functions/migration/activity/getPageCount.test.ts b/backend/functions/migration/activity/getPageCount.test.ts new file mode 100644 index 000000000..055d60968 --- /dev/null +++ b/backend/functions/migration/activity/getPageCount.test.ts @@ -0,0 +1,44 @@ +import { InvocationContext } from '@azure/functions'; +import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; +import { CamsError } from '../../lib/common-errors/cams-error'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import module from './getPageCount'; + +describe('getPageCount test', () => { + afterEach(() => { + jest.restoreAllMocks(); + }); + + test('should call getPageCount controller method', async () => { + const expected = 3; + const getPageCountSpy = jest + .spyOn(AcmsOrdersController.prototype, 'getPageCount') + .mockResolvedValue(expected); + + const context = createMockAzureFunctionContext(); + const input: PredicateAndPage = { + divisionCode: '101', + chapter: '15', + pageNumber: 1, + }; + + const actual = await module.handler(input, context); + expect(getPageCountSpy).toHaveBeenCalledWith(expect.anything(), input); + expect(actual).toEqual(expected); + }); + + test('should properly handle error when getPageCount controller throws an error', async () => { + const error = new CamsError('TEST_MODULE', { message: 'getPageCount Error' }); + jest.spyOn(AcmsOrdersController.prototype, 'getPageCount').mockRejectedValue(error); + + const context: InvocationContext = {} as InvocationContext; + const input: PredicateAndPage = { + divisionCode: '101', + chapter: '15', + pageNumber: 1, + }; + + await expect(module.handler(input, context)).rejects.toThrow(error); + }); +}); diff --git a/backend/functions/migration/activity/getPageCount.ts b/backend/functions/migration/activity/getPageCount.ts index 64a707ef1..ff43f436b 100644 --- a/backend/functions/migration/activity/getPageCount.ts +++ b/backend/functions/migration/activity/getPageCount.ts @@ -8,12 +8,11 @@ const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; async function getPageCount(input: PredicateAndPage, invocationContext: InvocationContext) { const logger = ContextCreator.getLogger(invocationContext); - const context = await ContextCreator.applicationContextCreator(invocationContext, logger); + const context = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); try { - console.log('#################GetPageCount', JSON.stringify(input)); - return controller.getPageCount(context, input); + return await controller.getPageCount(context, input); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } diff --git a/backend/functions/migration/activity/migrateConsolidation.ts b/backend/functions/migration/activity/migrateConsolidation.ts index b1d3c8d3d..a58c166f6 100644 --- a/backend/functions/migration/activity/migrateConsolidation.ts +++ b/backend/functions/migration/activity/migrateConsolidation.ts @@ -15,7 +15,7 @@ async function migrateConsolidation( const controller = new AcmsOrdersController(); try { - return controller.migrateConsolidation(appContext, leadCaseId); + return await controller.migrateConsolidation(appContext, leadCaseId); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } diff --git a/backend/functions/migration/activity/migrateConsolidations.test.ts b/backend/functions/migration/activity/migrateConsolidations.test.ts new file mode 100644 index 000000000..80603afe3 --- /dev/null +++ b/backend/functions/migration/activity/migrateConsolidations.test.ts @@ -0,0 +1,37 @@ +import { InvocationContext } from '@azure/functions'; +import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import module from './migrateConsolidation'; +import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; +import { CamsError } from '../../lib/common-errors/cams-error'; + +describe('getConsolidations test', () => { + afterEach(() => { + jest.restoreAllMocks(); + }); + + test('should call getLeadCaseIds controller method', async () => { + const caseId = '000-11-22222'; + const expected = { + leadCaseId: caseId, + success: true, + }; + const getLeadCaseIdsSpy = jest + .spyOn(AcmsOrdersController.prototype, 'migrateConsolidation') + .mockResolvedValue(expected); + + const context = createMockAzureFunctionContext(); + + const actual = await module.handler(caseId, context); + expect(getLeadCaseIdsSpy).toHaveBeenCalledWith(expect.anything(), caseId); + expect(actual).toEqual(expected); + }); + + test('should properly handle error when getLeadCaseIds controller throws an error', async () => { + const error = new CamsError('TEST_MODULE', { message: 'getConsolidation Error' }); + jest.spyOn(AcmsOrdersController.prototype, 'migrateConsolidation').mockRejectedValue(error); + + const context: InvocationContext = {} as InvocationContext; + + await expect(module.handler('000-11-22222', context)).rejects.toThrow(error); + }); +}); From c42f40d25741bb14f564c29096e3174220448ecf Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Tue, 26 Nov 2024 17:00:41 -0700 Subject: [PATCH 029/112] Test coverage on abstract-mssql-client Renamed mssql.ts to abstract-mssql-client.ts. Brought test coverage up to 100%. WIP Bringing acms.gateway.ts test coverage up. Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- .../abstract-mssql-client.exception.test.ts | 176 ++++++++++++++++++ ....test.ts => abstract-mssql-client.test.ts} | 4 +- .../{mssql.ts => abstract-mssql-client.ts} | 31 +-- .../gateways/acms/acms.gateway.test.ts | 67 ++++++- .../adapters/gateways/acms/acms.gateway.ts | 4 +- 5 files changed, 259 insertions(+), 23 deletions(-) create mode 100644 backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts rename backend/functions/lib/adapters/gateways/{mssql.test.ts => abstract-mssql-client.test.ts} (95%) rename backend/functions/lib/adapters/gateways/{mssql.ts => abstract-mssql-client.ts} (84%) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts new file mode 100644 index 000000000..30cb94144 --- /dev/null +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -0,0 +1,176 @@ +import { QueryResults, IDbConfig } from '../types/database'; +import { ConnectionError, MSSQLError, RequestError } from 'mssql'; +import { createMockApplicationContext } from '../../testing/testing-utilities'; +import { AbstractMssqlClient } from './abstract-mssql-client'; +import { ApplicationContext } from '../types/basic'; + +// Setting default Jest mocks for mssql +// eslint-disable-next-line no-var +var connectionError = new ConnectionError(''); +// eslint-disable-next-line no-var +var requestError = new RequestError(''); +// eslint-disable-next-line no-var +var mssqlError = new MSSQLError(''); + +type AggregateError = Error & { + errors?: Error[]; +}; + +const mockClose = jest.fn(); +const mockConnectionPoolClose = jest.fn(); +const mockQuery = jest.fn(); +const mockRequest = jest.fn().mockImplementation(() => ({ + input: jest.fn(), + query: mockQuery, +})); +const mockConnect = jest.fn().mockImplementation( + (): Promise => + Promise.resolve({ + request: mockRequest, + close: mockClose, + }), +); +jest.mock('mssql', () => { + return { + ConnectionError: jest.fn().mockReturnValue(connectionError), + RequestError: jest.fn().mockReturnValue(requestError), + MSSQLError: jest.fn().mockReturnValue(mssqlError), + ConnectionPool: jest.fn().mockImplementation(() => { + return { + close: mockConnectionPoolClose, + connect: mockConnect, + }; + }), + }; +}); + +class MssqlClient extends AbstractMssqlClient { + constructor(context: ApplicationContext) { + const config = { server: 'foo' } as IDbConfig; + super(context, config, 'Exception Tests'); + } +} + +describe('Tests database client exceptions', () => { + let client: MssqlClient; + let context: ApplicationContext; + + beforeEach(async () => { + jest.resetModules(); + context = await createMockApplicationContext(); + client = new MssqlClient(context); + }); + + test('should handle miscelaneous mssql error exceptions', async () => { + const expectedErrorMessage = 'Test request error exception'; + const requestError = new RequestError(expectedErrorMessage); + requestError.name = 'RequestError'; + requestError.code = ''; + requestError.message = expectedErrorMessage; + mockRequest.mockImplementation(() => { + throw requestError; + }); + + // method under test + const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); + + expect(mockRequest).toThrow(expectedErrorMessage); + expect(queryResult.success).toBeFalsy(); + }); + + test('should handle known mssql MSSQLError exceptions', async () => { + const expectedErrorMessage = 'Test MSSQLError exception'; + const requestError = new RequestError(expectedErrorMessage); + requestError.name = 'RequestError'; + requestError.code = ''; + requestError.message = expectedErrorMessage; + mockRequest.mockImplementation(() => { + const mssqlError = new MSSQLError({ + name: '', + message: '', + }); + // not totally sure why I have to set the error in this way to get it to work. + mssqlError.name = 'TestMSSQLMessage'; + mssqlError.message = expectedErrorMessage; + mssqlError.code = '1'; + mssqlError.originalError = { message: 'original error', name: 'originalError' }; + throw mssqlError; + }); + + // method under test + const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); + + expect(mockRequest).toThrow(expectedErrorMessage); + expect(queryResult.success).toBeFalsy(); + }); + + test('should handle known mssql ConnectionError exceptions', async () => { + const expectedErrorMessage = 'Test ConnectionError exception'; + const context = await createMockApplicationContext(); + const connectionError = new ConnectionError(expectedErrorMessage); + connectionError.code = ''; + connectionError.name = 'ConnectionError'; + connectionError.message = expectedErrorMessage; + mockConnect.mockImplementation(() => { + throw connectionError; + }); + + // method under test + const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); + expect(mockConnect).toThrow(expectedErrorMessage); + expect(queryResult.success).toBeFalsy(); + }); + + test('should handle known mssql ConnectionError exceptions with AggregateErrors', async () => { + const expectedErrorMessage = 'Test ConnectionError exception with AggregateErrors'; + const connectionError = new ConnectionError(expectedErrorMessage); + connectionError.code = ''; + connectionError.name = 'ConnectionError'; + connectionError.message = expectedErrorMessage; + connectionError.originalError = { + message: '', + name: 'AggregateError', + errors: [ + { message: 'Something happen 01', name: '01', code: '' } as MSSQLError, + { + message: 'Something happen 02', + name: '02', + code: '', + errors: [ + { + message: 'Agreggate error sub error 1', + name: '02.1', + code: '', + }, + ], + originalError: { + name: '03', + message: 'Nested aggregate errors', + errors: [ + { message: 'Nested aggregate error 04', name: '04', code: '' } as MSSQLError, + { message: 'Nested aggregate error 05', name: '05', code: '' } as MSSQLError, + ], + } as AggregateError, + } as ConnectionError, + ], + } as AggregateError; + mockConnect.mockImplementation(() => { + throw connectionError; + }); + + const context = await createMockApplicationContext(); + // method under test + const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); + + expect(mockConnect).toThrow(expectedErrorMessage); + expect(queryResult.success).toBeFalsy(); + }); + + test('should close connection pool when calling close', async () => { + const context = await createMockApplicationContext(); + const client = new MssqlClient(context); + + await client.close(); + expect(mockConnectionPoolClose).toHaveBeenCalled(); + }); +}); diff --git a/backend/functions/lib/adapters/gateways/mssql.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/mssql.test.ts rename to backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts index 0f137b7dd..4db02f2a2 100644 --- a/backend/functions/lib/adapters/gateways/mssql.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts @@ -1,6 +1,6 @@ import { QueryResults, IDbConfig } from '../types/database'; import { createMockApplicationContext } from '../../testing/testing-utilities'; -import { AbstractDbClient } from './mssql'; +import { AbstractMssqlClient } from './abstract-mssql-client'; import { ApplicationContext } from '../types/basic'; import { IResult } from 'mssql'; @@ -61,7 +61,7 @@ describe('Abstract MS-SQL client', () => { ]; // execute method under test - class TestDbClient extends AbstractDbClient { + class TestDbClient extends AbstractMssqlClient { constructor(context: ApplicationContext, config: IDbConfig, childModuleName: string) { super(context, config, childModuleName); } diff --git a/backend/functions/lib/adapters/gateways/mssql.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts similarity index 84% rename from backend/functions/lib/adapters/gateways/mssql.ts rename to backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index 23a04c7a3..2361603c2 100644 --- a/backend/functions/lib/adapters/gateways/mssql.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -3,21 +3,17 @@ import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; import { Closable, deferClose } from '../../defer-close'; import { ApplicationContext } from '../types/basic'; -export abstract class AbstractDbClient implements Closable { +export abstract class AbstractMssqlClient implements Closable { private connectionPool: ConnectionPool; private readonly moduleName: string; - protected constructor(context: ApplicationContext, config: IDbConfig, childModuleName: string) { - this.moduleName = `MSSQL-ABSTRACT-DB-CLIENT (${childModuleName})`; - this.setupConnectionPool(config); + protected constructor(context: ApplicationContext, dbConfig: IDbConfig, childModuleName: string) { + this.moduleName = `ABSTRACT-MSSQL-CLIENT (${childModuleName})`; + this.connectionPool = new ConnectionPool(dbConfig as config); deferClose(context, this); } - private setupConnectionPool = (databaseConfig: IDbConfig) => { - this.connectionPool = new ConnectionPool(databaseConfig as config); - }; - - async executeQuery( + public async executeQuery( context: ApplicationContext, query: string, input?: DbTableFieldSpec[], @@ -64,18 +60,23 @@ export abstract class AbstractDbClient implements Closable { errorMessages.push(error.message); context.logger.error(this.moduleName, 'ConnectionError', { errorMessages }); } else if (isMssqlError(error)) { - context.logger.error(this.moduleName, 'MssqlError', { + const newError = { error: { name: error.name, // RequestError description: error.message, // Timeout: Request failed to complete in 15000ms }, - originalError: { - name: error.originalError.name, - description: error.originalError.name, - }, + originalError: {}, query, input, - }); + }; + if (error.originalError) { + newError.originalError = { + name: error.originalError.name, + description: error.originalError.name, + }; + } + + context.logger.error(this.moduleName, 'MssqlError', newError); } else { context.logger.error(this.moduleName, error.message, { error, query, input }); } diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 8784487d2..64f0fbdca 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -1,4 +1,4 @@ -import { AbstractDbClient } from '../mssql'; +import { AbstractMssqlClient } from '../abstract-mssql-client'; import { AcmsGatewayImpl } from './acms.gateway'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; import { @@ -7,6 +7,7 @@ import { Predicate, PredicateAndPage, } from '../../../use-cases/acms-orders/acms-orders'; +import { UnknownError } from '../../../common-errors/unknown-error'; const PAGE_SIZE = 50; @@ -19,7 +20,7 @@ describe('ACMS gateway tests', () => { test.each(pageCountCases)( 'should execute query and calculate page count for $leadCaseCount consolidations', async (params: { leadCaseCount: number; pageCount: number }) => { - const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + const spy = jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockResolvedValue({ success: true, results: [{ leadCaseCount: params.leadCaseCount }], message: '', @@ -54,7 +55,7 @@ describe('ACMS gateway tests', () => { ]; const expectedResult = databaseResult.map((record) => record.leadCaseId); - const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + const spy = jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockResolvedValue({ success: true, results: databaseResult, message: '', @@ -114,7 +115,7 @@ describe('ACMS gateway tests', () => { ], }; - const spy = jest.spyOn(AbstractDbClient.prototype, 'executeQuery').mockResolvedValue({ + const spy = jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockResolvedValue({ success: true, results: databaseResult, message: '', @@ -131,4 +132,62 @@ describe('ACMS gateway tests', () => { ); expect(result).toEqual(expectedResult); }); + + test('should handle exceptions from executeQuery when calling getPageCount', async () => { + const mockError = new Error('test error'); + jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockRejectedValue(mockError); + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + await expect(async () => { + return await gateway.getPageCount(context, { + chapter: '11', + divisionCode: '010', + } as Predicate); + }).rejects.toThrow( + new UnknownError('ACMS_GATEWAY', { + status: 500, + message: 'Unknown Error', + originalError: mockError, + }), + ); + }); + + test('should handle exceptions from executeQuery when calling getLeadCaseIds', async () => { + const mockError = new Error('test error'); + jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockRejectedValue(mockError); + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + await expect(async () => { + return await gateway.getLeadCaseIds(context, { + chapter: '11', + divisionCode: '010', + pageNumber: 1, + } as PredicateAndPage); + }).rejects.toThrow( + new UnknownError('ACMS_GATEWAY', { + status: 500, + message: 'Unknown Error', + originalError: mockError, + }), + ); + }); + + test('should handle exceptions from executeQuery when calling getConsolidationDetails', async () => { + const mockError = new Error('test error'); + jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockRejectedValue(mockError); + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + await expect(async () => { + return await gateway.getConsolidationDetails(context, '000-00-1234'); + }).rejects.toThrow( + new UnknownError('ACMS_GATEWAY', { + status: 500, + message: 'Unknown Error', + originalError: mockError, + }), + ); + }); }); diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 3507b2197..64d2835bc 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -7,14 +7,14 @@ import { } from '../../../use-cases/acms-orders/acms-orders'; import { AcmsGateway } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; -import { AbstractDbClient } from '../mssql'; +import { AbstractMssqlClient } from '../abstract-mssql-client'; import { getCamsError } from '../../../common-errors/error-utilities'; import { DbTableFieldSpec } from '../../types/database'; const MODULE_NAME = 'ACMS_GATEWAY'; const PAGE_SIZE = 50; -export class AcmsGatewayImpl extends AbstractDbClient implements AcmsGateway { +export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway { constructor(context: ApplicationContext) { // The context carries different database connection configurations. // We pick off the configuration specific to this ACMS gateway. From 48369e2517296c3ef9ad5f99fe6968e1dc86781e Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 10:24:51 -0500 Subject: [PATCH 030/112] updated TaskHubName for durable functions within slots Jira ticket: CAMS-461 --- backend/functions/host.json | 5 +++++ ops/cloud-deployment/backend-api-deploy.bicep | 4 ++++ ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/functions/host.json b/backend/functions/host.json index 9093e3097..377cbf782 100644 --- a/backend/functions/host.json +++ b/backend/functions/host.json @@ -21,5 +21,10 @@ "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.*, 5.0.0)" + }, + "extensions": { + "durableTask": { + "hubName": "%TaskHubName%" + } } } diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index c3aa23055..dcb14aee2 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -362,6 +362,10 @@ var applicationSettings = concat( name: 'OKTA_API_KEY' value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=OKTA-API-KEY)' } + { + name: 'TaskHubName' + value: 'main' + } ], createApplicationInsights ? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: appInsights.outputs.connectionString }] diff --git a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh index 328ef5f1d..fbeeaafc8 100755 --- a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh +++ b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh @@ -102,7 +102,7 @@ echo "Database Name :${databaseName}" commitSha=$(git rev-parse HEAD) -az functionapp config appsettings set -g "$app_rg" -n "$api_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${storage_acc_key}" +az functionapp config appsettings set -g "$app_rg" -n "$api_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" TakHubName="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${storage_acc_key}" echo "Setting CORS Allowed origins for the API..." From de7bf9b3426bb6f620b58a13853b0bdcb9d80621 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 10:36:53 -0500 Subject: [PATCH 031/112] increased coverage on acms.gateway Jira ticket: CAMS-461 --- .../gateways/acms/acms.gateway.test.ts | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 64f0fbdca..b2daf1622 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -16,6 +16,7 @@ describe('ACMS gateway tests', () => { { leadCaseCount: 245, pageCount: 5 }, { leadCaseCount: 250, pageCount: 5 }, { leadCaseCount: 251, pageCount: 6 }, + { pageCount: 0 }, ]; test.each(pageCountCases)( 'should execute query and calculate page count for $leadCaseCount consolidations', @@ -85,7 +86,7 @@ describe('ACMS gateway tests', () => { }, ); - test('should get consolidation details from ACMS', async () => { + test('should get substantive consolidation details from ACMS', async () => { const leadCaseId = '0000000000'; const databaseResult: AcmsConsolidationChildCase[] = [ { @@ -153,6 +154,54 @@ describe('ACMS gateway tests', () => { ); }); + test('should get substantive consolidation details from ACMS', async () => { + const leadCaseId = '0000000000'; + const databaseResult: AcmsConsolidationChildCase[] = [ + { + caseId: '000-00-11111', + consolidationDate: '20240201', + consolidationType: 'A', + }, + { + caseId: '000-00-22222', + consolidationDate: '20240201', + consolidationType: 'A', + }, + ]; + const expectedResult: AcmsConsolidation = { + leadCaseId: '000-00-00000', + childCases: [ + { + caseId: '000-00-11111', + consolidationDate: '2024-02-01', + consolidationType: 'administrative', + }, + { + caseId: '000-00-22222', + consolidationDate: '2024-02-01', + consolidationType: 'administrative', + }, + ], + }; + + const spy = jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockResolvedValue({ + success: true, + results: databaseResult, + message: '', + }); + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + const result = await gateway.getConsolidationDetails(context, leadCaseId); + + expect(spy).toHaveBeenCalledWith( + context, + expect.any(String), + expect.arrayContaining([expect.objectContaining({ name: 'leadCaseId', value: leadCaseId })]), + ); + expect(result).toEqual(expectedResult); + }); + test('should handle exceptions from executeQuery when calling getLeadCaseIds', async () => { const mockError = new Error('test error'); jest.spyOn(AbstractMssqlClient.prototype, 'executeQuery').mockRejectedValue(mockError); From 0bde090701ab5af04aab921dde6ceb8920872200 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 10:47:26 -0500 Subject: [PATCH 032/112] corrected var for MyTaskHub env var Jira ticket: CAMS-461 --- backend/functions/host.json | 2 +- ops/cloud-deployment/backend-api-deploy.bicep | 2 +- ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/functions/host.json b/backend/functions/host.json index 377cbf782..50d7efd63 100644 --- a/backend/functions/host.json +++ b/backend/functions/host.json @@ -24,7 +24,7 @@ }, "extensions": { "durableTask": { - "hubName": "%TaskHubName%" + "hubName": "%MyTaskHub%" } } } diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index dcb14aee2..5f103456c 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -363,7 +363,7 @@ var applicationSettings = concat( value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=OKTA-API-KEY)' } { - name: 'TaskHubName' + name: 'MyTaskHub' value: 'main' } ], diff --git a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh index fbeeaafc8..2177855c8 100755 --- a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh +++ b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh @@ -102,7 +102,7 @@ echo "Database Name :${databaseName}" commitSha=$(git rev-parse HEAD) -az functionapp config appsettings set -g "$app_rg" -n "$api_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" TakHubName="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${storage_acc_key}" +az functionapp config appsettings set -g "$app_rg" -n "$api_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" MyTaskHub="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${storage_acc_key}" echo "Setting CORS Allowed origins for the API..." From 0e5c46a3a8b04e3de965087df85b029c90a7416a Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 11:00:17 -0500 Subject: [PATCH 033/112] properly renamed acms.gateway admin consol test Jira ticket: CAMS-461 --- .../functions/lib/adapters/gateways/acms/acms.gateway.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index b2daf1622..77e416e46 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -154,7 +154,7 @@ describe('ACMS gateway tests', () => { ); }); - test('should get substantive consolidation details from ACMS', async () => { + test('should get administrative consolidation details from ACMS', async () => { const leadCaseId = '0000000000'; const databaseResult: AcmsConsolidationChildCase[] = [ { From df820bbe25b6e0c82bac04c20c551d5c5ddc90a4 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:35:42 -0500 Subject: [PATCH 034/112] Properly translate chapters to query Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/acms/acms.gateway.test.ts | 53 +++++++++++++ .../adapters/gateways/acms/acms.gateway.ts | 78 +++++++++++-------- 2 files changed, 98 insertions(+), 33 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 77e416e46..1010613da 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -86,6 +86,59 @@ describe('ACMS gateway tests', () => { }, ); + const chapters = [ + { chapter: '9', querySubString: null, inputVariable: '09' }, + { chapter: '11', querySubString: null, inputVariable: '11' }, + { chapter: '12', querySubString: null, inputVariable: '12' }, + { chapter: '13', querySubString: null, inputVariable: '13' }, + { chapter: '15', querySubString: null, inputVariable: '15' }, + { chapter: '7', querySubString: "IN ('7A', '7N')", inputVariable: null }, + ]; + test.each(chapters)('should translate chapter $chapter into query', async (params) => { + const spy = jest + .spyOn(AbstractMssqlClient.prototype, 'executeQuery') + .mockResolvedValueOnce({ + success: true, + results: [{ leadCaseCount: 0 }], + message: '', + }) + .mockResolvedValue({ + success: true, + results: [], + message: '', + }); + + const predicate: Predicate = { + chapter: params.chapter, + divisionCode: '081', + }; + const predicateAndPage: PredicateAndPage = { + ...predicate, + pageNumber: 0, + }; + + const context = await createMockApplicationContext(); + const gateway = new AcmsGatewayImpl(context); + await gateway.getPageCount(context, predicate); + await gateway.getLeadCaseIds(context, predicateAndPage); + + if (params.inputVariable) { + expect(spy).toHaveBeenCalledWith( + context, + expect.any(String), + expect.arrayContaining([ + expect.objectContaining({ name: 'chapter', value: params.inputVariable }), + ]), + ); + } else { + expect(spy).toHaveBeenCalledWith( + context, + expect.stringContaining(params.querySubString), + expect.any(Array), + ); + } + }); + test('should get substantive consolidation details from ACMS', async () => { const leadCaseId = '0000000000'; const databaseResult: AcmsConsolidationChildCase[] = [ diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 64d2835bc..f09361087 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -24,14 +24,28 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { const input: DbTableFieldSpec[] = []; + let query = ` + SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) AS leadCaseCount + FROM CMMDB + WHERE CASE_DIV = @divisionCode + AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' + AND CONSOLIDATED_CASE_NUMBER != '0'`; - // TODO: map from string chapters that accept numbers to be two character strings - // 09, 11, 12, 13, 15, 7A, 7N, AC - input.push({ - name: 'chapter', - type: mssql.VarChar, - value: predicate.chapter, - }); + // Valid ACMS chapters: 09, 11, 12, 13, 15, 7A, 7N, AC + // 'AC' is the predecesor to chapter 15. We are not importing these old cases into CAMS. + // '7A' and '7N' are treated inclusively as chapter 7 cases when importing into CAMS. + // Leading zero padding is added for chapter 9. + + if (predicate.chapter === '7') { + query += ` AND CURR_CASE_CHAPT IN ('7A', '7N')`; + } else { + query += ` AND CURR_CASE_CHAPT = @chapter`; + input.push({ + name: 'chapter', + type: mssql.VarChar, + value: ('00' + predicate.chapter).slice(-2), + }); + } input.push({ name: 'divisionCode', @@ -43,14 +57,6 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway leadCaseCount: number; }; - const query = ` - SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) AS leadCaseCount - FROM CMMDB - WHERE CURR_CASE_CHAPT = @chapter - AND CASE_DIV = @divisionCode - AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' - AND CONSOLIDATED_CASE_NUMBER != '0'`; - try { const results = await this.executeQuery(context, query, input); const result = results.results[0]; @@ -66,14 +72,6 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway ): Promise { const input: DbTableFieldSpec[] = []; - // TODO: map from string chapters that accept numbers to be two character strings - // 09, 11, 12, 13, 15, 7A, 7N, AC - input.push({ - name: 'chapter', - type: mssql.VarChar, - value: predicateAndPage.chapter, - }); - input.push({ name: 'divisionCode', type: mssql.VarChar, @@ -92,25 +90,39 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway value: PAGE_SIZE * (predicateAndPage.pageNumber - 1), }); - // RIGHT(CONCAT('000', CAST(CONSOLIDATED_CASE_NUMBER AS VARCHAR)), 10) - const query = ` + let query = ` SELECT DISTINCT CONSOLIDATED_CASE_NUMBER AS leadCaseId FROM CMMDB - WHERE CURR_CASE_CHAPT = @chapter - AND CASE_DIV = @divisionCode + WHERE CASE_DIV = @divisionCode AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' - AND CONSOLIDATED_CASE_NUMBER != '0' - ORDER BY CONSOLIDATED_CASE_NUMBER DESC OFFSET @offset ROWS FETCH NEXT @limit ROWS ONLY`; + AND CONSOLIDATED_CASE_NUMBER != '0'`; + + // Valid ACMS chapters: 09, 11, 12, 13, 15, 7A, 7N, AC + // 'AC' is the predecesor to chapter 15. We are not importing these old cases into CAMS. + // '7A' and '7N' are treated inclusively as chapter 7 cases when importing into CAMS. + // Leading zero padding is added for chapter 9. + + if (predicateAndPage.chapter === '7') { + query += ` AND CURR_CASE_CHAPT IN ('7A', '7N')`; + } else { + query += ` AND CURR_CASE_CHAPT = @chapter`; + input.push({ + name: 'chapter', + type: mssql.VarChar, + value: ('00' + predicateAndPage.chapter).slice(-2), + }); + } + + query += ` ORDER BY CONSOLIDATED_CASE_NUMBER DESC OFFSET @offset ROWS FETCH NEXT @limit ROWS ONLY`; type ResultType = { leadCaseId: string; }; try { - const results = await this.executeQuery(context, query, input); - // TODO: Fix this. - const theFrackingList = results.results as ResultType[]; - return theFrackingList.map((record) => record.leadCaseId); + const { results } = await this.executeQuery(context, query, input); + const leadCaseIdsResults = results as ResultType[]; + return leadCaseIdsResults.map((record) => record.leadCaseId); } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } From 82ca9c52199195ba5a62dee8b8c0964ee6229158 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 16:21:56 -0500 Subject: [PATCH 035/112] renamed Acms types, added note for var keyword in db tests Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../abstract-mssql-client.exception.test.ts | 1 + .../lib/adapters/gateways/acms/acms.gateway.test.ts | 12 ++++++------ .../lib/adapters/gateways/acms/acms.gateway.ts | 8 ++++---- .../lib/adapters/utils/database.exception.test.ts | 1 + .../acms-orders/acms-orders.controller.test.ts | 8 ++++---- .../acms-orders/acms-orders.controller.ts | 11 +++++++---- .../lib/use-cases/acms-orders/acms-orders.test.ts | 10 +++++----- .../lib/use-cases/acms-orders/acms-orders.ts | 13 ++++++++----- backend/functions/lib/use-cases/gateways.types.ts | 6 +++--- .../activity/flattenBoundingArrays.test.ts | 6 +++--- .../migration/activity/flattenBoundingArrays.ts | 8 ++++---- .../migration/activity/getConsolidations.test.ts | 6 +++--- .../migration/activity/getConsolidations.ts | 7 +++++-- .../migration/activity/getPageCount.test.ts | 6 +++--- .../functions/migration/activity/getPageCount.ts | 4 ++-- .../migration/orchestration/orchestrator.ts | 9 ++++++--- .../migration/orchestration/sub-orchestrator-etl.ts | 4 ++-- .../orchestration/sub-orchestrator-paging.ts | 6 +++--- 18 files changed, 70 insertions(+), 56 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts index 30cb94144..7b9676897 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -5,6 +5,7 @@ import { AbstractMssqlClient } from './abstract-mssql-client'; import { ApplicationContext } from '../types/basic'; // Setting default Jest mocks for mssql +//NOTE: using const here causes these tests to error out with 'Cannot access {var} before initialization // eslint-disable-next-line no-var var connectionError = new ConnectionError(''); // eslint-disable-next-line no-var diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 1010613da..7c13845f8 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -4,8 +4,8 @@ import { createMockApplicationContext } from '../../../testing/testing-utilities import { AcmsConsolidation, AcmsConsolidationChildCase, - Predicate, - PredicateAndPage, + AcmsPredicate, + AcmsPredicateAndPage, } from '../../../use-cases/acms-orders/acms-orders'; import { UnknownError } from '../../../common-errors/unknown-error'; @@ -26,7 +26,7 @@ describe('ACMS gateway tests', () => { results: [{ leadCaseCount: params.leadCaseCount }], message: '', }); - const predicate: Predicate = { + const predicate: AcmsPredicate = { chapter: '15', divisionCode: '081', }; @@ -62,7 +62,7 @@ describe('ACMS gateway tests', () => { message: '', }); - const predicate: PredicateAndPage = { + const predicate: AcmsPredicateAndPage = { chapter: '15', divisionCode: '081', pageNumber, @@ -197,7 +197,7 @@ describe('ACMS gateway tests', () => { return await gateway.getPageCount(context, { chapter: '11', divisionCode: '010', - } as Predicate); + } as AcmsPredicate); }).rejects.toThrow( new UnknownError('ACMS_GATEWAY', { status: 500, @@ -266,7 +266,7 @@ describe('ACMS gateway tests', () => { chapter: '11', divisionCode: '010', pageNumber: 1, - } as PredicateAndPage); + } as AcmsPredicateAndPage); }).rejects.toThrow( new UnknownError('ACMS_GATEWAY', { status: 500, diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index f09361087..cfda328d1 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -2,8 +2,8 @@ import * as mssql from 'mssql'; import { AcmsConsolidation, AcmsConsolidationChildCase, - Predicate, - PredicateAndPage, + AcmsPredicate, + AcmsPredicateAndPage, } from '../../../use-cases/acms-orders/acms-orders'; import { AcmsGateway } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; @@ -22,7 +22,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway super(context, config, MODULE_NAME); } - async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + async getPageCount(context: ApplicationContext, predicate: AcmsPredicate): Promise { const input: DbTableFieldSpec[] = []; let query = ` SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) AS leadCaseCount @@ -68,7 +68,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway async getLeadCaseIds( context: ApplicationContext, - predicateAndPage: PredicateAndPage, + predicateAndPage: AcmsPredicateAndPage, ): Promise { const input: DbTableFieldSpec[] = []; diff --git a/backend/functions/lib/adapters/utils/database.exception.test.ts b/backend/functions/lib/adapters/utils/database.exception.test.ts index e9d21d671..434904a6f 100644 --- a/backend/functions/lib/adapters/utils/database.exception.test.ts +++ b/backend/functions/lib/adapters/utils/database.exception.test.ts @@ -4,6 +4,7 @@ import { ConnectionError, MSSQLError, RequestError } from 'mssql'; import { createMockApplicationContext } from '../../testing/testing-utilities'; // Setting default Jest mocks for mssql +//NOTE: using const here causes these tests to error out with 'Cannot access {var} before initialization // eslint-disable-next-line no-var var connectionError = new ConnectionError(''); // eslint-disable-next-line no-var diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts index 0b4ff84be..7cd95e67e 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -1,7 +1,7 @@ import AcmsOrders, { AcmsConsolidationReport, - Predicate, - PredicateAndPage, + AcmsPredicate, + AcmsPredicateAndPage, } from '../../use-cases/acms-orders/acms-orders'; import AcmsOrdersController from './acms-orders.controller'; import { ApplicationContext } from '../../adapters/types/basic'; @@ -16,7 +16,7 @@ describe('AcmsOrdersController', () => { test('should return ACMS Order Consolidations page count', async () => { jest.spyOn(AcmsOrders.prototype, 'getPageCount').mockResolvedValue(5); - const predicate: Predicate = { + const predicate: AcmsPredicate = { divisionCode: '000', chapter: '00', }; @@ -29,7 +29,7 @@ describe('AcmsOrdersController', () => { test('should return array of lead case ids when calling getConsolidationOrders', async () => { const leadCaseIds = ['811100000', '1231111111']; - const predicate: PredicateAndPage = { + const predicate: AcmsPredicateAndPage = { divisionCode: '000', chapter: '00', pageNumber: 1, diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index 103192d15..19bc20e52 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,8 +1,8 @@ import { ApplicationContext } from '../../adapters/types/basic'; import AcmsOrders, { AcmsConsolidationReport, - Predicate, - PredicateAndPage, + AcmsPredicate, + AcmsPredicateAndPage, } from '../../use-cases/acms-orders/acms-orders'; class AcmsOrdersController { private readonly useCase = new AcmsOrders(); @@ -14,13 +14,16 @@ class AcmsOrdersController { return this.useCase.migrateConsolidation(context, leadCaseId); } - public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + public async getPageCount( + context: ApplicationContext, + predicate: AcmsPredicate, + ): Promise { return this.useCase.getPageCount(context, predicate); } public async getLeadCaseIds( context: ApplicationContext, - predicate: PredicateAndPage, + predicate: AcmsPredicateAndPage, ): Promise { return this.useCase.getLeadCaseIds(context, predicate); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index 6245fd70e..e59b3021e 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -1,7 +1,7 @@ import Factory from '../../factory'; import { createMockApplicationContext } from '../../testing/testing-utilities'; import { AcmsGateway } from '../gateways.types'; -import AcmsOrders, { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders'; +import AcmsOrders, { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders'; import { CasesMongoRepository } from '../../adapters/gateways/mongo/cases.mongo.repository'; import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; import { AcmsGatewayImpl } from '../../adapters/gateways/acms/acms.gateway'; @@ -40,7 +40,7 @@ describe('ACMS Orders', () => { const getPageCount = jest.spyOn(mockAcmsGateway, 'getPageCount').mockResolvedValue(expected); jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); - const predicate: Predicate = { + const predicate: AcmsPredicate = { divisionCode: '000', chapter: '00', }; @@ -58,7 +58,7 @@ describe('ACMS Orders', () => { .mockResolvedValue(expected); jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); - const predicateAndPage: PredicateAndPage = { + const predicateAndPage: AcmsPredicateAndPage = { divisionCode: '000', chapter: '00', pageNumber: 1, @@ -533,12 +533,12 @@ describe('ACMS Orders', () => { jest.spyOn(Factory, 'getAcmsGateway').mockReturnValue(mockAcmsGateway); const useCase = new AcmsOrders(); - const predicate: Predicate = { + const predicate: AcmsPredicate = { divisionCode: '000', chapter: '00', }; - const predicateAndPage: PredicateAndPage = { + const predicateAndPage: AcmsPredicateAndPage = { ...predicate, pageNumber: 1, }; diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 6f9d14f22..bf1d8ce1d 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -9,17 +9,17 @@ import { getCamsError } from '../../common-errors/error-utilities'; const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; -export type Bounds = { +export type AcmsBounds = { divisionCodes: string[]; chapters: string[]; }; -export type Predicate = { +export type AcmsPredicate = { divisionCode: string; chapter: string; }; -export type PredicateAndPage = Predicate & { +export type AcmsPredicateAndPage = AcmsPredicate & { pageNumber: number; }; @@ -40,14 +40,17 @@ export type AcmsConsolidationReport = { }; export class AcmsOrders { - public async getPageCount(context: ApplicationContext, predicate: Predicate): Promise { + public async getPageCount( + context: ApplicationContext, + predicate: AcmsPredicate, + ): Promise { const gateway = Factory.getAcmsGateway(context); return gateway.getPageCount(context, predicate); } public async getLeadCaseIds( context: ApplicationContext, - predicateAndPage: PredicateAndPage, + predicateAndPage: AcmsPredicateAndPage, ): Promise { const gateway = Factory.getAcmsGateway(context); return gateway.getLeadCaseIds(context, predicateAndPage); diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index ce3df67e3..c1819f987 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -19,7 +19,7 @@ import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; -import { AcmsConsolidation, Predicate, PredicateAndPage } from './acms-orders/acms-orders'; +import { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders/acms-orders'; interface Creates { create(data: T): Promise; @@ -91,10 +91,10 @@ export interface OrdersGateway { } export interface AcmsGateway { - getPageCount(context: ApplicationContext, predicate: Predicate): Promise; + getPageCount(context: ApplicationContext, predicate: AcmsPredicate): Promise; getLeadCaseIds( context: ApplicationContext, - predicateAndPage: PredicateAndPage, + predicateAndPage: AcmsPredicateAndPage, ): Promise; getConsolidationDetails( context: ApplicationContext, diff --git a/backend/functions/migration/activity/flattenBoundingArrays.test.ts b/backend/functions/migration/activity/flattenBoundingArrays.test.ts index acaacbeeb..999bbf991 100644 --- a/backend/functions/migration/activity/flattenBoundingArrays.test.ts +++ b/backend/functions/migration/activity/flattenBoundingArrays.test.ts @@ -1,15 +1,15 @@ import { InvocationContext } from '@azure/functions'; -import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; import module from './flattenBoundingArrays'; describe('Flatten bounding arrays activity', () => { test('should transform bounding arrays into predicates', async () => { const context = {} as InvocationContext; - const bounds: Bounds = { + const bounds: AcmsBounds = { chapters: ['11', '15'], divisionCodes: ['000', '111'], }; - const expectedOuput: Predicate[] = [ + const expectedOuput: AcmsPredicate[] = [ { chapter: '11', divisionCode: '000' }, { chapter: '11', divisionCode: '111' }, { chapter: '15', divisionCode: '000' }, diff --git a/backend/functions/migration/activity/flattenBoundingArrays.ts b/backend/functions/migration/activity/flattenBoundingArrays.ts index 4eb21c0d2..0f7f79f06 100644 --- a/backend/functions/migration/activity/flattenBoundingArrays.ts +++ b/backend/functions/migration/activity/flattenBoundingArrays.ts @@ -1,11 +1,11 @@ import { InvocationContext } from '@azure/functions'; -import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; async function flattenBoundingArrays( - bounds: Bounds, + bounds: AcmsBounds, _context: InvocationContext, -): Promise { - const predicates: Predicate[] = []; +): Promise { + const predicates: AcmsPredicate[] = []; for (const chapter of bounds.chapters) { for (const divisionCode of bounds.divisionCodes) { predicates.push({ diff --git a/backend/functions/migration/activity/getConsolidations.test.ts b/backend/functions/migration/activity/getConsolidations.test.ts index a9ad3f527..f866c48f9 100644 --- a/backend/functions/migration/activity/getConsolidations.test.ts +++ b/backend/functions/migration/activity/getConsolidations.test.ts @@ -1,7 +1,7 @@ import { InvocationContext } from '@azure/functions'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import module from './getConsolidations'; -import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; import { CamsError } from '../../lib/common-errors/cams-error'; @@ -17,7 +17,7 @@ describe('getConsolidations test', () => { .mockResolvedValue(expected); const context = createMockAzureFunctionContext(); - const input: PredicateAndPage = { + const input: AcmsPredicateAndPage = { divisionCode: '101', chapter: '15', pageNumber: 1, @@ -33,7 +33,7 @@ describe('getConsolidations test', () => { jest.spyOn(AcmsOrdersController.prototype, 'getLeadCaseIds').mockRejectedValue(error); const context: InvocationContext = {} as InvocationContext; - const input: PredicateAndPage = { + const input: AcmsPredicateAndPage = { divisionCode: '101', chapter: '15', pageNumber: 1, diff --git a/backend/functions/migration/activity/getConsolidations.ts b/backend/functions/migration/activity/getConsolidations.ts index f51be13a4..a1ae9428f 100644 --- a/backend/functions/migration/activity/getConsolidations.ts +++ b/backend/functions/migration/activity/getConsolidations.ts @@ -1,12 +1,15 @@ import { InvocationContext } from '@azure/functions'; -import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import ContextCreator from '../../azure/application-context-creator'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import { getCamsError } from '../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT_ACTION_GET_CONSOLIDATIONS'; -async function getConsolidations(input: PredicateAndPage, invocationContext: InvocationContext) { +async function getConsolidations( + input: AcmsPredicateAndPage, + invocationContext: InvocationContext, +) { const logger = ContextCreator.getLogger(invocationContext); const context = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); diff --git a/backend/functions/migration/activity/getPageCount.test.ts b/backend/functions/migration/activity/getPageCount.test.ts index 055d60968..5ba9d2511 100644 --- a/backend/functions/migration/activity/getPageCount.test.ts +++ b/backend/functions/migration/activity/getPageCount.test.ts @@ -2,7 +2,7 @@ import { InvocationContext } from '@azure/functions'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; import { CamsError } from '../../lib/common-errors/cams-error'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import module from './getPageCount'; describe('getPageCount test', () => { @@ -17,7 +17,7 @@ describe('getPageCount test', () => { .mockResolvedValue(expected); const context = createMockAzureFunctionContext(); - const input: PredicateAndPage = { + const input: AcmsPredicateAndPage = { divisionCode: '101', chapter: '15', pageNumber: 1, @@ -33,7 +33,7 @@ describe('getPageCount test', () => { jest.spyOn(AcmsOrdersController.prototype, 'getPageCount').mockRejectedValue(error); const context: InvocationContext = {} as InvocationContext; - const input: PredicateAndPage = { + const input: AcmsPredicateAndPage = { divisionCode: '101', chapter: '15', pageNumber: 1, diff --git a/backend/functions/migration/activity/getPageCount.ts b/backend/functions/migration/activity/getPageCount.ts index ff43f436b..b71dc68cd 100644 --- a/backend/functions/migration/activity/getPageCount.ts +++ b/backend/functions/migration/activity/getPageCount.ts @@ -1,12 +1,12 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; -import { PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import { getCamsError } from '../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; -async function getPageCount(input: PredicateAndPage, invocationContext: InvocationContext) { +async function getPageCount(input: AcmsPredicateAndPage, invocationContext: InvocationContext) { const logger = ContextCreator.getLogger(invocationContext); const context = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); diff --git a/backend/functions/migration/orchestration/orchestrator.ts b/backend/functions/migration/orchestration/orchestrator.ts index 5c2fe7f84..53858da2d 100644 --- a/backend/functions/migration/orchestration/orchestrator.ts +++ b/backend/functions/migration/orchestration/orchestrator.ts @@ -1,13 +1,16 @@ -import { Bounds, Predicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; import { FLATTEN_BOUNDING_ARRAYS, SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; export function* main(context: OrchestrationContext) { - const bounds: Bounds = context.df.getInput(); + const bounds: AcmsBounds = context.df.getInput(); const provisioningTasks = []; - const partitions: Predicate[] = yield context.df.callActivity(FLATTEN_BOUNDING_ARRAYS, bounds); + const partitions: AcmsPredicate[] = yield context.df.callActivity( + FLATTEN_BOUNDING_ARRAYS, + bounds, + ); for (const partition of partitions) { const child_id = context.df.instanceId + `:${partition.divisionCode}:${partition.chapter}:`; provisioningTasks.push( diff --git a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts index e3a903d67..f4fb59fb4 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts @@ -1,12 +1,12 @@ import { AcmsConsolidationReport, - PredicateAndPage, + AcmsPredicateAndPage, } from '../../lib/use-cases/acms-orders/acms-orders'; import { GET_CONSOLIDATIONS, MIGRATE_CONSOLIDATION } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; export function* subOrchestratorETL(context: OrchestrationContext) { - const predicateAndPage: PredicateAndPage = context.df.getInput(); + const predicateAndPage: AcmsPredicateAndPage = context.df.getInput(); const leadCaseIds = yield context.df.callActivity(GET_CONSOLIDATIONS, predicateAndPage); diff --git a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts index b6ab33a5c..62c2141fa 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts @@ -1,14 +1,14 @@ import { OrchestrationContext } from 'durable-functions'; import { GET_PAGE_COUNT, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; -import { Predicate, PredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicate, AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; export function* subOrchestratorPaging(context: OrchestrationContext) { - const predicate: Predicate = context.df.getInput(); + const predicate: AcmsPredicate = context.df.getInput(); const pageCount: number = yield context.df.callActivity(GET_PAGE_COUNT, predicate); const provisioningTasks = []; for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { - const predicateAndPage: PredicateAndPage = { + const predicateAndPage: AcmsPredicateAndPage = { ...predicate, pageNumber, }; From 6d2449cfc78ad6be4b14d4a41019429561e99e83 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 27 Nov 2024 16:36:10 -0500 Subject: [PATCH 036/112] fixed named of Acms imports in acms.gateway Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- .../functions/lib/adapters/gateways/acms/acms.gateway.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index 7c13845f8..ccf675682 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -108,11 +108,11 @@ describe('ACMS gateway tests', () => { message: '', }); - const predicate: Predicate = { + const predicate: AcmsPredicate = { chapter: params.chapter, divisionCode: '081', }; - const predicateAndPage: PredicateAndPage = { + const predicateAndPage: AcmsPredicateAndPage = { ...predicate, pageNumber: 0, }; From 5e14dc5e2e32c5c276b9afd3d9bf0bdc7cd8f9d8 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:46:50 -0600 Subject: [PATCH 037/112] Wrap errors encounted in case details retrieval Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> --- .../lib/use-cases/case-management.ts | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/backend/functions/lib/use-cases/case-management.ts b/backend/functions/lib/use-cases/case-management.ts index da7952811..0a3993f48 100644 --- a/backend/functions/lib/use-cases/case-management.ts +++ b/backend/functions/lib/use-cases/case-management.ts @@ -19,6 +19,7 @@ import { CamsRole } from '../../../../common/src/cams/roles'; import { getCourtDivisionCodes } from '../../../../common/src/cams/users'; import { buildOfficeCode } from './offices/offices'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; +import { getCamsError } from '../common-errors/error-utilities'; const MODULE_NAME = 'CASE-MANAGEMENT-USE-CASE'; @@ -119,23 +120,31 @@ export default class CaseManagement { applicationContext: ApplicationContext, caseId: string, ): Promise> { - const caseDetails = await this.casesGateway.getCaseDetail(applicationContext, caseId); - caseDetails.transfers = await this.casesRepo.getTransfers(caseId); - caseDetails.consolidation = await this.casesRepo.getConsolidation(caseId); - caseDetails.assignments = await this.getCaseAssignments(applicationContext, caseDetails); - caseDetails.officeName = this.officesGateway.getOfficeName(caseDetails.courtDivisionCode); - caseDetails.officeCode = buildOfficeCode(caseDetails.regionId, caseDetails.courtDivisionCode); - const _actions = getAction(applicationContext, caseDetails); + try { + const caseDetails = await this.casesGateway.getCaseDetail(applicationContext, caseId); + caseDetails.transfers = await this.casesRepo.getTransfers(caseId); + caseDetails.consolidation = await this.casesRepo.getConsolidation(caseId); + caseDetails.assignments = await this.getCaseAssignments(applicationContext, caseDetails); + caseDetails.officeName = this.officesGateway.getOfficeName(caseDetails.courtDivisionCode); + caseDetails.officeCode = buildOfficeCode(caseDetails.regionId, caseDetails.courtDivisionCode); + const _actions = getAction(applicationContext, caseDetails); - return { ...caseDetails, _actions }; + return { ...caseDetails, _actions }; + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } } public async getCaseSummary( applicationContext: ApplicationContext, caseId: string, ): Promise { - const caseSummary = await this.casesGateway.getCaseSummary(applicationContext, caseId); - return caseSummary; + try { + const caseSummary = await this.casesGateway.getCaseSummary(applicationContext, caseId); + return caseSummary; + } catch (originalError) { + throw getCamsError(originalError, MODULE_NAME); + } } private async getCaseAssignments( From fe75b3be2270be4f23235c735fb60c90289a8d92 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:51:44 -0600 Subject: [PATCH 038/112] Do not close connection until we should We were closing the connection to Cosmos but leaving the repo around. The MongoClient therefore had no connection to Cosmos and was erroring on subsequent calls until the Function was spun down. Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/mongo/orders.mongo.repository.ts | 25 ++++++++++++++++++- .../mongo/utils/base-mongo-repository.ts | 5 +--- backend/functions/lib/factory.ts | 17 +++++++------ .../mock-gateways/mock-mongo.repository.ts | 4 +++ .../functions/lib/use-cases/gateways.types.ts | 4 ++- .../functions/lib/use-cases/orders/orders.ts | 7 ++++++ 6 files changed, 48 insertions(+), 14 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts index c532ce9fe..3cac03021 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts @@ -16,10 +16,33 @@ const COLLECTION_NAME = 'orders'; const { contains, equals, orderBy } = QueryBuilder; export class OrdersMongoRepository extends BaseMongoRepository implements OrdersRepository { - constructor(context: ApplicationContext) { + private static referenceCount: number = 0; + private static instance: OrdersMongoRepository; + + private constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!OrdersMongoRepository.instance) + OrdersMongoRepository.instance = new OrdersMongoRepository(context); + OrdersMongoRepository.referenceCount++; + return OrdersMongoRepository.instance; + } + + public static dropInstance() { + if (OrdersMongoRepository.referenceCount > 0) OrdersMongoRepository.referenceCount--; + if (OrdersMongoRepository.referenceCount < 1) { + OrdersMongoRepository.instance.client.close().then(); + OrdersMongoRepository.instance = null; + } + } + + public release() { + console.log('***** RELEASE CALLED **********'); + OrdersMongoRepository.dropInstance(); + } + async search(predicate: OrdersSearchPredicate): Promise { let query: ConditionOrConjunction; if (!predicate) { diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts index e0c063da1..7faeca25b 100644 --- a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts @@ -1,4 +1,3 @@ -import { deferClose } from '../../../../defer-close'; import { DocumentClient } from '../../../../humble-objects/mongo-humble'; import { ApplicationContext } from '../../../types/basic'; import { MongoCollectionAdapter } from './mongo-adapter'; @@ -9,14 +8,12 @@ export abstract class BaseMongoRepository { protected readonly client: DocumentClient; protected readonly databaseName: string; - constructor(context: ApplicationContext, moduleName: string, collectionName: string) { + protected constructor(context: ApplicationContext, moduleName: string, collectionName: string) { this.moduleName = moduleName; this.collectionName = collectionName; const { connectionString, databaseName } = context.config.documentDbConfig; this.databaseName = databaseName; this.client = new DocumentClient(connectionString); - - deferClose(context, this.client); } protected getAdapter() { diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index fdafe83bf..b480be720 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -49,12 +49,16 @@ import { AcmsGatewayImpl } from './adapters/gateways/acms/acms.gateway'; let casesRepo: CasesRepository; let casesGateway: CasesInterface; let ordersGateway: OrdersGateway; -let ordersRepo: OrdersRepository; let consolidationsRepo: ConsolidationOrdersRepository; let orderSyncStateRepo: RuntimeStateRepository; let storageGateway: StorageGateway; let acmsGateway: AcmsGateway; +// TODO: Need a better place to export this from. +export interface Releaseable { + release: () => void; +} + export const getAttorneyGateway = (): AttorneyGatewayInterface => { return MockAttorneysGateway; }; @@ -118,14 +122,11 @@ export const getOfficesRepository = (applicationContext: ApplicationContext): Of // transfer orders export const getOrdersRepository = (applicationContext: ApplicationContext): OrdersRepository => { - if (!ordersRepo) { - if (applicationContext.config.get('dbMock')) { - ordersRepo = new MockMongoRepository(); - } else { - ordersRepo = new OrdersMongoRepository(applicationContext); - } + if (applicationContext.config.get('dbMock')) { + return new MockMongoRepository(); + } else { + return OrdersMongoRepository.getInstance(applicationContext); } - return ordersRepo; }; export const getConsolidationOrdersRepository = ( diff --git a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts index a674814ba..4f2beb4ef 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts +++ b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts @@ -27,6 +27,10 @@ export class MockMongoRepository RuntimeStateRepository, UserSessionCacheRepository { + release() { + return; + } + findAssignmentsByCaseId(..._ignore): Promise { throw new Error('Method not implemented.'); } diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index c1819f987..49f9981e5 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -20,6 +20,7 @@ import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; import { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders/acms-orders'; +import { Releaseable } from '../factory'; interface Creates { create(data: T): Promise; @@ -69,7 +70,8 @@ export interface OrdersRepository extends Searches, CreatesMany, Reads, - Updates {} + Updates, + Releaseable {} export interface RuntimeStateRepository extends Reads, diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index d4197dfdb..7be24948b 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -74,6 +74,9 @@ export class OrdersUseCase { } const transferOrders = await ordersRepo.search(predicate); const consolidationOrders = await consolidationsRepo.search(predicate); + + ordersRepo.release(); + return transferOrders .concat(consolidationOrders) .sort((a, b) => sortDates(a.orderDate, b.orderDate)); @@ -147,6 +150,8 @@ export class OrdersUseCase { ); await casesRepo.createCaseHistory(caseHistory); } + + ordersRepo.release(); } public async syncOrders( @@ -247,6 +252,8 @@ export class OrdersUseCase { await runtimeStateRepo.upsert(finalSyncState); context.logger.info(MODULE_NAME, 'Updated runtime state in repo (Cosmos)', finalSyncState); + ordersRepo.release(); + return { options, initialSyncState, From 3a521df70e3391b1a97f48c66e0d3282ab20e57b Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:28:24 -0500 Subject: [PATCH 039/112] Fix broken test from repo singleton refactor Jira ticket: CAMS-461 --- .../gateways/mongo/orders.mongo.repository.test.ts | 2 +- backend/functions/lib/factory.ts | 2 +- .../lib/testing/mock-gateways/mock-mongo.repository.ts | 8 ++++++++ .../functions/orders-sync/orders-sync.function.test.ts | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts index 76ae948b2..31ac0e6c0 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts @@ -15,7 +15,7 @@ describe('orders repo', () => { beforeEach(async () => { context = await createMockApplicationContext(); - repo = new OrdersMongoRepository(context); + repo = OrdersMongoRepository.getInstance(context); jest.clearAllMocks(); }); diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index b480be720..b175dbb04 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -123,7 +123,7 @@ export const getOfficesRepository = (applicationContext: ApplicationContext): Of // transfer orders export const getOrdersRepository = (applicationContext: ApplicationContext): OrdersRepository => { if (applicationContext.config.get('dbMock')) { - return new MockMongoRepository(); + return MockMongoRepository.getInstance(applicationContext); } else { return OrdersMongoRepository.getInstance(applicationContext); } diff --git a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts index 4f2beb4ef..122c6dc7b 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts +++ b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts @@ -6,6 +6,7 @@ import { ConsolidationFrom, } from '../../../../../common/src/cams/events'; import { CaseHistory } from '../../../../../common/src/cams/history'; +import { ApplicationContext } from '../../adapters/types/basic'; import { CaseAssignmentRepository, CasesRepository, @@ -27,10 +28,17 @@ export class MockMongoRepository RuntimeStateRepository, UserSessionCacheRepository { + private static singleton: MockMongoRepository; + release() { return; } + static getInstance(_context: ApplicationContext) { + if (!this.singleton) this.singleton = new MockMongoRepository(); + return this.singleton; + } + findAssignmentsByCaseId(..._ignore): Promise { throw new Error('Method not implemented.'); } diff --git a/backend/functions/orders-sync/orders-sync.function.test.ts b/backend/functions/orders-sync/orders-sync.function.test.ts index 1214279b6..cd261fb88 100644 --- a/backend/functions/orders-sync/orders-sync.function.test.ts +++ b/backend/functions/orders-sync/orders-sync.function.test.ts @@ -26,6 +26,7 @@ describe('Orders Sync Function tests', () => { read: jest.fn(), update: jest.fn(), createMany: jest.fn(), + release: jest.fn(), }); const handleTimer = jest .spyOn(OrdersController.prototype, 'handleTimer') @@ -40,6 +41,7 @@ describe('Orders Sync Function tests', () => { read: jest.fn(), update: jest.fn(), createMany: jest.fn(), + release: jest.fn(), }); const handleTimer = jest .spyOn(OrdersController.prototype, 'handleTimer') From 2b4a93ec123f041a635ead4ec1383624fab00a50 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Mon, 2 Dec 2024 17:00:47 -0700 Subject: [PATCH 040/112] Converted case mongo repos to new instance management model. Jira ticket: CAMS-461 --- .../mongo/case-assignment.mongo.repository.ts | 23 +++++++++++ .../gateways/mongo/cases.mongo.repository.ts | 24 +++++++++++- .../case-associated.controller.ts | 4 +- backend/functions/lib/factory.ts | 13 ++----- .../lib/use-cases/case-assignment.ts | 38 ++++++++++--------- .../case-associated/case-associated.ts | 19 ++++------ .../lib/use-cases/case-management.ts | 30 +++++---------- .../functions/lib/use-cases/gateways.types.ts | 2 +- 8 files changed, 91 insertions(+), 62 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts index cc83b7395..9a1dd124a 100644 --- a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts @@ -14,10 +14,33 @@ export class CaseAssignmentMongoRepository extends BaseMongoRepository implements CaseAssignmentRepository { + private static referenceCount: number = 0; + private static instance: CaseAssignmentMongoRepository; + constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!CaseAssignmentMongoRepository.instance) + CaseAssignmentMongoRepository.instance = new CaseAssignmentMongoRepository(context); + CaseAssignmentMongoRepository.referenceCount++; + return CaseAssignmentMongoRepository.instance; + } + + public static dropInstance() { + if (CaseAssignmentMongoRepository.referenceCount > 0) + CaseAssignmentMongoRepository.referenceCount--; + if (CaseAssignmentMongoRepository.referenceCount < 1) { + CaseAssignmentMongoRepository.instance.client.close().then(); + CaseAssignmentMongoRepository.instance = null; + } + } + + public release() { + CaseAssignmentMongoRepository.dropInstance(); + } + async create(caseAssignment: CaseAssignment): Promise { try { return await this.getAdapter().insertOne(caseAssignment); diff --git a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts index 781a64e97..40178aa32 100644 --- a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts @@ -18,10 +18,32 @@ const COLLECTION_NAME = 'cases'; const { and, equals, regex } = QueryBuilder; export class CasesMongoRepository extends BaseMongoRepository implements CasesRepository { - constructor(context: ApplicationContext) { + private static referenceCount: number = 0; + private static instance: CasesMongoRepository; + + private constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!CasesMongoRepository.instance) + CasesMongoRepository.instance = new CasesMongoRepository(context); + CasesMongoRepository.referenceCount++; + return CasesMongoRepository.instance; + } + + public static dropInstance() { + if (CasesMongoRepository.referenceCount > 0) CasesMongoRepository.referenceCount--; + if (CasesMongoRepository.referenceCount < 1) { + CasesMongoRepository.instance.client.close().then(); + CasesMongoRepository.instance = null; + } + } + + public release() { + CasesMongoRepository.dropInstance(); + } + async getTransfers(caseId: string): Promise> { try { const query = QueryBuilder.build( diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts index ce312b686..3ab5262ee 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts +++ b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts @@ -11,8 +11,8 @@ const MODULE_NAME = 'CASE-ASSOCIATED-CONTROLLER'; export class CaseAssociatedController { private readonly useCase: CaseAssociatedUseCase; - constructor(applicationContext: ApplicationContext) { - this.useCase = new CaseAssociatedUseCase(applicationContext); + constructor(_applicationContext: ApplicationContext) { + this.useCase = new CaseAssociatedUseCase(); } public async handleRequest( diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index b175dbb04..5cf918427 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -46,7 +46,6 @@ import { UserSessionCacheMongoRepository } from './adapters/gateways/mongo/user- import { MockOfficesRepository } from './testing/mock-gateways/mock.offices.repository'; import { AcmsGatewayImpl } from './adapters/gateways/acms/acms.gateway'; -let casesRepo: CasesRepository; let casesGateway: CasesInterface; let ordersGateway: OrdersGateway; let consolidationsRepo: ConsolidationOrdersRepository; @@ -78,7 +77,7 @@ export const getAssignmentRepository = ( applicationContext: ApplicationContext, ): CaseAssignmentRepository => { if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return new CaseAssignmentMongoRepository(applicationContext); + return CaseAssignmentMongoRepository.getInstance(applicationContext); }; export const getCaseDocketUseCase = (context: ApplicationContext): CaseDocketUseCase => { @@ -143,14 +142,8 @@ export const getConsolidationOrdersRepository = ( }; export const getCasesRepository = (applicationContext: ApplicationContext): CasesRepository => { - if (!casesRepo) { - if (applicationContext.config.get('dbMock')) { - casesRepo = new MockMongoRepository(); - } else { - casesRepo = new CasesMongoRepository(applicationContext); - } - } - return casesRepo; + if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); + return CasesMongoRepository.getInstance(applicationContext); }; export const getRuntimeStateRepository = ( diff --git a/backend/functions/lib/use-cases/case-assignment.ts b/backend/functions/lib/use-cases/case-assignment.ts index 8c94b8683..ed5e0b88f 100644 --- a/backend/functions/lib/use-cases/case-assignment.ts +++ b/backend/functions/lib/use-cases/case-assignment.ts @@ -1,6 +1,6 @@ -import { getAssignmentRepository, getCasesRepository } from '../factory'; +import Factory, { getAssignmentRepository } from '../factory'; import { ApplicationContext } from '../adapters/types/basic'; -import { CaseAssignmentRepository, CasesRepository } from './gateways.types'; +import { CaseAssignmentRepository } from './gateways.types'; import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CaseAssignmentHistory } from '../../../../common/src/cams/history'; import CaseManagement from './case-management'; @@ -12,12 +12,12 @@ import { createAuditRecord } from '../../../../common/src/cams/auditable'; const MODULE_NAME = 'CASE-ASSIGNMENT'; export class CaseAssignmentUseCase { + private context: ApplicationContext; private assignmentRepository: CaseAssignmentRepository; - private casesRepository: CasesRepository; constructor(applicationContext: ApplicationContext) { + this.context = applicationContext; this.assignmentRepository = getAssignmentRepository(applicationContext); - this.casesRepository = getCasesRepository(applicationContext); } public async createTrialAttorneyAssignments( @@ -27,6 +27,7 @@ export class CaseAssignmentUseCase { role: string, options: { processRoles?: CamsRole[] } = {}, ): Promise { + const casesRepo = Factory.getCasesRepository(context); const userAndProcessRoles = [].concat(context.session.user.roles).concat(options.processRoles); if (!userAndProcessRoles.includes(CamsRole.CaseAssignmentManager)) { throw new AssignmentError(MODULE_NAME, { @@ -44,7 +45,7 @@ export class CaseAssignmentUseCase { await this.assignTrialAttorneys(context, caseId, newAssignments, role); // Reassign all child cases if this is a joint administration lead case. - const consolidationReferences = await this.casesRepository.getConsolidation(caseId); + const consolidationReferences = await casesRepo.getConsolidation(caseId); const childCaseIds = consolidationReferences .filter( (reference) => @@ -55,6 +56,8 @@ export class CaseAssignmentUseCase { for (const childCaseId of childCaseIds) { await this.assignTrialAttorneys(context, childCaseId, newAssignments, role); } + + casesRepo.release(); } private async assignTrialAttorneys( @@ -63,6 +66,8 @@ export class CaseAssignmentUseCase { newAssignments: CamsUserReference[], role: string, ): Promise { + const casesRepo = Factory.getCasesRepository(context); + const assignmentRepo = Factory.getAssignmentRepository(context); context.logger.info(MODULE_NAME, 'New assignments:', newAssignments); const listOfAssignments: CaseAssignment[] = []; @@ -85,9 +90,7 @@ export class CaseAssignmentUseCase { }); const listOfAssignmentIdsCreated: string[] = []; - const existingAssignmentRecordsMap = await this.assignmentRepository.findAssignmentsByCaseId([ - caseId, - ]); + const existingAssignmentRecordsMap = await assignmentRepo.findAssignmentsByCaseId([caseId]); const existingAssignmentRecords = existingAssignmentRecordsMap.get(caseId) ?? []; for (const existingAssignment of existingAssignmentRecords) { const stillAssigned = listOfAssignments.find((newAssignment) => { @@ -97,7 +100,7 @@ export class CaseAssignmentUseCase { ); }); if (!stillAssigned) { - await this.assignmentRepository.update({ + await assignmentRepo.update({ ...existingAssignment, unassignedOn: new Date().toISOString(), }); @@ -109,15 +112,13 @@ export class CaseAssignmentUseCase { return ea.name === assignment.name && ea.role === assignment.role; }); if (!existingAssignment) { - const assignmentId = await this.assignmentRepository.create(assignment); + const assignmentId = await assignmentRepo.create(assignment); if (!listOfAssignmentIdsCreated.includes(assignmentId)) listOfAssignmentIdsCreated.push(assignmentId); } } - const newAssignmentRecordsMap = await this.assignmentRepository.findAssignmentsByCaseId([ - caseId, - ]); + const newAssignmentRecordsMap = await assignmentRepo.findAssignmentsByCaseId([caseId]); const newAssignmentRecords = newAssignmentRecordsMap.get(caseId); const history = createAuditRecord( { @@ -129,7 +130,7 @@ export class CaseAssignmentUseCase { context.session?.user, ); history.updatedOn = currentDate; - await this.casesRepository.createCaseHistory(history); + await casesRepo.createCaseHistory(history); context.logger.info( MODULE_NAME, @@ -137,11 +138,14 @@ export class CaseAssignmentUseCase { listOfAssignmentIdsCreated, ); + casesRepo.release(); + return listOfAssignmentIdsCreated; } public async findAssignmentsByCaseId(caseIds: string[]): Promise> { - return await this.assignmentRepository.findAssignmentsByCaseId(caseIds); + const assignmentRepo = Factory.getAssignmentRepository(this.context); + return await assignmentRepo.findAssignmentsByCaseId(caseIds); } public async getCaseLoad(userId: string): Promise { @@ -150,7 +154,7 @@ export class CaseAssignmentUseCase { } public async getCaseAssignments(userId: string): Promise { - const assignments = await this.assignmentRepository.findAssignmentsByAssignee(userId); - return assignments; + const assignmentRepo = Factory.getAssignmentRepository(this.context); + return await assignmentRepo.findAssignmentsByAssignee(userId); } } diff --git a/backend/functions/lib/use-cases/case-associated/case-associated.ts b/backend/functions/lib/use-cases/case-associated/case-associated.ts index 1123f6558..e4234a818 100644 --- a/backend/functions/lib/use-cases/case-associated/case-associated.ts +++ b/backend/functions/lib/use-cases/case-associated/case-associated.ts @@ -1,6 +1,5 @@ -import { getCasesRepository } from '../../factory'; +import Factory from '../../factory'; import { ApplicationContext } from '../../adapters/types/basic'; -import { CasesRepository } from '../gateways.types'; import { EventCaseReference } from '../../../../../common/src/cams/events'; function getEarliestDate(orders: Array) { @@ -10,15 +9,10 @@ function getEarliestDate(orders: Array) { } export class CaseAssociatedUseCase { - private casesRepository: CasesRepository; - - constructor(applicationContext: ApplicationContext) { - this.casesRepository = getCasesRepository(applicationContext); - } - public async getAssociatedCases(context: ApplicationContext): Promise { + const casesRepo = Factory.getCasesRepository(context); const caseId = context.request.params.caseId; - const consolidation = await this.casesRepository.getConsolidation(caseId); + const consolidation = await casesRepo.getConsolidation(caseId); if (!consolidation.length) return []; let leadCaseRef: EventCaseReference; @@ -30,14 +24,17 @@ export class CaseAssociatedUseCase { if (thisIsTheLeadCase) { childCaseRefs = consolidation; const leadCaseId = childCaseRefs[0].otherCase.caseId; - const childCaseConsolidation = await this.casesRepository.getConsolidation(leadCaseId); + const childCaseConsolidation = await casesRepo.getConsolidation(leadCaseId); leadCaseRef = childCaseConsolidation[0]; } else { leadCaseRef = consolidation[0]; const leadCaseId = leadCaseRef.otherCase.caseId; - childCaseRefs = await this.casesRepository.getConsolidation(leadCaseId); + childCaseRefs = await casesRepo.getConsolidation(leadCaseId); } leadCaseRef.orderDate = getEarliestDate(childCaseRefs); + + casesRepo.release(); + return [leadCaseRef, ...childCaseRefs]; } } diff --git a/backend/functions/lib/use-cases/case-management.ts b/backend/functions/lib/use-cases/case-management.ts index 0a3993f48..d2e6b2610 100644 --- a/backend/functions/lib/use-cases/case-management.ts +++ b/backend/functions/lib/use-cases/case-management.ts @@ -1,18 +1,13 @@ import { ApplicationContext } from '../adapters/types/basic'; import { CaseBasics, CaseDetail, CaseSummary } from '../../../../common/src/cams/cases'; -import { - getAssignmentRepository, - getCasesGateway, - getCasesRepository, - getOfficesGateway, -} from '../factory'; +import Factory, { getAssignmentRepository, getCasesGateway, getOfficesGateway } from '../factory'; import { CasesInterface } from './cases.interface'; import { CaseAssignmentUseCase } from './case-assignment'; import { UnknownError } from '../common-errors/unknown-error'; import { isCamsError } from '../common-errors/cams-error'; import { AssignmentError } from './assignment.exception'; import { OfficesGateway } from './offices/offices.types'; -import { CaseAssignmentRepository, CasesRepository } from './gateways.types'; +import { CaseAssignmentRepository } from './gateways.types'; import { CasesSearchPredicate } from '../../../../common/src/api/search'; import Actions, { Action, ResourceActions } from '../../../../common/src/cams/actions'; import { CamsRole } from '../../../../common/src/cams/roles'; @@ -41,16 +36,10 @@ export function getAction( export default class CaseManagement { assignmentGateway: CaseAssignmentRepository; casesGateway: CasesInterface; - casesRepo: CasesRepository; officesGateway: OfficesGateway; - constructor( - applicationContext: ApplicationContext, - casesGateway?: CasesInterface, - casesRepo?: CasesRepository, - ) { + constructor(applicationContext: ApplicationContext, casesGateway?: CasesInterface) { this.assignmentGateway = getAssignmentRepository(applicationContext); - this.casesRepo = casesRepo ? casesRepo : getCasesRepository(applicationContext); this.casesGateway = casesGateway ? casesGateway : getCasesGateway(applicationContext); this.officesGateway = getOfficesGateway(applicationContext); } @@ -117,17 +106,18 @@ export default class CaseManagement { } public async getCaseDetail( - applicationContext: ApplicationContext, + context: ApplicationContext, caseId: string, ): Promise> { + const casesRepo = Factory.getCasesRepository(context); try { - const caseDetails = await this.casesGateway.getCaseDetail(applicationContext, caseId); - caseDetails.transfers = await this.casesRepo.getTransfers(caseId); - caseDetails.consolidation = await this.casesRepo.getConsolidation(caseId); - caseDetails.assignments = await this.getCaseAssignments(applicationContext, caseDetails); + const caseDetails = await this.casesGateway.getCaseDetail(context, caseId); + caseDetails.transfers = await casesRepo.getTransfers(caseId); + caseDetails.consolidation = await casesRepo.getConsolidation(caseId); + caseDetails.assignments = await this.getCaseAssignments(context, caseDetails); caseDetails.officeName = this.officesGateway.getOfficeName(caseDetails.courtDivisionCode); caseDetails.officeCode = buildOfficeCode(caseDetails.regionId, caseDetails.courtDivisionCode); - const _actions = getAction(applicationContext, caseDetails); + const _actions = getAction(context, caseDetails); return { ...caseDetails, _actions }; } catch (originalError) { diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index 49f9981e5..b22c0367c 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -104,7 +104,7 @@ export interface AcmsGateway { ): Promise; } -export interface CasesRepository { +export interface CasesRepository extends Releaseable { createTransferFrom(reference: TransferFrom): Promise; createTransferTo(reference: TransferTo): Promise; getTransfers(caseId: string): Promise>; From 57ab0d35e8290be81fa7702d2eead0e3b40d21c7 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:03:52 -0500 Subject: [PATCH 041/112] Refactor repos to use consistent singleton pattern Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../mongo/cases.mongo.repository.test.ts | 2 +- .../mongo/consolidations.mongo.repository.ts | 25 ++++++++ .../mongo/offices.mongo.repository.ts | 22 +++++++ .../gateways/mongo/orders.mongo.repository.ts | 8 ++- .../user-session-cache.mongo.repository.ts | 25 ++++++++ backend/functions/lib/factory.ts | 61 +++++++++++++------ .../local-data/local-cases-repository.ts | 4 ++ .../local-consolidation-orders-repository.ts | 12 ++++ .../mock-gateways/mock-mongo.repository.ts | 3 +- .../mock-gateways/mock.offices.repository.ts | 1 + .../lib/use-cases/case-management.test.ts | 7 +-- .../functions/lib/use-cases/gateways.types.ts | 19 ++++-- .../lib/use-cases/offices/offices.test.ts | 16 ++++- .../lib/use-cases/offices/offices.ts | 9 ++- .../functions/lib/use-cases/orders/orders.ts | 10 ++- .../user-session/user-session.test.ts | 1 + .../use-cases/user-session/user-session.ts | 2 + 17 files changed, 185 insertions(+), 42 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts index 8fa3deacd..34965b283 100644 --- a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts @@ -33,7 +33,7 @@ describe('Cases repository', () => { beforeEach(async () => { context = await createMockApplicationContext(); - repo = new CasesMongoRepository(context); + repo = CasesMongoRepository.getInstance(context); }); afterEach(async () => { diff --git a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts index 666017da9..62c2e08fe 100644 --- a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts @@ -16,10 +16,35 @@ export default class ConsolidationOrdersMongoRepository { + private static referenceCount: number = 0; + private static instance: ConsolidationOrdersMongoRepository; + constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!ConsolidationOrdersMongoRepository.instance) { + ConsolidationOrdersMongoRepository.instance = new ConsolidationOrdersMongoRepository(context); + } + ConsolidationOrdersMongoRepository.referenceCount++; + return ConsolidationOrdersMongoRepository.instance; + } + + public static dropInstance() { + if (ConsolidationOrdersMongoRepository.referenceCount > 0) { + ConsolidationOrdersMongoRepository.referenceCount--; + } + if (ConsolidationOrdersMongoRepository.referenceCount < 1) { + ConsolidationOrdersMongoRepository.instance.client.close().then(); + ConsolidationOrdersMongoRepository.instance = null; + } + } + + public release() { + ConsolidationOrdersMongoRepository.dropInstance(); + } + async read(id: string): Promise { try { const query = QueryBuilder.build( diff --git a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts index 9f88dd152..9ee537311 100644 --- a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts @@ -21,10 +21,32 @@ export type OfficeStaff = Staff & }; export class OfficesMongoRepository extends BaseMongoRepository implements OfficesRepository { + private static referenceCount: number = 0; + private static instance: OfficesMongoRepository; + constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!OfficesMongoRepository.instance) + OfficesMongoRepository.instance = new OfficesMongoRepository(context); + OfficesMongoRepository.referenceCount++; + return OfficesMongoRepository.instance; + } + + public static dropInstance() { + if (OfficesMongoRepository.referenceCount > 0) OfficesMongoRepository.referenceCount--; + if (OfficesMongoRepository.referenceCount < 1) { + OfficesMongoRepository.instance.client.close().then(); + OfficesMongoRepository.instance = null; + } + } + + public release() { + OfficesMongoRepository.dropInstance(); + } + async putOfficeStaff(officeCode: string, user: CamsUserReference): Promise { const ttl = 86400; const staff = createAuditRecord({ diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts index 3cac03021..40d308f83 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts @@ -24,14 +24,17 @@ export class OrdersMongoRepository extends BaseMongoRepository implements Orders } public static getInstance(context: ApplicationContext) { - if (!OrdersMongoRepository.instance) + if (!OrdersMongoRepository.instance) { OrdersMongoRepository.instance = new OrdersMongoRepository(context); + } OrdersMongoRepository.referenceCount++; return OrdersMongoRepository.instance; } public static dropInstance() { - if (OrdersMongoRepository.referenceCount > 0) OrdersMongoRepository.referenceCount--; + if (OrdersMongoRepository.referenceCount > 0) { + OrdersMongoRepository.referenceCount--; + } if (OrdersMongoRepository.referenceCount < 1) { OrdersMongoRepository.instance.client.close().then(); OrdersMongoRepository.instance = null; @@ -39,7 +42,6 @@ export class OrdersMongoRepository extends BaseMongoRepository implements Orders } public release() { - console.log('***** RELEASE CALLED **********'); OrdersMongoRepository.dropInstance(); } diff --git a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts index 1efacbe96..fdba69d2d 100644 --- a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts @@ -23,10 +23,35 @@ export class UserSessionCacheMongoRepository extends BaseMongoRepository implements UserSessionCacheRepository { + private static referenceCount: number = 0; + private static instance: UserSessionCacheMongoRepository; + constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); } + public static getInstance(context: ApplicationContext) { + if (!UserSessionCacheMongoRepository.instance) { + UserSessionCacheMongoRepository.instance = new UserSessionCacheMongoRepository(context); + } + UserSessionCacheMongoRepository.referenceCount++; + return UserSessionCacheMongoRepository.instance; + } + + public static dropInstance() { + if (UserSessionCacheMongoRepository.referenceCount > 0) { + UserSessionCacheMongoRepository.referenceCount--; + } + if (UserSessionCacheMongoRepository.referenceCount < 1) { + UserSessionCacheMongoRepository.instance.client.close().then(); + UserSessionCacheMongoRepository.instance = null; + } + } + + public release() { + UserSessionCacheMongoRepository.dropInstance(); + } + public async read(token: string): Promise { const tokenParts = token.split('.'); if (tokenParts.length !== 3) { diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index 5cf918427..d10ab2f83 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -14,6 +14,7 @@ import { CasesRepository, ConsolidationOrdersRepository, OfficesRepository, + OfficeStaffSyncState, OrdersGateway, OrdersRepository, OrderSyncState, @@ -48,15 +49,16 @@ import { AcmsGatewayImpl } from './adapters/gateways/acms/acms.gateway'; let casesGateway: CasesInterface; let ordersGateway: OrdersGateway; -let consolidationsRepo: ConsolidationOrdersRepository; -let orderSyncStateRepo: RuntimeStateRepository; let storageGateway: StorageGateway; let acmsGateway: AcmsGateway; -// TODO: Need a better place to export this from. -export interface Releaseable { - release: () => void; -} +let orderSyncStateRepo: RuntimeStateRepository; +let officeStaffSyncStateRepo: RuntimeStateRepository; + +let mockOrdersRepository: MockMongoRepository; +let mockConsolidationsRepository: MockMongoRepository; +let mockCasesRepository: MockMongoRepository; +let mockUserSessionCacheRepository: MockMongoRepository; export const getAttorneyGateway = (): AttorneyGatewayInterface => { return MockAttorneysGateway; @@ -116,13 +118,16 @@ export const getOfficesRepository = (applicationContext: ApplicationContext): Of if (applicationContext.config.authConfig.provider === 'mock') { return MockOfficesRepository; } - return new OfficesMongoRepository(applicationContext); + return OfficesMongoRepository.getInstance(applicationContext); }; // transfer orders export const getOrdersRepository = (applicationContext: ApplicationContext): OrdersRepository => { if (applicationContext.config.get('dbMock')) { - return MockMongoRepository.getInstance(applicationContext); + if (!mockOrdersRepository) { + mockOrdersRepository = MockMongoRepository.getInstance(applicationContext); + } + return mockOrdersRepository; } else { return OrdersMongoRepository.getInstance(applicationContext); } @@ -131,18 +136,23 @@ export const getOrdersRepository = (applicationContext: ApplicationContext): Ord export const getConsolidationOrdersRepository = ( applicationContext: ApplicationContext, ): ConsolidationOrdersRepository => { - if (!consolidationsRepo) { - if (applicationContext.config.get('dbMock')) { - consolidationsRepo = new MockMongoRepository(); - } else { - consolidationsRepo = new ConsolidationOrdersMongoRepository(applicationContext); + if (applicationContext.config.get('dbMock')) { + if (!mockConsolidationsRepository) { + mockConsolidationsRepository = MockMongoRepository.getInstance(applicationContext); } + return mockConsolidationsRepository; + } else { + return ConsolidationOrdersMongoRepository.getInstance(applicationContext); } - return consolidationsRepo; }; export const getCasesRepository = (applicationContext: ApplicationContext): CasesRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); + if (applicationContext.config.get('dbMock')) { + if (!mockCasesRepository) { + mockCasesRepository = MockMongoRepository.getInstance(applicationContext); + } + return mockCasesRepository; + } return CasesMongoRepository.getInstance(applicationContext); }; @@ -162,6 +172,15 @@ export const getOrderSyncStateRepo = ( return orderSyncStateRepo; }; +export const getOfficeStaffSyncStateRepo = ( + context: ApplicationContext, +): RuntimeStateRepository => { + if (!officeStaffSyncStateRepo) { + officeStaffSyncStateRepo = getRuntimeStateRepository(context); + } + return officeStaffSyncStateRepo; +}; + export const getAuthorizationGateway = (context: ApplicationContext): OpenIdConnectGateway => { if (context.config.authConfig.provider === 'okta') return OktaGateway; if (context.config.authConfig.provider === 'mock') return MockOpenIdConnectGateway; @@ -178,8 +197,13 @@ export const getUserSessionUseCase = (context: ApplicationContext) => { export const getUserSessionCacheRepository = ( context: ApplicationContext, ): UserSessionCacheRepository => { - if (context.config.get('dbMock')) return new MockMongoRepository(); - return new UserSessionCacheMongoRepository(context); + if (context.config.get('dbMock')) { + if (!mockUserSessionCacheRepository) { + mockUserSessionCacheRepository = MockMongoRepository.getInstance(context); + } + return mockUserSessionCacheRepository; + } + return UserSessionCacheMongoRepository.getInstance(context); }; export const getStorageGateway = (_context: ApplicationContext): StorageGateway => { @@ -211,10 +235,11 @@ export const Factory = { getOfficesGateway, getOfficesRepository, getOrdersRepository, - getOrderSyncStateRepo, getConsolidationOrdersRepository, getCasesRepository, getRuntimeStateRepository, + getOrderSyncStateRepo, + getOfficeStaffSyncStateRepo, getAuthorizationGateway, getUserSessionUseCase, getUserSessionCacheRepository, diff --git a/backend/functions/lib/testing/local-data/local-cases-repository.ts b/backend/functions/lib/testing/local-data/local-cases-repository.ts index 23489c266..eb25b823b 100644 --- a/backend/functions/lib/testing/local-data/local-cases-repository.ts +++ b/backend/functions/lib/testing/local-data/local-cases-repository.ts @@ -15,6 +15,10 @@ export class LocalCasesRepository implements CasesRepository { consolidationsContainer: Consolidation[] = []; transfersContainer: Transfer[] = []; + release() { + return; + } + async createTransferFrom(reference: TransferFrom): Promise { const doc = { ...reference, id: crypto.randomUUID() }; this.transfersContainer.push(doc); diff --git a/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts b/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts index 6684d6867..5dd2f58c1 100644 --- a/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts +++ b/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts @@ -2,10 +2,22 @@ import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; import { ConsolidationOrdersRepository } from '../../use-cases/gateways.types'; import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; import * as crypto from 'crypto'; +import { ApplicationContext } from '../../adapters/types/basic'; export class LocalConsolidationOrdersRepository implements ConsolidationOrdersRepository { container: ConsolidationOrder[] = []; + private static singleton: LocalConsolidationOrdersRepository; + + release() { + return; + } + + static getInstance(_context: ApplicationContext) { + if (!this.singleton) this.singleton = new LocalConsolidationOrdersRepository(); + return this.singleton; + } + async search(_predicate?: OrdersSearchPredicate): Promise { return [...this.container]; } diff --git a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts index 122c6dc7b..8e01c99ce 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts +++ b/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts @@ -35,8 +35,7 @@ export class MockMongoRepository } static getInstance(_context: ApplicationContext) { - if (!this.singleton) this.singleton = new MockMongoRepository(); - return this.singleton; + return new MockMongoRepository(); } findAssignmentsByCaseId(..._ignore): Promise { diff --git a/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts b/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts index 0c9d5f619..39309b511 100644 --- a/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts +++ b/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts @@ -1,6 +1,7 @@ import { TRIAL_ATTORNEYS } from '../../../../../common/src/cams/test-utilities/attorneys.mock'; export const MockOfficesRepository = { + release: () => {}, putOfficeStaff: (_officeCode, _user) => Promise.resolve(), getOfficeAttorneys: () => { return Promise.resolve(TRIAL_ATTORNEYS); diff --git a/backend/functions/lib/use-cases/case-management.test.ts b/backend/functions/lib/use-cases/case-management.test.ts index 4c41eee15..02e76f32c 100644 --- a/backend/functions/lib/use-cases/case-management.test.ts +++ b/backend/functions/lib/use-cases/case-management.test.ts @@ -8,7 +8,7 @@ import { createMockApplicationContextSession, } from '../testing/testing-utilities'; import { CamsRole } from '../../../../common/src/cams/roles'; -import { getCasesGateway, getCasesRepository } from '../factory'; +import { getCasesGateway } from '../factory'; import { ApplicationContext } from '../adapters/types/basic'; import { CamsUser } from '../../../../common/src/cams/users'; import { @@ -107,15 +107,12 @@ describe('Case management tests', () => { describe('constructor tests', () => { test('should always set casesRepo and officesGateway', () => { const casesGateway = getCasesGateway(applicationContext); - const casesRepo = getCasesRepository(applicationContext); const basic = new CaseManagement(applicationContext); - const withOptionalParams = new CaseManagement(applicationContext, casesGateway, casesRepo); + const withOptionalParams = new CaseManagement(applicationContext, casesGateway); expect(basic.casesGateway).toBeDefined(); - expect(basic.casesRepo).toBeDefined(); expect(withOptionalParams.casesGateway).toBeDefined(); - expect(withOptionalParams.casesRepo).toBeDefined(); }); }); diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/functions/lib/use-cases/gateways.types.ts index b22c0367c..8479ad768 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/functions/lib/use-cases/gateways.types.ts @@ -20,7 +20,10 @@ import { CaseAssignment } from '../../../../common/src/cams/assignments'; import { CamsSession } from '../../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; import { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders/acms-orders'; -import { Releaseable } from '../factory'; + +export interface Releasable { + release: () => void; +} interface Creates { create(data: T): Promise; @@ -55,9 +58,13 @@ export interface ConsolidationOrdersRepository Creates, CreatesMany, Reads, - Deletes {} + Deletes, + Releasable {} -export interface UserSessionCacheRepository extends Reads, Upserts {} +export interface UserSessionCacheRepository + extends Reads, + Upserts, + Releasable {} export interface CaseAssignmentRepository extends Creates, @@ -71,7 +78,7 @@ export interface OrdersRepository CreatesMany, Reads, Updates, - Releaseable {} + Releasable {} export interface RuntimeStateRepository extends Reads, @@ -104,7 +111,7 @@ export interface AcmsGateway { ): Promise; } -export interface CasesRepository extends Releaseable { +export interface CasesRepository extends Releasable { createTransferFrom(reference: TransferFrom): Promise; createTransferTo(reference: TransferTo): Promise; getTransfers(caseId: string): Promise>; @@ -115,7 +122,7 @@ export interface CasesRepository extends Releaseable { createCaseHistory(history: CaseHistory); } -export interface OfficesRepository { +export interface OfficesRepository extends Releasable { getOfficeAttorneys(officeCode: string): Promise; putOfficeStaff(officeCode: string, user: CamsUserReference): Promise; } diff --git a/backend/functions/lib/use-cases/offices/offices.test.ts b/backend/functions/lib/use-cases/offices/offices.test.ts index e83467242..3df12cdfd 100644 --- a/backend/functions/lib/use-cases/offices/offices.test.ts +++ b/backend/functions/lib/use-cases/offices/offices.test.ts @@ -88,6 +88,7 @@ describe('offices use case tests', () => { const repoSpy = jest.fn().mockResolvedValue([]); jest.spyOn(factory, 'getOfficesRepository').mockImplementation(() => { return { + release: () => {}, putOfficeStaff: jest.fn(), getOfficeAttorneys: repoSpy, close: jest.fn(), @@ -102,11 +103,20 @@ describe('offices use case tests', () => { expect(attorneysSpy).toHaveBeenCalledWith(localContext); }); + // TODO: this test is broken line 121 test('should return attorneys for office with feature flag on', async () => { + const localContext = { + ...applicationContext, + featureFlags: { ...applicationContext.featureFlags }, + }; + localContext.featureFlags['restrict-case-assignment'] = true; + const useCase = new OfficesUseCase(); - const repoSpy = jest.fn().mockResolvedValue([]); + const mockAttorneys = []; + const repoSpy = jest.fn().mockResolvedValue(mockAttorneys); jest.spyOn(factory, 'getOfficesRepository').mockImplementation(() => { return { + release: () => {}, putOfficeStaff: jest.fn(), getOfficeAttorneys: repoSpy, close: jest.fn(), @@ -115,8 +125,8 @@ describe('offices use case tests', () => { const attorneysSpy = jest.spyOn(AttorneysList.prototype, 'getAttorneyList'); const officeCode = 'new-york'; - const officeAttorneys = await useCase.getOfficeAttorneys(applicationContext, officeCode); - expect(officeAttorneys).toEqual([]); + const officeAttorneys = await useCase.getOfficeAttorneys(localContext, officeCode); + expect(officeAttorneys).toEqual(mockAttorneys); expect(repoSpy).toHaveBeenCalledWith(officeCode); expect(attorneysSpy).not.toHaveBeenCalled(); }); diff --git a/backend/functions/lib/use-cases/offices/offices.ts b/backend/functions/lib/use-cases/offices/offices.ts index 66ab95a3b..de5181b01 100644 --- a/backend/functions/lib/use-cases/offices/offices.ts +++ b/backend/functions/lib/use-cases/offices/offices.ts @@ -4,9 +4,9 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { getOfficesGateway, getUserGroupGateway, - getOfficesRepository, getStorageGateway, - getRuntimeStateRepository, + getOfficesRepository, + getOfficeStaffSyncStateRepo, } from '../../factory'; import { OfficeStaffSyncState } from '../gateways.types'; import { USTP_OFFICE_NAME_MAP } from '../../adapters/gateways/dxtr/dxtr.constants'; @@ -44,6 +44,7 @@ export class OfficesUseCase { if (context.featureFlags['restrict-case-assignment']) { const repository = getOfficesRepository(context); attorneys = await repository.getOfficeAttorneys(officeCode); + repository.release(); } else { const attorneysUseCase = new AttorneysList(); attorneys = await attorneysUseCase.getAttorneyList(context); @@ -116,10 +117,12 @@ export class OfficesUseCase { officesWithUsers, }; - const runtimeStateRepo = getRuntimeStateRepository(context); + const runtimeStateRepo = getOfficeStaffSyncStateRepo(context); await runtimeStateRepo.upsert(result); + repository.release(); + return result; } } diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 7be24948b..129dcfaa8 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -76,6 +76,7 @@ export class OrdersUseCase { const consolidationOrders = await consolidationsRepo.search(predicate); ordersRepo.release(); + consolidationsRepo.release(); return transferOrders .concat(consolidationOrders) @@ -152,6 +153,7 @@ export class OrdersUseCase { } ordersRepo.release(); + casesRepo.release(); } public async syncOrders( @@ -251,8 +253,10 @@ export class OrdersUseCase { const finalSyncState = { ...initialSyncState, txId: maxTxId }; await runtimeStateRepo.upsert(finalSyncState); context.logger.info(MODULE_NAME, 'Updated runtime state in repo (Cosmos)', finalSyncState); - + //TODO: Will need runtime state repo release once implemented + casesRepo.release(); ordersRepo.release(); + consolidationsRepo.release(); return { options, @@ -307,6 +311,8 @@ export class OrdersUseCase { .filter((h) => h.documentType === 'AUDIT_CONSOLIDATION') .sort((a, b) => sortDatesReverse(a.updatedOn, b.updatedOn)) .shift()?.after; + + casesRepo.release(); } catch { before = undefined; } @@ -462,6 +468,8 @@ export class OrdersUseCase { await casesRepo.createCaseHistory(leadCaseHistory); } + consolidationsRepo.release(); + return response; } diff --git a/backend/functions/lib/use-cases/user-session/user-session.test.ts b/backend/functions/lib/use-cases/user-session/user-session.test.ts index b0897cd87..4097bc89a 100644 --- a/backend/functions/lib/use-cases/user-session/user-session.test.ts +++ b/backend/functions/lib/use-cases/user-session/user-session.test.ts @@ -143,6 +143,7 @@ describe('user-session.gateway test', () => { jest.spyOn(factoryModule, 'getUserSessionCacheRepository').mockReturnValue({ upsert: jest.fn(), read: jest.fn().mockRejectedValue(new NotFoundError('')), + release: () => {}, }); jest.spyOn(factoryModule, 'getAuthorizationGateway').mockReturnValue(MockOpenIdConnectGateway); diff --git a/backend/functions/lib/use-cases/user-session/user-session.ts b/backend/functions/lib/use-cases/user-session/user-session.ts index 69a6581f3..f5aa66800 100644 --- a/backend/functions/lib/use-cases/user-session/user-session.ts +++ b/backend/functions/lib/use-cases/user-session/user-session.ts @@ -69,6 +69,8 @@ export class UserSessionUseCase { await sessionCacheRepository.upsert(session); + sessionCacheRepository.release(); + return session; } catch (error) { throw isCamsError(error) From 9e35fdd440a351dbb89a47871f0127dc924b8a14 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Tue, 3 Dec 2024 14:18:23 -0500 Subject: [PATCH 042/112] updated CaseHistory use case to allow for release add release on acms-orders Jira ticket: CAMS-461 --- .../case-history/case-history.function.ts | 2 +- .../case-history.controller.test.ts | 6 +++--- .../case-history/case-history.controller.ts | 6 +++--- .../lib/use-cases/acms-orders/acms-orders.ts | 2 ++ .../use-cases/case-history/case-history.test.ts | 5 +++-- .../lib/use-cases/case-history/case-history.ts | 17 +++++++---------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/backend/functions/case-history/case-history.function.ts b/backend/functions/case-history/case-history.function.ts index f14d4578c..69ffec218 100644 --- a/backend/functions/case-history/case-history.function.ts +++ b/backend/functions/case-history/case-history.function.ts @@ -22,7 +22,7 @@ export default async function handler( logger, request, ); - const caseHistoryController = new CaseHistoryController(applicationContext); + const caseHistoryController = new CaseHistoryController(); const responseBody = await caseHistoryController.handleRequest(applicationContext); return toAzureSuccess(responseBody); } catch (error) { diff --git a/backend/functions/lib/controllers/case-history/case-history.controller.test.ts b/backend/functions/lib/controllers/case-history/case-history.controller.test.ts index 002fc7243..bf002d5bb 100644 --- a/backend/functions/lib/controllers/case-history/case-history.controller.test.ts +++ b/backend/functions/lib/controllers/case-history/case-history.controller.test.ts @@ -13,7 +13,7 @@ describe('Test case-history controller', () => { test('should return a case history when getCaseHistory is called', async () => { jest.spyOn(CaseHistoryUseCase.prototype, 'getCaseHistory').mockResolvedValue(CASE_HISTORY); - const controller = new CaseHistoryController(applicationContext); + const controller = new CaseHistoryController(); const result = await controller.handleRequest(applicationContext); expect(result.body['data']).toEqual(CASE_HISTORY); }); @@ -22,13 +22,13 @@ describe('Test case-history controller', () => { jest .spyOn(CaseHistoryUseCase.prototype, 'getCaseHistory') .mockRejectedValue(new NotFoundError('TEST')); - const controller = new CaseHistoryController(applicationContext); + const controller = new CaseHistoryController(); await expect(controller.handleRequest(applicationContext)).rejects.toThrow('Not found'); }); test('should wrap unexpected errors with CamsError', async () => { const expectedMessage = 'Unknown Error'; - const controller = new CaseHistoryController(applicationContext); + const controller = new CaseHistoryController(); jest.spyOn(CaseHistoryUseCase.prototype, 'getCaseHistory').mockImplementation(async () => { throw Error(expectedMessage); }); diff --git a/backend/functions/lib/controllers/case-history/case-history.controller.ts b/backend/functions/lib/controllers/case-history/case-history.controller.ts index 4a96ae728..715342c38 100644 --- a/backend/functions/lib/controllers/case-history/case-history.controller.ts +++ b/backend/functions/lib/controllers/case-history/case-history.controller.ts @@ -11,14 +11,14 @@ const MODULE_NAME = 'CASE-HISTORY-CONTROLLER'; export class CaseHistoryController implements CamsController { private readonly useCase: CaseHistoryUseCase; - constructor(applicationContext: ApplicationContext) { - this.useCase = new CaseHistoryUseCase(applicationContext); + constructor() { + this.useCase = new CaseHistoryUseCase(); } public async handleRequest( context: ApplicationContext, ): Promise> { try { - const caseHistory = await this.useCase.getCaseHistory(context.request.params.id); + const caseHistory = await this.useCase.getCaseHistory(context); const success = httpSuccess({ body: { meta: { diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index bf1d8ce1d..4d950320f 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -180,6 +180,8 @@ export class AcmsOrders { await casesRepo.createCaseHistory(leadCaseHistory); leadCaseHistoryBefore = leadCaseHistoryAfter; } + + casesRepo.release(); } catch (error) { report.success = false; const camsError = getCamsError( diff --git a/backend/functions/lib/use-cases/case-history/case-history.test.ts b/backend/functions/lib/use-cases/case-history/case-history.test.ts index 38708730a..f7af37e4a 100644 --- a/backend/functions/lib/use-cases/case-history/case-history.test.ts +++ b/backend/functions/lib/use-cases/case-history/case-history.test.ts @@ -9,8 +9,9 @@ describe('Test case-history use case', () => { jest.spyOn(MockMongoRepository.prototype, 'getCaseHistory').mockResolvedValue(CASE_HISTORY); const mockContext = await createMockApplicationContext(); const caseId = NORMAL_CASE_ID; - const useCase = new CaseHistoryUseCase(mockContext); - const result = await useCase.getCaseHistory(caseId); + mockContext.request.params.id = caseId; + const useCase = new CaseHistoryUseCase(); + const result = await useCase.getCaseHistory(mockContext); expect(result).toEqual(CASE_HISTORY); }); }); diff --git a/backend/functions/lib/use-cases/case-history/case-history.ts b/backend/functions/lib/use-cases/case-history/case-history.ts index bf661b79d..04ade0bc0 100644 --- a/backend/functions/lib/use-cases/case-history/case-history.ts +++ b/backend/functions/lib/use-cases/case-history/case-history.ts @@ -1,16 +1,13 @@ -import { getCasesRepository } from '../../factory'; +import Factory from '../../factory'; import { ApplicationContext } from '../../adapters/types/basic'; -import { CasesRepository } from '../gateways.types'; import { CaseHistory } from '../../../../../common/src/cams/history'; export class CaseHistoryUseCase { - private casesRepository: CasesRepository; - - constructor(applicationContext: ApplicationContext) { - this.casesRepository = getCasesRepository(applicationContext); - } - - public async getCaseHistory(caseId: string): Promise { - return this.casesRepository.getCaseHistory(caseId); + public async getCaseHistory(context: ApplicationContext): Promise { + const caseId = context.request.params.id; + const casesRepo = Factory.getCasesRepository(context); + const caseHistory = casesRepo.getCaseHistory(caseId); + casesRepo.release(); + return caseHistory; } } From dd6316c748e368c6ed03edc77287a65e3828b9d7 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Tue, 3 Dec 2024 14:30:52 -0500 Subject: [PATCH 043/112] updated runtimestate repo to use deferclose Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- .../adapters/gateways/mongo/runtime-state.mongo.repository.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts index 988de260a..4e35c1054 100644 --- a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts @@ -7,6 +7,7 @@ import { import QueryBuilder from '../../../query/query-builder'; import { getCamsError } from '../../../common-errors/error-utilities'; import { BaseMongoRepository } from './utils/base-mongo-repository'; +import { deferClose } from '../../../defer-close'; const MODULE_NAME = 'RUNTIME_STATE_MONGO_REPOSITORY'; const COLLECTION_NAME = 'runtime-state'; @@ -19,6 +20,7 @@ export class RuntimeStateMongoRepository { constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); + deferClose(context, this.client); } async read(id: RuntimeStateDocumentType): Promise { From f430393206edd996cb44e65150e9c2715a394747 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:07:19 -0500 Subject: [PATCH 044/112] Add finalize deferrables function Jira ticket: CAMS-461 --- .../azure/application-context-creator.ts | 1 + .../healthcheck/healthcheck.db.cosmos.test.ts | 2 +- .../healthcheck/healthcheck.db.cosmos.ts | 2 +- .../healthcheck/healthcheck.function.ts | 2 +- .../gateways/abstract-mssql-client.ts | 2 +- .../case-assignment.mongo.repository.test.ts | 2 +- .../mongo/cases.mongo.repository.test.ts | 2 +- .../consolidations.mongo.repository.test.ts | 2 +- .../mongo/offices.mongo.repository.test.ts | 2 +- .../mongo/orders.mongo.repository.test.ts | 2 +- .../runtime-state.mongo.repository.test.ts | 2 +- .../mongo/runtime-state.mongo.repository.ts | 2 +- ...ser-session-cache.mongo.repository.test.ts | 2 +- .../functions/lib/adapters/types/basic.d.ts | 4 +- .../acms-orders/acms-orders.controller.ts | 13 +++- .../attorneys/attorneys.controller.ts | 4 +- .../case.assignment.controller.ts | 4 +- .../case-associated.controller.ts | 4 +- .../case-docket/case-docket.controller.ts | 4 +- .../case-history/case-history.controller.ts | 4 +- .../case-summary/case-summary.controller.ts | 4 +- .../lib/controllers/cases/cases.controller.ts | 4 +- .../controllers/courts/courts.controller.ts | 4 +- .../lib/controllers/me/me.controller.ts | 4 +- .../controllers/offices/offices.controller.ts | 6 +- .../controllers/orders/orders.controller.ts | 6 +- .../lib/{ => deferrable}/defer-close.test.ts | 0 .../lib/{ => deferrable}/defer-close.ts | 0 .../lib/deferrable/defer-release.test.ts | 48 ++++++++++++ .../functions/lib/deferrable/defer-release.ts | 37 +++++++++ .../deferrable/finalize-deferrable.test.ts | 26 +++++++ .../lib/deferrable/finalize-deferrable.ts | 9 +++ backend/functions/lib/factory.ts | 75 +++++++++++-------- .../lib/humble-objects/mongo-humble.ts | 2 +- .../lib/use-cases/acms-orders/acms-orders.ts | 2 - .../lib/use-cases/case-assignment.ts | 5 -- .../case-associated/case-associated.ts | 3 - .../use-cases/case-history/case-history.ts | 1 - .../lib/use-cases/offices/offices.ts | 4 - .../functions/lib/use-cases/orders/orders.ts | 14 ---- .../use-cases/user-session/user-session.ts | 3 - 41 files changed, 214 insertions(+), 105 deletions(-) rename backend/functions/lib/{ => deferrable}/defer-close.test.ts (100%) rename backend/functions/lib/{ => deferrable}/defer-close.ts (100%) create mode 100644 backend/functions/lib/deferrable/defer-release.test.ts create mode 100644 backend/functions/lib/deferrable/defer-release.ts create mode 100644 backend/functions/lib/deferrable/finalize-deferrable.test.ts create mode 100644 backend/functions/lib/deferrable/finalize-deferrable.ts diff --git a/backend/functions/azure/application-context-creator.ts b/backend/functions/azure/application-context-creator.ts index c35717b9e..adbfdeeb3 100644 --- a/backend/functions/azure/application-context-creator.ts +++ b/backend/functions/azure/application-context-creator.ts @@ -47,6 +47,7 @@ async function getApplicationContext(args: { request: request ? await azureToCamsHttpRequest(request) : undefined, session: undefined, closables: [], + releasables: [], } satisfies ApplicationContext; } diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts b/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts index 409c9b032..1dc90b893 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts +++ b/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts @@ -2,7 +2,7 @@ import { describe } from 'node:test'; import { ApplicationContext } from '../lib/adapters/types/basic'; import { createMockApplicationContext } from '../lib/testing/testing-utilities'; -import { closeDeferred } from '../lib/defer-close'; +import { closeDeferred } from '../lib/deferrable/defer-close'; import HealthcheckCosmosDb, { HealthCheckDocument } from './healthcheck.db.cosmos'; import { MongoCollectionAdapter } from '../lib/adapters/gateways/mongo/utils/mongo-adapter'; diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.ts b/backend/functions/healthcheck/healthcheck.db.cosmos.ts index 53fd1e872..1ec6e5b06 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.ts +++ b/backend/functions/healthcheck/healthcheck.db.cosmos.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { ApplicationContext } from '../lib/adapters/types/basic'; import { DocumentClient } from '../lib/humble-objects/mongo-humble'; import QueryBuilder from '../lib/query/query-builder'; -import { deferClose } from '../lib/defer-close'; +import { deferClose } from '../lib/deferrable/defer-close'; import { MongoCollectionAdapter } from '../lib/adapters/gateways/mongo/utils/mongo-adapter'; dotenv.config(); diff --git a/backend/functions/healthcheck/healthcheck.function.ts b/backend/functions/healthcheck/healthcheck.function.ts index 7199d25fd..d89d84389 100644 --- a/backend/functions/healthcheck/healthcheck.function.ts +++ b/backend/functions/healthcheck/healthcheck.function.ts @@ -8,7 +8,7 @@ import HealthcheckInfo from './healthcheck.info'; import { toAzureError, toAzureSuccess } from '../azure/functions'; import { httpSuccess } from '../lib/adapters/utils/http-response'; import HttpStatusCodes from '../../../common/src/api/http-status-codes'; -import { closeDeferred } from '../lib/defer-close'; +import { closeDeferred } from '../lib/deferrable/defer-close'; const MODULE_NAME = 'HEALTHCHECK'; diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index 2361603c2..0623207ce 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -1,6 +1,6 @@ import { config, ConnectionError, ConnectionPool, MSSQLError, IResult } from 'mssql'; import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; -import { Closable, deferClose } from '../../defer-close'; +import { Closable, deferClose } from '../../deferrable/defer-close'; import { ApplicationContext } from '../types/basic'; export abstract class AbstractMssqlClient implements Closable { diff --git a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts index 28a67ad37..3f8fa0933 100644 --- a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts @@ -1,6 +1,6 @@ import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; import { getCamsError } from '../../../common-errors/error-utilities'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; import { ApplicationContext } from '../../types/basic'; import { CaseAssignmentMongoRepository } from './case-assignment.mongo.repository'; diff --git a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts index 34965b283..0c5170d34 100644 --- a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts @@ -3,7 +3,7 @@ import { TransferFrom, TransferTo } from '../../../../../../common/src/cams/even import { CaseAssignmentHistory } from '../../../../../../common/src/cams/history'; import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; import { CamsError } from '../../../common-errors/cams-error'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { CASE_HISTORY } from '../../../testing/mock-data/case-history.mock'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; import { ApplicationContext } from '../../types/basic'; diff --git a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts index 8c861bdc2..970520db4 100644 --- a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts @@ -4,7 +4,7 @@ import MockData from '../../../../../../common/src/cams/test-utilities/mock-data import ConsolidationOrdersMongoRepository from './consolidations.mongo.repository'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; import QueryBuilder from '../../../query/query-builder'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { getCamsError } from '../../../common-errors/error-utilities'; describe('Consolidations Repository tests', () => { diff --git a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts index 3eb28695d..8ae93dfaf 100644 --- a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts @@ -8,7 +8,7 @@ import { MongoCollectionAdapter } from './utils/mongo-adapter'; import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; import QueryBuilder from '../../../query/query-builder'; import { CamsRole } from '../../../../../../common/src/cams/roles'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { createAuditRecord } from '../../../../../../common/src/cams/auditable'; import { getCamsError } from '../../../common-errors/error-utilities'; diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts index 31ac0e6c0..9a8f947e0 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts @@ -5,7 +5,7 @@ import MockData from '../../../../../../common/src/cams/test-utilities/mock-data import { TransferOrderAction } from '../../../../../../common/src/cams/orders'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; import QueryBuilder from '../../../query/query-builder'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { UnknownError } from '../../../common-errors/unknown-error'; import { NotFoundError } from '../../../common-errors/not-found-error'; diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts index a129fa07e..d6628c89f 100644 --- a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts @@ -4,7 +4,7 @@ import { ApplicationContext } from '../../types/basic'; import { RuntimeStateMongoRepository } from './runtime-state.mongo.repository'; import * as crypto from 'crypto'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import { UnknownError } from '../../../common-errors/unknown-error'; describe('Runtime State Repo', () => { diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts index 4e35c1054..db9b6e5ea 100644 --- a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts @@ -7,7 +7,7 @@ import { import QueryBuilder from '../../../query/query-builder'; import { getCamsError } from '../../../common-errors/error-utilities'; import { BaseMongoRepository } from './utils/base-mongo-repository'; -import { deferClose } from '../../../defer-close'; +import { deferClose } from '../../../deferrable/defer-close'; const MODULE_NAME = 'RUNTIME_STATE_MONGO_REPOSITORY'; const COLLECTION_NAME = 'runtime-state'; diff --git a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts b/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts index 5c48e7fdd..de64a44e6 100644 --- a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts +++ b/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts @@ -8,7 +8,7 @@ import { import { MockData } from '../../../../../../common/src/cams/test-utilities/mock-data'; import { CamsJwtClaims } from '../../../../../../common/src/cams/jwt'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; -import { closeDeferred } from '../../../defer-close'; +import { closeDeferred } from '../../../deferrable/defer-close'; import QueryBuilder from '../../../query/query-builder'; import { NotFoundError } from '../../../common-errors/not-found-error'; diff --git a/backend/functions/lib/adapters/types/basic.d.ts b/backend/functions/lib/adapters/types/basic.d.ts index 877f52ed8..189afebbc 100644 --- a/backend/functions/lib/adapters/types/basic.d.ts +++ b/backend/functions/lib/adapters/types/basic.d.ts @@ -2,7 +2,8 @@ import { ApplicationConfiguration } from '../../configs/application-configuratio import { CamsError } from '../../common-errors/cams-error'; import { CamsSession } from '../../../../../common/src/cams/session'; import { CamsHttpRequest } from './http'; -import { Closable } from '../../defer-close'; +import { Closable } from '../../deferrable/defer-close'; +import { Releasable } from '../../use-cases/gateways.types'; export interface LoggerHelper { debug: (moduleName: string, message: string, data?: unknown) => void; @@ -20,6 +21,7 @@ export interface ApplicationContext { invocationId: string; request?: CamsHttpRequest; closables: Closable[]; + releasables: Releasable[]; } export interface ObjectKeyVal { diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index 19bc20e52..b20a183d2 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,4 +1,5 @@ import { ApplicationContext } from '../../adapters/types/basic'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; import AcmsOrders, { AcmsConsolidationReport, AcmsPredicate, @@ -11,21 +12,27 @@ class AcmsOrdersController { context: ApplicationContext, leadCaseId: string, ): Promise { - return this.useCase.migrateConsolidation(context, leadCaseId); + const response = this.useCase.migrateConsolidation(context, leadCaseId); + await finalizeDeferrable(context); + return response; } public async getPageCount( context: ApplicationContext, predicate: AcmsPredicate, ): Promise { - return this.useCase.getPageCount(context, predicate); + const response = this.useCase.getPageCount(context, predicate); + await finalizeDeferrable(context); + return response; } public async getLeadCaseIds( context: ApplicationContext, predicate: AcmsPredicateAndPage, ): Promise { - return this.useCase.getLeadCaseIds(context, predicate); + const response = this.useCase.getLeadCaseIds(context, predicate); + await finalizeDeferrable(context); + return response; } } diff --git a/backend/functions/lib/controllers/attorneys/attorneys.controller.ts b/backend/functions/lib/controllers/attorneys/attorneys.controller.ts index 0083efa35..0848b5505 100644 --- a/backend/functions/lib/controllers/attorneys/attorneys.controller.ts +++ b/backend/functions/lib/controllers/attorneys/attorneys.controller.ts @@ -4,7 +4,7 @@ import { AttorneyUser } from '../../../../../common/src/cams/users'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'ATTORNEYS-CONTROLLER'; @@ -26,7 +26,7 @@ export class AttorneysController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts b/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts index bd086063c..e6786eb85 100644 --- a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts +++ b/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts @@ -8,7 +8,7 @@ import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-res import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; import { CamsController } from '../controller'; import { getCamsError } from '../../common-errors/error-utilities'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'ASSIGNMENT-CONTROLLER'; const INVALID_ROLE_MESSAGE = @@ -56,7 +56,7 @@ export class CaseAssignmentController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts index 3ab5262ee..19ac49399 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts +++ b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts @@ -4,7 +4,7 @@ import { UnknownError } from '../../common-errors/unknown-error'; import { EventCaseReference } from '../../../../../common/src/cams/events'; import { CaseAssociatedUseCase } from '../../use-cases/case-associated/case-associated'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'CASE-ASSOCIATED-CONTROLLER'; @@ -28,7 +28,7 @@ export class CaseAssociatedController { ? originalError : new UnknownError(MODULE_NAME, { originalError }); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/case-docket/case-docket.controller.ts b/backend/functions/lib/controllers/case-docket/case-docket.controller.ts index ce9a40f17..68bd9f1ab 100644 --- a/backend/functions/lib/controllers/case-docket/case-docket.controller.ts +++ b/backend/functions/lib/controllers/case-docket/case-docket.controller.ts @@ -6,7 +6,7 @@ import { UnknownError } from '../../common-errors/unknown-error'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { CaseDocket } from '../../../../../common/src/cams/cases'; import { CamsController } from '../controller'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'CASE-DOCKET-CONTROLLER'; @@ -34,7 +34,7 @@ export class CaseDocketController implements CamsController { ? originalError : new UnknownError(MODULE_NAME, { originalError }); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/case-history/case-history.controller.ts b/backend/functions/lib/controllers/case-history/case-history.controller.ts index 715342c38..dcef99465 100644 --- a/backend/functions/lib/controllers/case-history/case-history.controller.ts +++ b/backend/functions/lib/controllers/case-history/case-history.controller.ts @@ -4,7 +4,7 @@ import { CaseHistory } from '../../../../../common/src/cams/history'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'CASE-HISTORY-CONTROLLER'; @@ -31,7 +31,7 @@ export class CaseHistoryController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/case-summary/case-summary.controller.ts b/backend/functions/lib/controllers/case-summary/case-summary.controller.ts index 48b0542db..6aaa42e26 100644 --- a/backend/functions/lib/controllers/case-summary/case-summary.controller.ts +++ b/backend/functions/lib/controllers/case-summary/case-summary.controller.ts @@ -4,7 +4,7 @@ import CaseManagement from '../../use-cases/case-management'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'CASE-SUMMARY-CONTROLLER'; @@ -34,7 +34,7 @@ export class CaseSummaryController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/cases/cases.controller.ts b/backend/functions/lib/controllers/cases/cases.controller.ts index 57ea5dd72..0fc46b73b 100644 --- a/backend/functions/lib/controllers/cases/cases.controller.ts +++ b/backend/functions/lib/controllers/cases/cases.controller.ts @@ -8,8 +8,8 @@ import { Pagination } from '../../../../../common/src/api/pagination'; import { httpSuccess } from '../../adapters/utils/http-response'; import { ResourceActions } from '../../../../../common/src/cams/actions'; import { CamsController } from '../controller'; -import { closeDeferred } from '../../defer-close'; import { getCamsError } from '../../common-errors/error-utilities'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'CASES-CONTROLLER'; @@ -42,7 +42,7 @@ export class CasesController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } diff --git a/backend/functions/lib/controllers/courts/courts.controller.ts b/backend/functions/lib/controllers/courts/courts.controller.ts index ee4a610f7..98bee2796 100644 --- a/backend/functions/lib/controllers/courts/courts.controller.ts +++ b/backend/functions/lib/controllers/courts/courts.controller.ts @@ -4,7 +4,7 @@ import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; import { CourtsUseCase } from '../../use-cases/courts/courts'; import { CourtDivisionDetails } from '../../../../../common/src/cams/courts'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'COURTS-CONTROLLER'; @@ -31,7 +31,7 @@ export class CourtsController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/me/me.controller.ts b/backend/functions/lib/controllers/me/me.controller.ts index dff3b326c..f03976155 100644 --- a/backend/functions/lib/controllers/me/me.controller.ts +++ b/backend/functions/lib/controllers/me/me.controller.ts @@ -2,7 +2,7 @@ import { CamsSession } from '../../../../../common/src/cams/session'; import { ApplicationContext } from '../../adapters/types/basic'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; import { CamsController } from '../controller'; const MODULE_NAME = 'ME-CONTROLLER'; @@ -21,7 +21,7 @@ export class MeController implements CamsController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/offices/offices.controller.ts b/backend/functions/lib/controllers/offices/offices.controller.ts index 1bceca3c7..b151ea0c2 100644 --- a/backend/functions/lib/controllers/offices/offices.controller.ts +++ b/backend/functions/lib/controllers/offices/offices.controller.ts @@ -6,7 +6,7 @@ import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController, CamsTimerController } from '../controller'; import { CamsUserReference } from '../../../../../common/src/cams/users'; import { BadRequestError } from '../../common-errors/bad-request'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'OFFICES-CONTROLLER'; @@ -23,7 +23,7 @@ export class OfficesController implements CamsController, CamsTimerController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } @@ -53,7 +53,7 @@ export class OfficesController implements CamsController, CamsTimerController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } } diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/functions/lib/controllers/orders/orders.controller.ts index cf8d08c9f..e2a933919 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/functions/lib/controllers/orders/orders.controller.ts @@ -16,7 +16,7 @@ import { getCamsError } from '../../common-errors/error-utilities'; import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; -import { closeDeferred } from '../../defer-close'; +import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'ORDERS-CONTROLLER'; @@ -39,7 +39,7 @@ export class OrdersController implements CamsController, CamsTimerController { } catch (originalError) { throw getCamsError(originalError, MODULE_NAME); } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } @@ -63,7 +63,7 @@ export class OrdersController implements CamsController, CamsTimerController { }); } } finally { - await closeDeferred(context); + await finalizeDeferrable(context); } } diff --git a/backend/functions/lib/defer-close.test.ts b/backend/functions/lib/deferrable/defer-close.test.ts similarity index 100% rename from backend/functions/lib/defer-close.test.ts rename to backend/functions/lib/deferrable/defer-close.test.ts diff --git a/backend/functions/lib/defer-close.ts b/backend/functions/lib/deferrable/defer-close.ts similarity index 100% rename from backend/functions/lib/defer-close.ts rename to backend/functions/lib/deferrable/defer-close.ts diff --git a/backend/functions/lib/deferrable/defer-release.test.ts b/backend/functions/lib/deferrable/defer-release.test.ts new file mode 100644 index 000000000..21b5ce4af --- /dev/null +++ b/backend/functions/lib/deferrable/defer-release.test.ts @@ -0,0 +1,48 @@ +import { Closable, closeDeferred, deferClose, DeferCloseAccumulator } from './defer-close'; + +describe('Defer Release', () => { + test('should add a releasable object to an accumulator', async () => { + const closable: Closable = { + close: async () => {}, + }; + const accumulator: DeferCloseAccumulator = { + closables: [], + }; + const success = deferClose(accumulator, closable); + + expect(success).toBeTruthy(); + expect(accumulator.closables.length).toEqual(1); + }); + + test('should call close on deferred closables', async () => { + const close = jest.fn(); + const closable: Closable = { + close, + }; + const accumulator: DeferCloseAccumulator = { + closables: [closable], + }; + + const success = closeDeferred(accumulator); + + expect(success).toBeTruthy(); + expect(accumulator.closables.length).toEqual(1); + expect(close).toHaveBeenCalledTimes(1); + }); + + test('should silently handle close errors', async () => { + const close = jest.fn().mockRejectedValue(new Error('some error')); + const closable: Closable = { + close, + }; + const accumulator: DeferCloseAccumulator = { + closables: [closable], + }; + + const success = await closeDeferred(accumulator); + + expect(success).toBeFalsy(); + expect(accumulator.closables.length).toEqual(1); + expect(close).toHaveBeenCalledTimes(1); + }); +}); diff --git a/backend/functions/lib/deferrable/defer-release.ts b/backend/functions/lib/deferrable/defer-release.ts new file mode 100644 index 000000000..e9c9d92fb --- /dev/null +++ b/backend/functions/lib/deferrable/defer-release.ts @@ -0,0 +1,37 @@ +import { Releasable } from '../use-cases/gateways.types'; + +export interface DeferReleaseAccumulator { + releasables: Releasable[]; +} + +function isReleasable(obj: unknown): obj is Releasable { + return typeof obj === 'object' && 'release' in obj; +} + +function isDeferReleaseAccumulator(obj: unknown): obj is DeferReleaseAccumulator { + return typeof obj === 'object' && 'releasables' in obj; +} + +export function deferRelease(accumulator: unknown, releasable: unknown): boolean { + if (isDeferReleaseAccumulator(accumulator)) { + if (isReleasable(releasable)) { + const priorLength = accumulator.releasables.length; + return accumulator.releasables.push(releasable) > priorLength; + } + } +} + +export async function releaseDeferred(accumulator: unknown): Promise { + if (isDeferReleaseAccumulator(accumulator)) { + let success = true; + for (const releasable of accumulator.releasables) { + try { + await releasable.release(); + } catch { + success = false; + } + } + return success; + } + return false; +} diff --git a/backend/functions/lib/deferrable/finalize-deferrable.test.ts b/backend/functions/lib/deferrable/finalize-deferrable.test.ts new file mode 100644 index 000000000..743fbda9b --- /dev/null +++ b/backend/functions/lib/deferrable/finalize-deferrable.test.ts @@ -0,0 +1,26 @@ +import { DeferCloseAccumulator } from './defer-close'; +import { DeferReleaseAccumulator } from './defer-release'; +import { finalizeDeferrable } from './finalize-deferrable'; +import * as DeferCloseModule from './defer-close'; +import * as DeferReleaseModule from './defer-release'; + +describe('Finalize deferrable', () => { + test('should call closeDeferred and releaseDeferred', async () => { + const closeDeferred = jest + .spyOn(DeferCloseModule, 'closeDeferred') + .mockResolvedValue(undefined); + const releaseDeferred = jest + .spyOn(DeferReleaseModule, 'releaseDeferred') + .mockResolvedValue(undefined); + + interface JoinedAccumulator extends DeferCloseAccumulator, DeferReleaseAccumulator {} + const accumulator: JoinedAccumulator = { + closables: [], + releasables: [], + }; + await finalizeDeferrable(accumulator); + + expect(closeDeferred).toHaveBeenLastCalledWith(accumulator); + expect(releaseDeferred).toHaveBeenLastCalledWith(accumulator); + }); +}); diff --git a/backend/functions/lib/deferrable/finalize-deferrable.ts b/backend/functions/lib/deferrable/finalize-deferrable.ts new file mode 100644 index 000000000..1e3a9c826 --- /dev/null +++ b/backend/functions/lib/deferrable/finalize-deferrable.ts @@ -0,0 +1,9 @@ +import { closeDeferred, DeferCloseAccumulator } from './defer-close'; +import { DeferReleaseAccumulator, releaseDeferred } from './defer-release'; + +export async function finalizeDeferrable( + accumulator: DeferCloseAccumulator | DeferReleaseAccumulator, +) { + await closeDeferred(accumulator); + await releaseDeferred(accumulator); +} diff --git a/backend/functions/lib/factory.ts b/backend/functions/lib/factory.ts index d10ab2f83..fb841bc20 100644 --- a/backend/functions/lib/factory.ts +++ b/backend/functions/lib/factory.ts @@ -46,6 +46,7 @@ import { RuntimeStateMongoRepository } from './adapters/gateways/mongo/runtime-s import { UserSessionCacheMongoRepository } from './adapters/gateways/mongo/user-session-cache.mongo.repository'; import { MockOfficesRepository } from './testing/mock-gateways/mock.offices.repository'; import { AcmsGatewayImpl } from './adapters/gateways/acms/acms.gateway'; +import { deferRelease } from './deferrable/defer-release'; let casesGateway: CasesInterface; let ordersGateway: OrdersGateway; @@ -64,9 +65,9 @@ export const getAttorneyGateway = (): AttorneyGatewayInterface => { return MockAttorneysGateway; }; -export const getCasesGateway = (applicationContext: ApplicationContext): CasesInterface => { +export const getCasesGateway = (context: ApplicationContext): CasesInterface => { if (!casesGateway) { - if (applicationContext.config.get('dbMock')) { + if (context.config.get('dbMock')) { casesGateway = new CasesLocalGateway(); } else { casesGateway = new CasesDxtrGateway(); @@ -75,11 +76,11 @@ export const getCasesGateway = (applicationContext: ApplicationContext): CasesIn return casesGateway; }; -export const getAssignmentRepository = ( - applicationContext: ApplicationContext, -): CaseAssignmentRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return CaseAssignmentMongoRepository.getInstance(applicationContext); +export const getAssignmentRepository = (context: ApplicationContext): CaseAssignmentRepository => { + if (context.config.get('dbMock')) return new MockMongoRepository(); + const repo = CaseAssignmentMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; }; export const getCaseDocketUseCase = (context: ApplicationContext): CaseDocketUseCase => { @@ -95,9 +96,9 @@ export const getSqlConnection = (databaseConfig: IDbConfig) => { return new ConnectionPool(databaseConfig as config); }; -export const getOrdersGateway = (applicationContext: ApplicationContext): OrdersGateway => { +export const getOrdersGateway = (context: ApplicationContext): OrdersGateway => { if (!ordersGateway) { - if (applicationContext.config.get('dbMock')) { + if (context.config.get('dbMock')) { ordersGateway = new MockOrdersGateway(); } else { ordersGateway = new DxtrOrdersGateway(); @@ -106,61 +107,69 @@ export const getOrdersGateway = (applicationContext: ApplicationContext): Orders return ordersGateway; }; -export const getOfficesGateway = (applicationContext: ApplicationContext): OfficesGateway => { - if (applicationContext.config.get('dbMock')) { +export const getOfficesGateway = (context: ApplicationContext): OfficesGateway => { + if (context.config.get('dbMock')) { return new MockOfficesGateway(); } else { return new OfficesDxtrGateway(); } }; -export const getOfficesRepository = (applicationContext: ApplicationContext): OfficesRepository => { - if (applicationContext.config.authConfig.provider === 'mock') { +export const getOfficesRepository = (context: ApplicationContext): OfficesRepository => { + if (context.config.authConfig.provider === 'mock') { return MockOfficesRepository; } - return OfficesMongoRepository.getInstance(applicationContext); + const repo = OfficesMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; }; // transfer orders -export const getOrdersRepository = (applicationContext: ApplicationContext): OrdersRepository => { - if (applicationContext.config.get('dbMock')) { +export const getOrdersRepository = (context: ApplicationContext): OrdersRepository => { + if (context.config.get('dbMock')) { if (!mockOrdersRepository) { - mockOrdersRepository = MockMongoRepository.getInstance(applicationContext); + mockOrdersRepository = MockMongoRepository.getInstance(context); } return mockOrdersRepository; } else { - return OrdersMongoRepository.getInstance(applicationContext); + const repo = OrdersMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; } }; export const getConsolidationOrdersRepository = ( - applicationContext: ApplicationContext, + context: ApplicationContext, ): ConsolidationOrdersRepository => { - if (applicationContext.config.get('dbMock')) { + if (context.config.get('dbMock')) { if (!mockConsolidationsRepository) { - mockConsolidationsRepository = MockMongoRepository.getInstance(applicationContext); + mockConsolidationsRepository = MockMongoRepository.getInstance(context); } return mockConsolidationsRepository; } else { - return ConsolidationOrdersMongoRepository.getInstance(applicationContext); + const repo = ConsolidationOrdersMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; } }; -export const getCasesRepository = (applicationContext: ApplicationContext): CasesRepository => { - if (applicationContext.config.get('dbMock')) { +export const getCasesRepository = (context: ApplicationContext): CasesRepository => { + if (context.config.get('dbMock')) { if (!mockCasesRepository) { - mockCasesRepository = MockMongoRepository.getInstance(applicationContext); + mockCasesRepository = MockMongoRepository.getInstance(context); } return mockCasesRepository; } - return CasesMongoRepository.getInstance(applicationContext); + const repo = CasesMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; }; export const getRuntimeStateRepository = ( - applicationContext: ApplicationContext, + context: ApplicationContext, ): RuntimeStateRepository => { - if (applicationContext.config.get('dbMock')) return new MockMongoRepository(); - return new RuntimeStateMongoRepository(applicationContext); + if (context.config.get('dbMock')) return new MockMongoRepository(); + return new RuntimeStateMongoRepository(context); }; export const getOrderSyncStateRepo = ( @@ -203,7 +212,9 @@ export const getUserSessionCacheRepository = ( } return mockUserSessionCacheRepository; } - return UserSessionCacheMongoRepository.getInstance(context); + const repo = UserSessionCacheMongoRepository.getInstance(context); + deferRelease(repo, context); + return repo; }; export const getStorageGateway = (_context: ApplicationContext): StorageGateway => { @@ -217,9 +228,9 @@ export const getUserGroupGateway = (_context: ApplicationContext): UserGroupGate return OktaUserGroupGateway; }; -const getAcmsGateway = (applicationContext: ApplicationContext): AcmsGateway => { +const getAcmsGateway = (context: ApplicationContext): AcmsGateway => { if (!acmsGateway) { - acmsGateway = new AcmsGatewayImpl(applicationContext); + acmsGateway = new AcmsGatewayImpl(context); } return acmsGateway; }; diff --git a/backend/functions/lib/humble-objects/mongo-humble.ts b/backend/functions/lib/humble-objects/mongo-humble.ts index 93ec5e1b1..b36074f19 100644 --- a/backend/functions/lib/humble-objects/mongo-humble.ts +++ b/backend/functions/lib/humble-objects/mongo-humble.ts @@ -1,5 +1,5 @@ import { Collection, Db, MongoClient } from 'mongodb'; -import { Closable } from '../defer-close'; +import { Closable } from '../deferrable/defer-close'; export class CollectionHumble { private collection: Collection; diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 4d950320f..bf1d8ce1d 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -180,8 +180,6 @@ export class AcmsOrders { await casesRepo.createCaseHistory(leadCaseHistory); leadCaseHistoryBefore = leadCaseHistoryAfter; } - - casesRepo.release(); } catch (error) { report.success = false; const camsError = getCamsError( diff --git a/backend/functions/lib/use-cases/case-assignment.ts b/backend/functions/lib/use-cases/case-assignment.ts index ed5e0b88f..69668639b 100644 --- a/backend/functions/lib/use-cases/case-assignment.ts +++ b/backend/functions/lib/use-cases/case-assignment.ts @@ -56,8 +56,6 @@ export class CaseAssignmentUseCase { for (const childCaseId of childCaseIds) { await this.assignTrialAttorneys(context, childCaseId, newAssignments, role); } - - casesRepo.release(); } private async assignTrialAttorneys( @@ -137,9 +135,6 @@ export class CaseAssignmentUseCase { `Updated assignments for case number ${caseId}.`, listOfAssignmentIdsCreated, ); - - casesRepo.release(); - return listOfAssignmentIdsCreated; } diff --git a/backend/functions/lib/use-cases/case-associated/case-associated.ts b/backend/functions/lib/use-cases/case-associated/case-associated.ts index e4234a818..8393ec1d8 100644 --- a/backend/functions/lib/use-cases/case-associated/case-associated.ts +++ b/backend/functions/lib/use-cases/case-associated/case-associated.ts @@ -32,9 +32,6 @@ export class CaseAssociatedUseCase { childCaseRefs = await casesRepo.getConsolidation(leadCaseId); } leadCaseRef.orderDate = getEarliestDate(childCaseRefs); - - casesRepo.release(); - return [leadCaseRef, ...childCaseRefs]; } } diff --git a/backend/functions/lib/use-cases/case-history/case-history.ts b/backend/functions/lib/use-cases/case-history/case-history.ts index 04ade0bc0..db878dd26 100644 --- a/backend/functions/lib/use-cases/case-history/case-history.ts +++ b/backend/functions/lib/use-cases/case-history/case-history.ts @@ -7,7 +7,6 @@ export class CaseHistoryUseCase { const caseId = context.request.params.id; const casesRepo = Factory.getCasesRepository(context); const caseHistory = casesRepo.getCaseHistory(caseId); - casesRepo.release(); return caseHistory; } } diff --git a/backend/functions/lib/use-cases/offices/offices.ts b/backend/functions/lib/use-cases/offices/offices.ts index de5181b01..b2983f9b4 100644 --- a/backend/functions/lib/use-cases/offices/offices.ts +++ b/backend/functions/lib/use-cases/offices/offices.ts @@ -44,7 +44,6 @@ export class OfficesUseCase { if (context.featureFlags['restrict-case-assignment']) { const repository = getOfficesRepository(context); attorneys = await repository.getOfficeAttorneys(officeCode); - repository.release(); } else { const attorneysUseCase = new AttorneysList(); attorneys = await attorneysUseCase.getAttorneyList(context); @@ -120,9 +119,6 @@ export class OfficesUseCase { const runtimeStateRepo = getOfficeStaffSyncStateRepo(context); await runtimeStateRepo.upsert(result); - - repository.release(); - return result; } } diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/functions/lib/use-cases/orders/orders.ts index 129dcfaa8..20b51a78a 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/functions/lib/use-cases/orders/orders.ts @@ -75,9 +75,6 @@ export class OrdersUseCase { const transferOrders = await ordersRepo.search(predicate); const consolidationOrders = await consolidationsRepo.search(predicate); - ordersRepo.release(); - consolidationsRepo.release(); - return transferOrders .concat(consolidationOrders) .sort((a, b) => sortDates(a.orderDate, b.orderDate)); @@ -151,9 +148,6 @@ export class OrdersUseCase { ); await casesRepo.createCaseHistory(caseHistory); } - - ordersRepo.release(); - casesRepo.release(); } public async syncOrders( @@ -253,10 +247,6 @@ export class OrdersUseCase { const finalSyncState = { ...initialSyncState, txId: maxTxId }; await runtimeStateRepo.upsert(finalSyncState); context.logger.info(MODULE_NAME, 'Updated runtime state in repo (Cosmos)', finalSyncState); - //TODO: Will need runtime state repo release once implemented - casesRepo.release(); - ordersRepo.release(); - consolidationsRepo.release(); return { options, @@ -311,8 +301,6 @@ export class OrdersUseCase { .filter((h) => h.documentType === 'AUDIT_CONSOLIDATION') .sort((a, b) => sortDatesReverse(a.updatedOn, b.updatedOn)) .shift()?.after; - - casesRepo.release(); } catch { before = undefined; } @@ -468,8 +456,6 @@ export class OrdersUseCase { await casesRepo.createCaseHistory(leadCaseHistory); } - consolidationsRepo.release(); - return response; } diff --git a/backend/functions/lib/use-cases/user-session/user-session.ts b/backend/functions/lib/use-cases/user-session/user-session.ts index f5aa66800..04fd1ff9d 100644 --- a/backend/functions/lib/use-cases/user-session/user-session.ts +++ b/backend/functions/lib/use-cases/user-session/user-session.ts @@ -68,9 +68,6 @@ export class UserSessionUseCase { }; await sessionCacheRepository.upsert(session); - - sessionCacheRepository.release(); - return session; } catch (error) { throw isCamsError(error) From 9eef956a2656e31f2aa53be49b41f196f22326c9 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:34:49 -0500 Subject: [PATCH 045/112] Fix release deferred tests Jira ticket: CAMS-461 --- .../lib/deferrable/defer-close.test.ts | 4 ++ .../lib/deferrable/defer-release.test.ts | 55 ++++++++++--------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/backend/functions/lib/deferrable/defer-close.test.ts b/backend/functions/lib/deferrable/defer-close.test.ts index a5dc84a1a..b9946abe1 100644 --- a/backend/functions/lib/deferrable/defer-close.test.ts +++ b/backend/functions/lib/deferrable/defer-close.test.ts @@ -30,6 +30,10 @@ describe('Defer Close', () => { expect(close).toHaveBeenCalledTimes(1); }); + test('should not fail if a proper accumulator is not passed', async () => { + expect(closeDeferred({})).resolves.toBeFalsy(); + }); + test('should silently handle close errors', async () => { const close = jest.fn().mockRejectedValue(new Error('some error')); const closable: Closable = { diff --git a/backend/functions/lib/deferrable/defer-release.test.ts b/backend/functions/lib/deferrable/defer-release.test.ts index 21b5ce4af..62ae84b39 100644 --- a/backend/functions/lib/deferrable/defer-release.test.ts +++ b/backend/functions/lib/deferrable/defer-release.test.ts @@ -1,48 +1,53 @@ -import { Closable, closeDeferred, deferClose, DeferCloseAccumulator } from './defer-close'; +import { Releasable } from '../use-cases/gateways.types'; +import { deferRelease, DeferReleaseAccumulator, releaseDeferred } from './defer-release'; describe('Defer Release', () => { test('should add a releasable object to an accumulator', async () => { - const closable: Closable = { - close: async () => {}, + const closable: Releasable = { + release: async () => {}, }; - const accumulator: DeferCloseAccumulator = { - closables: [], + const accumulator: DeferReleaseAccumulator = { + releasables: [], }; - const success = deferClose(accumulator, closable); + const success = deferRelease(accumulator, closable); expect(success).toBeTruthy(); - expect(accumulator.closables.length).toEqual(1); + expect(accumulator.releasables.length).toEqual(1); }); - test('should call close on deferred closables', async () => { - const close = jest.fn(); - const closable: Closable = { - close, + test('should call release on deferred releasables', async () => { + const release = jest.fn(); + const releasable: Releasable = { + release, }; - const accumulator: DeferCloseAccumulator = { - closables: [closable], + const accumulator: DeferReleaseAccumulator = { + releasables: [releasable], }; - const success = closeDeferred(accumulator); + const success = releaseDeferred(accumulator); expect(success).toBeTruthy(); - expect(accumulator.closables.length).toEqual(1); - expect(close).toHaveBeenCalledTimes(1); + expect(accumulator.releasables.length).toEqual(1); + expect(release).toHaveBeenCalledTimes(1); }); - test('should silently handle close errors', async () => { - const close = jest.fn().mockRejectedValue(new Error('some error')); - const closable: Closable = { - close, + test('should not fail if a proper accumulator is not passed', async () => { + expect(releaseDeferred({})).resolves.toBeFalsy(); + }); + + test('should silently handle release errors', async () => { + const release = jest.fn().mockRejectedValue(new Error('some error')); + const releasable: Releasable = { + release, }; - const accumulator: DeferCloseAccumulator = { - closables: [closable], + const accumulator: DeferReleaseAccumulator = { + releasables: [releasable], }; - const success = await closeDeferred(accumulator); + const success = await releaseDeferred(accumulator); expect(success).toBeFalsy(); - expect(accumulator.closables.length).toEqual(1); - expect(close).toHaveBeenCalledTimes(1); + expect(accumulator.releasables.length).toEqual(1); + expect(release).toHaveBeenCalledTimes(1); }); }); From ef6254a8a889a976d18a492162c3d31f34f1937b Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:19:22 -0600 Subject: [PATCH 046/112] WIP - Troubleshooting errors Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../lib/adapters/gateways/acms/acms.gateway.ts | 16 +++++++++++----- .../lib/configs/application-configuration.ts | 16 ++++++++-------- .../orchestration/sub-orchestrator-paging.ts | 2 +- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index cfda328d1..a1c6e5ea5 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -26,7 +26,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway const input: DbTableFieldSpec[] = []; let query = ` SELECT COUNT(DISTINCT CONSOLIDATED_CASE_NUMBER) AS leadCaseCount - FROM CMMDB + FROM [dbo].[CMMDB] WHERE CASE_DIV = @divisionCode AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' AND CONSOLIDATED_CASE_NUMBER != '0'`; @@ -59,6 +59,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway try { const results = await this.executeQuery(context, query, input); + // TODO: handle falsy result const result = results.results[0]; return result.leadCaseCount ? Math.ceil(result.leadCaseCount / PAGE_SIZE) : 0; } catch (originalError) { @@ -92,7 +93,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway let query = ` SELECT DISTINCT CONSOLIDATED_CASE_NUMBER AS leadCaseId - FROM CMMDB + FROM [dbo].[CMMDB] WHERE CASE_DIV = @divisionCode AND CLOSED_BY_COURT_DATE = '0' OR CLOSED_BY_COURT_DATE > '20170101' AND CONSOLIDATED_CASE_NUMBER != '0'`; @@ -135,7 +136,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway const input: DbTableFieldSpec[] = []; input.push({ name: `leadCaseId`, - type: mssql.Int, + type: mssql.BigInt, value: leadCaseId, }); @@ -149,8 +150,8 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway RIGHT('00000' + CAST(CASE_NUMBER AS VARCHAR), 5) ) AS caseId, CONSOLIDATION_DATE as consolidationDate, - CONSOLIDATION_TYPE as consolidationType, - FROM CMMDB + CONSOLIDATION_TYPE as consolidationType + FROM [dbo].[CMMDB] WHERE CONSOLIDATED_CASE_NUMBER = @leadCaseId`; try { @@ -169,6 +170,11 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway childCases, }; } catch (originalError) { + context.logger.error( + MODULE_NAME, + `Failed to get case info for lead case id: ${leadCaseId}.`, + originalError, + ); throw getCamsError(originalError, MODULE_NAME); } } diff --git a/backend/functions/lib/configs/application-configuration.ts b/backend/functions/lib/configs/application-configuration.ts index dfa0009f2..031621a7b 100644 --- a/backend/functions/lib/configs/application-configuration.ts +++ b/backend/functions/lib/configs/application-configuration.ts @@ -21,7 +21,7 @@ export class ApplicationConfiguration { this.dbMock = process.env.DATABASE_MOCK?.toLowerCase() === 'true'; this.server = this.getAppServerConfig(); this.dxtrDbConfig = this.getDxtrDbConfig(process.env.MSSQL_DATABASE_DXTR); - this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_MSSQL_DATABASE); + this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_DATABASE); this.documentDbConfig = this.getDocumentDbConfig(); this.featureFlagKey = process.env.FEATURE_FLAG_SDK_KEY; this.authConfig = getAuthorizationConfig(); @@ -84,15 +84,15 @@ export class ApplicationConfiguration { // TODO: This and getDxtrDbConfig are gross. Refactor when we feel we really want to clean this up. private getAcmsDbConfig(database: string): IDbConfig { - const server = process.env.ACMS_MSSQL_HOST; + const server = process.env.ACMS_HOST; const port: number = Number(process.env.ACMS_PORT) || 1433; - const encrypt: boolean = Boolean(process.env.ACMS_MSSQL_ENCRYPT); - const trustServerCertificate: boolean = Boolean(process.env.ACMS_MSSQL_TRUST_UNSIGNED_CERT); + const encrypt: boolean = Boolean(process.env.ACMS_ENCRYPT); + const trustServerCertificate: boolean = Boolean(process.env.ACMS_TRUST_UNSIGNED_CERT); const authType = process.env.ACMS_AUTH_TYPE || 'azure-active-directory-default'; - const user = process.env.ACMS_MSSQL_USER; - const password = process.env.ACMS_MSSQL_PASS; - const identityClientId = process.env.ACMS_MSSQL_CLIENT_ID; - const requestTimeout = parseInt(process.env.ACMS_MSSQL_REQUEST_TIMEOUT ?? '15000'); + const user = process.env.ACMS_USER; + const password = process.env.ACMS_PASS; + const identityClientId = process.env.ACMS_CLIENT_ID; + const requestTimeout = parseInt(process.env.ACMS_REQUEST_TIMEOUT ?? '15000'); const config: IDbConfig = { server, diff --git a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts index 62c2141fa..c0d177f4d 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts @@ -7,7 +7,7 @@ export function* subOrchestratorPaging(context: OrchestrationContext) { const pageCount: number = yield context.df.callActivity(GET_PAGE_COUNT, predicate); const provisioningTasks = []; - for (let pageNumber = 0; pageNumber < pageCount; pageNumber++) { + for (let pageNumber = 1; pageNumber <= pageCount; pageNumber++) { const predicateAndPage: AcmsPredicateAndPage = { ...predicate, pageNumber, From 763bfa850f70db01576876e7ea4e7b62675848d0 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Wed, 4 Dec 2024 09:44:25 -0500 Subject: [PATCH 047/112] updated some tests and addressed comments Jira ticket: CAMS-461 --- .../functions/case-associated/case-associated.function.ts | 2 +- .../gateways/abstract-mssql-client.exception.test.ts | 4 ++++ .../functions/lib/adapters/utils/database.exception.test.ts | 2 +- .../case-associated/case-associated.controller.test.ts | 6 +++--- .../case-associated/case-associated.controller.ts | 2 +- .../functions/lib/use-cases/acms-orders/acms-orders.test.ts | 2 +- backend/functions/lib/use-cases/offices/offices.test.ts | 1 - 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/functions/case-associated/case-associated.function.ts b/backend/functions/case-associated/case-associated.function.ts index 72c454899..ded7a8332 100644 --- a/backend/functions/case-associated/case-associated.function.ts +++ b/backend/functions/case-associated/case-associated.function.ts @@ -22,7 +22,7 @@ export default async function handler( logger, request, ); - const controller = new CaseAssociatedController(applicationContext); + const controller = new CaseAssociatedController(); const response = await controller.handleRequest(applicationContext); diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts index 7b9676897..57131c2e0 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -77,6 +77,7 @@ describe('Tests database client exceptions', () => { expect(mockRequest).toThrow(expectedErrorMessage); expect(queryResult.success).toBeFalsy(); + expect(queryResult.message).toEqual(expectedErrorMessage); }); test('should handle known mssql MSSQLError exceptions', async () => { @@ -103,6 +104,7 @@ describe('Tests database client exceptions', () => { expect(mockRequest).toThrow(expectedErrorMessage); expect(queryResult.success).toBeFalsy(); + expect(queryResult.message).toEqual(expectedErrorMessage); }); test('should handle known mssql ConnectionError exceptions', async () => { @@ -120,6 +122,7 @@ describe('Tests database client exceptions', () => { const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); expect(mockConnect).toThrow(expectedErrorMessage); expect(queryResult.success).toBeFalsy(); + expect(queryResult.message).toEqual(expectedErrorMessage); }); test('should handle known mssql ConnectionError exceptions with AggregateErrors', async () => { @@ -165,6 +168,7 @@ describe('Tests database client exceptions', () => { expect(mockConnect).toThrow(expectedErrorMessage); expect(queryResult.success).toBeFalsy(); + expect(queryResult.message).toEqual(expectedErrorMessage); }); test('should close connection pool when calling close', async () => { diff --git a/backend/functions/lib/adapters/utils/database.exception.test.ts b/backend/functions/lib/adapters/utils/database.exception.test.ts index 434904a6f..639be3d72 100644 --- a/backend/functions/lib/adapters/utils/database.exception.test.ts +++ b/backend/functions/lib/adapters/utils/database.exception.test.ts @@ -4,7 +4,7 @@ import { ConnectionError, MSSQLError, RequestError } from 'mssql'; import { createMockApplicationContext } from '../../testing/testing-utilities'; // Setting default Jest mocks for mssql -//NOTE: using const here causes these tests to error out with 'Cannot access {var} before initialization +//NOTE: using const here causes these tests to error out with 'Cannot access {const} before initialization // eslint-disable-next-line no-var var connectionError = new ConnectionError(''); // eslint-disable-next-line no-var diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts b/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts index e8c4b6a41..7aa89b780 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts +++ b/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts @@ -26,7 +26,7 @@ describe('Test case-history controller', () => { .mockResolvedValue(associatedCases); const caseId = NORMAL_CASE_ID; applicationContext.request.params.caseId = caseId; - const controller = new CaseAssociatedController(applicationContext); + const controller = new CaseAssociatedController(); const result = await controller.handleRequest(applicationContext); expect(result.body.data).toEqual(associatedCases); }); @@ -37,7 +37,7 @@ describe('Test case-history controller', () => { .mockRejectedValue(new NotFoundError('TEST')); const caseId = NOT_FOUND_ERROR_CASE_ID; applicationContext.request.params.caseId = caseId; - const controller = new CaseAssociatedController(applicationContext); + const controller = new CaseAssociatedController(); await expect(controller.handleRequest(applicationContext)).rejects.toThrow('Not found'); }); @@ -45,7 +45,7 @@ describe('Test case-history controller', () => { const expectedMessage = 'Unknown Error'; const caseId = THROW_UNKNOWN_ERROR_CASE_ID; applicationContext.request.params.caseId = caseId; - const controller = new CaseAssociatedController(applicationContext); + const controller = new CaseAssociatedController(); jest .spyOn(CaseAssociatedUseCase.prototype, 'getAssociatedCases') .mockImplementation(async () => { diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts index 19ac49399..b9f69784d 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts +++ b/backend/functions/lib/controllers/case-associated/case-associated.controller.ts @@ -11,7 +11,7 @@ const MODULE_NAME = 'CASE-ASSOCIATED-CONTROLLER'; export class CaseAssociatedController { private readonly useCase: CaseAssociatedUseCase; - constructor(_applicationContext: ApplicationContext) { + constructor() { this.useCase = new CaseAssociatedUseCase(); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts index e59b3021e..8de6861c8 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts @@ -174,7 +174,7 @@ describe('ACMS Orders', () => { }); }); - test('should histories for consolidations over a date range', async () => { + test('should get histories for consolidations over a date range', async () => { jest .spyOn(CasesMongoRepository.prototype, 'createConsolidationFrom') .mockResolvedValue(MockData.getConsolidationFrom()); diff --git a/backend/functions/lib/use-cases/offices/offices.test.ts b/backend/functions/lib/use-cases/offices/offices.test.ts index 3df12cdfd..494e3d35e 100644 --- a/backend/functions/lib/use-cases/offices/offices.test.ts +++ b/backend/functions/lib/use-cases/offices/offices.test.ts @@ -103,7 +103,6 @@ describe('offices use case tests', () => { expect(attorneysSpy).toHaveBeenCalledWith(localContext); }); - // TODO: this test is broken line 121 test('should return attorneys for office with feature flag on', async () => { const localContext = { ...applicationContext, From 96fc95bee5d7da74214c4dadf1b1cf71fa2d112d Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:06:13 -0600 Subject: [PATCH 048/112] WIP - Use a singleton connection pool Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/abstract-mssql-client.ts | 18 ++++++++--------- .../lib/configs/application-configuration.ts | 20 +++++++++---------- .../acms-orders/acms-orders.controller.ts | 8 ++++---- .../lib/deferrable/finalize-deferrable.ts | 3 +++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index 0623207ce..79ef0388f 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -1,16 +1,18 @@ import { config, ConnectionError, ConnectionPool, MSSQLError, IResult } from 'mssql'; import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; -import { Closable, deferClose } from '../../deferrable/defer-close'; +import { deferClose } from '../../deferrable/defer-close'; import { ApplicationContext } from '../types/basic'; -export abstract class AbstractMssqlClient implements Closable { - private connectionPool: ConnectionPool; +export abstract class AbstractMssqlClient { + private static connectionPool: ConnectionPool; private readonly moduleName: string; protected constructor(context: ApplicationContext, dbConfig: IDbConfig, childModuleName: string) { this.moduleName = `ABSTRACT-MSSQL-CLIENT (${childModuleName})`; - this.connectionPool = new ConnectionPool(dbConfig as config); - deferClose(context, this); + if (!AbstractMssqlClient.connectionPool) { + AbstractMssqlClient.connectionPool = new ConnectionPool(dbConfig as config); + deferClose(context, AbstractMssqlClient.connectionPool); + } } public async executeQuery( @@ -20,7 +22,7 @@ export abstract class AbstractMssqlClient implements Closable { ): Promise { // we should do some sanitization here to eliminate sql injection issues try { - const connection = await this.connectionPool.connect(); + const connection = await AbstractMssqlClient.connectionPool.connect(); const request = connection.request(); if (typeof input != 'undefined') { @@ -90,10 +92,6 @@ export abstract class AbstractMssqlClient implements Closable { return queryResult; } } - - public async close(): Promise { - await this.connectionPool.close(); - } } function isMssqlError(e): e is MSSQLError { diff --git a/backend/functions/lib/configs/application-configuration.ts b/backend/functions/lib/configs/application-configuration.ts index 031621a7b..6db306d11 100644 --- a/backend/functions/lib/configs/application-configuration.ts +++ b/backend/functions/lib/configs/application-configuration.ts @@ -21,7 +21,7 @@ export class ApplicationConfiguration { this.dbMock = process.env.DATABASE_MOCK?.toLowerCase() === 'true'; this.server = this.getAppServerConfig(); this.dxtrDbConfig = this.getDxtrDbConfig(process.env.MSSQL_DATABASE_DXTR); - this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_DATABASE); + this.acmsDbConfig = this.getAcmsDbConfig(process.env.ACMS_MSSQL_DATABASE); this.documentDbConfig = this.getDocumentDbConfig(); this.featureFlagKey = process.env.FEATURE_FLAG_SDK_KEY; this.authConfig = getAuthorizationConfig(); @@ -84,15 +84,15 @@ export class ApplicationConfiguration { // TODO: This and getDxtrDbConfig are gross. Refactor when we feel we really want to clean this up. private getAcmsDbConfig(database: string): IDbConfig { - const server = process.env.ACMS_HOST; - const port: number = Number(process.env.ACMS_PORT) || 1433; - const encrypt: boolean = Boolean(process.env.ACMS_ENCRYPT); - const trustServerCertificate: boolean = Boolean(process.env.ACMS_TRUST_UNSIGNED_CERT); - const authType = process.env.ACMS_AUTH_TYPE || 'azure-active-directory-default'; - const user = process.env.ACMS_USER; - const password = process.env.ACMS_PASS; - const identityClientId = process.env.ACMS_CLIENT_ID; - const requestTimeout = parseInt(process.env.ACMS_REQUEST_TIMEOUT ?? '15000'); + const server = process.env.ACMS_MSSQL_HOST; + const port: number = Number(process.env.ACMS_MSSQL_PORT) || 1433; + const encrypt: boolean = Boolean(process.env.ACMS_MSSQL_ENCRYPT); + const trustServerCertificate: boolean = Boolean(process.env.ACMS_MSSQL_TRUST_UNSIGNED_CERT); + const authType = process.env.ACMS_MSSQL_AUTH_TYPE || 'azure-active-directory-default'; + const user = process.env.ACMS_MSSQL_USER; + const password = process.env.ACMS_MSSQL_PASS; + const identityClientId = process.env.ACMS_MSSQL_CLIENT_ID; + const requestTimeout = parseInt(process.env.ACMS_MSSQL_REQUEST_TIMEOUT ?? '15000'); const config: IDbConfig = { server, diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index b20a183d2..c0abd6fae 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,5 +1,5 @@ import { ApplicationContext } from '../../adapters/types/basic'; -import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; +// import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; import AcmsOrders, { AcmsConsolidationReport, AcmsPredicate, @@ -13,7 +13,7 @@ class AcmsOrdersController { leadCaseId: string, ): Promise { const response = this.useCase.migrateConsolidation(context, leadCaseId); - await finalizeDeferrable(context); + // await finalizeDeferrable(context); return response; } @@ -22,7 +22,7 @@ class AcmsOrdersController { predicate: AcmsPredicate, ): Promise { const response = this.useCase.getPageCount(context, predicate); - await finalizeDeferrable(context); + // await finalizeDeferrable(context); return response; } @@ -31,7 +31,7 @@ class AcmsOrdersController { predicate: AcmsPredicateAndPage, ): Promise { const response = this.useCase.getLeadCaseIds(context, predicate); - await finalizeDeferrable(context); + // await finalizeDeferrable(context); return response; } } diff --git a/backend/functions/lib/deferrable/finalize-deferrable.ts b/backend/functions/lib/deferrable/finalize-deferrable.ts index 1e3a9c826..ac21a2197 100644 --- a/backend/functions/lib/deferrable/finalize-deferrable.ts +++ b/backend/functions/lib/deferrable/finalize-deferrable.ts @@ -1,9 +1,12 @@ import { closeDeferred, DeferCloseAccumulator } from './defer-close'; import { DeferReleaseAccumulator, releaseDeferred } from './defer-release'; +import { LoggerHelper } from '../adapters/types/basic'; export async function finalizeDeferrable( accumulator: DeferCloseAccumulator | DeferReleaseAccumulator, ) { + const logger = accumulator['logger'] as LoggerHelper; + logger.debug('FINALIZE_DEFERRABLE', '!!!!!!!!!!!!!!!Finalize deferrable!!!!!!!!!!!!!!!'); await closeDeferred(accumulator); await releaseDeferred(accumulator); } From e771af1efd07d86d34aaab286cc480ee579e1c27 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:48:01 -0600 Subject: [PATCH 049/112] wip --- .../healthcheck/healthcheck.db.cosmos.ts | 2 +- .../mongo/utils/base-mongo-repository.ts | 5 ++++- .../functions/lib/deferrable/defer-close.test.ts | 2 +- backend/functions/lib/deferrable/defer-close.ts | 16 ++++++++++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.ts b/backend/functions/healthcheck/healthcheck.db.cosmos.ts index 1ec6e5b06..3a6344ccd 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.ts +++ b/backend/functions/healthcheck/healthcheck.db.cosmos.ts @@ -26,7 +26,7 @@ export default class HealthcheckCosmosDb { const { connectionString, databaseName } = this.context.config.documentDbConfig; this.databaseName = databaseName; this.client = new DocumentClient(connectionString); - deferClose(context, this.client); + deferClose(this.client, context); } private getAdapter() { diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts index 7faeca25b..6afa1099e 100644 --- a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts @@ -1,3 +1,4 @@ +import { deferClose } from '../../../../defer-close'; import { DocumentClient } from '../../../../humble-objects/mongo-humble'; import { ApplicationContext } from '../../../types/basic'; import { MongoCollectionAdapter } from './mongo-adapter'; @@ -8,12 +9,14 @@ export abstract class BaseMongoRepository { protected readonly client: DocumentClient; protected readonly databaseName: string; - protected constructor(context: ApplicationContext, moduleName: string, collectionName: string) { + constructor(context: ApplicationContext, moduleName: string, collectionName: string) { this.moduleName = moduleName; this.collectionName = collectionName; const { connectionString, databaseName } = context.config.documentDbConfig; this.databaseName = databaseName; this.client = new DocumentClient(connectionString); + + deferClose(this.client, context); } protected getAdapter() { diff --git a/backend/functions/lib/deferrable/defer-close.test.ts b/backend/functions/lib/deferrable/defer-close.test.ts index b9946abe1..37b433f99 100644 --- a/backend/functions/lib/deferrable/defer-close.test.ts +++ b/backend/functions/lib/deferrable/defer-close.test.ts @@ -8,7 +8,7 @@ describe('Defer Close', () => { const accumulator: DeferCloseAccumulator = { closables: [], }; - const success = deferClose(accumulator, closable); + const success = deferClose(closable, accumulator); expect(success).toBeTruthy(); expect(accumulator.closables.length).toEqual(1); diff --git a/backend/functions/lib/deferrable/defer-close.ts b/backend/functions/lib/deferrable/defer-close.ts index 46c67573a..8202c69f0 100644 --- a/backend/functions/lib/deferrable/defer-close.ts +++ b/backend/functions/lib/deferrable/defer-close.ts @@ -14,7 +14,7 @@ function isDeferCloseAccumulator(obj: unknown): obj is DeferCloseAccumulator { return typeof obj === 'object' && 'closables' in obj; } -export function deferClose(accumulator: unknown, closable: unknown): boolean { +export function deferClose(closable: unknown, accumulator: unknown = globalAccumulator): boolean { if (isDeferCloseAccumulator(accumulator)) { if (isClosable(closable)) { const priorLength = accumulator.closables.length; @@ -23,7 +23,7 @@ export function deferClose(accumulator: unknown, closable: unknown): boolean { } } -export async function closeDeferred(accumulator: unknown): Promise { +export async function closeDeferred(accumulator: unknown = globalAccumulator): Promise { if (isDeferCloseAccumulator(accumulator)) { let success = true; for (const closable of accumulator.closables) { @@ -37,3 +37,15 @@ export async function closeDeferred(accumulator: unknown): Promise { } return false; } + +const globalAccumulator: DeferCloseAccumulator = { + closables: [], +}; + +async function closeGlobal() { + console.warn(`***** CLOSING ${globalAccumulator.closables.length} CLOSABLES ****`); + closeDeferred(globalAccumulator); +} + +process.on('SIGINT', closeGlobal); +process.on('SIGTERM', closeGlobal); From 4991c1713621dfc2a66d61254487465b7749d37c Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:19:09 -0500 Subject: [PATCH 050/112] Add global defer close Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../functions/lib/adapters/gateways/abstract-mssql-client.ts | 2 +- .../adapters/gateways/mongo/runtime-state.mongo.repository.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index 79ef0388f..e3475f7a6 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -11,7 +11,7 @@ export abstract class AbstractMssqlClient { this.moduleName = `ABSTRACT-MSSQL-CLIENT (${childModuleName})`; if (!AbstractMssqlClient.connectionPool) { AbstractMssqlClient.connectionPool = new ConnectionPool(dbConfig as config); - deferClose(context, AbstractMssqlClient.connectionPool); + deferClose(AbstractMssqlClient.connectionPool); } } diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts index db9b6e5ea..988de260a 100644 --- a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts @@ -7,7 +7,6 @@ import { import QueryBuilder from '../../../query/query-builder'; import { getCamsError } from '../../../common-errors/error-utilities'; import { BaseMongoRepository } from './utils/base-mongo-repository'; -import { deferClose } from '../../../deferrable/defer-close'; const MODULE_NAME = 'RUNTIME_STATE_MONGO_REPOSITORY'; const COLLECTION_NAME = 'runtime-state'; @@ -20,7 +19,6 @@ export class RuntimeStateMongoRepository { constructor(context: ApplicationContext) { super(context, MODULE_NAME, COLLECTION_NAME); - deferClose(context, this.client); } async read(id: RuntimeStateDocumentType): Promise { From a03315a29624c787018229c16e871bee5f1b6622 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:01:49 -0600 Subject: [PATCH 051/112] Only connect to SQL Server once Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/abstract-mssql-client.ts | 27 ++++++++++--------- .../adapters/gateways/acms/acms.gateway.ts | 11 ++++---- .../lib/use-cases/acms-orders/acms-orders.ts | 5 ++-- .../orchestration/sub-orchestrator-etl.ts | 3 ++- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index e3475f7a6..bc94bb6d1 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -2,6 +2,7 @@ import { config, ConnectionError, ConnectionPool, MSSQLError, IResult } from 'ms import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; import { deferClose } from '../../deferrable/defer-close'; import { ApplicationContext } from '../types/basic'; +import { getCamsError } from '../../common-errors/error-utilities'; export abstract class AbstractMssqlClient { private static connectionPool: ConnectionPool; @@ -22,8 +23,11 @@ export abstract class AbstractMssqlClient { ): Promise { // we should do some sanitization here to eliminate sql injection issues try { - const connection = await AbstractMssqlClient.connectionPool.connect(); - const request = connection.request(); + if (!AbstractMssqlClient.connectionPool.connected) { + await AbstractMssqlClient.connectionPool.connect(); + } + // const connection = await AbstractMssqlClient.connectionPool.connect(); + const request = AbstractMssqlClient.connectionPool.request(); if (typeof input != 'undefined') { input.forEach((item) => { @@ -38,10 +42,6 @@ export abstract class AbstractMssqlClient { success: true, }; - context.logger.info(this.moduleName, 'Closing connection.'); - - await connection.close(); - return queryResults; } catch (error) { if (isConnectionError(error)) { @@ -83,13 +83,14 @@ export abstract class AbstractMssqlClient { context.logger.error(this.moduleName, error.message, { error, query, input }); } - // TODO May want to refactor to throw CamsError and remove returning QueryResults - const queryResult: QueryResults = { - results: {}, - message: (error as Error).message, - success: false, - }; - return queryResult; + // // TODO May want to refactor to throw CamsError and remove returning QueryResults + // const queryResult: QueryResults = { + // results: {}, + // message: (error as Error).message, + // success: false, + // }; + // return queryResult; + throw getCamsError(error, this.moduleName, error.message); } } } diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index a1c6e5ea5..52dab869e 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -12,7 +12,7 @@ import { getCamsError } from '../../../common-errors/error-utilities'; import { DbTableFieldSpec } from '../../types/database'; const MODULE_NAME = 'ACMS_GATEWAY'; -const PAGE_SIZE = 50; +const PAGE_SIZE = 10; export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway { constructor(context: ApplicationContext) { @@ -63,7 +63,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway const result = results.results[0]; return result.leadCaseCount ? Math.ceil(result.leadCaseCount / PAGE_SIZE) : 0; } catch (originalError) { - throw getCamsError(originalError, MODULE_NAME); + throw getCamsError(originalError, MODULE_NAME, originalError.message); } } @@ -125,7 +125,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway const leadCaseIdsResults = results as ResultType[]; return leadCaseIdsResults.map((record) => record.leadCaseId); } catch (originalError) { - throw getCamsError(originalError, MODULE_NAME); + throw getCamsError(originalError, MODULE_NAME, originalError.message); } } @@ -166,7 +166,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway }; }); return { - leadCaseId: this.formatCaseId(leadCaseId), + leadCaseId: this.formatCaseId(leadCaseId.toString()), childCases, }; } catch (originalError) { @@ -175,11 +175,12 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway `Failed to get case info for lead case id: ${leadCaseId}.`, originalError, ); - throw getCamsError(originalError, MODULE_NAME); + throw getCamsError(originalError, MODULE_NAME, originalError.message); } } private formatCaseId(caseId: string): string { + console.log(`Case ID: ${caseId} is of type ${typeof caseId}.`); const padded = caseId.padStart(10, '0'); return `${padded.slice(0, 3)}-${padded.slice(3, 5)}-${padded.slice(5)}`; } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index bf1d8ce1d..42d3fe8aa 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -45,7 +45,8 @@ export class AcmsOrders { predicate: AcmsPredicate, ): Promise { const gateway = Factory.getAcmsGateway(context); - return gateway.getPageCount(context, predicate); + const pageCount = await gateway.getPageCount(context, predicate); + return pageCount > 0 ? 1 : pageCount; } public async getLeadCaseIds( @@ -185,7 +186,7 @@ export class AcmsOrders { const camsError = getCamsError( error, MODULE_NAME, - `Transformation failed for lead case ${leadCaseId}`, + `Transformation failed for lead case ${leadCaseId}. ${error.message}`, ); context.logger.camsError(camsError); } diff --git a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts index f4fb59fb4..1e2879a03 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts @@ -12,7 +12,8 @@ export function* subOrchestratorETL(context: OrchestrationContext) { const etlTasks = []; for (let i = 0; i < leadCaseIds.length; i++) { - etlTasks.push(context.df.callActivity(MIGRATE_CONSOLIDATION, leadCaseIds[i])); + const leadCaseIdString = leadCaseIds[i].toString(); + etlTasks.push(context.df.callActivity(MIGRATE_CONSOLIDATION, leadCaseIdString)); } yield context.df.Task.all(etlTasks); From 61a198d6dce55dae18b630f773c6836c8edbe4ad Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:14:01 -0500 Subject: [PATCH 052/112] Add isolated integation test for acms migration Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../test-acms-migration.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 backend/functions/lib/testing/isolated-integration/test-acms-migration.ts diff --git a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts new file mode 100644 index 000000000..baf2404b8 --- /dev/null +++ b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts @@ -0,0 +1,30 @@ +import { InvocationContext } from '@azure/functions'; +import migrateConsolidation from '../../../migration/activity/migrateConsolidation'; + +const MODULE_NAME = 'ITEST'; + +/* +081-99-29871 - primary +081-99-83891 +081-99-31281 +*/ + +async function testAcmsMigration() { + const invocationContext = new InvocationContext(); + + try { + const leadCaseId = '819929871'; + const result = await migrateConsolidation.handler(leadCaseId, invocationContext); + console.log(result); + } catch (error) { + console.error(MODULE_NAME, error); + } finally { + console.log('Done.', '\n'); + } +} + +if (require.main === module) { + (async () => { + await testAcmsMigration(); + })(); +} From a6d3e7c0a7e48f1c0e2ac9785243870958f6c595 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:49:51 -0600 Subject: [PATCH 053/112] Use mock invocation context Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../testing/isolated-integration/test-acms-migration.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts index baf2404b8..6b77d0eac 100644 --- a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts +++ b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts @@ -1,5 +1,8 @@ -import { InvocationContext } from '@azure/functions'; import migrateConsolidation from '../../../migration/activity/migrateConsolidation'; +import { createMockAzureFunctionContext } from '../../../azure/testing-helpers'; +import * as dotenv from 'dotenv'; + +dotenv.config(); const MODULE_NAME = 'ITEST'; @@ -10,7 +13,7 @@ const MODULE_NAME = 'ITEST'; */ async function testAcmsMigration() { - const invocationContext = new InvocationContext(); + const invocationContext = createMockAzureFunctionContext({ ...process.env }); try { const leadCaseId = '819929871'; From 311bc86528d5fc2a30881f39859025e8475127c6 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:17:38 -0500 Subject: [PATCH 054/112] Fix differences between acms and dxtr case ids Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../adapters/gateways/acms/acms.gateway.ts | 20 +++++++++++-------- .../lib/use-cases/acms-orders/acms-orders.ts | 14 ++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index 52dab869e..a4bcfbc3b 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -157,14 +157,18 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway try { const results = await this.executeQuery(context, query, input); const rawResults = results.results as AcmsConsolidationChildCase[]; - const childCases = rawResults.map((bCase) => { - const date = String(bCase.consolidationDate); - return { - ...bCase, - consolidationType: bCase.consolidationType === 'S' ? 'substantive' : 'administrative', - consolidationDate: `${date.slice(0, 4)}-${date.slice(4, 6)}-${date.slice(6)}`, - }; - }); + + const formattedLeadCaseId = this.formatCaseId(leadCaseId); + const childCases = rawResults + .filter((bCase) => bCase.caseId !== formattedLeadCaseId) + .map((bCase) => { + const date = String(bCase.consolidationDate); + return { + ...bCase, + consolidationType: bCase.consolidationType === 'S' ? 'substantive' : 'administrative', + consolidationDate: `${date.slice(0, 4)}-${date.slice(4, 6)}-${date.slice(6)}`, + }; + }); return { leadCaseId: this.formatCaseId(leadCaseId.toString()), childCases, diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 42d3fe8aa..5b5b8ce52 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -59,21 +59,21 @@ export class AcmsOrders { public async migrateConsolidation( context: ApplicationContext, - leadCaseId: string, + acmsLeadCaseId: string, ): Promise { // TODO: Add child case count to the report?? - const report: AcmsConsolidationReport = { leadCaseId, success: true }; + const report: AcmsConsolidationReport = { leadCaseId: acmsLeadCaseId, success: true }; try { const casesRepo = Factory.getCasesRepository(context); const dxtr = Factory.getCasesGateway(context); const acms = Factory.getAcmsGateway(context); - const basics = await acms.getConsolidationDetails(context, leadCaseId); - const leadCase = await dxtr.getCaseSummary(context, leadCaseId); + const basics = await acms.getConsolidationDetails(context, acmsLeadCaseId); + const leadCase = await dxtr.getCaseSummary(context, basics.leadCaseId); // NOTE! Azure suggests that all work be IDEMPOTENT because activities run _at least once_. // Check if exported child cases have already been migrated. - const existingConsolidations = await casesRepo.getConsolidation(leadCaseId); + const existingConsolidations = await casesRepo.getConsolidation(basics.leadCaseId); const existingChildCaseIds = existingConsolidations .filter((link) => link.documentType === 'CONSOLIDATION_FROM') .map((link) => link.otherCase.caseId) @@ -120,7 +120,7 @@ export class AcmsOrders { const otherCase = await dxtr.getCaseSummary(context, childCase.caseId); const fromLink: ConsolidationFrom = { - caseId: leadCaseId, + caseId: basics.leadCaseId, consolidationType, documentType: 'CONSOLIDATION_FROM', orderDate: childCase.consolidationDate, @@ -186,7 +186,7 @@ export class AcmsOrders { const camsError = getCamsError( error, MODULE_NAME, - `Transformation failed for lead case ${leadCaseId}. ${error.message}`, + `Transformation failed for lead case ${acmsLeadCaseId}. ${error.message}`, ); context.logger.camsError(camsError); } From 2c99dd5def77601bc5384c59913c811f7879aa17 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Wed, 4 Dec 2024 15:18:40 -0700 Subject: [PATCH 055/112] Made connection pool a singleton for legacy dxtr Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../functions/lib/adapters/utils/database.ts | 18 ++++++++++-------- .../functions/lib/deferrable/defer-close.ts | 1 + .../test-acms-migration.ts | 1 + .../lib/use-cases/acms-orders/acms-orders.ts | 3 +-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/backend/functions/lib/adapters/utils/database.ts b/backend/functions/lib/adapters/utils/database.ts index c3fe64f4f..fb519dc58 100644 --- a/backend/functions/lib/adapters/utils/database.ts +++ b/backend/functions/lib/adapters/utils/database.ts @@ -1,9 +1,11 @@ -import { ConnectionError, MSSQLError } from 'mssql'; +import { ConnectionError, ConnectionPool, MSSQLError } from 'mssql'; import { ApplicationContext } from '../types/basic'; import { DbTableFieldSpec, IDbConfig, QueryResults } from '../types/database'; import { getSqlConnection } from '../../factory'; +import { deferClose } from '../../deferrable/defer-close'; const MODULE_NAME = 'DATABASE-UTILITY'; +let sqlConnectionPool: ConnectionPool; export async function executeQuery( applicationContext: ApplicationContext, @@ -13,9 +15,13 @@ export async function executeQuery( ): Promise { // we should do some sanitization here to eliminate sql injection issues try { - const sqlConnectionPool = getSqlConnection(databaseConfig); - const sqlConnection = await sqlConnectionPool.connect(); - const sqlRequest = sqlConnection.request(); + if (!sqlConnectionPool) { + sqlConnectionPool = getSqlConnection(databaseConfig); + deferClose(sqlConnectionPool); + } + + if (!sqlConnectionPool.connected) await sqlConnectionPool.connect(); + const sqlRequest = sqlConnectionPool.request(); if (typeof input != 'undefined') { input.forEach((item) => { @@ -30,10 +36,6 @@ export async function executeQuery( success: true, }; - applicationContext.logger.info(MODULE_NAME, 'Closing connection.'); - - await sqlConnection.close(); - return queryResult; } catch (error) { if (isConnectionError(error)) { diff --git a/backend/functions/lib/deferrable/defer-close.ts b/backend/functions/lib/deferrable/defer-close.ts index 8202c69f0..72316a4e5 100644 --- a/backend/functions/lib/deferrable/defer-close.ts +++ b/backend/functions/lib/deferrable/defer-close.ts @@ -49,3 +49,4 @@ async function closeGlobal() { process.on('SIGINT', closeGlobal); process.on('SIGTERM', closeGlobal); +process.on('exit', closeGlobal); diff --git a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts index 6b77d0eac..c8e1b17e5 100644 --- a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts +++ b/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts @@ -29,5 +29,6 @@ async function testAcmsMigration() { if (require.main === module) { (async () => { await testAcmsMigration(); + process.exit(0); })(); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 5b5b8ce52..79c3df6ee 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -45,8 +45,7 @@ export class AcmsOrders { predicate: AcmsPredicate, ): Promise { const gateway = Factory.getAcmsGateway(context); - const pageCount = await gateway.getPageCount(context, predicate); - return pageCount > 0 ? 1 : pageCount; + return await gateway.getPageCount(context, predicate); } public async getLeadCaseIds( From 18fe210afe7e5bc18fa6103935b468b2abd69e80 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:51:44 -0600 Subject: [PATCH 056/112] Add apiKey to client request Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../lib/use-cases/acms-orders/acms-orders.ts | 4 +++ .../client/acms-migration-trigger.function.ts | 32 +++++++++++++++++-- .../functions/migration/loadConsolidations.ts | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 79c3df6ee..60a8c8830 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -14,6 +14,10 @@ export type AcmsBounds = { chapters: string[]; }; +export type TriggerRequest = AcmsBounds & { + apiKey: string; +}; + export type AcmsPredicate = { divisionCode: string; chapter: string; diff --git a/backend/functions/migration/client/acms-migration-trigger.function.ts b/backend/functions/migration/client/acms-migration-trigger.function.ts index 4bd2e8d0d..d2ae53079 100644 --- a/backend/functions/migration/client/acms-migration-trigger.function.ts +++ b/backend/functions/migration/client/acms-migration-trigger.function.ts @@ -1,18 +1,44 @@ import * as df from 'durable-functions'; import { HttpRequest, HttpResponse, InvocationContext } from '@azure/functions'; import { MAIN_ORCHESTRATOR } from '../loadConsolidations'; +import { TriggerRequest } from '../../lib/use-cases/acms-orders/acms-orders'; +import { BadRequestError } from '../../lib/common-errors/bad-request'; +import * as dotenv from 'dotenv'; +import { UnauthorizedError } from '../../lib/common-errors/unauthorized-error'; + +const MODULE_NAME = 'ACMS_MIGRATION_TRIGGER'; +dotenv.config(); export default async function httpStart( request: HttpRequest, context: InvocationContext, ): Promise { const client = df.getClient(context); - const body: unknown = await request.json(); + let body: TriggerRequest; + if (request.body) { + body = (await request.json()) as unknown as TriggerRequest; + } + + if (!isTriggerRequest(body)) { + throw new BadRequestError(MODULE_NAME, { message: 'Missing or malformed request body.' }); + } + + if (body.apiKey !== process.env.ADMIN_KEY) { + throw new UnauthorizedError(MODULE_NAME, { message: 'API key was missing or did not match.' }); + } + const instanceId: string = await client.startNew(MAIN_ORCHESTRATOR, { input: body, }); - context.log(`Started orchestration with ID = '${instanceId}'.`); - return client.createCheckStatusResponse(request, instanceId); } + +function isTriggerRequest(request: unknown): request is TriggerRequest { + return ( + typeof request === 'object' && + 'apiKey' in request && + 'chapters' in request && + 'divisionCodes' in request + ); +} diff --git a/backend/functions/migration/loadConsolidations.ts b/backend/functions/migration/loadConsolidations.ts index d27decf07..e6e55b1c0 100644 --- a/backend/functions/migration/loadConsolidations.ts +++ b/backend/functions/migration/loadConsolidations.ts @@ -27,7 +27,7 @@ df.app.activity(MIGRATE_CONSOLIDATION, migrateConsolidation); df.app.activity(FLATTEN_BOUNDING_ARRAYS, flattenBoundingArrays); app.http('dfClient', { - route: 'orchestrators/orchestrator', + route: 'migrations/consolidation', extraInputs: [df.input.durableClient()], handler: httpStart, }); From 1bddff095d03fd0e1ca91d6ac8bcccb5ad8acac7 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:55:35 -0600 Subject: [PATCH 057/112] Remove unnecessary test Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../gateways/abstract-mssql-client.exception.test.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts index 57131c2e0..57a5d0278 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -170,12 +170,4 @@ describe('Tests database client exceptions', () => { expect(queryResult.success).toBeFalsy(); expect(queryResult.message).toEqual(expectedErrorMessage); }); - - test('should close connection pool when calling close', async () => { - const context = await createMockApplicationContext(); - const client = new MssqlClient(context); - - await client.close(); - expect(mockConnectionPoolClose).toHaveBeenCalled(); - }); }); From 7ad13957b03194fd5c6aebc6ff54768e959e12c2 Mon Sep 17 00:00:00 2001 From: Fritz Madden Date: Wed, 4 Dec 2024 16:55:00 -0700 Subject: [PATCH 058/112] All tests are passing. Yay! Jira ticket: CAMS-461 --- .../abstract-mssql-client.exception.test.ts | 36 ++++++++----------- .../gateways/abstract-mssql-client.test.ts | 9 +++++ .../gateways/acms/acms.gateway.test.ts | 14 ++++---- .../lib/adapters/utils/database.test.ts | 6 ++++ .../lib/deferrable/finalize-deferrable.ts | 3 -- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts index 57a5d0278..af2010790 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -1,4 +1,4 @@ -import { QueryResults, IDbConfig } from '../types/database'; +import { IDbConfig } from '../types/database'; import { ConnectionError, MSSQLError, RequestError } from 'mssql'; import { createMockApplicationContext } from '../../testing/testing-utilities'; import { AbstractMssqlClient } from './abstract-mssql-client'; @@ -40,6 +40,7 @@ jest.mock('mssql', () => { return { close: mockConnectionPoolClose, connect: mockConnect, + request: mockRequest, }; }), }; @@ -62,7 +63,7 @@ describe('Tests database client exceptions', () => { client = new MssqlClient(context); }); - test('should handle miscelaneous mssql error exceptions', async () => { + test('should rethrow miscelaneous mssql error exceptions', async () => { const expectedErrorMessage = 'Test request error exception'; const requestError = new RequestError(expectedErrorMessage); requestError.name = 'RequestError'; @@ -73,11 +74,9 @@ describe('Tests database client exceptions', () => { }); // method under test - const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); - - expect(mockRequest).toThrow(expectedErrorMessage); - expect(queryResult.success).toBeFalsy(); - expect(queryResult.message).toEqual(expectedErrorMessage); + await expect(async () => { + await client.executeQuery(context, 'SELECT * FROM bar', []); + }).rejects.toThrow(expectedErrorMessage); }); test('should handle known mssql MSSQLError exceptions', async () => { @@ -100,11 +99,9 @@ describe('Tests database client exceptions', () => { }); // method under test - const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); - - expect(mockRequest).toThrow(expectedErrorMessage); - expect(queryResult.success).toBeFalsy(); - expect(queryResult.message).toEqual(expectedErrorMessage); + await expect(async () => { + await client.executeQuery(context, 'SELECT * FROM bar', []); + }).rejects.toThrow(expectedErrorMessage); }); test('should handle known mssql ConnectionError exceptions', async () => { @@ -119,10 +116,9 @@ describe('Tests database client exceptions', () => { }); // method under test - const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); - expect(mockConnect).toThrow(expectedErrorMessage); - expect(queryResult.success).toBeFalsy(); - expect(queryResult.message).toEqual(expectedErrorMessage); + await expect(async () => { + await client.executeQuery(context, 'SELECT * FROM bar', []); + }).rejects.toThrow(expectedErrorMessage); }); test('should handle known mssql ConnectionError exceptions with AggregateErrors', async () => { @@ -164,10 +160,8 @@ describe('Tests database client exceptions', () => { const context = await createMockApplicationContext(); // method under test - const queryResult: QueryResults = await client.executeQuery(context, 'SELECT * FROM bar', []); - - expect(mockConnect).toThrow(expectedErrorMessage); - expect(queryResult.success).toBeFalsy(); - expect(queryResult.message).toEqual(expectedErrorMessage); + await expect(async () => { + await client.executeQuery(context, 'SELECT * FROM bar', []); + }).rejects.toThrow(expectedErrorMessage); }); }); diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts index 4db02f2a2..536f429e6 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts @@ -35,6 +35,15 @@ jest.mock('mssql', () => { ), }), ), + request: jest.fn().mockImplementation(() => ({ + input: jest.fn(), + query: jest + .fn() + .mockImplementation( + (): Promise> => + Promise.resolve({ recordset: 'test string' } as unknown as IResult), + ), + })), }; }), }; diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts index ccf675682..f809312f5 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts @@ -9,13 +9,13 @@ import { } from '../../../use-cases/acms-orders/acms-orders'; import { UnknownError } from '../../../common-errors/unknown-error'; -const PAGE_SIZE = 50; +const PAGE_SIZE = 10; describe('ACMS gateway tests', () => { const pageCountCases = [ - { leadCaseCount: 245, pageCount: 5 }, - { leadCaseCount: 250, pageCount: 5 }, - { leadCaseCount: 251, pageCount: 6 }, + { leadCaseCount: 245, pageCount: 25 }, + { leadCaseCount: 250, pageCount: 25 }, + { leadCaseCount: 251, pageCount: 26 }, { pageCount: 0 }, ]; test.each(pageCountCases)( @@ -201,7 +201,7 @@ describe('ACMS gateway tests', () => { }).rejects.toThrow( new UnknownError('ACMS_GATEWAY', { status: 500, - message: 'Unknown Error', + message: mockError.message, originalError: mockError, }), ); @@ -270,7 +270,7 @@ describe('ACMS gateway tests', () => { }).rejects.toThrow( new UnknownError('ACMS_GATEWAY', { status: 500, - message: 'Unknown Error', + message: mockError.message, originalError: mockError, }), ); @@ -287,7 +287,7 @@ describe('ACMS gateway tests', () => { }).rejects.toThrow( new UnknownError('ACMS_GATEWAY', { status: 500, - message: 'Unknown Error', + message: mockError.message, originalError: mockError, }), ); diff --git a/backend/functions/lib/adapters/utils/database.test.ts b/backend/functions/lib/adapters/utils/database.test.ts index b43baaf68..9ef67ec4d 100644 --- a/backend/functions/lib/adapters/utils/database.test.ts +++ b/backend/functions/lib/adapters/utils/database.test.ts @@ -12,6 +12,12 @@ jest.mock('mssql', () => { return { ConnectionPool: jest.fn().mockImplementation(() => { return { + request: jest.fn().mockImplementation(() => ({ + input: jest.fn(), + query: jest + .fn() + .mockImplementation((): Promise => Promise.resolve('test string')), + })), connect: jest.fn().mockImplementation( (): Promise => Promise.resolve({ diff --git a/backend/functions/lib/deferrable/finalize-deferrable.ts b/backend/functions/lib/deferrable/finalize-deferrable.ts index ac21a2197..1e3a9c826 100644 --- a/backend/functions/lib/deferrable/finalize-deferrable.ts +++ b/backend/functions/lib/deferrable/finalize-deferrable.ts @@ -1,12 +1,9 @@ import { closeDeferred, DeferCloseAccumulator } from './defer-close'; import { DeferReleaseAccumulator, releaseDeferred } from './defer-release'; -import { LoggerHelper } from '../adapters/types/basic'; export async function finalizeDeferrable( accumulator: DeferCloseAccumulator | DeferReleaseAccumulator, ) { - const logger = accumulator['logger'] as LoggerHelper; - logger.debug('FINALIZE_DEFERRABLE', '!!!!!!!!!!!!!!!Finalize deferrable!!!!!!!!!!!!!!!'); await closeDeferred(accumulator); await releaseDeferred(accumulator); } From e9a9b57888f3198b860dd78e0861ee3f167cd8dd Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:52:50 -0600 Subject: [PATCH 059/112] Fix mistaken merge conflict resolution Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- .../adapters/gateways/mongo/utils/base-mongo-repository.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts index 6afa1099e..7faeca25b 100644 --- a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts +++ b/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts @@ -1,4 +1,3 @@ -import { deferClose } from '../../../../defer-close'; import { DocumentClient } from '../../../../humble-objects/mongo-humble'; import { ApplicationContext } from '../../../types/basic'; import { MongoCollectionAdapter } from './mongo-adapter'; @@ -9,14 +8,12 @@ export abstract class BaseMongoRepository { protected readonly client: DocumentClient; protected readonly databaseName: string; - constructor(context: ApplicationContext, moduleName: string, collectionName: string) { + protected constructor(context: ApplicationContext, moduleName: string, collectionName: string) { this.moduleName = moduleName; this.collectionName = collectionName; const { connectionString, databaseName } = context.config.documentDbConfig; this.databaseName = databaseName; this.client = new DocumentClient(connectionString); - - deferClose(this.client, context); } protected getAdapter() { From 017d8aea8de21a0fe532a18f49d9a1c2c69ee6f1 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Thu, 5 Dec 2024 10:16:15 -0500 Subject: [PATCH 060/112] added admin key to backend bicep Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- ops/cloud-deployment/backend-api-deploy.bicep | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index 5f103456c..eaef235ad 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -286,6 +286,10 @@ var applicationSettings = concat( name: 'STARTING_MONTH' value: '-70' } + { + name: 'ADMIN_KEY' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ADMIN_KEY)' + } { name: 'COSMOS_DATABASE_NAME' value: cosmosDatabaseName From 520115f4c914849523e4960a90f786413361c45f Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Thu, 5 Dec 2024 10:58:24 -0500 Subject: [PATCH 061/112] fixed secret name in env var Jira ticket: CAMS-461 Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- ops/cloud-deployment/backend-api-deploy.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index eaef235ad..c29d4459c 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -288,7 +288,7 @@ var applicationSettings = concat( } { name: 'ADMIN_KEY' - value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ADMIN_KEY)' + value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=ADMIN-KEY)' } { name: 'COSMOS_DATABASE_NAME' From f526b4a31ba6cf578d557d9c1aa1c6a78013b920 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:59:16 -0600 Subject: [PATCH 062/112] Add a script to generate a shared secret apiKey We also replace ts-node with tsx because ts-node and Node 20 do not get along. Specifically, for some reason it cannot run files with a '.ts' file extension, which entirely defeats the purpose of the package for our uses. Jira ticket: CAMS-461 --- dev-tools/api-keys/generate-key.ts | 6 + dev-tools/package-lock.json | 583 +++++++++++++++++++++-------- dev-tools/package.json | 18 +- 3 files changed, 443 insertions(+), 164 deletions(-) create mode 100644 dev-tools/api-keys/generate-key.ts diff --git a/dev-tools/api-keys/generate-key.ts b/dev-tools/api-keys/generate-key.ts new file mode 100644 index 000000000..72f6bfc3c --- /dev/null +++ b/dev-tools/api-keys/generate-key.ts @@ -0,0 +1,6 @@ +import crypto from 'crypto'; +// Generate a random 32-byte key (256 bits) +const apiKey = crypto.randomBytes(32).toString('hex'); + +console.log(`Generated API Key: ${apiKey}`); +process.exit(0); diff --git a/dev-tools/package-lock.json b/dev-tools/package-lock.json index ca016b37b..a7c066ea5 100644 --- a/dev-tools/package-lock.json +++ b/dev-tools/package-lock.json @@ -21,7 +21,7 @@ "eslint-plugin-n": "^16.6.2", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-promise": "^6.6.0", - "ts-node": "^10.9.2" + "tsx": "^4.19.2" } }, "node_modules/@azure/abort-controller": { @@ -205,16 +205,364 @@ "node": ">=16" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -371,31 +719,6 @@ "deprecated": "Use @eslint/object-schema instead", "license": "BSD-3-Clause" }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -449,30 +772,6 @@ "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "license": "MIT" }, - "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "license": "MIT" - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "license": "MIT" - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "license": "MIT" - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "license": "MIT" - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -701,18 +1000,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/agent-base": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", @@ -765,12 +1052,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "license": "MIT" - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1037,12 +1318,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "license": "MIT" - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1174,15 +1449,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1361,6 +1627,44 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -1957,6 +2261,19 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2955,12 +3272,6 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "license": "ISC" - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3767,49 +4078,6 @@ "typescript": ">=4.2.0" } }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -3828,6 +4096,24 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tsx": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", + "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3979,12 +4265,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "license": "MIT" - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4098,15 +4378,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/dev-tools/package.json b/dev-tools/package.json index 228266b5f..89e995f9e 100644 --- a/dev-tools/package.json +++ b/dev-tools/package.json @@ -4,13 +4,14 @@ "description": "Custom tools used to aid development.", "scripts": { "clean": "rm -rf ./node_modules", - "delete-all": "ts-node cosmos-records/index.ts", - "delete-assignments": "ts-node cosmos-records/delete-assignments.ts", - "delete-orders": "ts-node cosmos-records/delete-orders.ts", - "sync-orders": "ts-node cosmos-records/sync-orders.ts", + "delete-all": "tsx --env-file=.env cosmos-records/index.ts", + "delete-assignments": "tsx --env-file=.env cosmos-records/delete-assignments.ts", + "delete-orders": "tsx --env-file=.env cosmos-records/delete-orders.ts", + "generate-api-key": "tsx --env-file=.env api-keys/generate-key.ts", + "sync-orders": "tsx --env-file=.env cosmos-records/sync-orders.ts", "reload-orders": "npm run delete-orders; npm run sync-orders", - "test-data:sql": "mkdir -p data; ts-node test-data/index.ts sql > data/test-data.sql", - "test-data:json": "mkdir -p data; ts-node test-data/index.ts json > data/test-data.json", + "test-data:sql": "mkdir -p data; tsx --env-file=.env test-data/index.ts sql > data/test-data.sql", + "test-data:json": "mkdir -p data; tsx --env-file=.env test-data/index.ts json > data/test-data.json", "lint": "eslint .", "lint:fix": "eslint . --fix" }, @@ -29,6 +30,7 @@ "eslint-plugin-n": "^16.6.2", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-promise": "^6.6.0", - "ts-node": "^10.9.2" - } + "tsx": "^4.19.2" + }, + "type": "module" } From 1eb3a72a393abbd33a358b5ad850813c088b739e Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:08:08 -0600 Subject: [PATCH 063/112] Add logging of aggregate results Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../abstract-mssql-client.exception.test.ts | 4 +-- .../gateways/abstract-mssql-client.test.ts | 2 +- .../gateways/abstract-mssql-client.ts | 15 ++------- .../adapters/gateways/acms/acms.gateway.ts | 5 ++- .../lib/adapters/utils/feature-flag.ts | 1 + .../acms-orders.controller.test.ts | 5 +-- .../acms-orders/acms-orders.controller.ts | 8 ++--- .../functions/lib/deferrable/defer-close.ts | 1 - .../lib/use-cases/acms-orders/acms-orders.ts | 33 +++++++++++++++++-- .../activity/migrateConsolidation.ts | 4 +-- .../activity/migrateConsolidations.test.ts | 4 ++- .../client/acms-migration-trigger.function.ts | 11 ++++--- .../migration/orchestration/orchestrator.ts | 26 ++++++++++++++- .../orchestration/sub-orchestrator-etl.ts | 25 ++++++++------ .../orchestration/sub-orchestrator-paging.ts | 30 ++++++++++++++--- 15 files changed, 121 insertions(+), 53 deletions(-) diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts index af2010790..ae4aaeef5 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts @@ -47,9 +47,9 @@ jest.mock('mssql', () => { }); class MssqlClient extends AbstractMssqlClient { - constructor(context: ApplicationContext) { + constructor(_context: ApplicationContext) { const config = { server: 'foo' } as IDbConfig; - super(context, config, 'Exception Tests'); + super(config, 'Exception Tests'); } } diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts index 536f429e6..03ff7ec44 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts @@ -72,7 +72,7 @@ describe('Abstract MS-SQL client', () => { // execute method under test class TestDbClient extends AbstractMssqlClient { constructor(context: ApplicationContext, config: IDbConfig, childModuleName: string) { - super(context, config, childModuleName); + super(config, childModuleName); } } const client = new TestDbClient(context, context.config.dxtrDbConfig, 'TEST_MODULE'); diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts index bc94bb6d1..d2601f3be 100644 --- a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts +++ b/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts @@ -8,7 +8,7 @@ export abstract class AbstractMssqlClient { private static connectionPool: ConnectionPool; private readonly moduleName: string; - protected constructor(context: ApplicationContext, dbConfig: IDbConfig, childModuleName: string) { + protected constructor(dbConfig: IDbConfig, childModuleName: string) { this.moduleName = `ABSTRACT-MSSQL-CLIENT (${childModuleName})`; if (!AbstractMssqlClient.connectionPool) { AbstractMssqlClient.connectionPool = new ConnectionPool(dbConfig as config); @@ -21,12 +21,10 @@ export abstract class AbstractMssqlClient { query: string, input?: DbTableFieldSpec[], ): Promise { - // we should do some sanitization here to eliminate sql injection issues try { if (!AbstractMssqlClient.connectionPool.connected) { await AbstractMssqlClient.connectionPool.connect(); } - // const connection = await AbstractMssqlClient.connectionPool.connect(); const request = AbstractMssqlClient.connectionPool.request(); if (typeof input != 'undefined') { @@ -64,8 +62,8 @@ export abstract class AbstractMssqlClient { } else if (isMssqlError(error)) { const newError = { error: { - name: error.name, // RequestError - description: error.message, // Timeout: Request failed to complete in 15000ms + name: error.name, + description: error.message, }, originalError: {}, query, @@ -83,13 +81,6 @@ export abstract class AbstractMssqlClient { context.logger.error(this.moduleName, error.message, { error, query, input }); } - // // TODO May want to refactor to throw CamsError and remove returning QueryResults - // const queryResult: QueryResults = { - // results: {}, - // message: (error as Error).message, - // success: false, - // }; - // return queryResult; throw getCamsError(error, this.moduleName, error.message); } } diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts index a4bcfbc3b..5af864dba 100644 --- a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts +++ b/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts @@ -19,7 +19,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway // The context carries different database connection configurations. // We pick off the configuration specific to this ACMS gateway. const config = context.config.acmsDbConfig; - super(context, config, MODULE_NAME); + super(config, MODULE_NAME); } async getPageCount(context: ApplicationContext, predicate: AcmsPredicate): Promise { @@ -32,7 +32,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway AND CONSOLIDATED_CASE_NUMBER != '0'`; // Valid ACMS chapters: 09, 11, 12, 13, 15, 7A, 7N, AC - // 'AC' is the predecesor to chapter 15. We are not importing these old cases into CAMS. + // 'AC' is the predecessor to chapter 15. We are not importing these old cases into CAMS. // '7A' and '7N' are treated inclusively as chapter 7 cases when importing into CAMS. // Leading zero padding is added for chapter 9. @@ -184,7 +184,6 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway } private formatCaseId(caseId: string): string { - console.log(`Case ID: ${caseId} is of type ${typeof caseId}.`); const padded = caseId.padStart(10, '0'); return `${padded.slice(0, 3)}-${padded.slice(3, 5)}-${padded.slice(5)}`; } diff --git a/backend/functions/lib/adapters/utils/feature-flag.ts b/backend/functions/lib/adapters/utils/feature-flag.ts index 0a5788554..05cd60e68 100644 --- a/backend/functions/lib/adapters/utils/feature-flag.ts +++ b/backend/functions/lib/adapters/utils/feature-flag.ts @@ -12,6 +12,7 @@ export async function getFeatureFlags(config: ApplicationConfiguration): Promise eventsUri: 'https://events.launchdarkly.us', }); await client.waitForInitialization(); + //TODO: revisit if this is necessary when we look at why we need to restart the backend for feature flags const state = await client.allFlagsState({ kind: 'user', key: 'feature-flag-migration', diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts index 7cd95e67e..b5e1aa581 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts @@ -1,5 +1,5 @@ import AcmsOrders, { - AcmsConsolidationReport, + AcmsTransformationResult, AcmsPredicate, AcmsPredicateAndPage, } from '../../use-cases/acms-orders/acms-orders'; @@ -45,8 +45,9 @@ describe('AcmsOrdersController', () => { test('should return processing report from migrateConsolidation', async () => { const leadCaseId = '811100000'; - const report: AcmsConsolidationReport = { + const report: AcmsTransformationResult = { leadCaseId, + childCaseCount: 1, success: true, }; const spy = jest.spyOn(AcmsOrders.prototype, 'migrateConsolidation').mockResolvedValue(report); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts index c0abd6fae..d3f53fe44 100644 --- a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts +++ b/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts @@ -1,7 +1,6 @@ import { ApplicationContext } from '../../adapters/types/basic'; -// import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; import AcmsOrders, { - AcmsConsolidationReport, + AcmsTransformationResult, AcmsPredicate, AcmsPredicateAndPage, } from '../../use-cases/acms-orders/acms-orders'; @@ -11,9 +10,8 @@ class AcmsOrdersController { public async migrateConsolidation( context: ApplicationContext, leadCaseId: string, - ): Promise { + ): Promise { const response = this.useCase.migrateConsolidation(context, leadCaseId); - // await finalizeDeferrable(context); return response; } @@ -22,7 +20,6 @@ class AcmsOrdersController { predicate: AcmsPredicate, ): Promise { const response = this.useCase.getPageCount(context, predicate); - // await finalizeDeferrable(context); return response; } @@ -31,7 +28,6 @@ class AcmsOrdersController { predicate: AcmsPredicateAndPage, ): Promise { const response = this.useCase.getLeadCaseIds(context, predicate); - // await finalizeDeferrable(context); return response; } } diff --git a/backend/functions/lib/deferrable/defer-close.ts b/backend/functions/lib/deferrable/defer-close.ts index 72316a4e5..ef491d60f 100644 --- a/backend/functions/lib/deferrable/defer-close.ts +++ b/backend/functions/lib/deferrable/defer-close.ts @@ -43,7 +43,6 @@ const globalAccumulator: DeferCloseAccumulator = { }; async function closeGlobal() { - console.warn(`***** CLOSING ${globalAccumulator.closables.length} CLOSABLES ****`); closeDeferred(globalAccumulator); } diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts index 60a8c8830..316b04055 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/functions/lib/use-cases/acms-orders/acms-orders.ts @@ -38,11 +38,32 @@ export type AcmsConsolidation = { childCases: AcmsConsolidationChildCase[]; }; -export type AcmsConsolidationReport = { +export type AcmsTransformationResult = { leadCaseId: string; + childCaseCount: number; success: boolean; }; +export type AcmsAggregate = { + successful: { + leadCaseCount: number; + childCaseCount: number; + }; + failed: { + leadCaseIds: string[]; + leadCaseCount: number; + childCaseCount: number; + }; +}; + +export type AcmsPageReport = AcmsAggregate & { + predicateAndPage: AcmsPredicateAndPage; +}; + +export type AcmsPartitionReport = AcmsAggregate & { + predicate: AcmsPredicate; +}; + export class AcmsOrders { public async getPageCount( context: ApplicationContext, @@ -63,9 +84,13 @@ export class AcmsOrders { public async migrateConsolidation( context: ApplicationContext, acmsLeadCaseId: string, - ): Promise { + ): Promise { // TODO: Add child case count to the report?? - const report: AcmsConsolidationReport = { leadCaseId: acmsLeadCaseId, success: true }; + const report: AcmsTransformationResult = { + leadCaseId: acmsLeadCaseId, + childCaseCount: 0, + success: true, + }; try { const casesRepo = Factory.getCasesRepository(context); const dxtr = Factory.getCasesGateway(context); @@ -92,6 +117,8 @@ export class AcmsOrders { return acc; }, new Set()); + report.childCaseCount = exportedChildCaseIds.size; + const unimportedChildCaseIds = new Set(); exportedChildCaseIds.forEach((caseId) => { if (!existingChildCaseIds.has(caseId)) { diff --git a/backend/functions/migration/activity/migrateConsolidation.ts b/backend/functions/migration/activity/migrateConsolidation.ts index a58c166f6..ff5077efb 100644 --- a/backend/functions/migration/activity/migrateConsolidation.ts +++ b/backend/functions/migration/activity/migrateConsolidation.ts @@ -2,14 +2,14 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; import { getCamsError } from '../../lib/common-errors/error-utilities'; -import { AcmsConsolidationReport } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsTransformationResult } from '../../lib/use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'IMPORT_ACTION_MIGRATE_CONSOLIDATION'; async function migrateConsolidation( leadCaseId: string, invocationContext: InvocationContext, -): Promise { +): Promise { const logger = ContextCreator.getLogger(invocationContext); const appContext = await ContextCreator.getApplicationContext({ invocationContext, logger }); const controller = new AcmsOrdersController(); diff --git a/backend/functions/migration/activity/migrateConsolidations.test.ts b/backend/functions/migration/activity/migrateConsolidations.test.ts index 80603afe3..e2263fba8 100644 --- a/backend/functions/migration/activity/migrateConsolidations.test.ts +++ b/backend/functions/migration/activity/migrateConsolidations.test.ts @@ -3,6 +3,7 @@ import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders. import module from './migrateConsolidation'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; import { CamsError } from '../../lib/common-errors/cams-error'; +import { AcmsTransformationResult } from '../../lib/use-cases/acms-orders/acms-orders'; describe('getConsolidations test', () => { afterEach(() => { @@ -11,8 +12,9 @@ describe('getConsolidations test', () => { test('should call getLeadCaseIds controller method', async () => { const caseId = '000-11-22222'; - const expected = { + const expected: AcmsTransformationResult = { leadCaseId: caseId, + childCaseCount: 2, success: true, }; const getLeadCaseIdsSpy = jest diff --git a/backend/functions/migration/client/acms-migration-trigger.function.ts b/backend/functions/migration/client/acms-migration-trigger.function.ts index d2ae53079..7a56ad0e7 100644 --- a/backend/functions/migration/client/acms-migration-trigger.function.ts +++ b/backend/functions/migration/client/acms-migration-trigger.function.ts @@ -14,21 +14,22 @@ export default async function httpStart( context: InvocationContext, ): Promise { const client = df.getClient(context); - let body: TriggerRequest; + let params: TriggerRequest; if (request.body) { - body = (await request.json()) as unknown as TriggerRequest; + params = (await request.json()) as unknown as TriggerRequest; } - if (!isTriggerRequest(body)) { + if (!isTriggerRequest(params)) { throw new BadRequestError(MODULE_NAME, { message: 'Missing or malformed request body.' }); } - if (body.apiKey !== process.env.ADMIN_KEY) { + if (params.apiKey !== process.env.ADMIN_KEY) { throw new UnauthorizedError(MODULE_NAME, { message: 'API key was missing or did not match.' }); } + delete params.apiKey; const instanceId: string = await client.startNew(MAIN_ORCHESTRATOR, { - input: body, + input: params, }); return client.createCheckStatusResponse(request, instanceId); diff --git a/backend/functions/migration/orchestration/orchestrator.ts b/backend/functions/migration/orchestration/orchestrator.ts index 53858da2d..65d417a16 100644 --- a/backend/functions/migration/orchestration/orchestrator.ts +++ b/backend/functions/migration/orchestration/orchestrator.ts @@ -1,4 +1,9 @@ -import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { + AcmsAggregate, + AcmsBounds, + AcmsPartitionReport, + AcmsPredicate, +} from '../../lib/use-cases/acms-orders/acms-orders'; import { FLATTEN_BOUNDING_ARRAYS, SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; @@ -18,4 +23,23 @@ export function* main(context: OrchestrationContext) { ); } yield context.df.Task.all(provisioningTasks); + + const summary = provisioningTasks.reduce( + (acc, task) => { + const report = task.result as AcmsPartitionReport; + context.log('Report', JSON.stringify(report)); + acc.successful.leadCaseCount += report.successful.leadCaseCount; + acc.successful.childCaseCount += report.successful.childCaseCount; + acc.failed.leadCaseIds.push(...report.failed.leadCaseIds); + acc.failed.leadCaseCount += report.failed.leadCaseCount; + acc.failed.childCaseCount += report.failed.childCaseCount; + return acc; + }, + { + successful: { leadCaseCount: 0, childCaseCount: 0 }, + failed: { leadCaseIds: [], leadCaseCount: 0, childCaseCount: 0 }, + } as AcmsAggregate, + ); + + context.log('Summary', JSON.stringify(bounds), JSON.stringify(summary)); } diff --git a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts index 1e2879a03..1d1b93669 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts @@ -1,6 +1,7 @@ import { - AcmsConsolidationReport, + AcmsTransformationResult, AcmsPredicateAndPage, + AcmsPageReport, } from '../../lib/use-cases/acms-orders/acms-orders'; import { GET_CONSOLIDATIONS, MIGRATE_CONSOLIDATION } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; @@ -18,19 +19,23 @@ export function* subOrchestratorETL(context: OrchestrationContext) { yield context.df.Task.all(etlTasks); - const finalResults = etlTasks.reduce( + return etlTasks.reduce( (acc, task) => { - const taskResponse = task as AcmsConsolidationReport; - if (taskResponse.success) { - acc.successful += 1; + const transformationResult = task.result as AcmsTransformationResult; + if (transformationResult.success) { + acc.successful.leadCaseCount += 1; + acc.successful.childCaseCount += transformationResult.childCaseCount; } else { - acc.failed += 1; + acc.failed.leadCaseIds.push(transformationResult.leadCaseId); + acc.failed.leadCaseCount += 1; + acc.failed.childCaseCount += transformationResult.childCaseCount; } return acc; }, - { successful: 0, failed: 0 }, - ); - context.log( - `ACMS Consolidation Migration ETL: successful: ${finalResults.successful}, failures: ${finalResults.failed}`, + { + predicateAndPage, + successful: { leadCaseCount: 0, childCaseCount: 0 }, + failed: { leadCaseIds: [], leadCaseCount: 0, childCaseCount: 0 }, + } as AcmsPageReport, ); } diff --git a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts index c0d177f4d..7c780b698 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts @@ -1,22 +1,44 @@ import { OrchestrationContext } from 'durable-functions'; import { GET_PAGE_COUNT, SUB_ORCHESTRATOR_ETL } from '../loadConsolidations'; -import { AcmsPredicate, AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { + AcmsPageReport, + AcmsPredicate, + AcmsPredicateAndPage, + AcmsPartitionReport, +} from '../../lib/use-cases/acms-orders/acms-orders'; export function* subOrchestratorPaging(context: OrchestrationContext) { const predicate: AcmsPredicate = context.df.getInput(); const pageCount: number = yield context.df.callActivity(GET_PAGE_COUNT, predicate); - const provisioningTasks = []; + const pagingTasks = []; for (let pageNumber = 1; pageNumber <= pageCount; pageNumber++) { const predicateAndPage: AcmsPredicateAndPage = { ...predicate, pageNumber, }; const child_id = context.df.instanceId + `:${pageNumber}`; - provisioningTasks.push( + pagingTasks.push( context.df.callSubOrchestrator(SUB_ORCHESTRATOR_ETL, predicateAndPage, child_id), ); } - yield context.df.Task.all(provisioningTasks); + yield context.df.Task.all(pagingTasks); + + return pagingTasks.reduce( + (acc, task) => { + const report = task.result as AcmsPageReport; + acc.successful.leadCaseCount += report.successful.leadCaseCount; + acc.successful.childCaseCount += report.successful.childCaseCount; + acc.failed.leadCaseIds.push(...report.failed.leadCaseIds); + acc.failed.leadCaseCount += report.failed.leadCaseCount; + acc.failed.childCaseCount += report.failed.childCaseCount; + return acc; + }, + { + predicate, + successful: { leadCaseCount: 0, childCaseCount: 0 }, + failed: { leadCaseIds: [], leadCaseCount: 0, childCaseCount: 0 }, + } as AcmsPartitionReport, + ); } From 9ec0b41513f7370335fddb4b706530f6209ba74c Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:43:19 -0500 Subject: [PATCH 064/112] Move lib up to backend directory to isolate az functions Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .../{functions => }/.dependency-cruiser.js | 0 backend/{functions => }/.eslintignore | 0 backend/{functions => }/.eslintrc.json | 0 backend/{functions => }/.gitignore | 0 backend/{functions => }/.prettierrc | 0 .../attorneys/attorneys.function.test.ts | 6 +++--- .../functions/attorneys/attorneys.function.ts | 2 +- .../azure/application-context-creator.test.ts | 12 +++++------ .../azure/application-context-creator.ts | 12 +++++------ backend/functions/azure/functions.test.ts | 4 ++-- backend/functions/azure/functions.ts | 10 +++++----- backend/functions/azure/testing-helpers.ts | 6 +++--- .../case.assignment.function.test.ts | 10 +++++----- .../case.assignment.function.ts | 2 +- .../case-associated.function.test.ts | 4 ++-- .../case-associated.function.ts | 2 +- .../case-docket/case-docket.function.test.ts | 10 +++++----- .../case-docket/case-docket.function.ts | 2 +- .../case-history.function.test.ts | 10 +++++----- .../case-history/case-history.function.ts | 2 +- .../case-summary.function.test.ts | 6 +++--- .../case-summary/case-summary.function.ts | 2 +- .../functions/cases/cases.function.test.ts | 6 +++--- backend/functions/cases/cases.function.ts | 2 +- .../consolidations.function.test.ts | 6 +++--- .../consolidations/consolidations.function.ts | 2 +- .../functions/courts/courts.function.test.ts | 4 ++-- backend/functions/courts/courts.function.ts | 2 +- .../healthcheck/healthcheck.db.cosmos.test.ts | 8 ++++---- .../healthcheck/healthcheck.db.cosmos.ts | 10 +++++----- .../healthcheck/healthcheck.db.sql.ts | 4 ++-- .../healthcheck/healthcheck.function.ts | 6 +++--- .../functions/healthcheck/healthcheck.info.ts | 2 +- .../functions/healthcheck/healthcheck.test.ts | 2 +- .../lib/testing/mock-data/attorneys.mock.ts | 7 ------- backend/functions/me/me.function.test.ts | 4 ++-- backend/functions/me/me.function.ts | 2 +- .../activity/flattenBoundingArrays.test.ts | 2 +- .../activity/flattenBoundingArrays.ts | 2 +- .../activity/getConsolidations.test.ts | 6 +++--- .../migration/activity/getConsolidations.ts | 6 +++--- .../migration/activity/getPageCount.test.ts | 6 +++--- .../migration/activity/getPageCount.ts | 6 +++--- .../activity/migrateConsolidation.ts | 6 +++--- .../activity/migrateConsolidations.test.ts | 6 +++--- .../client/acms-migration-trigger.function.ts | 6 +++--- .../migration/orchestration/orchestrator.ts | 2 +- .../orchestration/sub-orchestrator-etl.ts | 2 +- .../orchestration/sub-orchestrator-paging.ts | 2 +- .../functions/oauth2/mock-oauth2.function.ts | 4 ++-- .../office-staff-sync.function.test.ts | 6 +++--- .../office-staff-sync.function.ts | 2 +- .../offices/offices.function.test.ts | 4 ++-- backend/functions/offices/offices.function.ts | 2 +- .../orders-manual-sync.function.test.ts | 8 ++++---- .../orders-manual-sync.function.ts | 2 +- .../orders-suggestions.function.test.ts | 4 ++-- .../orders-suggestions.function.ts | 2 +- .../orders-sync/orders-sync.function.test.ts | 8 ++++---- .../orders-sync/orders-sync.function.ts | 2 +- .../functions/orders/orders.function.test.ts | 8 ++++---- backend/functions/orders/orders.function.ts | 2 +- backend/{functions => }/jest.config.js | 8 ++++---- .../abstract-mssql-client.exception.test.ts | 0 .../gateways/abstract-mssql-client.test.ts | 0 .../gateways/abstract-mssql-client.ts | 0 .../gateways/acms/acms.gateway.test.ts | 0 .../adapters/gateways/acms/acms.gateway.ts | 0 .../adapters/gateways/cases.local.gateway.ts | 6 +++--- .../gateways/debtor-type-gateway.test.ts | 0 .../adapters/gateways/debtor-type-gateway.ts | 0 .../dxtr/case-docket.dxtr.gateway.test.ts | 0 .../gateways/dxtr/case-docket.dxtr.gateway.ts | 2 +- .../gateways/dxtr/case-docket.mock.gateway.ts | 2 +- .../gateways/dxtr/cases.dxtr.gateway.test.ts | 4 ++-- .../gateways/dxtr/cases.dxtr.gateway.ts | 9 +++------ .../adapters/gateways/dxtr/dxtr.constants.ts | 0 .../gateways/dxtr/dxtr.gateway.helper.test.ts | 0 .../gateways/dxtr/dxtr.gateway.helper.ts | 0 .../dxtr/offices.dxtr.gateway.test.ts | 4 ++-- .../gateways/dxtr/offices.dxtr.gateway.ts | 8 ++------ .../gateways/dxtr/orders.dxtr.gateway.test.ts | 2 +- .../gateways/dxtr/orders.dxtr.gateway.ts | 4 ++-- .../adapters/gateways/gateway-helper.test.ts | 0 .../lib/adapters/gateways/gateway-helper.ts | 6 +++--- .../case-assignment.mongo.repository.test.ts | 2 +- .../mongo/case-assignment.mongo.repository.ts | 2 +- .../mongo/cases.mongo.repository.test.ts | 8 ++++---- .../gateways/mongo/cases.mongo.repository.ts | 4 ++-- .../consolidations.mongo.repository.test.ts | 2 +- .../mongo/consolidations.mongo.repository.ts | 6 +++--- .../mongo/offices.mongo.repository.test.ts | 6 +++--- .../mongo/offices.mongo.repository.ts | 8 ++++---- .../mongo/orders.mongo.repository.test.ts | 4 ++-- .../gateways/mongo/orders.mongo.repository.ts | 8 ++------ .../runtime-state.mongo.repository.test.ts | 0 .../mongo/runtime-state.mongo.repository.ts | 0 ...ser-session-cache.mongo.repository.test.ts | 4 ++-- .../user-session-cache.mongo.repository.ts | 4 ++-- .../mongo/utils/base-mongo-repository.ts | 0 .../mongo/utils/mongo-adapter.test.ts | 0 .../gateways/mongo/utils/mongo-adapter.ts | 0 .../mongo/utils/mongo-query-renderer.test.ts | 0 .../mongo/utils/mongo-query-renderer.ts | 0 .../adapters/gateways/okta/HumbleVerifier.ts | 2 +- .../gateways/okta/okta-gateway.test.ts | 2 +- .../adapters/gateways/okta/okta-gateway.ts | 4 ++-- .../okta/okta-user-group-gateway.test.ts | 2 +- .../gateways/okta/okta-user-group-gateway.ts | 2 +- .../gateways/petition-gateway.test.ts | 0 .../lib/adapters/gateways/petition-gateway.ts | 0 .../storage/local-storage-gateway.test.ts | 2 +- .../gateways/storage/local-storage-gateway.ts | 4 ++-- .../adapters/services/logger.service.test.ts | 0 .../lib/adapters/services/logger.service.ts | 0 .../lib/adapters/types/authorization.ts | 4 ++-- .../lib/adapters/types/basic.d.ts | 2 +- .../lib/adapters/types/cases.d.ts | 0 .../lib/adapters/types/database.d.ts | 0 .../lib/adapters/types/http.d.ts | 0 .../adapters/types/persistence.gateway.d.ts | 2 +- .../lib/adapters/types/region.d.ts | 0 .../lib/adapters/types/storage.ts | 4 ++-- .../adapters/utils/database.exception.test.ts | 2 +- .../lib/adapters/utils/database.test.ts | 2 +- .../lib/adapters/utils/database.ts | 0 .../lib/adapters/utils/date-helper.test.ts | 0 .../lib/adapters/utils/date-helper.ts | 0 .../lib/adapters/utils/feature-flag.test.ts | 0 .../lib/adapters/utils/feature-flag.ts | 2 +- .../lib/adapters/utils/http-response.test.ts | 0 .../lib/adapters/utils/http-response.ts | 4 ++-- .../lib/adapters/utils/string-helper.test.ts | 0 .../lib/adapters/utils/string-helper.ts | 0 .../lib/common-errors/bad-request.ts | 2 +- .../lib/common-errors/cams-error.ts | 2 +- .../lib/common-errors/common-errors.test.ts | 2 +- .../lib/common-errors/error-utilities.test.ts | 2 +- .../lib/common-errors/error-utilities.ts | 0 .../lib/common-errors/forbidden-error.ts | 2 +- .../lib/common-errors/not-found-error.ts | 2 +- .../lib/common-errors/server-config-error.ts | 2 +- .../lib/common-errors/unauthorized-error.ts | 2 +- .../lib/common-errors/unknown-error.ts | 2 +- .../configs/application-configuration.test.ts | 0 .../lib/configs/application-configuration.ts | 0 .../authorization-configuration.test.ts | 0 .../configs/authorization-configuration.ts | 4 ++-- .../user-groups-gateway-configuration.ts | 2 +- .../acms-orders.controller.test.ts | 0 .../acms-orders/acms-orders.controller.ts | 0 .../attorneys/attorneys.controller.test.ts | 2 +- .../attorneys/attorneys.controller.ts | 2 +- .../case.assignment.controller.test.ts | 10 +++++----- .../case.assignment.controller.ts | 8 ++++---- .../case-associated.controller.test.ts | 2 +- .../case-associated.controller.ts | 2 +- .../case-docket.controller.test.ts | 0 .../case-docket/case-docket.controller.ts | 2 +- .../case-history.controller.test.ts | 0 .../case-history/case-history.controller.ts | 2 +- .../case-summary.controller.test.ts | 2 +- .../case-summary/case-summary.controller.ts | 2 +- .../cases/cases.controller.test.ts | 6 +++--- .../lib/controllers/cases/cases.controller.ts | 10 +++++----- .../lib/controllers/controller.ts | 0 .../courts/courts.controller.test.ts | 2 +- .../controllers/courts/courts.controller.ts | 2 +- .../lib/controllers/me/me.controller.ts | 2 +- .../offices/offices.controller.test.ts | 2 +- .../controllers/offices/offices.controller.ts | 4 ++-- .../orders/orders.controller.test.ts | 10 +++++----- .../controllers/orders/orders.controller.ts | 6 +++--- .../lib/deferrable/defer-close.test.ts | 0 .../lib/deferrable/defer-close.ts | 0 .../lib/deferrable/defer-release.test.ts | 0 .../lib/deferrable/defer-release.ts | 0 .../deferrable/finalize-deferrable.test.ts | 0 .../lib/deferrable/finalize-deferrable.ts | 0 backend/{functions => }/lib/factory.test.ts | 0 backend/{functions => }/lib/factory.ts | 0 .../lib/humble-objects/mongo-humble.ts | 0 .../lib/query/query-builder.test.ts | 0 .../lib/query/query-builder.ts | 0 .../acms-dxtr-divisions/compare-divisions.ts | 4 ++-- .../lib/testing/analysis/export-office-csv.ts | 4 ++-- .../test-acms-migration.ts | 4 ++-- .../test-okta-group-api.ts | 2 +- .../local-data/local-cases-repository.ts | 4 ++-- .../local-consolidation-orders-repository.ts | 4 ++-- .../lib/testing/mock-data/attorneys.mock.ts | 7 +++++++ .../mock-data/cams-http-request-helper.ts | 2 +- .../mock-data/case-docket-entries.mock.ts | 2 +- .../testing/mock-data/case-history.mock.ts | 6 +++--- .../testing/mock-data/case-summaries.mock.ts | 2 +- .../lib/testing/mock-data/cases.mock.json | 0 .../mock-data/debtor-attorneys.mock.ts | 2 +- .../lib/testing/mock-data/debtors.mock.ts | 2 +- .../mock-data/generic-test-data.mock.ts | 0 .../lib/testing/mock-data/index.ts | 0 .../{functions => }/lib/testing/mock-fetch.ts | 0 .../mock-gateways/mock-attorneys.gateway.ts | 4 ++-- .../mock-gateways/mock-mongo.repository.ts | 4 ++-- .../mock-gateways/mock-oauth2-gateway.ts | 10 +++++----- .../mock-user-session-use-case.ts | 8 ++++---- .../mock-gateways/mock.offices.gateway.ts | 2 +- .../mock-gateways/mock.offices.repository.ts | 2 +- .../mock-gateways/mock.orders.gateway.ts | 4 ++-- .../lib/testing/testing-constants.ts | 0 .../lib/testing/testing-utilities.ts | 6 +++--- .../use-cases/acms-orders/acms-orders.test.ts | 12 +++++------ .../lib/use-cases/acms-orders/acms-orders.ts | 10 +++++----- .../use-cases/assignment.exception.test.ts | 2 +- .../lib/use-cases/assignment.exception.ts | 2 +- .../use-cases/attorney.gateway.interface.d.ts | 2 +- .../lib/use-cases/attorneys.test.ts | 2 +- .../lib/use-cases/attorneys.ts | 2 +- .../lib/use-cases/case-assignment.test.ts | 8 ++++---- .../lib/use-cases/case-assignment.ts | 10 +++++----- .../case-associated/case-associated.ts | 2 +- .../use-cases/case-docket/case-docket.test.ts | 0 .../lib/use-cases/case-docket/case-docket.ts | 2 +- .../case-history/case-history.test.ts | 0 .../use-cases/case-history/case-history.ts | 2 +- .../lib/use-cases/case-management.test.ts | 16 +++++++-------- .../lib/use-cases/case-management.ts | 12 +++++------ .../lib/use-cases/cases.interface.d.ts | 4 ++-- .../lib/use-cases/courts/courts.test.ts | 4 ++-- .../lib/use-cases/courts/courts.ts | 2 +- .../lib/use-cases/gateways.types.ts | 18 ++++++++--------- .../lib/use-cases/offices/offices.test.ts | 10 +++++----- .../lib/use-cases/offices/offices.ts | 4 ++-- .../lib/use-cases/offices/offices.types.ts | 2 +- .../orders-consolidation-approval.test.ts | 12 +++++------ .../orders/orders-local-gateway.test.ts | 10 +++++----- .../lib/use-cases/orders/orders.test.ts | 20 +++++++++---------- .../lib/use-cases/orders/orders.ts | 18 ++++++++--------- .../user-session/user-session.test.ts | 12 +++++------ .../use-cases/user-session/user-session.ts | 8 ++++---- backend/{functions => }/package-lock.json | 0 backend/{functions => }/package.json | 18 ++++++++--------- backend/{functions => }/tsconfig.build.json | 0 backend/{functions => }/tsconfig.json | 2 +- 243 files changed, 416 insertions(+), 427 deletions(-) rename backend/{functions => }/.dependency-cruiser.js (100%) rename backend/{functions => }/.eslintignore (100%) rename backend/{functions => }/.eslintrc.json (100%) rename backend/{functions => }/.gitignore (100%) rename backend/{functions => }/.prettierrc (100%) delete mode 100644 backend/functions/lib/testing/mock-data/attorneys.mock.ts rename backend/{functions => }/jest.config.js (84%) rename backend/{functions => }/lib/adapters/gateways/abstract-mssql-client.exception.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/abstract-mssql-client.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/abstract-mssql-client.ts (100%) rename backend/{functions => }/lib/adapters/gateways/acms/acms.gateway.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/acms/acms.gateway.ts (100%) rename backend/{functions => }/lib/adapters/gateways/cases.local.gateway.ts (94%) rename backend/{functions => }/lib/adapters/gateways/debtor-type-gateway.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/debtor-type-gateway.ts (100%) rename backend/{functions => }/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts (99%) rename backend/{functions => }/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts (91%) rename backend/{functions => }/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts (99%) rename backend/{functions => }/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts (99%) rename backend/{functions => }/lib/adapters/gateways/dxtr/dxtr.constants.ts (100%) rename backend/{functions => }/lib/adapters/gateways/dxtr/dxtr.gateway.helper.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/dxtr/dxtr.gateway.helper.ts (100%) rename backend/{functions => }/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts (95%) rename backend/{functions => }/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts (95%) rename backend/{functions => }/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts (99%) rename backend/{functions => }/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts (99%) rename backend/{functions => }/lib/adapters/gateways/gateway-helper.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/gateway-helper.ts (86%) rename backend/{functions => }/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts (98%) rename backend/{functions => }/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts (97%) rename backend/{functions => }/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts (95%) rename backend/{functions => }/lib/adapters/gateways/mongo/cases.mongo.repository.ts (96%) rename backend/{functions => }/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts (98%) rename backend/{functions => }/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts (93%) rename backend/{functions => }/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts (93%) rename backend/{functions => }/lib/adapters/gateways/mongo/offices.mongo.repository.ts (90%) rename backend/{functions => }/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts (97%) rename backend/{functions => }/lib/adapters/gateways/mongo/orders.mongo.repository.ts (94%) rename backend/{functions => }/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts (95%) rename backend/{functions => }/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts (95%) rename backend/{functions => }/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/utils/mongo-adapter.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/utils/mongo-adapter.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/utils/mongo-query-renderer.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/mongo/utils/mongo-query-renderer.ts (100%) rename backend/{functions => }/lib/adapters/gateways/okta/HumbleVerifier.ts (94%) rename backend/{functions => }/lib/adapters/gateways/okta/okta-gateway.test.ts (98%) rename backend/{functions => }/lib/adapters/gateways/okta/okta-gateway.ts (95%) rename backend/{functions => }/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts (99%) rename backend/{functions => }/lib/adapters/gateways/okta/okta-user-group-gateway.ts (99%) rename backend/{functions => }/lib/adapters/gateways/petition-gateway.test.ts (100%) rename backend/{functions => }/lib/adapters/gateways/petition-gateway.ts (100%) rename backend/{functions => }/lib/adapters/gateways/storage/local-storage-gateway.test.ts (93%) rename backend/{functions => }/lib/adapters/gateways/storage/local-storage-gateway.ts (96%) rename backend/{functions => }/lib/adapters/services/logger.service.test.ts (100%) rename backend/{functions => }/lib/adapters/services/logger.service.ts (100%) rename backend/{functions => }/lib/adapters/types/authorization.ts (90%) rename backend/{functions => }/lib/adapters/types/basic.d.ts (96%) rename backend/{functions => }/lib/adapters/types/cases.d.ts (100%) rename backend/{functions => }/lib/adapters/types/database.d.ts (100%) rename backend/{functions => }/lib/adapters/types/http.d.ts (100%) rename backend/{functions => }/lib/adapters/types/persistence.gateway.d.ts (95%) rename backend/{functions => }/lib/adapters/types/region.d.ts (100%) rename backend/{functions => }/lib/adapters/types/storage.ts (74%) rename backend/{functions => }/lib/adapters/utils/database.exception.test.ts (98%) rename backend/{functions => }/lib/adapters/utils/database.test.ts (97%) rename backend/{functions => }/lib/adapters/utils/database.ts (100%) rename backend/{functions => }/lib/adapters/utils/date-helper.test.ts (100%) rename backend/{functions => }/lib/adapters/utils/date-helper.ts (100%) rename backend/{functions => }/lib/adapters/utils/feature-flag.test.ts (100%) rename backend/{functions => }/lib/adapters/utils/feature-flag.ts (92%) rename backend/{functions => }/lib/adapters/utils/http-response.test.ts (100%) rename backend/{functions => }/lib/adapters/utils/http-response.ts (82%) rename backend/{functions => }/lib/adapters/utils/string-helper.test.ts (100%) rename backend/{functions => }/lib/adapters/utils/string-helper.ts (100%) rename backend/{functions => }/lib/common-errors/bad-request.ts (84%) rename backend/{functions => }/lib/common-errors/cams-error.ts (90%) rename backend/{functions => }/lib/common-errors/common-errors.test.ts (96%) rename backend/{functions => }/lib/common-errors/error-utilities.test.ts (91%) rename backend/{functions => }/lib/common-errors/error-utilities.ts (100%) rename backend/{functions => }/lib/common-errors/forbidden-error.ts (85%) rename backend/{functions => }/lib/common-errors/not-found-error.ts (88%) rename backend/{functions => }/lib/common-errors/server-config-error.ts (86%) rename backend/{functions => }/lib/common-errors/unauthorized-error.ts (84%) rename backend/{functions => }/lib/common-errors/unknown-error.ts (85%) rename backend/{functions => }/lib/configs/application-configuration.test.ts (100%) rename backend/{functions => }/lib/configs/application-configuration.ts (100%) rename backend/{functions => }/lib/configs/authorization-configuration.test.ts (100%) rename backend/{functions => }/lib/configs/authorization-configuration.ts (89%) rename backend/{functions => }/lib/configs/user-groups-gateway-configuration.ts (90%) rename backend/{functions => }/lib/controllers/acms-orders/acms-orders.controller.test.ts (100%) rename backend/{functions => }/lib/controllers/acms-orders/acms-orders.controller.ts (100%) rename backend/{functions => }/lib/controllers/attorneys/attorneys.controller.test.ts (95%) rename backend/{functions => }/lib/controllers/attorneys/attorneys.controller.ts (94%) rename backend/{functions => }/lib/controllers/case-assignment/case.assignment.controller.test.ts (95%) rename backend/{functions => }/lib/controllers/case-assignment/case.assignment.controller.ts (91%) rename backend/{functions => }/lib/controllers/case-associated/case-associated.controller.test.ts (96%) rename backend/{functions => }/lib/controllers/case-associated/case-associated.controller.ts (93%) rename backend/{functions => }/lib/controllers/case-docket/case-docket.controller.test.ts (100%) rename backend/{functions => }/lib/controllers/case-docket/case-docket.controller.ts (95%) rename backend/{functions => }/lib/controllers/case-history/case-history.controller.test.ts (100%) rename backend/{functions => }/lib/controllers/case-history/case-history.controller.ts (94%) rename backend/{functions => }/lib/controllers/case-summary/case-summary.controller.test.ts (95%) rename backend/{functions => }/lib/controllers/case-summary/case-summary.controller.ts (94%) rename backend/{functions => }/lib/controllers/cases/cases.controller.test.ts (98%) rename backend/{functions => }/lib/controllers/cases/cases.controller.ts (90%) rename backend/{functions => }/lib/controllers/controller.ts (100%) rename backend/{functions => }/lib/controllers/courts/courts.controller.test.ts (96%) rename backend/{functions => }/lib/controllers/courts/courts.controller.ts (93%) rename backend/{functions => }/lib/controllers/me/me.controller.ts (92%) rename backend/{functions => }/lib/controllers/offices/offices.controller.test.ts (98%) rename backend/{functions => }/lib/controllers/offices/offices.controller.ts (92%) rename backend/{functions => }/lib/controllers/orders/orders.controller.test.ts (97%) rename backend/{functions => }/lib/controllers/orders/orders.controller.ts (97%) rename backend/{functions => }/lib/deferrable/defer-close.test.ts (100%) rename backend/{functions => }/lib/deferrable/defer-close.ts (100%) rename backend/{functions => }/lib/deferrable/defer-release.test.ts (100%) rename backend/{functions => }/lib/deferrable/defer-release.ts (100%) rename backend/{functions => }/lib/deferrable/finalize-deferrable.test.ts (100%) rename backend/{functions => }/lib/deferrable/finalize-deferrable.ts (100%) rename backend/{functions => }/lib/factory.test.ts (100%) rename backend/{functions => }/lib/factory.ts (100%) rename backend/{functions => }/lib/humble-objects/mongo-humble.ts (100%) rename backend/{functions => }/lib/query/query-builder.test.ts (100%) rename backend/{functions => }/lib/query/query-builder.ts (100%) rename backend/{functions => }/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts (99%) rename backend/{functions => }/lib/testing/analysis/export-office-csv.ts (91%) rename backend/{functions => }/lib/testing/isolated-integration/test-acms-migration.ts (77%) rename backend/{functions => }/lib/testing/isolated-integration/test-okta-group-api.ts (95%) rename backend/{functions => }/lib/testing/local-data/local-cases-repository.ts (94%) rename backend/{functions => }/lib/testing/local-data/local-consolidation-orders-repository.ts (88%) create mode 100644 backend/lib/testing/mock-data/attorneys.mock.ts rename backend/{functions => }/lib/testing/mock-data/cams-http-request-helper.ts (84%) rename backend/{functions => }/lib/testing/mock-data/case-docket-entries.mock.ts (99%) rename backend/{functions => }/lib/testing/mock-data/case-history.mock.ts (94%) rename backend/{functions => }/lib/testing/mock-data/case-summaries.mock.ts (91%) rename backend/{functions => }/lib/testing/mock-data/cases.mock.json (100%) rename backend/{functions => }/lib/testing/mock-data/debtor-attorneys.mock.ts (97%) rename backend/{functions => }/lib/testing/mock-data/debtors.mock.ts (97%) rename backend/{functions => }/lib/testing/mock-data/generic-test-data.mock.ts (100%) rename backend/{functions => }/lib/testing/mock-data/index.ts (100%) rename backend/{functions => }/lib/testing/mock-fetch.ts (100%) rename backend/{functions => }/lib/testing/mock-gateways/mock-attorneys.gateway.ts (81%) rename backend/{functions => }/lib/testing/mock-gateways/mock-mongo.repository.ts (96%) rename backend/{functions => }/lib/testing/mock-gateways/mock-oauth2-gateway.ts (86%) rename backend/{functions => }/lib/testing/mock-gateways/mock-user-session-use-case.ts (78%) rename backend/{functions => }/lib/testing/mock-gateways/mock.offices.gateway.ts (96%) rename backend/{functions => }/lib/testing/mock-gateways/mock.offices.repository.ts (68%) rename backend/{functions => }/lib/testing/mock-gateways/mock.orders.gateway.ts (76%) rename backend/{functions => }/lib/testing/testing-constants.ts (100%) rename backend/{functions => }/lib/testing/testing-utilities.ts (86%) rename backend/{functions => }/lib/use-cases/acms-orders/acms-orders.test.ts (97%) rename backend/{functions => }/lib/use-cases/acms-orders/acms-orders.ts (95%) rename backend/{functions => }/lib/use-cases/assignment.exception.test.ts (84%) rename backend/{functions => }/lib/use-cases/assignment.exception.ts (84%) rename backend/{functions => }/lib/use-cases/attorney.gateway.interface.d.ts (81%) rename backend/{functions => }/lib/use-cases/attorneys.test.ts (94%) rename backend/{functions => }/lib/use-cases/attorneys.ts (93%) rename backend/{functions => }/lib/use-cases/case-assignment.test.ts (96%) rename backend/{functions => }/lib/use-cases/case-assignment.ts (94%) rename backend/{functions => }/lib/use-cases/case-associated/case-associated.ts (95%) rename backend/{functions => }/lib/use-cases/case-docket/case-docket.test.ts (100%) rename backend/{functions => }/lib/use-cases/case-docket/case-docket.ts (87%) rename backend/{functions => }/lib/use-cases/case-history/case-history.test.ts (100%) rename backend/{functions => }/lib/use-cases/case-history/case-history.ts (85%) rename backend/{functions => }/lib/use-cases/case-management.test.ts (96%) rename backend/{functions => }/lib/use-cases/case-management.ts (92%) rename backend/{functions => }/lib/use-cases/cases.interface.d.ts (76%) rename backend/{functions => }/lib/use-cases/courts/courts.test.ts (87%) rename backend/{functions => }/lib/use-cases/courts/courts.ts (92%) rename backend/{functions => }/lib/use-cases/gateways.types.ts (89%) rename backend/{functions => }/lib/use-cases/offices/offices.test.ts (95%) rename backend/{functions => }/lib/use-cases/offices/offices.ts (97%) rename backend/{functions => }/lib/use-cases/offices/offices.types.ts (77%) rename backend/{functions => }/lib/use-cases/orders/orders-consolidation-approval.test.ts (96%) rename backend/{functions => }/lib/use-cases/orders/orders-local-gateway.test.ts (94%) rename backend/{functions => }/lib/use-cases/orders/orders.test.ts (97%) rename backend/{functions => }/lib/use-cases/orders/orders.ts (96%) rename backend/{functions => }/lib/use-cases/user-session/user-session.test.ts (93%) rename backend/{functions => }/lib/use-cases/user-session/user-session.ts (89%) rename backend/{functions => }/package-lock.json (100%) rename backend/{functions => }/package.json (74%) rename backend/{functions => }/tsconfig.build.json (100%) rename backend/{functions => }/tsconfig.json (81%) diff --git a/backend/functions/.dependency-cruiser.js b/backend/.dependency-cruiser.js similarity index 100% rename from backend/functions/.dependency-cruiser.js rename to backend/.dependency-cruiser.js diff --git a/backend/functions/.eslintignore b/backend/.eslintignore similarity index 100% rename from backend/functions/.eslintignore rename to backend/.eslintignore diff --git a/backend/functions/.eslintrc.json b/backend/.eslintrc.json similarity index 100% rename from backend/functions/.eslintrc.json rename to backend/.eslintrc.json diff --git a/backend/functions/.gitignore b/backend/.gitignore similarity index 100% rename from backend/functions/.gitignore rename to backend/.gitignore diff --git a/backend/functions/.prettierrc b/backend/.prettierrc similarity index 100% rename from backend/functions/.prettierrc rename to backend/.prettierrc diff --git a/backend/functions/attorneys/attorneys.function.test.ts b/backend/functions/attorneys/attorneys.function.test.ts index f0375b9c8..18db41b8e 100644 --- a/backend/functions/attorneys/attorneys.function.test.ts +++ b/backend/functions/attorneys/attorneys.function.test.ts @@ -1,12 +1,12 @@ -import { AttorneysController } from '../lib/controllers/attorneys/attorneys.controller'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { AttorneysController } from '../../lib/controllers/attorneys/attorneys.controller'; +import { CamsError } from '../../lib/common-errors/cams-error'; import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import AttorneyList from '../lib/use-cases/attorneys'; +import AttorneyList from '../../lib/use-cases/attorneys'; import handler from './attorneys.function'; import { InvocationContext } from '@azure/functions'; import { ResponseBody } from '../../../common/src/api/response'; diff --git a/backend/functions/attorneys/attorneys.function.ts b/backend/functions/attorneys/attorneys.function.ts index 802e1aac4..f481f02d3 100644 --- a/backend/functions/attorneys/attorneys.function.ts +++ b/backend/functions/attorneys/attorneys.function.ts @@ -1,6 +1,6 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import { AttorneysController } from '../lib/controllers/attorneys/attorneys.controller'; +import { AttorneysController } from '../../lib/controllers/attorneys/attorneys.controller'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; import ContextCreator from '../azure/application-context-creator'; diff --git a/backend/functions/azure/application-context-creator.test.ts b/backend/functions/azure/application-context-creator.test.ts index 15e76a094..483cea9b1 100644 --- a/backend/functions/azure/application-context-creator.test.ts +++ b/backend/functions/azure/application-context-creator.test.ts @@ -1,13 +1,13 @@ import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { ApplicationContext } from '../lib/adapters/types/basic'; -import * as FeatureFlags from '../lib/adapters/utils/feature-flag'; -import { ApplicationConfiguration } from '../lib/configs/application-configuration'; -import { MockUserSessionUseCase } from '../lib/testing/mock-gateways/mock-user-session-use-case'; -import { createMockApplicationContext } from '../lib/testing/testing-utilities'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import * as FeatureFlags from '../../lib/adapters/utils/feature-flag'; +import { ApplicationConfiguration } from '../../lib/configs/application-configuration'; +import { MockUserSessionUseCase } from '../../lib/testing/mock-gateways/mock-user-session-use-case'; +import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; import ContextCreator from './application-context-creator'; import { createMockAzureFunctionContext, createMockAzureFunctionRequest } from './testing-helpers'; import { azureToCamsHttpRequest } from './functions'; -import { LoggerImpl } from '../lib/adapters/services/logger.service'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; describe('Application Context Creator', () => { describe('applicationContextCreator', () => { diff --git a/backend/functions/azure/application-context-creator.ts b/backend/functions/azure/application-context-creator.ts index adbfdeeb3..861b4374c 100644 --- a/backend/functions/azure/application-context-creator.ts +++ b/backend/functions/azure/application-context-creator.ts @@ -1,12 +1,12 @@ import * as jwt from 'jsonwebtoken'; import { InvocationContext, HttpRequest } from '@azure/functions'; -import { ApplicationContext } from '../lib/adapters/types/basic'; -import { ApplicationConfiguration } from '../lib/configs/application-configuration'; -import { getFeatureFlags } from '../lib/adapters/utils/feature-flag'; -import { LoggerImpl } from '../lib/adapters/services/logger.service'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { ApplicationConfiguration } from '../../lib/configs/application-configuration'; +import { getFeatureFlags } from '../../lib/adapters/utils/feature-flag'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; import { azureToCamsHttpRequest } from './functions'; -import { UnauthorizedError } from '../lib/common-errors/unauthorized-error'; -import { getUserSessionUseCase } from '../lib/factory'; +import { UnauthorizedError } from '../../lib/common-errors/unauthorized-error'; +import { getUserSessionUseCase } from '../../lib/factory'; const MODULE_NAME = 'APPLICATION-CONTEXT-CREATOR'; diff --git a/backend/functions/azure/functions.test.ts b/backend/functions/azure/functions.test.ts index ddfa3cc44..c8c2a1e16 100644 --- a/backend/functions/azure/functions.test.ts +++ b/backend/functions/azure/functions.test.ts @@ -1,7 +1,7 @@ import { azureToCamsHttpRequest, toAzureSuccess } from './functions'; import { HttpRequest, HttpResponseInit } from '@azure/functions'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; -import { CamsHttpResponseInit } from '../lib/adapters/utils/http-response'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CamsHttpResponseInit } from '../../lib/adapters/utils/http-response'; describe('functions test', () => { test('should return properly formatted CamsHttpRequest from malformed headers and query', async () => { diff --git a/backend/functions/azure/functions.ts b/backend/functions/azure/functions.ts index e655342b1..58d7e73df 100644 --- a/backend/functions/azure/functions.ts +++ b/backend/functions/azure/functions.ts @@ -1,9 +1,9 @@ import { HttpRequest, HttpResponseInit } from '@azure/functions'; -import { CamsDict, CamsHttpMethod, CamsHttpRequest } from '../lib/adapters/types/http'; -import { CamsHttpResponseInit, commonHeaders } from '../lib/adapters/utils/http-response'; -import { ApplicationContext } from '../lib/adapters/types/basic'; -import { getCamsError } from '../lib/common-errors/error-utilities'; -import { LoggerImpl } from '../lib/adapters/services/logger.service'; +import { CamsDict, CamsHttpMethod, CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CamsHttpResponseInit, commonHeaders } from '../../lib/adapters/utils/http-response'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { getCamsError } from '../../lib/common-errors/error-utilities'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; function azureToCamsDict(it: Iterable<[string, string]>): CamsDict { if (!it) return {}; diff --git a/backend/functions/azure/testing-helpers.ts b/backend/functions/azure/testing-helpers.ts index 290e4aa80..1b51e1cec 100644 --- a/backend/functions/azure/testing-helpers.ts +++ b/backend/functions/azure/testing-helpers.ts @@ -1,10 +1,10 @@ import { HttpRequest, InvocationContext } from '@azure/functions'; import { randomUUID } from 'node:crypto'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { httpSuccess } from '../lib/adapters/utils/http-response'; +import { httpSuccess } from '../../lib/adapters/utils/http-response'; import { toAzureError, toAzureSuccess } from './functions'; -import { ApplicationContext } from '../lib/adapters/types/basic'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; import { ResponseBody } from '../../../common/src/api/response'; export function createMockAzureFunctionContext( diff --git a/backend/functions/case-assignments/case.assignment.function.test.ts b/backend/functions/case-assignments/case.assignment.function.test.ts index 0b08f5710..2f9d787a8 100644 --- a/backend/functions/case-assignments/case.assignment.function.test.ts +++ b/backend/functions/case-assignments/case.assignment.function.test.ts @@ -1,18 +1,18 @@ import handler from './case.assignment.function'; -import { CaseAssignmentController } from '../lib/controllers/case-assignment/case.assignment.controller'; +import { CaseAssignmentController } from '../../lib/controllers/case-assignment/case.assignment.controller'; import ContextCreator from '../azure/application-context-creator'; import { CaseAssignment } from '../../../common/src/cams/assignments'; import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; import { InvocationContext } from '@azure/functions'; -import { createMockApplicationContext } from '../lib/testing/testing-utilities'; +import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { CamsError } from '../lib/common-errors/cams-error'; -import { UnknownError } from '../lib/common-errors/unknown-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; +import { UnknownError } from '../../lib/common-errors/unknown-error'; import HttpStatusCodes from '../../../common/src/api/http-status-codes'; describe('Case Assignment Function Tests', () => { diff --git a/backend/functions/case-assignments/case.assignment.function.ts b/backend/functions/case-assignments/case.assignment.function.ts index 62f75fce0..7b74817a3 100644 --- a/backend/functions/case-assignments/case.assignment.function.ts +++ b/backend/functions/case-assignments/case.assignment.function.ts @@ -1,5 +1,5 @@ import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; -import { CaseAssignmentController } from '../lib/controllers/case-assignment/case.assignment.controller'; +import { CaseAssignmentController } from '../../lib/controllers/case-assignment/case.assignment.controller'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; diff --git a/backend/functions/case-associated/case-associated.function.test.ts b/backend/functions/case-associated/case-associated.function.test.ts index fa585f15b..ef6990542 100644 --- a/backend/functions/case-associated/case-associated.function.test.ts +++ b/backend/functions/case-associated/case-associated.function.test.ts @@ -1,5 +1,5 @@ -import { NotFoundError } from '../lib/common-errors/not-found-error'; -import { CaseAssociatedController } from '../lib/controllers/case-associated/case-associated.controller'; +import { NotFoundError } from '../../lib/common-errors/not-found-error'; +import { CaseAssociatedController } from '../../lib/controllers/case-associated/case-associated.controller'; import handler from './case-associated.function'; import ContextCreator from '../azure/application-context-creator'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; diff --git a/backend/functions/case-associated/case-associated.function.ts b/backend/functions/case-associated/case-associated.function.ts index ded7a8332..7ea3d55e0 100644 --- a/backend/functions/case-associated/case-associated.function.ts +++ b/backend/functions/case-associated/case-associated.function.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; -import { CaseAssociatedController } from '../lib/controllers/case-associated/case-associated.controller'; +import { CaseAssociatedController } from '../../lib/controllers/case-associated/case-associated.controller'; import { toAzureError, toAzureSuccess } from '../azure/functions'; dotenv.config(); diff --git a/backend/functions/case-docket/case-docket.function.test.ts b/backend/functions/case-docket/case-docket.function.test.ts index 17d8efc66..c4154f65c 100644 --- a/backend/functions/case-docket/case-docket.function.test.ts +++ b/backend/functions/case-docket/case-docket.function.test.ts @@ -1,15 +1,15 @@ import handler from './case-docket.function'; -import { DXTR_CASE_DOCKET_ENTRIES } from '../lib/testing/mock-data/case-docket-entries.mock'; -import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../lib/testing/testing-constants'; +import { DXTR_CASE_DOCKET_ENTRIES } from '../../lib/testing/mock-data/case-docket-entries.mock'; +import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../lib/testing/testing-constants'; import { InvocationContext } from '@azure/functions'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { CaseDocketController } from '../lib/controllers/case-docket/case-docket.controller'; -import { NotFoundError } from '../lib/common-errors/not-found-error'; +import { CaseDocketController } from '../../lib/controllers/case-docket/case-docket.controller'; +import { NotFoundError } from '../../lib/common-errors/not-found-error'; import { CaseDocket } from '../../../common/src/cams/cases'; describe('Case docket function', () => { diff --git a/backend/functions/case-docket/case-docket.function.ts b/backend/functions/case-docket/case-docket.function.ts index 1aad04740..989b001b1 100644 --- a/backend/functions/case-docket/case-docket.function.ts +++ b/backend/functions/case-docket/case-docket.function.ts @@ -1,7 +1,7 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; -import { CaseDocketController } from '../lib/controllers/case-docket/case-docket.controller'; +import { CaseDocketController } from '../../lib/controllers/case-docket/case-docket.controller'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; diff --git a/backend/functions/case-history/case-history.function.test.ts b/backend/functions/case-history/case-history.function.test.ts index 5f4198cdc..39dd2b45a 100644 --- a/backend/functions/case-history/case-history.function.test.ts +++ b/backend/functions/case-history/case-history.function.test.ts @@ -1,12 +1,12 @@ -import { CASE_HISTORY } from '../lib/testing/mock-data/case-history.mock'; -import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../lib/testing/testing-constants'; -import { NotFoundError } from '../lib/common-errors/not-found-error'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; +import { CASE_HISTORY } from '../../lib/testing/mock-data/case-history.mock'; +import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../lib/testing/testing-constants'; +import { NotFoundError } from '../../lib/common-errors/not-found-error'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; import { InvocationContext } from '@azure/functions'; import handler from './case-history.function'; import ContextCreator from '../azure/application-context-creator'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { CaseHistoryController } from '../lib/controllers/case-history/case-history.controller'; +import { CaseHistoryController } from '../../lib/controllers/case-history/case-history.controller'; import { buildTestResponseError, buildTestResponseSuccess, diff --git a/backend/functions/case-history/case-history.function.ts b/backend/functions/case-history/case-history.function.ts index 69ffec218..a4f9d1ca7 100644 --- a/backend/functions/case-history/case-history.function.ts +++ b/backend/functions/case-history/case-history.function.ts @@ -1,7 +1,7 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; -import { CaseHistoryController } from '../lib/controllers/case-history/case-history.controller'; +import { CaseHistoryController } from '../../lib/controllers/case-history/case-history.controller'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; diff --git a/backend/functions/case-summary/case-summary.function.test.ts b/backend/functions/case-summary/case-summary.function.test.ts index 40ee2fda9..82fd95a5a 100644 --- a/backend/functions/case-summary/case-summary.function.test.ts +++ b/backend/functions/case-summary/case-summary.function.test.ts @@ -1,7 +1,7 @@ import { InvocationContext } from '@azure/functions'; import { CaseDetail } from '../../../common/src/cams/cases'; import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { NotFoundError } from '../lib/common-errors/not-found-error'; +import { NotFoundError } from '../../lib/common-errors/not-found-error'; import handler from './case-summary.function'; import ContextCreator from '../azure/application-context-creator'; import { @@ -9,8 +9,8 @@ import { buildTestResponseSuccess, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; -import { CaseSummaryController } from '../lib/controllers/case-summary/case-summary.controller'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CaseSummaryController } from '../../lib/controllers/case-summary/case-summary.controller'; describe('Case summary function', () => { jest diff --git a/backend/functions/case-summary/case-summary.function.ts b/backend/functions/case-summary/case-summary.function.ts index 81204a5f7..44ddbc8ab 100644 --- a/backend/functions/case-summary/case-summary.function.ts +++ b/backend/functions/case-summary/case-summary.function.ts @@ -3,7 +3,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/fu import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { CaseSummaryController } from '../lib/controllers/case-summary/case-summary.controller'; +import { CaseSummaryController } from '../../lib/controllers/case-summary/case-summary.controller'; dotenv.config(); diff --git a/backend/functions/cases/cases.function.test.ts b/backend/functions/cases/cases.function.test.ts index c3cc1db1b..1b45c208d 100644 --- a/backend/functions/cases/cases.function.test.ts +++ b/backend/functions/cases/cases.function.test.ts @@ -1,13 +1,13 @@ import handler from './cases.function'; import { buildTestResponseSuccess, createMockAzureFunctionRequest } from '../azure/testing-helpers'; -import { CasesController } from '../lib/controllers/cases/cases.controller'; +import { CasesController } from '../../lib/controllers/cases/cases.controller'; import ContextCreator from '../azure/application-context-creator'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; import { InvocationContext } from '@azure/functions'; import { ResourceActions } from '../../../common/src/cams/actions'; import { CaseDetail } from '../../../common/src/cams/cases'; -import { commonHeaders } from '../lib/adapters/utils/http-response'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { commonHeaders } from '../../lib/adapters/utils/http-response'; +import { CamsError } from '../../lib/common-errors/cams-error'; describe('Cases function', () => { jest diff --git a/backend/functions/cases/cases.function.ts b/backend/functions/cases/cases.function.ts index aaebe6a91..428f65817 100644 --- a/backend/functions/cases/cases.function.ts +++ b/backend/functions/cases/cases.function.ts @@ -1,6 +1,6 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import { CasesController } from '../lib/controllers/cases/cases.controller'; +import { CasesController } from '../../lib/controllers/cases/cases.controller'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError, toAzureSuccess } from '../azure/functions'; diff --git a/backend/functions/consolidations/consolidations.function.test.ts b/backend/functions/consolidations/consolidations.function.test.ts index 655c7f619..07ad5eaf2 100644 --- a/backend/functions/consolidations/consolidations.function.test.ts +++ b/backend/functions/consolidations/consolidations.function.test.ts @@ -1,6 +1,6 @@ import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; import handler from './consolidations.function'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; import ContextCreator from '../azure/application-context-creator'; import { buildTestResponseError, @@ -8,9 +8,9 @@ import { createMockAzureFunctionContext, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { ConsolidationOrder } from '../../../common/src/cams/orders'; -import { BadRequestError } from '../lib/common-errors/bad-request'; +import { BadRequestError } from '../../lib/common-errors/bad-request'; describe('Consolidations Function tests', () => { const defaultRequestProps: Partial = { diff --git a/backend/functions/consolidations/consolidations.function.ts b/backend/functions/consolidations/consolidations.function.ts index 8850455d8..1b3ee1646 100644 --- a/backend/functions/consolidations/consolidations.function.ts +++ b/backend/functions/consolidations/consolidations.function.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { initializeApplicationInsights } from '../azure/app-insights'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { toAzureError, toAzureSuccess } from '../azure/functions'; dotenv.config(); diff --git a/backend/functions/courts/courts.function.test.ts b/backend/functions/courts/courts.function.test.ts index a45286d01..a46aa03bc 100644 --- a/backend/functions/courts/courts.function.test.ts +++ b/backend/functions/courts/courts.function.test.ts @@ -1,4 +1,4 @@ -import { CamsError } from '../lib/common-errors/cams-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; import handler from './courts.function'; import { buildTestResponseError, @@ -6,7 +6,7 @@ import { createMockAzureFunctionContext, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { CourtsController } from '../lib/controllers/courts/courts.controller'; +import { CourtsController } from '../../lib/controllers/courts/courts.controller'; import { CourtDivisionDetails } from '../../../common/src/cams/courts'; import { COURT_DIVISIONS } from '../../../common/src/cams/test-utilities/courts.mock'; diff --git a/backend/functions/courts/courts.function.ts b/backend/functions/courts/courts.function.ts index a97ad560c..20687d927 100644 --- a/backend/functions/courts/courts.function.ts +++ b/backend/functions/courts/courts.function.ts @@ -1,7 +1,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { CourtsController } from '../lib/controllers/courts/courts.controller'; +import { CourtsController } from '../../lib/controllers/courts/courts.controller'; const MODULE_NAME = 'COURTS_FUNCTION'; diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts b/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts index 1dc90b893..42f74b89c 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts +++ b/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts @@ -1,11 +1,11 @@ import { describe } from 'node:test'; -import { ApplicationContext } from '../lib/adapters/types/basic'; -import { createMockApplicationContext } from '../lib/testing/testing-utilities'; -import { closeDeferred } from '../lib/deferrable/defer-close'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; +import { closeDeferred } from '../../lib/deferrable/defer-close'; import HealthcheckCosmosDb, { HealthCheckDocument } from './healthcheck.db.cosmos'; -import { MongoCollectionAdapter } from '../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; describe('healthcheck db tests', () => { let context: ApplicationContext; diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.ts b/backend/functions/healthcheck/healthcheck.db.cosmos.ts index 3a6344ccd..b4515d81c 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.ts +++ b/backend/functions/healthcheck/healthcheck.db.cosmos.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; -import { ApplicationContext } from '../lib/adapters/types/basic'; -import { DocumentClient } from '../lib/humble-objects/mongo-humble'; -import QueryBuilder from '../lib/query/query-builder'; -import { deferClose } from '../lib/deferrable/defer-close'; -import { MongoCollectionAdapter } from '../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { DocumentClient } from '../../lib/humble-objects/mongo-humble'; +import QueryBuilder from '../../lib/query/query-builder'; +import { deferClose } from '../../lib/deferrable/defer-close'; +import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; dotenv.config(); diff --git a/backend/functions/healthcheck/healthcheck.db.sql.ts b/backend/functions/healthcheck/healthcheck.db.sql.ts index 4cf6f4170..79edcbd36 100644 --- a/backend/functions/healthcheck/healthcheck.db.sql.ts +++ b/backend/functions/healthcheck/healthcheck.db.sql.ts @@ -1,5 +1,5 @@ -import { ApplicationContext } from '../lib/adapters/types/basic'; -import { getSqlConnection } from '../lib/factory'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { getSqlConnection } from '../../lib/factory'; const MODULE_NAME = 'HEALTHCHECK-SQL-DB'; diff --git a/backend/functions/healthcheck/healthcheck.function.ts b/backend/functions/healthcheck/healthcheck.function.ts index d89d84389..388bab50d 100644 --- a/backend/functions/healthcheck/healthcheck.function.ts +++ b/backend/functions/healthcheck/healthcheck.function.ts @@ -1,14 +1,14 @@ import ContextCreator from '../azure/application-context-creator'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; import HealthcheckCosmosDb from './healthcheck.db.cosmos'; import { app, InvocationContext, HttpResponseInit, HttpRequest } from '@azure/functions'; import HealthcheckSqlDb from './healthcheck.db.sql'; import HealthcheckInfo from './healthcheck.info'; import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { httpSuccess } from '../lib/adapters/utils/http-response'; +import { httpSuccess } from '../../lib/adapters/utils/http-response'; import HttpStatusCodes from '../../../common/src/api/http-status-codes'; -import { closeDeferred } from '../lib/deferrable/defer-close'; +import { closeDeferred } from '../../lib/deferrable/defer-close'; const MODULE_NAME = 'HEALTHCHECK'; diff --git a/backend/functions/healthcheck/healthcheck.info.ts b/backend/functions/healthcheck/healthcheck.info.ts index 856ca6842..d67a51fe0 100644 --- a/backend/functions/healthcheck/healthcheck.info.ts +++ b/backend/functions/healthcheck/healthcheck.info.ts @@ -1,5 +1,5 @@ import * as dotenv from 'dotenv'; -import { ApplicationContext } from '../lib/adapters/types/basic'; +import { ApplicationContext } from '../../lib/adapters/types/basic'; dotenv.config(); diff --git a/backend/functions/healthcheck/healthcheck.test.ts b/backend/functions/healthcheck/healthcheck.test.ts index c6a8ecac3..4fb780b2e 100644 --- a/backend/functions/healthcheck/healthcheck.test.ts +++ b/backend/functions/healthcheck/healthcheck.test.ts @@ -1,5 +1,5 @@ import { createMockAzureFunctionRequest } from '../azure/testing-helpers'; -import { MongoCollectionAdapter } from '../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; import { HealthCheckDocument } from './healthcheck.db.cosmos'; import handler, { checkResults } from './healthcheck.function'; diff --git a/backend/functions/lib/testing/mock-data/attorneys.mock.ts b/backend/functions/lib/testing/mock-data/attorneys.mock.ts deleted file mode 100644 index 243bfe501..000000000 --- a/backend/functions/lib/testing/mock-data/attorneys.mock.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { TRIAL_ATTORNEYS } from '../../../../../common/src/cams/test-utilities/attorneys.mock'; - -const list = { - attorneyList: TRIAL_ATTORNEYS, -}; - -export { list }; diff --git a/backend/functions/me/me.function.test.ts b/backend/functions/me/me.function.test.ts index 0ffe1a0a7..ecef356d0 100644 --- a/backend/functions/me/me.function.test.ts +++ b/backend/functions/me/me.function.test.ts @@ -5,11 +5,11 @@ import { } from '../azure/testing-helpers'; import ContextCreator from '../azure/application-context-creator'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { ForbiddenError } from '../lib/common-errors/forbidden-error'; +import { ForbiddenError } from '../../lib/common-errors/forbidden-error'; import handler from '../me/me.function'; import { InvocationContext } from '@azure/functions'; import { CamsSession } from '../../../common/src/cams/session'; -import { createMockApplicationContext } from '../lib/testing/testing-utilities'; +import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; describe('me Function test', () => { const context = new InvocationContext({ diff --git a/backend/functions/me/me.function.ts b/backend/functions/me/me.function.ts index ed5b536e5..36de4c333 100644 --- a/backend/functions/me/me.function.ts +++ b/backend/functions/me/me.function.ts @@ -1,7 +1,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { MeController } from '../lib/controllers/me/me.controller'; +import { MeController } from '../../lib/controllers/me/me.controller'; const MODULE_NAME = 'ME-FUNCTION'; diff --git a/backend/functions/migration/activity/flattenBoundingArrays.test.ts b/backend/functions/migration/activity/flattenBoundingArrays.test.ts index 999bbf991..1defc160e 100644 --- a/backend/functions/migration/activity/flattenBoundingArrays.test.ts +++ b/backend/functions/migration/activity/flattenBoundingArrays.test.ts @@ -1,5 +1,5 @@ import { InvocationContext } from '@azure/functions'; -import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsBounds, AcmsPredicate } from '../../../lib/use-cases/acms-orders/acms-orders'; import module from './flattenBoundingArrays'; describe('Flatten bounding arrays activity', () => { diff --git a/backend/functions/migration/activity/flattenBoundingArrays.ts b/backend/functions/migration/activity/flattenBoundingArrays.ts index 0f7f79f06..510a55369 100644 --- a/backend/functions/migration/activity/flattenBoundingArrays.ts +++ b/backend/functions/migration/activity/flattenBoundingArrays.ts @@ -1,5 +1,5 @@ import { InvocationContext } from '@azure/functions'; -import { AcmsBounds, AcmsPredicate } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsBounds, AcmsPredicate } from '../../../lib/use-cases/acms-orders/acms-orders'; async function flattenBoundingArrays( bounds: AcmsBounds, diff --git a/backend/functions/migration/activity/getConsolidations.test.ts b/backend/functions/migration/activity/getConsolidations.test.ts index f866c48f9..c71eef9ca 100644 --- a/backend/functions/migration/activity/getConsolidations.test.ts +++ b/backend/functions/migration/activity/getConsolidations.test.ts @@ -1,9 +1,9 @@ import { InvocationContext } from '@azure/functions'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; import module from './getConsolidations'; -import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../../lib/use-cases/acms-orders/acms-orders'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import { CamsError } from '../../../lib/common-errors/cams-error'; describe('getConsolidations test', () => { afterEach(() => { diff --git a/backend/functions/migration/activity/getConsolidations.ts b/backend/functions/migration/activity/getConsolidations.ts index a1ae9428f..07cf062e3 100644 --- a/backend/functions/migration/activity/getConsolidations.ts +++ b/backend/functions/migration/activity/getConsolidations.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; -import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { AcmsPredicateAndPage } from '../../../lib/use-cases/acms-orders/acms-orders'; import ContextCreator from '../../azure/application-context-creator'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -import { getCamsError } from '../../lib/common-errors/error-utilities'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT_ACTION_GET_CONSOLIDATIONS'; diff --git a/backend/functions/migration/activity/getPageCount.test.ts b/backend/functions/migration/activity/getPageCount.test.ts index 5ba9d2511..26120948c 100644 --- a/backend/functions/migration/activity/getPageCount.test.ts +++ b/backend/functions/migration/activity/getPageCount.test.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; +import { AcmsPredicateAndPage } from '../../../lib/use-cases/acms-orders/acms-orders'; import module from './getPageCount'; describe('getPageCount test', () => { diff --git a/backend/functions/migration/activity/getPageCount.ts b/backend/functions/migration/activity/getPageCount.ts index b71dc68cd..eb4454f12 100644 --- a/backend/functions/migration/activity/getPageCount.ts +++ b/backend/functions/migration/activity/getPageCount.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; -import { AcmsPredicateAndPage } from '../../lib/use-cases/acms-orders/acms-orders'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -import { getCamsError } from '../../lib/common-errors/error-utilities'; +import { AcmsPredicateAndPage } from '../../../lib/use-cases/acms-orders/acms-orders'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../../lib/common-errors/error-utilities'; const MODULE_NAME = 'IMPORT-ACTION-GET-PAGE-COUNT'; diff --git a/backend/functions/migration/activity/migrateConsolidation.ts b/backend/functions/migration/activity/migrateConsolidation.ts index ff5077efb..b3b943314 100644 --- a/backend/functions/migration/activity/migrateConsolidation.ts +++ b/backend/functions/migration/activity/migrateConsolidation.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; import ContextCreator from '../../azure/application-context-creator'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; -import { getCamsError } from '../../lib/common-errors/error-utilities'; -import { AcmsTransformationResult } from '../../lib/use-cases/acms-orders/acms-orders'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; +import { getCamsError } from '../../../lib/common-errors/error-utilities'; +import { AcmsTransformationResult } from '../../../lib/use-cases/acms-orders/acms-orders'; const MODULE_NAME = 'IMPORT_ACTION_MIGRATE_CONSOLIDATION'; diff --git a/backend/functions/migration/activity/migrateConsolidations.test.ts b/backend/functions/migration/activity/migrateConsolidations.test.ts index e2263fba8..bf135fe0b 100644 --- a/backend/functions/migration/activity/migrateConsolidations.test.ts +++ b/backend/functions/migration/activity/migrateConsolidations.test.ts @@ -1,9 +1,9 @@ import { InvocationContext } from '@azure/functions'; -import AcmsOrdersController from '../../lib/controllers/acms-orders/acms-orders.controller'; +import AcmsOrdersController from '../../../lib/controllers/acms-orders/acms-orders.controller'; import module from './migrateConsolidation'; import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import { AcmsTransformationResult } from '../../lib/use-cases/acms-orders/acms-orders'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import { AcmsTransformationResult } from '../../../lib/use-cases/acms-orders/acms-orders'; describe('getConsolidations test', () => { afterEach(() => { diff --git a/backend/functions/migration/client/acms-migration-trigger.function.ts b/backend/functions/migration/client/acms-migration-trigger.function.ts index 7a56ad0e7..478ac0ce4 100644 --- a/backend/functions/migration/client/acms-migration-trigger.function.ts +++ b/backend/functions/migration/client/acms-migration-trigger.function.ts @@ -1,10 +1,10 @@ import * as df from 'durable-functions'; import { HttpRequest, HttpResponse, InvocationContext } from '@azure/functions'; import { MAIN_ORCHESTRATOR } from '../loadConsolidations'; -import { TriggerRequest } from '../../lib/use-cases/acms-orders/acms-orders'; -import { BadRequestError } from '../../lib/common-errors/bad-request'; +import { TriggerRequest } from '../../../lib/use-cases/acms-orders/acms-orders'; +import { BadRequestError } from '../../../lib/common-errors/bad-request'; import * as dotenv from 'dotenv'; -import { UnauthorizedError } from '../../lib/common-errors/unauthorized-error'; +import { UnauthorizedError } from '../../../lib/common-errors/unauthorized-error'; const MODULE_NAME = 'ACMS_MIGRATION_TRIGGER'; dotenv.config(); diff --git a/backend/functions/migration/orchestration/orchestrator.ts b/backend/functions/migration/orchestration/orchestrator.ts index 65d417a16..09ead0161 100644 --- a/backend/functions/migration/orchestration/orchestrator.ts +++ b/backend/functions/migration/orchestration/orchestrator.ts @@ -3,7 +3,7 @@ import { AcmsBounds, AcmsPartitionReport, AcmsPredicate, -} from '../../lib/use-cases/acms-orders/acms-orders'; +} from '../../../lib/use-cases/acms-orders/acms-orders'; import { FLATTEN_BOUNDING_ARRAYS, SUB_ORCHESTRATOR_PAGING } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; diff --git a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts index 1d1b93669..5c36ce624 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-etl.ts @@ -2,7 +2,7 @@ import { AcmsTransformationResult, AcmsPredicateAndPage, AcmsPageReport, -} from '../../lib/use-cases/acms-orders/acms-orders'; +} from '../../../lib/use-cases/acms-orders/acms-orders'; import { GET_CONSOLIDATIONS, MIGRATE_CONSOLIDATION } from '../loadConsolidations'; import { OrchestrationContext } from 'durable-functions'; diff --git a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts index 7c780b698..75759ab12 100644 --- a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts +++ b/backend/functions/migration/orchestration/sub-orchestrator-paging.ts @@ -5,7 +5,7 @@ import { AcmsPredicate, AcmsPredicateAndPage, AcmsPartitionReport, -} from '../../lib/use-cases/acms-orders/acms-orders'; +} from '../../../lib/use-cases/acms-orders/acms-orders'; export function* subOrchestratorPaging(context: OrchestrationContext) { const predicate: AcmsPredicate = context.df.getInput(); diff --git a/backend/functions/oauth2/mock-oauth2.function.ts b/backend/functions/oauth2/mock-oauth2.function.ts index 31eed04be..bb3b1a4ed 100644 --- a/backend/functions/oauth2/mock-oauth2.function.ts +++ b/backend/functions/oauth2/mock-oauth2.function.ts @@ -1,8 +1,8 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; -import { mockAuthentication } from '../lib/testing/mock-gateways/mock-oauth2-gateway'; +import { mockAuthentication } from '../../lib/testing/mock-gateways/mock-oauth2-gateway'; import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { httpSuccess } from '../lib/adapters/utils/http-response'; +import { httpSuccess } from '../../lib/adapters/utils/http-response'; const MODULE_NAME = 'MOCK-OAUTH2-FUNCTION'; diff --git a/backend/functions/office-staff-sync/office-staff-sync.function.test.ts b/backend/functions/office-staff-sync/office-staff-sync.function.test.ts index 18814cdf0..223021419 100644 --- a/backend/functions/office-staff-sync/office-staff-sync.function.test.ts +++ b/backend/functions/office-staff-sync/office-staff-sync.function.test.ts @@ -1,9 +1,9 @@ -import { LoggerImpl } from '../lib/adapters/services/logger.service'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; +import { CamsError } from '../../lib/common-errors/cams-error'; import timerTrigger from './office-staff-sync.function'; import { Timer } from '@azure/functions'; import { createMockAzureFunctionContext } from '../azure/testing-helpers'; -import { OfficesController } from '../lib/controllers/offices/offices.controller'; +import { OfficesController } from '../../lib/controllers/offices/offices.controller'; describe('Office Staff Sync Function tests', () => { const context = createMockAzureFunctionContext(); diff --git a/backend/functions/office-staff-sync/office-staff-sync.function.ts b/backend/functions/office-staff-sync/office-staff-sync.function.ts index f6e6a17b6..cd91182af 100644 --- a/backend/functions/office-staff-sync/office-staff-sync.function.ts +++ b/backend/functions/office-staff-sync/office-staff-sync.function.ts @@ -3,7 +3,7 @@ import { app, InvocationContext, Timer } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; import { toAzureError } from '../azure/functions'; -import { OfficesController } from '../lib/controllers/offices/offices.controller'; +import { OfficesController } from '../../lib/controllers/offices/offices.controller'; dotenv.config(); diff --git a/backend/functions/offices/offices.function.test.ts b/backend/functions/offices/offices.function.test.ts index 809719c77..c6c611a51 100644 --- a/backend/functions/offices/offices.function.test.ts +++ b/backend/functions/offices/offices.function.test.ts @@ -1,4 +1,4 @@ -import { CamsError } from '../lib/common-errors/cams-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; import ContextCreator from '../azure/application-context-creator'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; import handler from './offices.function'; @@ -8,7 +8,7 @@ import { createMockAzureFunctionContext, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { OfficesController } from '../lib/controllers/offices/offices.controller'; +import { OfficesController } from '../../lib/controllers/offices/offices.controller'; import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../common/src/cams/offices'; describe('offices Function tests', () => { diff --git a/backend/functions/offices/offices.function.ts b/backend/functions/offices/offices.function.ts index 1d5560e16..f644b7547 100644 --- a/backend/functions/offices/offices.function.ts +++ b/backend/functions/offices/offices.function.ts @@ -1,6 +1,6 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; -import { OfficesController } from '../lib/controllers/offices/offices.controller'; +import { OfficesController } from '../../lib/controllers/offices/offices.controller'; import { toAzureError, toAzureSuccess } from '../azure/functions'; const MODULE_NAME = 'OFFICES_FUNCTION'; diff --git a/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts b/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts index 604496ee7..b8fd8d4d6 100644 --- a/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts +++ b/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts @@ -1,7 +1,7 @@ -import { LoggerImpl } from '../lib/adapters/services/logger.service'; -import { CamsError } from '../lib/common-errors/cams-error'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; -import { SyncOrdersStatus } from '../lib/use-cases/orders/orders'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; +import { CamsError } from '../../lib/common-errors/cams-error'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; +import { SyncOrdersStatus } from '../../lib/use-cases/orders/orders'; import handler from './orders-manual-sync.function'; import { buildTestResponseSuccess, createMockAzureFunctionRequest } from '../azure/testing-helpers'; diff --git a/backend/functions/orders-manual-sync/orders-manual-sync.function.ts b/backend/functions/orders-manual-sync/orders-manual-sync.function.ts index d4c88f8e8..7f9d23e11 100644 --- a/backend/functions/orders-manual-sync/orders-manual-sync.function.ts +++ b/backend/functions/orders-manual-sync/orders-manual-sync.function.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { toAzureError, toAzureSuccess } from '../azure/functions'; dotenv.config(); diff --git a/backend/functions/orders-suggestions/orders-suggestions.function.test.ts b/backend/functions/orders-suggestions/orders-suggestions.function.test.ts index 392735266..6a08e96ba 100644 --- a/backend/functions/orders-suggestions/orders-suggestions.function.test.ts +++ b/backend/functions/orders-suggestions/orders-suggestions.function.test.ts @@ -1,11 +1,11 @@ import handler from './orders-suggestions.function'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; import { buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import MockData from '../../../common/src/cams/test-utilities/mock-data'; import { CaseSummary } from '../../../common/src/cams/cases'; import { buildTestResponseError } from '../azure/testing-helpers'; diff --git a/backend/functions/orders-suggestions/orders-suggestions.function.ts b/backend/functions/orders-suggestions/orders-suggestions.function.ts index ba55d0d99..3674a35c6 100644 --- a/backend/functions/orders-suggestions/orders-suggestions.function.ts +++ b/backend/functions/orders-suggestions/orders-suggestions.function.ts @@ -1,7 +1,7 @@ import { InvocationContext, HttpRequest, HttpResponseInit, app } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import * as dotenv from 'dotenv'; import { toAzureError, toAzureSuccess } from '../azure/functions'; diff --git a/backend/functions/orders-sync/orders-sync.function.test.ts b/backend/functions/orders-sync/orders-sync.function.test.ts index cd261fb88..a5a915642 100644 --- a/backend/functions/orders-sync/orders-sync.function.test.ts +++ b/backend/functions/orders-sync/orders-sync.function.test.ts @@ -1,10 +1,10 @@ -import { LoggerImpl } from '../lib/adapters/services/logger.service'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { LoggerImpl } from '../../lib/adapters/services/logger.service'; +import { CamsError } from '../../lib/common-errors/cams-error'; import timerTrigger from './orders-sync.function'; import { Timer } from '@azure/functions'; import { createMockAzureFunctionContext } from '../azure/testing-helpers'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; -import * as factory from '../lib/factory'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; +import * as factory from '../../lib/factory'; describe('Orders Sync Function tests', () => { const context = createMockAzureFunctionContext({ MONGO_CONNECTION_STRING: 'fake' }); diff --git a/backend/functions/orders-sync/orders-sync.function.ts b/backend/functions/orders-sync/orders-sync.function.ts index c25213f31..110ac4088 100644 --- a/backend/functions/orders-sync/orders-sync.function.ts +++ b/backend/functions/orders-sync/orders-sync.function.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, Timer } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { toAzureError } from '../azure/functions'; dotenv.config(); diff --git a/backend/functions/orders/orders.function.test.ts b/backend/functions/orders/orders.function.test.ts index cf925ba4c..774637121 100644 --- a/backend/functions/orders/orders.function.test.ts +++ b/backend/functions/orders/orders.function.test.ts @@ -1,8 +1,8 @@ import handler from './orders.function'; -import { CamsError } from '../lib/common-errors/cams-error'; +import { CamsError } from '../../lib/common-errors/cams-error'; import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { CamsHttpRequest } from '../lib/adapters/types/http'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { Order } from '../../../common/src/cams/orders'; import { buildTestResponseError, @@ -10,7 +10,7 @@ import { createMockAzureFunctionContext, createMockAzureFunctionRequest, } from '../azure/testing-helpers'; -import { commonHeaders } from '../lib/adapters/utils/http-response'; +import { commonHeaders } from '../../lib/adapters/utils/http-response'; import HttpStatusCodes from '../../../common/src/api/http-status-codes'; describe('Orders Function tests', () => { diff --git a/backend/functions/orders/orders.function.ts b/backend/functions/orders/orders.function.ts index 18d1fb842..c6df6ce97 100644 --- a/backend/functions/orders/orders.function.ts +++ b/backend/functions/orders/orders.function.ts @@ -2,7 +2,7 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; import ContextCreator from '../azure/application-context-creator'; import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../lib/controllers/orders/orders.controller'; +import { OrdersController } from '../../lib/controllers/orders/orders.controller'; import { toAzureError, toAzureSuccess } from '../azure/functions'; const MODULE_NAME = 'ORDERS_FUNCTION'; diff --git a/backend/functions/jest.config.js b/backend/jest.config.js similarity index 84% rename from backend/functions/jest.config.js rename to backend/jest.config.js index ff284ec8a..0d00470a7 100644 --- a/backend/functions/jest.config.js +++ b/backend/jest.config.js @@ -16,7 +16,7 @@ module.exports = { '.*test.[jt]s', '.*mock.*.ts', '.*.d.ts', - 'azure/app-insights.ts', + 'functions/azure/app-insights.ts', 'dist/', 'coverage/', 'lib/adapters/gateways/cases.local.gateway.ts', @@ -28,9 +28,9 @@ module.exports = { 'lib/testing/testing-utilities.ts', 'jest.*config.js', 'lib/adapters/gateways/okta/HumbleVerifier.ts', - 'migration/client/', - 'migration/orchestration/', - 'migration/loadConsolidations.ts', + 'functions/migration/client/', + 'functions/migration/orchestration/', + 'functions/migration/loadConsolidations.ts', ], testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)', '!**/?(*.)+(integration).(spec|test).[jt]s?(x)'], }; diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts b/backend/lib/adapters/gateways/abstract-mssql-client.exception.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/abstract-mssql-client.exception.test.ts rename to backend/lib/adapters/gateways/abstract-mssql-client.exception.test.ts diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts b/backend/lib/adapters/gateways/abstract-mssql-client.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/abstract-mssql-client.test.ts rename to backend/lib/adapters/gateways/abstract-mssql-client.test.ts diff --git a/backend/functions/lib/adapters/gateways/abstract-mssql-client.ts b/backend/lib/adapters/gateways/abstract-mssql-client.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/abstract-mssql-client.ts rename to backend/lib/adapters/gateways/abstract-mssql-client.ts diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts b/backend/lib/adapters/gateways/acms/acms.gateway.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/acms/acms.gateway.test.ts rename to backend/lib/adapters/gateways/acms/acms.gateway.test.ts diff --git a/backend/functions/lib/adapters/gateways/acms/acms.gateway.ts b/backend/lib/adapters/gateways/acms/acms.gateway.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/acms/acms.gateway.ts rename to backend/lib/adapters/gateways/acms/acms.gateway.ts diff --git a/backend/functions/lib/adapters/gateways/cases.local.gateway.ts b/backend/lib/adapters/gateways/cases.local.gateway.ts similarity index 94% rename from backend/functions/lib/adapters/gateways/cases.local.gateway.ts rename to backend/lib/adapters/gateways/cases.local.gateway.ts index 6696d2a08..733cacbf4 100644 --- a/backend/functions/lib/adapters/gateways/cases.local.gateway.ts +++ b/backend/lib/adapters/gateways/cases.local.gateway.ts @@ -2,10 +2,10 @@ import { CasesInterface } from '../../use-cases/cases.interface'; import { ApplicationContext } from '../types/basic'; import { GatewayHelper } from './gateway-helper'; import { getMonthDayYearStringFromDate } from '../utils/date-helper'; -import { CaseBasics, CaseDetail } from '../../../../../common/src/cams/cases'; +import { CaseBasics, CaseDetail } from '../../../../common/src/cams/cases'; import { CamsError } from '../../common-errors/cams-error'; -import { CasesSearchPredicate } from '../../../../../common/src/api/search'; -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import { CasesSearchPredicate } from '../../../../common/src/api/search'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; const MODULE_NAME = 'MOCK-CASES-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/debtor-type-gateway.test.ts b/backend/lib/adapters/gateways/debtor-type-gateway.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/debtor-type-gateway.test.ts rename to backend/lib/adapters/gateways/debtor-type-gateway.test.ts diff --git a/backend/functions/lib/adapters/gateways/debtor-type-gateway.ts b/backend/lib/adapters/gateways/debtor-type-gateway.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/debtor-type-gateway.ts rename to backend/lib/adapters/gateways/debtor-type-gateway.ts diff --git a/backend/functions/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.test.ts b/backend/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.test.ts rename to backend/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.test.ts diff --git a/backend/functions/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts b/backend/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts rename to backend/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts index c145b16b2..39b664108 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts +++ b/backend/lib/adapters/gateways/dxtr/case-docket.dxtr.gateway.ts @@ -7,7 +7,7 @@ import { ApplicationContext } from '../../types/basic'; import { CaseDocketGateway } from '../../../use-cases/gateways.types'; import { CamsError } from '../../../common-errors/cams-error'; import { NotFoundError } from '../../../common-errors/not-found-error'; -import { CaseDocket, CaseDocketEntryDocument } from '../../../../../../common/src/cams/cases'; +import { CaseDocket, CaseDocketEntryDocument } from '../../../../../common/src/cams/cases'; const MODULENAME = 'CASE-DOCKET-DXTR-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts b/backend/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts similarity index 91% rename from backend/functions/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts rename to backend/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts index 0a4038154..16dc39931 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts +++ b/backend/lib/adapters/gateways/dxtr/case-docket.mock.gateway.ts @@ -3,7 +3,7 @@ import { ApplicationContext } from '../../types/basic'; import { CaseDocketGateway } from '../../../use-cases/gateways.types'; import { GatewayHelper } from '../gateway-helper'; import { NORMAL_CASE_ID } from '../../../testing/testing-constants'; -import { CaseDocket } from '../../../../../../common/src/cams/cases'; +import { CaseDocket } from '../../../../../common/src/cams/cases'; const MODULE_NAME = 'CASE-DOCKET-MOCK-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts b/backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts rename to backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts index d59f83fab..2b81d97a2 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts +++ b/backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.test.ts @@ -1,13 +1,13 @@ import CasesDxtrGateway, { getCaseIdParts } from './cases.dxtr.gateway'; import * as database from '../../utils/database'; import { QueryResults } from '../../types/database'; -import { CaseDetail } from '../../../../../../common/src/cams/cases'; +import { CaseDetail } from '../../../../../common/src/cams/cases'; import * as featureFlags from '../../utils/feature-flag'; import { CamsError } from '../../../common-errors/cams-error'; import { NotFoundError } from '../../../common-errors/not-found-error'; import { CASE_SUMMARIES } from '../../../testing/mock-data/case-summaries.mock'; import { DEBTORS } from '../../../testing/mock-data/debtors.mock'; -import { MockData } from '../../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; const dxtrDatabaseName = 'some-database-name'; diff --git a/backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts b/backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts rename to backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts index 2b3f528ad..af955e12d 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts +++ b/backend/lib/adapters/gateways/dxtr/cases.dxtr.gateway.ts @@ -12,12 +12,9 @@ import { getDebtorTypeLabel } from '../debtor-type-gateway'; import { getPetitionInfo } from '../petition-gateway'; import { NotFoundError } from '../../../common-errors/not-found-error'; import { CamsError } from '../../../common-errors/cams-error'; -import { - CasesSearchPredicate, - DEFAULT_SEARCH_LIMIT, -} from '../../../../../../common/src/api/search'; -import { CaseBasics, CaseDetail, CaseSummary } from '../../../../../../common/src/cams/cases'; -import { Party, DebtorAttorney } from '../../../../../../common/src/cams/parties'; +import { CasesSearchPredicate, DEFAULT_SEARCH_LIMIT } from '../../../../../common/src/api/search'; +import { CaseBasics, CaseDetail, CaseSummary } from '../../../../../common/src/cams/cases'; +import { Party, DebtorAttorney } from '../../../../../common/src/cams/parties'; const MODULENAME = 'CASES-DXTR-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/dxtr/dxtr.constants.ts b/backend/lib/adapters/gateways/dxtr/dxtr.constants.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/dxtr/dxtr.constants.ts rename to backend/lib/adapters/gateways/dxtr/dxtr.constants.ts diff --git a/backend/functions/lib/adapters/gateways/dxtr/dxtr.gateway.helper.test.ts b/backend/lib/adapters/gateways/dxtr/dxtr.gateway.helper.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/dxtr/dxtr.gateway.helper.test.ts rename to backend/lib/adapters/gateways/dxtr/dxtr.gateway.helper.test.ts diff --git a/backend/functions/lib/adapters/gateways/dxtr/dxtr.gateway.helper.ts b/backend/lib/adapters/gateways/dxtr/dxtr.gateway.helper.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/dxtr/dxtr.gateway.helper.ts rename to backend/lib/adapters/gateways/dxtr/dxtr.gateway.helper.ts diff --git a/backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts b/backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts rename to backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts index dcef5ec4c..0cad274e1 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts +++ b/backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.test.ts @@ -4,8 +4,8 @@ import { ApplicationContext } from '../../types/basic'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; import * as database from '../../utils/database'; import { QueryResults } from '../../types/database'; -import { COURT_DIVISIONS } from '../../../../../../common/src/cams/test-utilities/courts.mock'; -import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../../../../common/src/cams/offices'; +import { COURT_DIVISIONS } from '../../../../../common/src/cams/test-utilities/courts.mock'; +import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../../../common/src/cams/offices'; describe('offices gateway tests', () => { describe('getOffice tests', () => { diff --git a/backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts b/backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts rename to backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts index 0eba548cc..ee47ee3c2 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts +++ b/backend/lib/adapters/gateways/dxtr/offices.dxtr.gateway.ts @@ -4,12 +4,8 @@ import { ApplicationContext } from '../../types/basic'; import { DbTableFieldSpec, QueryResults } from '../../types/database'; import { executeQuery } from '../../utils/database'; import { OfficesGateway } from '../../../use-cases/offices/offices.types'; -import { CamsUserReference } from '../../../../../../common/src/cams/users'; -import { - UstpDivision, - UstpGroup, - UstpOfficeDetails, -} from '../../../../../../common/src/cams/offices'; +import { CamsUserReference } from '../../../../../common/src/cams/users'; +import { UstpDivision, UstpGroup, UstpOfficeDetails } from '../../../../../common/src/cams/offices'; import { buildOfficeCode, getOfficeName } from '../../../use-cases/offices/offices'; const MODULE_NAME = 'OFFICES-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts b/backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts rename to backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts index 0d1d983eb..310e87502 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts +++ b/backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.test.ts @@ -9,7 +9,7 @@ import { dxtrOrdersSorter, } from './orders.dxtr.gateway'; import { ApplicationContext } from '../../types/basic'; -import { MockData } from '../../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; function getEarliestDate(docket: DxtrOrderDocketEntry[]) { return docket.reduce((earliestDate, de) => { diff --git a/backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts b/backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts rename to backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts index aa515f110..b93e798a9 100644 --- a/backend/functions/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts +++ b/backend/lib/adapters/gateways/dxtr/orders.dxtr.gateway.ts @@ -9,9 +9,9 @@ import { RawConsolidationOrder, RawOrderSync, TransferOrder, -} from '../../../../../../common/src/cams/orders'; +} from '../../../../../common/src/cams/orders'; import { DxtrCaseDocketEntryDocument, translateModel } from './case-docket.dxtr.gateway'; -import { CaseDocketEntry } from '../../../../../../common/src/cams/cases'; +import { CaseDocketEntry } from '../../../../../common/src/cams/cases'; const MODULE_NAME = 'ORDERS-DXTR-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/gateway-helper.test.ts b/backend/lib/adapters/gateways/gateway-helper.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/gateway-helper.test.ts rename to backend/lib/adapters/gateways/gateway-helper.test.ts diff --git a/backend/functions/lib/adapters/gateways/gateway-helper.ts b/backend/lib/adapters/gateways/gateway-helper.ts similarity index 86% rename from backend/functions/lib/adapters/gateways/gateway-helper.ts rename to backend/lib/adapters/gateways/gateway-helper.ts index 714bfdd9c..57ece00e0 100644 --- a/backend/functions/lib/adapters/gateways/gateway-helper.ts +++ b/backend/lib/adapters/gateways/gateway-helper.ts @@ -6,9 +6,9 @@ import { DEBTOR_ATTORNEYS } from '../../testing/mock-data/debtor-attorneys.mock' import { DEBTORS } from '../../testing/mock-data/debtors.mock'; import { DXTR_CASE_DOCKET_ENTRIES } from '../../testing/mock-data/case-docket-entries.mock'; import { CASE_HISTORY } from '../../testing/mock-data/case-history.mock'; -import { CaseDetail, CaseDocketEntry } from '../../../../../common/src/cams/cases'; -import { DebtorAttorney, Party } from '../../../../../common/src/cams/parties'; -import { CaseAssignmentHistory } from '../../../../../common/src/cams/history'; +import { CaseDetail, CaseDocketEntry } from '../../../../common/src/cams/cases'; +import { DebtorAttorney, Party } from '../../../../common/src/cams/parties'; +import { CaseAssignmentHistory } from '../../../../common/src/cams/history'; export class GatewayHelper { getAllCasesMockExtract(): CaseDetail[] { diff --git a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts similarity index 98% rename from backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts index 3f8fa0933..0a2561a9e 100644 --- a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.test.ts @@ -1,4 +1,4 @@ -import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; import { getCamsError } from '../../../common-errors/error-utilities'; import { closeDeferred } from '../../../deferrable/defer-close'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; diff --git a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts similarity index 97% rename from backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts index 9a1dd124a..db266b923 100644 --- a/backend/functions/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/case-assignment.mongo.repository.ts @@ -1,5 +1,5 @@ import { ApplicationContext } from '../../types/basic'; -import { CaseAssignment } from '../../../../../../common/src/cams/assignments'; +import { CaseAssignment } from '../../../../../common/src/cams/assignments'; import QueryBuilder from '../../../query/query-builder'; import { CaseAssignmentRepository } from '../../../use-cases/gateways.types'; import { getCamsError } from '../../../common-errors/error-utilities'; diff --git a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts index 0c5170d34..e7723e7c1 100644 --- a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/cases.mongo.repository.test.ts @@ -1,7 +1,7 @@ -import { SYSTEM_USER_REFERENCE } from '../../../../../../common/src/cams/auditable'; -import { TransferFrom, TransferTo } from '../../../../../../common/src/cams/events'; -import { CaseAssignmentHistory } from '../../../../../../common/src/cams/history'; -import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; +import { SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; +import { TransferFrom, TransferTo } from '../../../../../common/src/cams/events'; +import { CaseAssignmentHistory } from '../../../../../common/src/cams/history'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; import { CamsError } from '../../../common-errors/cams-error'; import { closeDeferred } from '../../../deferrable/defer-close'; import { CASE_HISTORY } from '../../../testing/mock-data/case-history.mock'; diff --git a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/cases.mongo.repository.ts similarity index 96% rename from backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/cases.mongo.repository.ts index 40178aa32..598225ea3 100644 --- a/backend/functions/lib/adapters/gateways/mongo/cases.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/cases.mongo.repository.ts @@ -4,9 +4,9 @@ import { Transfer, TransferFrom, TransferTo, -} from '../../../../../../common/src/cams/events'; +} from '../../../../../common/src/cams/events'; import { ApplicationContext } from '../../types/basic'; -import { CaseHistory } from '../../../../../../common/src/cams/history'; +import { CaseHistory } from '../../../../../common/src/cams/history'; import QueryBuilder from '../../../query/query-builder'; import { CasesRepository } from '../../../use-cases/gateways.types'; import { getCamsError } from '../../../common-errors/error-utilities'; diff --git a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts similarity index 98% rename from backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts index 970520db4..af9632d23 100644 --- a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.test.ts @@ -1,6 +1,6 @@ import { ApplicationContext } from '../../types/basic'; import { createMockApplicationContext } from '../../../testing/testing-utilities'; -import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; import ConsolidationOrdersMongoRepository from './consolidations.mongo.repository'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; import QueryBuilder from '../../../query/query-builder'; diff --git a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts similarity index 93% rename from backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts index 62c2e08fe..ca6958ec0 100644 --- a/backend/functions/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/consolidations.mongo.repository.ts @@ -1,10 +1,10 @@ -import { OrdersSearchPredicate } from '../../../../../../common/src/api/search'; -import { ConsolidationOrder } from '../../../../../../common/src/cams/orders'; +import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; +import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; import QueryBuilder, { ConditionOrConjunction } from '../../../query/query-builder'; import { ConsolidationOrdersRepository } from '../../../use-cases/gateways.types'; import { ApplicationContext } from '../../types/basic'; import { getCamsError } from '../../../common-errors/error-utilities'; -import { CamsDocument } from '../../../../../../common/src/cams/document'; +import { CamsDocument } from '../../../../../common/src/cams/document'; import { BaseMongoRepository } from './utils/base-mongo-repository'; const MODULE_NAME: string = 'CONSOLIDATIONS_MONGO_REPOSITORY'; diff --git a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts similarity index 93% rename from backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts index 8ae93dfaf..1b0cf6d79 100644 --- a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/offices.mongo.repository.test.ts @@ -5,11 +5,11 @@ import { } from '../../../testing/testing-utilities'; import { ApplicationContext } from '../../types/basic'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; -import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; import QueryBuilder from '../../../query/query-builder'; -import { CamsRole } from '../../../../../../common/src/cams/roles'; +import { CamsRole } from '../../../../../common/src/cams/roles'; import { closeDeferred } from '../../../deferrable/defer-close'; -import { createAuditRecord } from '../../../../../../common/src/cams/auditable'; +import { createAuditRecord } from '../../../../../common/src/cams/auditable'; import { getCamsError } from '../../../common-errors/error-utilities'; describe('offices repo', () => { diff --git a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/offices.mongo.repository.ts similarity index 90% rename from backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/offices.mongo.repository.ts index 9ee537311..3f9aab637 100644 --- a/backend/functions/lib/adapters/gateways/mongo/offices.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/offices.mongo.repository.ts @@ -1,8 +1,8 @@ import { ApplicationContext } from '../../types/basic'; -import { AttorneyUser, CamsUserReference, Staff } from '../../../../../../common/src/cams/users'; -import { Auditable, createAuditRecord } from '../../../../../../common/src/cams/auditable'; -import { CamsRole } from '../../../../../../common/src/cams/roles'; -import { getCamsUserReference } from '../../../../../../common/src/cams/session'; +import { AttorneyUser, CamsUserReference, Staff } from '../../../../../common/src/cams/users'; +import { Auditable, createAuditRecord } from '../../../../../common/src/cams/auditable'; +import { CamsRole } from '../../../../../common/src/cams/roles'; +import { getCamsUserReference } from '../../../../../common/src/cams/session'; import QueryBuilder from '../../../query/query-builder'; import { getCamsError } from '../../../common-errors/error-utilities'; import { OfficesRepository } from '../../../use-cases/gateways.types'; diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts similarity index 97% rename from backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts index 9a8f947e0..0d8210578 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/orders.mongo.repository.test.ts @@ -1,8 +1,8 @@ import { createMockApplicationContext } from '../../../testing/testing-utilities'; import { OrdersMongoRepository } from './orders.mongo.repository'; import { ApplicationContext } from '../../types/basic'; -import MockData from '../../../../../../common/src/cams/test-utilities/mock-data'; -import { TransferOrderAction } from '../../../../../../common/src/cams/orders'; +import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import { TransferOrderAction } from '../../../../../common/src/cams/orders'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; import QueryBuilder from '../../../query/query-builder'; import { closeDeferred } from '../../../deferrable/defer-close'; diff --git a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/orders.mongo.repository.ts similarity index 94% rename from backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/orders.mongo.repository.ts index 40d308f83..417d502ec 100644 --- a/backend/functions/lib/adapters/gateways/mongo/orders.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/orders.mongo.repository.ts @@ -1,9 +1,5 @@ -import { OrdersSearchPredicate } from '../../../../../../common/src/api/search'; -import { - Order, - TransferOrder, - TransferOrderAction, -} from '../../../../../../common/src/cams/orders'; +import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; +import { Order, TransferOrder, TransferOrderAction } from '../../../../../common/src/cams/orders'; import { ApplicationContext } from '../../types/basic'; import { OrdersRepository } from '../../../use-cases/gateways.types'; import QueryBuilder, { ConditionOrConjunction } from '../../../query/query-builder'; diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/runtime-state.mongo.repository.test.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/runtime-state.mongo.repository.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts b/backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts rename to backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts index de64a44e6..743dfb170 100644 --- a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts +++ b/backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.test.ts @@ -5,8 +5,8 @@ import { CachedCamsSession, UserSessionCacheMongoRepository, } from './user-session-cache.mongo.repository'; -import { MockData } from '../../../../../../common/src/cams/test-utilities/mock-data'; -import { CamsJwtClaims } from '../../../../../../common/src/cams/jwt'; +import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { CamsJwtClaims } from '../../../../../common/src/cams/jwt'; import { MongoCollectionAdapter } from './utils/mongo-adapter'; import { closeDeferred } from '../../../deferrable/defer-close'; import QueryBuilder from '../../../query/query-builder'; diff --git a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts b/backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts rename to backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts index fdba69d2d..ba3deb9ca 100644 --- a/backend/functions/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts +++ b/backend/lib/adapters/gateways/mongo/user-session-cache.mongo.repository.ts @@ -1,8 +1,8 @@ import * as jwt from 'jsonwebtoken'; import { ApplicationContext } from '../../types/basic'; -import { CamsSession } from '../../../../../../common/src/cams/session'; +import { CamsSession } from '../../../../../common/src/cams/session'; import { UnauthorizedError } from '../../../common-errors/unauthorized-error'; -import { CamsJwtClaims } from '../../../../../../common/src/cams/jwt'; +import { CamsJwtClaims } from '../../../../../common/src/cams/jwt'; import { getCamsError } from '../../../common-errors/error-utilities'; import QueryBuilder from '../../../query/query-builder'; import { UserSessionCacheRepository } from '../../../use-cases/gateways.types'; diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts b/backend/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts rename to backend/lib/adapters/gateways/mongo/utils/base-mongo-repository.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/mongo-adapter.test.ts b/backend/lib/adapters/gateways/mongo/utils/mongo-adapter.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/utils/mongo-adapter.test.ts rename to backend/lib/adapters/gateways/mongo/utils/mongo-adapter.test.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/mongo-adapter.ts b/backend/lib/adapters/gateways/mongo/utils/mongo-adapter.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/utils/mongo-adapter.ts rename to backend/lib/adapters/gateways/mongo/utils/mongo-adapter.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/mongo-query-renderer.test.ts b/backend/lib/adapters/gateways/mongo/utils/mongo-query-renderer.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/utils/mongo-query-renderer.test.ts rename to backend/lib/adapters/gateways/mongo/utils/mongo-query-renderer.test.ts diff --git a/backend/functions/lib/adapters/gateways/mongo/utils/mongo-query-renderer.ts b/backend/lib/adapters/gateways/mongo/utils/mongo-query-renderer.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/mongo/utils/mongo-query-renderer.ts rename to backend/lib/adapters/gateways/mongo/utils/mongo-query-renderer.ts diff --git a/backend/functions/lib/adapters/gateways/okta/HumbleVerifier.ts b/backend/lib/adapters/gateways/okta/HumbleVerifier.ts similarity index 94% rename from backend/functions/lib/adapters/gateways/okta/HumbleVerifier.ts rename to backend/lib/adapters/gateways/okta/HumbleVerifier.ts index 71c473e83..d93fc98c1 100644 --- a/backend/functions/lib/adapters/gateways/okta/HumbleVerifier.ts +++ b/backend/lib/adapters/gateways/okta/HumbleVerifier.ts @@ -1,6 +1,6 @@ /* eslint-disable-next-line @typescript-eslint/no-require-imports */ import OktaJwtVerifier = require('@okta/jwt-verifier'); -import { CamsJwt } from '../../../../../../common/src/cams/jwt'; +import { CamsJwt } from '../../../../../common/src/cams/jwt'; type Algorithm = | 'HS256' diff --git a/backend/functions/lib/adapters/gateways/okta/okta-gateway.test.ts b/backend/lib/adapters/gateways/okta/okta-gateway.test.ts similarity index 98% rename from backend/functions/lib/adapters/gateways/okta/okta-gateway.test.ts rename to backend/lib/adapters/gateways/okta/okta-gateway.test.ts index 5254ac71c..7830fb255 100644 --- a/backend/functions/lib/adapters/gateways/okta/okta-gateway.test.ts +++ b/backend/lib/adapters/gateways/okta/okta-gateway.test.ts @@ -2,7 +2,7 @@ import * as Verifier from './HumbleVerifier'; import { UnauthorizedError } from '../../../common-errors/unauthorized-error'; import MockFetch from '../../../testing/mock-fetch'; import OktaGateway from './okta-gateway'; -import { CamsJwtHeader } from '../../../../../../common/src/cams/jwt'; +import { CamsJwtHeader } from '../../../../../common/src/cams/jwt'; import * as AuthorizationConfiguration from '../../../configs/authorization-configuration'; import { AuthorizationConfig } from '../../types/authorization'; diff --git a/backend/functions/lib/adapters/gateways/okta/okta-gateway.ts b/backend/lib/adapters/gateways/okta/okta-gateway.ts similarity index 95% rename from backend/functions/lib/adapters/gateways/okta/okta-gateway.ts rename to backend/lib/adapters/gateways/okta/okta-gateway.ts index 6cd4929b3..d275df5ff 100644 --- a/backend/functions/lib/adapters/gateways/okta/okta-gateway.ts +++ b/backend/lib/adapters/gateways/okta/okta-gateway.ts @@ -3,8 +3,8 @@ import { OpenIdConnectGateway } from '../../types/authorization'; import { ServerConfigError } from '../../../common-errors/server-config-error'; import { UnauthorizedError } from '../../../common-errors/unauthorized-error'; import { verifyAccessToken } from './HumbleVerifier'; -import { CamsUser } from '../../../../../../common/src/cams/users'; -import { CamsJwt } from '../../../../../../common/src/cams/jwt'; +import { CamsUser } from '../../../../../common/src/cams/users'; +import { CamsJwt } from '../../../../../common/src/cams/jwt'; import { isCamsError } from '../../../common-errors/cams-error'; const MODULE_NAME = 'OKTA-GATEWAY'; diff --git a/backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts b/backend/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts rename to backend/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts index 1854486db..7aabb24c7 100644 --- a/backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts +++ b/backend/lib/adapters/gateways/okta/okta-user-group-gateway.test.ts @@ -1,5 +1,5 @@ import { Collection, Group, User } from '@okta/okta-sdk-nodejs'; -import { CamsUserGroup, CamsUserReference } from '../../../../../../common/src/cams/users'; +import { CamsUserGroup, CamsUserReference } from '../../../../../common/src/cams/users'; import { OktaUserGroupGateway } from './okta-user-group-gateway'; import { UnknownError } from '../../../common-errors/unknown-error'; import { UserGroupGatewayConfig } from '../../types/authorization'; diff --git a/backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.ts b/backend/lib/adapters/gateways/okta/okta-user-group-gateway.ts similarity index 99% rename from backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.ts rename to backend/lib/adapters/gateways/okta/okta-user-group-gateway.ts index 27b2416b9..db84fce1b 100644 --- a/backend/functions/lib/adapters/gateways/okta/okta-user-group-gateway.ts +++ b/backend/lib/adapters/gateways/okta/okta-user-group-gateway.ts @@ -3,7 +3,7 @@ import { GroupApiListGroupsRequest, GroupApiListGroupUsersRequest, } from '@okta/okta-sdk-nodejs'; -import { CamsUserGroup, CamsUserReference } from '../../../../../../common/src/cams/users'; +import { CamsUserGroup, CamsUserReference } from '../../../../../common/src/cams/users'; import { UserGroupGateway, UserGroupGatewayConfig } from '../../types/authorization'; import { V2Configuration } from '@okta/okta-sdk-nodejs/src/types/configuration'; import { UnknownError } from '../../../common-errors/unknown-error'; diff --git a/backend/functions/lib/adapters/gateways/petition-gateway.test.ts b/backend/lib/adapters/gateways/petition-gateway.test.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/petition-gateway.test.ts rename to backend/lib/adapters/gateways/petition-gateway.test.ts diff --git a/backend/functions/lib/adapters/gateways/petition-gateway.ts b/backend/lib/adapters/gateways/petition-gateway.ts similarity index 100% rename from backend/functions/lib/adapters/gateways/petition-gateway.ts rename to backend/lib/adapters/gateways/petition-gateway.ts diff --git a/backend/functions/lib/adapters/gateways/storage/local-storage-gateway.test.ts b/backend/lib/adapters/gateways/storage/local-storage-gateway.test.ts similarity index 93% rename from backend/functions/lib/adapters/gateways/storage/local-storage-gateway.test.ts rename to backend/lib/adapters/gateways/storage/local-storage-gateway.test.ts index 2cb4a0d5d..c723fa0e9 100644 --- a/backend/functions/lib/adapters/gateways/storage/local-storage-gateway.test.ts +++ b/backend/lib/adapters/gateways/storage/local-storage-gateway.test.ts @@ -2,7 +2,7 @@ import LocalStorageGateway, { OFFICE_MAPPING_PATH, ROLE_MAPPING_PATH, } from './local-storage-gateway'; -import { CamsRole } from '../../../../../../common/src/cams/roles'; +import { CamsRole } from '../../../../../common/src/cams/roles'; describe('map get', () => { test('should return appropriate string for valid path', () => { diff --git a/backend/functions/lib/adapters/gateways/storage/local-storage-gateway.ts b/backend/lib/adapters/gateways/storage/local-storage-gateway.ts similarity index 96% rename from backend/functions/lib/adapters/gateways/storage/local-storage-gateway.ts rename to backend/lib/adapters/gateways/storage/local-storage-gateway.ts index 038994f52..65e1f0ebf 100644 --- a/backend/functions/lib/adapters/gateways/storage/local-storage-gateway.ts +++ b/backend/lib/adapters/gateways/storage/local-storage-gateway.ts @@ -1,10 +1,10 @@ -import { CamsRole } from '../../../../../../common/src/cams/roles'; +import { CamsRole } from '../../../../../common/src/cams/roles'; import { StorageGateway } from '../../types/storage'; import { USTP_OFFICES_ARRAY, UstpDivisionMeta, UstpOfficeDetails, -} from '../../../../../../common/src/cams/offices'; +} from '../../../../../common/src/cams/offices'; let roleMapping: Map; export const ROLE_MAPPING_PATH = '/rolemapping.csv'; diff --git a/backend/functions/lib/adapters/services/logger.service.test.ts b/backend/lib/adapters/services/logger.service.test.ts similarity index 100% rename from backend/functions/lib/adapters/services/logger.service.test.ts rename to backend/lib/adapters/services/logger.service.test.ts diff --git a/backend/functions/lib/adapters/services/logger.service.ts b/backend/lib/adapters/services/logger.service.ts similarity index 100% rename from backend/functions/lib/adapters/services/logger.service.ts rename to backend/lib/adapters/services/logger.service.ts diff --git a/backend/functions/lib/adapters/types/authorization.ts b/backend/lib/adapters/types/authorization.ts similarity index 90% rename from backend/functions/lib/adapters/types/authorization.ts rename to backend/lib/adapters/types/authorization.ts index 06976d508..8bc125d96 100644 --- a/backend/functions/lib/adapters/types/authorization.ts +++ b/backend/lib/adapters/types/authorization.ts @@ -1,5 +1,5 @@ -import { CamsUser, CamsUserGroup, CamsUserReference } from '../../../../../common/src/cams/users'; -import { CamsJwt } from '../../../../../common/src/cams/jwt'; +import { CamsUser, CamsUserGroup, CamsUserReference } from '../../../../common/src/cams/users'; +import { CamsJwt } from '../../../../common/src/cams/jwt'; import { ApplicationContext } from './basic'; export type AuthorizationConfig = { diff --git a/backend/functions/lib/adapters/types/basic.d.ts b/backend/lib/adapters/types/basic.d.ts similarity index 96% rename from backend/functions/lib/adapters/types/basic.d.ts rename to backend/lib/adapters/types/basic.d.ts index 189afebbc..fa59b19c0 100644 --- a/backend/functions/lib/adapters/types/basic.d.ts +++ b/backend/lib/adapters/types/basic.d.ts @@ -1,6 +1,6 @@ import { ApplicationConfiguration } from '../../configs/application-configuration'; import { CamsError } from '../../common-errors/cams-error'; -import { CamsSession } from '../../../../../common/src/cams/session'; +import { CamsSession } from '../../../../common/src/cams/session'; import { CamsHttpRequest } from './http'; import { Closable } from '../../deferrable/defer-close'; import { Releasable } from '../../use-cases/gateways.types'; diff --git a/backend/functions/lib/adapters/types/cases.d.ts b/backend/lib/adapters/types/cases.d.ts similarity index 100% rename from backend/functions/lib/adapters/types/cases.d.ts rename to backend/lib/adapters/types/cases.d.ts diff --git a/backend/functions/lib/adapters/types/database.d.ts b/backend/lib/adapters/types/database.d.ts similarity index 100% rename from backend/functions/lib/adapters/types/database.d.ts rename to backend/lib/adapters/types/database.d.ts diff --git a/backend/functions/lib/adapters/types/http.d.ts b/backend/lib/adapters/types/http.d.ts similarity index 100% rename from backend/functions/lib/adapters/types/http.d.ts rename to backend/lib/adapters/types/http.d.ts diff --git a/backend/functions/lib/adapters/types/persistence.gateway.d.ts b/backend/lib/adapters/types/persistence.gateway.d.ts similarity index 95% rename from backend/functions/lib/adapters/types/persistence.gateway.d.ts rename to backend/lib/adapters/types/persistence.gateway.d.ts index 15ec70305..c63c9aca4 100644 --- a/backend/functions/lib/adapters/types/persistence.gateway.d.ts +++ b/backend/lib/adapters/types/persistence.gateway.d.ts @@ -1,7 +1,7 @@ import { RecordObj, ObjectKeyVal } from './basic'; import { DbResult } from './database'; import { ApplicationContext } from './basic'; -import { AttorneyUser } from '../../../../../common/src/cams/users'; +import { AttorneyUser } from '../../../../common/src/cams/users'; export interface PersistenceGateway { createRecord( diff --git a/backend/functions/lib/adapters/types/region.d.ts b/backend/lib/adapters/types/region.d.ts similarity index 100% rename from backend/functions/lib/adapters/types/region.d.ts rename to backend/lib/adapters/types/region.d.ts diff --git a/backend/functions/lib/adapters/types/storage.ts b/backend/lib/adapters/types/storage.ts similarity index 74% rename from backend/functions/lib/adapters/types/storage.ts rename to backend/lib/adapters/types/storage.ts index 9636c96b1..9fb1d6bd9 100644 --- a/backend/functions/lib/adapters/types/storage.ts +++ b/backend/lib/adapters/types/storage.ts @@ -1,5 +1,5 @@ -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { UstpDivisionMeta, UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { UstpDivisionMeta, UstpOfficeDetails } from '../../../../common/src/cams/offices'; export type StorageGateway = { get(key: string): string | null; diff --git a/backend/functions/lib/adapters/utils/database.exception.test.ts b/backend/lib/adapters/utils/database.exception.test.ts similarity index 98% rename from backend/functions/lib/adapters/utils/database.exception.test.ts rename to backend/lib/adapters/utils/database.exception.test.ts index 639be3d72..ac89423ad 100644 --- a/backend/functions/lib/adapters/utils/database.exception.test.ts +++ b/backend/lib/adapters/utils/database.exception.test.ts @@ -1,4 +1,4 @@ -import { executeQuery } from '../utils/database'; +import { executeQuery } from './database'; import { QueryResults, IDbConfig } from '../types/database'; import { ConnectionError, MSSQLError, RequestError } from 'mssql'; import { createMockApplicationContext } from '../../testing/testing-utilities'; diff --git a/backend/functions/lib/adapters/utils/database.test.ts b/backend/lib/adapters/utils/database.test.ts similarity index 97% rename from backend/functions/lib/adapters/utils/database.test.ts rename to backend/lib/adapters/utils/database.test.ts index 9ef67ec4d..458fc8439 100644 --- a/backend/functions/lib/adapters/utils/database.test.ts +++ b/backend/lib/adapters/utils/database.test.ts @@ -1,4 +1,4 @@ -import { executeQuery } from '../utils/database'; +import { executeQuery } from './database'; import { QueryResults, IDbConfig } from '../types/database'; import { createMockApplicationContext } from '../../testing/testing-utilities'; diff --git a/backend/functions/lib/adapters/utils/database.ts b/backend/lib/adapters/utils/database.ts similarity index 100% rename from backend/functions/lib/adapters/utils/database.ts rename to backend/lib/adapters/utils/database.ts diff --git a/backend/functions/lib/adapters/utils/date-helper.test.ts b/backend/lib/adapters/utils/date-helper.test.ts similarity index 100% rename from backend/functions/lib/adapters/utils/date-helper.test.ts rename to backend/lib/adapters/utils/date-helper.test.ts diff --git a/backend/functions/lib/adapters/utils/date-helper.ts b/backend/lib/adapters/utils/date-helper.ts similarity index 100% rename from backend/functions/lib/adapters/utils/date-helper.ts rename to backend/lib/adapters/utils/date-helper.ts diff --git a/backend/functions/lib/adapters/utils/feature-flag.test.ts b/backend/lib/adapters/utils/feature-flag.test.ts similarity index 100% rename from backend/functions/lib/adapters/utils/feature-flag.test.ts rename to backend/lib/adapters/utils/feature-flag.test.ts diff --git a/backend/functions/lib/adapters/utils/feature-flag.ts b/backend/lib/adapters/utils/feature-flag.ts similarity index 92% rename from backend/functions/lib/adapters/utils/feature-flag.ts rename to backend/lib/adapters/utils/feature-flag.ts index 05cd60e68..02bedf958 100644 --- a/backend/functions/lib/adapters/utils/feature-flag.ts +++ b/backend/lib/adapters/utils/feature-flag.ts @@ -1,6 +1,6 @@ import * as ld from '@launchdarkly/node-server-sdk'; import { ApplicationConfiguration } from '../../configs/application-configuration'; -import { defaultFeatureFlags } from '../../../../../common/src/feature-flags'; +import { defaultFeatureFlags } from '../../../../common/src/feature-flags'; import { FeatureFlagSet } from '../types/basic'; export async function getFeatureFlags(config: ApplicationConfiguration): Promise { diff --git a/backend/functions/lib/adapters/utils/http-response.test.ts b/backend/lib/adapters/utils/http-response.test.ts similarity index 100% rename from backend/functions/lib/adapters/utils/http-response.test.ts rename to backend/lib/adapters/utils/http-response.test.ts diff --git a/backend/functions/lib/adapters/utils/http-response.ts b/backend/lib/adapters/utils/http-response.ts similarity index 82% rename from backend/functions/lib/adapters/utils/http-response.ts rename to backend/lib/adapters/utils/http-response.ts index 29e0d2462..b7020bc41 100644 --- a/backend/functions/lib/adapters/utils/http-response.ts +++ b/backend/lib/adapters/utils/http-response.ts @@ -1,5 +1,5 @@ -import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; -import { ResponseBody } from '../../../../../common/src/api/response'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import { ResponseBody } from '../../../../common/src/api/response'; export const commonHeaders: Record = { 'Content-Type': 'application/json', diff --git a/backend/functions/lib/adapters/utils/string-helper.test.ts b/backend/lib/adapters/utils/string-helper.test.ts similarity index 100% rename from backend/functions/lib/adapters/utils/string-helper.test.ts rename to backend/lib/adapters/utils/string-helper.test.ts diff --git a/backend/functions/lib/adapters/utils/string-helper.ts b/backend/lib/adapters/utils/string-helper.ts similarity index 100% rename from backend/functions/lib/adapters/utils/string-helper.ts rename to backend/lib/adapters/utils/string-helper.ts diff --git a/backend/functions/lib/common-errors/bad-request.ts b/backend/lib/common-errors/bad-request.ts similarity index 84% rename from backend/functions/lib/common-errors/bad-request.ts rename to backend/lib/common-errors/bad-request.ts index e05fa6db1..549d453e2 100644 --- a/backend/functions/lib/common-errors/bad-request.ts +++ b/backend/lib/common-errors/bad-request.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ interface BadRequestErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/common-errors/cams-error.ts b/backend/lib/common-errors/cams-error.ts similarity index 90% rename from backend/functions/lib/common-errors/cams-error.ts rename to backend/lib/common-errors/cams-error.ts index b8dd9ff37..9685cd13f 100644 --- a/backend/functions/lib/common-errors/cams-error.ts +++ b/backend/lib/common-errors/cams-error.ts @@ -1,4 +1,4 @@ -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; export interface CamsErrorOptions { status?: number; diff --git a/backend/functions/lib/common-errors/common-errors.test.ts b/backend/lib/common-errors/common-errors.test.ts similarity index 96% rename from backend/functions/lib/common-errors/common-errors.test.ts rename to backend/lib/common-errors/common-errors.test.ts index 8e3059459..9afed4487 100644 --- a/backend/functions/lib/common-errors/common-errors.test.ts +++ b/backend/lib/common-errors/common-errors.test.ts @@ -5,7 +5,7 @@ import { NotFoundError } from './not-found-error'; import { ServerConfigError } from './server-config-error'; import { UnauthorizedError } from './unauthorized-error'; import { UnknownError } from './unknown-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; describe('Common errors', () => { const testModuleName = 'Test'; diff --git a/backend/functions/lib/common-errors/error-utilities.test.ts b/backend/lib/common-errors/error-utilities.test.ts similarity index 91% rename from backend/functions/lib/common-errors/error-utilities.test.ts rename to backend/lib/common-errors/error-utilities.test.ts index 03695b9f5..1b68b6972 100644 --- a/backend/functions/lib/common-errors/error-utilities.test.ts +++ b/backend/lib/common-errors/error-utilities.test.ts @@ -1,7 +1,7 @@ import { UnauthorizedError } from './unauthorized-error'; import { getCamsError } from './error-utilities'; import { isCamsError } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; const MODULE_NAME = 'test-module'; describe('error utilities tests', () => { diff --git a/backend/functions/lib/common-errors/error-utilities.ts b/backend/lib/common-errors/error-utilities.ts similarity index 100% rename from backend/functions/lib/common-errors/error-utilities.ts rename to backend/lib/common-errors/error-utilities.ts diff --git a/backend/functions/lib/common-errors/forbidden-error.ts b/backend/lib/common-errors/forbidden-error.ts similarity index 85% rename from backend/functions/lib/common-errors/forbidden-error.ts rename to backend/lib/common-errors/forbidden-error.ts index 2b32e6f41..c8f3f6e91 100644 --- a/backend/functions/lib/common-errors/forbidden-error.ts +++ b/backend/lib/common-errors/forbidden-error.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ interface ForbiddenErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/common-errors/not-found-error.ts b/backend/lib/common-errors/not-found-error.ts similarity index 88% rename from backend/functions/lib/common-errors/not-found-error.ts rename to backend/lib/common-errors/not-found-error.ts index d82f53df5..8d8e6f975 100644 --- a/backend/functions/lib/common-errors/not-found-error.ts +++ b/backend/lib/common-errors/not-found-error.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions, isCamsError } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ interface NotFoundErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/common-errors/server-config-error.ts b/backend/lib/common-errors/server-config-error.ts similarity index 86% rename from backend/functions/lib/common-errors/server-config-error.ts rename to backend/lib/common-errors/server-config-error.ts index d0de0694f..85641b335 100644 --- a/backend/functions/lib/common-errors/server-config-error.ts +++ b/backend/lib/common-errors/server-config-error.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ export interface ServerConfigErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/common-errors/unauthorized-error.ts b/backend/lib/common-errors/unauthorized-error.ts similarity index 84% rename from backend/functions/lib/common-errors/unauthorized-error.ts rename to backend/lib/common-errors/unauthorized-error.ts index 7d0c50d52..bcdb99834 100644 --- a/backend/functions/lib/common-errors/unauthorized-error.ts +++ b/backend/lib/common-errors/unauthorized-error.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ interface UnauthorizedErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/common-errors/unknown-error.ts b/backend/lib/common-errors/unknown-error.ts similarity index 85% rename from backend/functions/lib/common-errors/unknown-error.ts rename to backend/lib/common-errors/unknown-error.ts index fc5c5fd75..49d5c7a9f 100644 --- a/backend/functions/lib/common-errors/unknown-error.ts +++ b/backend/lib/common-errors/unknown-error.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from './cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ interface UnknownErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/configs/application-configuration.test.ts b/backend/lib/configs/application-configuration.test.ts similarity index 100% rename from backend/functions/lib/configs/application-configuration.test.ts rename to backend/lib/configs/application-configuration.test.ts diff --git a/backend/functions/lib/configs/application-configuration.ts b/backend/lib/configs/application-configuration.ts similarity index 100% rename from backend/functions/lib/configs/application-configuration.ts rename to backend/lib/configs/application-configuration.ts diff --git a/backend/functions/lib/configs/authorization-configuration.test.ts b/backend/lib/configs/authorization-configuration.test.ts similarity index 100% rename from backend/functions/lib/configs/authorization-configuration.test.ts rename to backend/lib/configs/authorization-configuration.test.ts diff --git a/backend/functions/lib/configs/authorization-configuration.ts b/backend/lib/configs/authorization-configuration.ts similarity index 89% rename from backend/functions/lib/configs/authorization-configuration.ts rename to backend/lib/configs/authorization-configuration.ts index 82479b985..9e1c31787 100644 --- a/backend/functions/lib/configs/authorization-configuration.ts +++ b/backend/lib/configs/authorization-configuration.ts @@ -1,7 +1,7 @@ import * as dotenv from 'dotenv'; import { AuthorizationConfig } from '../adapters/types/authorization'; -import { EnvLoginConfig } from '../../../../common/src/cams/login'; -import { keyValuesToRecord } from '../../../../common/src/cams/utilities'; +import { EnvLoginConfig } from '../../../common/src/cams/login'; +import { keyValuesToRecord } from '../../../common/src/cams/utilities'; dotenv.config(); diff --git a/backend/functions/lib/configs/user-groups-gateway-configuration.ts b/backend/lib/configs/user-groups-gateway-configuration.ts similarity index 90% rename from backend/functions/lib/configs/user-groups-gateway-configuration.ts rename to backend/lib/configs/user-groups-gateway-configuration.ts index 756ea8ecb..34b6f95df 100644 --- a/backend/functions/lib/configs/user-groups-gateway-configuration.ts +++ b/backend/lib/configs/user-groups-gateway-configuration.ts @@ -1,6 +1,6 @@ import * as dotenv from 'dotenv'; import { UserGroupGatewayConfig } from '../adapters/types/authorization'; -import { keyValuesToRecord } from '../../../../common/src/cams/utilities'; +import { keyValuesToRecord } from '../../../common/src/cams/utilities'; dotenv.config(); diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts b/backend/lib/controllers/acms-orders/acms-orders.controller.test.ts similarity index 100% rename from backend/functions/lib/controllers/acms-orders/acms-orders.controller.test.ts rename to backend/lib/controllers/acms-orders/acms-orders.controller.test.ts diff --git a/backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts b/backend/lib/controllers/acms-orders/acms-orders.controller.ts similarity index 100% rename from backend/functions/lib/controllers/acms-orders/acms-orders.controller.ts rename to backend/lib/controllers/acms-orders/acms-orders.controller.ts diff --git a/backend/functions/lib/controllers/attorneys/attorneys.controller.test.ts b/backend/lib/controllers/attorneys/attorneys.controller.test.ts similarity index 95% rename from backend/functions/lib/controllers/attorneys/attorneys.controller.test.ts rename to backend/lib/controllers/attorneys/attorneys.controller.test.ts index 0638c1537..e49bbaaf2 100644 --- a/backend/functions/lib/controllers/attorneys/attorneys.controller.test.ts +++ b/backend/lib/controllers/attorneys/attorneys.controller.test.ts @@ -1,4 +1,4 @@ -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import { createMockApplicationContext } from '../../testing/testing-utilities'; import AttorneysList from '../../use-cases/attorneys'; import { NotFoundError } from '../../common-errors/not-found-error'; diff --git a/backend/functions/lib/controllers/attorneys/attorneys.controller.ts b/backend/lib/controllers/attorneys/attorneys.controller.ts similarity index 94% rename from backend/functions/lib/controllers/attorneys/attorneys.controller.ts rename to backend/lib/controllers/attorneys/attorneys.controller.ts index 0848b5505..f9166a78e 100644 --- a/backend/functions/lib/controllers/attorneys/attorneys.controller.ts +++ b/backend/lib/controllers/attorneys/attorneys.controller.ts @@ -1,6 +1,6 @@ import { ApplicationContext } from '../../adapters/types/basic'; import AttorneysList from '../../use-cases/attorneys'; -import { AttorneyUser } from '../../../../../common/src/cams/users'; +import { AttorneyUser } from '../../../../common/src/cams/users'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; diff --git a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.test.ts b/backend/lib/controllers/case-assignment/case.assignment.controller.test.ts similarity index 95% rename from backend/functions/lib/controllers/case-assignment/case.assignment.controller.test.ts rename to backend/lib/controllers/case-assignment/case.assignment.controller.test.ts index d38f6c919..d7c336901 100644 --- a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.test.ts +++ b/backend/lib/controllers/case-assignment/case.assignment.controller.test.ts @@ -3,7 +3,7 @@ import { THROW_PERMISSIONS_ERROR_CASE_ID, THROW_UNKNOWN_ERROR_CASE_ID, } from '../../testing/testing-constants'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { CaseAssignmentUseCase } from '../../use-cases/case-assignment'; import { CamsError } from '../../common-errors/cams-error'; import { ForbiddenError } from '../../common-errors/forbidden-error'; @@ -11,13 +11,13 @@ import { createMockApplicationContext, createMockApplicationContextSession, } from '../../testing/testing-utilities'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { CamsUserReference } from '../../../../../common/src/cams/users'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsUserReference } from '../../../../common/src/cams/users'; import { UnknownError } from '../../common-errors/unknown-error'; -import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; import { httpSuccess } from '../../adapters/utils/http-response'; import { mockCamsHttpRequest } from '../../testing/mock-data/cams-http-request-helper'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; import { ApplicationContext } from '../../adapters/types/basic'; const Jane = MockData.getCamsUserReference({ name: 'Jane' }); diff --git a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts b/backend/lib/controllers/case-assignment/case.assignment.controller.ts similarity index 91% rename from backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts rename to backend/lib/controllers/case-assignment/case.assignment.controller.ts index e6786eb85..4b21b2292 100644 --- a/backend/functions/lib/controllers/case-assignment/case.assignment.controller.ts +++ b/backend/lib/controllers/case-assignment/case.assignment.controller.ts @@ -1,11 +1,11 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { CaseAssignmentUseCase } from '../../use-cases/case-assignment'; import { AssignmentError } from '../../use-cases/assignment.exception'; -import { CaseAssignment } from '../../../../../common/src/cams/assignments'; -import { CamsUserReference } from '../../../../../common/src/cams/users'; -import { CamsRole } from '../../../../../common/src/cams/roles'; +import { CaseAssignment } from '../../../../common/src/cams/assignments'; +import { CamsUserReference } from '../../../../common/src/cams/users'; +import { CamsRole } from '../../../../common/src/cams/roles'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; -import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; import { CamsController } from '../controller'; import { getCamsError } from '../../common-errors/error-utilities'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts b/backend/lib/controllers/case-associated/case-associated.controller.test.ts similarity index 96% rename from backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts rename to backend/lib/controllers/case-associated/case-associated.controller.test.ts index 7aa89b780..e9c75280e 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.test.ts +++ b/backend/lib/controllers/case-associated/case-associated.controller.test.ts @@ -7,7 +7,7 @@ import { } from '../../testing/testing-constants'; import { NotFoundError } from '../../common-errors/not-found-error'; import { CaseAssociatedUseCase } from '../../use-cases/case-associated/case-associated'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; describe('Test case-history controller', () => { let applicationContext; diff --git a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts b/backend/lib/controllers/case-associated/case-associated.controller.ts similarity index 93% rename from backend/functions/lib/controllers/case-associated/case-associated.controller.ts rename to backend/lib/controllers/case-associated/case-associated.controller.ts index b9f69784d..1eb6a598f 100644 --- a/backend/functions/lib/controllers/case-associated/case-associated.controller.ts +++ b/backend/lib/controllers/case-associated/case-associated.controller.ts @@ -1,7 +1,7 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { isCamsError } from '../../common-errors/cams-error'; import { UnknownError } from '../../common-errors/unknown-error'; -import { EventCaseReference } from '../../../../../common/src/cams/events'; +import { EventCaseReference } from '../../../../common/src/cams/events'; import { CaseAssociatedUseCase } from '../../use-cases/case-associated/case-associated'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/controllers/case-docket/case-docket.controller.test.ts b/backend/lib/controllers/case-docket/case-docket.controller.test.ts similarity index 100% rename from backend/functions/lib/controllers/case-docket/case-docket.controller.test.ts rename to backend/lib/controllers/case-docket/case-docket.controller.test.ts diff --git a/backend/functions/lib/controllers/case-docket/case-docket.controller.ts b/backend/lib/controllers/case-docket/case-docket.controller.ts similarity index 95% rename from backend/functions/lib/controllers/case-docket/case-docket.controller.ts rename to backend/lib/controllers/case-docket/case-docket.controller.ts index 68bd9f1ab..5b82875f4 100644 --- a/backend/functions/lib/controllers/case-docket/case-docket.controller.ts +++ b/backend/lib/controllers/case-docket/case-docket.controller.ts @@ -4,7 +4,7 @@ import { getCaseDocketUseCase } from '../../factory'; import { isCamsError } from '../../common-errors/cams-error'; import { UnknownError } from '../../common-errors/unknown-error'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; -import { CaseDocket } from '../../../../../common/src/cams/cases'; +import { CaseDocket } from '../../../../common/src/cams/cases'; import { CamsController } from '../controller'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/controllers/case-history/case-history.controller.test.ts b/backend/lib/controllers/case-history/case-history.controller.test.ts similarity index 100% rename from backend/functions/lib/controllers/case-history/case-history.controller.test.ts rename to backend/lib/controllers/case-history/case-history.controller.test.ts diff --git a/backend/functions/lib/controllers/case-history/case-history.controller.ts b/backend/lib/controllers/case-history/case-history.controller.ts similarity index 94% rename from backend/functions/lib/controllers/case-history/case-history.controller.ts rename to backend/lib/controllers/case-history/case-history.controller.ts index dcef99465..0b30f9791 100644 --- a/backend/functions/lib/controllers/case-history/case-history.controller.ts +++ b/backend/lib/controllers/case-history/case-history.controller.ts @@ -1,6 +1,6 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { CaseHistoryUseCase } from '../../use-cases/case-history/case-history'; -import { CaseHistory } from '../../../../../common/src/cams/history'; +import { CaseHistory } from '../../../../common/src/cams/history'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; diff --git a/backend/functions/lib/controllers/case-summary/case-summary.controller.test.ts b/backend/lib/controllers/case-summary/case-summary.controller.test.ts similarity index 95% rename from backend/functions/lib/controllers/case-summary/case-summary.controller.test.ts rename to backend/lib/controllers/case-summary/case-summary.controller.test.ts index c7f1a3815..60245d9ba 100644 --- a/backend/functions/lib/controllers/case-summary/case-summary.controller.test.ts +++ b/backend/lib/controllers/case-summary/case-summary.controller.test.ts @@ -1,7 +1,7 @@ import { createMockApplicationContext } from '../../testing/testing-utilities'; import CaseManagement from '../../use-cases/case-management'; import { NotFoundError } from '../../common-errors/not-found-error'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { CaseSummaryController } from './case-summary.controller'; describe('Test case-summary controller', () => { diff --git a/backend/functions/lib/controllers/case-summary/case-summary.controller.ts b/backend/lib/controllers/case-summary/case-summary.controller.ts similarity index 94% rename from backend/functions/lib/controllers/case-summary/case-summary.controller.ts rename to backend/lib/controllers/case-summary/case-summary.controller.ts index 6aaa42e26..b7ec5e17a 100644 --- a/backend/functions/lib/controllers/case-summary/case-summary.controller.ts +++ b/backend/lib/controllers/case-summary/case-summary.controller.ts @@ -1,5 +1,5 @@ import { ApplicationContext } from '../../adapters/types/basic'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; +import { CaseSummary } from '../../../../common/src/cams/cases'; import CaseManagement from '../../use-cases/case-management'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; diff --git a/backend/functions/lib/controllers/cases/cases.controller.test.ts b/backend/lib/controllers/cases/cases.controller.test.ts similarity index 98% rename from backend/functions/lib/controllers/cases/cases.controller.test.ts rename to backend/lib/controllers/cases/cases.controller.test.ts index edef2a3ee..861db7df9 100644 --- a/backend/functions/lib/controllers/cases/cases.controller.test.ts +++ b/backend/lib/controllers/cases/cases.controller.test.ts @@ -1,15 +1,15 @@ -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { ApplicationContext } from '../../adapters/types/basic'; import { CamsHttpResponseInit } from '../../adapters/utils/http-response'; import CaseManagement from '../../use-cases/case-management'; import { CasesController } from './cases.controller'; -import { CaseBasics, CaseDetail } from '../../../../../common/src/cams/cases'; +import { CaseBasics, CaseDetail } from '../../../../common/src/cams/cases'; import { mockCamsHttpRequest, mockRequestUrl, } from '../../testing/mock-data/cams-http-request-helper'; import { createMockApplicationContext } from '../../testing/testing-utilities'; -import { ResourceActions } from '../../../../../common/src/cams/actions'; +import { ResourceActions } from '../../../../common/src/cams/actions'; import { CamsError } from '../../common-errors/cams-error'; describe('cases controller test', () => { diff --git a/backend/functions/lib/controllers/cases/cases.controller.ts b/backend/lib/controllers/cases/cases.controller.ts similarity index 90% rename from backend/functions/lib/controllers/cases/cases.controller.ts rename to backend/lib/controllers/cases/cases.controller.ts index 0fc46b73b..65682d2d5 100644 --- a/backend/functions/lib/controllers/cases/cases.controller.ts +++ b/backend/lib/controllers/cases/cases.controller.ts @@ -1,12 +1,12 @@ import { ApplicationContext } from '../../adapters/types/basic'; import CaseManagement from '../../use-cases/case-management'; -import { ResponseBody } from '../../../../../common/src/api/response'; -import { CaseBasics, CaseDetail } from '../../../../../common/src/cams/cases'; -import { CasesSearchPredicate } from '../../../../../common/src/api/search'; +import { ResponseBody } from '../../../../common/src/api/response'; +import { CaseBasics, CaseDetail } from '../../../../common/src/cams/cases'; +import { CasesSearchPredicate } from '../../../../common/src/api/search'; import { CamsHttpRequest } from '../../adapters/types/http'; -import { Pagination } from '../../../../../common/src/api/pagination'; +import { Pagination } from '../../../../common/src/api/pagination'; import { httpSuccess } from '../../adapters/utils/http-response'; -import { ResourceActions } from '../../../../../common/src/cams/actions'; +import { ResourceActions } from '../../../../common/src/cams/actions'; import { CamsController } from '../controller'; import { getCamsError } from '../../common-errors/error-utilities'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/controllers/controller.ts b/backend/lib/controllers/controller.ts similarity index 100% rename from backend/functions/lib/controllers/controller.ts rename to backend/lib/controllers/controller.ts diff --git a/backend/functions/lib/controllers/courts/courts.controller.test.ts b/backend/lib/controllers/courts/courts.controller.test.ts similarity index 96% rename from backend/functions/lib/controllers/courts/courts.controller.test.ts rename to backend/lib/controllers/courts/courts.controller.test.ts index 6f25ab025..150980508 100644 --- a/backend/functions/lib/controllers/courts/courts.controller.test.ts +++ b/backend/lib/controllers/courts/courts.controller.test.ts @@ -1,6 +1,6 @@ import { createMockApplicationContext } from '../../testing/testing-utilities'; import { ApplicationContext } from '../../adapters/types/basic'; -import { COURT_DIVISIONS } from '../../../../../common/src/cams/test-utilities/courts.mock'; +import { COURT_DIVISIONS } from '../../../../common/src/cams/test-utilities/courts.mock'; import { CamsError } from '../../common-errors/cams-error'; import { mockCamsHttpRequest } from '../../testing/mock-data/cams-http-request-helper'; import { CourtsController } from './courts.controller'; diff --git a/backend/functions/lib/controllers/courts/courts.controller.ts b/backend/lib/controllers/courts/courts.controller.ts similarity index 93% rename from backend/functions/lib/controllers/courts/courts.controller.ts rename to backend/lib/controllers/courts/courts.controller.ts index 98bee2796..d36af65c4 100644 --- a/backend/functions/lib/controllers/courts/courts.controller.ts +++ b/backend/lib/controllers/courts/courts.controller.ts @@ -3,7 +3,7 @@ import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-res import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController } from '../controller'; import { CourtsUseCase } from '../../use-cases/courts/courts'; -import { CourtDivisionDetails } from '../../../../../common/src/cams/courts'; +import { CourtDivisionDetails } from '../../../../common/src/cams/courts'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; const MODULE_NAME = 'COURTS-CONTROLLER'; diff --git a/backend/functions/lib/controllers/me/me.controller.ts b/backend/lib/controllers/me/me.controller.ts similarity index 92% rename from backend/functions/lib/controllers/me/me.controller.ts rename to backend/lib/controllers/me/me.controller.ts index f03976155..e50ad2547 100644 --- a/backend/functions/lib/controllers/me/me.controller.ts +++ b/backend/lib/controllers/me/me.controller.ts @@ -1,4 +1,4 @@ -import { CamsSession } from '../../../../../common/src/cams/session'; +import { CamsSession } from '../../../../common/src/cams/session'; import { ApplicationContext } from '../../adapters/types/basic'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; diff --git a/backend/functions/lib/controllers/offices/offices.controller.test.ts b/backend/lib/controllers/offices/offices.controller.test.ts similarity index 98% rename from backend/functions/lib/controllers/offices/offices.controller.test.ts rename to backend/lib/controllers/offices/offices.controller.test.ts index 25f75b77a..089b6a71b 100644 --- a/backend/functions/lib/controllers/offices/offices.controller.test.ts +++ b/backend/lib/controllers/offices/offices.controller.test.ts @@ -1,7 +1,7 @@ import { createMockApplicationContext } from '../../testing/testing-utilities'; import { ApplicationContext } from '../../adapters/types/basic'; import { OfficesController } from './offices.controller'; -import { COURT_DIVISIONS } from '../../../../../common/src/cams/test-utilities/courts.mock'; +import { COURT_DIVISIONS } from '../../../../common/src/cams/test-utilities/courts.mock'; import { CamsError } from '../../common-errors/cams-error'; import { mockCamsHttpRequest } from '../../testing/mock-data/cams-http-request-helper'; import { UnknownError } from '../../common-errors/unknown-error'; diff --git a/backend/functions/lib/controllers/offices/offices.controller.ts b/backend/lib/controllers/offices/offices.controller.ts similarity index 92% rename from backend/functions/lib/controllers/offices/offices.controller.ts rename to backend/lib/controllers/offices/offices.controller.ts index b151ea0c2..bfbf95dc1 100644 --- a/backend/functions/lib/controllers/offices/offices.controller.ts +++ b/backend/lib/controllers/offices/offices.controller.ts @@ -1,10 +1,10 @@ import { OfficesUseCase } from '../../use-cases/offices/offices'; import { ApplicationContext } from '../../adapters/types/basic'; -import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; import { CamsController, CamsTimerController } from '../controller'; -import { CamsUserReference } from '../../../../../common/src/cams/users'; +import { CamsUserReference } from '../../../../common/src/cams/users'; import { BadRequestError } from '../../common-errors/bad-request'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/controllers/orders/orders.controller.test.ts b/backend/lib/controllers/orders/orders.controller.test.ts similarity index 97% rename from backend/functions/lib/controllers/orders/orders.controller.test.ts rename to backend/lib/controllers/orders/orders.controller.test.ts index 875b54e4c..fe72cfefc 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.test.ts +++ b/backend/lib/controllers/orders/orders.controller.test.ts @@ -11,14 +11,14 @@ import { Order, TransferOrder, TransferOrderAction, -} from '../../../../../common/src/cams/orders'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; -import { sortDates } from '../../../../../common/src/date-helper'; +} from '../../../../common/src/cams/orders'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; +import { sortDates } from '../../../../common/src/date-helper'; import { OrdersController } from './orders.controller'; import { CamsHttpResponseInit, commonHeaders } from '../../adapters/utils/http-response'; -import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; import { mockCamsHttpRequest } from '../../testing/mock-data/cams-http-request-helper'; -import { ResponseBody } from '../../../../../common/src/api/response'; +import { ResponseBody } from '../../../../common/src/api/response'; import { NotFoundError } from '../../common-errors/not-found-error'; import { BadRequestError } from '../../common-errors/bad-request'; import * as crypto from 'crypto'; diff --git a/backend/functions/lib/controllers/orders/orders.controller.ts b/backend/lib/controllers/orders/orders.controller.ts similarity index 97% rename from backend/functions/lib/controllers/orders/orders.controller.ts rename to backend/lib/controllers/orders/orders.controller.ts index e2a933919..aaa0b3717 100644 --- a/backend/functions/lib/controllers/orders/orders.controller.ts +++ b/backend/lib/controllers/orders/orders.controller.ts @@ -8,12 +8,12 @@ import { isConsolidationOrderRejection, Order, TransferOrderAction, -} from '../../../../../common/src/cams/orders'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; +} from '../../../../common/src/cams/orders'; +import { CaseSummary } from '../../../../common/src/cams/cases'; import { BadRequestError } from '../../common-errors/bad-request'; import { CamsHttpResponseInit, httpSuccess } from '../../adapters/utils/http-response'; import { getCamsError } from '../../common-errors/error-utilities'; -import HttpStatusCodes from '../../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; import { CamsController, CamsTimerController } from '../controller'; import { NotFoundError } from '../../common-errors/not-found-error'; import { finalizeDeferrable } from '../../deferrable/finalize-deferrable'; diff --git a/backend/functions/lib/deferrable/defer-close.test.ts b/backend/lib/deferrable/defer-close.test.ts similarity index 100% rename from backend/functions/lib/deferrable/defer-close.test.ts rename to backend/lib/deferrable/defer-close.test.ts diff --git a/backend/functions/lib/deferrable/defer-close.ts b/backend/lib/deferrable/defer-close.ts similarity index 100% rename from backend/functions/lib/deferrable/defer-close.ts rename to backend/lib/deferrable/defer-close.ts diff --git a/backend/functions/lib/deferrable/defer-release.test.ts b/backend/lib/deferrable/defer-release.test.ts similarity index 100% rename from backend/functions/lib/deferrable/defer-release.test.ts rename to backend/lib/deferrable/defer-release.test.ts diff --git a/backend/functions/lib/deferrable/defer-release.ts b/backend/lib/deferrable/defer-release.ts similarity index 100% rename from backend/functions/lib/deferrable/defer-release.ts rename to backend/lib/deferrable/defer-release.ts diff --git a/backend/functions/lib/deferrable/finalize-deferrable.test.ts b/backend/lib/deferrable/finalize-deferrable.test.ts similarity index 100% rename from backend/functions/lib/deferrable/finalize-deferrable.test.ts rename to backend/lib/deferrable/finalize-deferrable.test.ts diff --git a/backend/functions/lib/deferrable/finalize-deferrable.ts b/backend/lib/deferrable/finalize-deferrable.ts similarity index 100% rename from backend/functions/lib/deferrable/finalize-deferrable.ts rename to backend/lib/deferrable/finalize-deferrable.ts diff --git a/backend/functions/lib/factory.test.ts b/backend/lib/factory.test.ts similarity index 100% rename from backend/functions/lib/factory.test.ts rename to backend/lib/factory.test.ts diff --git a/backend/functions/lib/factory.ts b/backend/lib/factory.ts similarity index 100% rename from backend/functions/lib/factory.ts rename to backend/lib/factory.ts diff --git a/backend/functions/lib/humble-objects/mongo-humble.ts b/backend/lib/humble-objects/mongo-humble.ts similarity index 100% rename from backend/functions/lib/humble-objects/mongo-humble.ts rename to backend/lib/humble-objects/mongo-humble.ts diff --git a/backend/functions/lib/query/query-builder.test.ts b/backend/lib/query/query-builder.test.ts similarity index 100% rename from backend/functions/lib/query/query-builder.test.ts rename to backend/lib/query/query-builder.test.ts diff --git a/backend/functions/lib/query/query-builder.ts b/backend/lib/query/query-builder.ts similarity index 100% rename from backend/functions/lib/query/query-builder.ts rename to backend/lib/query/query-builder.ts diff --git a/backend/functions/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts b/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts similarity index 99% rename from backend/functions/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts rename to backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts index 8f9fe2bcd..f0a11edf8 100644 --- a/backend/functions/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts +++ b/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; -import applicationContextCreator from '../../../../azure/application-context-creator'; +import applicationContextCreator from '../../../../functions/azure/application-context-creator'; import { LoggerImpl } from '../../../adapters/services/logger.service'; import OfficesDxtrGateway from '../../../adapters/gateways/dxtr/offices.dxtr.gateway'; -import { UstpOfficeDetails } from '../../../../../../common/src/cams/offices'; +import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; import * as fs from 'fs/promises'; // Sourced from Office_Regions_and_Divisions.pdf diff --git a/backend/functions/lib/testing/analysis/export-office-csv.ts b/backend/lib/testing/analysis/export-office-csv.ts similarity index 91% rename from backend/functions/lib/testing/analysis/export-office-csv.ts rename to backend/lib/testing/analysis/export-office-csv.ts index 4675fe8ed..99795faba 100644 --- a/backend/functions/lib/testing/analysis/export-office-csv.ts +++ b/backend/lib/testing/analysis/export-office-csv.ts @@ -1,8 +1,8 @@ import { InvocationContext } from '@azure/functions'; -import applicationContextCreator from '../../../azure/application-context-creator'; +import applicationContextCreator from '../../../functions/azure/application-context-creator'; import { LoggerImpl } from '../../adapters/services/logger.service'; import OfficesDxtrGateway from '../../adapters/gateways/dxtr/offices.dxtr.gateway'; -import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import * as fs from 'fs/promises'; const MODULE_NAME = 'ITEST'; diff --git a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts b/backend/lib/testing/isolated-integration/test-acms-migration.ts similarity index 77% rename from backend/functions/lib/testing/isolated-integration/test-acms-migration.ts rename to backend/lib/testing/isolated-integration/test-acms-migration.ts index c8e1b17e5..c7deb9932 100644 --- a/backend/functions/lib/testing/isolated-integration/test-acms-migration.ts +++ b/backend/lib/testing/isolated-integration/test-acms-migration.ts @@ -1,5 +1,5 @@ -import migrateConsolidation from '../../../migration/activity/migrateConsolidation'; -import { createMockAzureFunctionContext } from '../../../azure/testing-helpers'; +import migrateConsolidation from '../../../functions/migration/activity/migrateConsolidation'; +import { createMockAzureFunctionContext } from '../../../functions/azure/testing-helpers'; import * as dotenv from 'dotenv'; dotenv.config(); diff --git a/backend/functions/lib/testing/isolated-integration/test-okta-group-api.ts b/backend/lib/testing/isolated-integration/test-okta-group-api.ts similarity index 95% rename from backend/functions/lib/testing/isolated-integration/test-okta-group-api.ts rename to backend/lib/testing/isolated-integration/test-okta-group-api.ts index 1bd03c93c..d7587d88a 100644 --- a/backend/functions/lib/testing/isolated-integration/test-okta-group-api.ts +++ b/backend/lib/testing/isolated-integration/test-okta-group-api.ts @@ -1,6 +1,6 @@ import { InvocationContext } from '@azure/functions'; import { LoggerImpl } from '../../adapters/services/logger.service'; -import applicationContextCreator from '../../../azure/application-context-creator'; +import applicationContextCreator from '../../../functions/azure/application-context-creator'; import { UserGroupGatewayConfig } from '../../adapters/types/authorization'; import { getUserGroupGatewayConfig } from '../../configs/user-groups-gateway-configuration'; import OktaUserGroupGateway from '../../adapters/gateways/okta/okta-user-group-gateway'; diff --git a/backend/functions/lib/testing/local-data/local-cases-repository.ts b/backend/lib/testing/local-data/local-cases-repository.ts similarity index 94% rename from backend/functions/lib/testing/local-data/local-cases-repository.ts rename to backend/lib/testing/local-data/local-cases-repository.ts index eb25b823b..6bd05e260 100644 --- a/backend/functions/lib/testing/local-data/local-cases-repository.ts +++ b/backend/lib/testing/local-data/local-cases-repository.ts @@ -6,8 +6,8 @@ import { Transfer, TransferFrom, TransferTo, -} from '../../../../../common/src/cams/events'; -import { CaseHistory } from '../../../../../common/src/cams/history'; +} from '../../../../common/src/cams/events'; +import { CaseHistory } from '../../../../common/src/cams/history'; import { CasesRepository } from '../../use-cases/gateways.types'; export class LocalCasesRepository implements CasesRepository { diff --git a/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts b/backend/lib/testing/local-data/local-consolidation-orders-repository.ts similarity index 88% rename from backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts rename to backend/lib/testing/local-data/local-consolidation-orders-repository.ts index 5dd2f58c1..8135e68f3 100644 --- a/backend/functions/lib/testing/local-data/local-consolidation-orders-repository.ts +++ b/backend/lib/testing/local-data/local-consolidation-orders-repository.ts @@ -1,6 +1,6 @@ -import { ConsolidationOrder } from '../../../../../common/src/cams/orders'; +import { ConsolidationOrder } from '../../../../common/src/cams/orders'; import { ConsolidationOrdersRepository } from '../../use-cases/gateways.types'; -import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; +import { OrdersSearchPredicate } from '../../../../common/src/api/search'; import * as crypto from 'crypto'; import { ApplicationContext } from '../../adapters/types/basic'; diff --git a/backend/lib/testing/mock-data/attorneys.mock.ts b/backend/lib/testing/mock-data/attorneys.mock.ts new file mode 100644 index 000000000..98ee01717 --- /dev/null +++ b/backend/lib/testing/mock-data/attorneys.mock.ts @@ -0,0 +1,7 @@ +import { TRIAL_ATTORNEYS } from '../../../../common/src/cams/test-utilities/attorneys.mock'; + +const list = { + attorneyList: TRIAL_ATTORNEYS, +}; + +export { list }; diff --git a/backend/functions/lib/testing/mock-data/cams-http-request-helper.ts b/backend/lib/testing/mock-data/cams-http-request-helper.ts similarity index 84% rename from backend/functions/lib/testing/mock-data/cams-http-request-helper.ts rename to backend/lib/testing/mock-data/cams-http-request-helper.ts index 4bfd6196e..bb37e17f6 100644 --- a/backend/functions/lib/testing/mock-data/cams-http-request-helper.ts +++ b/backend/lib/testing/mock-data/cams-http-request-helper.ts @@ -1,4 +1,4 @@ -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { CamsHttpRequest } from '../../adapters/types/http'; export const mockRequestUrl = 'http://mockhost/api'; diff --git a/backend/functions/lib/testing/mock-data/case-docket-entries.mock.ts b/backend/lib/testing/mock-data/case-docket-entries.mock.ts similarity index 99% rename from backend/functions/lib/testing/mock-data/case-docket-entries.mock.ts rename to backend/lib/testing/mock-data/case-docket-entries.mock.ts index b469deb4b..18174fbf5 100644 --- a/backend/functions/lib/testing/mock-data/case-docket-entries.mock.ts +++ b/backend/lib/testing/mock-data/case-docket-entries.mock.ts @@ -1,4 +1,4 @@ -import { CaseDocket, CaseDocketEntryDocument } from '../../../../../common/src/cams/cases'; +import { CaseDocket, CaseDocketEntryDocument } from '../../../../common/src/cams/cases'; import { DxtrCaseDocketEntryDocument } from '../../adapters/gateways/dxtr/case-docket.dxtr.gateway'; export const DXTR_CASE_DOCKET_ENTRIES: CaseDocket = [ diff --git a/backend/functions/lib/testing/mock-data/case-history.mock.ts b/backend/lib/testing/mock-data/case-history.mock.ts similarity index 94% rename from backend/functions/lib/testing/mock-data/case-history.mock.ts rename to backend/lib/testing/mock-data/case-history.mock.ts index 98d451711..b201c044a 100644 --- a/backend/functions/lib/testing/mock-data/case-history.mock.ts +++ b/backend/lib/testing/mock-data/case-history.mock.ts @@ -1,6 +1,6 @@ -import { SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; -import { CaseAssignmentHistory } from '../../../../../common/src/cams/history'; -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import { SYSTEM_USER_REFERENCE } from '../../../../common/src/cams/auditable'; +import { CaseAssignmentHistory } from '../../../../common/src/cams/history'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; export const CASE_HISTORY: CaseAssignmentHistory[] = [ { diff --git a/backend/functions/lib/testing/mock-data/case-summaries.mock.ts b/backend/lib/testing/mock-data/case-summaries.mock.ts similarity index 91% rename from backend/functions/lib/testing/mock-data/case-summaries.mock.ts rename to backend/lib/testing/mock-data/case-summaries.mock.ts index bf13d3b49..6f4ff0bf6 100644 --- a/backend/functions/lib/testing/mock-data/case-summaries.mock.ts +++ b/backend/lib/testing/mock-data/case-summaries.mock.ts @@ -1,4 +1,4 @@ -import { CaseSummary } from '../../../../../common/src/cams/cases'; +import { CaseSummary } from '../../../../common/src/cams/cases'; export const CASE_SUMMARIES: CaseSummary[] = [ { diff --git a/backend/functions/lib/testing/mock-data/cases.mock.json b/backend/lib/testing/mock-data/cases.mock.json similarity index 100% rename from backend/functions/lib/testing/mock-data/cases.mock.json rename to backend/lib/testing/mock-data/cases.mock.json diff --git a/backend/functions/lib/testing/mock-data/debtor-attorneys.mock.ts b/backend/lib/testing/mock-data/debtor-attorneys.mock.ts similarity index 97% rename from backend/functions/lib/testing/mock-data/debtor-attorneys.mock.ts rename to backend/lib/testing/mock-data/debtor-attorneys.mock.ts index 37529b668..64300d057 100644 --- a/backend/functions/lib/testing/mock-data/debtor-attorneys.mock.ts +++ b/backend/lib/testing/mock-data/debtor-attorneys.mock.ts @@ -1,4 +1,4 @@ -import { DebtorAttorney } from '../../../../../common/src/cams/parties'; +import { DebtorAttorney } from '../../../../common/src/cams/parties'; export const DEBTOR_ATTORNEYS = new Map([ [ diff --git a/backend/functions/lib/testing/mock-data/debtors.mock.ts b/backend/lib/testing/mock-data/debtors.mock.ts similarity index 97% rename from backend/functions/lib/testing/mock-data/debtors.mock.ts rename to backend/lib/testing/mock-data/debtors.mock.ts index 1afeeb828..f56303c0e 100644 --- a/backend/functions/lib/testing/mock-data/debtors.mock.ts +++ b/backend/lib/testing/mock-data/debtors.mock.ts @@ -1,4 +1,4 @@ -import { Party } from '../../../../../common/src/cams/parties'; +import { Party } from '../../../../common/src/cams/parties'; export const DEBTORS = new Map([ [ diff --git a/backend/functions/lib/testing/mock-data/generic-test-data.mock.ts b/backend/lib/testing/mock-data/generic-test-data.mock.ts similarity index 100% rename from backend/functions/lib/testing/mock-data/generic-test-data.mock.ts rename to backend/lib/testing/mock-data/generic-test-data.mock.ts diff --git a/backend/functions/lib/testing/mock-data/index.ts b/backend/lib/testing/mock-data/index.ts similarity index 100% rename from backend/functions/lib/testing/mock-data/index.ts rename to backend/lib/testing/mock-data/index.ts diff --git a/backend/functions/lib/testing/mock-fetch.ts b/backend/lib/testing/mock-fetch.ts similarity index 100% rename from backend/functions/lib/testing/mock-fetch.ts rename to backend/lib/testing/mock-fetch.ts diff --git a/backend/functions/lib/testing/mock-gateways/mock-attorneys.gateway.ts b/backend/lib/testing/mock-gateways/mock-attorneys.gateway.ts similarity index 81% rename from backend/functions/lib/testing/mock-gateways/mock-attorneys.gateway.ts rename to backend/lib/testing/mock-gateways/mock-attorneys.gateway.ts index 41021efad..69ff425af 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-attorneys.gateway.ts +++ b/backend/lib/testing/mock-gateways/mock-attorneys.gateway.ts @@ -1,5 +1,5 @@ -import { TRIAL_ATTORNEYS } from '../../../../../common/src/cams/test-utilities/attorneys.mock'; -import { AttorneyUser } from '../../../../../common/src/cams/users'; +import { TRIAL_ATTORNEYS } from '../../../../common/src/cams/test-utilities/attorneys.mock'; +import { AttorneyUser } from '../../../../common/src/cams/users'; import { ApplicationContext } from '../../adapters/types/basic'; import { AttorneyGatewayInterface } from '../../use-cases/attorney.gateway.interface'; diff --git a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts b/backend/lib/testing/mock-gateways/mock-mongo.repository.ts similarity index 96% rename from backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts rename to backend/lib/testing/mock-gateways/mock-mongo.repository.ts index 8e01c99ce..556c1fb57 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-mongo.repository.ts +++ b/backend/lib/testing/mock-gateways/mock-mongo.repository.ts @@ -4,8 +4,8 @@ import { TransferTo, ConsolidationTo, ConsolidationFrom, -} from '../../../../../common/src/cams/events'; -import { CaseHistory } from '../../../../../common/src/cams/history'; +} from '../../../../common/src/cams/events'; +import { CaseHistory } from '../../../../common/src/cams/history'; import { ApplicationContext } from '../../adapters/types/basic'; import { CaseAssignmentRepository, diff --git a/backend/functions/lib/testing/mock-gateways/mock-oauth2-gateway.ts b/backend/lib/testing/mock-gateways/mock-oauth2-gateway.ts similarity index 86% rename from backend/functions/lib/testing/mock-gateways/mock-oauth2-gateway.ts rename to backend/lib/testing/mock-gateways/mock-oauth2-gateway.ts index 5386e4158..2d464504c 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-oauth2-gateway.ts +++ b/backend/lib/testing/mock-gateways/mock-oauth2-gateway.ts @@ -1,12 +1,12 @@ import * as jwt from 'jsonwebtoken'; import { ApplicationContext } from '../../adapters/types/basic'; import { ForbiddenError } from '../../common-errors/forbidden-error'; -import { MockUser, MockUsers } from '../../../../../common/src/cams/test-utilities/mock-user'; -import { CamsUser } from '../../../../../common/src/cams/users'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { CamsJwt, CamsJwtClaims, CamsJwtHeader } from '../../../../../common/src/cams/jwt'; +import { MockUser, MockUsers } from '../../../../common/src/cams/test-utilities/mock-user'; +import { CamsUser } from '../../../../common/src/cams/users'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsJwt, CamsJwtClaims, CamsJwtHeader } from '../../../../common/src/cams/jwt'; import { OpenIdConnectGateway } from '../../adapters/types/authorization'; -import { USTP_OFFICES_ARRAY } from '../../../../../common/src/cams/offices'; +import { USTP_OFFICES_ARRAY } from '../../../../common/src/cams/offices'; const MODULE_NAME = 'MOCK_OAUTH2_GATEWAY'; const mockUsers: MockUser[] = MockUsers; diff --git a/backend/functions/lib/testing/mock-gateways/mock-user-session-use-case.ts b/backend/lib/testing/mock-gateways/mock-user-session-use-case.ts similarity index 78% rename from backend/functions/lib/testing/mock-gateways/mock-user-session-use-case.ts rename to backend/lib/testing/mock-gateways/mock-user-session-use-case.ts index 056db8f41..a40198bb0 100644 --- a/backend/functions/lib/testing/mock-gateways/mock-user-session-use-case.ts +++ b/backend/lib/testing/mock-gateways/mock-user-session-use-case.ts @@ -1,10 +1,10 @@ import * as jwt from 'jsonwebtoken'; import { ApplicationContext } from '../../adapters/types/basic'; import { getUser } from './mock-oauth2-gateway'; -import { CamsSession } from '../../../../../common/src/cams/session'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { CamsJwtClaims } from '../../../../../common/src/cams/jwt'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { CamsSession } from '../../../../common/src/cams/session'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsJwtClaims } from '../../../../common/src/cams/jwt'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; const cache = new Map(); diff --git a/backend/functions/lib/testing/mock-gateways/mock.offices.gateway.ts b/backend/lib/testing/mock-gateways/mock.offices.gateway.ts similarity index 96% rename from backend/functions/lib/testing/mock-gateways/mock.offices.gateway.ts rename to backend/lib/testing/mock-gateways/mock.offices.gateway.ts index a53ef9e1c..7fe56747b 100644 --- a/backend/functions/lib/testing/mock-gateways/mock.offices.gateway.ts +++ b/backend/lib/testing/mock-gateways/mock.offices.gateway.ts @@ -1,4 +1,4 @@ -import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { USTP_OFFICE_NAME_MAP } from '../../adapters/gateways/dxtr/dxtr.constants'; import { ApplicationContext } from '../../adapters/types/basic'; import { CamsError } from '../../common-errors/cams-error'; diff --git a/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts b/backend/lib/testing/mock-gateways/mock.offices.repository.ts similarity index 68% rename from backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts rename to backend/lib/testing/mock-gateways/mock.offices.repository.ts index 39309b511..2537fe3b9 100644 --- a/backend/functions/lib/testing/mock-gateways/mock.offices.repository.ts +++ b/backend/lib/testing/mock-gateways/mock.offices.repository.ts @@ -1,4 +1,4 @@ -import { TRIAL_ATTORNEYS } from '../../../../../common/src/cams/test-utilities/attorneys.mock'; +import { TRIAL_ATTORNEYS } from '../../../../common/src/cams/test-utilities/attorneys.mock'; export const MockOfficesRepository = { release: () => {}, diff --git a/backend/functions/lib/testing/mock-gateways/mock.orders.gateway.ts b/backend/lib/testing/mock-gateways/mock.orders.gateway.ts similarity index 76% rename from backend/functions/lib/testing/mock-gateways/mock.orders.gateway.ts rename to backend/lib/testing/mock-gateways/mock.orders.gateway.ts index 5e98a98ff..c9c14a109 100644 --- a/backend/functions/lib/testing/mock-gateways/mock.orders.gateway.ts +++ b/backend/lib/testing/mock-gateways/mock.orders.gateway.ts @@ -1,5 +1,5 @@ -import { RawOrderSync } from '../../../../../common/src/cams/orders'; -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import { RawOrderSync } from '../../../../common/src/cams/orders'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import { ApplicationContext } from '../../adapters/types/basic'; import { OrdersGateway } from '../../use-cases/gateways.types'; diff --git a/backend/functions/lib/testing/testing-constants.ts b/backend/lib/testing/testing-constants.ts similarity index 100% rename from backend/functions/lib/testing/testing-constants.ts rename to backend/lib/testing/testing-constants.ts diff --git a/backend/functions/lib/testing/testing-utilities.ts b/backend/lib/testing/testing-utilities.ts similarity index 86% rename from backend/functions/lib/testing/testing-utilities.ts rename to backend/lib/testing/testing-utilities.ts index 3b1371dbe..338e604b2 100644 --- a/backend/functions/lib/testing/testing-utilities.ts +++ b/backend/lib/testing/testing-utilities.ts @@ -1,9 +1,9 @@ import { ApplicationContext } from '../adapters/types/basic'; import { HttpRequest, InvocationContext } from '@azure/functions'; -import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; -import { CamsSession } from '../../../../common/src/cams/session'; +import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; +import { CamsSession } from '../../../common/src/cams/session'; import { CamsHttpMethod, CamsHttpRequest } from '../adapters/types/http'; -import ContextCreator from '../../azure/application-context-creator'; +import ContextCreator from '../../functions/azure/application-context-creator'; import { LoggerImpl } from '../adapters/services/logger.service'; const invocationContext = new InvocationContext(); diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts b/backend/lib/use-cases/acms-orders/acms-orders.test.ts similarity index 97% rename from backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts rename to backend/lib/use-cases/acms-orders/acms-orders.test.ts index 8de6861c8..89493f72b 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.test.ts +++ b/backend/lib/use-cases/acms-orders/acms-orders.test.ts @@ -3,14 +3,14 @@ import { createMockApplicationContext } from '../../testing/testing-utilities'; import { AcmsGateway } from '../gateways.types'; import AcmsOrders, { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders'; import { CasesMongoRepository } from '../../adapters/gateways/mongo/cases.mongo.repository'; -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import { AcmsGatewayImpl } from '../../adapters/gateways/acms/acms.gateway'; import CasesDxtrGateway from '../../adapters/gateways/dxtr/cases.dxtr.gateway'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; -import { ConsolidationType } from '../../../../../common/src/cams/orders'; -import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; -import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; -import { ConsolidationFrom } from '../../../../../common/src/cams/events'; +import { CaseSummary } from '../../../../common/src/cams/cases'; +import { ConsolidationType } from '../../../../common/src/cams/orders'; +import { CaseConsolidationHistory } from '../../../../common/src/cams/history'; +import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../common/src/cams/auditable'; +import { ConsolidationFrom } from '../../../../common/src/cams/events'; const mockAcmsGateway: AcmsGateway = { getPageCount: function (..._ignore): Promise { diff --git a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts b/backend/lib/use-cases/acms-orders/acms-orders.ts similarity index 95% rename from backend/functions/lib/use-cases/acms-orders/acms-orders.ts rename to backend/lib/use-cases/acms-orders/acms-orders.ts index 316b04055..af1c9e8a7 100644 --- a/backend/functions/lib/use-cases/acms-orders/acms-orders.ts +++ b/backend/lib/use-cases/acms-orders/acms-orders.ts @@ -1,10 +1,10 @@ import { ApplicationContext } from '../../adapters/types/basic'; import Factory from '../../factory'; -import { ConsolidationFrom, ConsolidationTo } from '../../../../../common/src/cams/events'; -import { ConsolidationType } from '../../../../../common/src/cams/orders'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; -import { CaseConsolidationHistory } from '../../../../../common/src/cams/history'; -import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; +import { ConsolidationFrom, ConsolidationTo } from '../../../../common/src/cams/events'; +import { ConsolidationType } from '../../../../common/src/cams/orders'; +import { CaseSummary } from '../../../../common/src/cams/cases'; +import { CaseConsolidationHistory } from '../../../../common/src/cams/history'; +import { ACMS_SYSTEM_USER_REFERENCE } from '../../../../common/src/cams/auditable'; import { getCamsError } from '../../common-errors/error-utilities'; const MODULE_NAME = 'ACMS_ORDERS_USE_CASE'; diff --git a/backend/functions/lib/use-cases/assignment.exception.test.ts b/backend/lib/use-cases/assignment.exception.test.ts similarity index 84% rename from backend/functions/lib/use-cases/assignment.exception.test.ts rename to backend/lib/use-cases/assignment.exception.test.ts index b4af91996..1a8682a3d 100644 --- a/backend/functions/lib/use-cases/assignment.exception.test.ts +++ b/backend/lib/use-cases/assignment.exception.test.ts @@ -1,5 +1,5 @@ import { AssignmentError } from './assignment.exception'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; describe('CAMS Assignment Exception', () => { const testModuleName = 'Test'; diff --git a/backend/functions/lib/use-cases/assignment.exception.ts b/backend/lib/use-cases/assignment.exception.ts similarity index 84% rename from backend/functions/lib/use-cases/assignment.exception.ts rename to backend/lib/use-cases/assignment.exception.ts index dac52dd79..7adbeadbd 100644 --- a/backend/functions/lib/use-cases/assignment.exception.ts +++ b/backend/lib/use-cases/assignment.exception.ts @@ -1,5 +1,5 @@ import { CamsError, CamsErrorOptions } from '../common-errors/cams-error'; -import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import HttpStatusCodes from '../../../common/src/api/http-status-codes'; /* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ export interface AssignmentErrorOptions extends CamsErrorOptions {} diff --git a/backend/functions/lib/use-cases/attorney.gateway.interface.d.ts b/backend/lib/use-cases/attorney.gateway.interface.d.ts similarity index 81% rename from backend/functions/lib/use-cases/attorney.gateway.interface.d.ts rename to backend/lib/use-cases/attorney.gateway.interface.d.ts index daccb5487..4a7032ce8 100644 --- a/backend/functions/lib/use-cases/attorney.gateway.interface.d.ts +++ b/backend/lib/use-cases/attorney.gateway.interface.d.ts @@ -1,5 +1,5 @@ import { ApplicationContext } from '../adapters/types/basic'; -import { AttorneyUser } from '../../../../common/src/cams/users'; +import { AttorneyUser } from '../../../common/src/cams/users'; export interface AttorneyGatewayInterface { getAttorneys(applicationContext: ApplicationContext): Promise>; diff --git a/backend/functions/lib/use-cases/attorneys.test.ts b/backend/lib/use-cases/attorneys.test.ts similarity index 94% rename from backend/functions/lib/use-cases/attorneys.test.ts rename to backend/lib/use-cases/attorneys.test.ts index ad5ebc814..86fa8d78d 100644 --- a/backend/functions/lib/use-cases/attorneys.test.ts +++ b/backend/lib/use-cases/attorneys.test.ts @@ -1,4 +1,4 @@ -import { TRIAL_ATTORNEYS } from '../../../../common/src/cams/test-utilities/attorneys.mock'; +import { TRIAL_ATTORNEYS } from '../../../common/src/cams/test-utilities/attorneys.mock'; import { createMockApplicationContext } from '../testing/testing-utilities'; import AttorneysList from './attorneys'; import { CaseAssignmentUseCase } from './case-assignment'; diff --git a/backend/functions/lib/use-cases/attorneys.ts b/backend/lib/use-cases/attorneys.ts similarity index 93% rename from backend/functions/lib/use-cases/attorneys.ts rename to backend/lib/use-cases/attorneys.ts index 30687370e..a362bb589 100644 --- a/backend/functions/lib/use-cases/attorneys.ts +++ b/backend/lib/use-cases/attorneys.ts @@ -2,7 +2,7 @@ import { AttorneyGatewayInterface } from './attorney.gateway.interface'; import { ApplicationContext } from '../adapters/types/basic'; import { getAttorneyGateway } from '../factory'; import { CaseAssignmentUseCase } from './case-assignment'; -import { AttorneyUser } from '../../../../common/src/cams/users'; +import { AttorneyUser } from '../../../common/src/cams/users'; const MODULE_NAME = 'ATTORNEYS-USE-CASE'; diff --git a/backend/functions/lib/use-cases/case-assignment.test.ts b/backend/lib/use-cases/case-assignment.test.ts similarity index 96% rename from backend/functions/lib/use-cases/case-assignment.test.ts rename to backend/lib/use-cases/case-assignment.test.ts index 15ecdb4f6..235170623 100644 --- a/backend/functions/lib/use-cases/case-assignment.test.ts +++ b/backend/lib/use-cases/case-assignment.test.ts @@ -4,12 +4,12 @@ import { createMockApplicationContext, createMockApplicationContextSession, } from '../testing/testing-utilities'; -import MockData from '../../../../common/src/cams/test-utilities/mock-data'; -import { CamsRole } from '../../../../common/src/cams/roles'; +import MockData from '../../../common/src/cams/test-utilities/mock-data'; +import { CamsRole } from '../../../common/src/cams/roles'; import CaseManagement from './case-management'; -import { getCourtDivisionCodes } from '../../../../common/src/cams/users'; +import { getCourtDivisionCodes } from '../../../common/src/cams/users'; import { MockMongoRepository } from '../testing/mock-gateways/mock-mongo.repository'; -import { ConsolidationOrder } from '../../../../common/src/cams/orders'; +import { ConsolidationOrder } from '../../../common/src/cams/orders'; const randomId = () => { return '' + Math.random() * 99999999; diff --git a/backend/functions/lib/use-cases/case-assignment.ts b/backend/lib/use-cases/case-assignment.ts similarity index 94% rename from backend/functions/lib/use-cases/case-assignment.ts rename to backend/lib/use-cases/case-assignment.ts index 69668639b..ea53158cc 100644 --- a/backend/functions/lib/use-cases/case-assignment.ts +++ b/backend/lib/use-cases/case-assignment.ts @@ -1,13 +1,13 @@ import Factory, { getAssignmentRepository } from '../factory'; import { ApplicationContext } from '../adapters/types/basic'; import { CaseAssignmentRepository } from './gateways.types'; -import { CaseAssignment } from '../../../../common/src/cams/assignments'; -import { CaseAssignmentHistory } from '../../../../common/src/cams/history'; +import { CaseAssignment } from '../../../common/src/cams/assignments'; +import { CaseAssignmentHistory } from '../../../common/src/cams/history'; import CaseManagement from './case-management'; -import { CamsUserReference, getCourtDivisionCodes } from '../../../../common/src/cams/users'; -import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsUserReference, getCourtDivisionCodes } from '../../../common/src/cams/users'; +import { CamsRole } from '../../../common/src/cams/roles'; import { AssignmentError } from './assignment.exception'; -import { createAuditRecord } from '../../../../common/src/cams/auditable'; +import { createAuditRecord } from '../../../common/src/cams/auditable'; const MODULE_NAME = 'CASE-ASSIGNMENT'; diff --git a/backend/functions/lib/use-cases/case-associated/case-associated.ts b/backend/lib/use-cases/case-associated/case-associated.ts similarity index 95% rename from backend/functions/lib/use-cases/case-associated/case-associated.ts rename to backend/lib/use-cases/case-associated/case-associated.ts index 8393ec1d8..e2728b0f7 100644 --- a/backend/functions/lib/use-cases/case-associated/case-associated.ts +++ b/backend/lib/use-cases/case-associated/case-associated.ts @@ -1,6 +1,6 @@ import Factory from '../../factory'; import { ApplicationContext } from '../../adapters/types/basic'; -import { EventCaseReference } from '../../../../../common/src/cams/events'; +import { EventCaseReference } from '../../../../common/src/cams/events'; function getEarliestDate(orders: Array) { const earliestOrder = orders.sort((a, b) => (a.orderDate < b.orderDate ? -1 : 1))[0]; diff --git a/backend/functions/lib/use-cases/case-docket/case-docket.test.ts b/backend/lib/use-cases/case-docket/case-docket.test.ts similarity index 100% rename from backend/functions/lib/use-cases/case-docket/case-docket.test.ts rename to backend/lib/use-cases/case-docket/case-docket.test.ts diff --git a/backend/functions/lib/use-cases/case-docket/case-docket.ts b/backend/lib/use-cases/case-docket/case-docket.ts similarity index 87% rename from backend/functions/lib/use-cases/case-docket/case-docket.ts rename to backend/lib/use-cases/case-docket/case-docket.ts index a5ade3001..fee01510d 100644 --- a/backend/functions/lib/use-cases/case-docket/case-docket.ts +++ b/backend/lib/use-cases/case-docket/case-docket.ts @@ -1,6 +1,6 @@ import { CaseDocketGateway } from '../gateways.types'; import { ApplicationContext } from '../../adapters/types/basic'; -import { CaseDocket } from '../../../../../common/src/cams/cases'; +import { CaseDocket } from '../../../../common/src/cams/cases'; export class CaseDocketUseCase { private readonly gateway: CaseDocketGateway; diff --git a/backend/functions/lib/use-cases/case-history/case-history.test.ts b/backend/lib/use-cases/case-history/case-history.test.ts similarity index 100% rename from backend/functions/lib/use-cases/case-history/case-history.test.ts rename to backend/lib/use-cases/case-history/case-history.test.ts diff --git a/backend/functions/lib/use-cases/case-history/case-history.ts b/backend/lib/use-cases/case-history/case-history.ts similarity index 85% rename from backend/functions/lib/use-cases/case-history/case-history.ts rename to backend/lib/use-cases/case-history/case-history.ts index db878dd26..1b426e825 100644 --- a/backend/functions/lib/use-cases/case-history/case-history.ts +++ b/backend/lib/use-cases/case-history/case-history.ts @@ -1,6 +1,6 @@ import Factory from '../../factory'; import { ApplicationContext } from '../../adapters/types/basic'; -import { CaseHistory } from '../../../../../common/src/cams/history'; +import { CaseHistory } from '../../../../common/src/cams/history'; export class CaseHistoryUseCase { public async getCaseHistory(context: ApplicationContext): Promise { diff --git a/backend/functions/lib/use-cases/case-management.test.ts b/backend/lib/use-cases/case-management.test.ts similarity index 96% rename from backend/functions/lib/use-cases/case-management.test.ts rename to backend/lib/use-cases/case-management.test.ts index 02e76f32c..14dde07f6 100644 --- a/backend/functions/lib/use-cases/case-management.test.ts +++ b/backend/lib/use-cases/case-management.test.ts @@ -1,25 +1,25 @@ import CaseManagement, { getAction } from './case-management'; import { UnknownError } from '../common-errors/unknown-error'; import { CamsError } from '../common-errors/cams-error'; -import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; -import { CaseAssignment } from '../../../../common/src/cams/assignments'; +import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; +import { CaseAssignment } from '../../../common/src/cams/assignments'; import { createMockApplicationContext, createMockApplicationContextSession, } from '../testing/testing-utilities'; -import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsRole } from '../../../common/src/cams/roles'; import { getCasesGateway } from '../factory'; import { ApplicationContext } from '../adapters/types/basic'; -import { CamsUser } from '../../../../common/src/cams/users'; +import { CamsUser } from '../../../common/src/cams/users'; import { REGION_02_GROUP_BU, REGION_02_GROUP_NY, -} from '../../../../common/src/cams/test-utilities/mock-user'; -import { ustpOfficeToCourtDivision } from '../../../../common/src/cams/courts'; +} from '../../../common/src/cams/test-utilities/mock-user'; +import { ustpOfficeToCourtDivision } from '../../../common/src/cams/courts'; import { buildOfficeCode } from './offices/offices'; import { MockMongoRepository } from '../testing/mock-gateways/mock-mongo.repository'; -import { TransferOrder } from '../../../../common/src/cams/orders'; -import { ConsolidationTo } from '../../../../common/src/cams/events'; +import { TransferOrder } from '../../../common/src/cams/orders'; +import { ConsolidationTo } from '../../../common/src/cams/events'; const attorneyJaneSmith = { id: '001', name: 'Jane Smith' }; const attorneyJoeNobel = { id: '002', name: 'Joe Nobel' }; diff --git a/backend/functions/lib/use-cases/case-management.ts b/backend/lib/use-cases/case-management.ts similarity index 92% rename from backend/functions/lib/use-cases/case-management.ts rename to backend/lib/use-cases/case-management.ts index d2e6b2610..6656a6f0c 100644 --- a/backend/functions/lib/use-cases/case-management.ts +++ b/backend/lib/use-cases/case-management.ts @@ -1,5 +1,5 @@ import { ApplicationContext } from '../adapters/types/basic'; -import { CaseBasics, CaseDetail, CaseSummary } from '../../../../common/src/cams/cases'; +import { CaseBasics, CaseDetail, CaseSummary } from '../../../common/src/cams/cases'; import Factory, { getAssignmentRepository, getCasesGateway, getOfficesGateway } from '../factory'; import { CasesInterface } from './cases.interface'; import { CaseAssignmentUseCase } from './case-assignment'; @@ -8,12 +8,12 @@ import { isCamsError } from '../common-errors/cams-error'; import { AssignmentError } from './assignment.exception'; import { OfficesGateway } from './offices/offices.types'; import { CaseAssignmentRepository } from './gateways.types'; -import { CasesSearchPredicate } from '../../../../common/src/api/search'; -import Actions, { Action, ResourceActions } from '../../../../common/src/cams/actions'; -import { CamsRole } from '../../../../common/src/cams/roles'; -import { getCourtDivisionCodes } from '../../../../common/src/cams/users'; +import { CasesSearchPredicate } from '../../../common/src/api/search'; +import Actions, { Action, ResourceActions } from '../../../common/src/cams/actions'; +import { CamsRole } from '../../../common/src/cams/roles'; +import { getCourtDivisionCodes } from '../../../common/src/cams/users'; import { buildOfficeCode } from './offices/offices'; -import { CaseAssignment } from '../../../../common/src/cams/assignments'; +import { CaseAssignment } from '../../../common/src/cams/assignments'; import { getCamsError } from '../common-errors/error-utilities'; const MODULE_NAME = 'CASE-MANAGEMENT-USE-CASE'; diff --git a/backend/functions/lib/use-cases/cases.interface.d.ts b/backend/lib/use-cases/cases.interface.d.ts similarity index 76% rename from backend/functions/lib/use-cases/cases.interface.d.ts rename to backend/lib/use-cases/cases.interface.d.ts index 99bc1713d..43e71f034 100644 --- a/backend/functions/lib/use-cases/cases.interface.d.ts +++ b/backend/lib/use-cases/cases.interface.d.ts @@ -1,6 +1,6 @@ import { ApplicationContext } from '../adapters/types/basic'; -import { CaseBasics, CaseDetail, CaseSummary } from '../../../../common/src/cams/cases'; -import { CasesSearchPredicate } from '../../../../common/src/api/search'; +import { CaseBasics, CaseDetail, CaseSummary } from '../../../common/src/cams/cases'; +import { CasesSearchPredicate } from '../../../common/src/api/search'; export interface CasesInterface { getCaseDetail(applicationContext: ApplicationContext, caseId: string): Promise; diff --git a/backend/functions/lib/use-cases/courts/courts.test.ts b/backend/lib/use-cases/courts/courts.test.ts similarity index 87% rename from backend/functions/lib/use-cases/courts/courts.test.ts rename to backend/lib/use-cases/courts/courts.test.ts index 9139e382b..26768fb93 100644 --- a/backend/functions/lib/use-cases/courts/courts.test.ts +++ b/backend/lib/use-cases/courts/courts.test.ts @@ -2,8 +2,8 @@ import { CourtsUseCase } from './courts'; import { ApplicationContext } from '../../adapters/types/basic'; import { createMockApplicationContext } from '../../testing/testing-utilities'; import { OfficesUseCase } from '../offices/offices'; -import { USTP_OFFICES_ARRAY } from '../../../../../common/src/cams/offices'; -import { ustpOfficeToCourtDivision } from '../../../../../common/src/cams/courts'; +import { USTP_OFFICES_ARRAY } from '../../../../common/src/cams/offices'; +import { ustpOfficeToCourtDivision } from '../../../../common/src/cams/courts'; describe('Courts use case tests', () => { let useCase: CourtsUseCase; diff --git a/backend/functions/lib/use-cases/courts/courts.ts b/backend/lib/use-cases/courts/courts.ts similarity index 92% rename from backend/functions/lib/use-cases/courts/courts.ts rename to backend/lib/use-cases/courts/courts.ts index 80288c692..03466e307 100644 --- a/backend/functions/lib/use-cases/courts/courts.ts +++ b/backend/lib/use-cases/courts/courts.ts @@ -2,7 +2,7 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { CourtDivisionDetails, ustpOfficeToCourtDivision, -} from '../../../../../common/src/cams/courts'; +} from '../../../../common/src/cams/courts'; import { OfficesUseCase } from '../offices/offices'; export class CourtsUseCase { diff --git a/backend/functions/lib/use-cases/gateways.types.ts b/backend/lib/use-cases/gateways.types.ts similarity index 89% rename from backend/functions/lib/use-cases/gateways.types.ts rename to backend/lib/use-cases/gateways.types.ts index 8479ad768..95d45ed19 100644 --- a/backend/functions/lib/use-cases/gateways.types.ts +++ b/backend/lib/use-cases/gateways.types.ts @@ -4,20 +4,20 @@ import { Order, RawOrderSync, TransferOrderAction, -} from '../../../../common/src/cams/orders'; +} from '../../../common/src/cams/orders'; import { ConsolidationTo, ConsolidationFrom, TransferFrom, TransferTo, -} from '../../../../common/src/cams/events'; -import { CaseAssignmentHistory, CaseHistory } from '../../../../common/src/cams/history'; -import { CaseDocket } from '../../../../common/src/cams/cases'; -import { OrdersSearchPredicate } from '../../../../common/src/api/search'; -import { AttorneyUser, CamsUserGroup, CamsUserReference } from '../../../../common/src/cams/users'; -import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; -import { CaseAssignment } from '../../../../common/src/cams/assignments'; -import { CamsSession } from '../../../../common/src/cams/session'; +} from '../../../common/src/cams/events'; +import { CaseAssignmentHistory, CaseHistory } from '../../../common/src/cams/history'; +import { CaseDocket } from '../../../common/src/cams/cases'; +import { OrdersSearchPredicate } from '../../../common/src/api/search'; +import { AttorneyUser, CamsUserGroup, CamsUserReference } from '../../../common/src/cams/users'; +import { UstpOfficeDetails } from '../../../common/src/cams/offices'; +import { CaseAssignment } from '../../../common/src/cams/assignments'; +import { CamsSession } from '../../../common/src/cams/session'; import { ConditionOrConjunction, Sort } from '../query/query-builder'; import { AcmsConsolidation, AcmsPredicate, AcmsPredicateAndPage } from './acms-orders/acms-orders'; diff --git a/backend/functions/lib/use-cases/offices/offices.test.ts b/backend/lib/use-cases/offices/offices.test.ts similarity index 95% rename from backend/functions/lib/use-cases/offices/offices.test.ts rename to backend/lib/use-cases/offices/offices.test.ts index 494e3d35e..6068ef853 100644 --- a/backend/functions/lib/use-cases/offices/offices.test.ts +++ b/backend/lib/use-cases/offices/offices.test.ts @@ -4,14 +4,14 @@ import { createMockApplicationContext } from '../../testing/testing-utilities'; import * as factory from '../../factory'; import OktaUserGroupGateway from '../../adapters/gateways/okta/okta-user-group-gateway'; import { UserGroupGatewayConfig } from '../../adapters/types/authorization'; -import { CamsUserGroup, Staff } from '../../../../../common/src/cams/users'; -import MockData from '../../../../../common/src/cams/test-utilities/mock-data'; -import { USTP_OFFICES_ARRAY, UstpDivisionMeta } from '../../../../../common/src/cams/offices'; -import { TRIAL_ATTORNEYS } from '../../../../../common/src/cams/test-utilities/attorneys.mock'; +import { CamsUserGroup, Staff } from '../../../../common/src/cams/users'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; +import { USTP_OFFICES_ARRAY, UstpDivisionMeta } from '../../../../common/src/cams/offices'; +import { TRIAL_ATTORNEYS } from '../../../../common/src/cams/test-utilities/attorneys.mock'; import AttorneysList from '../attorneys'; import { MockMongoRepository } from '../../testing/mock-gateways/mock-mongo.repository'; import { MockOfficesRepository } from '../../testing/mock-gateways/mock.offices.repository'; -import { CamsRole } from '../../../../../common/src/cams/roles'; +import { CamsRole } from '../../../../common/src/cams/roles'; describe('offices use case tests', () => { let applicationContext: ApplicationContext; diff --git a/backend/functions/lib/use-cases/offices/offices.ts b/backend/lib/use-cases/offices/offices.ts similarity index 97% rename from backend/functions/lib/use-cases/offices/offices.ts rename to backend/lib/use-cases/offices/offices.ts index b2983f9b4..d700f38a5 100644 --- a/backend/functions/lib/use-cases/offices/offices.ts +++ b/backend/lib/use-cases/offices/offices.ts @@ -1,5 +1,5 @@ -import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; -import { AttorneyUser, Staff } from '../../../../../common/src/cams/users'; +import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; +import { AttorneyUser, Staff } from '../../../../common/src/cams/users'; import { ApplicationContext } from '../../adapters/types/basic'; import { getOfficesGateway, diff --git a/backend/functions/lib/use-cases/offices/offices.types.ts b/backend/lib/use-cases/offices/offices.types.ts similarity index 77% rename from backend/functions/lib/use-cases/offices/offices.types.ts rename to backend/lib/use-cases/offices/offices.types.ts index 53711d67a..854ce6762 100644 --- a/backend/functions/lib/use-cases/offices/offices.types.ts +++ b/backend/lib/use-cases/offices/offices.types.ts @@ -1,4 +1,4 @@ -import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import { ApplicationContext } from '../../adapters/types/basic'; export interface OfficesGateway { diff --git a/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts b/backend/lib/use-cases/orders/orders-consolidation-approval.test.ts similarity index 96% rename from backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts rename to backend/lib/use-cases/orders/orders-consolidation-approval.test.ts index 5db22292c..e7bb63a8b 100644 --- a/backend/functions/lib/use-cases/orders/orders-consolidation-approval.test.ts +++ b/backend/lib/use-cases/orders/orders-consolidation-approval.test.ts @@ -7,15 +7,15 @@ import { getCasesRepository } from '../../factory'; import { ConsolidationOrderActionApproval, getCaseSummaryFromConsolidationOrderCase, -} from '../../../../../common/src/cams/orders'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +} from '../../../../common/src/cams/orders'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { ApplicationContext } from '../../adapters/types/basic'; import * as crypto from 'crypto'; -import { CaseHistory, ConsolidationOrderSummary } from '../../../../../common/src/cams/history'; +import { CaseHistory, ConsolidationOrderSummary } from '../../../../common/src/cams/history'; import { CaseAssignmentUseCase } from '../case-assignment'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { SYSTEM_USER_REFERENCE } from '../../../../../common/src/cams/auditable'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { SYSTEM_USER_REFERENCE } from '../../../../common/src/cams/auditable'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; import { MockMongoRepository } from '../../testing/mock-gateways/mock-mongo.repository'; describe('Orders use case', () => { diff --git a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts b/backend/lib/use-cases/orders/orders-local-gateway.test.ts similarity index 94% rename from backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts rename to backend/lib/use-cases/orders/orders-local-gateway.test.ts index bdd542b3b..9e67bd285 100644 --- a/backend/functions/lib/use-cases/orders/orders-local-gateway.test.ts +++ b/backend/lib/use-cases/orders/orders-local-gateway.test.ts @@ -1,18 +1,18 @@ -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { ConsolidationOrder, ConsolidationOrderActionApproval, -} from '../../../../../common/src/cams/orders'; +} from '../../../../common/src/cams/orders'; import { Factory } from '../../factory'; import { CasesRepository, ConsolidationOrdersRepository } from '../gateways.types'; -import { ConsolidationFrom, ConsolidationTo } from '../../../../../common/src/cams/events'; +import { ConsolidationFrom, ConsolidationTo } from '../../../../common/src/cams/events'; import { createMockApplicationContext, createMockApplicationContextSession, } from '../../testing/testing-utilities'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; import { LocalCasesRepository } from '../../testing/local-data/local-cases-repository'; import { LocalConsolidationOrdersRepository } from '../../testing/local-data/local-consolidation-orders-repository'; import { OrdersUseCase } from './orders'; diff --git a/backend/functions/lib/use-cases/orders/orders.test.ts b/backend/lib/use-cases/orders/orders.test.ts similarity index 97% rename from backend/functions/lib/use-cases/orders/orders.test.ts rename to backend/lib/use-cases/orders/orders.test.ts index bceff338e..dd6fdb0e7 100644 --- a/backend/functions/lib/use-cases/orders/orders.test.ts +++ b/backend/lib/use-cases/orders/orders.test.ts @@ -17,29 +17,29 @@ import { getCaseSummaryFromTransferOrder, TransferOrder, TransferOrderAction, -} from '../../../../../common/src/cams/orders'; +} from '../../../../common/src/cams/orders'; import { ConsolidationFrom, ConsolidationTo, TransferFrom, TransferTo, -} from '../../../../../common/src/cams/events'; +} from '../../../../common/src/cams/events'; import { CASE_SUMMARIES } from '../../testing/mock-data/case-summaries.mock'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { CasesLocalGateway } from '../../adapters/gateways/cases.local.gateway'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; +import { CaseSummary } from '../../../../common/src/cams/cases'; import { ApplicationContext } from '../../adapters/types/basic'; import { NotFoundError } from '../../common-errors/not-found-error'; import * as crypto from 'crypto'; -import { CaseHistory, ConsolidationOrderSummary } from '../../../../../common/src/cams/history'; +import { CaseHistory, ConsolidationOrderSummary } from '../../../../common/src/cams/history'; import { MockOrdersGateway } from '../../testing/mock-gateways/mock.orders.gateway'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { getCamsUserReference } from '../../../../../common/src/cams/session'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { getCamsUserReference } from '../../../../common/src/cams/session'; import { CaseAssignmentUseCase } from '../case-assignment'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; -import { getCourtDivisionCodes } from '../../../../../common/src/cams/users'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; +import { getCourtDivisionCodes } from '../../../../common/src/cams/users'; import { MockMongoRepository } from '../../testing/mock-gateways/mock-mongo.repository'; -import { UstpDivisionMeta } from '../../../../../common/src/cams/offices'; +import { UstpDivisionMeta } from '../../../../common/src/cams/offices'; describe('Orders use case', () => { const CASE_ID = '000-11-22222'; diff --git a/backend/functions/lib/use-cases/orders/orders.ts b/backend/lib/use-cases/orders/orders.ts similarity index 96% rename from backend/functions/lib/use-cases/orders/orders.ts rename to backend/lib/use-cases/orders/orders.ts index 20b51a78a..06d49ed0f 100644 --- a/backend/functions/lib/use-cases/orders/orders.ts +++ b/backend/lib/use-cases/orders/orders.ts @@ -14,30 +14,30 @@ import { ConsolidationType, getCaseSummaryFromTransferOrder, getCaseSummaryFromConsolidationOrderCase, -} from '../../../../../common/src/cams/orders'; +} from '../../../../common/src/cams/orders'; import { ConsolidationFrom, ConsolidationTo, TransferFrom, TransferTo, -} from '../../../../../common/src/cams/events'; -import { CaseSummary } from '../../../../../common/src/cams/cases'; +} from '../../../../common/src/cams/events'; +import { CaseSummary } from '../../../../common/src/cams/cases'; import { CamsError } from '../../common-errors/cams-error'; -import { sortDates, sortDatesReverse } from '../../../../../common/src/date-helper'; +import { sortDates, sortDatesReverse } from '../../../../common/src/date-helper'; import * as crypto from 'crypto'; import { CaseConsolidationHistory, CaseHistory, ConsolidationOrderSummary, isConsolidationHistory, -} from '../../../../../common/src/cams/history'; +} from '../../../../common/src/cams/history'; import { CaseAssignmentUseCase } from '../case-assignment'; import { BadRequestError } from '../../common-errors/bad-request'; -import { CamsUserReference, getCourtDivisionCodes } from '../../../../../common/src/cams/users'; -import { CamsRole } from '../../../../../common/src/cams/roles'; +import { CamsUserReference, getCourtDivisionCodes } from '../../../../common/src/cams/users'; +import { CamsRole } from '../../../../common/src/cams/roles'; import { UnauthorizedError } from '../../common-errors/unauthorized-error'; -import { createAuditRecord } from '../../../../../common/src/cams/auditable'; -import { OrdersSearchPredicate } from '../../../../../common/src/api/search'; +import { createAuditRecord } from '../../../../common/src/cams/auditable'; +import { OrdersSearchPredicate } from '../../../../common/src/api/search'; import { isNotFoundError } from '../../common-errors/not-found-error'; import { Factory } from '../../factory'; diff --git a/backend/functions/lib/use-cases/user-session/user-session.test.ts b/backend/lib/use-cases/user-session/user-session.test.ts similarity index 93% rename from backend/functions/lib/use-cases/user-session/user-session.test.ts rename to backend/lib/use-cases/user-session/user-session.test.ts index 4097bc89a..72f1aad3c 100644 --- a/backend/functions/lib/use-cases/user-session/user-session.test.ts +++ b/backend/lib/use-cases/user-session/user-session.test.ts @@ -1,17 +1,17 @@ import { UserSessionUseCase } from './user-session'; import { ApplicationContext } from '../../adapters/types/basic'; import { createMockApplicationContext } from '../../testing/testing-utilities'; -import { MockData } from '../../../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { UnauthorizedError } from '../../common-errors/unauthorized-error'; import * as factoryModule from '../../factory'; import { ServerConfigError } from '../../common-errors/server-config-error'; -import { CamsSession } from '../../../../../common/src/cams/session'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { urlRegex } from '../../../../../common/src/cams/test-utilities/regex'; -import { CamsJwtHeader } from '../../../../../common/src/cams/jwt'; +import { CamsSession } from '../../../../common/src/cams/session'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { urlRegex } from '../../../../common/src/cams/test-utilities/regex'; +import { CamsJwtHeader } from '../../../../common/src/cams/jwt'; import MockOpenIdConnectGateway from '../../testing/mock-gateways/mock-oauth2-gateway'; import * as Verifier from '../../adapters/gateways/okta/HumbleVerifier'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; import { MockMongoRepository } from '../../testing/mock-gateways/mock-mongo.repository'; import { NotFoundError } from '../../common-errors/not-found-error'; diff --git a/backend/functions/lib/use-cases/user-session/user-session.ts b/backend/lib/use-cases/user-session/user-session.ts similarity index 89% rename from backend/functions/lib/use-cases/user-session/user-session.ts rename to backend/lib/use-cases/user-session/user-session.ts index 04fd1ff9d..83378b55a 100644 --- a/backend/functions/lib/use-cases/user-session/user-session.ts +++ b/backend/lib/use-cases/user-session/user-session.ts @@ -3,11 +3,11 @@ import { ApplicationContext } from '../../adapters/types/basic'; import { UnauthorizedError } from '../../common-errors/unauthorized-error'; import { isCamsError } from '../../common-errors/cams-error'; import { ServerConfigError } from '../../common-errors/server-config-error'; -import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; +import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; import LocalStorageGateway from '../../adapters/gateways/storage/local-storage-gateway'; -import { CamsRole } from '../../../../../common/src/cams/roles'; -import { CamsSession } from '../../../../../common/src/cams/session'; -import { REGION_02_GROUP_NY } from '../../../../../common/src/cams/test-utilities/mock-user'; +import { CamsRole } from '../../../../common/src/cams/roles'; +import { CamsSession } from '../../../../common/src/cams/session'; +import { REGION_02_GROUP_NY } from '../../../../common/src/cams/test-utilities/mock-user'; import { isNotFoundError } from '../../common-errors/not-found-error'; const MODULE_NAME = 'USER-SESSION-GATEWAY'; diff --git a/backend/functions/package-lock.json b/backend/package-lock.json similarity index 100% rename from backend/functions/package-lock.json rename to backend/package-lock.json diff --git a/backend/functions/package.json b/backend/package.json similarity index 74% rename from backend/functions/package.json rename to backend/package.json index ec0ebc375..dc59fdb44 100644 --- a/backend/functions/package.json +++ b/backend/package.json @@ -44,22 +44,22 @@ "scripts": { "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage", "build": "tsc --build tsconfig.build.json", - "build-common": "pushd ../../common && npm ci && npm run build && popd", + "build-common": "pushd ../common && npm ci && npm run build && popd", "watch": "tsc --project tsconfig.build.json -w", "prestart": "npm run build", "start": "func start --typescript", "start:dev": "nodemon --esm src/server.ts", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", - "lint": "eslint .", - "lint:fix": "eslint . --fix", - "format": "prettier --write './**/*.{js,ts,css,md,json}' --config ./.prettierrc", - "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip . --exclude @.funcignore --exclude .funcignore && mv /tmp/build/$OUT.zip .", + "lint": "eslint functions", + "lint:fix": "eslint functions --fix", + "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", + "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude @.funcignore --exclude .funcignore && mv /tmp/build/$OUT.zip .", "coverage": "npm test -- --coverage", "coverage:ci": "npm config set script-shell=/bin/bash && npm run build-common && npm test -- --coverage", - "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", - "dependency-cruiser:ci": "npx depcruise --output-type err-long attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync lib ", - "itest:okta-group-api": "CAMS_LOGIN_PROVIDER=okta npx ts-node ./lib/testing/isolated-integration/test-okta-group-api.ts", - "itest:export-office-csv": "CAMS_LOGIN_PROVIDER=okta npx ts-node ./lib/testing/isolated-integration/export-office-csv.ts" + "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", + "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", + "itest:okta-group-api": "CAMS_LOGIN_PROVIDER=okta npx ts-node lib/testing/isolated-integration/test-okta-group-api.ts", + "itest:export-office-csv": "CAMS_LOGIN_PROVIDER=okta npx ts-node ../lib/testing/isolated-integration/export-office-csv.ts" } } diff --git a/backend/functions/tsconfig.build.json b/backend/tsconfig.build.json similarity index 100% rename from backend/functions/tsconfig.build.json rename to backend/tsconfig.build.json diff --git a/backend/functions/tsconfig.json b/backend/tsconfig.json similarity index 81% rename from backend/functions/tsconfig.json rename to backend/tsconfig.json index ce3ea8bb6..ab1da766c 100644 --- a/backend/functions/tsconfig.json +++ b/backend/tsconfig.json @@ -7,6 +7,6 @@ "strict": false, "resolveJsonModule": true }, - "references": [{ "path": "../../common" }], + "references": [{ "path": "../common"}], "exclude": ["node_modules"] } From 05ed5c839d643a05fad0909c05408f95004e9c22 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:48:38 -0500 Subject: [PATCH 065/112] Fix backend start path Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index dc59fdb44..b7c5a25c8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -47,7 +47,7 @@ "build-common": "pushd ../common && npm ci && npm run build && popd", "watch": "tsc --project tsconfig.build.json -w", "prestart": "npm run build", - "start": "func start --typescript", + "start": "pushd functions && func start --typescript && popd", "start:dev": "nodemon --esm src/server.ts", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", From 6abe1b2768272b248fa93754617a2edfa7fd8221 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:53:03 -0600 Subject: [PATCH 066/112] Change workflow paths to api Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- .github/workflows/continuous-deployment.yml | 2 +- .github/workflows/sub-build.yml | 4 ++-- .github/workflows/sub-security-scan.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 6bd1aee47..a69c4415f 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -88,7 +88,7 @@ jobs: unit-test-backend: uses: ./.github/workflows/reusable-unit-test.yml with: - path: backend/functions + path: backend node-version: ${{ vars.NODE_VERSION }} unit-test-common: diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 1e9f704d1..8d75b086d 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -84,7 +84,7 @@ jobs: backend: defaults: run: - working-directory: backend/functions + working-directory: backend runs-on: ubuntu-latest environment: ${{ inputs.environment }} @@ -107,5 +107,5 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.apiName }}-build - path: backend/functions/${{ inputs.apiName }}.zip + path: backend/${{ inputs.apiName }}.zip if-no-files-found: error diff --git a/.github/workflows/sub-security-scan.yml b/.github/workflows/sub-security-scan.yml index 45d33114e..dd6f78a53 100644 --- a/.github/workflows/sub-security-scan.yml +++ b/.github/workflows/sub-security-scan.yml @@ -12,7 +12,7 @@ jobs: sca-scan-backend: uses: ./.github/workflows/reusable-sca-scan.yml with: - path: backend/functions + path: backend secrets: inherit # pragma: allowlist secret sca-scan-common: From 1135cff5761967fec3a06a9a9123593d905b8b61 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:02:22 -0600 Subject: [PATCH 067/112] Fix remaining path issues Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- .github/workflows/sub-build.yml | 2 +- ops/scripts/utility/clean-all-projects.sh | 2 +- ops/scripts/utility/clean-install-all-projects.sh | 2 +- package.json | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 8d75b086d..88151447a 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -93,7 +93,7 @@ jobs: - uses: actions/checkout@v3 - name: Execute Build run: | - pushd ../../common + pushd ../common npm ci popd diff --git a/ops/scripts/utility/clean-all-projects.sh b/ops/scripts/utility/clean-all-projects.sh index 568fdde6e..04247a166 100755 --- a/ops/scripts/utility/clean-all-projects.sh +++ b/ops/scripts/utility/clean-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend/functions" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit diff --git a/ops/scripts/utility/clean-install-all-projects.sh b/ops/scripts/utility/clean-install-all-projects.sh index a6278cebe..bec66001e 100755 --- a/ops/scripts/utility/clean-install-all-projects.sh +++ b/ops/scripts/utility/clean-install-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend/functions" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit diff --git a/package.json b/package.json index a6c5ab260..5ce5ce99c 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "scripts": { "clean:all": "./ops/scripts/utility/clean-all-projects.sh", "ci:all": "./ops/scripts/utility/clean-install-all-projects.sh", - "start:backend": "cd backend/functions && npm run start", + "start:backend": "cd backend && npm run start", "start:frontend": "cd user-interface && npm run start", "build": "npm run build:common && npm run build:backend && npm run build:frontend", - "build:backend": "cd backend/functions && npm run build", + "build:backend": "cd backend && npm run build", "build:frontend": "cd user-interface && npm run build", "build:common": "cd common && npm run build", "clean-and-build": "npm run clean:all && npm run ci:all && npm run build" From 73ebee820ffb1dc769cb8b32b5a3f12210290967 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:12:19 -0600 Subject: [PATCH 068/112] Fix backend zip creation Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index b7c5a25c8..4aee8079a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -54,7 +54,7 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude @.funcignore --exclude .funcignore && mv /tmp/build/$OUT.zip .", + "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude functions/@.funcignore --exclude functions/.funcignore && mv /tmp/build/$OUT.zip .", "coverage": "npm test -- --coverage", "coverage:ci": "npm config set script-shell=/bin/bash && npm run build-common && npm test -- --coverage", "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", From d23584f56077b8a2c769656ce73b2a4439926241 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Fri, 6 Dec 2024 17:47:50 -0500 Subject: [PATCH 069/112] separate durable function and workflow accomodations refactor to create separate functionApps for durable and non durable functions, updated workflows and scripts to accomodate for the addition Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .github/workflows/continuous-deployment.yml | 19 ++- .github/workflows/reusable-backend-slot.yml | 14 +- .github/workflows/reusable-build-info.yml | 25 +-- .../workflows/reusable-database-deploy.yml | 7 +- .github/workflows/reusable-e2e.yml | 8 +- .github/workflows/reusable-endpoint-test.yml | 6 +- .github/workflows/reusable-frontend-slot.yml | 4 +- .github/workflows/sub-build.yml | 25 ++- .github/workflows/sub-deploy-code-slot.yml | 124 +++++++++++--- .github/workflows/sub-deploy-code.yml | 59 +++++-- .../workflows/sub-deploy-slot-resources.yml | 10 +- .github/workflows/sub-deploy.yml | 15 +- .gitignore | 3 + backend/functions/{ => api}/.funcignore | 0 .../attorneys/attorneys.function.test.ts | 16 +- .../{ => api}/attorneys/attorneys.function.ts | 8 +- .../case.assignment.function.test.ts | 20 +-- .../case.assignment.function.ts | 8 +- .../case-associated.function.test.ts | 12 +- .../case-associated.function.ts | 8 +- .../case-docket/case-docket.function.test.ts | 14 +- .../case-docket/case-docket.function.ts | 8 +- .../case-history.function.test.ts | 18 +-- .../case-history/case-history.function.ts | 8 +- .../case-summary.function.test.ts | 14 +- .../case-summary/case-summary.function.ts | 8 +- .../{ => api}/cases/cases.function.test.ts | 19 ++- .../{ => api}/cases/cases.function.ts | 8 +- .../consolidations.function.test.ts | 14 +- .../consolidations/consolidations.function.ts | 8 +- .../{ => api}/courts/courts.function.test.ts | 10 +- .../{ => api}/courts/courts.function.ts | 6 +- .../healthcheck/healthcheck.db.cosmos.test.ts | 8 +- .../healthcheck/healthcheck.db.cosmos.ts | 10 +- .../healthcheck/healthcheck.db.sql.ts | 4 +- .../healthcheck/healthcheck.function.ts | 12 +- .../{ => api}/healthcheck/healthcheck.info.ts | 2 +- .../{ => api}/healthcheck/healthcheck.test.ts | 4 +- backend/functions/api/host.json | 25 +++ .../{ => api}/me/me.function.test.ts | 14 +- backend/functions/{ => api}/me/me.function.ts | 6 +- .../{ => api}/oauth2/mock-oauth2.function.ts | 8 +- .../office-staff-sync.function.test.ts | 8 +- .../office-staff-sync.function.ts | 8 +- .../offices/offices.function.test.ts | 12 +- .../{ => api}/offices/offices.function.ts | 6 +- .../orders-manual-sync.function.test.ts | 13 +- .../orders-manual-sync.function.ts | 8 +- .../orders-suggestions.function.test.ts | 12 +- .../orders-suggestions.function.ts | 8 +- .../orders-sync/orders-sync.function.test.ts | 10 +- .../orders-sync/orders-sync.function.ts | 8 +- .../{ => api}/orders/orders.function.test.ts | 16 +- .../{ => api}/orders/orders.function.ts | 8 +- backend/functions/api/package-lock.json | 105 ++++++++++++ backend/functions/api/package.json | 10 ++ backend/functions/api/tsconfig.build.json | 7 + backend/functions/migration/.funcignore | 15 ++ backend/functions/{ => migration}/host.json | 0 backend/functions/migration/package-lock.json | 105 ++++++++++++ backend/functions/migration/package.json | 10 ++ .../functions/migration/tsconfig.build.json | 7 + backend/lib/load-env.ts | 8 + backend/package.json | 18 ++- backend/tsconfig.build.json | 5 +- ops/cloud-deployment/backend-api-deploy.bicep | 153 ++++++++++++++---- .../frontend-webapp-deploy.bicep | 6 +- .../lib/network/ustp-cams-network.bicep | 113 +++++++++---- ops/cloud-deployment/main.bicep | 43 +++-- ops/scripts/pipeline/azure-deploy.sh | 28 +++- ops/scripts/pipeline/endpoint-test.sh | 6 +- .../slots/az-slot-api-resource-deploy.sh | 62 ++++--- .../slots/az-slot-web-resource-deploy.sh | 6 +- .../utility/clean-install-all-projects.sh | 4 +- package.json | 10 +- 75 files changed, 1053 insertions(+), 404 deletions(-) rename backend/functions/{ => api}/.funcignore (100%) rename backend/functions/{ => api}/attorneys/attorneys.function.test.ts (78%) rename backend/functions/{ => api}/attorneys/attorneys.function.ts (75%) rename backend/functions/{ => api}/case-assignments/case.assignment.function.test.ts (85%) rename backend/functions/{ => api}/case-assignments/case.assignment.function.ts (75%) rename backend/functions/{ => api}/case-associated/case-associated.function.test.ts (77%) rename backend/functions/{ => api}/case-associated/case-associated.function.ts (74%) rename backend/functions/{ => api}/case-docket/case-docket.function.test.ts (73%) rename backend/functions/{ => api}/case-docket/case-docket.function.ts (77%) rename backend/functions/{ => api}/case-history/case-history.function.test.ts (74%) rename backend/functions/{ => api}/case-history/case-history.function.ts (75%) rename backend/functions/{ => api}/case-summary/case-summary.function.test.ts (79%) rename backend/functions/{ => api}/case-summary/case-summary.function.ts (75%) rename backend/functions/{ => api}/cases/cases.function.test.ts (72%) rename backend/functions/{ => api}/cases/cases.function.ts (76%) rename backend/functions/{ => api}/consolidations/consolidations.function.test.ts (87%) rename backend/functions/{ => api}/consolidations/consolidations.function.ts (76%) rename backend/functions/{ => api}/courts/courts.function.test.ts (79%) rename backend/functions/{ => api}/courts/courts.function.ts (80%) rename backend/functions/{ => api}/healthcheck/healthcheck.db.cosmos.test.ts (85%) rename backend/functions/{ => api}/healthcheck/healthcheck.db.cosmos.ts (87%) rename backend/functions/{ => api}/healthcheck/healthcheck.db.sql.ts (85%) rename backend/functions/{ => api}/healthcheck/healthcheck.function.ts (86%) rename backend/functions/{ => api}/healthcheck/healthcheck.info.ts (90%) rename backend/functions/{ => api}/healthcheck/healthcheck.test.ts (91%) create mode 100644 backend/functions/api/host.json rename backend/functions/{ => api}/me/me.function.test.ts (72%) rename backend/functions/{ => api}/me/me.function.ts (79%) rename backend/functions/{ => api}/oauth2/mock-oauth2.function.ts (73%) rename backend/functions/{ => api}/office-staff-sync/office-staff-sync.function.test.ts (79%) rename backend/functions/{ => api}/office-staff-sync/office-staff-sync.function.ts (72%) rename backend/functions/{ => api}/offices/offices.function.test.ts (81%) rename backend/functions/{ => api}/offices/offices.function.ts (81%) rename backend/functions/{ => api}/orders-manual-sync/orders-manual-sync.function.test.ts (81%) rename backend/functions/{ => api}/orders-manual-sync/orders-manual-sync.function.ts (82%) rename backend/functions/{ => api}/orders-suggestions/orders-suggestions.function.test.ts (79%) rename backend/functions/{ => api}/orders-suggestions/orders-suggestions.function.ts (76%) rename backend/functions/{ => api}/orders-sync/orders-sync.function.test.ts (81%) rename backend/functions/{ => api}/orders-sync/orders-sync.function.ts (72%) rename backend/functions/{ => api}/orders/orders.function.test.ts (84%) rename backend/functions/{ => api}/orders/orders.function.ts (75%) create mode 100644 backend/functions/api/package-lock.json create mode 100644 backend/functions/api/package.json create mode 100644 backend/functions/api/tsconfig.build.json create mode 100644 backend/functions/migration/.funcignore rename backend/functions/{ => migration}/host.json (100%) create mode 100644 backend/functions/migration/package-lock.json create mode 100644 backend/functions/migration/package.json create mode 100644 backend/functions/migration/tsconfig.build.json create mode 100644 backend/lib/load-env.ts diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index a69c4415f..0673aa766 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -29,7 +29,9 @@ on: - "false" - "true" enableBicepDeployment: - description: "enableBicepDeployment: Execute main.bicep deployment for application component Azure resources" + description: + "enableBicepDeployment: Execute main.bicep deployment for application component Azure + resources" required: true default: "false" type: choice @@ -109,12 +111,13 @@ jobs: secrets: inherit # pragma: allowlist secret with: nodeVersion: ${{ vars.NODE_VERSION }} - apiName: ${{ needs.setup.outputs.apiName }} - camsServerHostname: ${{ needs.setup.outputs.apiName }}.azurewebsites${{ vars.AZ_HOSTNAME_SUFFIX }} + camsServerHostname: ${{ needs.setup.outputs.apiFunctionName }}.azurewebsites${{ vars.AZ_HOSTNAME_SUFFIX }} camsServerPort: ${{ vars.CAMS_SERVER_PORT }} camsServerProtocol: ${{ vars.CAMS_SERVER_PROTOCOL }} camsBasePath: ${{ vars.CAMS_BASE_PATH }} webappName: ${{ needs.setup.outputs.webappName }} + apiFunctionName: ${{ needs.setup.outputs.apiFunctionName }} + migrationFunctionName: ${{ needs.setup.outputs.migrationFunctionName }} environment: ${{ needs.setup.outputs.ghaEnvironment }} launchDarklyEnvironment: ${{ vars.CAMS_LAUNCH_DARKLY_ENV }} @@ -131,13 +134,16 @@ jobs: unit-test-backend, unit-test-common, ] - if: ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/dependency-updates-auto') || (inputs.deployBranch == 'true')) + if: + ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/dependency-updates-auto') || + (inputs.deployBranch == 'true')) with: ghaEnvironment: ${{ needs.setup.outputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ needs.setup.outputs.azResourceGrpAppEncrypted }} azResourceGrpNetworkEncrypted: ${{ needs.setup.outputs.azResourceGrpNetworkEncrypted }} stackName: ${{ needs.setup.outputs.stackName }} - apiName: ${{ needs.setup.outputs.apiName }} + apiFunctionName: ${{ needs.setup.outputs.apiFunctionName }} + migrationFunctionName: ${{ needs.setup.outputs.migrationFunctionName }} webAppName: ${{ needs.setup.outputs.webappName }} environmentHash: ${{ needs.setup.outputs.environmentHash }} execVnetDeploy: ${{ needs.setup.outputs.execVnetDeploy }} @@ -154,7 +160,8 @@ jobs: ghaEnvironment: ${{ needs.setup.outputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ needs.setup.outputs.azResourceGrpAppEncrypted }} stackName: ${{ needs.setup.outputs.stackName }} - apiName: ${{ needs.setup.outputs.apiName }} + apiFunctionName: ${{ needs.setup.outputs.apiFunctionName }} + migrationFunctionName: ${{ needs.setup.outputs.migrationFunctionName }} webAppName: ${{ needs.setup.outputs.webappName }} environmentHash: ${{ needs.setup.outputs.environmentHash }} slotName: ${{ needs.setup.outputs.slotName }} diff --git a/.github/workflows/reusable-backend-slot.yml b/.github/workflows/reusable-backend-slot.yml index c4c8cdd12..696a58a99 100644 --- a/.github/workflows/reusable-backend-slot.yml +++ b/.github/workflows/reusable-backend-slot.yml @@ -6,7 +6,10 @@ on: webAppName: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string ghaEnvironment: @@ -51,16 +54,19 @@ jobs: - name: Create API Slot Resource run: | - slotStorageAccountName=ustpslot${{ inputs.environmentHash }} + migrationSlotStorageAccountName=ustpslot${{ inputs.environmentHash }} + apiSlotStorageAccountName=migrationslot${{ inputs.environmentHash }} ./ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh \ --resourceGroup ${{ steps.rgApp.outputs.out }} \ --idResourceGroup ${{ secrets.AZURE_RG }} \ - --apiName ${{ inputs.apiName }} \ + --apiFunctionName ${{ inputs.apiFunctionName }} \ + --migrationFunctionName ${{ inputs.migrationFunctionName }} \ --webappName ${{ inputs.webappName }} \ --slotName ${{ inputs.slotName }} \ --kvIdName ${{ secrets.AZ_KV_APP_CONFIG_MANAGED_ID }} \ --sqlIdName ${{ secrets.AZ_SQL_IDENTITY_NAME }} \ - --storageAccName ${slotStorageAccountName:0:24} \ + --apiStorageAccName ${migrationSlotStorageAccountName:0:24} \ + --migrationStorageAccName ${apiSlotStorageAccountName:0:24} \ --databaseName ${{ secrets.AZ_COSMOS_DATABASE_NAME }} \ --infoSha ${{ inputs.environmentHash || 'DOES_NOT_EXIST' }} diff --git a/.github/workflows/reusable-build-info.yml b/.github/workflows/reusable-build-info.yml index 33fbb92e9..416438e0f 100644 --- a/.github/workflows/reusable-build-info.yml +++ b/.github/workflows/reusable-build-info.yml @@ -19,9 +19,9 @@ on: webappName: description: "Expected Web Application name [used for Azure Resource]" value: ${{ jobs.build-info.outputs.webappName }} - apiName: + apiFunctionName: description: "" - value: ${{ jobs.build-info.outputs.apiName }} + value: ${{ jobs.build-info.outputs.apiFunctionName }} azResourceGrpAppEncrypted: description: "" value: ${{ jobs.build-info.outputs.azResourceGrpAppEncrypted }} @@ -31,6 +31,9 @@ on: environmentHash: description: "" value: ${{ jobs.build-info.outputs.environmentHash }} + migrationFunctionName: + description: "" + value: ${{ jobs.build-info.outputs.migrationFunctionName }} slotName: description: "" value: ${{ jobs.build-info.outputs.slotName }} @@ -56,12 +59,13 @@ jobs: outputs: stackName: ${{ steps.build-info.outputs.stackName }} webappName: ${{ steps.build-info.outputs.webappName }} - apiName: ${{ steps.build-info.outputs.apiName }} + apiFunctionName: ${{ steps.build-info.outputs.apiFunctionName }} azResourceGrpAppEncrypted: ${{ steps.rgApp.outputs.out }} azResourceGrpNetworkEncrypted: ${{ steps.rgNetwork.outputs.out }} environmentHash: ${{ steps.check-env.outputs.environmentHash }} execVnetDeploy: ${{ steps.build-info.outputs.execVnetDeploy }} slotName: ${{ steps.build-info.outputs.slotName }} + migrationFunctionName: ${{ steps.build-info.outputs.migrationFunctionName }} deployBicep: ${{ steps.check-bicep.outputs.deployBicep }} initialDeployment: ${{ steps.check-initial-deployment.outputs.initialDeployment }} steps: @@ -101,9 +105,11 @@ jobs: stackName=$(ops/scripts/pipeline/generate-stackname.sh ${{ inputs.environment }} ${{ vars.APP_NAME }} ${{ vars.DEV_SUFFIX }} ${{ github.ref_name }}) echo "Stack Name: $stackName" webappName="${stackName}-webapp" - echo "Webapp Artifact: $webappName" - apiName="${stackName}-node-api" - echo "Api Artifact: $apiName" + echo "Webapp Name: $webappName" + apiFunctionName="${stackName}-node-api" + echo "Api Function Name: $apiFunctionName" + migrationFunctionName="${stackName}-migration" + echo "Migration Function Name: $migrationFunctionName" # Deployment flags echo "Bicep Deployment Flag: ${{ inputs.enableBicepDeployment == 'true' }}" @@ -115,7 +121,8 @@ jobs: echo "azResourceGrpNetwork=${{ secrets.AZ_NETWORK_RG }}${resourceGroupSuffix}" >> $GITHUB_OUTPUT echo "stackName=${stackName}" >> $GITHUB_OUTPUT echo "webappName=${webappName}" >> $GITHUB_OUTPUT - echo "apiName=${apiName}" >> $GITHUB_OUTPUT + echo "apiFunctionName=${apiFunctionName}" >> $GITHUB_OUTPUT + echo "migrationFunctionName=${migrationFunctionName}" >> $GITHUB_OUTPUT echo "execVnetDeploy=${execVnetDeploy}" >> $GITHUB_OUTPUT echo "slotName=${{ vars.SLOT_NAME }}" >> $GITHUB_OUTPUT @@ -140,10 +147,10 @@ jobs: op: decode in: ${{ steps.rgApp.outputs.out }} - - name: Check Initial Deployment + - name: Check Initial Deployment # update flag --apiName to --apiFunctionName id: check-initial-deployment run: | - initialDeployment=$(./ops/scripts/pipeline/check-for-environment.sh --resource-group ${{ steps.rgAppDecode.outputs.out }} --webappName ${{ steps.build-info.outputs.webappName }} --apiName ${{ steps.build-info.outputs.apiName }}) + initialDeployment=$(./ops/scripts/pipeline/check-for-environment.sh --resource-group ${{ steps.rgAppDecode.outputs.out }} --webappName ${{ steps.build-info.outputs.webappName }} --apiName ${{ steps.build-info.outputs.apiFunctionName }}) echo "initialDeployment=${initialDeployment}" >> $GITHUB_OUTPUT echo "Initial Deployment: ${initialDeployment}" diff --git a/.github/workflows/reusable-database-deploy.yml b/.github/workflows/reusable-database-deploy.yml index 97484d6c0..d90cedc64 100644 --- a/.github/workflows/reusable-database-deploy.yml +++ b/.github/workflows/reusable-database-deploy.yml @@ -9,7 +9,10 @@ on: azResourceGrpNetworkEncrypted: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string environmentHash: @@ -57,7 +60,7 @@ jobs: - name: Deploy Cosmos MongoDB id: azure-mongodb-deploy run: | - allowedNetworks=$(az network vnet subnet list -g ${{ steps.rgNetwork.outputs.out }} --vnet-name ${{ vars.AZ_NETWORK_VNET_NAME }} --query "[?name=='snet-${{ inputs.apiName }}'].id" -o json) + allowedNetworks=$(az network vnet subnet list -g ${{ steps.rgNetwork.outputs.out }} --vnet-name ${{ vars.AZ_NETWORK_VNET_NAME }} --query "[?name=='snet-${{ inputs.apiFunctionName }}' || name=='snet-${{inputs.migrationFunctionName}}'].id" -o json) ./ops/scripts/pipeline/az-cosmos-deploy.sh \ -g ${{ secrets.AZURE_RG }} \ diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml index b8cf09533..4477c8ce9 100644 --- a/.github/workflows/reusable-e2e.yml +++ b/.github/workflows/reusable-e2e.yml @@ -3,7 +3,7 @@ name: End-to-end Tests on: workflow_call: inputs: - apiName: + apiFunctionName: required: true type: string slotName: @@ -75,13 +75,13 @@ jobs: fi echo "Seeding E2E CosmosDB..." - curl -v -d '{"txIdOverride": '0'}' -H "Content-Type: application/json" https://${{ inputs.apiName }}.azurewebsites${{ vars.AZ_HOSTNAME_SUFFIX }}/api/orders-sync?x-ms-routing-name=${{ inputs.slotName }} + curl -v -d '{"txIdOverride": '0'}' -H "Content-Type: application/json" https://${{ inputs.apiFunctionName }}.azurewebsites${{ vars.AZ_HOSTNAME_SUFFIX }}/api/orders-sync?x-ms-routing-name=${{ inputs.slotName }} - name: Restart API and Install Node dependencies working-directory: test/e2e run: | - az functionapp restart --name ${{ inputs.apiName }} --resource-group ${{ steps.rgApp.outputs.out }} & az webapp restart --name ${{ inputs.webappName }} --resource-group ${{ steps.rgApp.outputs.out }} - az functionapp restart --name ${{ inputs.apiName }} --resource-group ${{ steps.rgApp.outputs.out }} --slot staging & az webapp restart --name ${{ inputs.webappName }} --resource-group ${{ steps.rgApp.outputs.out }} --slot staging + az functionapp restart --name ${{ inputs.apiFunctionName }} --resource-group ${{ steps.rgApp.outputs.out }} & az webapp restart --name ${{ inputs.webappName }} --resource-group ${{ steps.rgApp.outputs.out }} + az functionapp restart --name ${{ inputs.apiFunctionName }} --resource-group ${{ steps.rgApp.outputs.out }} --slot staging & az webapp restart --name ${{ inputs.webappName }} --resource-group ${{ steps.rgApp.outputs.out }} --slot staging sleep 10 npm ci npx playwright install chromium msedge diff --git a/.github/workflows/reusable-endpoint-test.yml b/.github/workflows/reusable-endpoint-test.yml index 502f13d01..3eebf6842 100644 --- a/.github/workflows/reusable-endpoint-test.yml +++ b/.github/workflows/reusable-endpoint-test.yml @@ -3,7 +3,7 @@ name: Endpoint Tests on: workflow_call: inputs: - apiName: + apiFunctionName: required: true type: string slotName: @@ -33,7 +33,7 @@ jobs: env: stackName: ${{ inputs.stackName }} webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} branchHashId: ${{ inputs.branchHashId }} priority: 200 steps: @@ -62,7 +62,7 @@ jobs: - name: Health check App Resources run: | ./ops/scripts/pipeline/endpoint-test.sh \ - --apiName ${{ inputs.apiName }} \ + --apiFunctionName ${{ inputs.apiFunctionName }} \ --webappName ${{ inputs.webappName }} \ --hostSuffix ${{ vars.AZ_HOSTNAME_SUFFIX }} \ --gitSha ${{ github.sha }} \ diff --git a/.github/workflows/reusable-frontend-slot.yml b/.github/workflows/reusable-frontend-slot.yml index a857b533c..e9d84dcdb 100644 --- a/.github/workflows/reusable-frontend-slot.yml +++ b/.github/workflows/reusable-frontend-slot.yml @@ -6,7 +6,7 @@ on: webAppName: required: true type: string - apiName: + apiFunctionName: required: true type: string ghaEnvironment: @@ -51,7 +51,7 @@ jobs: ./ops/scripts/pipeline/slots/az-slot-web-resource-deploy.sh \ --resourceGroup ${{ steps.rgApp.outputs.out }} \ --webappName ${{ inputs.webappName }} \ - --apiName ${{ inputs.apiName }} \ + --apiFunctionName ${{ inputs.apiFunctionName }} \ --slotName ${{ inputs.slotName }} \ --subscription ${{ secrets.AZURE_SUBSCRIPTION }} \ --network-rg ${{ steps.rgNetwork.outputs.out }} \ diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 88151447a..3d9e0d5fd 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -6,7 +6,10 @@ on: nodeVersion: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string camsServerHostname: @@ -100,12 +103,22 @@ jobs: npm ci npm run build - - name: Package Application - run: OUT=${{ inputs.apiName }} npm run pack + - name: Package API + run: OUT=${{ inputs.apiFunctionName }} npm run pack + + - name: Package Migration + run: OUT=${{ inputs.migrationFunctionName }} npm run pack:migration + + - name: Upload API Azure Functions Artifact + uses: actions/upload-artifact@v4.4.0 + with: + name: ${{ inputs.apiFunctionName }}-build + path: backend/api/${{ inputs.apiFunctionName }}.zip + if-no-files-found: error - - name: Upload Node Azure Functions Artifact + - name: Upload Migration Azure Functions Artifact uses: actions/upload-artifact@v4.4.0 with: - name: ${{ inputs.apiName }}-build - path: backend/${{ inputs.apiName }}.zip + name: ${{ inputs.migrationFunctionName }}-build + path: backend/migration/${{ inputs.migrationFunctionName }}.zip if-no-files-found: error diff --git a/.github/workflows/sub-deploy-code-slot.yml b/.github/workflows/sub-deploy-code-slot.yml index 1041d44f6..95398a632 100644 --- a/.github/workflows/sub-deploy-code-slot.yml +++ b/.github/workflows/sub-deploy-code-slot.yml @@ -15,7 +15,10 @@ on: webappName: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string azResourceGrpAppEncrypted: @@ -40,8 +43,9 @@ jobs: ghaEnvironment: ${{ inputs.ghaEnvironment }} environmentHash: ${{ inputs.environmentHash }} stackName: ${{ inputs.stackName }} - webAppName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + webappName: ${{ inputs.webappName }} + apiFunctionName: ${{ inputs.apiFunctionName }} + migrationFunctionName: ${{ inputs.migrationFunctionName }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} secrets: inherit # pragma: allowlist secret @@ -77,7 +81,7 @@ jobs: -n ${{ inputs.webappName }} \ --slotName ${{ inputs.slotName }} - deploy-service-slot: + deploy-api-slot: runs-on: ubuntu-latest environment: ${{ inputs.ghaEnvironment }} steps: @@ -86,7 +90,7 @@ jobs: - name: Download artifact from build job uses: actions/download-artifact@v4.1.7 with: - name: ${{ inputs.apiName }}-build + name: ${{ inputs.apiFunctionName }}-build - uses: azure/login@v1 with: @@ -100,22 +104,54 @@ jobs: op: decode in: ${{ inputs.azResourceGrpAppEncrypted }} - - name: Deploy Azure Functions slot backend - id: deploy-backend-slot-step + - name: Deploy Azure Function API slot + id: deploy-api-slot-step run: | ./ops/scripts/pipeline/slots/az-func-slot-deploy.sh \ -g ${{ steps.rgApp.outputs.out }} \ - -n ${{ inputs.apiName }} \ - --src ./${{ inputs.apiName }}.zip \ + -n ${{ inputs.apiFunctionName }} \ + --src ./${{ inputs.apiFunctionName }}.zip \ + --slotName ${{ inputs.slotName }} + + deploy-migration-slot: + runs-on: ubuntu-latest + environment: ${{ inputs.ghaEnvironment }} + steps: + - uses: actions/checkout@main + + - name: Download artifact from build job + uses: actions/download-artifact@v4.1.7 + with: + name: ${{ inputs.migrationFunctionName }}-build + + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ vars.AZURE_ENVIRONMENT }} + + - uses: cloudposse/github-action-secret-outputs@main + id: rgApp + with: + secret: ${{ secrets.PGP_SIGNING_PASSPHRASE }} + op: decode + in: ${{ inputs.azResourceGrpAppEncrypted }} + + - name: Deploy Azure Function Migration slot + id: deploy-migration-slot-step + run: | + ./ops/scripts/pipeline/slots/az-func-slot-deploy.sh \ + -g ${{ steps.rgApp.outputs.out }} \ + -n ${{ inputs.migrationFunctionName }} \ + --src ./${{ inputs.migrationFunctionName }}.zip \ --slotName ${{ inputs.slotName }} endpoint-test-application-slot: - needs: [deploy-webapp-slot, deploy-service-slot] + needs: [deploy-webapp-slot, deploy-api-slot, deploy-migration-slot] uses: ./.github/workflows/reusable-endpoint-test.yml with: stackName: ${{ inputs.stackName }} webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} branchHashId: ${{ inputs.environmentHash }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} @@ -124,10 +160,15 @@ jobs: execute-e2e-test: needs: - [deploy-webapp-slot, deploy-service-slot, endpoint-test-application-slot] + [ + deploy-webapp-slot, + deploy-api-slot, + deploy-migration-slot, + endpoint-test-application-slot, + ] uses: ./.github/workflows/reusable-e2e.yml with: - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} slotName: ${{ inputs.slotName }} webappName: ${{ inputs.webappName }} stackName: ${{ inputs.stackName }} @@ -140,7 +181,13 @@ jobs: swap-webapp-deployment-slot: if: ${{ inputs.initialDeployment != 'true' }} runs-on: ubuntu-latest - needs: [deploy-webapp-slot, deploy-service-slot, execute-e2e-test] + needs: + [ + deploy-webapp-slot, + deploy-api-slot, + deploy-migration-slot, + execute-e2e-test, + ] environment: ${{ inputs.ghaEnvironment }} env: webappName: ${{ inputs.webappName }} @@ -164,10 +211,45 @@ jobs: swap-nodeapi-deployment-slot: if: ${{ inputs.initialDeployment != 'true' }} runs-on: ubuntu-latest - needs: [deploy-webapp-slot, deploy-service-slot, execute-e2e-test] + needs: + [ + deploy-webapp-slot, + deploy-api-slot, + deploy-migration-slot, + execute-e2e-test, + ] + environment: ${{ inputs.ghaEnvironment }} + env: + apiFunctionName: ${{ inputs.apiFunctionName }} + slotName: ${{ inputs.slotName }} + steps: + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ vars.AZURE_ENVIRONMENT }} + - uses: cloudposse/github-action-secret-outputs@main + id: rgApp + with: + secret: ${{ secrets.PGP_SIGNING_PASSPHRASE }} + op: decode + in: ${{ inputs.azResourceGrpAppEncrypted }} + - name: Swap Deployment Slot + run: | + az functionapp deployment slot swap --slot ${{ env.slotName }} --name ${{ env.apiFunctionName }} -g ${{ steps.rgApp.outputs.out }} + az webapp traffic-routing clear --name ${{ env.apiFunctionName }} -g ${{ steps.rgApp.outputs.out }} + + swap-migration-app-deployment-slot: + if: ${{ inputs.initialDeployment != 'true' }} + runs-on: ubuntu-latest + needs: + [ + deploy-webapp-slot, + deploy-api-slot, + deploy-migration-slot, + execute-e2e-test, + ] environment: ${{ inputs.ghaEnvironment }} env: - apiName: ${{ inputs.apiName }} slotName: ${{ inputs.slotName }} steps: - uses: azure/login@v1 @@ -182,8 +264,8 @@ jobs: in: ${{ inputs.azResourceGrpAppEncrypted }} - name: Swap Deployment Slot run: | - az functionapp deployment slot swap --slot ${{ env.slotName }} --name ${{ env.apiName }} -g ${{ steps.rgApp.outputs.out }} - az webapp traffic-routing clear --name ${{ env.apiName }} -g ${{ steps.rgApp.outputs.out }} + az functionapp deployment slot swap --slot ${{ env.slotName }} --name ${{ inputs.migrationFunctionName }} -g ${{ steps.rgApp.outputs.out }} + az webapp traffic-routing clear --name ${{ inputs.migrationFunctionName }} -g ${{ steps.rgApp.outputs.out }} endpoint-test-application-post-swap: needs: [swap-nodeapi-deployment-slot, swap-webapp-deployment-slot] @@ -191,7 +273,7 @@ jobs: with: stackName: ${{ inputs.stackName }} webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} branchHashId: ${{ inputs.environmentHash }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} @@ -204,7 +286,7 @@ jobs: environment: ${{ inputs.ghaEnvironment }} env: webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} steps: - uses: azure/login@v1 with: @@ -221,4 +303,4 @@ jobs: - name: Enable production slot access run: | az webapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.webappName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true - az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.apiName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true + az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.apiFunctionName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true diff --git a/.github/workflows/sub-deploy-code.yml b/.github/workflows/sub-deploy-code.yml index 7befe872a..d0dbc8071 100644 --- a/.github/workflows/sub-deploy-code.yml +++ b/.github/workflows/sub-deploy-code.yml @@ -15,7 +15,10 @@ on: webappName: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string azResourceGrpAppEncrypted: @@ -54,7 +57,39 @@ jobs: -g ${{ steps.rgApp.outputs.out }} \ -n ${{ inputs.webappName }} - deploy-service: + deploy-api: + runs-on: ubuntu-latest + environment: ${{ inputs.ghaEnvironment }} + steps: + - uses: actions/checkout@main + + - name: Download artifact from build job + uses: actions/download-artifact@v4.1.7 + with: + name: ${{ inputs.apiFunctionName }}-build + + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + environment: ${{ vars.AZURE_ENVIRONMENT }} + + - uses: cloudposse/github-action-secret-outputs@main + id: rgApp + with: + secret: ${{ secrets.PGP_SIGNING_PASSPHRASE }} + op: decode + in: ${{ inputs.azResourceGrpAppEncrypted }} + + - name: Deploy Azure Functions API + id: deploy-backend-api-step + run: | + sleep 30 && + ./ops/scripts/pipeline/az-func-deploy.sh \ + -g ${{ steps.rgApp.outputs.out }} \ + -n ${{ inputs.apiFunctionName }} \ + --src ./${{ inputs.apiFunctionName }}.zip + + deploy-migration-app: runs-on: ubuntu-latest environment: ${{ inputs.ghaEnvironment }} steps: @@ -63,7 +98,7 @@ jobs: - name: Download artifact from build job uses: actions/download-artifact@v4.1.7 with: - name: ${{ inputs.apiName }}-build + name: ${{ inputs.migrationFunctionName }}-build - uses: azure/login@v1 with: @@ -77,22 +112,22 @@ jobs: op: decode in: ${{ inputs.azResourceGrpAppEncrypted }} - - name: Deploy Azure Functions backend - id: deploy-backend-step + - name: Deploy Azure Function Migration App + id: deploy-migration-app-step run: | sleep 30 && ./ops/scripts/pipeline/az-func-deploy.sh \ -g ${{ steps.rgApp.outputs.out }} \ - -n ${{ inputs.apiName }} \ - --src ./${{ inputs.apiName }}.zip + -n ${{ inputs.migrationFunctionName }} \ + --src ./${{ inputs.migrationFunctionName }}.zip - endpoint-test-application: - needs: [deploy-webapp, deploy-service] + endpoint-test-application: # TODO: healthcheck/endpoint test on new migration function app? + needs: [deploy-webapp, deploy-api] uses: ./.github/workflows/reusable-endpoint-test.yml with: stackName: ${{ inputs.stackName }} webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} branchHashId: ${{ inputs.environmentHash }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} @@ -105,7 +140,7 @@ jobs: environment: ${{ inputs.ghaEnvironment }} env: webappName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} steps: - uses: azure/login@v1 with: @@ -122,4 +157,4 @@ jobs: - name: Enable production slot access run: | az webapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.webappName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true - az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.apiName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true + az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.apiFunctionName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true diff --git a/.github/workflows/sub-deploy-slot-resources.yml b/.github/workflows/sub-deploy-slot-resources.yml index fe4272ec4..026fcaeea 100644 --- a/.github/workflows/sub-deploy-slot-resources.yml +++ b/.github/workflows/sub-deploy-slot-resources.yml @@ -6,7 +6,10 @@ on: webAppName: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string ghaEnvironment: @@ -29,7 +32,7 @@ jobs: uses: ./.github/workflows/reusable-frontend-slot.yml with: webAppName: ${{ inputs.webAppName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} azResourceGrpNetworkEncrypted: ${{ inputs.azResourceGrpNetworkEncrypted }} @@ -40,7 +43,8 @@ jobs: uses: ./.github/workflows/reusable-backend-slot.yml with: webAppName: ${{ inputs.webAppName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} + migrationFunctionName: ${{ inputs.migrationFunctionName }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} azResourceGrpNetworkEncrypted: ${{ inputs.azResourceGrpNetworkEncrypted }} diff --git a/.github/workflows/sub-deploy.yml b/.github/workflows/sub-deploy.yml index fbe55bcf2..c566d2a33 100644 --- a/.github/workflows/sub-deploy.yml +++ b/.github/workflows/sub-deploy.yml @@ -15,7 +15,10 @@ on: stackName: required: true type: string - apiName: + apiFunctionName: + required: true + type: string + migrationFunctionName: required: true type: string webAppName: @@ -45,7 +48,9 @@ jobs: deploy-infra: name: Azure Infrastructure uses: ./.github/workflows/reusable-deploy.yml - if: ((github.ref == 'refs/heads/main') || (inputs.deployBranch == 'true')) && ${{ inputs.deployBicep == 'true' }} + if: + ((github.ref == 'refs/heads/main') || (inputs.deployBranch == 'true')) && ${{ + inputs.deployBicep == 'true' }} with: ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} @@ -66,7 +71,8 @@ jobs: ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpNetworkEncrypted: ${{ inputs.azResourceGrpNetworkEncrypted }} environmentHash: ${{ inputs.environmentHash }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} + migrationFunctionName: ${{ inputs.migrationFunctionName }} secrets: inherit # pragma: allowlist secret deploy-slot-resources: @@ -76,7 +82,8 @@ jobs: if: ((github.ref == 'refs/heads/main') || (inputs.deployBranch == 'true')) with: webAppName: ${{ inputs.webappName }} - apiName: ${{ inputs.apiName }} + apiFunctionName: ${{ inputs.apiFunctionName }} + migrationFunctionName: ${{ inputs.migrationFunctionName }} ghaEnvironment: ${{ inputs.ghaEnvironment }} azResourceGrpAppEncrypted: ${{ inputs.azResourceGrpAppEncrypted }} azResourceGrpNetworkEncrypted: ${{ inputs.azResourceGrpNetworkEncrypted }} diff --git a/.gitignore b/.gitignore index 98d9ac132..bebb0bbf8 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,9 @@ cams1.code-workspace # Node **/node_modules/ +# Dist +**/dist/ + # Veracode **/pipeline-scan* diff --git a/backend/functions/.funcignore b/backend/functions/api/.funcignore similarity index 100% rename from backend/functions/.funcignore rename to backend/functions/api/.funcignore diff --git a/backend/functions/attorneys/attorneys.function.test.ts b/backend/functions/api/attorneys/attorneys.function.test.ts similarity index 78% rename from backend/functions/attorneys/attorneys.function.test.ts rename to backend/functions/api/attorneys/attorneys.function.test.ts index 18db41b8e..897502717 100644 --- a/backend/functions/attorneys/attorneys.function.test.ts +++ b/backend/functions/api/attorneys/attorneys.function.test.ts @@ -1,17 +1,17 @@ -import { AttorneysController } from '../../lib/controllers/attorneys/attorneys.controller'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; +import { AttorneysController } from '../../../lib/controllers/attorneys/attorneys.controller'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import AttorneyList from '../../lib/use-cases/attorneys'; +} from '../../azure/testing-helpers'; +import AttorneyList from '../../../lib/use-cases/attorneys'; import handler from './attorneys.function'; import { InvocationContext } from '@azure/functions'; -import { ResponseBody } from '../../../common/src/api/response'; -import { AttorneyUser } from '../../../common/src/cams/users'; -import ContextCreator from '../azure/application-context-creator'; +import { ResponseBody } from '../../../../common/src/api/response'; +import { AttorneyUser } from '../../../../common/src/cams/users'; +import ContextCreator from '../../azure/application-context-creator'; describe('Attorneys Azure Function tests', () => { const request = createMockAzureFunctionRequest(); diff --git a/backend/functions/attorneys/attorneys.function.ts b/backend/functions/api/attorneys/attorneys.function.ts similarity index 75% rename from backend/functions/attorneys/attorneys.function.ts rename to backend/functions/api/attorneys/attorneys.function.ts index f481f02d3..c69188491 100644 --- a/backend/functions/attorneys/attorneys.function.ts +++ b/backend/functions/api/attorneys/attorneys.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import { AttorneysController } from '../../lib/controllers/attorneys/attorneys.controller'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import ContextCreator from '../azure/application-context-creator'; +import { AttorneysController } from '../../../lib/controllers/attorneys/attorneys.controller'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; dotenv.config(); diff --git a/backend/functions/case-assignments/case.assignment.function.test.ts b/backend/functions/api/case-assignments/case.assignment.function.test.ts similarity index 85% rename from backend/functions/case-assignments/case.assignment.function.test.ts rename to backend/functions/api/case-assignments/case.assignment.function.test.ts index 2f9d787a8..c51997169 100644 --- a/backend/functions/case-assignments/case.assignment.function.test.ts +++ b/backend/functions/api/case-assignments/case.assignment.function.test.ts @@ -1,19 +1,19 @@ import handler from './case.assignment.function'; -import { CaseAssignmentController } from '../../lib/controllers/case-assignment/case.assignment.controller'; -import ContextCreator from '../azure/application-context-creator'; -import { CaseAssignment } from '../../../common/src/cams/assignments'; -import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CaseAssignmentController } from '../../../lib/controllers/case-assignment/case.assignment.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { CaseAssignment } from '../../../../common/src/cams/assignments'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; import { InvocationContext } from '@azure/functions'; -import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; +import { createMockApplicationContext } from '../../../lib/testing/testing-utilities'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import { UnknownError } from '../../lib/common-errors/unknown-error'; -import HttpStatusCodes from '../../../common/src/api/http-status-codes'; +} from '../../azure/testing-helpers'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import { UnknownError } from '../../../lib/common-errors/unknown-error'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; describe('Case Assignment Function Tests', () => { const defaultRequestProps: Partial = { diff --git a/backend/functions/case-assignments/case.assignment.function.ts b/backend/functions/api/case-assignments/case.assignment.function.ts similarity index 75% rename from backend/functions/case-assignments/case.assignment.function.ts rename to backend/functions/api/case-assignments/case.assignment.function.ts index 7b74817a3..7977d3a43 100644 --- a/backend/functions/case-assignments/case.assignment.function.ts +++ b/backend/functions/api/case-assignments/case.assignment.function.ts @@ -1,8 +1,8 @@ import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; -import { CaseAssignmentController } from '../../lib/controllers/case-assignment/case.assignment.controller'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import { CaseAssignmentController } from '../../../lib/controllers/case-assignment/case.assignment.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; const MODULE_NAME = 'CASE-ASSIGNMENT-FUNCTION'; diff --git a/backend/functions/case-associated/case-associated.function.test.ts b/backend/functions/api/case-associated/case-associated.function.test.ts similarity index 77% rename from backend/functions/case-associated/case-associated.function.test.ts rename to backend/functions/api/case-associated/case-associated.function.test.ts index ef6990542..29d4a02df 100644 --- a/backend/functions/case-associated/case-associated.function.test.ts +++ b/backend/functions/api/case-associated/case-associated.function.test.ts @@ -1,15 +1,15 @@ -import { NotFoundError } from '../../lib/common-errors/not-found-error'; -import { CaseAssociatedController } from '../../lib/controllers/case-associated/case-associated.controller'; +import { NotFoundError } from '../../../lib/common-errors/not-found-error'; +import { CaseAssociatedController } from '../../../lib/controllers/case-associated/case-associated.controller'; import handler from './case-associated.function'; -import ContextCreator from '../azure/application-context-creator'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; +import ContextCreator from '../../azure/application-context-creator'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import { InvocationContext } from '@azure/functions'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { EventCaseReference } from '../../../common/src/cams/events'; +} from '../../azure/testing-helpers'; +import { EventCaseReference } from '../../../../common/src/cams/events'; describe('Case summary function', () => { jest diff --git a/backend/functions/case-associated/case-associated.function.ts b/backend/functions/api/case-associated/case-associated.function.ts similarity index 74% rename from backend/functions/case-associated/case-associated.function.ts rename to backend/functions/api/case-associated/case-associated.function.ts index 7ea3d55e0..5994d86b2 100644 --- a/backend/functions/case-associated/case-associated.function.ts +++ b/backend/functions/api/case-associated/case-associated.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { CaseAssociatedController } from '../../lib/controllers/case-associated/case-associated.controller'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { CaseAssociatedController } from '../../../lib/controllers/case-associated/case-associated.controller'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/case-docket/case-docket.function.test.ts b/backend/functions/api/case-docket/case-docket.function.test.ts similarity index 73% rename from backend/functions/case-docket/case-docket.function.test.ts rename to backend/functions/api/case-docket/case-docket.function.test.ts index c4154f65c..9bd996781 100644 --- a/backend/functions/case-docket/case-docket.function.test.ts +++ b/backend/functions/api/case-docket/case-docket.function.test.ts @@ -1,16 +1,16 @@ import handler from './case-docket.function'; -import { DXTR_CASE_DOCKET_ENTRIES } from '../../lib/testing/mock-data/case-docket-entries.mock'; -import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../lib/testing/testing-constants'; +import { DXTR_CASE_DOCKET_ENTRIES } from '../../../lib/testing/mock-data/case-docket-entries.mock'; +import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../../lib/testing/testing-constants'; import { InvocationContext } from '@azure/functions'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { CaseDocketController } from '../../lib/controllers/case-docket/case-docket.controller'; -import { NotFoundError } from '../../lib/common-errors/not-found-error'; -import { CaseDocket } from '../../../common/src/cams/cases'; +} from '../../azure/testing-helpers'; +import { CaseDocketController } from '../../../lib/controllers/case-docket/case-docket.controller'; +import { NotFoundError } from '../../../lib/common-errors/not-found-error'; +import { CaseDocket } from '../../../../common/src/cams/cases'; describe('Case docket function', () => { const context = new InvocationContext({ diff --git a/backend/functions/case-docket/case-docket.function.ts b/backend/functions/api/case-docket/case-docket.function.ts similarity index 77% rename from backend/functions/case-docket/case-docket.function.ts rename to backend/functions/api/case-docket/case-docket.function.ts index 989b001b1..478e5fe0f 100644 --- a/backend/functions/case-docket/case-docket.function.ts +++ b/backend/functions/api/case-docket/case-docket.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { CaseDocketController } from '../../lib/controllers/case-docket/case-docket.controller'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { CaseDocketController } from '../../../lib/controllers/case-docket/case-docket.controller'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/case-history/case-history.function.test.ts b/backend/functions/api/case-history/case-history.function.test.ts similarity index 74% rename from backend/functions/case-history/case-history.function.test.ts rename to backend/functions/api/case-history/case-history.function.test.ts index 39dd2b45a..f9d1a9a93 100644 --- a/backend/functions/case-history/case-history.function.test.ts +++ b/backend/functions/api/case-history/case-history.function.test.ts @@ -1,18 +1,18 @@ -import { CASE_HISTORY } from '../../lib/testing/mock-data/case-history.mock'; -import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../lib/testing/testing-constants'; -import { NotFoundError } from '../../lib/common-errors/not-found-error'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; +import { CASE_HISTORY } from '../../../lib/testing/mock-data/case-history.mock'; +import { NORMAL_CASE_ID, NOT_FOUND_ERROR_CASE_ID } from '../../../lib/testing/testing-constants'; +import { NotFoundError } from '../../../lib/common-errors/not-found-error'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; import { InvocationContext } from '@azure/functions'; import handler from './case-history.function'; -import ContextCreator from '../azure/application-context-creator'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { CaseHistoryController } from '../../lib/controllers/case-history/case-history.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; +import { CaseHistoryController } from '../../../lib/controllers/case-history/case-history.controller'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { CaseHistory } from '../../../common/src/cams/history'; +} from '../../azure/testing-helpers'; +import { CaseHistory } from '../../../../common/src/cams/history'; describe('Case History Function Tests', () => { const defaultRequestProps: Partial = { diff --git a/backend/functions/case-history/case-history.function.ts b/backend/functions/api/case-history/case-history.function.ts similarity index 75% rename from backend/functions/case-history/case-history.function.ts rename to backend/functions/api/case-history/case-history.function.ts index a4f9d1ca7..c33b2a237 100644 --- a/backend/functions/case-history/case-history.function.ts +++ b/backend/functions/api/case-history/case-history.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { CaseHistoryController } from '../../lib/controllers/case-history/case-history.controller'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { CaseHistoryController } from '../../../lib/controllers/case-history/case-history.controller'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; const MODULE_NAME = 'CASE-HISTORY-FUNCTION'; diff --git a/backend/functions/case-summary/case-summary.function.test.ts b/backend/functions/api/case-summary/case-summary.function.test.ts similarity index 79% rename from backend/functions/case-summary/case-summary.function.test.ts rename to backend/functions/api/case-summary/case-summary.function.test.ts index 82fd95a5a..b497fac70 100644 --- a/backend/functions/case-summary/case-summary.function.test.ts +++ b/backend/functions/api/case-summary/case-summary.function.test.ts @@ -1,16 +1,16 @@ import { InvocationContext } from '@azure/functions'; -import { CaseDetail } from '../../../common/src/cams/cases'; -import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { NotFoundError } from '../../lib/common-errors/not-found-error'; +import { CaseDetail } from '../../../../common/src/cams/cases'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; +import { NotFoundError } from '../../../lib/common-errors/not-found-error'; import handler from './case-summary.function'; -import ContextCreator from '../azure/application-context-creator'; +import ContextCreator from '../../azure/application-context-creator'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; -import { CaseSummaryController } from '../../lib/controllers/case-summary/case-summary.controller'; +} from '../../azure/testing-helpers'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; +import { CaseSummaryController } from '../../../lib/controllers/case-summary/case-summary.controller'; describe('Case summary function', () => { jest diff --git a/backend/functions/case-summary/case-summary.function.ts b/backend/functions/api/case-summary/case-summary.function.ts similarity index 75% rename from backend/functions/case-summary/case-summary.function.ts rename to backend/functions/api/case-summary/case-summary.function.ts index 44ddbc8ab..7a34a9ba6 100644 --- a/backend/functions/case-summary/case-summary.function.ts +++ b/backend/functions/api/case-summary/case-summary.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { CaseSummaryController } from '../../lib/controllers/case-summary/case-summary.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import { CaseSummaryController } from '../../../lib/controllers/case-summary/case-summary.controller'; dotenv.config(); diff --git a/backend/functions/cases/cases.function.test.ts b/backend/functions/api/cases/cases.function.test.ts similarity index 72% rename from backend/functions/cases/cases.function.test.ts rename to backend/functions/api/cases/cases.function.test.ts index 1b45c208d..4730c1a25 100644 --- a/backend/functions/cases/cases.function.test.ts +++ b/backend/functions/api/cases/cases.function.test.ts @@ -1,13 +1,16 @@ import handler from './cases.function'; -import { buildTestResponseSuccess, createMockAzureFunctionRequest } from '../azure/testing-helpers'; -import { CasesController } from '../../lib/controllers/cases/cases.controller'; -import ContextCreator from '../azure/application-context-creator'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; +import { + buildTestResponseSuccess, + createMockAzureFunctionRequest, +} from '../../azure/testing-helpers'; +import { CasesController } from '../../../lib/controllers/cases/cases.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import { InvocationContext } from '@azure/functions'; -import { ResourceActions } from '../../../common/src/cams/actions'; -import { CaseDetail } from '../../../common/src/cams/cases'; -import { commonHeaders } from '../../lib/adapters/utils/http-response'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import { ResourceActions } from '../../../../common/src/cams/actions'; +import { CaseDetail } from '../../../../common/src/cams/cases'; +import { commonHeaders } from '../../../lib/adapters/utils/http-response'; +import { CamsError } from '../../../lib/common-errors/cams-error'; describe('Cases function', () => { jest diff --git a/backend/functions/cases/cases.function.ts b/backend/functions/api/cases/cases.function.ts similarity index 76% rename from backend/functions/cases/cases.function.ts rename to backend/functions/api/cases/cases.function.ts index 428f65817..60251be68 100644 --- a/backend/functions/cases/cases.function.ts +++ b/backend/functions/api/cases/cases.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import { CasesController } from '../../lib/controllers/cases/cases.controller'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import { CasesController } from '../../../lib/controllers/cases/cases.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/consolidations/consolidations.function.test.ts b/backend/functions/api/consolidations/consolidations.function.test.ts similarity index 87% rename from backend/functions/consolidations/consolidations.function.test.ts rename to backend/functions/api/consolidations/consolidations.function.test.ts index 07ad5eaf2..3b2c944f7 100644 --- a/backend/functions/consolidations/consolidations.function.test.ts +++ b/backend/functions/api/consolidations/consolidations.function.test.ts @@ -1,16 +1,16 @@ -import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; import handler from './consolidations.function'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; -import ContextCreator from '../azure/application-context-creator'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; +import ContextCreator from '../../azure/application-context-creator'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { ConsolidationOrder } from '../../../common/src/cams/orders'; -import { BadRequestError } from '../../lib/common-errors/bad-request'; +} from '../../azure/testing-helpers'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { ConsolidationOrder } from '../../../../common/src/cams/orders'; +import { BadRequestError } from '../../../lib/common-errors/bad-request'; describe('Consolidations Function tests', () => { const defaultRequestProps: Partial = { diff --git a/backend/functions/consolidations/consolidations.function.ts b/backend/functions/api/consolidations/consolidations.function.ts similarity index 76% rename from backend/functions/consolidations/consolidations.function.ts rename to backend/functions/api/consolidations/consolidations.function.ts index 1b3ee1646..107ceef02 100644 --- a/backend/functions/consolidations/consolidations.function.ts +++ b/backend/functions/api/consolidations/consolidations.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; -import { initializeApplicationInsights } from '../azure/app-insights'; +import { initializeApplicationInsights } from '../../azure/app-insights'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/courts/courts.function.test.ts b/backend/functions/api/courts/courts.function.test.ts similarity index 79% rename from backend/functions/courts/courts.function.test.ts rename to backend/functions/api/courts/courts.function.test.ts index a46aa03bc..aba16c247 100644 --- a/backend/functions/courts/courts.function.test.ts +++ b/backend/functions/api/courts/courts.function.test.ts @@ -1,14 +1,14 @@ -import { CamsError } from '../../lib/common-errors/cams-error'; +import { CamsError } from '../../../lib/common-errors/cams-error'; import handler from './courts.function'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { CourtsController } from '../../lib/controllers/courts/courts.controller'; -import { CourtDivisionDetails } from '../../../common/src/cams/courts'; -import { COURT_DIVISIONS } from '../../../common/src/cams/test-utilities/courts.mock'; +} from '../../azure/testing-helpers'; +import { CourtsController } from '../../../lib/controllers/courts/courts.controller'; +import { CourtDivisionDetails } from '../../../../common/src/cams/courts'; +import { COURT_DIVISIONS } from '../../../../common/src/cams/test-utilities/courts.mock'; describe('Courts Function tests', () => { let request; diff --git a/backend/functions/courts/courts.function.ts b/backend/functions/api/courts/courts.function.ts similarity index 80% rename from backend/functions/courts/courts.function.ts rename to backend/functions/api/courts/courts.function.ts index 20687d927..21f4e28be 100644 --- a/backend/functions/courts/courts.function.ts +++ b/backend/functions/api/courts/courts.function.ts @@ -1,7 +1,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { CourtsController } from '../../lib/controllers/courts/courts.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import { CourtsController } from '../../../lib/controllers/courts/courts.controller'; const MODULE_NAME = 'COURTS_FUNCTION'; diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts b/backend/functions/api/healthcheck/healthcheck.db.cosmos.test.ts similarity index 85% rename from backend/functions/healthcheck/healthcheck.db.cosmos.test.ts rename to backend/functions/api/healthcheck/healthcheck.db.cosmos.test.ts index 42f74b89c..4ce2530ea 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.test.ts +++ b/backend/functions/api/healthcheck/healthcheck.db.cosmos.test.ts @@ -1,11 +1,11 @@ import { describe } from 'node:test'; -import { ApplicationContext } from '../../lib/adapters/types/basic'; -import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; -import { closeDeferred } from '../../lib/deferrable/defer-close'; +import { ApplicationContext } from '../../../lib/adapters/types/basic'; +import { createMockApplicationContext } from '../../../lib/testing/testing-utilities'; +import { closeDeferred } from '../../../lib/deferrable/defer-close'; import HealthcheckCosmosDb, { HealthCheckDocument } from './healthcheck.db.cosmos'; -import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { MongoCollectionAdapter } from '../../../lib/adapters/gateways/mongo/utils/mongo-adapter'; describe('healthcheck db tests', () => { let context: ApplicationContext; diff --git a/backend/functions/healthcheck/healthcheck.db.cosmos.ts b/backend/functions/api/healthcheck/healthcheck.db.cosmos.ts similarity index 87% rename from backend/functions/healthcheck/healthcheck.db.cosmos.ts rename to backend/functions/api/healthcheck/healthcheck.db.cosmos.ts index b4515d81c..e055864eb 100644 --- a/backend/functions/healthcheck/healthcheck.db.cosmos.ts +++ b/backend/functions/api/healthcheck/healthcheck.db.cosmos.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; -import { ApplicationContext } from '../../lib/adapters/types/basic'; -import { DocumentClient } from '../../lib/humble-objects/mongo-humble'; -import QueryBuilder from '../../lib/query/query-builder'; -import { deferClose } from '../../lib/deferrable/defer-close'; -import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { ApplicationContext } from '../../../lib/adapters/types/basic'; +import { DocumentClient } from '../../../lib/humble-objects/mongo-humble'; +import QueryBuilder from '../../../lib/query/query-builder'; +import { deferClose } from '../../../lib/deferrable/defer-close'; +import { MongoCollectionAdapter } from '../../../lib/adapters/gateways/mongo/utils/mongo-adapter'; dotenv.config(); diff --git a/backend/functions/healthcheck/healthcheck.db.sql.ts b/backend/functions/api/healthcheck/healthcheck.db.sql.ts similarity index 85% rename from backend/functions/healthcheck/healthcheck.db.sql.ts rename to backend/functions/api/healthcheck/healthcheck.db.sql.ts index 79edcbd36..08e4501e8 100644 --- a/backend/functions/healthcheck/healthcheck.db.sql.ts +++ b/backend/functions/api/healthcheck/healthcheck.db.sql.ts @@ -1,5 +1,5 @@ -import { ApplicationContext } from '../../lib/adapters/types/basic'; -import { getSqlConnection } from '../../lib/factory'; +import { ApplicationContext } from '../../../lib/adapters/types/basic'; +import { getSqlConnection } from '../../../lib/factory'; const MODULE_NAME = 'HEALTHCHECK-SQL-DB'; diff --git a/backend/functions/healthcheck/healthcheck.function.ts b/backend/functions/api/healthcheck/healthcheck.function.ts similarity index 86% rename from backend/functions/healthcheck/healthcheck.function.ts rename to backend/functions/api/healthcheck/healthcheck.function.ts index 388bab50d..6cc93ae76 100644 --- a/backend/functions/healthcheck/healthcheck.function.ts +++ b/backend/functions/api/healthcheck/healthcheck.function.ts @@ -1,14 +1,14 @@ -import ContextCreator from '../azure/application-context-creator'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import ContextCreator from '../../azure/application-context-creator'; +import { CamsError } from '../../../lib/common-errors/cams-error'; import HealthcheckCosmosDb from './healthcheck.db.cosmos'; import { app, InvocationContext, HttpResponseInit, HttpRequest } from '@azure/functions'; import HealthcheckSqlDb from './healthcheck.db.sql'; import HealthcheckInfo from './healthcheck.info'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { httpSuccess } from '../../lib/adapters/utils/http-response'; -import HttpStatusCodes from '../../../common/src/api/http-status-codes'; -import { closeDeferred } from '../../lib/deferrable/defer-close'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import { httpSuccess } from '../../../lib/adapters/utils/http-response'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; +import { closeDeferred } from '../../../lib/deferrable/defer-close'; const MODULE_NAME = 'HEALTHCHECK'; diff --git a/backend/functions/healthcheck/healthcheck.info.ts b/backend/functions/api/healthcheck/healthcheck.info.ts similarity index 90% rename from backend/functions/healthcheck/healthcheck.info.ts rename to backend/functions/api/healthcheck/healthcheck.info.ts index d67a51fe0..ea67fd1fd 100644 --- a/backend/functions/healthcheck/healthcheck.info.ts +++ b/backend/functions/api/healthcheck/healthcheck.info.ts @@ -1,5 +1,5 @@ import * as dotenv from 'dotenv'; -import { ApplicationContext } from '../../lib/adapters/types/basic'; +import { ApplicationContext } from '../../../lib/adapters/types/basic'; dotenv.config(); diff --git a/backend/functions/healthcheck/healthcheck.test.ts b/backend/functions/api/healthcheck/healthcheck.test.ts similarity index 91% rename from backend/functions/healthcheck/healthcheck.test.ts rename to backend/functions/api/healthcheck/healthcheck.test.ts index 4fb780b2e..e2271270b 100644 --- a/backend/functions/healthcheck/healthcheck.test.ts +++ b/backend/functions/api/healthcheck/healthcheck.test.ts @@ -1,5 +1,5 @@ -import { createMockAzureFunctionRequest } from '../azure/testing-helpers'; -import { MongoCollectionAdapter } from '../../lib/adapters/gateways/mongo/utils/mongo-adapter'; +import { createMockAzureFunctionRequest } from '../../azure/testing-helpers'; +import { MongoCollectionAdapter } from '../../../lib/adapters/gateways/mongo/utils/mongo-adapter'; import { HealthCheckDocument } from './healthcheck.db.cosmos'; import handler, { checkResults } from './healthcheck.function'; diff --git a/backend/functions/api/host.json b/backend/functions/api/host.json new file mode 100644 index 000000000..9093e3097 --- /dev/null +++ b/backend/functions/api/host.json @@ -0,0 +1,25 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "enableDependencyTracking": true, + "dependencyTrackingOptions": { + "enableSqlCommandTextInstrumentation": true + }, + "samplingSettings": { + "isEnabled": true + } + }, + "fileLoggingMode": "always", + "logLevel": { + "default": "Debug", + "Host.Results": "Information", + "Function": "Information", + "Worker": "Information" + } + }, + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[4.*, 5.0.0)" + } +} diff --git a/backend/functions/me/me.function.test.ts b/backend/functions/api/me/me.function.test.ts similarity index 72% rename from backend/functions/me/me.function.test.ts rename to backend/functions/api/me/me.function.test.ts index ecef356d0..7dea1960c 100644 --- a/backend/functions/me/me.function.test.ts +++ b/backend/functions/api/me/me.function.test.ts @@ -2,14 +2,14 @@ import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import ContextCreator from '../azure/application-context-creator'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { ForbiddenError } from '../../lib/common-errors/forbidden-error'; -import handler from '../me/me.function'; +} from '../../azure/testing-helpers'; +import ContextCreator from '../../azure/application-context-creator'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; +import { ForbiddenError } from '../../../lib/common-errors/forbidden-error'; +import handler from './me.function'; import { InvocationContext } from '@azure/functions'; -import { CamsSession } from '../../../common/src/cams/session'; -import { createMockApplicationContext } from '../../lib/testing/testing-utilities'; +import { CamsSession } from '../../../../common/src/cams/session'; +import { createMockApplicationContext } from '../../../lib/testing/testing-utilities'; describe('me Function test', () => { const context = new InvocationContext({ diff --git a/backend/functions/me/me.function.ts b/backend/functions/api/me/me.function.ts similarity index 79% rename from backend/functions/me/me.function.ts rename to backend/functions/api/me/me.function.ts index 36de4c333..9a43da326 100644 --- a/backend/functions/me/me.function.ts +++ b/backend/functions/api/me/me.function.ts @@ -1,7 +1,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { MeController } from '../../lib/controllers/me/me.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import { MeController } from '../../../lib/controllers/me/me.controller'; const MODULE_NAME = 'ME-FUNCTION'; diff --git a/backend/functions/oauth2/mock-oauth2.function.ts b/backend/functions/api/oauth2/mock-oauth2.function.ts similarity index 73% rename from backend/functions/oauth2/mock-oauth2.function.ts rename to backend/functions/api/oauth2/mock-oauth2.function.ts index bb3b1a4ed..c4ea70a5d 100644 --- a/backend/functions/oauth2/mock-oauth2.function.ts +++ b/backend/functions/api/oauth2/mock-oauth2.function.ts @@ -1,8 +1,8 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { mockAuthentication } from '../../lib/testing/mock-gateways/mock-oauth2-gateway'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; -import { httpSuccess } from '../../lib/adapters/utils/http-response'; +import ContextCreator from '../../azure/application-context-creator'; +import { mockAuthentication } from '../../../lib/testing/mock-gateways/mock-oauth2-gateway'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; +import { httpSuccess } from '../../../lib/adapters/utils/http-response'; const MODULE_NAME = 'MOCK-OAUTH2-FUNCTION'; diff --git a/backend/functions/office-staff-sync/office-staff-sync.function.test.ts b/backend/functions/api/office-staff-sync/office-staff-sync.function.test.ts similarity index 79% rename from backend/functions/office-staff-sync/office-staff-sync.function.test.ts rename to backend/functions/api/office-staff-sync/office-staff-sync.function.test.ts index 223021419..22d239d8e 100644 --- a/backend/functions/office-staff-sync/office-staff-sync.function.test.ts +++ b/backend/functions/api/office-staff-sync/office-staff-sync.function.test.ts @@ -1,9 +1,9 @@ -import { LoggerImpl } from '../../lib/adapters/services/logger.service'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import { LoggerImpl } from '../../../lib/adapters/services/logger.service'; +import { CamsError } from '../../../lib/common-errors/cams-error'; import timerTrigger from './office-staff-sync.function'; import { Timer } from '@azure/functions'; -import { createMockAzureFunctionContext } from '../azure/testing-helpers'; -import { OfficesController } from '../../lib/controllers/offices/offices.controller'; +import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; +import { OfficesController } from '../../../lib/controllers/offices/offices.controller'; describe('Office Staff Sync Function tests', () => { const context = createMockAzureFunctionContext(); diff --git a/backend/functions/office-staff-sync/office-staff-sync.function.ts b/backend/functions/api/office-staff-sync/office-staff-sync.function.ts similarity index 72% rename from backend/functions/office-staff-sync/office-staff-sync.function.ts rename to backend/functions/api/office-staff-sync/office-staff-sync.function.ts index cd91182af..3138d1ab4 100644 --- a/backend/functions/office-staff-sync/office-staff-sync.function.ts +++ b/backend/functions/api/office-staff-sync/office-staff-sync.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, Timer } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { toAzureError } from '../azure/functions'; -import { OfficesController } from '../../lib/controllers/offices/offices.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { toAzureError } from '../../azure/functions'; +import { OfficesController } from '../../../lib/controllers/offices/offices.controller'; dotenv.config(); diff --git a/backend/functions/offices/offices.function.test.ts b/backend/functions/api/offices/offices.function.test.ts similarity index 81% rename from backend/functions/offices/offices.function.test.ts rename to backend/functions/api/offices/offices.function.test.ts index c6c611a51..73c05950d 100644 --- a/backend/functions/offices/offices.function.test.ts +++ b/backend/functions/api/offices/offices.function.test.ts @@ -1,15 +1,15 @@ -import { CamsError } from '../../lib/common-errors/cams-error'; -import ContextCreator from '../azure/application-context-creator'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import ContextCreator from '../../azure/application-context-creator'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; import handler from './offices.function'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { OfficesController } from '../../lib/controllers/offices/offices.controller'; -import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../common/src/cams/offices'; +} from '../../azure/testing-helpers'; +import { OfficesController } from '../../../lib/controllers/offices/offices.controller'; +import { USTP_OFFICES_ARRAY, UstpOfficeDetails } from '../../../../common/src/cams/offices'; describe('offices Function tests', () => { let request; diff --git a/backend/functions/offices/offices.function.ts b/backend/functions/api/offices/offices.function.ts similarity index 81% rename from backend/functions/offices/offices.function.ts rename to backend/functions/api/offices/offices.function.ts index f644b7547..f2737a8fa 100644 --- a/backend/functions/offices/offices.function.ts +++ b/backend/functions/api/offices/offices.function.ts @@ -1,7 +1,7 @@ import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { OfficesController } from '../../lib/controllers/offices/offices.controller'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { OfficesController } from '../../../lib/controllers/offices/offices.controller'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; const MODULE_NAME = 'OFFICES_FUNCTION'; diff --git a/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts b/backend/functions/api/orders-manual-sync/orders-manual-sync.function.test.ts similarity index 81% rename from backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts rename to backend/functions/api/orders-manual-sync/orders-manual-sync.function.test.ts index b8fd8d4d6..7383b870d 100644 --- a/backend/functions/orders-manual-sync/orders-manual-sync.function.test.ts +++ b/backend/functions/api/orders-manual-sync/orders-manual-sync.function.test.ts @@ -1,9 +1,12 @@ -import { LoggerImpl } from '../../lib/adapters/services/logger.service'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { SyncOrdersStatus } from '../../lib/use-cases/orders/orders'; +import { LoggerImpl } from '../../../lib/adapters/services/logger.service'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { SyncOrdersStatus } from '../../../lib/use-cases/orders/orders'; import handler from './orders-manual-sync.function'; -import { buildTestResponseSuccess, createMockAzureFunctionRequest } from '../azure/testing-helpers'; +import { + buildTestResponseSuccess, + createMockAzureFunctionRequest, +} from '../../azure/testing-helpers'; const syncResponse: SyncOrdersStatus = { options: { diff --git a/backend/functions/orders-manual-sync/orders-manual-sync.function.ts b/backend/functions/api/orders-manual-sync/orders-manual-sync.function.ts similarity index 82% rename from backend/functions/orders-manual-sync/orders-manual-sync.function.ts rename to backend/functions/api/orders-manual-sync/orders-manual-sync.function.ts index 7f9d23e11..f06830c48 100644 --- a/backend/functions/orders-manual-sync/orders-manual-sync.function.ts +++ b/backend/functions/api/orders-manual-sync/orders-manual-sync.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, HttpRequest, HttpResponseInit } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/orders-suggestions/orders-suggestions.function.test.ts b/backend/functions/api/orders-suggestions/orders-suggestions.function.test.ts similarity index 79% rename from backend/functions/orders-suggestions/orders-suggestions.function.test.ts rename to backend/functions/api/orders-suggestions/orders-suggestions.function.test.ts index 6a08e96ba..cc5322c58 100644 --- a/backend/functions/orders-suggestions/orders-suggestions.function.test.ts +++ b/backend/functions/api/orders-suggestions/orders-suggestions.function.test.ts @@ -1,14 +1,14 @@ import handler from './orders-suggestions.function'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import { CamsError } from '../../../lib/common-errors/cams-error'; import { buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import MockData from '../../../common/src/cams/test-utilities/mock-data'; -import { CaseSummary } from '../../../common/src/cams/cases'; -import { buildTestResponseError } from '../azure/testing-helpers'; +} from '../../azure/testing-helpers'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import MockData from '../../../../common/src/cams/test-utilities/mock-data'; +import { CaseSummary } from '../../../../common/src/cams/cases'; +import { buildTestResponseError } from '../../azure/testing-helpers'; describe('Orders suggestions function tests', () => { const context = createMockAzureFunctionContext(); diff --git a/backend/functions/orders-suggestions/orders-suggestions.function.ts b/backend/functions/api/orders-suggestions/orders-suggestions.function.ts similarity index 76% rename from backend/functions/orders-suggestions/orders-suggestions.function.ts rename to backend/functions/api/orders-suggestions/orders-suggestions.function.ts index 3674a35c6..d0e87f994 100644 --- a/backend/functions/orders-suggestions/orders-suggestions.function.ts +++ b/backend/functions/api/orders-suggestions/orders-suggestions.function.ts @@ -1,10 +1,10 @@ import { InvocationContext, HttpRequest, HttpResponseInit, app } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; import * as dotenv from 'dotenv'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; dotenv.config(); initializeApplicationInsights(); diff --git a/backend/functions/orders-sync/orders-sync.function.test.ts b/backend/functions/api/orders-sync/orders-sync.function.test.ts similarity index 81% rename from backend/functions/orders-sync/orders-sync.function.test.ts rename to backend/functions/api/orders-sync/orders-sync.function.test.ts index a5a915642..46d074acf 100644 --- a/backend/functions/orders-sync/orders-sync.function.test.ts +++ b/backend/functions/api/orders-sync/orders-sync.function.test.ts @@ -1,10 +1,10 @@ -import { LoggerImpl } from '../../lib/adapters/services/logger.service'; -import { CamsError } from '../../lib/common-errors/cams-error'; +import { LoggerImpl } from '../../../lib/adapters/services/logger.service'; +import { CamsError } from '../../../lib/common-errors/cams-error'; import timerTrigger from './orders-sync.function'; import { Timer } from '@azure/functions'; -import { createMockAzureFunctionContext } from '../azure/testing-helpers'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import * as factory from '../../lib/factory'; +import { createMockAzureFunctionContext } from '../../azure/testing-helpers'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import * as factory from '../../../lib/factory'; describe('Orders Sync Function tests', () => { const context = createMockAzureFunctionContext({ MONGO_CONNECTION_STRING: 'fake' }); diff --git a/backend/functions/orders-sync/orders-sync.function.ts b/backend/functions/api/orders-sync/orders-sync.function.ts similarity index 72% rename from backend/functions/orders-sync/orders-sync.function.ts rename to backend/functions/api/orders-sync/orders-sync.function.ts index 110ac4088..eb269bda3 100644 --- a/backend/functions/orders-sync/orders-sync.function.ts +++ b/backend/functions/api/orders-sync/orders-sync.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, InvocationContext, Timer } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { toAzureError } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { toAzureError } from '../../azure/functions'; dotenv.config(); diff --git a/backend/functions/orders/orders.function.test.ts b/backend/functions/api/orders/orders.function.test.ts similarity index 84% rename from backend/functions/orders/orders.function.test.ts rename to backend/functions/api/orders/orders.function.test.ts index 774637121..4d62f8e7b 100644 --- a/backend/functions/orders/orders.function.test.ts +++ b/backend/functions/api/orders/orders.function.test.ts @@ -1,17 +1,17 @@ import handler from './orders.function'; -import { CamsError } from '../../lib/common-errors/cams-error'; -import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; -import { CamsHttpRequest } from '../../lib/adapters/types/http'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { Order } from '../../../common/src/cams/orders'; +import { CamsError } from '../../../lib/common-errors/cams-error'; +import { MockData } from '../../../../common/src/cams/test-utilities/mock-data'; +import { CamsHttpRequest } from '../../../lib/adapters/types/http'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { Order } from '../../../../common/src/cams/orders'; import { buildTestResponseError, buildTestResponseSuccess, createMockAzureFunctionContext, createMockAzureFunctionRequest, -} from '../azure/testing-helpers'; -import { commonHeaders } from '../../lib/adapters/utils/http-response'; -import HttpStatusCodes from '../../../common/src/api/http-status-codes'; +} from '../../azure/testing-helpers'; +import { commonHeaders } from '../../../lib/adapters/utils/http-response'; +import HttpStatusCodes from '../../../../common/src/api/http-status-codes'; describe('Orders Function tests', () => { const request = createMockAzureFunctionRequest({ diff --git a/backend/functions/orders/orders.function.ts b/backend/functions/api/orders/orders.function.ts similarity index 75% rename from backend/functions/orders/orders.function.ts rename to backend/functions/api/orders/orders.function.ts index c6df6ce97..127a39b5d 100644 --- a/backend/functions/orders/orders.function.ts +++ b/backend/functions/api/orders/orders.function.ts @@ -1,9 +1,9 @@ import * as dotenv from 'dotenv'; import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'; -import ContextCreator from '../azure/application-context-creator'; -import { initializeApplicationInsights } from '../azure/app-insights'; -import { OrdersController } from '../../lib/controllers/orders/orders.controller'; -import { toAzureError, toAzureSuccess } from '../azure/functions'; +import ContextCreator from '../../azure/application-context-creator'; +import { initializeApplicationInsights } from '../../azure/app-insights'; +import { OrdersController } from '../../../lib/controllers/orders/orders.controller'; +import { toAzureError, toAzureSuccess } from '../../azure/functions'; const MODULE_NAME = 'ORDERS_FUNCTION'; diff --git a/backend/functions/api/package-lock.json b/backend/functions/api/package-lock.json new file mode 100644 index 000000000..584f737b8 --- /dev/null +++ b/backend/functions/api/package-lock.json @@ -0,0 +1,105 @@ +{ + "name": "cams-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cams-api", + "version": "1.0.0", + "workspaces": [ + "../../" + ], + "dependencies": { + "@azure/functions": "^4.6.0" + } + }, + "../..": { + "name": "node", + "version": "1.0.0", + "dependencies": { + "@azure/cosmos": "^4.2.0", + "@azure/functions": "^4.6.0", + "@azure/identity": "^4.5.0", + "@azure/keyvault-secrets": "^4.9.0", + "@launchdarkly/node-server-sdk": "^9.7.2", + "@okta/jwt-verifier": "^4.0.1", + "@okta/okta-sdk-nodejs": "^7.1.1", + "applicationinsights": "^3.4.0", + "dotenv": "^16.4.7", + "durable-functions": "^3.1.0", + "jsonwebtoken": "^9.0.2", + "mongodb": "^6.11.0", + "mssql": "^10.0.4" + }, + "devDependencies": { + "@faker-js/faker": "^9.3.0", + "@types/jest": "^29.5.14", + "@types/mssql": "^9.1.5", + "@types/node": "^22.10.1", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "azure-function-context-mock": "^0.0.7", + "dependency-cruiser": "^16.7.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-promise": "^6.6.0", + "jest": "^29.7.0", + "prettier": "^3.4.2", + "ts-jest": "^29.2.5", + "typescript": "^5.7.2" + } + }, + "node_modules/@azure/functions": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.0.tgz", + "integrity": "sha512-vGq9jXlgrJ3KaI8bepgfpk26zVY8vFZsQukF85qjjKTAR90eFOOBNaa+mc/0ViDY2lcdrU2fL/o1pQyZUtTDsw==", + "dependencies": { + "cookie": "^0.7.0", + "long": "^4.0.0", + "undici": "^5.13.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/node": { + "resolved": "../..", + "link": true + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + } + } +} diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json new file mode 100644 index 000000000..c898fad82 --- /dev/null +++ b/backend/functions/api/package.json @@ -0,0 +1,10 @@ +{ + "name": "cams-api", + "version": "1.0.0", + "description": "", + "workspaces": ["../../"], + "dependencies": { + "@azure/functions": "^4.6.0" + }, + "main": "dist/backend/functions/api/*/*.function.js" +} diff --git a/backend/functions/api/tsconfig.build.json b/backend/functions/api/tsconfig.build.json new file mode 100644 index 000000000..efef3c642 --- /dev/null +++ b/backend/functions/api/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "outDir": "dist" + }, + "extends": "../../tsconfig.json", + "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] +} diff --git a/backend/functions/migration/.funcignore b/backend/functions/migration/.funcignore new file mode 100644 index 000000000..931ec1df9 --- /dev/null +++ b/backend/functions/migration/.funcignore @@ -0,0 +1,15 @@ +*.js.map +*.ts +.git* +.vscode +__azurite_db*__.json +__blobstorage__ +__queuestorage__ +local.settings.json +test +tsconfig.json +*.zip +README.md +.env +.eslint* +*.test.* diff --git a/backend/functions/host.json b/backend/functions/migration/host.json similarity index 100% rename from backend/functions/host.json rename to backend/functions/migration/host.json diff --git a/backend/functions/migration/package-lock.json b/backend/functions/migration/package-lock.json new file mode 100644 index 000000000..d43500849 --- /dev/null +++ b/backend/functions/migration/package-lock.json @@ -0,0 +1,105 @@ +{ + "name": "cams-migration", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cams-migration", + "version": "1.0.0", + "workspaces": [ + "../../" + ], + "dependencies": { + "@azure/functions": "^4.6.0" + } + }, + "../..": { + "name": "node", + "version": "1.0.0", + "dependencies": { + "@azure/cosmos": "^4.2.0", + "@azure/functions": "^4.6.0", + "@azure/identity": "^4.5.0", + "@azure/keyvault-secrets": "^4.9.0", + "@launchdarkly/node-server-sdk": "^9.7.2", + "@okta/jwt-verifier": "^4.0.1", + "@okta/okta-sdk-nodejs": "^7.1.1", + "applicationinsights": "^3.4.0", + "dotenv": "^16.4.7", + "durable-functions": "^3.1.0", + "jsonwebtoken": "^9.0.2", + "mongodb": "^6.11.0", + "mssql": "^10.0.4" + }, + "devDependencies": { + "@faker-js/faker": "^9.3.0", + "@types/jest": "^29.5.14", + "@types/mssql": "^9.1.5", + "@types/node": "^22.10.1", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "azure-function-context-mock": "^0.0.7", + "dependency-cruiser": "^16.7.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-promise": "^6.6.0", + "jest": "^29.7.0", + "prettier": "^3.4.2", + "ts-jest": "^29.2.5", + "typescript": "^5.7.2" + } + }, + "node_modules/@azure/functions": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.0.tgz", + "integrity": "sha512-vGq9jXlgrJ3KaI8bepgfpk26zVY8vFZsQukF85qjjKTAR90eFOOBNaa+mc/0ViDY2lcdrU2fL/o1pQyZUtTDsw==", + "dependencies": { + "cookie": "^0.7.0", + "long": "^4.0.0", + "undici": "^5.13.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/node": { + "resolved": "../..", + "link": true + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + } + } +} diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json new file mode 100644 index 000000000..39aac1768 --- /dev/null +++ b/backend/functions/migration/package.json @@ -0,0 +1,10 @@ +{ + "name": "cams-migration", + "version": "1.0.0", + "description": "", + "workspaces": ["../../"], + "dependencies": { + "@azure/functions": "^4.6.0" + }, + "main": "dist/backend/functions/migration/*/*.js" +} diff --git a/backend/functions/migration/tsconfig.build.json b/backend/functions/migration/tsconfig.build.json new file mode 100644 index 000000000..efef3c642 --- /dev/null +++ b/backend/functions/migration/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "outDir": "dist" + }, + "extends": "../../tsconfig.json", + "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] +} diff --git a/backend/lib/load-env.ts b/backend/lib/load-env.ts new file mode 100644 index 000000000..4e6e17fd2 --- /dev/null +++ b/backend/lib/load-env.ts @@ -0,0 +1,8 @@ +import * as dotenv from 'dotenv'; +import * as path from 'path'; + +function loadEnv() { + dotenv.config({ path: path.resolve(__dirname, '../.env') }); +} + +module.exports = { loadEnv }; diff --git a/backend/package.json b/backend/package.json index 4aee8079a..1abd09723 100644 --- a/backend/package.json +++ b/backend/package.json @@ -36,29 +36,33 @@ "mongodb": "^6.11.0", "mssql": "^10.0.4" }, - "main": "dist/backend/functions/*/*.js", "overrides": { "@azure/identity": "$@azure/identity", "cookie": "^0.7.2" }, "scripts": { - "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage", + "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && npm run clean:api && npm run clean:migration", + "clean:api": "pushd functions/api && rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && popd", + "clean:migration": "pushd functions/migration && rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && popd", "build": "tsc --build tsconfig.build.json", + "build:api": "pushd functions/api && tsc --build tsconfig.build.json && popd", + "build:migration": "pushd functions/migration && tsc --build tsconfig.build.json && popd", "build-common": "pushd ../common && npm ci && npm run build && popd", "watch": "tsc --project tsconfig.build.json -w", "prestart": "npm run build", - "start": "pushd functions && func start --typescript && popd", - "start:dev": "nodemon --esm src/server.ts", + "start:api": "pushd functions/api && func start --typescript && popd", + "start:migration": "pushd functions/migration && func start --typescript && popd", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude functions/@.funcignore --exclude functions/.funcignore && mv /tmp/build/$OUT.zip .", + "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions/migration --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "coverage:ci": "npm config set script-shell=/bin/bash && npm run build-common && npm test -- --coverage", - "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", - "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", + "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", + "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", "itest:okta-group-api": "CAMS_LOGIN_PROVIDER=okta npx ts-node lib/testing/isolated-integration/test-okta-group-api.ts", "itest:export-office-csv": "CAMS_LOGIN_PROVIDER=okta npx ts-node ../lib/testing/isolated-integration/export-office-csv.ts" } diff --git a/backend/tsconfig.build.json b/backend/tsconfig.build.json index 276ba9abd..5cee1ca91 100644 --- a/backend/tsconfig.build.json +++ b/backend/tsconfig.build.json @@ -1,4 +1,7 @@ { + "compilerOptions": { + "outDir": "dist" + }, "extends": "./tsconfig.json", - "exclude": ["**/*.test.ts","**/testing*","**/fake*", "**/testing/*"] + "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*", "functions"] } diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index c29d4459c..e8e6473f3 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -37,11 +37,16 @@ var planTypeToSkuMap = { param stackName string = 'ustp-cams' -param functionName string +param apiFunctionName string + +param apiFunctionSubnetId string + +param migrationFunctionName string + +param migrationFunctionSubnetId string param virtualNetworkResourceGroupName string -param functionSubnetId string param privateEndpointSubnetId string @@ -75,7 +80,7 @@ param functionsVersion string = '~4' @description('Storage account name. Default creates unique name from resource group id and stack name') @minLength(3) @maxLength(24) -param functionsStorageName string = 'ustpfunc${uniqueString(resourceGroup().id, functionName)}' +param functionsStorageName string = 'ustpfunc${uniqueString(resourceGroup().id, apiFunctionName)}' @description('List of origins to allow. Need to include protocol') param corsAllowOrigins array = [] @@ -159,7 +164,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { name: functionsStorageName location: location tags: { - 'Stack Name': functionName + 'Stack Name': apiFunctionName } sku: { name: 'Standard_LRS' @@ -172,33 +177,33 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { } module appInsights './lib/app-insights/app-insights.bicep' = if (createApplicationInsights) { - name: '${functionName}-application-insights-module' + name: '${apiFunctionName}-application-insights-module' params: { location: location kind: 'web' - appInsightsName: 'appi-${functionName}' + appInsightsName: 'appi-${apiFunctionName}' applicationType: 'web' workspaceResourceId: analyticsWorkspaceId } } module diagnosticSettings './lib/app-insights/diagnostics-settings-func.bicep' = if (createApplicationInsights) { - name: '${functionName}-diagnostic-settings-module' + name: '${apiFunctionName}-diagnostic-settings-module' params: { - functionAppName: functionName + functionAppName: apiFunctionName workspaceResourceId: analyticsWorkspaceId } dependsOn: [ appInsights - functionApp + apiFunctionApp ] } module healthAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { - name: '${functionName}-healthcheck-alert-rule-module' + name: '${apiFunctionName}-healthcheck-alert-rule-module' params: { - alertName: '${functionName}-health-check-alert' - appId: functionApp.id + alertName: '${apiFunctionName}-health-check-alert' + appId: apiFunctionApp.id timeAggregation: 'Average' operator: 'LessThan' targetResourceType: 'Microsoft.Web/sites' @@ -211,10 +216,10 @@ module healthAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if ( } module httpAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { - name: '${functionName}-http-error-alert-rule-module' + name: '${apiFunctionName}-http-error-alert-rule-module' params: { - alertName: '${functionName}-http-error-alert' - appId: functionApp.id + alertName: '${apiFunctionName}-http-error-alert' + appId: apiFunctionApp.id timeAggregation: 'Total' operator: 'GreaterThanOrEqual' targetResourceType: 'Microsoft.Web/sites' @@ -237,8 +242,8 @@ var userAssignedIdentities = union( createSqlServerVnetRule ? { '${sqlIdentity.id}': {} } : {} ) -resource functionApp 'Microsoft.Web/sites@2022-09-01' = { - name: functionName +resource apiFunctionApp 'Microsoft.Web/sites@2022-09-01' = { + name: apiFunctionName location: location kind: 'functionapp,linux' identity: { @@ -249,7 +254,7 @@ resource functionApp 'Microsoft.Web/sites@2022-09-01' = { serverFarmId: servicePlan.id enabled: true httpsOnly: true - virtualNetworkSubnetId: functionSubnetId + virtualNetworkSubnetId: apiFunctionSubnetId keyVaultReferenceIdentity: appConfigIdentity.id } dependsOn: [ @@ -258,6 +263,27 @@ resource functionApp 'Microsoft.Web/sites@2022-09-01' = { ] } + +resource migrationFunctionApp 'Microsoft.Web/sites@2022-09-01' = { + name: migrationFunctionName + location: location + kind: 'functionapp,linux' + identity: { + type: 'UserAssigned' + userAssignedIdentities: userAssignedIdentities + } + properties: { + serverFarmId: servicePlan.id + enabled: true + httpsOnly: true + virtualNetworkSubnetId: migrationFunctionSubnetId + keyVaultReferenceIdentity: appConfigIdentity.id + } + dependsOn: [ + appConfigIdentity + sqlIdentity + ] +} //TODO: Clear segregation with DXTR vs ACMS variable/secret naming in GitHub and ADO secret libraries var applicationSettings = concat( @@ -410,8 +436,8 @@ var ipSecurityRestrictionsRules = concat( : [] ) -resource functionAppConfig 'Microsoft.Web/sites/config@2022-09-01' = { - parent: functionApp +resource apiFunctionConfig 'Microsoft.Web/sites/config@2022-09-01' = { + parent: apiFunctionApp name: 'web' properties: { cors: { @@ -441,14 +467,60 @@ resource functionAppConfig 'Microsoft.Web/sites/config@2022-09-01' = { } } -module privateEndpoint './lib/network/subnet-private-endpoint.bicep' = { - name: '${functionName}-pep-module' +resource migrationFunctionConfig 'Microsoft.Web/sites/config@2022-09-01' = { + parent: migrationFunctionApp + name: 'web' + properties: { + cors: { + allowedOrigins: corsAllowOrigins + } + numberOfWorkers: 1 + alwaysOn: true + http20Enabled: true + functionAppScaleLimit: 0 + minimumElasticInstanceCount: 0 + publicNetworkAccess: 'Enabled' + ipSecurityRestrictions: ipSecurityRestrictionsRules + ipSecurityRestrictionsDefaultAction: 'Deny' + scmIpSecurityRestrictions: [ + { + ipAddress: 'Any' + action: 'Deny' + priority: 2147483647 + name: 'Deny all' + description: 'Deny all access' + } + ] + scmIpSecurityRestrictionsDefaultAction: 'Deny' + scmIpSecurityRestrictionsUseMain: false + linuxFxVersion: linuxFxVersionMap['${functionsRuntime}'] + appSettings: applicationSettings + } +} + +module apiPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = { + name: '${apiFunctionName}-pep-module' scope: resourceGroup(virtualNetworkResourceGroupName) params: { privateLinkGroup: 'sites' - stackName: functionName + stackName: apiFunctionName location: location - privateLinkServiceId: functionApp.id + privateLinkServiceId: apiFunctionApp.id + privateEndpointSubnetId: privateEndpointSubnetId + privateDnsZoneName: privateDnsZoneName + privateDnsZoneResourceGroup: privateDnsZoneResourceGroup + privateDnsZoneSubscriptionId: privateDnsZoneSubscriptionId + } +} + +module migrationFunctionPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = { + name: '${migrationFunctionName}-pep-module' + scope: resourceGroup(virtualNetworkResourceGroupName) + params: { + privateLinkGroup: 'sites' + stackName: migrationFunctionName + location: location + privateLinkServiceId: migrationFunctionApp.id privateEndpointSubnetId: privateEndpointSubnetId privateDnsZoneName: privateDnsZoneName privateDnsZoneResourceGroup: privateDnsZoneResourceGroup @@ -458,25 +530,35 @@ module privateEndpoint './lib/network/subnet-private-endpoint.bicep' = { var createSqlServerVnetRule = !empty(sqlServerResourceGroupName) && !empty(sqlServerName) && !isUstpDeployment -module setSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = if (createSqlServerVnetRule) { +module setMigrationFunctionSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = if (createSqlServerVnetRule) { + scope: resourceGroup(sqlServerResourceGroupName) + name: '${apiFunctionName}-sql-vnet-rule-module' + params: { + stackName: migrationFunctionName + sqlServerName: sqlServerName + subnetId: apiFunctionSubnetId + } +} + +module setApiFunctionSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = if (createSqlServerVnetRule) { scope: resourceGroup(sqlServerResourceGroupName) - name: '${functionName}-sql-vnet-rule-module' + name: '${apiFunctionName}-sql-vnet-rule-module' params: { - stackName: functionName + stackName: apiFunctionName sqlServerName: sqlServerName - subnetId: functionSubnetId + subnetId: apiFunctionSubnetId } } -// Creates a managed identity that would be used to grant access to functionapp instance -var sqlIdentityName = !empty(sqlServerIdentityName) ? sqlServerIdentityName : 'id-sql-${functionName}-readonly' +// Creates a managed identity that would be used to grant access to function instance +var sqlIdentityName = !empty(sqlServerIdentityName) ? sqlServerIdentityName : 'id-sql-${apiFunctionName}-readonly' var sqlIdentityRG = !empty(sqlServerIdentityResourceGroupName) ? sqlServerIdentityResourceGroupName : sqlServerResourceGroupName module sqlManagedIdentity './lib/identity/managed-identity.bicep' = if (createSqlServerVnetRule) { scope: resourceGroup(sqlIdentityRG) - name: '${functionName}-sql-identity-module' + name: '${apiFunctionName}-sql-identity-module' params: { managedIdentityName: sqlIdentityName location: location @@ -488,7 +570,8 @@ resource sqlIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-3 scope: resourceGroup(sqlIdentityRG) } -output functionAppName string = functionApp.name -output functionAppId string = functionApp.id -output createdSqlServerVnetRule bool = createSqlServerVnetRule -output keyVaultId string = functionApp.properties.keyVaultReferenceIdentity +// output apiFunctionAppName string = apiFunctionApp.name +// output apiFunctionAppId string = apiFunctionApp.id +// output migrationFunctionAppId string = migrationFunctionApp.id +// output createdSqlServerVnetRule bool = createSqlServerVnetRule +// output keyVaultId string = apiFunctionApp.properties.keyVaultReferenceIdentity diff --git a/ops/cloud-deployment/frontend-webapp-deploy.bicep b/ops/cloud-deployment/frontend-webapp-deploy.bicep index 8c04db27d..505fd4a35 100644 --- a/ops/cloud-deployment/frontend-webapp-deploy.bicep +++ b/ops/cloud-deployment/frontend-webapp-deploy.bicep @@ -316,6 +316,6 @@ module privateEndpoint './lib/network/subnet-private-endpoint.bicep' = { privateDnsZoneSubscriptionId: privateDnsZoneSubscriptionId } } -output webappName string = webapp.name -output webappId string = webapp.id -output webappUrl string = webapp.properties.hostNameSslStates[0].name +// output webappName string = webapp.name +// output webappId string = webapp.id +// output webappUrl string = webapp.properties.hostNameSslStates[0].name diff --git a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep index 6748c0c46..f6a0872a2 100644 --- a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep +++ b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep @@ -14,17 +14,23 @@ param virtualNetworkName string = 'vnet-${stackName}' param linkVnetIds array = [] -param vnetAddressPrefix array = [ '10.10.0.0/16' ] +param vnetAddressPrefix array = ['10.10.0.0/16'] -param functionName string = '${stackName}-node-api' +param apiFunctionName string = '${stackName}-node-api' -param functionSubnetName string = 'snet-${functionName}' +param apiFunctionSubnetName string = 'snet-${apiFunctionName}' -param functionSubnetAddressPrefix string = '10.10.11.0/28' +param apiFunctionSubnetAddressPrefix string = '10.10.11.0/28' + +param migrationFunctionName string = '${stackName}-migration' + +param migrationSubnetAddressPrefix string = '10.10.14.0/28' + +param migrationSubnetName string = 'snet-${migrationFunctionName}' param webappName string = '${stackName}-node-api' -param webappSubnetName string = 'snet-${functionName}' +param webappSubnetName string = 'snet-${apiFunctionName}' param webappSubnetAddressPrefix string = '10.10.10.0/28' @@ -41,35 +47,32 @@ param privateDnsZoneResourceGroup string = networkResourceGroupName @description('Private DNS Zone subscription, all 3 params here are set because the Prod environment uses a different subscription and RG for these') param privateDnsZoneSubscriptionId string = subscription().subscriptionId - - -module targetVnet './vnet.bicep' = - if (deployVnet) { - name: '${stackName}-vnet-module' - scope: resourceGroup(networkResourceGroupName) - params: { - vnetName: virtualNetworkName - vnetAddressPrefix: vnetAddressPrefix - location: location - } +module targetVnet './vnet.bicep' = if (deployVnet) { + name: '${stackName}-vnet-module' + scope: resourceGroup(networkResourceGroupName) + params: { + vnetName: virtualNetworkName + vnetAddressPrefix: vnetAddressPrefix + location: location } +} resource ustpVirtualNetwork 'Microsoft.Network/virtualNetworks@2022-09-01' existing = { name: virtualNetworkName scope: resourceGroup(networkResourceGroupName) } -module ustpDnsZones './private-dns-zones.bicep' ={ - name: '${stackName}-network-dns-module' - scope: resourceGroup(privateDnsZoneSubscriptionId, privateDnsZoneResourceGroup) - params: { - stackName: stackName - virtualNetworkId: ustpVirtualNetwork.id - linkVnetIds: linkVnetIds - privateDnsZoneName: privateDnsZoneName - deployDns: deployDns - privateDnsZoneSubscriptionId: privateDnsZoneSubscriptionId - privateDnsZoneResourceGroup: privateDnsZoneResourceGroup +module ustpDnsZones './private-dns-zones.bicep' = { + name: '${stackName}-network-dns-module' + scope: resourceGroup(privateDnsZoneSubscriptionId, privateDnsZoneResourceGroup) + params: { + stackName: stackName + virtualNetworkId: ustpVirtualNetwork.id + linkVnetIds: linkVnetIds + privateDnsZoneName: privateDnsZoneName + deployDns: deployDns + privateDnsZoneSubscriptionId: privateDnsZoneSubscriptionId + privateDnsZoneResourceGroup: privateDnsZoneResourceGroup } } @@ -104,13 +107,50 @@ module privateEndpointSubnet './subnet.bicep' = { ] } -module functionSubnet './subnet.bicep' = { - name: '${functionName}-subnet-module' +module apiFunctionSubnet './subnet.bicep' = { + name: '${apiFunctionName}-subnet-module' + scope: resourceGroup(networkResourceGroupName) + params: { + virtualNetworkName: virtualNetworkName + subnetName: apiFunctionSubnetName + subnetAddressPrefix: apiFunctionSubnetAddressPrefix + subnetServiceEndpoints: [ + { + service: 'Microsoft.Sql' + locations: [ + location + ] + } + { + service: 'Microsoft.AzureCosmosDB' + locations: [ + location + ] + } + ] + subnetDelegations: [ + { + name: 'Microsoft.Web/serverfarms' + properties: { + serviceName: 'Microsoft.Web/serverfarms' + } + } + ] + } + dependsOn: [ + ustpVirtualNetwork + ustpDnsZones + privateEndpointSubnet + ] +} + +module migrationFunctionSubnet './subnet.bicep' = { + name: '${migrationFunctionName}-subnet-module' scope: resourceGroup(networkResourceGroupName) params: { virtualNetworkName: virtualNetworkName - subnetName: functionSubnetName - subnetAddressPrefix: functionSubnetAddressPrefix + subnetName: migrationSubnetName + subnetAddressPrefix: migrationSubnetAddressPrefix subnetServiceEndpoints: [ { service: 'Microsoft.Sql' @@ -161,13 +201,18 @@ module webappSubnet './subnet.bicep' = { dependsOn: [ ustpVirtualNetwork ustpDnsZones - functionSubnet + apiFunctionSubnet ] } output privateEndpointSubnetName string = privateEndpointSubnet.outputs.subnetName output privateEndpointSubnetId string = privateEndpointSubnet.outputs.subnetId -output functionSubnetId string = functionSubnet.outputs.subnetId +output apiFunctionSubnetId string = apiFunctionSubnet.outputs.subnetId output webappSubnetId string = webappSubnet.outputs.subnetId +output migrationFunctionSubnetId string = migrationFunctionSubnet.outputs.subnetId output privateDnsZoneId string = ustpDnsZones.outputs.privateDnsZoneId -output cosmosDbAllowedSubnets array = [privateEndpointSubnet.outputs.subnetId, functionSubnet.outputs.subnetId] +output cosmosDbAllowedSubnets array = [ + privateEndpointSubnet.outputs.subnetId + apiFunctionSubnet.outputs.subnetId + migrationFunctionSubnet.outputs.subnetId +] diff --git a/ops/cloud-deployment/main.bicep b/ops/cloud-deployment/main.bicep index f0eeafabc..57de1f52f 100644 --- a/ops/cloud-deployment/main.bicep +++ b/ops/cloud-deployment/main.bicep @@ -44,11 +44,17 @@ param webappSubnetAddressPrefix string = '10.10.10.0/28' ]) param webappPlanType string = 'P1v2' -param functionName string = '${stackName}-node-api' +param apiFunctionName string = '${stackName}-node-api' -param functionSubnetName string = 'snet-${functionName}' +param apiFunctionSubnetName string = 'snet-${apiFunctionName}' -param functionSubnetAddressPrefix string = '10.10.11.0/28' +param apiFunctionSubnetAddressPrefix string = '10.10.11.0/28' + +param migrationFunctionName string = '${stackName}-migration' + +param migrationSubnetAddressPrefix string = '10.10.14.0/28' + +param migrationSubnetName string = 'snet-${migrationFunctionName}' @description('Plan type to determine functionapp service plan Sku') @allowed([ @@ -139,9 +145,12 @@ module network './lib//network/ustp-cams-network.bicep' = { networkResourceGroupName: networkResourceGroupName deployVnet: deployVnet location: location - functionName: functionName - functionSubnetName: functionSubnetName - functionSubnetAddressPrefix: functionSubnetAddressPrefix + apiFunctionName: apiFunctionName + apiFunctionSubnetName: apiFunctionSubnetName + apiFunctionSubnetAddressPrefix: apiFunctionSubnetAddressPrefix + migrationFunctionName: migrationFunctionName + migrationSubnetAddressPrefix: migrationSubnetAddressPrefix + migrationSubnetName: migrationSubnetName webappName: webappName webappSubnetAddressPrefix: webappSubnetAddressPrefix webappSubnetName: webappSubnetName @@ -172,7 +181,7 @@ module ustpWebapp 'frontend-webapp-deploy.bicep' = { createAlerts: createAlerts actionGroupName: actionGroupName actionGroupResourceGroupName: analyticsResourceGroupName - targetApiServerHost: '${functionName}.azurewebsites${azHostSuffix} ${functionName}-${slotName}.azurewebsites${azHostSuffix}' //adding both production and slot hostname to CSP + targetApiServerHost: '${apiFunctionName}.azurewebsites${azHostSuffix} ${apiFunctionName}-${slotName}.azurewebsites${azHostSuffix}' //adding both production and slot hostname to CSP ustpIssueCollectorHash: ustpIssueCollectorHash camsReactSelectHash: camsReactSelectHash webappSubnetId: network.outputs.webappSubnetId @@ -196,10 +205,12 @@ module ustpFunctions 'backend-api-deploy.bicep' = { analyticsWorkspaceId: analyticsWorkspaceId location: location planType: functionPlanType - planName: 'plan-${functionName}' - functionName: functionName + planName: 'plan-${stackName}-functions' + apiFunctionName: apiFunctionName + apiFunctionSubnetId: network.outputs.apiFunctionSubnetId + migrationFunctionName: migrationFunctionName + migrationFunctionSubnetId: network.outputs.migrationFunctionSubnetId functionsRuntime: 'node' - functionSubnetId: network.outputs.functionSubnetId sqlServerName: sqlServerName sqlServerResourceGroupName: sqlServerResourceGroupName sqlServerIdentityName: sqlServerIdentityName @@ -230,9 +241,9 @@ module ustpFunctions 'backend-api-deploy.bicep' = { // main.bicep outputs -resource identityKeyVaultAppConfig 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { - name: idKeyvaultAppConfiguration - scope: resourceGroup(kvAppConfigResourceGroupName) -} -output keyVaultId string = identityKeyVaultAppConfig.id -output keyVaultManagedIdName string = identityKeyVaultAppConfig.name +// resource identityKeyVaultAppConfig 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { +// name: idKeyvaultAppConfiguration +// scope: resourceGroup(kvAppConfigResourceGroupName) +// } +// output keyVaultId string = identityKeyVaultAppConfig.id +// output keyVaultManagedIdName string = identityKeyVaultAppConfig.name diff --git a/ops/scripts/pipeline/azure-deploy.sh b/ops/scripts/pipeline/azure-deploy.sh index 8af2415ac..cd51ef69f 100755 --- a/ops/scripts/pipeline/azure-deploy.sh +++ b/ops/scripts/pipeline/azure-deploy.sh @@ -16,12 +16,12 @@ deployment_parameters='' is_ustp_deployment=false inputParams=() -requiredUSTPParams=("--mssqlRequestTimeout" "--isUstpDeployment" "--resource-group" "--file" "--stackName" "--networkResourceGroupName" "--virtualNetworkName" "--analyticsWorkspaceId" "--idKeyvaultAppConfiguration" "--kvAppConfigName" "--cosmosDatabaseName" "--deployVnet" "--camsReactSelectHash" "--ustpIssueCollectorHash" "--createAlerts" "--deployAppInsights" "--functionPlanType" "--webappPlanType" "--loginProvider" "--loginProviderConfig" "--sqlServerName" "--sqlServerResourceGroupName" "--oktaUrl" "--location" "--webappSubnetName" "--functionSubnetName" "--privateEndpointSubnetName" "--webappSubnetAddressPrefix" "--privateEndpointSubnetAddressPrefix" "--functionSubnetAddressPrefix" "--privateDnsZoneName" "--privateDnsZoneResourceGroup" "--privateDnsZoneSubscriptionId" "--analyticsResourceGroupName" "--kvAppConfigResourceGroupName" "--deployDns") +requiredUSTPParams=("--mssqlRequestTimeout" "--isUstpDeployment" "--resource-group" "--file" "--stackName" "--networkResourceGroupName" "--virtualNetworkName" "--analyticsWorkspaceId" "--idKeyvaultAppConfiguration" "--kvAppConfigName" "--cosmosDatabaseName" "--deployVnet" "--camsReactSelectHash" "--ustpIssueCollectorHash" "--createAlerts" "--deployAppInsights" "--functionPlanType" "--webappPlanType" "--loginProvider" "--loginProviderConfig" "--sqlServerName" "--sqlServerResourceGroupName" "--oktaUrl" "--location" "--webappSubnetName" "--apiFunctionSubnetName" "--privateEndpointSubnetName" "--webappSubnetAddressPrefix" "--privateEndpointSubnetAddressPrefix" "--apiFunctionSubnetAddressPrefix" "--migrationSubnetName" "--migrationSubnetAddressPrefix" "--privateDnsZoneName" "--privateDnsZoneResourceGroup" "--privateDnsZoneSubscriptionId" "--analyticsResourceGroupName" "--kvAppConfigResourceGroupName" "--deployDns") requiredFlexionParams=("--mssqlRequestTimeout" "--resource-group" "--file" "--stackName" "--networkResourceGroupName" "--kvAppConfigName" "--kvAppConfigResourceGroupName" "--virtualNetworkName" "--analyticsWorkspaceId" "--idKeyvaultAppConfiguration" "--cosmosDatabaseName" "--deployVnet" "--camsReactSelectHash" "--ustpIssueCollectorHash" "--createAlerts" "--deployAppInsights" "--functionPlanType" "--webappPlanType" "--loginProvider" "--loginProviderConfig" "--sqlServerName" "--sqlServerResourceGroupName" "--sqlServerIdentityName" "--actionGroupName" "--oktaUrl") # shellcheck disable=SC2034 # REASON: to have a reference for all possible parameters -allParams=("--mssqlRequestTimeout" "--isUstpDeployment" "--resource-group" "--file" "--stackName" "--networkResourceGroupName" "--virtualNetworkName" "--analyticsWorkspaceId" "--idKeyvaultAppConfiguration" "--kvAppConfigName" "--cosmosDatabaseName" "--deployVnet" "--camsReactSelectHash" "--ustpIssueCollectorHash" "--createAlerts" "--deployAppInsights" "--functionPlanType" "--webappPlanType" "--loginProvider" "--loginProviderConfig" "--sqlServerName" "--sqlServerResourceGroupName" "--sqlServerIdentityResourceGroupName" "--sqlServerIdentityName" "--actionGroupName" "--oktaUrl" "--location" "--webappSubnetName" "--functionSubnetName" "--privateEndpointSubnetName" "--webappSubnetAddressPrefix" "--functionSubnetAddressPrefix" "--vnetAddressPrefix" "--linkVnetIds" "--privateDnsZoneName" "--privateDnsZoneResourceGroup" "--privateDnsZoneSubscriptionId" "--analyticsResourceGroupName" "--kvAppConfigResourceGroupName" "--deployDns" "--azHostSuffix" "--allowVeracodeScan") +allParams=("--mssqlRequestTimeout" "--isUstpDeployment" "--resource-group" "--file" "--stackName" "--networkResourceGroupName" "--virtualNetworkName" "--analyticsWorkspaceId" "--idKeyvaultAppConfiguration" "--kvAppConfigName" "--cosmosDatabaseName" "--deployVnet" "--camsReactSelectHash" "--ustpIssueCollectorHash" "--createAlerts" "--deployAppInsights" "--functionPlanType" "--webappPlanType" "--loginProvider" "--loginProviderConfig" "--sqlServerName" "--sqlServerResourceGroupName" "--sqlServerIdentityResourceGroupName" "--sqlServerIdentityName" "--actionGroupName" "--oktaUrl" "--location" "--webappSubnetName" "--apiFunctionSubnetName" "--privateEndpointSubnetName" "--webappSubnetAddressPrefix" "--apiFunctionSubnetAddressPrefix" "--migrationSubnetName" "--migrationSubnetAddressPrefix" "--vnetAddressPrefix" "--linkVnetIds" "--privateDnsZoneName" "--privateDnsZoneResourceGroup" "--privateDnsZoneSubscriptionId" "--analyticsResourceGroupName" "--kvAppConfigResourceGroupName" "--deployDns" "--azHostSuffix" "--allowVeracodeScan") function az_vnet_exists_func() { @@ -158,16 +158,28 @@ while [[ $# -gt 0 ]]; do deployment_parameters="${deployment_parameters} ${webapp_subnet_address_prefix_param}" shift 2 ;; - --functionSubnetName) + --apiFunctionSubnetName) inputParams+=("${1}") - function_subnet_name_param="functionSubnetName=${2}" - deployment_parameters="${deployment_parameters} ${function_subnet_name_param}" + api_function_subnet_name_param="apiFunctionSubnetName=${2}" + deployment_parameters="${deployment_parameters} ${api_function_subnet_name_param}" shift 2 ;; - --functionSubnetAddressPrefix) + --apiFunctionSubnetAddressPrefix) inputParams+=("${1}") - function_subnet_address_prefix_param="functionSubnetAddressPrefix=${2}" - deployment_parameters="${deployment_parameters} ${function_subnet_address_prefix_param}" + api_function_subnet_address_prefix_param="apiFunctionSubnetAddressPrefix=${2}" + deployment_parameters="${deployment_parameters} ${api_function_subnet_address_prefix_param}" + shift 2 + ;; + --migrationFunctionSubnetName) + inputParams+=("${1}") + migration_function_subnet_name_param="migrationFunctionSubnetName=${2}" + deployment_parameters="${deployment_parameters} ${migration_function_subnet_name_param}" + shift 2 + ;; + --migrationFunctionSubnetAddressPrefix) + inputParams+=("${1}") + migration_function_subnet_address_prefix_param="migrationFunctionSubnetAddressPrefix=${2}" + deployment_parameters="${deployment_parameters} ${migration_function_subnet_address_prefix_param}" shift 2 ;; --privateEndpointSubnetName) diff --git a/ops/scripts/pipeline/endpoint-test.sh b/ops/scripts/pipeline/endpoint-test.sh index 059b1a3ed..4c6e21e1d 100755 --- a/ops/scripts/pipeline/endpoint-test.sh +++ b/ops/scripts/pipeline/endpoint-test.sh @@ -2,7 +2,7 @@ # Title: endpoint-test.sh # Description: Verify 200 response from frontend and backend -# Usage: ./endpoint-test.sh --webappName webappName --apiName apiName --slot slotName --hostSuffix hostSuffix +# Usage: ./endpoint-test.sh --webappName webappName --apiFunctionName apiFunctionName --slot slotName --hostSuffix hostSuffix # # Exitcodes # ========== @@ -18,11 +18,11 @@ isLocalRun='' while [[ $# -gt 0 ]]; do case $1 in -h | --help) - echo "./endpoint-test.sh --webappName webappName --apiName apiName --slot slotName --hostSuffix hostSuffix" + echo "./endpoint-test.sh --webappName webappName --apiFunctionName apiFunctionName --slot slotName --hostSuffix hostSuffix" exit 0 ;; - --apiName) + --apiFunctionName) api_name="${2}" shift 2 ;; diff --git a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh index 2177855c8..d21bdebed 100755 --- a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh +++ b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh @@ -2,7 +2,7 @@ # Title: az-slot-api-resource-deploy.sh # Description: Helper script to provision Azure slot deployment resources for Azure functionapp api -# Usage: ./az-slot-api-resource-deploy.sh -h --resourceGroup resourceGroupName --idResourceGroup managedIdResourceGroup --webappName webappName --apiName functionappName --slotName staging --kvIdName kvManagedIdName --sqlIdName sqlManagedIdName --cosmosIdName cosmosManagedIdName --storageAccName apiStorageAccountName --databaseName cosmosDbName --infoSha environmentHash --isUstpDeployment +# Usage: ./az-slot-api-resource-deploy.sh -h --resourceGroup resourceGroupName --idResourceGroup managedIdResourceGroup --webappName webappName --apiFunctionName functionappName --slotName staging --kvIdName kvManagedIdName --sqlIdName sqlManagedIdName --cosmosIdName cosmosManagedIdName --apiStorageAccName apiStorageAccountName --databaseName cosmosDbName --infoSha environmentHash --isUstpDeployment # # Exitcodes # ========== @@ -18,7 +18,7 @@ info_sha='' while [[ $# -gt 0 ]]; do case $1 in -h | --help) - echo "USAGE: az-slot-api-resource-deploy.sh -h --resourceGroup resourceGroupName --idResourceGroup managedIdResourceGroup --webappName webappName --apiName functionappName --slotName staging --kvIdName kvManagedIdName --sqlIdName sqlManagedIdName --storageAccName apiStorageAccountName --databaseName cosmosDbName --infoSha environmentHash" + echo "USAGE: az-slot-api-resource-deploy.sh -h --resourceGroup resourceGroupName --idResourceGroup managedIdResourceGroup --webappName webappName --apiFunctionName functionappName --slotName staging --kvIdName kvManagedIdName --sqlIdName sqlManagedIdName --apiStorageAccName apiStorageAccountName --databaseName cosmosDbName --infoSha environmentHash" exit 0 ;; --resourceGroup) @@ -31,8 +31,13 @@ while [[ $# -gt 0 ]]; do shift 2 ;; - --apiName) - api_name="${2}" + --apiFunctionName) + api_function_name="${2}" + shift 2 + ;; + + --migrationFunctionName) + migration_function_name="${2}" shift 2 ;; @@ -54,8 +59,12 @@ while [[ $# -gt 0 ]]; do sql_id_name="${2}" shift 2 ;; - --storageAccName) - storage_acc_name="${2}" + --apiStorageAccName) + api_storage_acc_name="${2}" + shift 2 + ;; + --migrationStorageAccName) + migration_storage_acc_name="${2}" shift 2 ;; --databaseName) @@ -78,14 +87,21 @@ done #Function App Slot Deployment and Configuration echo "Creating Storage account for Node API Slot..." -az storage account create --name "$storage_acc_name" --resource-group "$app_rg" -o json -storage_acc_key=$(az storage account keys list -g "$app_rg" --account-name "$storage_acc_name" --query '[0].value' -o tsv) +az storage account create --name "$api_storage_acc_name" --resource-group "$app_rg" -o json -echo "Creating Node API Staging Slot..." -az functionapp deployment slot create --name "$api_name" --resource-group "$app_rg" --slot "$slot_name" --configuration-source "$api_name" +az storage account create --name "$migration_storage_acc_name" --resource-group "$app_rg" -o json + +api_storage_acc_key=$(az storage account keys list -g "$app_rg" --account-name "$api_storage_acc_name" --query '[0].value' -o tsv) +migration_storage_acc_key=$(az storage account keys list -g "$app_rg" --account-name "$migration_storage_acc_name" --query '[0].value' -o tsv) -echo "Setting deployment slot settings for storage account and cosmos database for e2e testing..." +echo "Creating API Function Staging Slot..." +az functionapp deployment slot create --name "$api_function_name" --resource-group "$app_rg" --slot "$slot_name" --configuration-source "$api_function_name" + +echo "Creating Node API Function Staging Slot..." +az functionapp deployment slot create --name "$migration_function_name" --resource-group "$app_rg" --slot "$slot_name" --configuration-source "$migration_function_name" + +echo "Setting deployment slot settings for storage account and cosmos database for e2e testing..." databaseName=$database_name if [[ ${is_ustp_deployment} == true ]]; then @@ -102,13 +118,13 @@ echo "Database Name :${databaseName}" commitSha=$(git rev-parse HEAD) -az functionapp config appsettings set -g "$app_rg" -n "$api_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" MyTaskHub="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${storage_acc_key}" +az functionapp config appsettings set -g "$app_rg" -n "$api_function_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" MyTaskHub="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${api_storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${api_storage_acc_key}" +az functionapp config appsettings set -g "$app_rg" -n "$migration_function_name" --slot "$slot_name" --settings "INFO_SHA=$commitSha" --slot-settings COSMOS_DATABASE_NAME="$databaseName" MyTaskHub="${slot_name}" AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=${migration_storage_acc_name};EndpointSuffix=core.usgovcloudapi.net;AccountKey=${migration_storage_acc_key}" echo "Setting CORS Allowed origins for the API..." -az functionapp cors add -g "$app_rg" --name "$api_name" --slot "$slot_name" --allowed-origins "https://${webapp_name}-${slot_name}.azurewebsites.us" +az functionapp cors add -g "$app_rg" --name "$api_function_name" --slot "$slot_name" --allowed-origins "https://${webapp_name}-${slot_name}.azurewebsites.us" -echo "Assigning managed Identities..." # Identities occasionally come through with improper id for usage here, this constructs that kv_ref_id=$(az identity list -g "$id_rg" --query "[?name == '$kv_id_name'].id" -o tsv) identities="$kv_ref_id" @@ -118,11 +134,21 @@ if [[ ${sql_id_name} != null && ${sql_id_name} != '' ]]; then identities="$identities $sql_ref_id" fi + +echo "Assigning managed Identities API Function App..." # shellcheck disable=SC2086 # REASON: Adds unwanted quotes after --identities -az functionapp identity assign -g "$app_rg" -n "$api_name" --slot "$slot_name" --identities $identities +az functionapp identity assign -g "$app_rg" -n "$api_function_name" --slot "$slot_name" --identities $identities + +echo "Assigning managed Identities to Migration Function App..." +# shellcheck disable=SC2086 # REASON: Adds unwanted quotes after --identities +az functionapp identity assign -g "$app_rg" -n "$migration_function_name" --slot "$slot_name" --identities $identities + +echo "Setting KeyVaultReferenceIdentity API Function App..." +az functionapp update --resource-group "$app_rg" --name "$api_function_name" --slot "$slot_name" --set keyVaultReferenceIdentity="$kv_ref_id" -echo "Setting KeyVaultReferenceIdentity..." -az functionapp update --resource-group "$app_rg" --name "$api_name" --slot "$slot_name" --set keyVaultReferenceIdentity="$kv_ref_id" +echo "Setting KeyVaultReferenceIdentity for Migration Function App..." +az functionapp update --resource-group "$app_rg" --name "$api_function_name" --slot "$slot_name" --set keyVaultReferenceIdentity="$kv_ref_id" +#TODO: deal with traffic routing if we want to test # shellcheck disable=SC2086 -az webapp traffic-routing set --distribution ${slot_name}=0 --name "${api_name}" --resource-group "${app_rg}" +az webapp traffic-routing set --distribution ${slot_name}=0 --name "${api_function_name}" --resource-group "${app_rg}" diff --git a/ops/scripts/pipeline/slots/az-slot-web-resource-deploy.sh b/ops/scripts/pipeline/slots/az-slot-web-resource-deploy.sh index 21d6ea11f..7442c7adc 100755 --- a/ops/scripts/pipeline/slots/az-slot-web-resource-deploy.sh +++ b/ops/scripts/pipeline/slots/az-slot-web-resource-deploy.sh @@ -2,7 +2,7 @@ # Title: az-slot-web-resource-deploy.sh # Description: Helper script to provision Azure slot deployment resources for Azure webapp -# Usage: ./az-slot-web-resource-deploy.sh -h --resourceGroup resourceGroupName --webappName webappName --apiName apiName --slotName staging --subscription networkSubscription --network-rg networkResourceGroup --vnet vnetName --subnet webappSubnetName" +# Usage: ./az-slot-web-resource-deploy.sh -h --resourceGroup resourceGroupName --webappName webappName --apiFunctionName apiFunctionName --slotName staging --subscription networkSubscription --network-rg networkResourceGroup --vnet vnetName --subnet webappSubnetName" # # Exitcodes # ========== @@ -15,7 +15,7 @@ set -euo pipefail # ensure job step fails in CI pipeline when error occurs while [[ $# -gt 0 ]]; do case $1 in -h | --help) - echo "USAGE: az-slot-web-resource-deploy.sh -h --resourceGroup resourceGroupName --webappName webappName --apiName apiName --slotName staging --subscription networkSubscription --network-rg networkResourceGroup --vnet vnetName --subnet webappSubnetName" + echo "USAGE: az-slot-web-resource-deploy.sh -h --resourceGroup resourceGroupName --webappName webappName --apiFunctionName apiFunctionName --slotName staging --subscription networkSubscription --network-rg networkResourceGroup --vnet vnetName --subnet webappSubnetName" exit 0 ;; --resourceGroup) @@ -27,7 +27,7 @@ while [[ $# -gt 0 ]]; do shift 2 ;; - --apiName) + --apiFunctionName) api_name="${2}" shift 2 ;; diff --git a/ops/scripts/utility/clean-install-all-projects.sh b/ops/scripts/utility/clean-install-all-projects.sh index bec66001e..49d4e4b4c 100755 --- a/ops/scripts/utility/clean-install-all-projects.sh +++ b/ops/scripts/utility/clean-install-all-projects.sh @@ -6,11 +6,11 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "backend/functions/api" "backend/functions/migration" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit - echo "Cleaning ${str}." + echo "Clean installing ${str}." npm ci popd || exit done diff --git a/package.json b/package.json index 5ce5ce99c..5b1673ea4 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,12 @@ "scripts": { "clean:all": "./ops/scripts/utility/clean-all-projects.sh", "ci:all": "./ops/scripts/utility/clean-install-all-projects.sh", - "start:backend": "cd backend && npm run start", - "start:frontend": "cd user-interface && npm run start", + "start:backend": "pushd backend && npm run start && popd", + "start:frontend": "pushd user-interface && npm run start && popd", "build": "npm run build:common && npm run build:backend && npm run build:frontend", - "build:backend": "cd backend && npm run build", - "build:frontend": "cd user-interface && npm run build", - "build:common": "cd common && npm run build", + "build:backend": "pushd backend && npm run build && npm run build:api && npm run build:migration && popd", + "build:frontend": "pushd user-interface && npm run build && popd", + "build:common": "pushd common && npm run build && popd", "clean-and-build": "npm run clean:all && npm run ci:all && npm run build" } } From cbb097d23ed88233128468414e8c098aeab6ad10 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 09:02:32 -0500 Subject: [PATCH 070/112] edited workflow to run ci properly on newly split functions Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 3d9e0d5fd..f98f3ca50 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -100,8 +100,17 @@ jobs: npm ci popd + pushd ./functions/api npm ci - npm run build + popd + + npm run build:api + + npm pushd ./functions/migration + npm ci + popd + + npm run build:migration - name: Package API run: OUT=${{ inputs.apiFunctionName }} npm run pack From 0a9eb9e447794a1466a86d76998cdf77836e56de Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 09:18:46 -0500 Subject: [PATCH 071/112] corrected paths in pushd Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index f98f3ca50..1f9d1fe29 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -100,13 +100,13 @@ jobs: npm ci popd - pushd ./functions/api + pushd functions/api npm ci popd npm run build:api - npm pushd ./functions/migration + npm pushd functions/migration npm ci popd From d4b98222f442889797c01ed2c9041ae962c68329 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 09:22:26 -0500 Subject: [PATCH 072/112] removed npm Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 1f9d1fe29..187cbb6b1 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -106,7 +106,7 @@ jobs: npm run build:api - npm pushd functions/migration + pushd functions/migration npm ci popd From eb0765a9b9fb2efd30400bd8b516eb3d1b22c8e1 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:11:39 -0500 Subject: [PATCH 073/112] moved app insights and alert creation into one place Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 6 - ops/cloud-deployment/backend-api-deploy.bicep | 170 +++++++++--------- .../app-insights/function-app-insights.bicep | 72 ++++++++ 3 files changed, 162 insertions(+), 86 deletions(-) create mode 100644 ops/cloud-deployment/lib/app-insights/function-app-insights.bicep diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 187cbb6b1..1d21c4a5e 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -100,16 +100,10 @@ jobs: npm ci popd - pushd functions/api npm ci - popd npm run build:api - pushd functions/migration - npm ci - popd - npm run build:migration - name: Package API diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index e8e6473f3..194ee6637 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -37,6 +37,19 @@ var planTypeToSkuMap = { param stackName string = 'ustp-cams' +@description('Azure functions version') +param functionsVersion string = '~4' + +@description('Storage account name. Default creates unique name from resource group id and stack name') +@minLength(3) +@maxLength(24) +param apiFunctionStorageName string = 'ustpfunc${uniqueString(resourceGroup().id, apiFunctionName)}' + +@description('Storage account name. Default creates unique name from resource group id and stack name') +@minLength(3) +@maxLength(24) +param migrationFunctionStorageName string = 'ustpmigr${uniqueString(resourceGroup().id, apiFunctionName)}' + param apiFunctionName string param apiFunctionSubnetId string @@ -74,14 +87,6 @@ param loginProvider string @description('Is ustp deployment') param isUstpDeployment bool -@description('Azure functions version') -param functionsVersion string = '~4' - -@description('Storage account name. Default creates unique name from resource group id and stack name') -@minLength(3) -@maxLength(24) -param functionsStorageName string = 'ustpfunc${uniqueString(resourceGroup().id, apiFunctionName)}' - @description('List of origins to allow. Need to include protocol') param corsAllowOrigins array = [] @@ -135,9 +140,6 @@ resource appConfigIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@202 scope: resourceGroup(kvAppConfigResourceGroupName) } -/* - App service plan (hosting plan) for Azure functions instances -*/ resource servicePlan 'Microsoft.Web/serverfarms@2022-09-01' = { location: location name: planName @@ -157,11 +159,9 @@ resource servicePlan 'Microsoft.Web/serverfarms@2022-09-01' = { } } -/* - Storage resource for Azure functions -*/ -resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { - name: functionsStorageName +//Storage Account Resources +resource apiFunctionStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { + name: apiFunctionStorageName location: location tags: { 'Stack Name': apiFunctionName @@ -176,65 +176,24 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { } } -module appInsights './lib/app-insights/app-insights.bicep' = if (createApplicationInsights) { - name: '${apiFunctionName}-application-insights-module' - params: { - location: location - kind: 'web' - appInsightsName: 'appi-${apiFunctionName}' - applicationType: 'web' - workspaceResourceId: analyticsWorkspaceId - } -} - -module diagnosticSettings './lib/app-insights/diagnostics-settings-func.bicep' = if (createApplicationInsights) { - name: '${apiFunctionName}-diagnostic-settings-module' - params: { - functionAppName: apiFunctionName - workspaceResourceId: analyticsWorkspaceId +resource migrationFunctonStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { + name: migrationFunctionStorageName + location: location + tags: { + 'Stack Name': apiFunctionName } - dependsOn: [ - appInsights - apiFunctionApp - ] -} - -module healthAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { - name: '${apiFunctionName}-healthcheck-alert-rule-module' - params: { - alertName: '${apiFunctionName}-health-check-alert' - appId: apiFunctionApp.id - timeAggregation: 'Average' - operator: 'LessThan' - targetResourceType: 'Microsoft.Web/sites' - metricName: 'HealthCheckStatus' - severity: 2 - threshold: 100 - actionGroupName: actionGroupName - actionGroupResourceGroupName: actionGroupResourceGroupName + sku: { + name: 'Standard_LRS' } -} - -module httpAlertRule './lib/monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { - name: '${apiFunctionName}-http-error-alert-rule-module' - params: { - alertName: '${apiFunctionName}-http-error-alert' - appId: apiFunctionApp.id - timeAggregation: 'Total' - operator: 'GreaterThanOrEqual' - targetResourceType: 'Microsoft.Web/sites' - metricName: 'Http5xx' - severity: 1 - threshold: 1 - actionGroupName: actionGroupName - actionGroupResourceGroupName: actionGroupResourceGroupName + kind: 'Storage' + properties: { + supportsHttpsTrafficOnly: true + defaultToOAuthAuthentication: true } } -/* - Create functionapp -*/ +//Function App Resources var userAssignedIdentities = union( { '${appConfigIdentity.id}': {} @@ -284,14 +243,39 @@ resource migrationFunctionApp 'Microsoft.Web/sites@2022-09-01' = { sqlIdentity ] } + +//Create App Insights +module apiFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = { + name:'appi-${apiFunctionName}-module' + scope: resourceGroup() + params: { + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName + analyticsWorkspaceId: analyticsWorkspaceId + createAlerts: createAlerts + createApplicationInsights: createApplicationInsights + functionAppName: apiFunctionName + } +} + +module migrationFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = { + name:'appi-${migrationFunctionName}-module' + scope: resourceGroup() + params: { + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName + analyticsWorkspaceId: analyticsWorkspaceId + createAlerts: createAlerts + createApplicationInsights: createApplicationInsights + functionAppName: migrationFunctionName + } + +} + //TODO: Clear segregation with DXTR vs ACMS variable/secret naming in GitHub and ADO secret libraries -var applicationSettings = concat( +var baseApplicationSettings = concat( [ - { - name: 'AzureWebJobsStorage' - value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' - } { name: 'FUNCTIONS_EXTENSION_VERSION' value: functionsVersion @@ -397,9 +381,6 @@ var applicationSettings = concat( value: 'main' } ], - createApplicationInsights - ? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: appInsights.outputs.connectionString }] - : [], isUstpDeployment ? [ { name: 'MSSQL_USER', value: '@Microsoft.KeyVault(VaultName=${kvAppConfigName};SecretName=MSSQL-USER)' } @@ -413,6 +394,34 @@ var applicationSettings = concat( ] ) +//Migration Function Application Settings +var migrationApplicationSettings = concat( + [ + { + name: 'AzureWebJobsStorage' + value: 'DefaultEndpointsProtocol=https;AccountName=${migrationFunctonStorageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${migrationFunctonStorageAccount.listKeys().keys[0].value}' + } + ], + baseApplicationSettings, + createApplicationInsights + ? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: migrationFunctionAppInsights.outputs.connectionString }] + : [] +) + +//API Function Application Settings +var apiApplicationSettings = concat( + [ + { + name: 'AzureWebJobsStorage' + value: 'DefaultEndpointsProtocol=https;AccountName=${apiFunctionStorageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${apiFunctionStorageAccount.listKeys().keys[0].value}' + } + ], + baseApplicationSettings, + createApplicationInsights + ? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: apiFunctionAppInsights.outputs.connectionString }] + : [] +) + var ipSecurityRestrictionsRules = concat( [ { @@ -463,7 +472,7 @@ resource apiFunctionConfig 'Microsoft.Web/sites/config@2022-09-01' = { scmIpSecurityRestrictionsDefaultAction: 'Deny' scmIpSecurityRestrictionsUseMain: false linuxFxVersion: linuxFxVersionMap['${functionsRuntime}'] - appSettings: applicationSettings + appSettings: apiApplicationSettings } } @@ -494,10 +503,11 @@ resource migrationFunctionConfig 'Microsoft.Web/sites/config@2022-09-01' = { scmIpSecurityRestrictionsDefaultAction: 'Deny' scmIpSecurityRestrictionsUseMain: false linuxFxVersion: linuxFxVersionMap['${functionsRuntime}'] - appSettings: applicationSettings + appSettings: migrationApplicationSettings } } +//Private Endpoints module apiPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = { name: '${apiFunctionName}-pep-module' scope: resourceGroup(virtualNetworkResourceGroupName) @@ -536,7 +546,7 @@ module setMigrationFunctionSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' params: { stackName: migrationFunctionName sqlServerName: sqlServerName - subnetId: apiFunctionSubnetId + subnetId: migrationFunctionSubnetId } } diff --git a/ops/cloud-deployment/lib/app-insights/function-app-insights.bicep b/ops/cloud-deployment/lib/app-insights/function-app-insights.bicep new file mode 100644 index 000000000..f372d58e6 --- /dev/null +++ b/ops/cloud-deployment/lib/app-insights/function-app-insights.bicep @@ -0,0 +1,72 @@ +param functionAppName string + +param analyticsWorkspaceId string + +param createAlerts bool + +param createApplicationInsights bool + +param actionGroupName string + +param actionGroupResourceGroupName string + +resource functionApp 'Microsoft.Web/sites@2022-09-01' existing = { + name: functionAppName +} + +module appInsights '../app-insights/app-insights.bicep' = if (createApplicationInsights) { + name: '${functionAppName}-application-insights-module' + params: { + location: functionApp.location + kind: 'web' + appInsightsName: 'appi-${functionAppName}' + applicationType: 'web' + workspaceResourceId: analyticsWorkspaceId + } +} + +module diagnosticSettings '../app-insights/diagnostics-settings-func.bicep' = if (createApplicationInsights) { + name: '${functionAppName}-diagnostic-settings-module' + params: { + functionAppName: functionAppName + workspaceResourceId: analyticsWorkspaceId + } + dependsOn: [ + appInsights + functionApp + ] +} + +module healthAlertRule '../monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { + name: '${functionAppName}-healthcheck-alert-rule-module' + params: { + alertName: '${functionAppName}-health-check-alert' + appId: functionApp.id + timeAggregation: 'Average' + operator: 'LessThan' + targetResourceType: 'Microsoft.Web/sites' + metricName: 'HealthCheckStatus' + severity: 2 + threshold: 100 + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName + } +} + +module httpAlertRule '../monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { + name: '${functionAppName}-http-error-alert-rule-module' + params: { + alertName: '${functionAppName}-http-error-alert' + appId: functionApp.id + timeAggregation: 'Total' + operator: 'GreaterThanOrEqual' + targetResourceType: 'Microsoft.Web/sites' + metricName: 'Http5xx' + severity: 1 + threshold: 1 + actionGroupName: actionGroupName + actionGroupResourceGroupName: actionGroupResourceGroupName + } +} + +output connectionString string = appInsights.outputs.connectionString From 8c6b7696fcb05fc8acb4827a4e635a5dcf07bfe8 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:19:15 -0500 Subject: [PATCH 074/112] added node dependency to backend Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 1d21c4a5e..4b1178979 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -94,6 +94,13 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.nodeVersion }} + cache: "npm" + cache-dependency-path: backend/package-lock.json + - name: Execute Build run: | pushd ../common From 61d2eccf71065d5e68f58520dec59f43b802559c Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:35:54 -0500 Subject: [PATCH 075/112] added use-base for ci Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 8 ++------ backend/package.json | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 4b1178979..550ccacf5 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -94,12 +94,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ inputs.nodeVersion }} - cache: "npm" - cache-dependency-path: backend/package-lock.json - name: Execute Build run: | @@ -109,6 +103,8 @@ jobs: npm ci + npm run use-bash + npm run build:api npm run build:migration diff --git a/backend/package.json b/backend/package.json index 1abd09723..9e8187974 100644 --- a/backend/package.json +++ b/backend/package.json @@ -60,6 +60,7 @@ "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration && mv /tmp/build/api/$OUT.zip .", "pack:migration": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions/migration --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", + "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm config set script-shell=/bin/bash && npm run build-common && npm test -- --coverage", "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", From 9700e79b9b85d326929ea23e69807a40369c05f0 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:49:42 -0500 Subject: [PATCH 076/112] created use-bash in package.json and corrected pack Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- .github/workflows/sub-build.yml | 8 +++----- backend/package.json | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 550ccacf5..978fd59f0 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -97,13 +97,11 @@ jobs: - name: Execute Build run: | - pushd ../common - npm ci - popd + npm run use-bash - npm ci + npm run build-common - npm run use-bash + npm ci npm run build:api diff --git a/backend/package.json b/backend/package.json index 9e8187974..bc3cf7280 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,11 +57,11 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build && zip -q -r /tmp/build/$OUT.zip functions/migration --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip functions --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", - "coverage:ci": "npm config set script-shell=/bin/bash && npm run build-common && npm test -- --coverage", + "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", "itest:okta-group-api": "CAMS_LOGIN_PROVIDER=okta npx ts-node lib/testing/isolated-integration/test-okta-group-api.ts", From 0a99c0add5d044e7c8df81e58203bb2856d3bfd9 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:53:39 -0500 Subject: [PATCH 077/112] fixed artifact path on build Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 978fd59f0..baccd6761 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -117,12 +117,12 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.apiFunctionName }}-build - path: backend/api/${{ inputs.apiFunctionName }}.zip + path: backend/${{ inputs.apiFunctionName }}.zip if-no-files-found: error - name: Upload Migration Azure Functions Artifact uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.migrationFunctionName }}-build - path: backend/migration/${{ inputs.migrationFunctionName }}.zip + path: backend/${{ inputs.migrationFunctionName }}.zip if-no-files-found: error From 8f800829de3529cf5eb955fc55749432802dd4f4 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 10:59:22 -0500 Subject: [PATCH 078/112] addressed todo in bicep Jira ticket: CAMS-461 --- ops/cloud-deployment/main.bicep | 2 -- 1 file changed, 2 deletions(-) diff --git a/ops/cloud-deployment/main.bicep b/ops/cloud-deployment/main.bicep index 57de1f52f..13de524c8 100644 --- a/ops/cloud-deployment/main.bicep +++ b/ops/cloud-deployment/main.bicep @@ -126,8 +126,6 @@ param camsReactSelectHash string param cosmosDatabaseName string - -//TODO: Break out Alerts && Action Group module actionGroup './lib/monitoring-alerts/alert-action-group.bicep' = if (createAlerts) { name: '${actionGroupName}-action-group-module' From 407dcd8a9bcbe267c007dd9ccf94aa30a752d974 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 11:23:02 -0500 Subject: [PATCH 079/112] fixed sql vnet rule fir migration functionapp Jira ticket: CAMS-461 --- ops/cloud-deployment/backend-api-deploy.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index 194ee6637..89fc95d3a 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -542,7 +542,7 @@ var createSqlServerVnetRule = !empty(sqlServerResourceGroupName) && !empty(sqlSe module setMigrationFunctionSqlServerVnetRule './lib/network/sql-vnet-rule.bicep' = if (createSqlServerVnetRule) { scope: resourceGroup(sqlServerResourceGroupName) - name: '${apiFunctionName}-sql-vnet-rule-module' + name: '${migrationFunctionName}-sql-vnet-rule-module' params: { stackName: migrationFunctionName sqlServerName: sqlServerName From 33115ca58e01ccc4fd582c7e5a4b5e942cd6604f Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 11:25:21 -0500 Subject: [PATCH 080/112] fixed webapp name [skip ci] Jira ticket: CAMS-461 --- ops/cloud-deployment/lib/network/ustp-cams-network.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep index f6a0872a2..1fe488b44 100644 --- a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep +++ b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep @@ -28,7 +28,7 @@ param migrationSubnetAddressPrefix string = '10.10.14.0/28' param migrationSubnetName string = 'snet-${migrationFunctionName}' -param webappName string = '${stackName}-node-api' +param webappName string = '${stackName}-webapp' param webappSubnetName string = 'snet-${apiFunctionName}' From dbda7335068b4a8351962e6e25f9f4e686b89197 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 11:40:13 -0500 Subject: [PATCH 081/112] fixed dependency issue in network subnets Jira ticket: CAMS-461 --- ops/cloud-deployment/lib/network/ustp-cams-network.bicep | 2 ++ ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep index 1fe488b44..9f9a5444d 100644 --- a/ops/cloud-deployment/lib/network/ustp-cams-network.bicep +++ b/ops/cloud-deployment/lib/network/ustp-cams-network.bicep @@ -178,6 +178,7 @@ module migrationFunctionSubnet './subnet.bicep' = { ustpVirtualNetwork ustpDnsZones privateEndpointSubnet + apiFunctionSubnet ] } @@ -202,6 +203,7 @@ module webappSubnet './subnet.bicep' = { ustpVirtualNetwork ustpDnsZones apiFunctionSubnet + migrationFunctionSubnet ] } diff --git a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh index d21bdebed..3c413550d 100755 --- a/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh +++ b/ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh @@ -125,6 +125,9 @@ az functionapp config appsettings set -g "$app_rg" -n "$migration_function_name" echo "Setting CORS Allowed origins for the API..." az functionapp cors add -g "$app_rg" --name "$api_function_name" --slot "$slot_name" --allowed-origins "https://${webapp_name}-${slot_name}.azurewebsites.us" +echo "Setting CORS Allowed origins for Migration function" +az functionapp cors add -g "$app_rg" --name "$api_function_name" --slot "$slot_name" --allowed-origins "https://portal.azure.us" + # Identities occasionally come through with improper id for usage here, this constructs that kv_ref_id=$(az identity list -g "$id_rg" --query "[?name == '$kv_id_name'].id" -o tsv) identities="$kv_ref_id" From 180e6b90115420066ad09f5709a3ba4692416171 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 11:46:01 -0500 Subject: [PATCH 082/112] added stop operation to migration slot [skip ci] Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .github/workflows/sub-deploy-code-slot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sub-deploy-code-slot.yml b/.github/workflows/sub-deploy-code-slot.yml index 95398a632..1276aad9b 100644 --- a/.github/workflows/sub-deploy-code-slot.yml +++ b/.github/workflows/sub-deploy-code-slot.yml @@ -266,6 +266,7 @@ jobs: run: | az functionapp deployment slot swap --slot ${{ env.slotName }} --name ${{ inputs.migrationFunctionName }} -g ${{ steps.rgApp.outputs.out }} az webapp traffic-routing clear --name ${{ inputs.migrationFunctionName }} -g ${{ steps.rgApp.outputs.out }} + az functionapp stop -g ${{ steps.rgApp.outputs.out }} --name ${{ inputs.migrationFunctionName }} --slot ${{ inputs.slotName }} endpoint-test-application-post-swap: needs: [swap-nodeapi-deployment-slot, swap-webapp-deployment-slot] @@ -304,3 +305,4 @@ jobs: run: | az webapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.webappName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ env.apiFunctionName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true + az functionapp config access-restriction add --resource-group ${{ steps.rgApp.outputs.out }} --name ${{ inputs.migrationFunctionName }} --rule-name AllowAll --action Allow --ip-address 0.0.0.0/0 --priority 100 1>/dev/null || true From 73270b72606c1c6df19d16f383f99e818d9d7bc0 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 11:57:58 -0500 Subject: [PATCH 083/112] commented out prelim steps for now fixed appi dependencies Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .github/workflows/continuous-deployment.yml | 119 ++++++++---------- ops/cloud-deployment/backend-api-deploy.bicep | 7 +- 2 files changed, 61 insertions(+), 65 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 0673aa766..4223cf5de 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -49,60 +49,60 @@ jobs: enableBicepDeployment: ${{ inputs.enableBicepDeployment }} deployVnet: ${{ inputs.deployVnet }} - accessibility-test: - defaults: - run: - working-directory: user-interface - - runs-on: ubuntu-latest - - steps: - - name: Install chrome - uses: browser-actions/setup-chrome@v1 - - - name: Get source code - uses: actions/checkout@v3 - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ vars.NODE_VERSION }} - cache: "npm" - cache-dependency-path: user-interface/package-lock.json - - - name: Install Node dependencies - run: | - pushd ../common - npm ci - popd - - npm ci && npm install -g pa11y-ci - - - name: Run pa11y Test - run: ../ops/scripts/pipeline/accessibility-test.sh - - unit-test-frontend: - uses: ./.github/workflows/reusable-unit-test.yml - with: - path: user-interface - node-version: ${{ vars.NODE_VERSION }} - - unit-test-backend: - uses: ./.github/workflows/reusable-unit-test.yml - with: - path: backend - node-version: ${{ vars.NODE_VERSION }} - - unit-test-common: - uses: ./.github/workflows/reusable-unit-test.yml - with: - path: common - node-version: ${{ vars.NODE_VERSION }} - - security-scan: - name: Security - uses: ./.github/workflows/sub-security-scan.yml - secrets: inherit # pragma: allowlist secret + # accessibility-test: + # defaults: + # run: + # working-directory: user-interface + + # runs-on: ubuntu-latest + + # steps: + # - name: Install chrome + # uses: browser-actions/setup-chrome@v1 + + # - name: Get source code + # uses: actions/checkout@v3 + + # - name: Use Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: ${{ vars.NODE_VERSION }} + # cache: "npm" + # cache-dependency-path: user-interface/package-lock.json + + # - name: Install Node dependencies + # run: | + # pushd ../common + # npm ci + # popd + + # npm ci && npm install -g pa11y-ci + + # - name: Run pa11y Test + # run: ../ops/scripts/pipeline/accessibility-test.sh + + # unit-test-frontend: + # uses: ./.github/workflows/reusable-unit-test.yml + # with: + # path: user-interface + # node-version: ${{ vars.NODE_VERSION }} + + # unit-test-backend: + # uses: ./.github/workflows/reusable-unit-test.yml + # with: + # path: backend + # node-version: ${{ vars.NODE_VERSION }} + + # unit-test-common: + # uses: ./.github/workflows/reusable-unit-test.yml + # with: + # path: common + # node-version: ${{ vars.NODE_VERSION }} + + # security-scan: + # name: Security + # uses: ./.github/workflows/sub-security-scan.yml + # secrets: inherit # pragma: allowlist secret build: name: Build @@ -124,16 +124,7 @@ jobs: deploy: name: Cloud Resource Deployment uses: ./.github/workflows/sub-deploy.yml - needs: - [ - setup, - build, - accessibility-test, - security-scan, - unit-test-frontend, - unit-test-backend, - unit-test-common, - ] + needs: [setup, build] if: ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/dependency-updates-auto') || (inputs.deployBranch == 'true')) diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index 89fc95d3a..03a19098b 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -256,6 +256,9 @@ module apiFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = { createApplicationInsights: createApplicationInsights functionAppName: apiFunctionName } + dependsOn: [ + apiFunctionApp + ] } module migrationFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = { @@ -269,7 +272,9 @@ module migrationFunctionAppInsights 'lib/app-insights/function-app-insights.bice createApplicationInsights: createApplicationInsights functionAppName: migrationFunctionName } - + dependsOn: [ + migrationFunctionApp + ] } //TODO: Clear segregation with DXTR vs ACMS variable/secret naming in GitHub and ADO secret libraries From 6231e1e36d11500434c3abf2811f284d51e624d2 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 12:33:07 -0500 Subject: [PATCH 084/112] corrected pack commands and az-delete-branch-resources Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- backend/package.json | 4 ++-- ops/scripts/utility/az-delete-branch-resources.sh | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index bc3cf7280..4cc4190f2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,8 +57,8 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip functions --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . functions --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", diff --git a/ops/scripts/utility/az-delete-branch-resources.sh b/ops/scripts/utility/az-delete-branch-resources.sh index 1e05e73fc..a46dfd139 100755 --- a/ops/scripts/utility/az-delete-branch-resources.sh +++ b/ops/scripts/utility/az-delete-branch-resources.sh @@ -41,8 +41,11 @@ if [[ "${rgAppExists}" == "true" ]]; then echo "Start disconnecting VNET integration" webapp="ustp-cams-dev-${hash_id}-webapp" az webapp vnet-integration remove -g "${app_rg}" -n "${webapp}" - functionapp="ustp-cams-dev-${hash_id}-node-api" - az functionapp vnet-integration remove -g "${app_rg}" -n "${functionapp}" + apiFunctionApp="ustp-cams-dev-${hash_id}-node-api" + az functionapp vnet-integration remove -g "${app_rg}" -n "${apiFunctionApp}" + echo "Completed disconnecting VNET integration" + migrationFunctionApp="ustp-cams-dev-${hash_id}-migration" + az functionapp vnet-integration remove -g "${app_rg}" -n "${migrationFunctionApp}" echo "Completed disconnecting VNET integration" fi From 75756c58d50c35adc1eae8d1ba305ac8b9ce1257 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 12:45:40 -0500 Subject: [PATCH 085/112] fixed pack commands Jira ticket: CAMS-461 Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 4cc4190f2..c7d423329 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,8 +57,8 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . functions --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", From 7359f21a1650979568583cf5efe0bbd5b5933d1b Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 12:55:41 -0500 Subject: [PATCH 086/112] correctly used dirs in zip command for pack Jira ticket: CAMS-461 Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> --- backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index c7d423329..85445ae7c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,8 +57,8 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration** && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api** && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", From 6210a165fcb28067b5e5d102b8e89e716d1774aa Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 13:08:29 -0500 Subject: [PATCH 087/112] another attempt at pack commands Jira ticket: CAMS-461 --- backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 85445ae7c..2a43f94c7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,8 +57,8 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude api/@.funcignore --exclude api/.funcignore --exclude migration** && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude migration/@.funcignore --exclude migration/.funcignore --exclude api** && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions/ --exclude functions/api/@.funcignore --exclude api/.funcignore --exclude functions/migration** && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip functions/ --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api** && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", From a10905dcbe8dcf6d8a0b39066e2ec7916edbb147 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Mon, 9 Dec 2024 13:10:04 -0500 Subject: [PATCH 088/112] final attempt Jira ticket: CAMS-461 --- backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 2a43f94c7..1b45aa0ad 100644 --- a/backend/package.json +++ b/backend/package.json @@ -57,8 +57,8 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip functions/ --exclude functions/api/@.funcignore --exclude api/.funcignore --exclude functions/migration** && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip functions/ --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api** && mv /tmp/build/migration/$OUT.zip .", + "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration** && mv /tmp/build/api/$OUT.zip .", + "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api** && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", From a8a6ec46410644adc0013f732af409a17d8fb8c9 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:40:41 -0500 Subject: [PATCH 089/112] Refactor building AZ function packages Jira ticket: CAMS-461 --- .gitignore | 3 ++- backend/functions/api/package.json | 12 ++++++----- backend/functions/api/tsconfig.build.json | 2 +- backend/functions/migration/package.json | 12 ++++++----- .../functions/migration/tsconfig.build.json | 2 +- backend/pack.sh | 11 ++++++++++ backend/package.json | 20 +++++++++++-------- 7 files changed, 41 insertions(+), 21 deletions(-) create mode 100755 backend/pack.sh diff --git a/.gitignore b/.gitignore index bebb0bbf8..79426714e 100644 --- a/.gitignore +++ b/.gitignore @@ -75,8 +75,9 @@ cams1.code-workspace # Node **/node_modules/ -# Dist +# Build and Dist **/dist/ +**/build/ # Veracode **/pipeline-scan* diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index c898fad82..b31326f3e 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -2,9 +2,11 @@ "name": "cams-api", "version": "1.0.0", "description": "", - "workspaces": ["../../"], - "dependencies": { - "@azure/functions": "^4.6.0" - }, - "main": "dist/backend/functions/api/*/*.function.js" + "main": "backend/functions/api/*/*.js", + "scripts": { + "clean": "rm -rf build/ dist/ api.zip", + "start": "func start --javascript", + "build": "tsc --build tsconfig.build.json", + "pack": "export PACK_OUT=api; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" + } } diff --git a/backend/functions/api/tsconfig.build.json b/backend/functions/api/tsconfig.build.json index efef3c642..bbaddc8ab 100644 --- a/backend/functions/api/tsconfig.build.json +++ b/backend/functions/api/tsconfig.build.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "dist" + "outDir": "build" }, "extends": "../../tsconfig.json", "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index 39aac1768..d2bde55fa 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -2,9 +2,11 @@ "name": "cams-migration", "version": "1.0.0", "description": "", - "workspaces": ["../../"], - "dependencies": { - "@azure/functions": "^4.6.0" - }, - "main": "dist/backend/functions/migration/*/*.js" + "main": "backend/functions/migration/*/*.js", + "scripts": { + "clean": "rm -rf build/ dist/ migration.zip", + "start": "func start --javascript", + "build": "tsc --build tsconfig.build.json", + "pack": "export PACK_OUT=migration; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" + } } diff --git a/backend/functions/migration/tsconfig.build.json b/backend/functions/migration/tsconfig.build.json index efef3c642..bbaddc8ab 100644 --- a/backend/functions/migration/tsconfig.build.json +++ b/backend/functions/migration/tsconfig.build.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "dist" + "outDir": "build" }, "extends": "../../tsconfig.json", "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] diff --git a/backend/pack.sh b/backend/pack.sh new file mode 100755 index 000000000..31f6e8088 --- /dev/null +++ b/backend/pack.sh @@ -0,0 +1,11 @@ +#! /usr/bin/bash +mkdir -p dist/node_modules/ +cp -r build/* dist/ +cp -r ../../node_modules/* dist/node_modules/ +cp package.json dist/ +cp host.json dist/ +mkdir -p "$PACK_TEMP_DIR" +pushd dist || exit +zip -r "$PACK_TEMP_DIR/$PACK_OUT.zip" . --exclude "*.map" --exclude "*.ts" +popd || exit +mv "$PACK_TEMP_DIR/$PACK_OUT.zip" . diff --git a/backend/package.json b/backend/package.json index 1b45aa0ad..314cb9222 100644 --- a/backend/package.json +++ b/backend/package.json @@ -22,8 +22,8 @@ "typescript": "^5.7.2" }, "dependencies": { - "@azure/cosmos": "^4.2.0", "@azure/functions": "^4.6.0", + "@azure/cosmos": "^4.2.0", "@azure/identity": "^4.5.0", "@azure/keyvault-secrets": "^4.9.0", "@launchdarkly/node-server-sdk": "^9.7.2", @@ -41,13 +41,19 @@ "cookie": "^0.7.2" }, "scripts": { - "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && npm run clean:api && npm run clean:migration", - "clean:api": "pushd functions/api && rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && popd", - "clean:migration": "pushd functions/migration && rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage && popd", + "all": "npm run clean:all && npm ci && npm run build:all && npm run pack:all", + "clean:all": "npm run clean && npm run clean:api && npm run clean:migration", + "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage", + "clean:api": "pushd functions/api && npm run clean && popd", + "clean:migration": "pushd functions/migration && npm run clean && popd", + "build:all": "npm run build-common && npm run build && npm run build:api && npm run build:migration", "build": "tsc --build tsconfig.build.json", - "build:api": "pushd functions/api && tsc --build tsconfig.build.json && popd", - "build:migration": "pushd functions/migration && tsc --build tsconfig.build.json && popd", "build-common": "pushd ../common && npm ci && npm run build && popd", + "build:api": "npm run build && pushd functions/api && npm run build && popd", + "build:migration": "npm run build && pushd functions/migration && npm run build && popd", + "pack:all": "npm run pack:api && npm run pack:migration", + "pack:api": "pushd functions/api && npm run pack && popd", + "pack:migration": "pushd functions/migration && npm run pack && popd", "watch": "tsc --project tsconfig.build.json -w", "prestart": "npm run build", "start:api": "pushd functions/api && func start --typescript && popd", @@ -57,8 +63,6 @@ "lint": "eslint functions", "lint:fix": "eslint functions --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", - "pack": "mkdir -p /tmp/build/api && zip -q -r /tmp/build/api/$OUT.zip . --exclude functions/api/@.funcignore --exclude functions/api/.funcignore --exclude functions/migration** && mv /tmp/build/api/$OUT.zip .", - "pack:migration": "mkdir -p /tmp/build/migration && zip -q -r /tmp/build/migration/$OUT.zip . --exclude functions/migration/@.funcignore --exclude functions/migration/.funcignore --exclude functions/api** && mv /tmp/build/migration/$OUT.zip .", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", From b93ce03ab674883669e8c4434d1e84c247f7f176 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:01:27 -0500 Subject: [PATCH 090/112] Fix running locally vs packaging Jira ticket: CAMS-461 --- backend/functions/api/dist.package.json | 9 ++ backend/functions/api/package-lock.json | 105 ------------------ backend/functions/api/package.json | 7 +- backend/functions/migration/dist.package.json | 9 ++ backend/functions/migration/package.json | 7 +- backend/pack.sh | 4 +- backend/package.json | 6 +- 7 files changed, 32 insertions(+), 115 deletions(-) create mode 100644 backend/functions/api/dist.package.json delete mode 100644 backend/functions/api/package-lock.json create mode 100644 backend/functions/migration/dist.package.json diff --git a/backend/functions/api/dist.package.json b/backend/functions/api/dist.package.json new file mode 100644 index 000000000..f7567cb32 --- /dev/null +++ b/backend/functions/api/dist.package.json @@ -0,0 +1,9 @@ +{ + "name": "cams-api", + "version": "1.0.0", + "description": "", + "main": "backend/functions/api/*/*.function.js", + "scripts": { + "start": "func start --javascript" + } +} diff --git a/backend/functions/api/package-lock.json b/backend/functions/api/package-lock.json deleted file mode 100644 index 584f737b8..000000000 --- a/backend/functions/api/package-lock.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "name": "cams-api", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "cams-api", - "version": "1.0.0", - "workspaces": [ - "../../" - ], - "dependencies": { - "@azure/functions": "^4.6.0" - } - }, - "../..": { - "name": "node", - "version": "1.0.0", - "dependencies": { - "@azure/cosmos": "^4.2.0", - "@azure/functions": "^4.6.0", - "@azure/identity": "^4.5.0", - "@azure/keyvault-secrets": "^4.9.0", - "@launchdarkly/node-server-sdk": "^9.7.2", - "@okta/jwt-verifier": "^4.0.1", - "@okta/okta-sdk-nodejs": "^7.1.1", - "applicationinsights": "^3.4.0", - "dotenv": "^16.4.7", - "durable-functions": "^3.1.0", - "jsonwebtoken": "^9.0.2", - "mongodb": "^6.11.0", - "mssql": "^10.0.4" - }, - "devDependencies": { - "@faker-js/faker": "^9.3.0", - "@types/jest": "^29.5.14", - "@types/mssql": "^9.1.5", - "@types/node": "^22.10.1", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "azure-function-context-mock": "^0.0.7", - "dependency-cruiser": "^16.7.0", - "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^16.6.2", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-promise": "^6.6.0", - "jest": "^29.7.0", - "prettier": "^3.4.2", - "ts-jest": "^29.2.5", - "typescript": "^5.7.2" - } - }, - "node_modules/@azure/functions": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.0.tgz", - "integrity": "sha512-vGq9jXlgrJ3KaI8bepgfpk26zVY8vFZsQukF85qjjKTAR90eFOOBNaa+mc/0ViDY2lcdrU2fL/o1pQyZUtTDsw==", - "dependencies": { - "cookie": "^0.7.0", - "long": "^4.0.0", - "undici": "^5.13.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "engines": { - "node": ">=14" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/node": { - "resolved": "../..", - "link": true - }, - "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - } - } -} diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index b31326f3e..ec3200270 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -2,10 +2,11 @@ "name": "cams-api", "version": "1.0.0", "description": "", - "main": "backend/functions/api/*/*.js", + "main": "build/backend/functions/api/*/*.function.js", "scripts": { - "clean": "rm -rf build/ dist/ api.zip", - "start": "func start --javascript", + "clean": "rm -rf build/ dist/ *.zip", + "prestart": "npm run build", + "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", "pack": "export PACK_OUT=api; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" } diff --git a/backend/functions/migration/dist.package.json b/backend/functions/migration/dist.package.json new file mode 100644 index 000000000..9edc4d695 --- /dev/null +++ b/backend/functions/migration/dist.package.json @@ -0,0 +1,9 @@ +{ + "name": "cams-migration", + "version": "1.0.0", + "description": "", + "main": "backend/functions/migration/*/*.js", + "scripts": { + "start": "func start --javascript" + } +} diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index d2bde55fa..04aada96a 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -2,10 +2,11 @@ "name": "cams-migration", "version": "1.0.0", "description": "", - "main": "backend/functions/migration/*/*.js", + "main": "build/backend/functions/migration/*/*.js", "scripts": { - "clean": "rm -rf build/ dist/ migration.zip", - "start": "func start --javascript", + "clean": "rm -rf build/ dist/ *.zip", + "prestart": "npm run build", + "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", "pack": "export PACK_OUT=migration; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" } diff --git a/backend/pack.sh b/backend/pack.sh index 31f6e8088..d76060bef 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -1,8 +1,8 @@ -#! /usr/bin/bash +#! /bin/bash mkdir -p dist/node_modules/ cp -r build/* dist/ cp -r ../../node_modules/* dist/node_modules/ -cp package.json dist/ +cp dist.package.json dist/package.json cp host.json dist/ mkdir -p "$PACK_TEMP_DIR" pushd dist || exit diff --git a/backend/package.json b/backend/package.json index 314cb9222..b568ff9b9 100644 --- a/backend/package.json +++ b/backend/package.json @@ -52,12 +52,14 @@ "build:api": "npm run build && pushd functions/api && npm run build && popd", "build:migration": "npm run build && pushd functions/migration && npm run build && popd", "pack:all": "npm run pack:api && npm run pack:migration", + "pack": "npm run pack:api", "pack:api": "pushd functions/api && npm run pack && popd", "pack:migration": "pushd functions/migration && npm run pack && popd", "watch": "tsc --project tsconfig.build.json -w", "prestart": "npm run build", - "start:api": "pushd functions/api && func start --typescript && popd", - "start:migration": "pushd functions/migration && func start --typescript && popd", + "start": "npm run start:api", + "start:api": "pushd functions/api && npm run start && popd", + "start:migration": "pushd functions/migration && npm run start && popd", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", "lint": "eslint functions", From 307cdd4b2806825cd94f7f06351ad18ec2dac6cb Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:08:49 -0500 Subject: [PATCH 091/112] Limit redundant builds when starting locally Jira ticket: CAMS-461 --- backend/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index b568ff9b9..0e125877f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -49,14 +49,14 @@ "build:all": "npm run build-common && npm run build && npm run build:api && npm run build:migration", "build": "tsc --build tsconfig.build.json", "build-common": "pushd ../common && npm ci && npm run build && popd", - "build:api": "npm run build && pushd functions/api && npm run build && popd", - "build:migration": "npm run build && pushd functions/migration && npm run build && popd", + "build:api": "pushd functions/api && npm run build && popd", + "build:migration": "pushd functions/migration && npm run build && popd", "pack:all": "npm run pack:api && npm run pack:migration", "pack": "npm run pack:api", "pack:api": "pushd functions/api && npm run pack && popd", "pack:migration": "pushd functions/migration && npm run pack && popd", "watch": "tsc --project tsconfig.build.json -w", - "prestart": "npm run build", + "prestart": "npm run build-common && npm run build", "start": "npm run start:api", "start:api": "pushd functions/api && npm run start && popd", "start:migration": "pushd functions/migration && npm run start && popd", From e6b42af416fc6e2bc7dfdff31f47dc3e6a19fdee Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:20:14 -0500 Subject: [PATCH 092/112] Sync .env and local.settings.json with functions Jira ticket: CAMS-461 --- backend/functions/api/package.json | 2 +- backend/functions/migration/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index ec3200270..2de0ebcd0 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -5,7 +5,7 @@ "main": "build/backend/functions/api/*/*.function.js", "scripts": { "clean": "rm -rf build/ dist/ *.zip", - "prestart": "npm run build", + "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", "pack": "export PACK_OUT=api; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index 04aada96a..2911ae88d 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -5,7 +5,7 @@ "main": "build/backend/functions/migration/*/*.js", "scripts": { "clean": "rm -rf build/ dist/ *.zip", - "prestart": "npm run build", + "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", "pack": "export PACK_OUT=migration; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" From e27a24aecabba5fabf5c1d7622c7d3cab9ca309f Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:35:30 -0500 Subject: [PATCH 093/112] Use OUT env var for naming package archive Jira ticket: CAMS-461 --- backend/pack.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/pack.sh b/backend/pack.sh index d76060bef..fcad82b2e 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -1,4 +1,11 @@ #! /bin/bash + +if [[ $OUT == "" ]]; then + FILE_NAME=$PACK_OUT; +else + FILE_NAME=$OUT; +fi + mkdir -p dist/node_modules/ cp -r build/* dist/ cp -r ../../node_modules/* dist/node_modules/ @@ -6,6 +13,6 @@ cp dist.package.json dist/package.json cp host.json dist/ mkdir -p "$PACK_TEMP_DIR" pushd dist || exit -zip -r "$PACK_TEMP_DIR/$PACK_OUT.zip" . --exclude "*.map" --exclude "*.ts" +zip -r "$PACK_TEMP_DIR/$FILE_NAME.zip" . --exclude "*.map" --exclude "*.ts" popd || exit -mv "$PACK_TEMP_DIR/$PACK_OUT.zip" . +mv "$PACK_TEMP_DIR/$FILE_NAME.zip" . From f545c1a9bcdd9f23b24a6c7b81e44d3b12523180 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:44:03 -0500 Subject: [PATCH 094/112] Fix temp archive path and file name for CI pipeline Jira ticket: CAMS-461 --- backend/functions/api/package.json | 2 +- backend/functions/migration/package.json | 2 +- backend/pack.sh | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index 2de0ebcd0..e946bd94c 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -8,6 +8,6 @@ "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", - "pack": "export PACK_OUT=api; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" + "pack": "export PACK_OUT=api; ../../pack.sh api" } } diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index 2911ae88d..d46b926f9 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -8,6 +8,6 @@ "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", - "pack": "export PACK_OUT=migration; export PACK_TEMP_DIR=/tmp/build/${pwd}; ../../pack.sh" + "pack": "export PACK_OUT=migration; ../../pack.sh migration" } } diff --git a/backend/pack.sh b/backend/pack.sh index fcad82b2e..334959d78 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -6,6 +6,10 @@ else FILE_NAME=$OUT; fi +PACK_TEMP_DIR="/tmp/build/$1" + +echo "Creating archive $PACK_TEMP_DIR/$FILE_NAME.zip" + mkdir -p dist/node_modules/ cp -r build/* dist/ cp -r ../../node_modules/* dist/node_modules/ @@ -13,6 +17,6 @@ cp dist.package.json dist/package.json cp host.json dist/ mkdir -p "$PACK_TEMP_DIR" pushd dist || exit -zip -r "$PACK_TEMP_DIR/$FILE_NAME.zip" . --exclude "*.map" --exclude "*.ts" +zip -q -r "$PACK_TEMP_DIR/$FILE_NAME.zip" . --exclude "*.map" --exclude "*.ts" popd || exit mv "$PACK_TEMP_DIR/$FILE_NAME.zip" . From 8505c2afc45f9c20ececd261f5f0518e3d0cb211 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:48:56 -0500 Subject: [PATCH 095/112] Fix paths to archive in Github workflow Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index baccd6761..75f52b665 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -117,12 +117,12 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.apiFunctionName }}-build - path: backend/${{ inputs.apiFunctionName }}.zip + path: backend/function/api/${{ inputs.apiFunctionName }}.zip if-no-files-found: error - name: Upload Migration Azure Functions Artifact uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.migrationFunctionName }}-build - path: backend/${{ inputs.migrationFunctionName }}.zip + path: backend/functions/migration/${{ inputs.migrationFunctionName }}.zip if-no-files-found: error From 7264fb4b10ece1673e745b7dc149b73a5efada35 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:53:06 -0500 Subject: [PATCH 096/112] Fix typo in functions archive path Jira ticket: CAMS-461 --- .github/workflows/sub-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index 75f52b665..e4289b6f3 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -117,7 +117,7 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.apiFunctionName }}-build - path: backend/function/api/${{ inputs.apiFunctionName }}.zip + path: backend/functions/api/${{ inputs.apiFunctionName }}.zip if-no-files-found: error - name: Upload Migration Azure Functions Artifact From 2fa3214a755c267171c4ea227ea1e024b6856a2c Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:01:23 -0500 Subject: [PATCH 097/112] Simplify pack.sh env var param for file name Jira ticket: CAMS-461 --- backend/functions/api/package.json | 2 +- backend/functions/migration/package.json | 2 +- backend/pack.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index e946bd94c..a11c5cb70 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -8,6 +8,6 @@ "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", - "pack": "export PACK_OUT=api; ../../pack.sh api" + "pack": "../../pack.sh api" } } diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index d46b926f9..7d6bce5c7 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -8,6 +8,6 @@ "prestart": "npm run build && cp ../../.env ../../local.settings.json .", "start": "func start --typescript --model v4", "build": "tsc --build tsconfig.build.json", - "pack": "export PACK_OUT=migration; ../../pack.sh migration" + "pack": "../../pack.sh migration" } } diff --git a/backend/pack.sh b/backend/pack.sh index 334959d78..fc106f431 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -1,7 +1,7 @@ #! /bin/bash if [[ $OUT == "" ]]; then - FILE_NAME=$PACK_OUT; + FILE_NAME=$1; else FILE_NAME=$OUT; fi From 3da41aee8734885c765fad82ebeae7c2d8879f24 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:49:14 -0500 Subject: [PATCH 098/112] Consolidate build dir back into dist Jira ticket: CAMS-461 Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .gitignore | 3 +-- backend/functions/api/dist.package.json | 9 --------- backend/functions/api/package.json | 6 +++--- backend/functions/api/tsconfig.build.json | 2 +- backend/functions/migration/dist.package.json | 9 --------- backend/functions/migration/package.json | 6 +++--- backend/functions/migration/tsconfig.build.json | 2 +- backend/pack.sh | 12 ++++-------- 8 files changed, 13 insertions(+), 36 deletions(-) delete mode 100644 backend/functions/api/dist.package.json delete mode 100644 backend/functions/migration/dist.package.json diff --git a/.gitignore b/.gitignore index 79426714e..bebb0bbf8 100644 --- a/.gitignore +++ b/.gitignore @@ -75,9 +75,8 @@ cams1.code-workspace # Node **/node_modules/ -# Build and Dist +# Dist **/dist/ -**/build/ # Veracode **/pipeline-scan* diff --git a/backend/functions/api/dist.package.json b/backend/functions/api/dist.package.json deleted file mode 100644 index f7567cb32..000000000 --- a/backend/functions/api/dist.package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "cams-api", - "version": "1.0.0", - "description": "", - "main": "backend/functions/api/*/*.function.js", - "scripts": { - "start": "func start --javascript" - } -} diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index a11c5cb70..d829f969c 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -2,11 +2,11 @@ "name": "cams-api", "version": "1.0.0", "description": "", - "main": "build/backend/functions/api/*/*.function.js", + "main": "dist/backend/functions/api/*/*.function.js", "scripts": { - "clean": "rm -rf build/ dist/ *.zip", + "clean": "rm -rf dist/ node_modules/ *.zip", "prestart": "npm run build && cp ../../.env ../../local.settings.json .", - "start": "func start --typescript --model v4", + "start": "func start --javascript", "build": "tsc --build tsconfig.build.json", "pack": "../../pack.sh api" } diff --git a/backend/functions/api/tsconfig.build.json b/backend/functions/api/tsconfig.build.json index bbaddc8ab..efef3c642 100644 --- a/backend/functions/api/tsconfig.build.json +++ b/backend/functions/api/tsconfig.build.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "build" + "outDir": "dist" }, "extends": "../../tsconfig.json", "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] diff --git a/backend/functions/migration/dist.package.json b/backend/functions/migration/dist.package.json deleted file mode 100644 index 9edc4d695..000000000 --- a/backend/functions/migration/dist.package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "cams-migration", - "version": "1.0.0", - "description": "", - "main": "backend/functions/migration/*/*.js", - "scripts": { - "start": "func start --javascript" - } -} diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index 7d6bce5c7..7ab29411a 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -2,11 +2,11 @@ "name": "cams-migration", "version": "1.0.0", "description": "", - "main": "build/backend/functions/migration/*/*.js", + "main": "dist/backend/functions/migration/loadConsolidations.js", "scripts": { - "clean": "rm -rf build/ dist/ *.zip", + "clean": "rm -rf dist/ node_modules/ *.zip", "prestart": "npm run build && cp ../../.env ../../local.settings.json .", - "start": "func start --typescript --model v4", + "start": "func start --javascript", "build": "tsc --build tsconfig.build.json", "pack": "../../pack.sh migration" } diff --git a/backend/functions/migration/tsconfig.build.json b/backend/functions/migration/tsconfig.build.json index bbaddc8ab..efef3c642 100644 --- a/backend/functions/migration/tsconfig.build.json +++ b/backend/functions/migration/tsconfig.build.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "build" + "outDir": "dist" }, "extends": "../../tsconfig.json", "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*"] diff --git a/backend/pack.sh b/backend/pack.sh index fc106f431..8aa980a34 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -10,13 +10,9 @@ PACK_TEMP_DIR="/tmp/build/$1" echo "Creating archive $PACK_TEMP_DIR/$FILE_NAME.zip" -mkdir -p dist/node_modules/ -cp -r build/* dist/ -cp -r ../../node_modules/* dist/node_modules/ -cp dist.package.json dist/package.json -cp host.json dist/ +mkdir -p dist/ +mkdir -p node_modules/ +cp -r ../../node_modules/* node_modules/ mkdir -p "$PACK_TEMP_DIR" -pushd dist || exit -zip -q -r "$PACK_TEMP_DIR/$FILE_NAME.zip" . --exclude "*.map" --exclude "*.ts" -popd || exit +zip -q -r "$PACK_TEMP_DIR/$FILE_NAME.zip" ./dist ./node_modules ./package.json ./host.json --exclude "*.map" --exclude "*.ts" mv "$PACK_TEMP_DIR/$FILE_NAME.zip" . From f08ad210d7152ad9f659c1bcd306fcc71d05c175 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:09:17 -0600 Subject: [PATCH 099/112] Run clean:all for the backend instead of clean I would actually prefer to not make this change, rather change the clean script in the backend to clean all. But I'd like to hear what others' thoughts are about this. [skip ci] Jira ticket: CAMS-461 --- ops/scripts/utility/clean-all-projects.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ops/scripts/utility/clean-all-projects.sh b/ops/scripts/utility/clean-all-projects.sh index 04247a166..377dfbbc9 100755 --- a/ops/scripts/utility/clean-all-projects.sh +++ b/ops/scripts/utility/clean-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit @@ -15,4 +15,9 @@ for str in "${PROJECTS[@]}"; do popd || exit done +pushd "backend" || exit +echo "Cleaning backend." +npm run clean:all +popd || exit + exit 0 From 080fd0e9c8a85dc43565279bba97652f1cf78e25 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:16:18 -0600 Subject: [PATCH 100/112] Ignore package-lock.json files The api and migration packages exist to manage Azure Functions, not npm packages. For the time being, they should not have their own dependencies and thus should never have 'npm ci' run against them as part of the build process. [skip ci] Jira ticket: CAMS-461 --- backend/functions/api/.gitignore | 2 + backend/functions/migration/.gitignore | 2 + backend/functions/migration/package-lock.json | 105 ------------------ 3 files changed, 4 insertions(+), 105 deletions(-) create mode 100644 backend/functions/api/.gitignore create mode 100644 backend/functions/migration/.gitignore delete mode 100644 backend/functions/migration/package-lock.json diff --git a/backend/functions/api/.gitignore b/backend/functions/api/.gitignore new file mode 100644 index 000000000..ee0da9b3f --- /dev/null +++ b/backend/functions/api/.gitignore @@ -0,0 +1,2 @@ +# Ignore package-lock.json as this project should not have its own dependencies +package-lock.json diff --git a/backend/functions/migration/.gitignore b/backend/functions/migration/.gitignore new file mode 100644 index 000000000..ee0da9b3f --- /dev/null +++ b/backend/functions/migration/.gitignore @@ -0,0 +1,2 @@ +# Ignore package-lock.json as this project should not have its own dependencies +package-lock.json diff --git a/backend/functions/migration/package-lock.json b/backend/functions/migration/package-lock.json deleted file mode 100644 index d43500849..000000000 --- a/backend/functions/migration/package-lock.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "name": "cams-migration", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "cams-migration", - "version": "1.0.0", - "workspaces": [ - "../../" - ], - "dependencies": { - "@azure/functions": "^4.6.0" - } - }, - "../..": { - "name": "node", - "version": "1.0.0", - "dependencies": { - "@azure/cosmos": "^4.2.0", - "@azure/functions": "^4.6.0", - "@azure/identity": "^4.5.0", - "@azure/keyvault-secrets": "^4.9.0", - "@launchdarkly/node-server-sdk": "^9.7.2", - "@okta/jwt-verifier": "^4.0.1", - "@okta/okta-sdk-nodejs": "^7.1.1", - "applicationinsights": "^3.4.0", - "dotenv": "^16.4.7", - "durable-functions": "^3.1.0", - "jsonwebtoken": "^9.0.2", - "mongodb": "^6.11.0", - "mssql": "^10.0.4" - }, - "devDependencies": { - "@faker-js/faker": "^9.3.0", - "@types/jest": "^29.5.14", - "@types/mssql": "^9.1.5", - "@types/node": "^22.10.1", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "azure-function-context-mock": "^0.0.7", - "dependency-cruiser": "^16.7.0", - "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^16.6.2", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-promise": "^6.6.0", - "jest": "^29.7.0", - "prettier": "^3.4.2", - "ts-jest": "^29.2.5", - "typescript": "^5.7.2" - } - }, - "node_modules/@azure/functions": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.0.tgz", - "integrity": "sha512-vGq9jXlgrJ3KaI8bepgfpk26zVY8vFZsQukF85qjjKTAR90eFOOBNaa+mc/0ViDY2lcdrU2fL/o1pQyZUtTDsw==", - "dependencies": { - "cookie": "^0.7.0", - "long": "^4.0.0", - "undici": "^5.13.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "engines": { - "node": ">=14" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/node": { - "resolved": "../..", - "link": true - }, - "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - } - } -} From 9a836434130f21e95785f46e2b72900e82debe2e Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:46:58 -0600 Subject: [PATCH 101/112] Fix lint scripts [skip ci] Jira ticket: CAMS-461 --- backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 0e125877f..6430aa6ec 100644 --- a/backend/package.json +++ b/backend/package.json @@ -62,8 +62,8 @@ "start:migration": "pushd functions/migration && npm run start && popd", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", - "lint": "eslint functions", - "lint:fix": "eslint functions --fix", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "format": "prettier --write './**/*.{js,ts,css,md,json}' --config .prettierrc", "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", From 39e05ac1e13d79823d8a2a7c8eef277ab83ccef4 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:58:23 -0600 Subject: [PATCH 102/112] Remove unused file Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/lib/load-env.ts | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 backend/lib/load-env.ts diff --git a/backend/lib/load-env.ts b/backend/lib/load-env.ts deleted file mode 100644 index 4e6e17fd2..000000000 --- a/backend/lib/load-env.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as dotenv from 'dotenv'; -import * as path from 'path'; - -function loadEnv() { - dotenv.config({ path: path.resolve(__dirname, '../.env') }); -} - -module.exports = { loadEnv }; From 2edede57e5737fd5559239704c136bf8165d553c Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:00:00 -0600 Subject: [PATCH 103/112] Clean up use of clean scripts Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/functions/api/package.json | 4 ++-- backend/functions/migration/package.json | 4 ++-- backend/pack.sh | 1 + ops/scripts/utility/clean-all-projects.sh | 7 +------ ops/scripts/utility/clean-install-all-projects.sh | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/backend/functions/api/package.json b/backend/functions/api/package.json index d829f969c..7e76ee65a 100644 --- a/backend/functions/api/package.json +++ b/backend/functions/api/package.json @@ -4,8 +4,8 @@ "description": "", "main": "dist/backend/functions/api/*/*.function.js", "scripts": { - "clean": "rm -rf dist/ node_modules/ *.zip", - "prestart": "npm run build && cp ../../.env ../../local.settings.json .", + "clean": "rm -rf ./dist ./node_modules *.zip", + "prestart": "npm run build && cp ../../.env .", "start": "func start --javascript", "build": "tsc --build tsconfig.build.json", "pack": "../../pack.sh api" diff --git a/backend/functions/migration/package.json b/backend/functions/migration/package.json index 7ab29411a..d800a2273 100644 --- a/backend/functions/migration/package.json +++ b/backend/functions/migration/package.json @@ -4,8 +4,8 @@ "description": "", "main": "dist/backend/functions/migration/loadConsolidations.js", "scripts": { - "clean": "rm -rf dist/ node_modules/ *.zip", - "prestart": "npm run build && cp ../../.env ../../local.settings.json .", + "clean": "rm -rf ./dist ./node_modules *.zip", + "prestart": "npm run build && cp ../../.env .", "start": "func start --javascript", "build": "tsc --build tsconfig.build.json", "pack": "../../pack.sh migration" diff --git a/backend/pack.sh b/backend/pack.sh index 8aa980a34..5bc240a59 100755 --- a/backend/pack.sh +++ b/backend/pack.sh @@ -16,3 +16,4 @@ cp -r ../../node_modules/* node_modules/ mkdir -p "$PACK_TEMP_DIR" zip -q -r "$PACK_TEMP_DIR/$FILE_NAME.zip" ./dist ./node_modules ./package.json ./host.json --exclude "*.map" --exclude "*.ts" mv "$PACK_TEMP_DIR/$FILE_NAME.zip" . +rm -rf node_modules diff --git a/ops/scripts/utility/clean-all-projects.sh b/ops/scripts/utility/clean-all-projects.sh index 377dfbbc9..4db4d5815 100755 --- a/ops/scripts/utility/clean-all-projects.sh +++ b/ops/scripts/utility/clean-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "backend/functions/api" "backend/functions/migration" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit @@ -15,9 +15,4 @@ for str in "${PROJECTS[@]}"; do popd || exit done -pushd "backend" || exit -echo "Cleaning backend." -npm run clean:all -popd || exit - exit 0 diff --git a/ops/scripts/utility/clean-install-all-projects.sh b/ops/scripts/utility/clean-install-all-projects.sh index 49d4e4b4c..82c878a12 100755 --- a/ops/scripts/utility/clean-install-all-projects.sh +++ b/ops/scripts/utility/clean-install-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend" "backend/functions/api" "backend/functions/migration" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit From 7f5bb804b6b37757dbc9bba6aeae1b0d36d433c0 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:21:11 -0600 Subject: [PATCH 104/112] Remove unused scripts Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 6430aa6ec..50b6cd37f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -55,8 +55,6 @@ "pack": "npm run pack:api", "pack:api": "pushd functions/api && npm run pack && popd", "pack:migration": "pushd functions/migration && npm run pack && popd", - "watch": "tsc --project tsconfig.build.json -w", - "prestart": "npm run build-common && npm run build", "start": "npm run start:api", "start:api": "pushd functions/api && npm run start && popd", "start:migration": "pushd functions/migration && npm run start && popd", From 9a08c59acbfa94d368c600a0672fda80e01375e8 Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:30:27 -0600 Subject: [PATCH 105/112] Rename functions directory to function-apps Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- .github/workflows/sub-build.yml | 4 +-- architecture/export-architecture-diagrams.sh | 4 +-- .../api/.funcignore | 0 .../api/.gitignore | 0 .../api/attorneys/attorneys.function.test.ts | 0 .../api/attorneys/attorneys.function.ts | 0 .../case.assignment.function.test.ts | 0 .../case.assignment.function.ts | 0 .../case-associated.function.test.ts | 0 .../case-associated.function.ts | 0 .../case-docket/case-docket.function.test.ts | 0 .../api/case-docket/case-docket.function.ts | 0 .../case-history.function.test.ts | 0 .../api/case-history/case-history.function.ts | 0 .../case-summary.function.test.ts | 0 .../api/case-summary/case-summary.function.ts | 0 .../api/cases/cases.function.test.ts | 0 .../api/cases/cases.function.ts | 0 .../consolidations.function.test.ts | 0 .../consolidations/consolidations.function.ts | 0 .../api/courts/courts.function.test.ts | 0 .../api/courts/courts.function.ts | 0 .../healthcheck/healthcheck.db.cosmos.test.ts | 0 .../api/healthcheck/healthcheck.db.cosmos.ts | 0 .../api/healthcheck/healthcheck.db.sql.ts | 0 .../api/healthcheck/healthcheck.function.ts | 0 .../api/healthcheck/healthcheck.info.ts | 0 .../api/healthcheck/healthcheck.test.ts | 0 .../api/host.json | 0 .../api/me/me.function.test.ts | 0 .../api/me/me.function.ts | 0 .../api/oauth2/mock-oauth2.function.ts | 0 .../office-staff-sync.function.test.ts | 0 .../office-staff-sync.function.ts | 0 .../api/offices/offices.function.test.ts | 0 .../api/offices/offices.function.ts | 0 .../orders-manual-sync.function.test.ts | 0 .../orders-manual-sync.function.ts | 0 .../orders-suggestions.function.test.ts | 0 .../orders-suggestions.function.ts | 0 .../orders-sync/orders-sync.function.test.ts | 0 .../api/orders-sync/orders-sync.function.ts | 0 .../api/orders/orders.function.test.ts | 0 .../api/orders/orders.function.ts | 0 .../api/package.json | 0 .../api/tsconfig.build.json | 0 .../azure/app-insights.ts | 0 .../azure/application-context-creator.test.ts | 0 .../azure/application-context-creator.ts | 0 .../azure/functions.test.ts | 2 +- .../azure/functions.ts | 0 .../azure/testing-helpers.ts | 0 .../migration/.funcignore | 0 .../migration/.gitignore | 0 .../activity/flattenBoundingArrays.test.ts | 0 .../activity/flattenBoundingArrays.ts | 0 .../activity/getConsolidations.test.ts | 0 .../migration/activity/getConsolidations.ts | 0 .../migration/activity/getPageCount.test.ts | 0 .../migration/activity/getPageCount.ts | 0 .../activity/migrateConsolidation.ts | 0 .../activity/migrateConsolidations.test.ts | 0 .../client/acms-migration-trigger.function.ts | 0 .../migration/host.json | 0 .../migration/loadConsolidations.ts | 0 .../migration/orchestration/orchestrator.ts | 0 .../orchestration/sub-orchestrator-etl.ts | 0 .../orchestration/sub-orchestrator-paging.ts | 0 .../migration/package.json | 0 .../migration/tsconfig.build.json | 0 backend/jest.config.js | 8 ++--- backend/lib/factory.test.ts | 2 +- .../acms-dxtr-divisions/compare-divisions.ts | 4 +-- .../lib/testing/analysis/export-office-csv.ts | 2 +- .../test-acms-migration.ts | 4 +-- .../test-okta-group-api.ts | 2 +- backend/lib/testing/testing-utilities.ts | 2 +- .../orders/orders-local-gateway.test.ts | 2 +- backend/package.json | 20 ++++++------ backend/tsconfig.build.json | 4 ++- common/src/cams/events.test.ts | 2 +- common/src/cams/users.test.ts | 2 +- .../dependency-cruiser/functions/current.svg | 32 +++++++++---------- .../dependency-graph_2023-09-18_1237.svg | 30 ++++++++--------- .../dependency-graph_2023-09-26_1701.svg | 30 ++++++++--------- .../dependency-graph_2023-09-27_1700.svg | 26 +++++++-------- .../dependency-graph_2023-10-04_1610.svg | 26 +++++++-------- .../dependency-graph_api_2023-10-19_1223.svg | 18 +++++------ .../dependency-graph_api_2023-12.svg | 26 +++++++-------- .../slots/az-slot-start-stop-operations.sh | 2 +- ops/scripts/utility/audit.sh | 2 +- ops/scripts/utility/check-outdated.sh | 2 +- ops/scripts/utility/clean-all-projects.sh | 2 +- ops/scripts/utility/run-all-tests.sh | 2 +- ops/scripts/utility/update-dependencies.sh | 2 +- test/e2e/playwright/auth-setup.ts | 2 +- user-interface/src/lib/models/api2.test.ts | 4 +-- user-interface/src/lib/utils/datetime.test.ts | 2 +- 98 files changed, 137 insertions(+), 135 deletions(-) rename backend/{functions => function-apps}/api/.funcignore (100%) rename backend/{functions => function-apps}/api/.gitignore (100%) rename backend/{functions => function-apps}/api/attorneys/attorneys.function.test.ts (100%) rename backend/{functions => function-apps}/api/attorneys/attorneys.function.ts (100%) rename backend/{functions => function-apps}/api/case-assignments/case.assignment.function.test.ts (100%) rename backend/{functions => function-apps}/api/case-assignments/case.assignment.function.ts (100%) rename backend/{functions => function-apps}/api/case-associated/case-associated.function.test.ts (100%) rename backend/{functions => function-apps}/api/case-associated/case-associated.function.ts (100%) rename backend/{functions => function-apps}/api/case-docket/case-docket.function.test.ts (100%) rename backend/{functions => function-apps}/api/case-docket/case-docket.function.ts (100%) rename backend/{functions => function-apps}/api/case-history/case-history.function.test.ts (100%) rename backend/{functions => function-apps}/api/case-history/case-history.function.ts (100%) rename backend/{functions => function-apps}/api/case-summary/case-summary.function.test.ts (100%) rename backend/{functions => function-apps}/api/case-summary/case-summary.function.ts (100%) rename backend/{functions => function-apps}/api/cases/cases.function.test.ts (100%) rename backend/{functions => function-apps}/api/cases/cases.function.ts (100%) rename backend/{functions => function-apps}/api/consolidations/consolidations.function.test.ts (100%) rename backend/{functions => function-apps}/api/consolidations/consolidations.function.ts (100%) rename backend/{functions => function-apps}/api/courts/courts.function.test.ts (100%) rename backend/{functions => function-apps}/api/courts/courts.function.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.db.cosmos.test.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.db.cosmos.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.db.sql.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.function.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.info.ts (100%) rename backend/{functions => function-apps}/api/healthcheck/healthcheck.test.ts (100%) rename backend/{functions => function-apps}/api/host.json (100%) rename backend/{functions => function-apps}/api/me/me.function.test.ts (100%) rename backend/{functions => function-apps}/api/me/me.function.ts (100%) rename backend/{functions => function-apps}/api/oauth2/mock-oauth2.function.ts (100%) rename backend/{functions => function-apps}/api/office-staff-sync/office-staff-sync.function.test.ts (100%) rename backend/{functions => function-apps}/api/office-staff-sync/office-staff-sync.function.ts (100%) rename backend/{functions => function-apps}/api/offices/offices.function.test.ts (100%) rename backend/{functions => function-apps}/api/offices/offices.function.ts (100%) rename backend/{functions => function-apps}/api/orders-manual-sync/orders-manual-sync.function.test.ts (100%) rename backend/{functions => function-apps}/api/orders-manual-sync/orders-manual-sync.function.ts (100%) rename backend/{functions => function-apps}/api/orders-suggestions/orders-suggestions.function.test.ts (100%) rename backend/{functions => function-apps}/api/orders-suggestions/orders-suggestions.function.ts (100%) rename backend/{functions => function-apps}/api/orders-sync/orders-sync.function.test.ts (100%) rename backend/{functions => function-apps}/api/orders-sync/orders-sync.function.ts (100%) rename backend/{functions => function-apps}/api/orders/orders.function.test.ts (100%) rename backend/{functions => function-apps}/api/orders/orders.function.ts (100%) rename backend/{functions => function-apps}/api/package.json (100%) rename backend/{functions => function-apps}/api/tsconfig.build.json (100%) rename backend/{functions => function-apps}/azure/app-insights.ts (100%) rename backend/{functions => function-apps}/azure/application-context-creator.test.ts (100%) rename backend/{functions => function-apps}/azure/application-context-creator.ts (100%) rename backend/{functions => function-apps}/azure/functions.test.ts (97%) rename backend/{functions => function-apps}/azure/functions.ts (100%) rename backend/{functions => function-apps}/azure/testing-helpers.ts (100%) rename backend/{functions => function-apps}/migration/.funcignore (100%) rename backend/{functions => function-apps}/migration/.gitignore (100%) rename backend/{functions => function-apps}/migration/activity/flattenBoundingArrays.test.ts (100%) rename backend/{functions => function-apps}/migration/activity/flattenBoundingArrays.ts (100%) rename backend/{functions => function-apps}/migration/activity/getConsolidations.test.ts (100%) rename backend/{functions => function-apps}/migration/activity/getConsolidations.ts (100%) rename backend/{functions => function-apps}/migration/activity/getPageCount.test.ts (100%) rename backend/{functions => function-apps}/migration/activity/getPageCount.ts (100%) rename backend/{functions => function-apps}/migration/activity/migrateConsolidation.ts (100%) rename backend/{functions => function-apps}/migration/activity/migrateConsolidations.test.ts (100%) rename backend/{functions => function-apps}/migration/client/acms-migration-trigger.function.ts (100%) rename backend/{functions => function-apps}/migration/host.json (100%) rename backend/{functions => function-apps}/migration/loadConsolidations.ts (100%) rename backend/{functions => function-apps}/migration/orchestration/orchestrator.ts (100%) rename backend/{functions => function-apps}/migration/orchestration/sub-orchestrator-etl.ts (100%) rename backend/{functions => function-apps}/migration/orchestration/sub-orchestrator-paging.ts (100%) rename backend/{functions => function-apps}/migration/package.json (100%) rename backend/{functions => function-apps}/migration/tsconfig.build.json (100%) diff --git a/.github/workflows/sub-build.yml b/.github/workflows/sub-build.yml index e4289b6f3..358a1d1b5 100644 --- a/.github/workflows/sub-build.yml +++ b/.github/workflows/sub-build.yml @@ -117,12 +117,12 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.apiFunctionName }}-build - path: backend/functions/api/${{ inputs.apiFunctionName }}.zip + path: backend/function-apps/api/${{ inputs.apiFunctionName }}.zip if-no-files-found: error - name: Upload Migration Azure Functions Artifact uses: actions/upload-artifact@v4.4.0 with: name: ${{ inputs.migrationFunctionName }}-build - path: backend/functions/migration/${{ inputs.migrationFunctionName }}.zip + path: backend/function-apps/migration/${{ inputs.migrationFunctionName }}.zip if-no-files-found: error diff --git a/architecture/export-architecture-diagrams.sh b/architecture/export-architecture-diagrams.sh index 8324da346..0fc80478f 100755 --- a/architecture/export-architecture-diagrams.sh +++ b/architecture/export-architecture-diagrams.sh @@ -41,7 +41,7 @@ mermaid_file="./structurizr-FunctionsAPIwithWebapp.mmd" cat "$mermaid_file" printf "\n\`\`\`\n" } > temp_file.md -mv temp_file.md ../docs/architecture/diagrams/cams-webapp-with-functions-api.md +mv temp_file.md ../docs/architecture/diagrams/cams-webapp-with-function-apps-api.md ## CAMS Webapp Components mermaid_file="./structurizr-CAMSWebapp.mmd" @@ -59,6 +59,6 @@ mermaid_file="./structurizr-FunctionsAPI.mmd" cat "$mermaid_file" printf "\n\`\`\`\n" } > temp_file.md -mv temp_file.md ../docs/architecture/diagrams/cams-functions-api-components.md +mv temp_file.md ../docs/architecture/diagrams/cams-function-apps-api-components.md popd || exit diff --git a/backend/functions/api/.funcignore b/backend/function-apps/api/.funcignore similarity index 100% rename from backend/functions/api/.funcignore rename to backend/function-apps/api/.funcignore diff --git a/backend/functions/api/.gitignore b/backend/function-apps/api/.gitignore similarity index 100% rename from backend/functions/api/.gitignore rename to backend/function-apps/api/.gitignore diff --git a/backend/functions/api/attorneys/attorneys.function.test.ts b/backend/function-apps/api/attorneys/attorneys.function.test.ts similarity index 100% rename from backend/functions/api/attorneys/attorneys.function.test.ts rename to backend/function-apps/api/attorneys/attorneys.function.test.ts diff --git a/backend/functions/api/attorneys/attorneys.function.ts b/backend/function-apps/api/attorneys/attorneys.function.ts similarity index 100% rename from backend/functions/api/attorneys/attorneys.function.ts rename to backend/function-apps/api/attorneys/attorneys.function.ts diff --git a/backend/functions/api/case-assignments/case.assignment.function.test.ts b/backend/function-apps/api/case-assignments/case.assignment.function.test.ts similarity index 100% rename from backend/functions/api/case-assignments/case.assignment.function.test.ts rename to backend/function-apps/api/case-assignments/case.assignment.function.test.ts diff --git a/backend/functions/api/case-assignments/case.assignment.function.ts b/backend/function-apps/api/case-assignments/case.assignment.function.ts similarity index 100% rename from backend/functions/api/case-assignments/case.assignment.function.ts rename to backend/function-apps/api/case-assignments/case.assignment.function.ts diff --git a/backend/functions/api/case-associated/case-associated.function.test.ts b/backend/function-apps/api/case-associated/case-associated.function.test.ts similarity index 100% rename from backend/functions/api/case-associated/case-associated.function.test.ts rename to backend/function-apps/api/case-associated/case-associated.function.test.ts diff --git a/backend/functions/api/case-associated/case-associated.function.ts b/backend/function-apps/api/case-associated/case-associated.function.ts similarity index 100% rename from backend/functions/api/case-associated/case-associated.function.ts rename to backend/function-apps/api/case-associated/case-associated.function.ts diff --git a/backend/functions/api/case-docket/case-docket.function.test.ts b/backend/function-apps/api/case-docket/case-docket.function.test.ts similarity index 100% rename from backend/functions/api/case-docket/case-docket.function.test.ts rename to backend/function-apps/api/case-docket/case-docket.function.test.ts diff --git a/backend/functions/api/case-docket/case-docket.function.ts b/backend/function-apps/api/case-docket/case-docket.function.ts similarity index 100% rename from backend/functions/api/case-docket/case-docket.function.ts rename to backend/function-apps/api/case-docket/case-docket.function.ts diff --git a/backend/functions/api/case-history/case-history.function.test.ts b/backend/function-apps/api/case-history/case-history.function.test.ts similarity index 100% rename from backend/functions/api/case-history/case-history.function.test.ts rename to backend/function-apps/api/case-history/case-history.function.test.ts diff --git a/backend/functions/api/case-history/case-history.function.ts b/backend/function-apps/api/case-history/case-history.function.ts similarity index 100% rename from backend/functions/api/case-history/case-history.function.ts rename to backend/function-apps/api/case-history/case-history.function.ts diff --git a/backend/functions/api/case-summary/case-summary.function.test.ts b/backend/function-apps/api/case-summary/case-summary.function.test.ts similarity index 100% rename from backend/functions/api/case-summary/case-summary.function.test.ts rename to backend/function-apps/api/case-summary/case-summary.function.test.ts diff --git a/backend/functions/api/case-summary/case-summary.function.ts b/backend/function-apps/api/case-summary/case-summary.function.ts similarity index 100% rename from backend/functions/api/case-summary/case-summary.function.ts rename to backend/function-apps/api/case-summary/case-summary.function.ts diff --git a/backend/functions/api/cases/cases.function.test.ts b/backend/function-apps/api/cases/cases.function.test.ts similarity index 100% rename from backend/functions/api/cases/cases.function.test.ts rename to backend/function-apps/api/cases/cases.function.test.ts diff --git a/backend/functions/api/cases/cases.function.ts b/backend/function-apps/api/cases/cases.function.ts similarity index 100% rename from backend/functions/api/cases/cases.function.ts rename to backend/function-apps/api/cases/cases.function.ts diff --git a/backend/functions/api/consolidations/consolidations.function.test.ts b/backend/function-apps/api/consolidations/consolidations.function.test.ts similarity index 100% rename from backend/functions/api/consolidations/consolidations.function.test.ts rename to backend/function-apps/api/consolidations/consolidations.function.test.ts diff --git a/backend/functions/api/consolidations/consolidations.function.ts b/backend/function-apps/api/consolidations/consolidations.function.ts similarity index 100% rename from backend/functions/api/consolidations/consolidations.function.ts rename to backend/function-apps/api/consolidations/consolidations.function.ts diff --git a/backend/functions/api/courts/courts.function.test.ts b/backend/function-apps/api/courts/courts.function.test.ts similarity index 100% rename from backend/functions/api/courts/courts.function.test.ts rename to backend/function-apps/api/courts/courts.function.test.ts diff --git a/backend/functions/api/courts/courts.function.ts b/backend/function-apps/api/courts/courts.function.ts similarity index 100% rename from backend/functions/api/courts/courts.function.ts rename to backend/function-apps/api/courts/courts.function.ts diff --git a/backend/functions/api/healthcheck/healthcheck.db.cosmos.test.ts b/backend/function-apps/api/healthcheck/healthcheck.db.cosmos.test.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.db.cosmos.test.ts rename to backend/function-apps/api/healthcheck/healthcheck.db.cosmos.test.ts diff --git a/backend/functions/api/healthcheck/healthcheck.db.cosmos.ts b/backend/function-apps/api/healthcheck/healthcheck.db.cosmos.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.db.cosmos.ts rename to backend/function-apps/api/healthcheck/healthcheck.db.cosmos.ts diff --git a/backend/functions/api/healthcheck/healthcheck.db.sql.ts b/backend/function-apps/api/healthcheck/healthcheck.db.sql.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.db.sql.ts rename to backend/function-apps/api/healthcheck/healthcheck.db.sql.ts diff --git a/backend/functions/api/healthcheck/healthcheck.function.ts b/backend/function-apps/api/healthcheck/healthcheck.function.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.function.ts rename to backend/function-apps/api/healthcheck/healthcheck.function.ts diff --git a/backend/functions/api/healthcheck/healthcheck.info.ts b/backend/function-apps/api/healthcheck/healthcheck.info.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.info.ts rename to backend/function-apps/api/healthcheck/healthcheck.info.ts diff --git a/backend/functions/api/healthcheck/healthcheck.test.ts b/backend/function-apps/api/healthcheck/healthcheck.test.ts similarity index 100% rename from backend/functions/api/healthcheck/healthcheck.test.ts rename to backend/function-apps/api/healthcheck/healthcheck.test.ts diff --git a/backend/functions/api/host.json b/backend/function-apps/api/host.json similarity index 100% rename from backend/functions/api/host.json rename to backend/function-apps/api/host.json diff --git a/backend/functions/api/me/me.function.test.ts b/backend/function-apps/api/me/me.function.test.ts similarity index 100% rename from backend/functions/api/me/me.function.test.ts rename to backend/function-apps/api/me/me.function.test.ts diff --git a/backend/functions/api/me/me.function.ts b/backend/function-apps/api/me/me.function.ts similarity index 100% rename from backend/functions/api/me/me.function.ts rename to backend/function-apps/api/me/me.function.ts diff --git a/backend/functions/api/oauth2/mock-oauth2.function.ts b/backend/function-apps/api/oauth2/mock-oauth2.function.ts similarity index 100% rename from backend/functions/api/oauth2/mock-oauth2.function.ts rename to backend/function-apps/api/oauth2/mock-oauth2.function.ts diff --git a/backend/functions/api/office-staff-sync/office-staff-sync.function.test.ts b/backend/function-apps/api/office-staff-sync/office-staff-sync.function.test.ts similarity index 100% rename from backend/functions/api/office-staff-sync/office-staff-sync.function.test.ts rename to backend/function-apps/api/office-staff-sync/office-staff-sync.function.test.ts diff --git a/backend/functions/api/office-staff-sync/office-staff-sync.function.ts b/backend/function-apps/api/office-staff-sync/office-staff-sync.function.ts similarity index 100% rename from backend/functions/api/office-staff-sync/office-staff-sync.function.ts rename to backend/function-apps/api/office-staff-sync/office-staff-sync.function.ts diff --git a/backend/functions/api/offices/offices.function.test.ts b/backend/function-apps/api/offices/offices.function.test.ts similarity index 100% rename from backend/functions/api/offices/offices.function.test.ts rename to backend/function-apps/api/offices/offices.function.test.ts diff --git a/backend/functions/api/offices/offices.function.ts b/backend/function-apps/api/offices/offices.function.ts similarity index 100% rename from backend/functions/api/offices/offices.function.ts rename to backend/function-apps/api/offices/offices.function.ts diff --git a/backend/functions/api/orders-manual-sync/orders-manual-sync.function.test.ts b/backend/function-apps/api/orders-manual-sync/orders-manual-sync.function.test.ts similarity index 100% rename from backend/functions/api/orders-manual-sync/orders-manual-sync.function.test.ts rename to backend/function-apps/api/orders-manual-sync/orders-manual-sync.function.test.ts diff --git a/backend/functions/api/orders-manual-sync/orders-manual-sync.function.ts b/backend/function-apps/api/orders-manual-sync/orders-manual-sync.function.ts similarity index 100% rename from backend/functions/api/orders-manual-sync/orders-manual-sync.function.ts rename to backend/function-apps/api/orders-manual-sync/orders-manual-sync.function.ts diff --git a/backend/functions/api/orders-suggestions/orders-suggestions.function.test.ts b/backend/function-apps/api/orders-suggestions/orders-suggestions.function.test.ts similarity index 100% rename from backend/functions/api/orders-suggestions/orders-suggestions.function.test.ts rename to backend/function-apps/api/orders-suggestions/orders-suggestions.function.test.ts diff --git a/backend/functions/api/orders-suggestions/orders-suggestions.function.ts b/backend/function-apps/api/orders-suggestions/orders-suggestions.function.ts similarity index 100% rename from backend/functions/api/orders-suggestions/orders-suggestions.function.ts rename to backend/function-apps/api/orders-suggestions/orders-suggestions.function.ts diff --git a/backend/functions/api/orders-sync/orders-sync.function.test.ts b/backend/function-apps/api/orders-sync/orders-sync.function.test.ts similarity index 100% rename from backend/functions/api/orders-sync/orders-sync.function.test.ts rename to backend/function-apps/api/orders-sync/orders-sync.function.test.ts diff --git a/backend/functions/api/orders-sync/orders-sync.function.ts b/backend/function-apps/api/orders-sync/orders-sync.function.ts similarity index 100% rename from backend/functions/api/orders-sync/orders-sync.function.ts rename to backend/function-apps/api/orders-sync/orders-sync.function.ts diff --git a/backend/functions/api/orders/orders.function.test.ts b/backend/function-apps/api/orders/orders.function.test.ts similarity index 100% rename from backend/functions/api/orders/orders.function.test.ts rename to backend/function-apps/api/orders/orders.function.test.ts diff --git a/backend/functions/api/orders/orders.function.ts b/backend/function-apps/api/orders/orders.function.ts similarity index 100% rename from backend/functions/api/orders/orders.function.ts rename to backend/function-apps/api/orders/orders.function.ts diff --git a/backend/functions/api/package.json b/backend/function-apps/api/package.json similarity index 100% rename from backend/functions/api/package.json rename to backend/function-apps/api/package.json diff --git a/backend/functions/api/tsconfig.build.json b/backend/function-apps/api/tsconfig.build.json similarity index 100% rename from backend/functions/api/tsconfig.build.json rename to backend/function-apps/api/tsconfig.build.json diff --git a/backend/functions/azure/app-insights.ts b/backend/function-apps/azure/app-insights.ts similarity index 100% rename from backend/functions/azure/app-insights.ts rename to backend/function-apps/azure/app-insights.ts diff --git a/backend/functions/azure/application-context-creator.test.ts b/backend/function-apps/azure/application-context-creator.test.ts similarity index 100% rename from backend/functions/azure/application-context-creator.test.ts rename to backend/function-apps/azure/application-context-creator.test.ts diff --git a/backend/functions/azure/application-context-creator.ts b/backend/function-apps/azure/application-context-creator.ts similarity index 100% rename from backend/functions/azure/application-context-creator.ts rename to backend/function-apps/azure/application-context-creator.ts diff --git a/backend/functions/azure/functions.test.ts b/backend/function-apps/azure/functions.test.ts similarity index 97% rename from backend/functions/azure/functions.test.ts rename to backend/function-apps/azure/functions.test.ts index c8c2a1e16..ee9a2c9f7 100644 --- a/backend/functions/azure/functions.test.ts +++ b/backend/function-apps/azure/functions.test.ts @@ -3,7 +3,7 @@ import { HttpRequest, HttpResponseInit } from '@azure/functions'; import { CamsHttpRequest } from '../../lib/adapters/types/http'; import { CamsHttpResponseInit } from '../../lib/adapters/utils/http-response'; -describe('functions test', () => { +describe('function-apps test', () => { test('should return properly formatted CamsHttpRequest from malformed headers and query', async () => { const request = { method: 'GET', diff --git a/backend/functions/azure/functions.ts b/backend/function-apps/azure/functions.ts similarity index 100% rename from backend/functions/azure/functions.ts rename to backend/function-apps/azure/functions.ts diff --git a/backend/functions/azure/testing-helpers.ts b/backend/function-apps/azure/testing-helpers.ts similarity index 100% rename from backend/functions/azure/testing-helpers.ts rename to backend/function-apps/azure/testing-helpers.ts diff --git a/backend/functions/migration/.funcignore b/backend/function-apps/migration/.funcignore similarity index 100% rename from backend/functions/migration/.funcignore rename to backend/function-apps/migration/.funcignore diff --git a/backend/functions/migration/.gitignore b/backend/function-apps/migration/.gitignore similarity index 100% rename from backend/functions/migration/.gitignore rename to backend/function-apps/migration/.gitignore diff --git a/backend/functions/migration/activity/flattenBoundingArrays.test.ts b/backend/function-apps/migration/activity/flattenBoundingArrays.test.ts similarity index 100% rename from backend/functions/migration/activity/flattenBoundingArrays.test.ts rename to backend/function-apps/migration/activity/flattenBoundingArrays.test.ts diff --git a/backend/functions/migration/activity/flattenBoundingArrays.ts b/backend/function-apps/migration/activity/flattenBoundingArrays.ts similarity index 100% rename from backend/functions/migration/activity/flattenBoundingArrays.ts rename to backend/function-apps/migration/activity/flattenBoundingArrays.ts diff --git a/backend/functions/migration/activity/getConsolidations.test.ts b/backend/function-apps/migration/activity/getConsolidations.test.ts similarity index 100% rename from backend/functions/migration/activity/getConsolidations.test.ts rename to backend/function-apps/migration/activity/getConsolidations.test.ts diff --git a/backend/functions/migration/activity/getConsolidations.ts b/backend/function-apps/migration/activity/getConsolidations.ts similarity index 100% rename from backend/functions/migration/activity/getConsolidations.ts rename to backend/function-apps/migration/activity/getConsolidations.ts diff --git a/backend/functions/migration/activity/getPageCount.test.ts b/backend/function-apps/migration/activity/getPageCount.test.ts similarity index 100% rename from backend/functions/migration/activity/getPageCount.test.ts rename to backend/function-apps/migration/activity/getPageCount.test.ts diff --git a/backend/functions/migration/activity/getPageCount.ts b/backend/function-apps/migration/activity/getPageCount.ts similarity index 100% rename from backend/functions/migration/activity/getPageCount.ts rename to backend/function-apps/migration/activity/getPageCount.ts diff --git a/backend/functions/migration/activity/migrateConsolidation.ts b/backend/function-apps/migration/activity/migrateConsolidation.ts similarity index 100% rename from backend/functions/migration/activity/migrateConsolidation.ts rename to backend/function-apps/migration/activity/migrateConsolidation.ts diff --git a/backend/functions/migration/activity/migrateConsolidations.test.ts b/backend/function-apps/migration/activity/migrateConsolidations.test.ts similarity index 100% rename from backend/functions/migration/activity/migrateConsolidations.test.ts rename to backend/function-apps/migration/activity/migrateConsolidations.test.ts diff --git a/backend/functions/migration/client/acms-migration-trigger.function.ts b/backend/function-apps/migration/client/acms-migration-trigger.function.ts similarity index 100% rename from backend/functions/migration/client/acms-migration-trigger.function.ts rename to backend/function-apps/migration/client/acms-migration-trigger.function.ts diff --git a/backend/functions/migration/host.json b/backend/function-apps/migration/host.json similarity index 100% rename from backend/functions/migration/host.json rename to backend/function-apps/migration/host.json diff --git a/backend/functions/migration/loadConsolidations.ts b/backend/function-apps/migration/loadConsolidations.ts similarity index 100% rename from backend/functions/migration/loadConsolidations.ts rename to backend/function-apps/migration/loadConsolidations.ts diff --git a/backend/functions/migration/orchestration/orchestrator.ts b/backend/function-apps/migration/orchestration/orchestrator.ts similarity index 100% rename from backend/functions/migration/orchestration/orchestrator.ts rename to backend/function-apps/migration/orchestration/orchestrator.ts diff --git a/backend/functions/migration/orchestration/sub-orchestrator-etl.ts b/backend/function-apps/migration/orchestration/sub-orchestrator-etl.ts similarity index 100% rename from backend/functions/migration/orchestration/sub-orchestrator-etl.ts rename to backend/function-apps/migration/orchestration/sub-orchestrator-etl.ts diff --git a/backend/functions/migration/orchestration/sub-orchestrator-paging.ts b/backend/function-apps/migration/orchestration/sub-orchestrator-paging.ts similarity index 100% rename from backend/functions/migration/orchestration/sub-orchestrator-paging.ts rename to backend/function-apps/migration/orchestration/sub-orchestrator-paging.ts diff --git a/backend/functions/migration/package.json b/backend/function-apps/migration/package.json similarity index 100% rename from backend/functions/migration/package.json rename to backend/function-apps/migration/package.json diff --git a/backend/functions/migration/tsconfig.build.json b/backend/function-apps/migration/tsconfig.build.json similarity index 100% rename from backend/functions/migration/tsconfig.build.json rename to backend/function-apps/migration/tsconfig.build.json diff --git a/backend/jest.config.js b/backend/jest.config.js index 0d00470a7..f2ce5d400 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -16,7 +16,7 @@ module.exports = { '.*test.[jt]s', '.*mock.*.ts', '.*.d.ts', - 'functions/azure/app-insights.ts', + 'function-apps/azure/app-insights.ts', 'dist/', 'coverage/', 'lib/adapters/gateways/cases.local.gateway.ts', @@ -28,9 +28,9 @@ module.exports = { 'lib/testing/testing-utilities.ts', 'jest.*config.js', 'lib/adapters/gateways/okta/HumbleVerifier.ts', - 'functions/migration/client/', - 'functions/migration/orchestration/', - 'functions/migration/loadConsolidations.ts', + 'function-apps/migration/client/', + 'function-apps/migration/orchestration/', + 'function-apps/migration/loadConsolidations.ts', ], testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)', '!**/?(*.)+(integration).(spec|test).[jt]s?(x)'], }; diff --git a/backend/lib/factory.test.ts b/backend/lib/factory.test.ts index 265166247..b9c53e2d1 100644 --- a/backend/lib/factory.test.ts +++ b/backend/lib/factory.test.ts @@ -1,7 +1,7 @@ import { ApplicationContext } from './adapters/types/basic'; import { createMockApplicationContext } from './testing/testing-utilities'; -describe('Factory functions', () => { +describe('Factory function-apps', () => { let dbContext: ApplicationContext; let mockDbContext: ApplicationContext; let factory; diff --git a/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts b/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts index f0a11edf8..cb14e312f 100644 --- a/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts +++ b/backend/lib/testing/analysis/acms-dxtr-divisions/compare-divisions.ts @@ -1,5 +1,5 @@ import { InvocationContext } from '@azure/functions'; -import applicationContextCreator from '../../../../functions/azure/application-context-creator'; +import applicationContextCreator from '../../../../function-apps/azure/application-context-creator'; import { LoggerImpl } from '../../../adapters/services/logger.service'; import OfficesDxtrGateway from '../../../adapters/gateways/dxtr/offices.dxtr.gateway'; import { UstpOfficeDetails } from '../../../../../common/src/cams/offices'; @@ -433,7 +433,7 @@ async function main() { ); // Write the results to the temp directory. - // See: backend/functions/temp/ + // See: backend/function-apps/temp/ await outputResults(output); } diff --git a/backend/lib/testing/analysis/export-office-csv.ts b/backend/lib/testing/analysis/export-office-csv.ts index 99795faba..b89ca92b5 100644 --- a/backend/lib/testing/analysis/export-office-csv.ts +++ b/backend/lib/testing/analysis/export-office-csv.ts @@ -1,5 +1,5 @@ import { InvocationContext } from '@azure/functions'; -import applicationContextCreator from '../../../functions/azure/application-context-creator'; +import applicationContextCreator from '../../../function-apps/azure/application-context-creator'; import { LoggerImpl } from '../../adapters/services/logger.service'; import OfficesDxtrGateway from '../../adapters/gateways/dxtr/offices.dxtr.gateway'; import { UstpOfficeDetails } from '../../../../common/src/cams/offices'; diff --git a/backend/lib/testing/isolated-integration/test-acms-migration.ts b/backend/lib/testing/isolated-integration/test-acms-migration.ts index c7deb9932..6899421e9 100644 --- a/backend/lib/testing/isolated-integration/test-acms-migration.ts +++ b/backend/lib/testing/isolated-integration/test-acms-migration.ts @@ -1,5 +1,5 @@ -import migrateConsolidation from '../../../functions/migration/activity/migrateConsolidation'; -import { createMockAzureFunctionContext } from '../../../functions/azure/testing-helpers'; +import migrateConsolidation from '../../../function-apps/migration/activity/migrateConsolidation'; +import { createMockAzureFunctionContext } from '../../../function-apps/azure/testing-helpers'; import * as dotenv from 'dotenv'; dotenv.config(); diff --git a/backend/lib/testing/isolated-integration/test-okta-group-api.ts b/backend/lib/testing/isolated-integration/test-okta-group-api.ts index d7587d88a..2b4edab63 100644 --- a/backend/lib/testing/isolated-integration/test-okta-group-api.ts +++ b/backend/lib/testing/isolated-integration/test-okta-group-api.ts @@ -1,6 +1,6 @@ import { InvocationContext } from '@azure/functions'; import { LoggerImpl } from '../../adapters/services/logger.service'; -import applicationContextCreator from '../../../functions/azure/application-context-creator'; +import applicationContextCreator from '../../../function-apps/azure/application-context-creator'; import { UserGroupGatewayConfig } from '../../adapters/types/authorization'; import { getUserGroupGatewayConfig } from '../../configs/user-groups-gateway-configuration'; import OktaUserGroupGateway from '../../adapters/gateways/okta/okta-user-group-gateway'; diff --git a/backend/lib/testing/testing-utilities.ts b/backend/lib/testing/testing-utilities.ts index 338e604b2..9a59a840c 100644 --- a/backend/lib/testing/testing-utilities.ts +++ b/backend/lib/testing/testing-utilities.ts @@ -3,7 +3,7 @@ import { HttpRequest, InvocationContext } from '@azure/functions'; import { MockData } from '../../../common/src/cams/test-utilities/mock-data'; import { CamsSession } from '../../../common/src/cams/session'; import { CamsHttpMethod, CamsHttpRequest } from '../adapters/types/http'; -import ContextCreator from '../../functions/azure/application-context-creator'; +import ContextCreator from '../../function-apps/azure/application-context-creator'; import { LoggerImpl } from '../adapters/services/logger.service'; const invocationContext = new InvocationContext(); diff --git a/backend/lib/use-cases/orders/orders-local-gateway.test.ts b/backend/lib/use-cases/orders/orders-local-gateway.test.ts index 9e67bd285..c24fb1cc1 100644 --- a/backend/lib/use-cases/orders/orders-local-gateway.test.ts +++ b/backend/lib/use-cases/orders/orders-local-gateway.test.ts @@ -114,7 +114,7 @@ describe('orders use case tests', () => { }); test('should not create a second lead case for an existing consolidation', async () => { - // Spy/mock the factory functions so we can return a LOCAL database of our choosing for the test. + // Spy/mock the factory function-apps so we can return a LOCAL database of our choosing for the test. // We need a generic LOCAL gateway implementation that we return via the mocked factory function. const localCasesRepo = new LocalCasesRepository(); const localConsolidationsRepo = new LocalConsolidationOrdersRepository(); diff --git a/backend/package.json b/backend/package.json index 50b6cd37f..5247ec1af 100644 --- a/backend/package.json +++ b/backend/package.json @@ -44,20 +44,20 @@ "all": "npm run clean:all && npm ci && npm run build:all && npm run pack:all", "clean:all": "npm run clean && npm run clean:api && npm run clean:migration", "clean": "rm -rf ./dist && rm -rf ./node_modules && rm -rf ./coverage", - "clean:api": "pushd functions/api && npm run clean && popd", - "clean:migration": "pushd functions/migration && npm run clean && popd", + "clean:api": "pushd function-apps/api && npm run clean && popd", + "clean:migration": "pushd function-apps/migration && npm run clean && popd", "build:all": "npm run build-common && npm run build && npm run build:api && npm run build:migration", "build": "tsc --build tsconfig.build.json", "build-common": "pushd ../common && npm ci && npm run build && popd", - "build:api": "pushd functions/api && npm run build && popd", - "build:migration": "pushd functions/migration && npm run build && popd", + "build:api": "pushd function-apps/api && npm run build && popd", + "build:migration": "pushd function-apps/migration && npm run build && popd", "pack:all": "npm run pack:api && npm run pack:migration", "pack": "npm run pack:api", - "pack:api": "pushd functions/api && npm run pack && popd", - "pack:migration": "pushd functions/migration && npm run pack && popd", + "pack:api": "pushd function-apps/api && npm run pack && popd", + "pack:migration": "pushd function-apps/migration && npm run pack && popd", "start": "npm run start:api", - "start:api": "pushd functions/api && npm run start && popd", - "start:migration": "pushd functions/migration && npm run start && popd", + "start:api": "pushd function-apps/api && npm run start && popd", + "start:migration": "pushd function-apps/migration && npm run start && popd", "test": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js", "test:open-handles": "CAMS_LOGIN_PROVIDER='mock' DATABASE_MOCK='true' MONGO_CONNECTION_STRING='mongodb://test-string' jest -c jest.config.js --detectOpenHandles", "lint": "eslint .", @@ -66,8 +66,8 @@ "coverage": "npm test -- --coverage", "use-bash": "npm config set script-shell=/bin/bash", "coverage:ci": "npm run use-bash && npm run build-common && npm test -- --coverage", - "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", - "dependency-cruiser:ci": "npx depcruise --output-type err-long functions/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", + "dependency-cruiser-graphical": "current_time=$(date +'%Y-%m-%d_%H%M') && npx depcruise --output-type dot --do-not-follow '^node_modules($|/)' function-apps/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib | dot -T svg > ../../docs/architecture/dependency-cruiser/functions/dependency-graph_api_${current_time}.svg", + "dependency-cruiser:ci": "npx depcruise --output-type err-long function-apps/api/attorneys case-assignments case-docket case-history case-summary cases consolidations healthcheck offices orders orders-manual-sync orders-sync ../lib ", "itest:okta-group-api": "CAMS_LOGIN_PROVIDER=okta npx ts-node lib/testing/isolated-integration/test-okta-group-api.ts", "itest:export-office-csv": "CAMS_LOGIN_PROVIDER=okta npx ts-node ../lib/testing/isolated-integration/export-office-csv.ts" } diff --git a/backend/tsconfig.build.json b/backend/tsconfig.build.json index 5cee1ca91..43ffdae92 100644 --- a/backend/tsconfig.build.json +++ b/backend/tsconfig.build.json @@ -3,5 +3,7 @@ "outDir": "dist" }, "extends": "./tsconfig.json", - "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*", "functions"] + "exclude": ["**/*.test.ts", "**/testing*", "**/fake*", "**/testing/*", + "function-apps" + ] } diff --git a/common/src/cams/events.test.ts b/common/src/cams/events.test.ts index 1b90ea819..2a813dfc7 100644 --- a/common/src/cams/events.test.ts +++ b/common/src/cams/events.test.ts @@ -26,7 +26,7 @@ const substantiveConsolidationChildCase: Consolidation[] = [ }), ]; -describe('Event domain helper functions', () => { +describe('Event domain helper function-apps', () => { describe('isJointAdministrationLeadCase', () => { test('should return true', () => { expect(isJointAdministrationLeadCase(jointAdministrationLeadCase)).toBeTruthy(); diff --git a/common/src/cams/users.test.ts b/common/src/cams/users.test.ts index a2f60f4c2..a739d3046 100644 --- a/common/src/cams/users.test.ts +++ b/common/src/cams/users.test.ts @@ -2,7 +2,7 @@ import MockData from './test-utilities/mock-data'; import { REGION_02_GROUP_NY, REGION_02_GROUP_SE } from './test-utilities/mock-user'; import { getCourtDivisionCodes, getGroupDesignators } from './users'; -describe('users helper functions tests', () => { +describe('users helper function-apps tests', () => { describe('getCourtDivisionCodes tests', () => { test('should get division codes from a user with offices', () => { const user = MockData.getCamsUser({ diff --git a/docs/architecture/dependency-cruiser/functions/current.svg b/docs/architecture/dependency-cruiser/functions/current.svg index 1fadda8d1..4e773ff0c 100644 --- a/docs/architecture/dependency-cruiser/functions/current.svg +++ b/docs/architecture/dependency-cruiser/functions/current.svg @@ -728,7 +728,7 @@ - + node_modules/@azure/functions @@ -740,7 +740,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -782,7 +782,7 @@ - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -1061,7 +1061,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -1085,7 +1085,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1232,7 +1232,7 @@ - + case-docket/case-docket.function.ts->node_modules/@azure/functions @@ -1475,7 +1475,7 @@ - + case-history/case-history.function.ts->node_modules/@azure/functions @@ -1679,7 +1679,7 @@ - + case-summary/case-summary.function.ts->node_modules/@azure/functions @@ -1757,7 +1757,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -1943,7 +1943,7 @@ - + consolidations/consolidations.function.ts->node_modules/@azure/functions @@ -2627,7 +2627,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -5138,7 +5138,7 @@ - + lib/adapters/services/logger.service.ts->node_modules/@azure/functions @@ -6686,7 +6686,7 @@ - + offices/offices.function.ts->node_modules/@azure/functions @@ -6770,7 +6770,7 @@ - + orders-manual-sync/orders-manual-sync.function.ts->node_modules/@azure/functions @@ -6869,7 +6869,7 @@ - + orders-sync/orders-sync.function.ts->node_modules/@azure/functions @@ -6965,7 +6965,7 @@ - + orders/orders.function.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-18_1237.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-18_1237.svg index ad578035e..c97f676b0 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-18_1237.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-18_1237.svg @@ -211,7 +211,7 @@ - + node_modules/@azure/functions @@ -223,7 +223,7 @@ - + lib/adapters/controllers/attorneys.controller.ts->node_modules/@azure/functions @@ -280,7 +280,7 @@ - + lib/adapters/utils/http.ts->node_modules/@azure/functions @@ -331,7 +331,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -383,7 +383,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -500,7 +500,7 @@ - + lib/adapters/controllers/case.assignment.controller.ts->node_modules/@azure/functions @@ -605,7 +605,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -677,7 +677,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -743,7 +743,7 @@ - + lib/adapters/controllers/cases.controller.ts->node_modules/@azure/functions @@ -836,7 +836,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1121,7 +1121,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -1382,7 +1382,7 @@ - + lib/adapters/controllers/users.controller.ts->node_modules/@azure/functions @@ -2558,7 +2558,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2759,7 +2759,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions @@ -3264,7 +3264,7 @@ - + users/users.function.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-26_1701.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-26_1701.svg index ad578035e..c97f676b0 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-26_1701.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-26_1701.svg @@ -211,7 +211,7 @@ - + node_modules/@azure/functions @@ -223,7 +223,7 @@ - + lib/adapters/controllers/attorneys.controller.ts->node_modules/@azure/functions @@ -280,7 +280,7 @@ - + lib/adapters/utils/http.ts->node_modules/@azure/functions @@ -331,7 +331,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -383,7 +383,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -500,7 +500,7 @@ - + lib/adapters/controllers/case.assignment.controller.ts->node_modules/@azure/functions @@ -605,7 +605,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -677,7 +677,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -743,7 +743,7 @@ - + lib/adapters/controllers/cases.controller.ts->node_modules/@azure/functions @@ -836,7 +836,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1121,7 +1121,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -1382,7 +1382,7 @@ - + lib/adapters/controllers/users.controller.ts->node_modules/@azure/functions @@ -2558,7 +2558,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2759,7 +2759,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions @@ -3264,7 +3264,7 @@ - + users/users.function.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-27_1700.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-27_1700.svg index 52fc8ace5..7ef051dd0 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-27_1700.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-09-27_1700.svg @@ -206,7 +206,7 @@ - + node_modules/@azure/functions @@ -218,7 +218,7 @@ - + lib/adapters/controllers/attorneys.controller.ts->node_modules/@azure/functions @@ -275,7 +275,7 @@ - + lib/adapters/utils/http.ts->node_modules/@azure/functions @@ -326,7 +326,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -378,7 +378,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -495,7 +495,7 @@ - + lib/adapters/controllers/case.assignment.controller.ts->node_modules/@azure/functions @@ -600,7 +600,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -672,7 +672,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -738,7 +738,7 @@ - + lib/adapters/controllers/cases.controller.ts->node_modules/@azure/functions @@ -831,7 +831,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1071,7 +1071,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -2013,7 +2013,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2079,7 +2079,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-10-04_1610.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-10-04_1610.svg index 518d6a137..3cbf86608 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-10-04_1610.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_2023-10-04_1610.svg @@ -206,7 +206,7 @@ - + node_modules/@azure/functions @@ -218,7 +218,7 @@ - + lib/adapters/controllers/attorneys.controller.ts->node_modules/@azure/functions @@ -275,7 +275,7 @@ - + lib/adapters/utils/http.ts->node_modules/@azure/functions @@ -326,7 +326,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -378,7 +378,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -495,7 +495,7 @@ - + lib/adapters/controllers/case.assignment.controller.ts->node_modules/@azure/functions @@ -600,7 +600,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -666,7 +666,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -732,7 +732,7 @@ - + lib/adapters/controllers/cases.controller.ts->node_modules/@azure/functions @@ -849,7 +849,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1106,7 +1106,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -2166,7 +2166,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2232,7 +2232,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-10-19_1223.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-10-19_1223.svg index 56fb60d10..20431c044 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-10-19_1223.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-10-19_1223.svg @@ -398,7 +398,7 @@ - + node_modules/@azure/functions @@ -410,7 +410,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -470,7 +470,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -731,7 +731,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -749,7 +749,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -863,7 +863,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -1289,7 +1289,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -2501,7 +2501,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2567,7 +2567,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions diff --git a/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-12.svg b/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-12.svg index 518d6a137..3cbf86608 100644 --- a/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-12.svg +++ b/docs/architecture/dependency-cruiser/functions/dependency-graph_api_2023-12.svg @@ -206,7 +206,7 @@ - + node_modules/@azure/functions @@ -218,7 +218,7 @@ - + lib/adapters/controllers/attorneys.controller.ts->node_modules/@azure/functions @@ -275,7 +275,7 @@ - + lib/adapters/utils/http.ts->node_modules/@azure/functions @@ -326,7 +326,7 @@ - + attorneys/attorneys.function.ts->node_modules/@azure/functions @@ -378,7 +378,7 @@ no-circular - + lib/adapters/utils/application-context-creator.ts->node_modules/@azure/functions @@ -495,7 +495,7 @@ - + lib/adapters/controllers/case.assignment.controller.ts->node_modules/@azure/functions @@ -600,7 +600,7 @@ - + case-assignments/case.assignment.function.ts->node_modules/@azure/functions @@ -666,7 +666,7 @@ - + cases/cases.function.ts->node_modules/@azure/functions @@ -732,7 +732,7 @@ - + lib/adapters/controllers/cases.controller.ts->node_modules/@azure/functions @@ -849,7 +849,7 @@ - + lib/adapters/types/basic.d.ts->node_modules/@azure/functions @@ -1106,7 +1106,7 @@ - + healthcheck/healthcheck.function.ts->node_modules/@azure/functions @@ -2166,7 +2166,7 @@ - + lib/adapters/gateways/mock-cases.gateway.ts->node_modules/@azure/functions @@ -2232,7 +2232,7 @@ - + lib/adapters/services/logger.service.test.ts->node_modules/@azure/functions diff --git a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh index 560c94bf0..aa3cc5012 100755 --- a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh +++ b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Description: Helper script to start and stop slots so we do not run sync functions against slot resources +# Description: Helper script to start and stop slots so we do not run sync function-apps against slot resources # Prerequisite: # - curl # - Azure CLI diff --git a/ops/scripts/utility/audit.sh b/ops/scripts/utility/audit.sh index 9095b53e5..b5dcb8a4d 100755 --- a/ops/scripts/utility/audit.sh +++ b/ops/scripts/utility/audit.sh @@ -59,7 +59,7 @@ trap 'rm -f "$TEMP_FILE"' EXIT cat ./ops/scripts/utility/audit-comment.md >> "$TEMP_FILE" RESULTS=0 -PROJECTS=("backend/functions" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for dir in "${PROJECTS[@]}"; do pushd "${dir}" || exit npm ci diff --git a/ops/scripts/utility/check-outdated.sh b/ops/scripts/utility/check-outdated.sh index 673ca2649..5265900ab 100755 --- a/ops/scripts/utility/check-outdated.sh +++ b/ops/scripts/utility/check-outdated.sh @@ -59,7 +59,7 @@ trap 'rm -f "$TEMP_FILE"' EXIT cat ./ops/scripts/utility/outdated-comment.md >> "$TEMP_FILE" OUTDATED=false -PROJECTS=("backend/functions" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for dir in "${PROJECTS[@]}"; do pushd "${dir}" || exit npm ci diff --git a/ops/scripts/utility/clean-all-projects.sh b/ops/scripts/utility/clean-all-projects.sh index 4db4d5815..efe23c201 100755 --- a/ops/scripts/utility/clean-all-projects.sh +++ b/ops/scripts/utility/clean-all-projects.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/clean-all-projects.sh -PROJECTS=("backend" "backend/functions/api" "backend/functions/migration" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "backend/function-apps/api" "backend/function-apps/migration" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit diff --git a/ops/scripts/utility/run-all-tests.sh b/ops/scripts/utility/run-all-tests.sh index 88781d9d2..a3147df43 100755 --- a/ops/scripts/utility/run-all-tests.sh +++ b/ops/scripts/utility/run-all-tests.sh @@ -6,7 +6,7 @@ # From the root directory, run the following command: # ./ops/scripts/utility/run-all-tests.sh -PROJECTS=("backend/functions" "common" "user-interface") +PROJECTS=("backend" "common" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit diff --git a/ops/scripts/utility/update-dependencies.sh b/ops/scripts/utility/update-dependencies.sh index a14721fa6..95710f63b 100755 --- a/ops/scripts/utility/update-dependencies.sh +++ b/ops/scripts/utility/update-dependencies.sh @@ -72,7 +72,7 @@ else fi -PROJECTS=("backend/functions" "common" "dev-tools" "test/e2e" "user-interface") +PROJECTS=("backend" "common" "dev-tools" "test/e2e" "user-interface") for str in "${PROJECTS[@]}"; do pushd "${str}" || exit diff --git a/test/e2e/playwright/auth-setup.ts b/test/e2e/playwright/auth-setup.ts index b6b491aa7..811ee238c 100644 --- a/test/e2e/playwright/auth-setup.ts +++ b/test/e2e/playwright/auth-setup.ts @@ -57,7 +57,7 @@ async function oktaLogin(page: Page) { function usingAuthenticationProvider() { let loginFunction; const provider = process.env.CAMS_LOGIN_PROVIDER ?? 'mock'; - // TODO: Add new login functions as we add new providers. + // TODO: Add new login function-apps as we add new providers. switch (provider.toLowerCase()) { case 'none': loginFunction = noOp; diff --git a/user-interface/src/lib/models/api2.test.ts b/user-interface/src/lib/models/api2.test.ts index 9265145df..61fb7d474 100644 --- a/user-interface/src/lib/models/api2.test.ts +++ b/user-interface/src/lib/models/api2.test.ts @@ -75,7 +75,7 @@ describe('extractPathFromUri', () => { }); }); -describe('_Api2 functions', async () => { +describe('_Api2 function-apps', async () => { let api: ApiType; let api2: Api2Type; @@ -86,7 +86,7 @@ describe('_Api2 functions', async () => { api2 = await import('./api2'); }); - test('should call real api functions', async () => { + test('should call real api function-apps', async () => { await callApiFunction(api2.Api2.getAttorneys, null, api); await callApiFunction(api2.Api2.getCaseAssignments, 'some-id', api); await callApiFunction(api2.Api2.getCaseAssociations, 'some-id', api); diff --git a/user-interface/src/lib/utils/datetime.test.ts b/user-interface/src/lib/utils/datetime.test.ts index fd2525fd8..083ac636e 100644 --- a/user-interface/src/lib/utils/datetime.test.ts +++ b/user-interface/src/lib/utils/datetime.test.ts @@ -54,7 +54,7 @@ describe('Date/Time utilities', () => { }); }); - describe('sort functions', () => { + describe('sort function-apps', () => { test('should sort dates newest first', () => { const middle = new Date(2024, 0, 1); const newest = new Date(2024, 1, 1); From 5a684f1a92f62a4d10850d4192cbe78ccb5823e1 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Tue, 10 Dec 2024 15:05:22 -0500 Subject: [PATCH 106/112] uncommmented unit tests and security scans Jira ticket: CAMS-461 --- .github/workflows/continuous-deployment.yml | 119 +++++++++++--------- 1 file changed, 64 insertions(+), 55 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 4223cf5de..0673aa766 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -49,60 +49,60 @@ jobs: enableBicepDeployment: ${{ inputs.enableBicepDeployment }} deployVnet: ${{ inputs.deployVnet }} - # accessibility-test: - # defaults: - # run: - # working-directory: user-interface - - # runs-on: ubuntu-latest - - # steps: - # - name: Install chrome - # uses: browser-actions/setup-chrome@v1 - - # - name: Get source code - # uses: actions/checkout@v3 - - # - name: Use Node.js - # uses: actions/setup-node@v3 - # with: - # node-version: ${{ vars.NODE_VERSION }} - # cache: "npm" - # cache-dependency-path: user-interface/package-lock.json - - # - name: Install Node dependencies - # run: | - # pushd ../common - # npm ci - # popd - - # npm ci && npm install -g pa11y-ci - - # - name: Run pa11y Test - # run: ../ops/scripts/pipeline/accessibility-test.sh - - # unit-test-frontend: - # uses: ./.github/workflows/reusable-unit-test.yml - # with: - # path: user-interface - # node-version: ${{ vars.NODE_VERSION }} - - # unit-test-backend: - # uses: ./.github/workflows/reusable-unit-test.yml - # with: - # path: backend - # node-version: ${{ vars.NODE_VERSION }} - - # unit-test-common: - # uses: ./.github/workflows/reusable-unit-test.yml - # with: - # path: common - # node-version: ${{ vars.NODE_VERSION }} - - # security-scan: - # name: Security - # uses: ./.github/workflows/sub-security-scan.yml - # secrets: inherit # pragma: allowlist secret + accessibility-test: + defaults: + run: + working-directory: user-interface + + runs-on: ubuntu-latest + + steps: + - name: Install chrome + uses: browser-actions/setup-chrome@v1 + + - name: Get source code + uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ vars.NODE_VERSION }} + cache: "npm" + cache-dependency-path: user-interface/package-lock.json + + - name: Install Node dependencies + run: | + pushd ../common + npm ci + popd + + npm ci && npm install -g pa11y-ci + + - name: Run pa11y Test + run: ../ops/scripts/pipeline/accessibility-test.sh + + unit-test-frontend: + uses: ./.github/workflows/reusable-unit-test.yml + with: + path: user-interface + node-version: ${{ vars.NODE_VERSION }} + + unit-test-backend: + uses: ./.github/workflows/reusable-unit-test.yml + with: + path: backend + node-version: ${{ vars.NODE_VERSION }} + + unit-test-common: + uses: ./.github/workflows/reusable-unit-test.yml + with: + path: common + node-version: ${{ vars.NODE_VERSION }} + + security-scan: + name: Security + uses: ./.github/workflows/sub-security-scan.yml + secrets: inherit # pragma: allowlist secret build: name: Build @@ -124,7 +124,16 @@ jobs: deploy: name: Cloud Resource Deployment uses: ./.github/workflows/sub-deploy.yml - needs: [setup, build] + needs: + [ + setup, + build, + accessibility-test, + security-scan, + unit-test-frontend, + unit-test-backend, + unit-test-common, + ] if: ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/dependency-updates-auto') || (inputs.deployBranch == 'true')) From edac5b2c1a36f14e9cffecc116379ccebc9f4875 Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Tue, 10 Dec 2024 15:08:33 -0500 Subject: [PATCH 107/112] removed commented out bicep code Jira ticket: CAMS-461 --- ops/cloud-deployment/backend-api-deploy.bicep | 6 ------ ops/cloud-deployment/frontend-webapp-deploy.bicep | 3 --- ops/cloud-deployment/main.bicep | 8 -------- 3 files changed, 17 deletions(-) diff --git a/ops/cloud-deployment/backend-api-deploy.bicep b/ops/cloud-deployment/backend-api-deploy.bicep index 03a19098b..e48db2b55 100644 --- a/ops/cloud-deployment/backend-api-deploy.bicep +++ b/ops/cloud-deployment/backend-api-deploy.bicep @@ -584,9 +584,3 @@ resource sqlIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-3 name: sqlIdentityName scope: resourceGroup(sqlIdentityRG) } - -// output apiFunctionAppName string = apiFunctionApp.name -// output apiFunctionAppId string = apiFunctionApp.id -// output migrationFunctionAppId string = migrationFunctionApp.id -// output createdSqlServerVnetRule bool = createSqlServerVnetRule -// output keyVaultId string = apiFunctionApp.properties.keyVaultReferenceIdentity diff --git a/ops/cloud-deployment/frontend-webapp-deploy.bicep b/ops/cloud-deployment/frontend-webapp-deploy.bicep index 505fd4a35..58b4d5252 100644 --- a/ops/cloud-deployment/frontend-webapp-deploy.bicep +++ b/ops/cloud-deployment/frontend-webapp-deploy.bicep @@ -316,6 +316,3 @@ module privateEndpoint './lib/network/subnet-private-endpoint.bicep' = { privateDnsZoneSubscriptionId: privateDnsZoneSubscriptionId } } -// output webappName string = webapp.name -// output webappId string = webapp.id -// output webappUrl string = webapp.properties.hostNameSslStates[0].name diff --git a/ops/cloud-deployment/main.bicep b/ops/cloud-deployment/main.bicep index 13de524c8..bdf799ee0 100644 --- a/ops/cloud-deployment/main.bicep +++ b/ops/cloud-deployment/main.bicep @@ -237,11 +237,3 @@ module ustpFunctions 'backend-api-deploy.bicep' = { ] } -// main.bicep outputs - -// resource identityKeyVaultAppConfig 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { -// name: idKeyvaultAppConfiguration -// scope: resourceGroup(kvAppConfigResourceGroupName) -// } -// output keyVaultId string = identityKeyVaultAppConfig.id -// output keyVaultManagedIdName string = identityKeyVaultAppConfig.name From 511ba778bbe1928a39b5fcce4a2dddae8d62cb76 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:09:36 +0000 Subject: [PATCH 108/112] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- ops/cloud-deployment/main.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/ops/cloud-deployment/main.bicep b/ops/cloud-deployment/main.bicep index bdf799ee0..8c33ed837 100644 --- a/ops/cloud-deployment/main.bicep +++ b/ops/cloud-deployment/main.bicep @@ -236,4 +236,3 @@ module ustpFunctions 'backend-api-deploy.bicep' = { network ] } - From e6e6b4a1a74d6e6255ffad990fd4da5f1245ca1c Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:30:49 -0500 Subject: [PATCH 109/112] Fix package.json entry point paths Jira ticket: CAMS-461 Co-authored-by: Fritz Madden <96319835+fmaddenflx@users.noreply.github.com> Co-authored-by: Arthur Morrow <133667008+amorrow-flexion@users.noreply.github.com> Co-authored-by: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Co-authored-by: Brian Posey <15091170+btposey@users.noreply.github.com>, --- backend/function-apps/api/package.json | 2 +- backend/function-apps/migration/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/function-apps/api/package.json b/backend/function-apps/api/package.json index 7e76ee65a..c45a335bb 100644 --- a/backend/function-apps/api/package.json +++ b/backend/function-apps/api/package.json @@ -2,7 +2,7 @@ "name": "cams-api", "version": "1.0.0", "description": "", - "main": "dist/backend/functions/api/*/*.function.js", + "main": "dist/backend/function-apps/api/*/*.function.js", "scripts": { "clean": "rm -rf ./dist ./node_modules *.zip", "prestart": "npm run build && cp ../../.env .", diff --git a/backend/function-apps/migration/package.json b/backend/function-apps/migration/package.json index d800a2273..6ed42908f 100644 --- a/backend/function-apps/migration/package.json +++ b/backend/function-apps/migration/package.json @@ -2,7 +2,7 @@ "name": "cams-migration", "version": "1.0.0", "description": "", - "main": "dist/backend/functions/migration/loadConsolidations.js", + "main": "dist/backend/function-apps/migration/loadConsolidations.js", "scripts": { "clean": "rm -rf ./dist ./node_modules *.zip", "prestart": "npm run build && cp ../../.env .", From 4a1baee062108490243c855cd641dea1e0a1566e Mon Sep 17 00:00:00 2001 From: James Brooks <12275865+jamesobrooks@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:49:56 -0600 Subject: [PATCH 110/112] Fix erroneous change --- backend/lib/use-cases/orders/orders-local-gateway.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/lib/use-cases/orders/orders-local-gateway.test.ts b/backend/lib/use-cases/orders/orders-local-gateway.test.ts index c24fb1cc1..9e67bd285 100644 --- a/backend/lib/use-cases/orders/orders-local-gateway.test.ts +++ b/backend/lib/use-cases/orders/orders-local-gateway.test.ts @@ -114,7 +114,7 @@ describe('orders use case tests', () => { }); test('should not create a second lead case for an existing consolidation', async () => { - // Spy/mock the factory function-apps so we can return a LOCAL database of our choosing for the test. + // Spy/mock the factory functions so we can return a LOCAL database of our choosing for the test. // We need a generic LOCAL gateway implementation that we return via the mocked factory function. const localCasesRepo = new LocalCasesRepository(); const localConsolidationsRepo = new LocalConsolidationOrdersRepository(); From 359779a28c5763887b14ff762902e8d3369f4052 Mon Sep 17 00:00:00 2001 From: Brian Posey <15091170+btposey@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:12:40 -0500 Subject: [PATCH 111/112] Fix functions -> function-apps renaming errors Jira ticket: CAMS-461 --- .github/workflows/reusable-build-info.yml | 2 +- ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh | 2 +- test/e2e/playwright/auth-setup.ts | 2 +- user-interface/src/lib/models/api2.test.ts | 4 ++-- user-interface/src/lib/utils/datetime.test.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-build-info.yml b/.github/workflows/reusable-build-info.yml index 416438e0f..fcf14c140 100644 --- a/.github/workflows/reusable-build-info.yml +++ b/.github/workflows/reusable-build-info.yml @@ -147,7 +147,7 @@ jobs: op: decode in: ${{ steps.rgApp.outputs.out }} - - name: Check Initial Deployment # update flag --apiName to --apiFunctionName + - name: Check Initial Deployment id: check-initial-deployment run: | initialDeployment=$(./ops/scripts/pipeline/check-for-environment.sh --resource-group ${{ steps.rgAppDecode.outputs.out }} --webappName ${{ steps.build-info.outputs.webappName }} --apiName ${{ steps.build-info.outputs.apiFunctionName }}) diff --git a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh index aa3cc5012..560c94bf0 100755 --- a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh +++ b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Description: Helper script to start and stop slots so we do not run sync function-apps against slot resources +# Description: Helper script to start and stop slots so we do not run sync functions against slot resources # Prerequisite: # - curl # - Azure CLI diff --git a/test/e2e/playwright/auth-setup.ts b/test/e2e/playwright/auth-setup.ts index 811ee238c..b6b491aa7 100644 --- a/test/e2e/playwright/auth-setup.ts +++ b/test/e2e/playwright/auth-setup.ts @@ -57,7 +57,7 @@ async function oktaLogin(page: Page) { function usingAuthenticationProvider() { let loginFunction; const provider = process.env.CAMS_LOGIN_PROVIDER ?? 'mock'; - // TODO: Add new login function-apps as we add new providers. + // TODO: Add new login functions as we add new providers. switch (provider.toLowerCase()) { case 'none': loginFunction = noOp; diff --git a/user-interface/src/lib/models/api2.test.ts b/user-interface/src/lib/models/api2.test.ts index 61fb7d474..9265145df 100644 --- a/user-interface/src/lib/models/api2.test.ts +++ b/user-interface/src/lib/models/api2.test.ts @@ -75,7 +75,7 @@ describe('extractPathFromUri', () => { }); }); -describe('_Api2 function-apps', async () => { +describe('_Api2 functions', async () => { let api: ApiType; let api2: Api2Type; @@ -86,7 +86,7 @@ describe('_Api2 function-apps', async () => { api2 = await import('./api2'); }); - test('should call real api function-apps', async () => { + test('should call real api functions', async () => { await callApiFunction(api2.Api2.getAttorneys, null, api); await callApiFunction(api2.Api2.getCaseAssignments, 'some-id', api); await callApiFunction(api2.Api2.getCaseAssociations, 'some-id', api); diff --git a/user-interface/src/lib/utils/datetime.test.ts b/user-interface/src/lib/utils/datetime.test.ts index 083ac636e..fd2525fd8 100644 --- a/user-interface/src/lib/utils/datetime.test.ts +++ b/user-interface/src/lib/utils/datetime.test.ts @@ -54,7 +54,7 @@ describe('Date/Time utilities', () => { }); }); - describe('sort function-apps', () => { + describe('sort functions', () => { test('should sort dates newest first', () => { const middle = new Date(2024, 0, 1); const newest = new Date(2024, 1, 1); From 488acb8146bde4b1017d973c1d559ea7d10715ae Mon Sep 17 00:00:00 2001 From: Arthur Morrow Date: Tue, 10 Dec 2024 16:25:08 -0500 Subject: [PATCH 112/112] updated stop slot to include migration function Jira ticket: CAMS-461 --- .../slots/az-slot-start-stop-operations.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh index 560c94bf0..0af280c67 100755 --- a/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh +++ b/ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh @@ -4,7 +4,7 @@ # Prerequisite: # - curl # - Azure CLI -# Usage: az-slot-lifecycle.sh -g --apiName --webappName --slotName --operation +# Usage: az-slot-start-stop-operations.sh -g --apiFunctionName --migrationFunctionName --webappName --slotName --operation set -euo pipefail # ensure job step fails in CI pipeline when error occurs @@ -18,8 +18,13 @@ while [[ $# -gt 0 ]]; do shift 2 ;; - --apiName) - api_name="${2}" + --apiFunctionName) + api_function_name="${2}" + shift 2 + ;; + + --migrationFunctionName) + migration_function_name="${2}" shift 2 ;; @@ -46,13 +51,15 @@ done if [[ ${operation} == 'stop' ]]; then echo "Stopping Node API ${slot_name} slot..." - az functionapp stop -g "${app_rg}" --name "${api_name}" --slot "${slot_name}" + az functionapp stop -g "${app_rg}" --name "${api_function_name}" --slot "${slot_name}" + echo "Stopping Migration Function ${slot_name} slot..." + az functionapp stop -g "${app_rg}" --name "${migration_function_name}" --slot "${slot_name}" echo "Stopping Webapp ${slot_name} slot..." az webapp stop -g "${app_rg}" --name "${webapp_name}" --slot "${slot_name}" elif [[ ${operation} == 'start' ]]; then echo "Starting Node API ${slot_name} slot..." - az functionapp start -g "${app_rg}" --name "${api_name}" --slot "${slot_name}" + az functionapp start -g "${app_rg}" --name "${api_function_name}" --slot "${slot_name}" echo "Starting Webapp ${slot_name} slot..." az webapp start -g "${app_rg}" --name "${webapp_name}" --slot "${slot_name}"