diff --git a/.prettierrc b/.prettierrc index 283367cde..fa9699b89 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,6 +3,5 @@ "trailingComma": "all", "singleQuote": true, "printWidth": 80, - "no-parameter-properties": true, "tabWidth": 2 } diff --git a/services/API-service/.prettierrc.js b/services/API-service/.prettierrc.js index a183a7df1..d20840619 100644 --- a/services/API-service/.prettierrc.js +++ b/services/API-service/.prettierrc.js @@ -3,6 +3,9 @@ module.exports = { trailingComma: 'all', singleQuote: true, printWidth: 80, - 'no-parameter-properties': true, tabWidth: 2, + plugins: ['@ianvs/prettier-plugin-sort-imports'], + importOrder: ['^@nestjs', '', '', '', '^[.]'], + importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'], + importOrderTypeScriptVersion: '5.0.0', }; diff --git a/services/API-service/appdatasource.ts b/services/API-service/appdatasource.ts index e29a3ca46..b2789d5ac 100644 --- a/services/API-service/appdatasource.ts +++ b/services/API-service/appdatasource.ts @@ -1,3 +1,5 @@ import { DataSource, DataSourceOptions } from 'typeorm'; + import { ORMConfig } from './ormconfig'; + export const AppDataSource = new DataSource(ORMConfig as DataSourceOptions); diff --git a/services/API-service/migration/1710512991479-rename-mock-rasters.ts b/services/API-service/migration/1710512991479-rename-mock-rasters.ts index 6237128d9..d77f99b38 100644 --- a/services/API-service/migration/1710512991479-rename-mock-rasters.ts +++ b/services/API-service/migration/1710512991479-rename-mock-rasters.ts @@ -1,7 +1,8 @@ -import { MigrationInterface, QueryRunner } from 'typeorm'; import * as fs from 'fs'; import * as path from 'path'; +import { MigrationInterface, QueryRunner } from 'typeorm'; + export class RenameMockRasters1710512991479 implements MigrationInterface { public async up(_queryRunner: QueryRunner): Promise { const directoryPath = './geoserver-volume/raster-files/mock-output/'; diff --git a/services/API-service/ormconfig.ts b/services/API-service/ormconfig.ts index 54a054e9e..c5830ba14 100644 --- a/services/API-service/ormconfig.ts +++ b/services/API-service/ormconfig.ts @@ -1,4 +1,5 @@ import * as fs from 'fs'; + import { DataSourceOptions } from 'typeorm'; export const ORMConfig: DataSourceOptions = { diff --git a/services/API-service/package-lock.json b/services/API-service/package-lock.json index 2a926b0d3..592770c77 100644 --- a/services/API-service/package-lock.json +++ b/services/API-service/package-lock.json @@ -19,6 +19,7 @@ "class-transformer": "^0.3.1", "class-validator": "^0.14.0", "csv-parser": "^3.0.0", + "date-fns": "^3.6.0", "ejs": "^3.1.9", "jsonwebtoken": "^8.1.1", "juice": "^10.0.0", @@ -36,6 +37,7 @@ "wkt-io-ts": "^1.0.2" }, "devDependencies": { + "@ianvs/prettier-plugin-sort-imports": "^4.3.0", "@types/express": "^4.17.14", "@types/jest": "^26.0.20", "@types/node": "16.x", @@ -70,41 +72,77 @@ "node": ">=0.10.0" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.12.13" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", + "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "dev": true, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.13.tgz", - "integrity": "sha512-BQKE9kXkPlXHPeqissfxo0lySWJcYdEP0hdtJOH/iJfDdhOCcgtNCjftCJg3qqauB4h+lz2N6ixM++b9DN1Tcw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.13", - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helpers": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", - "convert-source-map": "^1.7.0", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", + "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helpers": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/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 + }, "node_modules/@babel/core/node_modules/debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -118,13 +156,10 @@ } }, "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -138,106 +173,119 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/@babel/core/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dev": true, - "bin": { - "semver": "bin/semver" + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/core/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", + "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", "dev": true, + "dependencies": { + "@babel/compat-data": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6.9.0" } }, - "node_modules/@babel/generator": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.15.tgz", - "integrity": "sha512-6F2xHxBiFXWNSGb7vyCUTBF8RCLY66rS0zEPcP8t/nQyXjha5EuK4z7H5o7fWG8B4M7y6mqVWq1J+1PuwRhecQ==", + "node_modules/@babel/helper-compilation-targets/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, "dependencies": { - "@babel/types": "^7.12.13", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "yallist": "^3.0.2" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, - "node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.13.tgz", - "integrity": "sha512-B+7nN0gIL8FZ8SvMcF+EPyB21KnCcZHQZFczCxbiNGV/O0rsrSBlWGLzmtBJ3GMjSVMIm4lpFhR+VdVBuIsUcQ==", + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz", - "integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz", - "integrity": "sha512-acKF7EjqOR67ASIlDTupwkKM1eUisNAjaSduo5Cz+793ikfnpe7p4Q7B7EWU2PCoSTPWsQkR7hRUWEIZPiVLGA==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13", - "@babel/helper-simple-access": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.12.11", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", + "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { @@ -246,68 +294,90 @@ "integrity": "sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA==", "dev": true }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz", - "integrity": "sha512-pctAOIAMVStI2TMLhozPKbf5yTEXc0OJa0eENheb4w09SrgOWEs+P4nTOZYJQCqs8JlErGLDPDJTiGIp3ygbLg==", + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz", - "integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==", + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", + "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@babel/helpers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.13.tgz", - "integrity": "sha512-oohVzLRZ3GQEk4Cjhfs9YkJA4TdIDTObdBEZGrd6F/T0GPSnuV6l22eMcxlvcvzVIPH3VTtxbseudM1zIE+rPQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", + "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", "dev": true, "dependencies": { - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", - "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.15.tgz", - "integrity": "sha512-AQBOU2Z9kWwSZMd6lNjCX0GUgFonL1wAM1db8L8PMk9UDaGsRCArBkU4Sc+UCM3AE4hjbXx+h58Lb3QT4oRmrA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -326,9 +396,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", - "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -337,31 +407,38 @@ } }, "node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.13.tgz", - "integrity": "sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/traverse/node_modules/debug": { @@ -383,14 +460,17 @@ "dev": true }, "node_modules/@babel/types": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.13.tgz", - "integrity": "sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@cnakazawa/watch": { @@ -610,6 +690,41 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@ianvs/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-OOMtUcO4J3LoL63dOKAe7bn+lSRRPeit2DqNHpx+wvBp3Grejo2PMaK4Mp1mwy8pnat64ccSgk/lBZbsAdLErw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.24.0", + "@babel/generator": "^7.23.6", + "@babel/parser": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", + "semver": "^7.5.2" + }, + "peerDependencies": { + "@vue/compiler-sfc": "2.7.x || 3.x", + "prettier": "2 || 3" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@ianvs/prettier-plugin-sort-imports/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jest/console": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", @@ -1444,6 +1559,20 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", @@ -1453,12 +1582,31 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "devOptional": 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, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@lukeed/csprng": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", @@ -3508,6 +3656,38 @@ "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "node_modules/browserslist": { + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.16" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/bs-logger": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", @@ -3642,6 +3822,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001639", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz", + "integrity": "sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, "node_modules/capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -4308,11 +4508,6 @@ "node": ">=8" } }, - "node_modules/cryptr": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/cryptr/-/cryptr-6.0.2.tgz", - "integrity": "sha512-1TRHI4bmuLIB8WgkH9eeYXzhEg1T4tonO4vVaMBKKde8Dre51J68nAgTVXTwMYXAf7+mV2gBCkm/9wksjSb2sA==" - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -4402,18 +4597,12 @@ } }, "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" } }, "node_modules/dayjs": { @@ -4750,6 +4939,12 @@ "node": ">=0.10.0" } }, + "node_modules/electron-to-chromium": { + "version": "1.4.815", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.815.tgz", + "integrity": "sha512-OvpTT2ItpOXJL7IGcYakRjHCt8L5GrrN/wHCQsRB4PQa1X9fe+X9oen245mIId7s14xvArCGSTIq644yPUKKLg==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4832,9 +5027,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } @@ -10423,6 +10618,12 @@ "semver": "bin/semver" } }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, "node_modules/nodemon": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", @@ -11021,6 +11222,12 @@ "node": ">= 10.x" } }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -11451,9 +11658,9 @@ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, "node_modules/regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regex-not": { "version": "1.0.2", @@ -12016,9 +12223,9 @@ "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==" }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -13504,6 +13711,21 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/typeorm/node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/typeorm/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -13738,6 +13960,36 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, + "node_modules/update-browserslist-db": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/update-notifier": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", @@ -14378,38 +14630,61 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "requires": { - "@babel/highlight": "^7.12.13" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" } }, + "@babel/compat-data": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", + "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "dev": true + }, "@babel/core": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.13.tgz", - "integrity": "sha512-BQKE9kXkPlXHPeqissfxo0lySWJcYdEP0hdtJOH/iJfDdhOCcgtNCjftCJg3qqauB4h+lz2N6ixM++b9DN1Tcw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.13", - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helpers": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", - "convert-source-map": "^1.7.0", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", + "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helpers": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" }, "dependencies": { + "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 + }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -14420,115 +14695,110 @@ } }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true } } }, "@babel/generator": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.15.tgz", - "integrity": "sha512-6F2xHxBiFXWNSGb7vyCUTBF8RCLY66rS0zEPcP8t/nQyXjha5EuK4z7H5o7fWG8B4M7y6mqVWq1J+1PuwRhecQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dev": true, "requires": { - "@babel/types": "^7.12.13", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", + "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "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, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } }, - "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" } }, - "@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.13.tgz", - "integrity": "sha512-B+7nN0gIL8FZ8SvMcF+EPyB21KnCcZHQZFczCxbiNGV/O0rsrSBlWGLzmtBJ3GMjSVMIm4lpFhR+VdVBuIsUcQ==", + "@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" } }, "@babel/helper-module-imports": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz", - "integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-module-transforms": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz", - "integrity": "sha512-acKF7EjqOR67ASIlDTupwkKM1eUisNAjaSduo5Cz+793ikfnpe7p4Q7B7EWU2PCoSTPWsQkR7hRUWEIZPiVLGA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13", - "@babel/helper-simple-access": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.12.11", - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", - "lodash": "^4.17.19" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", - "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", + "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" } }, "@babel/helper-plugin-utils": { @@ -14537,68 +14807,69 @@ "integrity": "sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA==", "dev": true }, - "@babel/helper-replace-supers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz", - "integrity": "sha512-pctAOIAMVStI2TMLhozPKbf5yTEXc0OJa0eENheb4w09SrgOWEs+P4nTOZYJQCqs8JlErGLDPDJTiGIp3ygbLg==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" - } - }, "@babel/helper-simple-access": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz", - "integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.24.7" } }, + "@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", + "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", "dev": true }, "@babel/helpers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.13.tgz", - "integrity": "sha512-oohVzLRZ3GQEk4Cjhfs9YkJA4TdIDTObdBEZGrd6F/T0GPSnuV6l22eMcxlvcvzVIPH3VTtxbseudM1zIE+rPQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", + "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", "dev": true, "requires": { - "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/highlight": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", - "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" } }, "@babel/parser": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.15.tgz", - "integrity": "sha512-AQBOU2Z9kWwSZMd6lNjCX0GUgFonL1wAM1db8L8PMk9UDaGsRCArBkU4Sc+UCM3AE4hjbXx+h58Lb3QT4oRmrA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -14611,39 +14882,40 @@ } }, "@babel/runtime": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", - "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "requires": { "regenerator-runtime": "^0.14.0" } }, "@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dev": true, "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/traverse": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.13.tgz", - "integrity": "sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", "dev": true, "requires": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", + "globals": "^11.1.0" }, "dependencies": { "debug": { @@ -14664,13 +14936,13 @@ } }, "@babel/types": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.13.tgz", - "integrity": "sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" } }, @@ -14828,6 +15100,28 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@ianvs/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-OOMtUcO4J3LoL63dOKAe7bn+lSRRPeit2DqNHpx+wvBp3Grejo2PMaK4Mp1mwy8pnat64ccSgk/lBZbsAdLErw==", + "dev": true, + "requires": { + "@babel/core": "^7.24.0", + "@babel/generator": "^7.23.6", + "@babel/parser": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", + "semver": "^7.5.2" + }, + "dependencies": { + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true + } + } + }, "@jest/console": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", @@ -15542,18 +15836,45 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "devOptional": true }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, "@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "devOptional": true }, + "@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, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "@lukeed/csprng": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", @@ -17009,6 +17330,18 @@ } } }, + "browserslist": { + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.16" + } + }, "bs-logger": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", @@ -17115,6 +17448,12 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" }, + "caniuse-lite": { + "version": "1.0.30001639", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz", + "integrity": "sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg==", + "dev": true + }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -17644,11 +17983,6 @@ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", "dev": true }, - "cryptr": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/cryptr/-/cryptr-6.0.2.tgz", - "integrity": "sha512-1TRHI4bmuLIB8WgkH9eeYXzhEg1T4tonO4vVaMBKKde8Dre51J68nAgTVXTwMYXAf7+mV2gBCkm/9wksjSb2sA==" - }, "css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -17722,12 +18056,9 @@ } }, "date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "requires": { - "@babel/runtime": "^7.21.0" - } + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==" }, "dayjs": { "version": "1.11.6", @@ -17980,6 +18311,12 @@ "jake": "^10.8.5" } }, + "electron-to-chromium": { + "version": "1.4.815", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.815.tgz", + "integrity": "sha512-OvpTT2ItpOXJL7IGcYakRjHCt8L5GrrN/wHCQsRB4PQa1X9fe+X9oen245mIId7s14xvArCGSTIq644yPUKKLg==", + "dev": true + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -18047,9 +18384,9 @@ } }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==" }, "escape-goat": { "version": "2.1.1", @@ -22612,6 +22949,12 @@ } } }, + "node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, "nodemon": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", @@ -23085,6 +23428,12 @@ } } }, + "picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -23403,9 +23752,9 @@ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, "regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "regex-not": { "version": "1.0.2", @@ -23864,9 +24213,9 @@ "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "semver-diff": { @@ -24983,6 +25332,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "requires": { + "@babel/runtime": "^7.21.0" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -25154,6 +25511,16 @@ } } }, + "update-browserslist-db": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "dev": true, + "requires": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + } + }, "update-notifier": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", diff --git a/services/API-service/package.json b/services/API-service/package.json index da68974f0..7017a7564 100644 --- a/services/API-service/package.json +++ b/services/API-service/package.json @@ -39,6 +39,7 @@ "class-transformer": "^0.3.1", "class-validator": "^0.14.0", "csv-parser": "^3.0.0", + "date-fns": "^3.6.0", "ejs": "^3.1.9", "jsonwebtoken": "^8.1.1", "juice": "^10.0.0", @@ -56,6 +57,7 @@ "wkt-io-ts": "^1.0.2" }, "devDependencies": { + "@ianvs/prettier-plugin-sort-imports": "^4.3.0", "@types/express": "^4.17.14", "@types/jest": "^26.0.20", "@types/node": "16.x", diff --git a/services/API-service/src/api/admin-area-data/admin-area-data.controller.ts b/services/API-service/src/api/admin-area-data/admin-area-data.controller.ts index c6df15115..e7a1d091a 100644 --- a/services/API-service/src/api/admin-area-data/admin-area-data.controller.ts +++ b/services/API-service/src/api/admin-area-data/admin-area-data.controller.ts @@ -18,13 +18,14 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; +import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; import { AdminDataReturnDto } from '../admin-area-dynamic-data/dto/admin-data-return.dto'; import { UserRole } from '../user/user-role.enum'; import { AdminAreaDataService } from './admin-area-data.service'; import { UploadAdminAreaDataJsonDto } from './dto/upload-admin-area-data.dto'; -import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; @ApiBearerAuth() @UseGuards(RolesGuard) diff --git a/services/API-service/src/api/admin-area-data/admin-area-data.entity.ts b/services/API-service/src/api/admin-area-data/admin-area-data.entity.ts index 8e814fb22..398ab633a 100644 --- a/services/API-service/src/api/admin-area-data/admin-area-data.entity.ts +++ b/services/API-service/src/api/admin-area-data/admin-area-data.entity.ts @@ -1,11 +1,12 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, - JoinColumn, + Entity, Index, + JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { AdminLevel } from '../country/admin-level.enum'; import { CountryEntity } from '../country/country.entity'; diff --git a/services/API-service/src/api/admin-area-data/admin-area-data.module.ts b/services/API-service/src/api/admin-area-data/admin-area-data.module.ts index c2fe9c72f..94204c953 100644 --- a/services/API-service/src/api/admin-area-data/admin-area-data.module.ts +++ b/services/API-service/src/api/admin-area-data/admin-area-data.module.ts @@ -1,11 +1,12 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; import { UserModule } from '../user/user.module'; import { AdminAreaDataController } from './admin-area-data.controller'; import { AdminAreaDataEntity } from './admin-area-data.entity'; import { AdminAreaDataService } from './admin-area-data.service'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/admin-area-data/admin-area-data.service.ts b/services/API-service/src/api/admin-area-data/admin-area-data.service.ts index aaf578c41..3ca40b22c 100644 --- a/services/API-service/src/api/admin-area-data/admin-area-data.service.ts +++ b/services/API-service/src/api/admin-area-data/admin-area-data.service.ts @@ -1,15 +1,17 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + +import { validate } from 'class-validator'; import { Repository } from 'typeorm'; + +import { HelperService } from '../../shared/helper.service'; +import { AdminDataReturnDto } from '../admin-area-dynamic-data/dto/admin-data-return.dto'; +import { UpdateableStaticIndicator } from '../admin-area-dynamic-data/enum/dynamic-data-unit'; import { AdminAreaDataEntity } from './admin-area-data.entity'; import { UploadAdminAreaDataDto, UploadAdminAreaDataJsonDto, } from './dto/upload-admin-area-data.dto'; -import { validate } from 'class-validator'; -import { AdminDataReturnDto } from '../admin-area-dynamic-data/dto/admin-data-return.dto'; -import { HelperService } from '../../shared/helper.service'; -import { UpdateableStaticIndicator } from '../admin-area-dynamic-data/enum/dynamic-data-unit'; @Injectable() export class AdminAreaDataService { diff --git a/services/API-service/src/api/admin-area-data/dto/upload-admin-area-data.dto.ts b/services/API-service/src/api/admin-area-data/dto/upload-admin-area-data.dto.ts index 7d6b14912..550f86077 100644 --- a/services/API-service/src/api/admin-area-data/dto/upload-admin-area-data.dto.ts +++ b/services/API-service/src/api/admin-area-data/dto/upload-admin-area-data.dto.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsEnum, @@ -7,14 +10,13 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; -import { Type } from 'class-transformer'; -import { ManyToOne, JoinColumn } from 'typeorm'; +import { JoinColumn, ManyToOne } from 'typeorm'; + import { DynamicDataPlaceCodeDto } from '../../admin-area-dynamic-data/dto/dynamic-data-place-code.dto'; +import indicatorData from '../../admin-area-dynamic-data/dto/example/ETH/malaria/upload-potential_cases-3.json'; import { UpdateableStaticIndicator } from '../../admin-area-dynamic-data/enum/dynamic-data-unit'; import { AdminLevel } from '../../country/admin-level.enum'; import { CountryEntity } from '../../country/country.entity'; -import indicatorData from '../../admin-area-dynamic-data/dto/example/ETH/malaria/upload-potential_cases-3.json'; export class UploadAdminAreaDataDto { @ApiProperty() diff --git a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.controller.ts b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.controller.ts index d85aedc5b..689043455 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.controller.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.controller.ts @@ -1,26 +1,35 @@ -import { AdminDataReturnDto } from './dto/admin-data-return.dto'; -import { DynamicIndicator } from './enum/dynamic-data-unit'; -import { Body, Get, Param, UploadedFile } from '@nestjs/common'; -import { Controller, Post, UseGuards, UseInterceptors } from '@nestjs/common'; import { - ApiOperation, - ApiConsumes, + Body, + Controller, + Get, + Param, + Post, + UploadedFile, + UseGuards, + UseInterceptors, +} from '@nestjs/common'; +import { Query } from '@nestjs/common/decorators'; +import { FileInterceptor } from '@nestjs/platform-express'; +import { ApiBearerAuth, - ApiTags, - ApiParam, ApiBody, - ApiResponse, + ApiConsumes, + ApiOperation, + ApiParam, ApiQuery, + ApiResponse, + ApiTags, } from '@nestjs/swagger'; + +import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; -import { UploadAdminAreaDynamicDataDto } from './dto/upload-admin-area-dynamic-data.dto'; -import { AdminAreaDynamicDataService } from './admin-area-dynamic-data.service'; +import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; import { DisasterType } from '../disaster/disaster-type.enum'; -import { FileInterceptor } from '@nestjs/platform-express'; -import { Roles } from '../../roles.decorator'; import { UserRole } from '../user/user-role.enum'; -import { Query } from '@nestjs/common/decorators'; -import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; +import { AdminAreaDynamicDataService } from './admin-area-dynamic-data.service'; +import { AdminDataReturnDto } from './dto/admin-data-return.dto'; +import { UploadAdminAreaDynamicDataDto } from './dto/upload-admin-area-dynamic-data.dto'; +import { DynamicIndicator } from './enum/dynamic-data-unit'; @ApiBearerAuth() @UseGuards(RolesGuard) diff --git a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.entity.ts b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.entity.ts index 4d1143d6e..de6f17225 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.entity.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.entity.ts @@ -1,11 +1,12 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, - JoinColumn, + Entity, Index, + JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; diff --git a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.module.ts b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.module.ts index f7b529db9..268de513f 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.module.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.module.ts @@ -1,16 +1,17 @@ -import { CountryModule } from './../country/country.module'; -import { UserModule } from '../user/user.module'; -import { AdminAreaDynamicDataService } from './admin-area-dynamic-data.service'; -import { AdminAreaDynamicDataController } from './admin-area-dynamic-data.controller'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { TriggerPerLeadTime } from '../event/trigger-per-lead-time.entity'; -import { AdminAreaDynamicDataEntity } from './admin-area-dynamic-data.entity'; -import { EventModule } from '../event/event.module'; -import { DisasterEntity } from '../disaster/disaster.entity'; -import { CountryEntity } from '../country/country.entity'; + import { HelperService } from '../../shared/helper.service'; import { AdminAreaModule } from '../admin-area/admin-area.module'; +import { CountryEntity } from '../country/country.entity'; +import { DisasterEntity } from '../disaster/disaster.entity'; +import { EventModule } from '../event/event.module'; +import { TriggerPerLeadTime } from '../event/trigger-per-lead-time.entity'; +import { UserModule } from '../user/user.module'; +import { CountryModule } from './../country/country.module'; +import { AdminAreaDynamicDataController } from './admin-area-dynamic-data.controller'; +import { AdminAreaDynamicDataEntity } from './admin-area-dynamic-data.entity'; +import { AdminAreaDynamicDataService } from './admin-area-dynamic-data.service'; @Module({ imports: [ diff --git a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.service.ts b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.service.ts index d424227b2..6dbe706f6 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.service.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/admin-area-dynamic-data.service.ts @@ -1,21 +1,23 @@ -import { LeadTime } from './enum/lead-time.enum'; -import { DynamicDataPlaceCodeDto } from './dto/dynamic-data-place-code.dto'; +import fs from 'fs'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; -import { DataSource, In, IsNull, MoreThanOrEqual, Repository } from 'typeorm'; -import { UploadAdminAreaDynamicDataDto } from './dto/upload-admin-area-dynamic-data.dto'; import { InjectRepository } from '@nestjs/typeorm'; -import { AdminAreaDynamicDataEntity } from './admin-area-dynamic-data.entity'; -import { DynamicIndicator } from './enum/dynamic-data-unit'; -import { AdminDataReturnDto } from './dto/admin-data-return.dto'; -import { UploadTriggerPerLeadTimeDto } from '../event/dto/upload-trigger-per-leadtime.dto'; -import { EventService } from '../event/event.service'; -import { DisasterEntity } from '../disaster/disaster.entity'; -import { DisasterType } from '../disaster/disaster-type.enum'; -import fs from 'fs'; -import { CountryEntity } from '../country/country.entity'; + +import { DataSource, In, IsNull, MoreThanOrEqual, Repository } from 'typeorm'; + +import { DisasterTypeGeoServerMapper } from '../../scripts/disaster-type-geoserver-file.mapper'; import { HelperService } from '../../shared/helper.service'; import { EventAreaService } from '../admin-area/services/event-area.service'; -import { DisasterTypeGeoServerMapper } from '../../scripts/disaster-type-geoserver-file.mapper'; +import { CountryEntity } from '../country/country.entity'; +import { DisasterType } from '../disaster/disaster-type.enum'; +import { DisasterEntity } from '../disaster/disaster.entity'; +import { UploadTriggerPerLeadTimeDto } from '../event/dto/upload-trigger-per-leadtime.dto'; +import { EventService } from '../event/event.service'; +import { AdminAreaDynamicDataEntity } from './admin-area-dynamic-data.entity'; +import { AdminDataReturnDto } from './dto/admin-data-return.dto'; +import { DynamicDataPlaceCodeDto } from './dto/dynamic-data-place-code.dto'; +import { UploadAdminAreaDynamicDataDto } from './dto/upload-admin-area-dynamic-data.dto'; +import { DynamicIndicator } from './enum/dynamic-data-unit'; +import { LeadTime } from './enum/lead-time.enum'; interface RasterData { originalname: string; diff --git a/services/API-service/src/api/admin-area-dynamic-data/dto/dynamic-data-place-code.dto.ts b/services/API-service/src/api/admin-area-dynamic-data/dto/dynamic-data-place-code.dto.ts index 003620ec3..efee267fe 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/dto/dynamic-data-place-code.dto.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/dto/dynamic-data-place-code.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsNumber, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsNumber, IsString } from 'class-validator'; + export class DynamicDataPlaceCodeDto { @ApiProperty() @IsNotEmpty() diff --git a/services/API-service/src/api/admin-area-dynamic-data/dto/upload-admin-area-dynamic-data.dto.ts b/services/API-service/src/api/admin-area-dynamic-data/dto/upload-admin-area-dynamic-data.dto.ts index f93be9656..bd314f830 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/dto/upload-admin-area-dynamic-data.dto.ts +++ b/services/API-service/src/api/admin-area-dynamic-data/dto/upload-admin-area-dynamic-data.dto.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsEnum, @@ -7,13 +10,12 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { Type } from 'class-transformer'; -import { ApiProperty } from '@nestjs/swagger'; + +import { DisasterType } from '../../disaster/disaster-type.enum'; +import { DynamicIndicator } from '../enum/dynamic-data-unit'; +import { LeadTime } from '../enum/lead-time.enum'; import { DynamicDataPlaceCodeDto } from './dynamic-data-place-code.dto'; import exposure from './example/PHL/dengue/upload-potential_cases-2.json'; -import { LeadTime } from '../enum/lead-time.enum'; -import { DynamicIndicator } from '../enum/dynamic-data-unit'; -import { DisasterType } from '../../disaster/disaster-type.enum'; export class UploadAdminAreaDynamicDataDto { @ApiProperty({ example: 'PHL' }) diff --git a/services/API-service/src/api/admin-area/admin-area.controller.ts b/services/API-service/src/api/admin-area/admin-area.controller.ts index bd03cb3e1..c497f97e6 100644 --- a/services/API-service/src/api/admin-area/admin-area.controller.ts +++ b/services/API-service/src/api/admin-area/admin-area.controller.ts @@ -17,13 +17,14 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; -import { GeoJson } from '../../shared/geo.model'; + +import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; -import { AdminAreaService } from './admin-area.service'; import { AggregateDataRecord } from '../../shared/data.model'; -import { AdminAreaEntity } from './admin-area.entity'; -import { Roles } from '../../roles.decorator'; +import { GeoJson } from '../../shared/geo.model'; import { UserRole } from '../user/user-role.enum'; +import { AdminAreaEntity } from './admin-area.entity'; +import { AdminAreaService } from './admin-area.service'; @ApiBearerAuth() @UseGuards(RolesGuard) diff --git a/services/API-service/src/api/admin-area/admin-area.entity.ts b/services/API-service/src/api/admin-area/admin-area.entity.ts index f1acf5042..f4af44831 100644 --- a/services/API-service/src/api/admin-area/admin-area.entity.ts +++ b/services/API-service/src/api/admin-area/admin-area.entity.ts @@ -1,14 +1,16 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, - JoinColumn, - OneToMany, + Entity, Index, + JoinColumn, + ManyToOne, MultiPolygon, + OneToMany, + PrimaryGeneratedColumn, } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; diff --git a/services/API-service/src/api/admin-area/admin-area.module.ts b/services/API-service/src/api/admin-area/admin-area.module.ts index f5e3ca1ff..37ab73e4c 100644 --- a/services/API-service/src/api/admin-area/admin-area.module.ts +++ b/services/API-service/src/api/admin-area/admin-area.module.ts @@ -1,18 +1,19 @@ -import { CountryModule } from './../country/country.module'; +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; +import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { CountryEntity } from '../country/country.entity'; +import { DisasterEntity } from '../disaster/disaster.entity'; import { EventModule } from '../event/event.module'; import { UserModule } from '../user/user.module'; +import { CountryModule } from './../country/country.module'; import { AdminAreaController } from './admin-area.controller'; import { AdminAreaEntity } from './admin-area.entity'; import { AdminAreaService } from './admin-area.service'; -import { DisasterEntity } from '../disaster/disaster.entity'; -import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; -import { HttpModule } from '@nestjs/axios'; -import { EventAreaService } from './services/event-area.service'; import { EventAreaEntity } from './event-area.entity'; +import { EventAreaService } from './services/event-area.service'; @Module({ imports: [ diff --git a/services/API-service/src/api/admin-area/admin-area.service.ts b/services/API-service/src/api/admin-area/admin-area.service.ts index f11ca8d4a..43c98c262 100644 --- a/services/API-service/src/api/admin-area/admin-area.service.ts +++ b/services/API-service/src/api/admin-area/admin-area.service.ts @@ -1,17 +1,19 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { GeoJson } from '../../shared/geo.model'; -import { HelperService } from '../../shared/helper.service'; + import { InsertResult, MoreThan, MoreThanOrEqual, Repository } from 'typeorm'; -import { AdminAreaEntity } from './admin-area.entity'; -import { EventService } from '../event/event.service'; + import { AggregateDataRecord } from '../../shared/data.model'; -import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; +import { GeoJson } from '../../shared/geo.model'; +import { HelperService } from '../../shared/helper.service'; import { AdminAreaDataEntity } from '../admin-area-data/admin-area-data.entity'; -import { DisasterType } from '../disaster/disaster-type.enum'; -import { DisasterEntity } from '../disaster/disaster.entity'; +import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { DynamicIndicator } from '../admin-area-dynamic-data/enum/dynamic-data-unit'; import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; +import { DisasterType } from '../disaster/disaster-type.enum'; +import { DisasterEntity } from '../disaster/disaster.entity'; +import { EventService } from '../event/event.service'; +import { AdminAreaEntity } from './admin-area.entity'; import { EventAreaService } from './services/event-area.service'; @Injectable() diff --git a/services/API-service/src/api/admin-area/event-area.entity.ts b/services/API-service/src/api/admin-area/event-area.entity.ts index e79c87e29..085245d30 100644 --- a/services/API-service/src/api/admin-area/event-area.entity.ts +++ b/services/API-service/src/api/admin-area/event-area.entity.ts @@ -1,12 +1,14 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, + Entity, JoinColumn, + ManyToOne, MultiPolygon, + PrimaryGeneratedColumn, } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; import { DisasterType } from '../disaster/disaster-type.enum'; import { DisasterEntity } from '../disaster/disaster.entity'; diff --git a/services/API-service/src/api/admin-area/services/event-area.service.ts b/services/API-service/src/api/admin-area/services/event-area.service.ts index 42f6f65ec..b292772d3 100644 --- a/services/API-service/src/api/admin-area/services/event-area.service.ts +++ b/services/API-service/src/api/admin-area/services/event-area.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { Repository, MoreThanOrEqual, InsertResult } from 'typeorm'; + +import { InsertResult, MoreThanOrEqual, Repository } from 'typeorm'; + import { AggregateDataRecord, EventSummaryCountry, diff --git a/services/API-service/src/api/country/country-disaster.entity.ts b/services/API-service/src/api/country/country-disaster.entity.ts index 8f53d8cf2..68655d202 100644 --- a/services/API-service/src/api/country/country-disaster.entity.ts +++ b/services/API-service/src/api/country/country-disaster.entity.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { Column, Entity, @@ -8,6 +9,7 @@ import { ManyToOne, PrimaryGeneratedColumn, } from 'typeorm'; + import { DisasterType } from '../disaster/disaster-type.enum'; import { DisasterEntity } from '../disaster/disaster.entity'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; diff --git a/services/API-service/src/api/country/country.controller.ts b/services/API-service/src/api/country/country.controller.ts index 85dec28eb..f713ea67b 100644 --- a/services/API-service/src/api/country/country.controller.ts +++ b/services/API-service/src/api/country/country.controller.ts @@ -6,12 +6,13 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; -import { NotificationInfoDto } from './dto/notification-info.dto'; import { UserRole } from '../user/user-role.enum'; import { CountryEntity } from './country.entity'; import { CountryService } from './country.service'; import { AddCountriesDto } from './dto/add-countries.dto'; +import { NotificationInfoDto } from './dto/notification-info.dto'; @ApiBearerAuth() @ApiTags('country') diff --git a/services/API-service/src/api/country/country.entity.ts b/services/API-service/src/api/country/country.entity.ts index 2b42542e6..85e4f75b1 100644 --- a/services/API-service/src/api/country/country.entity.ts +++ b/services/API-service/src/api/country/country.entity.ts @@ -1,3 +1,5 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { Column, Entity, @@ -7,11 +9,11 @@ import { OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; + import { BoundingBox } from '../../shared/geo.model'; -import { UserEntity } from '../user/user.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; import { NotificationInfoEntity } from '../notification/notifcation-info.entity'; -import { ApiProperty } from '@nestjs/swagger'; +import { UserEntity } from '../user/user.entity'; import { CountryDisasterSettingsEntity } from './country-disaster.entity'; @Entity('country') diff --git a/services/API-service/src/api/country/country.module.ts b/services/API-service/src/api/country/country.module.ts index e3e94e2fd..f0850e486 100644 --- a/services/API-service/src/api/country/country.module.ts +++ b/services/API-service/src/api/country/country.module.ts @@ -1,5 +1,7 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { DisasterEntity } from '../disaster/disaster.entity'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; import { NotificationInfoEntity } from '../notification/notifcation-info.entity'; @@ -8,7 +10,6 @@ import { CountryDisasterSettingsEntity } from './country-disaster.entity'; import { CountryController } from './country.controller'; import { CountryEntity } from './country.entity'; import { CountryService } from './country.service'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/country/country.service.ts b/services/API-service/src/api/country/country.service.ts index ffb6a04a1..8d96324e2 100644 --- a/services/API-service/src/api/country/country.service.ts +++ b/services/API-service/src/api/country/country.service.ts @@ -1,10 +1,12 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { In, Repository } from 'typeorm'; + import { DisasterType } from '../disaster/disaster-type.enum'; import { DisasterEntity } from '../disaster/disaster.entity'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; -import { NotificationInfoDto } from './dto/notification-info.dto'; +import { NotificationInfoEntity } from '../notification/notifcation-info.entity'; import { AdminLevel } from './admin-level.enum'; import { CountryDisasterSettingsEntity } from './country-disaster.entity'; import { CountryEntity } from './country.entity'; @@ -13,7 +15,7 @@ import { CountryDisasterSettingsDto, CountryDto, } from './dto/add-countries.dto'; -import { NotificationInfoEntity } from '../notification/notifcation-info.entity'; +import { NotificationInfoDto } from './dto/notification-info.dto'; @Injectable() export class CountryService { diff --git a/services/API-service/src/api/country/dto/add-countries.dto.ts b/services/API-service/src/api/country/dto/add-countries.dto.ts index 52adfd06d..5ff0f9879 100644 --- a/services/API-service/src/api/country/dto/add-countries.dto.ts +++ b/services/API-service/src/api/country/dto/add-countries.dto.ts @@ -1,5 +1,7 @@ -import { IsNotEmpty } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; + +import { IsNotEmpty } from 'class-validator'; + import { BoundingBox } from '../../../shared/geo.model'; import { DisasterType } from '../../disaster/disaster-type.enum'; import { AdminLevel } from '../admin-level.enum'; diff --git a/services/API-service/src/api/country/dto/notification-info.dto.ts b/services/API-service/src/api/country/dto/notification-info.dto.ts index bd27c5d29..8374168d6 100644 --- a/services/API-service/src/api/country/dto/notification-info.dto.ts +++ b/services/API-service/src/api/country/dto/notification-info.dto.ts @@ -1,6 +1,7 @@ -import { IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsOptional, IsString } from 'class-validator'; + export class NotificationInfoDto { @ApiProperty() @IsString() diff --git a/services/API-service/src/api/disaster/disaster.entity.ts b/services/API-service/src/api/disaster/disaster.entity.ts index cda1131a4..b648e2a53 100644 --- a/services/API-service/src/api/disaster/disaster.entity.ts +++ b/services/API-service/src/api/disaster/disaster.entity.ts @@ -1,4 +1,5 @@ -import { CountryEntity } from './../country/country.entity'; +import { ApiProperty } from '@nestjs/swagger'; + import { Column, Entity, @@ -6,13 +7,14 @@ import { ManyToMany, PrimaryGeneratedColumn, } from 'typeorm'; -import { DisasterType } from './disaster-type.enum'; -import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime, LeadTimeUnit, } from '../admin-area-dynamic-data/enum/lead-time.enum'; import { UserEntity } from '../user/user.entity'; +import { CountryEntity } from './../country/country.entity'; +import { DisasterType } from './disaster-type.enum'; @Entity('disaster') export class DisasterEntity { diff --git a/services/API-service/src/api/eap-actions/area-of-focus.entity.ts b/services/API-service/src/api/eap-actions/area-of-focus.entity.ts index fc097d256..2e1cf58a1 100644 --- a/services/API-service/src/api/eap-actions/area-of-focus.entity.ts +++ b/services/API-service/src/api/eap-actions/area-of-focus.entity.ts @@ -1,5 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; -import { Entity, Column, OneToMany, PrimaryColumn } from 'typeorm'; + +import { Column, Entity, OneToMany, PrimaryColumn } from 'typeorm'; + import { EapActionEntity } from './eap-action.entity'; @Entity('area-of-focus') diff --git a/services/API-service/src/api/eap-actions/dto/check-eap-action.dto.ts b/services/API-service/src/api/eap-actions/dto/check-eap-action.dto.ts index 0e65837a1..52afc0877 100644 --- a/services/API-service/src/api/eap-actions/dto/check-eap-action.dto.ts +++ b/services/API-service/src/api/eap-actions/dto/check-eap-action.dto.ts @@ -1,6 +1,7 @@ -import { IsBoolean, IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsBoolean, IsNotEmpty, IsString } from 'class-validator'; + export class CheckEapActionDto { @ApiProperty() @IsNotEmpty() diff --git a/services/API-service/src/api/eap-actions/dto/eap-action.dto.ts b/services/API-service/src/api/eap-actions/dto/eap-action.dto.ts index 11f9f4c63..8c8ae807c 100644 --- a/services/API-service/src/api/eap-actions/dto/eap-action.dto.ts +++ b/services/API-service/src/api/eap-actions/dto/eap-action.dto.ts @@ -1,7 +1,9 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; -import { AreaOfFocusEntity } from '../area-of-focus.entity'; + +import { IsNotEmpty, IsString } from 'class-validator'; + import { DisasterType } from '../../disaster/disaster-type.enum'; +import { AreaOfFocusEntity } from '../area-of-focus.entity'; class EapActionDto { @ApiProperty({ example: 'UGA' }) diff --git a/services/API-service/src/api/eap-actions/eap-action-status.entity.ts b/services/API-service/src/api/eap-actions/eap-action-status.entity.ts index 5b7ef3a11..ac934d15d 100644 --- a/services/API-service/src/api/eap-actions/eap-action-status.entity.ts +++ b/services/API-service/src/api/eap-actions/eap-action-status.entity.ts @@ -1,11 +1,13 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, + Entity, Index, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; import { UserEntity } from '../user/user.entity'; import { EapActionEntity } from './eap-action.entity'; diff --git a/services/API-service/src/api/eap-actions/eap-action.entity.ts b/services/API-service/src/api/eap-actions/eap-action.entity.ts index ab70d6749..51ac4442b 100644 --- a/services/API-service/src/api/eap-actions/eap-action.entity.ts +++ b/services/API-service/src/api/eap-actions/eap-action.entity.ts @@ -1,11 +1,12 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - OneToMany, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + OneToMany, + PrimaryGeneratedColumn, } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; import { AreaOfFocusEntity } from './area-of-focus.entity'; diff --git a/services/API-service/src/api/eap-actions/eap-actions.controller.ts b/services/API-service/src/api/eap-actions/eap-actions.controller.ts index ae535b920..155f3348a 100644 --- a/services/API-service/src/api/eap-actions/eap-actions.controller.ts +++ b/services/API-service/src/api/eap-actions/eap-actions.controller.ts @@ -1,6 +1,4 @@ -import { Controller, Post, Body, Get, UseGuards, Param } from '@nestjs/common'; -import { EapAction, EapActionsService } from './eap-actions.service'; -import { UserDecorator } from '../user/user.decorator'; +import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, @@ -8,15 +6,18 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; -import { CheckEapActionDto } from './dto/check-eap-action.dto'; -import { EapActionStatusEntity } from './eap-action-status.entity'; -import { AreaOfFocusEntity } from './area-of-focus.entity'; -import { RolesGuard } from '../../roles.guard'; + import { Roles } from '../../roles.decorator'; +import { RolesGuard } from '../../roles.guard'; +import { DisasterType } from '../disaster/disaster-type.enum'; import { UserRole } from '../user/user-role.enum'; -import { EapActionEntity } from './eap-action.entity'; +import { UserDecorator } from '../user/user.decorator'; +import { AreaOfFocusEntity } from './area-of-focus.entity'; +import { CheckEapActionDto } from './dto/check-eap-action.dto'; import { AddEapActionsDto } from './dto/eap-action.dto'; -import { DisasterType } from '../disaster/disaster-type.enum'; +import { EapActionStatusEntity } from './eap-action-status.entity'; +import { EapActionEntity } from './eap-action.entity'; +import { EapAction, EapActionsService } from './eap-actions.service'; @ApiBearerAuth() @ApiTags('eap-actions') diff --git a/services/API-service/src/api/eap-actions/eap-actions.module.ts b/services/API-service/src/api/eap-actions/eap-actions.module.ts index 74cb74192..b9e19d453 100644 --- a/services/API-service/src/api/eap-actions/eap-actions.module.ts +++ b/services/API-service/src/api/eap-actions/eap-actions.module.ts @@ -1,17 +1,18 @@ -import { CountryEntity } from './../country/country.entity'; -import { TriggerPerLeadTime } from '../event/trigger-per-lead-time.entity'; +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + +import { AdminAreaEntity } from '../admin-area/admin-area.entity'; +import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; +import { TriggerPerLeadTime } from '../event/trigger-per-lead-time.entity'; import { UserEntity } from '../user/user.entity'; import { UserModule } from '../user/user.module'; -import { EapActionEntity } from './eap-action.entity'; +import { CountryEntity } from './../country/country.entity'; +import { AreaOfFocusEntity } from './area-of-focus.entity'; import { EapActionStatusEntity } from './eap-action-status.entity'; +import { EapActionEntity } from './eap-action.entity'; import { EapActionsController } from './eap-actions.controller'; import { EapActionsService } from './eap-actions.service'; -import { AreaOfFocusEntity } from './area-of-focus.entity'; -import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; -import { AdminAreaEntity } from '../admin-area/admin-area.entity'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/eap-actions/eap-actions.service.ts b/services/API-service/src/api/eap-actions/eap-actions.service.ts index f3f43c1ee..79853bd17 100644 --- a/services/API-service/src/api/eap-actions/eap-actions.service.ts +++ b/services/API-service/src/api/eap-actions/eap-actions.service.ts @@ -1,15 +1,17 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { UserEntity } from '../user/user.entity'; + import { In, IsNull, Repository } from 'typeorm'; -import { EapActionEntity } from './eap-action.entity'; -import { EapActionStatusEntity } from './eap-action-status.entity'; -import { CheckEapActionDto } from './dto/check-eap-action.dto'; -import { AreaOfFocusEntity } from './area-of-focus.entity'; -import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; + import { AdminAreaEntity } from '../admin-area/admin-area.entity'; -import { AddEapActionsDto } from './dto/eap-action.dto'; import { DisasterType } from '../disaster/disaster-type.enum'; +import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; +import { UserEntity } from '../user/user.entity'; +import { AreaOfFocusEntity } from './area-of-focus.entity'; +import { CheckEapActionDto } from './dto/check-eap-action.dto'; +import { AddEapActionsDto } from './dto/eap-action.dto'; +import { EapActionStatusEntity } from './eap-action-status.entity'; +import { EapActionEntity } from './eap-action.entity'; export interface EapAction { Early_action: string; diff --git a/services/API-service/src/api/event/dto/event-place-code.dto.ts b/services/API-service/src/api/event/dto/event-place-code.dto.ts index c3b3dd32e..f41b79a73 100644 --- a/services/API-service/src/api/event/dto/event-place-code.dto.ts +++ b/services/API-service/src/api/event/dto/event-place-code.dto.ts @@ -1,7 +1,9 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; -import { DisasterType } from '../../disaster/disaster-type.enum'; + +import { IsNotEmpty, IsString } from 'class-validator'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; +import { DisasterType } from '../../disaster/disaster-type.enum'; export class AffectedAreaDto { public placeCode: string; diff --git a/services/API-service/src/api/event/dto/trigger-per-leadtime.dto.ts b/services/API-service/src/api/event/dto/trigger-per-leadtime.dto.ts index 1553d4901..1aa1fe456 100644 --- a/services/API-service/src/api/event/dto/trigger-per-leadtime.dto.ts +++ b/services/API-service/src/api/event/dto/trigger-per-leadtime.dto.ts @@ -1,5 +1,7 @@ -import { IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; + +import { IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; export class TriggerPerLeadTimeDto { diff --git a/services/API-service/src/api/event/dto/upload-trigger-per-leadtime.dto.ts b/services/API-service/src/api/event/dto/upload-trigger-per-leadtime.dto.ts index 93d99aafb..487b0a171 100644 --- a/services/API-service/src/api/event/dto/upload-trigger-per-leadtime.dto.ts +++ b/services/API-service/src/api/event/dto/upload-trigger-per-leadtime.dto.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsEnum, @@ -6,11 +9,10 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; -import { Type } from 'class-transformer'; -import { TriggerPerLeadTimeDto } from './trigger-per-leadtime.dto'; -import triggers from './example/triggers-per-leadtime-UGA-triggered.json'; + import { DisasterType } from '../../disaster/disaster-type.enum'; +import triggers from './example/triggers-per-leadtime-UGA-triggered.json'; +import { TriggerPerLeadTimeDto } from './trigger-per-leadtime.dto'; export class UploadTriggerPerLeadTimeDto { @ApiProperty({ example: 'UGA' }) diff --git a/services/API-service/src/api/event/event-map-image.entity.ts b/services/API-service/src/api/event/event-map-image.entity.ts index 36c0f1587..1052b0000 100644 --- a/services/API-service/src/api/event/event-map-image.entity.ts +++ b/services/API-service/src/api/event/event-map-image.entity.ts @@ -1,11 +1,13 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, Column, - PrimaryGeneratedColumn, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; import { DisasterType } from '../disaster/disaster-type.enum'; import { DisasterEntity } from '../disaster/disaster.entity'; diff --git a/services/API-service/src/api/event/event-place-code.entity.ts b/services/API-service/src/api/event/event-place-code.entity.ts index ca3a7561a..bef237b0a 100644 --- a/services/API-service/src/api/event/event-place-code.entity.ts +++ b/services/API-service/src/api/event/event-place-code.entity.ts @@ -1,13 +1,14 @@ import { - Entity, - Column, Check, - PrimaryGeneratedColumn, + Column, + Entity, + JoinColumn, JoinTable, - OneToMany, ManyToOne, - JoinColumn, + OneToMany, + PrimaryGeneratedColumn, } from 'typeorm'; + import { AdminAreaEntity } from '../admin-area/admin-area.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; import { EapActionStatusEntity } from '../eap-actions/eap-action-status.entity'; diff --git a/services/API-service/src/api/event/event.controller.ts b/services/API-service/src/api/event/event.controller.ts index 539107eeb..990cc1cb4 100644 --- a/services/API-service/src/api/event/event.controller.ts +++ b/services/API-service/src/api/event/event.controller.ts @@ -1,8 +1,4 @@ -import { - ActivationLogDto, - EventPlaceCodeDto, -} from './dto/event-place-code.dto'; -import { EventService } from './event.service'; +import stream from 'stream'; import { Body, Controller, @@ -17,6 +13,7 @@ import { UseGuards, UseInterceptors, } from '@nestjs/common'; +import { FileInterceptor } from '@nestjs/platform-express'; import { ApiBearerAuth, ApiBody, @@ -27,18 +24,23 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + +import { Response } from 'express-serve-static-core'; + +import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; -import { UploadTriggerPerLeadTimeDto } from './dto/upload-trigger-per-leadtime.dto'; import { EventSummaryCountry, TriggeredArea } from '../../shared/data.model'; -import { DateDto, TriggerPerLeadTimeExampleDto } from './dto/date.dto'; -import { Roles } from '../../roles.decorator'; -import { UserRole } from '../user/user-role.enum'; -import { UserDecorator } from '../user/user.decorator'; -import { FileInterceptor } from '@nestjs/platform-express'; -import stream from 'stream'; -import { Response } from 'express-serve-static-core'; import { IMAGE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; import { SendNotificationDto } from '../notification/dto/send-notification.dto'; +import { UserRole } from '../user/user-role.enum'; +import { UserDecorator } from '../user/user.decorator'; +import { DateDto, TriggerPerLeadTimeExampleDto } from './dto/date.dto'; +import { + ActivationLogDto, + EventPlaceCodeDto, +} from './dto/event-place-code.dto'; +import { UploadTriggerPerLeadTimeDto } from './dto/upload-trigger-per-leadtime.dto'; +import { EventService } from './event.service'; @ApiBearerAuth() @ApiTags('event') diff --git a/services/API-service/src/api/event/event.module.ts b/services/API-service/src/api/event/event.module.ts index 52ab2aeb9..633c42cc8 100644 --- a/services/API-service/src/api/event/event.module.ts +++ b/services/API-service/src/api/event/event.module.ts @@ -1,20 +1,21 @@ -import { EapActionsModule } from './../eap-actions/eap-actions.module'; -import { CountryModule } from './../country/country.module'; -import { EventPlaceCodeEntity } from './event-place-code.entity'; -import { UserModule } from './../user/user.module'; import { Module } from '@nestjs/common'; -import { EventController } from './event.controller'; -import { EventService } from './event.service'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { TriggerPerLeadTime } from './trigger-per-lead-time.entity'; + +import { HelperService } from '../../shared/helper.service'; import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { AdminAreaEntity } from '../admin-area/admin-area.entity'; +import { CountryEntity } from '../country/country.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; -import { HelperService } from '../../shared/helper.service'; +import { TyphoonTrackModule } from '../typhoon-track/typhoon-track.module'; import { UserEntity } from '../user/user.entity'; +import { CountryModule } from './../country/country.module'; +import { EapActionsModule } from './../eap-actions/eap-actions.module'; +import { UserModule } from './../user/user.module'; import { EventMapImageEntity } from './event-map-image.entity'; -import { TyphoonTrackModule } from '../typhoon-track/typhoon-track.module'; -import { CountryEntity } from '../country/country.entity'; +import { EventPlaceCodeEntity } from './event-place-code.entity'; +import { EventController } from './event.controller'; +import { EventService } from './event.service'; +import { TriggerPerLeadTime } from './trigger-per-lead-time.entity'; @Module({ imports: [ diff --git a/services/API-service/src/api/event/event.service.ts b/services/API-service/src/api/event/event.service.ts index a2b615fb3..c016e676b 100644 --- a/services/API-service/src/api/event/event.service.ts +++ b/services/API-service/src/api/event/event.service.ts @@ -1,43 +1,45 @@ -import { EapActionsService } from './../eap-actions/eap-actions.service'; -import { AdminAreaDynamicDataEntity } from './../admin-area-dynamic-data/admin-area-dynamic-data.entity'; -import { EventPlaceCodeEntity } from './event-place-code.entity'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; + +import { subDays } from 'date-fns'; import { - ActivationLogDto, - AffectedAreaDto, - EventPlaceCodeDto, -} from './dto/event-place-code.dto'; -import { + DataSource, + In, + IsNull, LessThan, + MoreThan, MoreThanOrEqual, Repository, - In, - MoreThan, - IsNull, - DataSource, SelectQueryBuilder, } from 'typeorm'; -import { InjectRepository } from '@nestjs/typeorm'; -import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; -import { UploadTriggerPerLeadTimeDto } from './dto/upload-trigger-per-leadtime.dto'; -import { TriggerPerLeadTime } from './trigger-per-lead-time.entity'; import { DisasterSpecificProperties, EventSummaryCountry, TriggeredArea, } from '../../shared/data.model'; +import { HelperService } from '../../shared/helper.service'; +import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; import { AdminAreaEntity } from '../admin-area/admin-area.entity'; -import { DateDto } from './dto/date.dto'; -import { TriggerPerLeadTimeDto } from './dto/trigger-per-leadtime.dto'; +import { CountryDisasterSettingsEntity } from '../country/country-disaster.entity'; +import { CountryEntity } from '../country/country.entity'; import { DisasterType } from '../disaster/disaster-type.enum'; import { DisasterEntity } from '../disaster/disaster.entity'; -import { HelperService } from '../../shared/helper.service'; +import { TyphoonTrackService } from '../typhoon-track/typhoon-track.service'; import { UserEntity } from '../user/user.entity'; +import { AdminAreaDynamicDataEntity } from './../admin-area-dynamic-data/admin-area-dynamic-data.entity'; +import { EapActionsService } from './../eap-actions/eap-actions.service'; +import { DateDto } from './dto/date.dto'; +import { + ActivationLogDto, + AffectedAreaDto, + EventPlaceCodeDto, +} from './dto/event-place-code.dto'; +import { TriggerPerLeadTimeDto } from './dto/trigger-per-leadtime.dto'; +import { UploadTriggerPerLeadTimeDto } from './dto/upload-trigger-per-leadtime.dto'; import { EventMapImageEntity } from './event-map-image.entity'; -import { TyphoonTrackService } from '../typhoon-track/typhoon-track.service'; -import { CountryEntity } from '../country/country.entity'; -import { CountryDisasterSettingsEntity } from '../country/country-disaster.entity'; +import { EventPlaceCodeEntity } from './event-place-code.entity'; +import { TriggerPerLeadTime } from './trigger-per-lead-time.entity'; @Injectable() export class EventService { @@ -89,7 +91,7 @@ export class EventService { ): Promise { const adminAreaIds = await this.getCountryAdminAreaIds(countryCodeISO3); - const sixDaysAgo = new Date(Date.now() - 6 * 24 * 60 * 60 * 1000); + const sixDaysAgo = subDays(new Date(), 6); const eventSummaryQueryBuilder = this.createEventSummaryQueryBuilder( countryCodeISO3, ) diff --git a/services/API-service/src/api/event/trigger-per-lead-time.entity.ts b/services/API-service/src/api/event/trigger-per-lead-time.entity.ts index ef3eeee88..778baaf76 100644 --- a/services/API-service/src/api/event/trigger-per-lead-time.entity.ts +++ b/services/API-service/src/api/event/trigger-per-lead-time.entity.ts @@ -1,10 +1,11 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; import { CountryEntity } from '../country/country.entity'; import { DisasterEntity } from '../disaster/disaster.entity'; diff --git a/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts b/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts index 1cdc7b59c..7c7bceed0 100644 --- a/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts +++ b/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts @@ -1,3 +1,5 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { IsIn, IsNotEmpty, @@ -5,7 +7,7 @@ import { IsOptional, IsString, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; + import { EapAlertClassKeyEnum } from '../../../shared/data.model'; export class GlofasStationForecastDto { diff --git a/services/API-service/src/api/glofas-station/dto/upload-station.dto.ts b/services/API-service/src/api/glofas-station/dto/upload-station.dto.ts index 4e296ad43..41ec3ef93 100644 --- a/services/API-service/src/api/glofas-station/dto/upload-station.dto.ts +++ b/services/API-service/src/api/glofas-station/dto/upload-station.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class UploadStationDto { @ApiProperty({ example: 'G1374' }) @IsNotEmpty() diff --git a/services/API-service/src/api/glofas-station/dto/upload-trigger-per-station.ts b/services/API-service/src/api/glofas-station/dto/upload-trigger-per-station.ts index 55f0f244a..6229d388d 100644 --- a/services/API-service/src/api/glofas-station/dto/upload-trigger-per-station.ts +++ b/services/API-service/src/api/glofas-station/dto/upload-trigger-per-station.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsNotEmpty, @@ -5,11 +8,10 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; -import { Type } from 'class-transformer'; -import { GlofasStationForecastDto } from './station-forecast.dto'; import stations from '../../point-data/dto/example/glofas-stations/glofas-stations-UGA-triggered.json'; +import { GlofasStationForecastDto } from './station-forecast.dto'; export class UploadTriggerPerStationDto { @ApiProperty({ example: 'UGA' }) diff --git a/services/API-service/src/api/glofas-station/glofas-station.controller.ts b/services/API-service/src/api/glofas-station/glofas-station.controller.ts index 50c2d3b13..6a54db489 100644 --- a/services/API-service/src/api/glofas-station/glofas-station.controller.ts +++ b/services/API-service/src/api/glofas-station/glofas-station.controller.ts @@ -6,6 +6,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; import { UserRole } from '../user/user-role.enum'; diff --git a/services/API-service/src/api/glofas-station/glofas-station.module.ts b/services/API-service/src/api/glofas-station/glofas-station.module.ts index b4e05210f..3b5c76086 100644 --- a/services/API-service/src/api/glofas-station/glofas-station.module.ts +++ b/services/API-service/src/api/glofas-station/glofas-station.module.ts @@ -1,15 +1,16 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; import { AdminAreaDynamicDataEntity } from '../admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { AdminAreaEntity } from '../admin-area/admin-area.entity'; import { CountryEntity } from '../country/country.entity'; import { EventModule } from '../event/event.module'; +import { PointDataModule } from '../point-data/point-data.module'; import { UserModule } from '../user/user.module'; import { GlofasStationController } from './glofas-station.controller'; import { GlofasStationService } from './glofas-station.service'; -import { HttpModule } from '@nestjs/axios'; -import { PointDataModule } from '../point-data/point-data.module'; @Module({ imports: [ diff --git a/services/API-service/src/api/glofas-station/glofas-station.service.ts b/services/API-service/src/api/glofas-station/glofas-station.service.ts index dd7f407cf..bfd264f0b 100644 --- a/services/API-service/src/api/glofas-station/glofas-station.service.ts +++ b/services/API-service/src/api/glofas-station/glofas-station.service.ts @@ -1,12 +1,14 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { Repository } from 'typeorm'; -import { UploadTriggerPerStationDto } from './dto/upload-trigger-per-station'; -import { DisasterType } from '../disaster/disaster-type.enum'; + import { CountryEntity } from '../country/country.entity'; -import { PointDataService } from '../point-data/point-data.service'; +import { DisasterType } from '../disaster/disaster-type.enum'; import { UploadDynamicPointDataDto } from '../point-data/dto/upload-asset-exposure-status.dto'; import { PointDataEnum } from '../point-data/point-data.entity'; +import { PointDataService } from '../point-data/point-data.service'; +import { UploadTriggerPerStationDto } from './dto/upload-trigger-per-station'; @Injectable() export class GlofasStationService { diff --git a/services/API-service/src/api/lead-time/lead-time.entity.ts b/services/API-service/src/api/lead-time/lead-time.entity.ts index f374b78ce..a14e29b1b 100644 --- a/services/API-service/src/api/lead-time/lead-time.entity.ts +++ b/services/API-service/src/api/lead-time/lead-time.entity.ts @@ -1,5 +1,7 @@ -import { Entity, PrimaryGeneratedColumn, Column, ManyToMany } from 'typeorm'; +import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'; + import { CountryDisasterSettingsEntity } from '../country/country-disaster.entity'; + @Entity('lead-time') export class LeadTimeEntity { @PrimaryGeneratedColumn('uuid') diff --git a/services/API-service/src/api/lines-data/dto/upload-asset-exposure-status.dto.ts b/services/API-service/src/api/lines-data/dto/upload-asset-exposure-status.dto.ts index 6d6b352fc..dd809b37b 100644 --- a/services/API-service/src/api/lines-data/dto/upload-asset-exposure-status.dto.ts +++ b/services/API-service/src/api/lines-data/dto/upload-asset-exposure-status.dto.ts @@ -1,3 +1,5 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { IsArray, IsEnum, @@ -5,7 +7,7 @@ import { IsOptional, IsString, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; import { DisasterType } from '../../disaster/disaster-type.enum'; import { LinesDataEnum } from '../lines-data.entity'; diff --git a/services/API-service/src/api/lines-data/dto/upload-buildings.dto.ts b/services/API-service/src/api/lines-data/dto/upload-buildings.dto.ts index d9252c7d1..5d6522451 100644 --- a/services/API-service/src/api/lines-data/dto/upload-buildings.dto.ts +++ b/services/API-service/src/api/lines-data/dto/upload-buildings.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty } from 'class-validator'; + export class BuildingDto { @ApiProperty({ example: 1234 }) public fid: number = undefined; diff --git a/services/API-service/src/api/lines-data/dto/upload-roads.dto.ts b/services/API-service/src/api/lines-data/dto/upload-roads.dto.ts index 2c320678c..864510b6a 100644 --- a/services/API-service/src/api/lines-data/dto/upload-roads.dto.ts +++ b/services/API-service/src/api/lines-data/dto/upload-roads.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class RoadDto { @ApiProperty({ example: 'highway' }) @IsString() diff --git a/services/API-service/src/api/lines-data/lines-data-dynamic-status.entity.ts b/services/API-service/src/api/lines-data/lines-data-dynamic-status.entity.ts index 7b50870ca..2317dbed4 100644 --- a/services/API-service/src/api/lines-data/lines-data-dynamic-status.entity.ts +++ b/services/API-service/src/api/lines-data/lines-data-dynamic-status.entity.ts @@ -1,12 +1,14 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, + Entity, + Index, JoinColumn, ManyToOne, - Index, + PrimaryGeneratedColumn, } from 'typeorm'; + import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; import { LinesDataEntity } from './lines-data.entity'; diff --git a/services/API-service/src/api/lines-data/lines-data-views.entity.ts b/services/API-service/src/api/lines-data/lines-data-views.entity.ts index 7f7bbf506..7b82e0a23 100644 --- a/services/API-service/src/api/lines-data/lines-data-views.entity.ts +++ b/services/API-service/src/api/lines-data/lines-data-views.entity.ts @@ -1,7 +1,8 @@ import { ViewEntity } from 'typeorm'; -import { LinesDataEntity, LinesDataEnum } from './lines-data.entity'; -import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; + import { AppDataSource } from '../../../appdatasource'; +import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; +import { LinesDataEntity, LinesDataEnum } from './lines-data.entity'; const getViewQuery = (type: LinesDataEnum) => { return () => diff --git a/services/API-service/src/api/lines-data/lines-data.controller.ts b/services/API-service/src/api/lines-data/lines-data.controller.ts index e9e2e5bed..bba97c730 100644 --- a/services/API-service/src/api/lines-data/lines-data.controller.ts +++ b/services/API-service/src/api/lines-data/lines-data.controller.ts @@ -17,12 +17,13 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; +import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; import { UserRole } from '../user/user-role.enum'; -import { LinesDataService } from './lines-data.service'; import { UploadLinesExposureStatusDto } from './dto/upload-asset-exposure-status.dto'; -import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; +import { LinesDataService } from './lines-data.service'; @ApiBearerAuth() @ApiTags('lines-data') diff --git a/services/API-service/src/api/lines-data/lines-data.entity.ts b/services/API-service/src/api/lines-data/lines-data.entity.ts index 416386ce2..66ffbf8ea 100644 --- a/services/API-service/src/api/lines-data/lines-data.entity.ts +++ b/services/API-service/src/api/lines-data/lines-data.entity.ts @@ -1,9 +1,9 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - Index, + Entity, Geometry, + Index, + PrimaryGeneratedColumn, } from 'typeorm'; export enum LinesDataEnum { diff --git a/services/API-service/src/api/lines-data/lines-data.module.ts b/services/API-service/src/api/lines-data/lines-data.module.ts index a16a0e0ec..36c72f55a 100644 --- a/services/API-service/src/api/lines-data/lines-data.module.ts +++ b/services/API-service/src/api/lines-data/lines-data.module.ts @@ -1,12 +1,13 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; import { UserModule } from '../user/user.module'; +import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; import { LinesDataController } from './lines-data.controller'; import { LinesDataEntity } from './lines-data.entity'; import { LinesDataService } from './lines-data.service'; -import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/lines-data/lines-data.service.ts b/services/API-service/src/api/lines-data/lines-data.service.ts index f52ee6375..d468d0720 100644 --- a/services/API-service/src/api/lines-data/lines-data.service.ts +++ b/services/API-service/src/api/lines-data/lines-data.service.ts @@ -1,12 +1,14 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { HelperService } from '../../shared/helper.service'; + import { MoreThanOrEqual, Repository } from 'typeorm'; -import { LinesDataEntity, LinesDataEnum } from './lines-data.entity'; -import { RoadDto } from './dto/upload-roads.dto'; + +import { HelperService } from '../../shared/helper.service'; import { UploadLinesExposureStatusDto } from './dto/upload-asset-exposure-status.dto'; -import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; import { BuildingDto } from './dto/upload-buildings.dto'; +import { RoadDto } from './dto/upload-roads.dto'; +import { LinesDataDynamicStatusEntity } from './lines-data-dynamic-status.entity'; +import { LinesDataEntity, LinesDataEnum } from './lines-data.entity'; @Injectable() export class LinesDataService { diff --git a/services/API-service/src/api/metadata/dto/add-indicators.dto.ts b/services/API-service/src/api/metadata/dto/add-indicators.dto.ts index f975c0b9e..e0029e2d2 100644 --- a/services/API-service/src/api/metadata/dto/add-indicators.dto.ts +++ b/services/API-service/src/api/metadata/dto/add-indicators.dto.ts @@ -1,3 +1,5 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { IsBoolean, IsIn, @@ -5,7 +7,6 @@ import { IsNumber, IsString, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; export class IndicatorDto { @ApiProperty({ diff --git a/services/API-service/src/api/metadata/dto/add-layers.dto.ts b/services/API-service/src/api/metadata/dto/add-layers.dto.ts index 72d048578..0abac94a5 100644 --- a/services/API-service/src/api/metadata/dto/add-layers.dto.ts +++ b/services/API-service/src/api/metadata/dto/add-layers.dto.ts @@ -1,5 +1,7 @@ -import { IsBoolean, IsEnum, IsIn, IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; + +import { IsBoolean, IsEnum, IsIn, IsNotEmpty, IsString } from 'class-validator'; + import { DisasterType } from '../../disaster/disaster-type.enum'; export class LayerDto { diff --git a/services/API-service/src/api/metadata/indicator-metadata.entity.ts b/services/API-service/src/api/metadata/indicator-metadata.entity.ts index 413cea53d..ce8ab7512 100644 --- a/services/API-service/src/api/metadata/indicator-metadata.entity.ts +++ b/services/API-service/src/api/metadata/indicator-metadata.entity.ts @@ -1,5 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; -import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; + +import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; @Entity('indicator-metadata') export class IndicatorMetadataEntity { diff --git a/services/API-service/src/api/metadata/layer-metadata.entity.ts b/services/API-service/src/api/metadata/layer-metadata.entity.ts index 1f2251e01..4c021f993 100644 --- a/services/API-service/src/api/metadata/layer-metadata.entity.ts +++ b/services/API-service/src/api/metadata/layer-metadata.entity.ts @@ -1,6 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; + import { IsIn } from 'class-validator'; -import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; +import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; @Entity('layer-metadata') export class LayerMetadataEntity { diff --git a/services/API-service/src/api/metadata/metadata.controller.ts b/services/API-service/src/api/metadata/metadata.controller.ts index d97333542..42fb49c9d 100644 --- a/services/API-service/src/api/metadata/metadata.controller.ts +++ b/services/API-service/src/api/metadata/metadata.controller.ts @@ -6,6 +6,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; import { UserRole } from '../user/user-role.enum'; diff --git a/services/API-service/src/api/metadata/metadata.module.ts b/services/API-service/src/api/metadata/metadata.module.ts index 1d9cfcaad..bba7858ad 100644 --- a/services/API-service/src/api/metadata/metadata.module.ts +++ b/services/API-service/src/api/metadata/metadata.module.ts @@ -1,15 +1,16 @@ -import { CountryModule } from './../country/country.module'; +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + +import { HelperService } from '../../shared/helper.service'; +import { DisasterEntity } from '../disaster/disaster.entity'; +import { EventModule } from '../event/event.module'; import { UserModule } from '../user/user.module'; -import { MetadataController } from './metadata.controller'; +import { CountryModule } from './../country/country.module'; import { IndicatorMetadataEntity } from './indicator-metadata.entity'; -import { MetadataService } from './metadata.service'; import { LayerMetadataEntity } from './layer-metadata.entity'; -import { HelperService } from '../../shared/helper.service'; -import { EventModule } from '../event/event.module'; -import { DisasterEntity } from '../disaster/disaster.entity'; -import { HttpModule } from '@nestjs/axios'; +import { MetadataController } from './metadata.controller'; +import { MetadataService } from './metadata.service'; @Module({ imports: [ diff --git a/services/API-service/src/api/metadata/metadata.service.ts b/services/API-service/src/api/metadata/metadata.service.ts index 574f4fb11..536928b3f 100644 --- a/services/API-service/src/api/metadata/metadata.service.ts +++ b/services/API-service/src/api/metadata/metadata.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { Repository } from 'typeorm'; + import { DisasterType } from '../disaster/disaster-type.enum'; import { AddIndicatorsDto, IndicatorDto } from './dto/add-indicators.dto'; import { AddLayersDto, LayerDto } from './dto/add-layers.dto'; diff --git a/services/API-service/src/api/notification/dto/send-notification.dto.ts b/services/API-service/src/api/notification/dto/send-notification.dto.ts index 98431e8d2..2109c565a 100644 --- a/services/API-service/src/api/notification/dto/send-notification.dto.ts +++ b/services/API-service/src/api/notification/dto/send-notification.dto.ts @@ -1,7 +1,9 @@ -import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; -import { DisasterType } from '../../disaster/disaster-type.enum'; + +import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator'; + import countries from '../../../scripts/json/countries.json'; +import { DisasterType } from '../../disaster/disaster-type.enum'; export class SendNotificationDto { @ApiProperty({ example: countries.map((c) => c.countryCodeISO3).join(' | ') }) diff --git a/services/API-service/src/api/notification/email/email-template.service.ts b/services/API-service/src/api/notification/email/email-template.service.ts index 1cb38034f..86eb669cc 100644 --- a/services/API-service/src/api/notification/email/email-template.service.ts +++ b/services/API-service/src/api/notification/email/email-template.service.ts @@ -1,6 +1,9 @@ import * as fs from 'fs'; +import { Injectable } from '@nestjs/common'; + import * as ejs from 'ejs'; import * as juice from 'juice'; + import { EapAlertClassKeyEnum, EventSummaryCountry, @@ -13,7 +16,6 @@ import { NotificationDataPerEventDto, TriggerStatusLabelEnum, } from '../dto/notification-date-per-event.dto'; -import { Injectable } from '@nestjs/common'; const emailFolder = './src/api/notification/email'; const emailTemplateFolder = `${emailFolder}/html`; diff --git a/services/API-service/src/api/notification/email/email.service.ts b/services/API-service/src/api/notification/email/email.service.ts index 3cad2dad4..013008a5d 100644 --- a/services/API-service/src/api/notification/email/email.service.ts +++ b/services/API-service/src/api/notification/email/email.service.ts @@ -1,9 +1,10 @@ -import { CountryEntity } from './../../country/country.entity'; import { Injectable } from '@nestjs/common'; + import Mailchimp from 'mailchimp-api-v3'; -import { DisasterType } from '../../disaster/disaster-type.enum'; import { EventSummaryCountry } from '../../../shared/data.model'; +import { DisasterType } from '../../disaster/disaster-type.enum'; +import { CountryEntity } from './../../country/country.entity'; import { NotificationContentService } from './../notification-content/notification-content.service'; import { EmailTemplateService } from './email-template.service'; diff --git a/services/API-service/src/api/notification/lookup/lookup.module.ts b/services/API-service/src/api/notification/lookup/lookup.module.ts index c69fd6c58..62fcab6e7 100644 --- a/services/API-service/src/api/notification/lookup/lookup.module.ts +++ b/services/API-service/src/api/notification/lookup/lookup.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { LookupService } from './lookup.service'; @Module({ diff --git a/services/API-service/src/api/notification/lookup/lookup.service.ts b/services/API-service/src/api/notification/lookup/lookup.service.ts index a50a79955..6426c8c06 100644 --- a/services/API-service/src/api/notification/lookup/lookup.service.ts +++ b/services/API-service/src/api/notification/lookup/lookup.service.ts @@ -1,4 +1,5 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; + import { twilioClient } from '../whatsapp/twilio.client'; @Injectable() diff --git a/services/API-service/src/api/notification/notification-content/notification-content.module.ts b/services/API-service/src/api/notification/notification-content/notification-content.module.ts index 6369045e5..585dc94fc 100644 --- a/services/API-service/src/api/notification/notification-content/notification-content.module.ts +++ b/services/API-service/src/api/notification/notification-content/notification-content.module.ts @@ -1,5 +1,7 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + +import { HelperService } from '../../../shared/helper.service'; import { AdminAreaDataModule } from '../../admin-area-data/admin-area-data.module'; import { AdminAreaDynamicDataModule } from '../../admin-area-dynamic-data/admin-area-dynamic-data.module'; import { AdminAreaModule } from '../../admin-area/admin-area.module'; @@ -8,7 +10,6 @@ import { DisasterEntity } from '../../disaster/disaster.entity'; import { EventModule } from '../../event/event.module'; import { IndicatorMetadataEntity } from '../../metadata/indicator-metadata.entity'; import { NotificationContentService } from './notification-content.service'; -import { HelperService } from '../../../shared/helper.service'; @Module({ imports: [ diff --git a/services/API-service/src/api/notification/notification-content/notification-content.service.ts b/services/API-service/src/api/notification/notification-content/notification-content.service.ts index 7e4e25a34..e46c1524b 100644 --- a/services/API-service/src/api/notification/notification-content/notification-content.service.ts +++ b/services/API-service/src/api/notification/notification-content/notification-content.service.ts @@ -1,20 +1,22 @@ -import { CountryEntity } from '../../country/country.entity'; import { Injectable } from '@nestjs/common'; -import { EventService } from '../../event/event.service'; import { InjectRepository } from '@nestjs/typeorm'; + import { Repository } from 'typeorm'; -import { IndicatorMetadataEntity } from '../../metadata/indicator-metadata.entity'; + +import { EventSummaryCountry, TriggeredArea } from '../../../shared/data.model'; +import { HelperService } from '../../../shared/helper.service'; import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; +import { CountryEntity } from '../../country/country.entity'; import { DisasterType } from '../../disaster/disaster-type.enum'; import { DisasterEntity } from '../../disaster/disaster.entity'; -import { EventSummaryCountry, TriggeredArea } from '../../../shared/data.model'; -import { HelperService } from '../../../shared/helper.service'; +import { EventService } from '../../event/event.service'; +import { IndicatorMetadataEntity } from '../../metadata/indicator-metadata.entity'; +import { AdminAreaLabel } from '../dto/admin-area-notification-info.dto'; +import { ContentEventEmail } from '../dto/content-trigger-email.dto'; import { NotificationDataPerEventDto, TriggerStatusLabelEnum, } from '../dto/notification-date-per-event.dto'; -import { AdminAreaLabel } from '../dto/admin-area-notification-info.dto'; -import { ContentEventEmail } from '../dto/content-trigger-email.dto'; @Injectable() export class NotificationContentService { diff --git a/services/API-service/src/api/notification/notification.controller.ts b/services/API-service/src/api/notification/notification.controller.ts index e122e5b94..65b1d12a6 100644 --- a/services/API-service/src/api/notification/notification.controller.ts +++ b/services/API-service/src/api/notification/notification.controller.ts @@ -1,4 +1,3 @@ -import { NotificationService } from './notification.service'; import { Body, Controller, @@ -16,11 +15,13 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; -import { RolesGuard } from '../../roles.guard'; -import { SendNotificationDto } from './dto/send-notification.dto'; + import { Roles } from '../../roles.decorator'; +import { RolesGuard } from '../../roles.guard'; import { UserRole } from '../user/user-role.enum'; import { NotificationApiTestResponseDto } from './dto/notification-api-test-response.dto'; +import { SendNotificationDto } from './dto/send-notification.dto'; +import { NotificationService } from './notification.service'; @ApiBearerAuth() @UseGuards(RolesGuard) diff --git a/services/API-service/src/api/notification/notification.module.ts b/services/API-service/src/api/notification/notification.module.ts index 316927954..833c61d7b 100644 --- a/services/API-service/src/api/notification/notification.module.ts +++ b/services/API-service/src/api/notification/notification.module.ts @@ -1,17 +1,18 @@ -import { AdminAreaDynamicDataModule } from './../admin-area-dynamic-data/admin-area-dynamic-data.module'; -import { NotificationInfoEntity } from './notifcation-info.entity'; -import { EventModule } from './../event/event.module'; import { Module } from '@nestjs/common'; -import { UserModule } from '../user/user.module'; -import { NotificationController } from './notification.controller'; -import { NotificationService } from './notification.service'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { IndicatorMetadataEntity } from '../metadata/indicator-metadata.entity'; -import { WhatsappModule } from './whatsapp/whatsapp.module'; -import { NotificationContentModule } from './notification-content/notification-content.module'; -import { EmailService } from './email/email.service'; import { TyphoonTrackModule } from '../typhoon-track/typhoon-track.module'; +import { UserModule } from '../user/user.module'; +import { AdminAreaDynamicDataModule } from './../admin-area-dynamic-data/admin-area-dynamic-data.module'; +import { EventModule } from './../event/event.module'; import { EmailTemplateService } from './email/email-template.service'; +import { EmailService } from './email/email.service'; +import { NotificationInfoEntity } from './notifcation-info.entity'; +import { NotificationContentModule } from './notification-content/notification-content.module'; +import { NotificationController } from './notification.controller'; +import { NotificationService } from './notification.service'; +import { WhatsappModule } from './whatsapp/whatsapp.module'; @Module({ imports: [ diff --git a/services/API-service/src/api/notification/notification.service.ts b/services/API-service/src/api/notification/notification.service.ts index 0e4324125..514a03a19 100644 --- a/services/API-service/src/api/notification/notification.service.ts +++ b/services/API-service/src/api/notification/notification.service.ts @@ -1,16 +1,17 @@ import { Injectable } from '@nestjs/common'; -import { EventService } from '../event/event.service'; -import { DisasterType } from '../disaster/disaster-type.enum'; -import { WhatsappService } from './whatsapp/whatsapp.service'; -import { NotificationContentService } from './notification-content/notification-content.service'; -import { EmailService } from './email/email.service'; -import { TyphoonTrackService } from '../typhoon-track/typhoon-track.service'; + import { EventSummaryCountry } from '../../shared/data.model'; import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; +import { DisasterType } from '../disaster/disaster-type.enum'; +import { EventService } from '../event/event.service'; +import { TyphoonTrackService } from '../typhoon-track/typhoon-track.service'; import { NotificationApiTestResponseChannelDto, NotificationApiTestResponseDto, } from './dto/notification-api-test-response.dto'; +import { EmailService } from './email/email.service'; +import { NotificationContentService } from './notification-content/notification-content.service'; +import { WhatsappService } from './whatsapp/whatsapp.service'; @Injectable() export class NotificationService { diff --git a/services/API-service/src/api/notification/whatsapp/auth.middlewareTwilio.ts b/services/API-service/src/api/notification/whatsapp/auth.middlewareTwilio.ts index fbd5bdf68..7985f19c0 100644 --- a/services/API-service/src/api/notification/whatsapp/auth.middlewareTwilio.ts +++ b/services/API-service/src/api/notification/whatsapp/auth.middlewareTwilio.ts @@ -1,6 +1,8 @@ import { HttpStatus, Injectable, NestMiddleware } from '@nestjs/common'; import { HttpException } from '@nestjs/common/exceptions/http.exception'; + import { NextFunction, Request, Response } from 'express'; + import { DEBUG, EXTERNAL_API } from '../../../config'; import { twilio } from './twilio.client'; diff --git a/services/API-service/src/api/notification/whatsapp/twilio.dto.ts b/services/API-service/src/api/notification/whatsapp/twilio.dto.ts index 3b6f1bcb1..5e3acc318 100644 --- a/services/API-service/src/api/notification/whatsapp/twilio.dto.ts +++ b/services/API-service/src/api/notification/whatsapp/twilio.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { IsOptional, IsString } from 'class-validator'; export enum TwilioStatus { diff --git a/services/API-service/src/api/notification/whatsapp/whatsapp.controller.ts b/services/API-service/src/api/notification/whatsapp/whatsapp.controller.ts index 79db69d44..a067fb05e 100644 --- a/services/API-service/src/api/notification/whatsapp/whatsapp.controller.ts +++ b/services/API-service/src/api/notification/whatsapp/whatsapp.controller.ts @@ -1,5 +1,6 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiConsumes, ApiTags } from '@nestjs/swagger'; + import { SendTestWhatsappDto, TwilioIncomingCallbackDto, diff --git a/services/API-service/src/api/notification/whatsapp/whatsapp.module.ts b/services/API-service/src/api/notification/whatsapp/whatsapp.module.ts index e79653ba0..653537e2e 100644 --- a/services/API-service/src/api/notification/whatsapp/whatsapp.module.ts +++ b/services/API-service/src/api/notification/whatsapp/whatsapp.module.ts @@ -5,6 +5,7 @@ import { RequestMethod, } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { API_PATHS } from '../../../config'; import { CountryEntity } from '../../country/country.entity'; import { EventMapImageEntity } from '../../event/event-map-image.entity'; diff --git a/services/API-service/src/api/notification/whatsapp/whatsapp.service.ts b/services/API-service/src/api/notification/whatsapp/whatsapp.service.ts index 3359046c2..681ff1699 100644 --- a/services/API-service/src/api/notification/whatsapp/whatsapp.service.ts +++ b/services/API-service/src/api/notification/whatsapp/whatsapp.service.ts @@ -1,6 +1,8 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { IsNull, Not, Repository } from 'typeorm'; + import { EXTERNAL_API } from '../../../config'; import { EventSummaryCountry } from '../../../shared/data.model'; import { CountryEntity } from '../../country/country.entity'; @@ -8,6 +10,7 @@ import { DisasterType } from '../../disaster/disaster-type.enum'; import { EventMapImageEntity } from '../../event/event-map-image.entity'; import { EventService } from '../../event/event.service'; import { UserEntity } from '../../user/user.entity'; +import { formatActionUnitValue } from '../helpers/format-action-unit-value.helper'; import { LookupService } from '../lookup/lookup.service'; import { NotificationContentService } from '../notification-content/notification-content.service'; import { twilioClient } from './twilio.client'; @@ -16,7 +19,6 @@ import { TwilioStatusCallbackDto, } from './twilio.dto'; import { NotificationType, TwilioMessageEntity } from './twilio.entity'; -import { formatActionUnitValue } from '../helpers/format-action-unit-value.helper'; @Injectable() export class WhatsappService { diff --git a/services/API-service/src/api/point-data/dto/upload-asset-exposure-status.dto.ts b/services/API-service/src/api/point-data/dto/upload-asset-exposure-status.dto.ts index 031f95b1b..5f88e3e68 100644 --- a/services/API-service/src/api/point-data/dto/upload-asset-exposure-status.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-asset-exposure-status.dto.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsEnum, @@ -6,11 +9,10 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; import { DisasterType } from '../../disaster/disaster-type.enum'; import { PointDataEnum } from '../point-data.entity'; -import { Type } from 'class-transformer'; export class UploadAssetExposureStatusDto { @ApiProperty({ example: ['123', '234'] }) diff --git a/services/API-service/src/api/point-data/dto/upload-community-notifications.dto.ts b/services/API-service/src/api/point-data/dto/upload-community-notifications.dto.ts index 4be79b600..d330f62de 100644 --- a/services/API-service/src/api/point-data/dto/upload-community-notifications.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-community-notifications.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class CommunityNotificationDto { @ApiProperty({ example: 'nameVolunteer' }) @IsNotEmpty() diff --git a/services/API-service/src/api/point-data/dto/upload-dam-sites.dto.ts b/services/API-service/src/api/point-data/dto/upload-dam-sites.dto.ts index 884515095..d8880551c 100644 --- a/services/API-service/src/api/point-data/dto/upload-dam-sites.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-dam-sites.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class DamSiteDto { @ApiProperty({ example: 'name' }) @IsNotEmpty() diff --git a/services/API-service/src/api/point-data/dto/upload-evacuation-centers.dto.ts b/services/API-service/src/api/point-data/dto/upload-evacuation-centers.dto.ts index 570099bdf..ae7cf3e0c 100644 --- a/services/API-service/src/api/point-data/dto/upload-evacuation-centers.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-evacuation-centers.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { IsNotEmpty, IsString } from 'class-validator'; export class EvacuationCenterDto { diff --git a/services/API-service/src/api/point-data/dto/upload-gauge.dto.ts b/services/API-service/src/api/point-data/dto/upload-gauge.dto.ts index b64eb1c74..5f39ba5a9 100644 --- a/services/API-service/src/api/point-data/dto/upload-gauge.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-gauge.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; + export class GaugeDto { @ApiProperty({ example: 'name' }) @IsString() diff --git a/services/API-service/src/api/point-data/dto/upload-glofas-station.dto.ts b/services/API-service/src/api/point-data/dto/upload-glofas-station.dto.ts index 5df1ce898..337fe39ca 100644 --- a/services/API-service/src/api/point-data/dto/upload-glofas-station.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-glofas-station.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; + export class GlofasStationDto { @ApiProperty({ example: 'G5100' }) @IsString() diff --git a/services/API-service/src/api/point-data/dto/upload-health-sites.dto.ts b/services/API-service/src/api/point-data/dto/upload-health-sites.dto.ts index 0d109f291..45bf22447 100644 --- a/services/API-service/src/api/point-data/dto/upload-health-sites.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-health-sites.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; export class HealthSiteDto { diff --git a/services/API-service/src/api/point-data/dto/upload-red-cross-branch.dto.ts b/services/API-service/src/api/point-data/dto/upload-red-cross-branch.dto.ts index 4b9c1b2f8..cd160a223 100644 --- a/services/API-service/src/api/point-data/dto/upload-red-cross-branch.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-red-cross-branch.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; + export class RedCrossBranchDto { @ApiProperty({ example: 'branch name' }) @IsNotEmpty() diff --git a/services/API-service/src/api/point-data/dto/upload-schools.dto.ts b/services/API-service/src/api/point-data/dto/upload-schools.dto.ts index e2b1419ce..d1e1cd08b 100644 --- a/services/API-service/src/api/point-data/dto/upload-schools.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-schools.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class SchoolDto { @ApiProperty({ example: 'name' }) @IsString() diff --git a/services/API-service/src/api/point-data/dto/upload-waterpoint.dto.ts b/services/API-service/src/api/point-data/dto/upload-waterpoint.dto.ts index a98238e5a..d42a501cb 100644 --- a/services/API-service/src/api/point-data/dto/upload-waterpoint.dto.ts +++ b/services/API-service/src/api/point-data/dto/upload-waterpoint.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString } from 'class-validator'; + export class WaterpointDto { @ApiProperty({ example: 'name' }) @IsString() diff --git a/services/API-service/src/api/point-data/dynamic-point-data.entity.ts b/services/API-service/src/api/point-data/dynamic-point-data.entity.ts index b8b228b96..6b56bcde9 100644 --- a/services/API-service/src/api/point-data/dynamic-point-data.entity.ts +++ b/services/API-service/src/api/point-data/dynamic-point-data.entity.ts @@ -1,13 +1,14 @@ import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, - JoinColumn, + Entity, Index, + JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; -import { PointDataEntity } from './point-data.entity'; + import { LeadTimeEntity } from '../lead-time/lead-time.entity'; +import { PointDataEntity } from './point-data.entity'; @Entity('dynamic-point-data') export class DynamicPointDataEntity { diff --git a/services/API-service/src/api/point-data/point-data.controller.ts b/services/API-service/src/api/point-data/point-data.controller.ts index aa51421b1..884734e4d 100644 --- a/services/API-service/src/api/point-data/point-data.controller.ts +++ b/services/API-service/src/api/point-data/point-data.controller.ts @@ -21,16 +21,17 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; +import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; import { GeoJson } from '../../shared/geo.model'; import { UserRole } from '../user/user-role.enum'; -import { CommunityNotification, PointDataService } from './point-data.service'; import { UploadAssetExposureStatusDto, UploadDynamicPointDataDto, } from './dto/upload-asset-exposure-status.dto'; -import { FILE_UPLOAD_API_FORMAT } from '../../shared/file-upload-api-format'; +import { CommunityNotification, PointDataService } from './point-data.service'; @ApiBearerAuth() @ApiTags('point-data') diff --git a/services/API-service/src/api/point-data/point-data.entity.ts b/services/API-service/src/api/point-data/point-data.entity.ts index 27c87058c..cf0bb940c 100644 --- a/services/API-service/src/api/point-data/point-data.entity.ts +++ b/services/API-service/src/api/point-data/point-data.entity.ts @@ -1,4 +1,5 @@ -import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm'; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; + import { DynamicPointDataEntity } from './dynamic-point-data.entity'; export enum PointDataEnum { diff --git a/services/API-service/src/api/point-data/point-data.module.ts b/services/API-service/src/api/point-data/point-data.module.ts index d615a9994..eb97f1758 100644 --- a/services/API-service/src/api/point-data/point-data.module.ts +++ b/services/API-service/src/api/point-data/point-data.module.ts @@ -1,13 +1,14 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; import { WhatsappModule } from '../notification/whatsapp/whatsapp.module'; import { UserModule } from '../user/user.module'; +import { DynamicPointDataEntity } from './dynamic-point-data.entity'; import { PointDataController } from './point-data.controller'; import { PointDataEntity } from './point-data.entity'; import { PointDataService } from './point-data.service'; -import { HttpModule } from '@nestjs/axios'; -import { DynamicPointDataEntity } from './dynamic-point-data.entity'; @Module({ imports: [ diff --git a/services/API-service/src/api/point-data/point-data.service.ts b/services/API-service/src/api/point-data/point-data.service.ts index d08c16421..d00d8fd32 100644 --- a/services/API-service/src/api/point-data/point-data.service.ts +++ b/services/API-service/src/api/point-data/point-data.service.ts @@ -1,26 +1,28 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { validate } from 'class-validator'; +import { IsNull, MoreThanOrEqual, Repository } from 'typeorm'; + import { GeoJson } from '../../shared/geo.model'; import { HelperService } from '../../shared/helper.service'; -import { IsNull, MoreThanOrEqual, Repository } from 'typeorm'; -import { EvacuationCenterDto } from './dto/upload-evacuation-centers.dto'; -import { PointDataEntity, PointDataEnum } from './point-data.entity'; -import { DamSiteDto } from './dto/upload-dam-sites.dto'; -import { HealthSiteDto } from './dto/upload-health-sites.dto'; -import { RedCrossBranchDto } from './dto/upload-red-cross-branch.dto'; -import { CommunityNotificationDto } from './dto/upload-community-notifications.dto'; +import { DisasterType } from '../disaster/disaster-type.enum'; import { WhatsappService } from '../notification/whatsapp/whatsapp.service'; -import { SchoolDto } from './dto/upload-schools.dto'; -import { WaterpointDto } from './dto/upload-waterpoint.dto'; import { UploadAssetExposureStatusDto, UploadDynamicPointDataDto, } from './dto/upload-asset-exposure-status.dto'; -import { DisasterType } from '../disaster/disaster-type.enum'; +import { CommunityNotificationDto } from './dto/upload-community-notifications.dto'; +import { DamSiteDto } from './dto/upload-dam-sites.dto'; +import { EvacuationCenterDto } from './dto/upload-evacuation-centers.dto'; import { GaugeDto } from './dto/upload-gauge.dto'; -import { DynamicPointDataEntity } from './dynamic-point-data.entity'; import { GlofasStationDto } from './dto/upload-glofas-station.dto'; +import { HealthSiteDto } from './dto/upload-health-sites.dto'; +import { RedCrossBranchDto } from './dto/upload-red-cross-branch.dto'; +import { SchoolDto } from './dto/upload-schools.dto'; +import { WaterpointDto } from './dto/upload-waterpoint.dto'; +import { DynamicPointDataEntity } from './dynamic-point-data.entity'; +import { PointDataEntity, PointDataEnum } from './point-data.entity'; export interface CommunityNotification { nameVolunteer: string; diff --git a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.controller.ts b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.controller.ts index aaf39d3fc..a26a065f2 100644 --- a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.controller.ts +++ b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.controller.ts @@ -6,6 +6,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { RolesGuard } from '../../roles.guard'; import { RainfallTriggersEntity } from './rainfall-triggers.entity'; import { RainfallTriggersService } from './rainfall-triggers.service'; diff --git a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.entity.ts b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.entity.ts index 4a37bbc1d..a65c862a8 100644 --- a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.entity.ts +++ b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.entity.ts @@ -1,11 +1,13 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { LeadTime } from '../admin-area-dynamic-data/enum/lead-time.enum'; import { CountryEntity } from '../country/country.entity'; diff --git a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.module.ts b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.module.ts index 8417dd78e..ab54500e2 100644 --- a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.module.ts +++ b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.module.ts @@ -1,10 +1,11 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { UserModule } from '../user/user.module'; import { RainfallTriggersController } from './rainfall-triggers.controller'; import { RainfallTriggersEntity } from './rainfall-triggers.entity'; import { RainfallTriggersService } from './rainfall-triggers.service'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.service.ts b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.service.ts index 49caa6e4a..532d08dec 100644 --- a/services/API-service/src/api/rainfall-triggers/rainfall-triggers.service.ts +++ b/services/API-service/src/api/rainfall-triggers/rainfall-triggers.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { Repository } from 'typeorm'; + import { RainfallTriggersEntity } from './rainfall-triggers.entity'; @Injectable() diff --git a/services/API-service/src/api/typhoon-track/dto/trackpoint-details.ts b/services/API-service/src/api/typhoon-track/dto/trackpoint-details.ts index cd6519f34..d1ea98640 100644 --- a/services/API-service/src/api/typhoon-track/dto/trackpoint-details.ts +++ b/services/API-service/src/api/typhoon-track/dto/trackpoint-details.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsBoolean, IsDate, @@ -5,8 +8,6 @@ import { IsNotEmpty, IsNumber, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; -import { Type } from 'class-transformer'; export enum TyphoonCategory { TD = 'TD', diff --git a/services/API-service/src/api/typhoon-track/dto/upload-typhoon-track.ts b/services/API-service/src/api/typhoon-track/dto/upload-typhoon-track.ts index 2534316c9..2b0bda241 100644 --- a/services/API-service/src/api/typhoon-track/dto/upload-typhoon-track.ts +++ b/services/API-service/src/api/typhoon-track/dto/upload-typhoon-track.ts @@ -1,3 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +import { Type } from 'class-transformer'; import { IsArray, IsNotEmpty, @@ -5,9 +8,8 @@ import { IsString, ValidateNested, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime } from '../../admin-area-dynamic-data/enum/lead-time.enum'; -import { Type } from 'class-transformer'; import { TrackpointDetailsDto } from './trackpoint-details'; export class UploadTyphoonTrackDto { diff --git a/services/API-service/src/api/typhoon-track/typhoon-track.controller.ts b/services/API-service/src/api/typhoon-track/typhoon-track.controller.ts index ed02b04c3..93382493a 100644 --- a/services/API-service/src/api/typhoon-track/typhoon-track.controller.ts +++ b/services/API-service/src/api/typhoon-track/typhoon-track.controller.ts @@ -15,6 +15,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; import { GeoJson } from '../../shared/geo.model'; diff --git a/services/API-service/src/api/typhoon-track/typhoon-track.entity.ts b/services/API-service/src/api/typhoon-track/typhoon-track.entity.ts index a8511b8ac..34180fe60 100644 --- a/services/API-service/src/api/typhoon-track/typhoon-track.entity.ts +++ b/services/API-service/src/api/typhoon-track/typhoon-track.entity.ts @@ -1,11 +1,13 @@ import { ApiProperty } from '@nestjs/swagger'; + import { - Entity, - PrimaryGeneratedColumn, Column, - ManyToOne, + Entity, JoinColumn, + ManyToOne, + PrimaryGeneratedColumn, } from 'typeorm'; + import { GeoJson } from '../../shared/geo.model'; import { CountryEntity } from '../country/country.entity'; import { LeadTimeEntity } from '../lead-time/lead-time.entity'; diff --git a/services/API-service/src/api/typhoon-track/typhoon-track.module.ts b/services/API-service/src/api/typhoon-track/typhoon-track.module.ts index ed01ec32c..d21bf08a1 100644 --- a/services/API-service/src/api/typhoon-track/typhoon-track.module.ts +++ b/services/API-service/src/api/typhoon-track/typhoon-track.module.ts @@ -1,12 +1,13 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; + import { HelperService } from '../../shared/helper.service'; import { TriggerPerLeadTime } from '../event/trigger-per-lead-time.entity'; import { UserModule } from '../user/user.module'; import { TyphoonTrackController } from './typhoon-track.controller'; import { TyphoonTrackEntity } from './typhoon-track.entity'; import { TyphoonTrackService } from './typhoon-track.service'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [ diff --git a/services/API-service/src/api/typhoon-track/typhoon-track.service.ts b/services/API-service/src/api/typhoon-track/typhoon-track.service.ts index f44eff507..cd244a4f4 100644 --- a/services/API-service/src/api/typhoon-track/typhoon-track.service.ts +++ b/services/API-service/src/api/typhoon-track/typhoon-track.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; + import { InsertResult, MoreThanOrEqual, Repository } from 'typeorm'; + import { DisasterSpecificProperties } from '../../shared/data.model'; import { GeoJson } from '../../shared/geo.model'; import { HelperService } from '../../shared/helper.service'; diff --git a/services/API-service/src/api/user/dto/create-user.dto.ts b/services/API-service/src/api/user/dto/create-user.dto.ts index 658e79d3c..cdc70f851 100644 --- a/services/API-service/src/api/user/dto/create-user.dto.ts +++ b/services/API-service/src/api/user/dto/create-user.dto.ts @@ -1,3 +1,5 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { ArrayNotEmpty, IsArray, @@ -9,11 +11,11 @@ import { IsString, MinLength, } from 'class-validator'; -import { ApiProperty } from '@nestjs/swagger'; -import { UserRole } from '../user-role.enum'; -import { UserStatus } from '../user-status.enum'; + import countries from '../../../scripts/json/countries.json'; import disasterTypes from '../../../scripts/json/disasters.json'; +import { UserRole } from '../user-role.enum'; +import { UserStatus } from '../user-status.enum'; const userRoleArray = Object.values(UserRole).map((item) => String(item)); diff --git a/services/API-service/src/api/user/dto/delete-user.dto.ts b/services/API-service/src/api/user/dto/delete-user.dto.ts index 156605bc9..6607f952f 100644 --- a/services/API-service/src/api/user/dto/delete-user.dto.ts +++ b/services/API-service/src/api/user/dto/delete-user.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty } from 'class-validator'; + export class DeleteUserDto { @ApiProperty() @IsNotEmpty() diff --git a/services/API-service/src/api/user/dto/login-user.dto.ts b/services/API-service/src/api/user/dto/login-user.dto.ts index 389bf55ce..2e0128650 100644 --- a/services/API-service/src/api/user/dto/login-user.dto.ts +++ b/services/API-service/src/api/user/dto/login-user.dto.ts @@ -1,6 +1,7 @@ -import { IsEmail, IsNotEmpty, MinLength } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsEmail, IsNotEmpty, MinLength } from 'class-validator'; + export class LoginUserDto { @ApiProperty({ example: 'dunant@redcross.nl' }) @IsEmail() diff --git a/services/API-service/src/api/user/dto/update-password.dto.ts b/services/API-service/src/api/user/dto/update-password.dto.ts index 6bed76aec..508b255c5 100644 --- a/services/API-service/src/api/user/dto/update-password.dto.ts +++ b/services/API-service/src/api/user/dto/update-password.dto.ts @@ -1,6 +1,7 @@ -import { IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator'; + export class UpdatePasswordDto { @ApiProperty({ example: 'abcd' }) @IsNotEmpty() diff --git a/services/API-service/src/api/user/user.controller.ts b/services/API-service/src/api/user/user.controller.ts index cb29a5bf6..afebd1343 100644 --- a/services/API-service/src/api/user/user.controller.ts +++ b/services/API-service/src/api/user/user.controller.ts @@ -1,26 +1,27 @@ import { - Post, Body, Controller, - UsePipes, HttpStatus, + Post, UseGuards, + UsePipes, } from '@nestjs/common'; -import { UserService } from './user.service'; -import { UserResponseObject } from './user.model'; -import { CreateUserDto, LoginUserDto, UpdatePasswordDto } from './dto'; import { HttpException } from '@nestjs/common/exceptions/http.exception'; -import { ValidationPipe } from '../../shared/pipes/validation.pipe'; import { - ApiTags, ApiBearerAuth, ApiOperation, ApiResponse, + ApiTags, } from '@nestjs/swagger'; + +import { Roles } from '../../roles.decorator'; import { RolesGuard } from '../../roles.guard'; +import { ValidationPipe } from '../../shared/pipes/validation.pipe'; +import { CreateUserDto, LoginUserDto, UpdatePasswordDto } from './dto'; import { UserRole } from './user-role.enum'; -import { Roles } from '../../roles.decorator'; import { UserDecorator } from './user.decorator'; +import { UserResponseObject } from './user.model'; +import { UserService } from './user.service'; @ApiTags('-- user --') @Controller('user') diff --git a/services/API-service/src/api/user/user.decorator.ts b/services/API-service/src/api/user/user.decorator.ts index 26da13080..0e0beadf3 100644 --- a/services/API-service/src/api/user/user.decorator.ts +++ b/services/API-service/src/api/user/user.decorator.ts @@ -1,5 +1,7 @@ -import { ExecutionContext, createParamDecorator } from '@nestjs/common'; +import { createParamDecorator, ExecutionContext } from '@nestjs/common'; + import * as jwt from 'jsonwebtoken'; + import { User } from './user.model'; export const UserDecorator = createParamDecorator( diff --git a/services/API-service/src/api/user/user.entity.ts b/services/API-service/src/api/user/user.entity.ts index 78689fb18..e7de74318 100644 --- a/services/API-service/src/api/user/user.entity.ts +++ b/services/API-service/src/api/user/user.entity.ts @@ -1,20 +1,22 @@ +import crypto from 'crypto'; + import { IsEmail } from 'class-validator'; import { - Entity, - PrimaryGeneratedColumn, - Column, BeforeInsert, - OneToMany, - ManyToMany, + Column, + Entity, JoinTable, + ManyToMany, + OneToMany, + PrimaryGeneratedColumn, } from 'typeorm'; -import crypto from 'crypto'; + import { CountryEntity } from '../country/country.entity'; +import { DisasterEntity } from '../disaster/disaster.entity'; import { EapActionStatusEntity } from '../eap-actions/eap-action-status.entity'; +import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; import { UserRole } from './user-role.enum'; import { UserStatus } from './user-status.enum'; -import { EventPlaceCodeEntity } from '../event/event-place-code.entity'; -import { DisasterEntity } from '../disaster/disaster.entity'; @Entity('user') export class UserEntity { diff --git a/services/API-service/src/api/user/user.model.ts b/services/API-service/src/api/user/user.model.ts index a57c2b084..e0822aed5 100644 --- a/services/API-service/src/api/user/user.model.ts +++ b/services/API-service/src/api/user/user.model.ts @@ -1,6 +1,7 @@ +import { ApiProperty } from '@nestjs/swagger'; + import { UserRole } from './user-role.enum'; import { UserStatus } from './user-status.enum'; -import { ApiProperty } from '@nestjs/swagger'; export class User { public userId: string; diff --git a/services/API-service/src/api/user/user.module.ts b/services/API-service/src/api/user/user.module.ts index f5784cd3a..8c5018ba5 100644 --- a/services/API-service/src/api/user/user.module.ts +++ b/services/API-service/src/api/user/user.module.ts @@ -1,11 +1,12 @@ import { Module } from '@nestjs/common'; -import { UserController } from './user.controller'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { UserEntity } from './user.entity'; -import { UserService } from './user.service'; + import { CountryEntity } from '../country/country.entity'; -import { LookupModule } from '../notification/lookup/lookup.module'; import { DisasterEntity } from '../disaster/disaster.entity'; +import { LookupModule } from '../notification/lookup/lookup.module'; +import { UserController } from './user.controller'; +import { UserEntity } from './user.entity'; +import { UserService } from './user.service'; @Module({ imports: [ diff --git a/services/API-service/src/api/user/user.service.ts b/services/API-service/src/api/user/user.service.ts index 52dd269bd..3d3e6f5fd 100644 --- a/services/API-service/src/api/user/user.service.ts +++ b/services/API-service/src/api/user/user.service.ts @@ -1,18 +1,19 @@ -import { Injectable } from '@nestjs/common'; +import crypto from 'crypto'; +import { HttpStatus, Injectable } from '@nestjs/common'; +import { HttpException } from '@nestjs/common/exceptions/http.exception'; import { InjectRepository } from '@nestjs/typeorm'; -import { Repository, In } from 'typeorm'; -import { UserEntity } from './user.entity'; -import { CreateUserDto, LoginUserDto, UpdatePasswordDto } from './dto'; -import { UserResponseObject } from './user.model'; + import { validate } from 'class-validator'; -import { HttpException } from '@nestjs/common/exceptions/http.exception'; -import { HttpStatus } from '@nestjs/common'; -import crypto from 'crypto'; import jwt from 'jsonwebtoken'; +import { In, Repository } from 'typeorm'; + import { CountryEntity } from '../country/country.entity'; -import { UserRole } from './user-role.enum'; -import { LookupService } from '../notification/lookup/lookup.service'; import { DisasterEntity } from '../disaster/disaster.entity'; +import { LookupService } from '../notification/lookup/lookup.service'; +import { CreateUserDto, LoginUserDto, UpdatePasswordDto } from './dto'; +import { UserRole } from './user-role.enum'; +import { UserEntity } from './user.entity'; +import { UserResponseObject } from './user.model'; @Injectable() export class UserService { diff --git a/services/API-service/src/api/waterpoints/waterpoints.controller.ts b/services/API-service/src/api/waterpoints/waterpoints.controller.ts index 8220f5ec3..3764446ef 100644 --- a/services/API-service/src/api/waterpoints/waterpoints.controller.ts +++ b/services/API-service/src/api/waterpoints/waterpoints.controller.ts @@ -1,15 +1,17 @@ -import { Get, Param, Controller, UseGuards } from '@nestjs/common'; -import { AxiosResponse } from 'axios'; +import { Controller, Get, Param, UseGuards } from '@nestjs/common'; import { - ApiTags, + ApiBearerAuth, ApiOperation, ApiParam, - ApiBearerAuth, ApiResponse, + ApiTags, } from '@nestjs/swagger'; + +import { AxiosResponse } from 'axios'; + +import { RolesGuard } from '../../roles.guard'; import { GeoJson } from '../../shared/geo.model'; import { WaterpointsService } from './waterpoints.service'; -import { RolesGuard } from '../../roles.guard'; @ApiBearerAuth() @UseGuards(RolesGuard) diff --git a/services/API-service/src/api/waterpoints/waterpoints.module.ts b/services/API-service/src/api/waterpoints/waterpoints.module.ts index e20253c41..56720635e 100644 --- a/services/API-service/src/api/waterpoints/waterpoints.module.ts +++ b/services/API-service/src/api/waterpoints/waterpoints.module.ts @@ -1,9 +1,10 @@ +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; + import { CountryModule } from '../country/country.module'; import { UserModule } from '../user/user.module'; import { WaterpointsController } from './waterpoints.controller'; import { WaterpointsService } from './waterpoints.service'; -import { HttpModule } from '@nestjs/axios'; @Module({ imports: [HttpModule, UserModule, CountryModule], diff --git a/services/API-service/src/api/waterpoints/waterpoints.service.ts b/services/API-service/src/api/waterpoints/waterpoints.service.ts index c4ca8d656..ace8a43e5 100644 --- a/services/API-service/src/api/waterpoints/waterpoints.service.ts +++ b/services/API-service/src/api/waterpoints/waterpoints.service.ts @@ -1,10 +1,12 @@ +import { HttpService } from '@nestjs/axios'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; + import { AxiosResponse } from 'axios'; -import { WKTStringFromGeometry } from 'wkt-io-ts'; import { isRight } from 'fp-ts/lib/Either'; -import { CountryService } from '../country/country.service'; +import { WKTStringFromGeometry } from 'wkt-io-ts'; + import { GeoJson } from '../../shared/geo.model'; -import { HttpService } from '@nestjs/axios'; +import { CountryService } from '../country/country.service'; @Injectable() export class WaterpointsService { diff --git a/services/API-service/src/app.controller.ts b/services/API-service/src/app.controller.ts index a3589bd93..10c750934 100644 --- a/services/API-service/src/app.controller.ts +++ b/services/API-service/src/app.controller.ts @@ -1,10 +1,11 @@ -import { Get, Controller, UseGuards } from '@nestjs/common'; +import { Controller, Get, UseGuards } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { RolesGuard } from './roles.guard'; @ApiTags('-- check API --') diff --git a/services/API-service/src/app.module.ts b/services/API-service/src/app.module.ts index e927b7518..c5ee48b02 100644 --- a/services/API-service/src/app.module.ts +++ b/services/API-service/src/app.module.ts @@ -1,26 +1,27 @@ import { Module } from '@nestjs/common'; -import { AppController } from './app.controller'; -import { HealthModule } from './health.module'; -import { EapActionsModule } from './api/eap-actions/eap-actions.module'; -import { ScriptsModule } from './scripts/scripts.module'; +import { ScheduleModule } from '@nestjs/schedule'; + +import { AdminAreaDataModule } from './api/admin-area-data/admin-area-data.module'; +import { AdminAreaDynamicDataModule } from './api/admin-area-dynamic-data/admin-area-dynamic-data.module'; +import { AdminAreaModule } from './api/admin-area/admin-area.module'; import { CountryModule } from './api/country/country.module'; -import { WaterpointsModule } from './api/waterpoints/waterpoints.module'; +import { DisasterModule } from './api/disaster/disaster.module'; +import { EapActionsModule } from './api/eap-actions/eap-actions.module'; import { EventModule } from './api/event/event.module'; -import { MetadataModule } from './api/metadata/metadata.module'; -import { AdminAreaModule } from './api/admin-area/admin-area.module'; import { GlofasStationModule } from './api/glofas-station/glofas-station.module'; -import { AdminAreaDynamicDataModule } from './api/admin-area-dynamic-data/admin-area-dynamic-data.module'; -import { DisasterModule } from './api/disaster/disaster.module'; -import { AdminAreaDataModule } from './api/admin-area-data/admin-area-data.module'; -import { RainfallTriggersModule } from './api/rainfall-triggers/rainfall-triggers.module'; +import { LinesDataModule } from './api/lines-data/lines-data.module'; +import { MetadataModule } from './api/metadata/metadata.module'; import { NotificationModule } from './api/notification/notification.module'; -import { UserModule } from './api/user/user.module'; -import { TyphoonTrackModule } from './api/typhoon-track/typhoon-track.module'; import { WhatsappModule } from './api/notification/whatsapp/whatsapp.module'; -import { CronjobModule } from './cronjob/cronjob.module'; -import { ScheduleModule } from '@nestjs/schedule'; import { PointDataModule } from './api/point-data/point-data.module'; -import { LinesDataModule } from './api/lines-data/lines-data.module'; +import { RainfallTriggersModule } from './api/rainfall-triggers/rainfall-triggers.module'; +import { TyphoonTrackModule } from './api/typhoon-track/typhoon-track.module'; +import { UserModule } from './api/user/user.module'; +import { WaterpointsModule } from './api/waterpoints/waterpoints.module'; +import { AppController } from './app.controller'; +import { CronjobModule } from './cronjob/cronjob.module'; +import { HealthModule } from './health.module'; +import { ScriptsModule } from './scripts/scripts.module'; import { TypeOrmModule } from './typeorm.module'; @Module({ diff --git a/services/API-service/src/cronjob/cronjob.module.ts b/services/API-service/src/cronjob/cronjob.module.ts index 8f74ea67c..487b014ba 100644 --- a/services/API-service/src/cronjob/cronjob.module.ts +++ b/services/API-service/src/cronjob/cronjob.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { AdminAreaDynamicDataModule } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.module'; import { CronjobService } from './cronjob.service'; diff --git a/services/API-service/src/cronjob/cronjob.service.ts b/services/API-service/src/cronjob/cronjob.service.ts index 9be1806b7..ec5d59843 100644 --- a/services/API-service/src/cronjob/cronjob.service.ts +++ b/services/API-service/src/cronjob/cronjob.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@nestjs/common'; import { Cron, CronExpression } from '@nestjs/schedule'; + import { AdminAreaDynamicDataService } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.service'; @Injectable() diff --git a/services/API-service/src/main.ts b/services/API-service/src/main.ts index 17e95f170..5e6bbc7b9 100644 --- a/services/API-service/src/main.ts +++ b/services/API-service/src/main.ts @@ -1,15 +1,17 @@ -import { EXTERNAL_API, PORT } from './config'; +import { BadRequestException, ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; -import { ApplicationModule } from './app.module'; import { - SwaggerModule, DocumentBuilder, - SwaggerDocumentOptions, SwaggerCustomOptions, + SwaggerDocumentOptions, + SwaggerModule, } from '@nestjs/swagger'; -import { BadRequestException, ValidationPipe } from '@nestjs/common'; + import * as bodyParser from 'body-parser'; +import { ApplicationModule } from './app.module'; +import { EXTERNAL_API, PORT } from './config'; + async function bootstrap(): Promise { const appOptions = { cors: true }; const app = await NestFactory.create(ApplicationModule, appOptions); diff --git a/services/API-service/src/roles.decorator.ts b/services/API-service/src/roles.decorator.ts index ea6255c28..a4eb3aa1b 100644 --- a/services/API-service/src/roles.decorator.ts +++ b/services/API-service/src/roles.decorator.ts @@ -1,4 +1,5 @@ import { SetMetadata } from '@nestjs/common'; + import { UserRole } from './api/user/user-role.enum'; export const Roles = (...roles: UserRole[]) => SetMetadata('roles', roles); diff --git a/services/API-service/src/roles.guard.ts b/services/API-service/src/roles.guard.ts index cd6d426e4..2be104149 100644 --- a/services/API-service/src/roles.guard.ts +++ b/services/API-service/src/roles.guard.ts @@ -1,9 +1,11 @@ -import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'; -import * as jwt from 'jsonwebtoken'; -import { UserService } from './api/user/user.service'; -import { User } from './api/user/user.model'; +import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; + +import * as jwt from 'jsonwebtoken'; + import { UserRole } from './api/user/user-role.enum'; +import { User } from './api/user/user.model'; +import { UserService } from './api/user/user.service'; @Injectable() export class RolesGuard implements CanActivate { diff --git a/services/API-service/src/scripts.ts b/services/API-service/src/scripts.ts index 8bf6fed4b..514255fda 100644 --- a/services/API-service/src/scripts.ts +++ b/services/API-service/src/scripts.ts @@ -1,5 +1,7 @@ import { NestFactory } from '@nestjs/core'; -import { ScriptsModule, InterfaceScript } from './scripts/scripts.module'; + +import { InterfaceScript, ScriptsModule } from './scripts/scripts.module'; + import yargs = require('yargs'); async function main(): Promise { diff --git a/services/API-service/src/scripts/geoserver-sync.service.ts b/services/API-service/src/scripts/geoserver-sync.service.ts index e032d52f1..465aba245 100644 --- a/services/API-service/src/scripts/geoserver-sync.service.ts +++ b/services/API-service/src/scripts/geoserver-sync.service.ts @@ -1,11 +1,13 @@ +import fs from 'fs'; import { HttpService } from '@nestjs/axios'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; + import { firstValueFrom } from 'rxjs'; -import { INTERNAL_GEOSERVER_API_URL } from '../config'; -import countries from './json/countries.json'; + import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { INTERNAL_GEOSERVER_API_URL } from '../config'; import { DisasterTypeGeoServerMapper } from './disaster-type-geoserver-file.mapper'; -import fs from 'fs'; +import countries from './json/countries.json'; const workspaceName = 'ibf-system'; diff --git a/services/API-service/src/scripts/mock-helper.service.ts b/services/API-service/src/scripts/mock-helper.service.ts index a51a174f5..b75b305ea 100644 --- a/services/API-service/src/scripts/mock-helper.service.ts +++ b/services/API-service/src/scripts/mock-helper.service.ts @@ -1,16 +1,17 @@ +import fs from 'fs'; import { Injectable } from '@nestjs/common'; + +import { AdminAreaDynamicDataService } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.service'; import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { EventService } from '../api/event/event.service'; import { UploadLinesExposureStatusDto } from '../api/lines-data/dto/upload-asset-exposure-status.dto'; import { LinesDataEnum } from '../api/lines-data/lines-data.entity'; +import { LinesDataService } from '../api/lines-data/lines-data.service'; import { UploadDynamicPointDataDto } from '../api/point-data/dto/upload-asset-exposure-status.dto'; import { PointDataEnum } from '../api/point-data/point-data.entity'; -import { DisasterTypeGeoServerMapper } from './disaster-type-geoserver-file.mapper'; -import { AdminAreaDynamicDataService } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.service'; -import { EventService } from '../api/event/event.service'; -import { LinesDataService } from '../api/lines-data/lines-data.service'; import { PointDataService } from '../api/point-data/point-data.service'; -import fs from 'fs'; +import { DisasterTypeGeoServerMapper } from './disaster-type-geoserver-file.mapper'; @Injectable() export class MockHelperService { diff --git a/services/API-service/src/scripts/mock.controller.ts b/services/API-service/src/scripts/mock.controller.ts index ae4699c61..d02971e37 100644 --- a/services/API-service/src/scripts/mock.controller.ts +++ b/services/API-service/src/scripts/mock.controller.ts @@ -1,9 +1,9 @@ import { + Body, Controller, + HttpStatus, Post, - Body, Res, - HttpStatus, UseGuards, Query, ParseBoolPipe, @@ -15,17 +15,19 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; -import { RolesGuard } from '../roles.guard'; + import { DisasterType } from '../api/disaster/disaster-type.enum'; -import { Roles } from '../roles.decorator'; import { UserRole } from '../api/user/user-role.enum'; -import { MockService } from './mock.service'; +import { Roles } from '../roles.decorator'; +import { RolesGuard } from '../roles.guard'; import { - FloodsScenario, - FlashFloodsScenario, EpidemicsScenario, + FlashFloodsScenario, + FloodsScenario, } from './enum/mock-scenario.enum'; +import { MockService } from './mock.service'; export class MockBaseScenario { @ApiProperty({ example: 'fill_in_secret' }) diff --git a/services/API-service/src/scripts/mock.service.ts b/services/API-service/src/scripts/mock.service.ts index c3c8d541e..559bd17e7 100644 --- a/services/API-service/src/scripts/mock.service.ts +++ b/services/API-service/src/scripts/mock.service.ts @@ -1,29 +1,31 @@ -import { Injectable } from '@nestjs/common'; -import { DisasterType } from '../api/disaster/disaster-type.enum'; import fs from 'fs'; -import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; -import { MetadataService } from '../api/metadata/metadata.service'; -import { DynamicIndicator } from '../api/admin-area-dynamic-data/enum/dynamic-data-unit'; +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; + +import { In, Repository } from 'typeorm'; + +import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { AdminAreaDynamicDataService } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.service'; +import { DynamicIndicator } from '../api/admin-area-dynamic-data/enum/dynamic-data-unit'; +import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; +import { AdminAreaService } from '../api/admin-area/admin-area.service'; import { AdminLevel } from '../api/country/admin-level.enum'; +import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { EapActionStatusEntity } from '../api/eap-actions/eap-action-status.entity'; +import { EventPlaceCodeEntity } from '../api/event/event-place-code.entity'; import { EventService } from '../api/event/event.service'; -import countries from './json/countries.json'; +import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; import { GlofasStationService } from '../api/glofas-station/glofas-station.service'; +import { MetadataService } from '../api/metadata/metadata.service'; +import { DEBUG } from '../config'; +import { GeoserverSyncService } from './geoserver-sync.service'; +import countries from './json/countries.json'; +import { MockHelperService } from './mock-helper.service'; import { MockEpidemicsScenario, MockFlashFloodsScenario, MockFloodsScenario, } from './mock.controller'; -import { In, Repository } from 'typeorm'; -import { EventPlaceCodeEntity } from '../api/event/event-place-code.entity'; -import { InjectRepository } from '@nestjs/typeorm'; -import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; -import { EapActionStatusEntity } from '../api/eap-actions/eap-action-status.entity'; -import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; -import { AdminAreaService } from '../api/admin-area/admin-area.service'; -import { MockHelperService } from './mock-helper.service'; -import { DEBUG } from '../config'; -import { GeoserverSyncService } from './geoserver-sync.service'; class Scenario { scenarioName: string; diff --git a/services/API-service/src/scripts/scripts.controller.ts b/services/API-service/src/scripts/scripts.controller.ts index b8a6dda0f..18425f628 100644 --- a/services/API-service/src/scripts/scripts.controller.ts +++ b/services/API-service/src/scripts/scripts.controller.ts @@ -1,9 +1,9 @@ import { + Body, Controller, + HttpStatus, Post, - Body, Res, - HttpStatus, UseGuards, } from '@nestjs/common'; import { @@ -13,6 +13,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; + import { IsEnum, IsIn, @@ -20,13 +21,14 @@ import { IsOptional, IsString, } from 'class-validator'; -import { SeedInit } from './seed-init'; -import { ScriptsService } from './scripts.service'; -import { RolesGuard } from '../roles.guard'; + import { DisasterType } from '../api/disaster/disaster-type.enum'; -import { Roles } from '../roles.decorator'; import { UserRole } from '../api/user/user-role.enum'; +import { Roles } from '../roles.decorator'; +import { RolesGuard } from '../roles.guard'; import { TyphoonScenario } from './enum/mock-scenario.enum'; +import { ScriptsService } from './scripts.service'; +import { SeedInit } from './seed-init'; class ResetDto { @ApiProperty({ example: 'fill_in_secret' }) diff --git a/services/API-service/src/scripts/scripts.module.ts b/services/API-service/src/scripts/scripts.module.ts index e1c38e464..e28a4b26f 100644 --- a/services/API-service/src/scripts/scripts.module.ts +++ b/services/API-service/src/scripts/scripts.module.ts @@ -1,39 +1,41 @@ -import { EapActionStatusEntity } from './../api/eap-actions/eap-action-status.entity'; -import { EventPlaceCodeEntity } from './../api/event/event-place-code.entity'; -import { AdminAreaDynamicDataModule } from './../api/admin-area-dynamic-data/admin-area-dynamic-data.module'; +import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm'; + import { Arguments } from 'yargs'; -import { ScriptsController } from './scripts.controller'; -import { SeedInit } from './seed-init'; -import { GlofasStationModule } from '../api/glofas-station/glofas-station.module'; -import { ScriptsService } from './scripts.service'; -import { EventModule } from '../api/event/event.module'; -import { UserModule } from '../api/user/user.module'; + +import { ORMConfig } from '../../ormconfig'; +import { AdminAreaDataModule } from '../api/admin-area-data/admin-area-data.module'; +import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { AdminAreaEntity } from '../api/admin-area/admin-area.entity'; -import { LeadTimeEntity } from '../api/lead-time/lead-time.entity'; -import { CountryEntity } from '../api/country/country.entity'; -import { TyphoonTrackModule } from '../api/typhoon-track/typhoon-track.module'; -import SeedProd from './seed-prod'; -import { MetadataModule } from '../api/metadata/metadata.module'; -import SeedAdminArea from './seed-admin-area'; import { AdminAreaModule } from '../api/admin-area/admin-area.module'; +import { CountryEntity } from '../api/country/country.entity'; import { CountryModule } from '../api/country/country.module'; -import SeedAdminAreaData from './seed-admin-area-data'; -import SeedPointData from './seed-point-data'; -import SeedRainfallData from './seed-rainfall-data'; -import { PointDataModule } from '../api/point-data/point-data.module'; -import { AdminAreaDataModule } from '../api/admin-area-data/admin-area-data.module'; +import { EventModule } from '../api/event/event.module'; import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; -import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; +import { GlofasStationModule } from '../api/glofas-station/glofas-station.module'; +import { LeadTimeEntity } from '../api/lead-time/lead-time.entity'; import { LinesDataModule } from '../api/lines-data/lines-data.module'; -import SeedLineData from './seed-line-data'; -import { ORMConfig } from '../../ormconfig'; -import { MockService } from './mock.service'; -import { MockController } from './mock.controller'; +import { MetadataModule } from '../api/metadata/metadata.module'; +import { PointDataModule } from '../api/point-data/point-data.module'; +import { TyphoonTrackModule } from '../api/typhoon-track/typhoon-track.module'; +import { UserModule } from '../api/user/user.module'; +import { AdminAreaDynamicDataModule } from './../api/admin-area-dynamic-data/admin-area-dynamic-data.module'; +import { EapActionStatusEntity } from './../api/eap-actions/eap-action-status.entity'; +import { EventPlaceCodeEntity } from './../api/event/event-place-code.entity'; import { GeoserverSyncService } from './geoserver-sync.service'; -import { HttpModule } from '@nestjs/axios'; import { MockHelperService } from './mock-helper.service'; +import { MockController } from './mock.controller'; +import { MockService } from './mock.service'; +import { ScriptsController } from './scripts.controller'; +import { ScriptsService } from './scripts.service'; +import SeedAdminArea from './seed-admin-area'; +import SeedAdminAreaData from './seed-admin-area-data'; +import { SeedInit } from './seed-init'; +import SeedLineData from './seed-line-data'; +import SeedPointData from './seed-point-data'; +import SeedProd from './seed-prod'; +import SeedRainfallData from './seed-rainfall-data'; @Module({ imports: [ diff --git a/services/API-service/src/scripts/scripts.service.ts b/services/API-service/src/scripts/scripts.service.ts index 573d4068f..893a30482 100644 --- a/services/API-service/src/scripts/scripts.service.ts +++ b/services/API-service/src/scripts/scripts.service.ts @@ -1,31 +1,33 @@ +import fs from 'fs'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; + +import { In, Repository } from 'typeorm'; + +import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; import { AdminAreaDynamicDataService } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.service'; +import { DynamicIndicator } from '../api/admin-area-dynamic-data/enum/dynamic-data-unit'; +import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; +import { AdminAreaEntity } from '../api/admin-area/admin-area.entity'; +import { AdminLevel } from '../api/country/admin-level.enum'; +import { CountryEntity } from '../api/country/country.entity'; import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { EapActionStatusEntity } from '../api/eap-actions/eap-action-status.entity'; +import { EventPlaceCodeEntity } from '../api/event/event-place-code.entity'; +import { EventService } from '../api/event/event.service'; +import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; import { GlofasStationService } from '../api/glofas-station/glofas-station.service'; +import { MetadataService } from '../api/metadata/metadata.service'; +import { TyphoonTrackService } from '../api/typhoon-track/typhoon-track.service'; +import { TyphoonScenario } from './enum/mock-scenario.enum'; +import countries from './json/countries.json'; +import { MockHelperService } from './mock-helper.service'; +import { MockService } from './mock.service'; import { MockAll, MockDynamic, MockTyphoonScenario, } from './scripts.controller'; -import countries from './json/countries.json'; -import fs from 'fs'; -import { DynamicIndicator } from '../api/admin-area-dynamic-data/enum/dynamic-data-unit'; -import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; -import { EventService } from '../api/event/event.service'; -import { InjectRepository } from '@nestjs/typeorm'; -import { EventPlaceCodeEntity } from '../api/event/event-place-code.entity'; -import { In, Repository } from 'typeorm'; -import { EapActionStatusEntity } from '../api/eap-actions/eap-action-status.entity'; -import { CountryEntity } from '../api/country/country.entity'; -import { TyphoonTrackService } from '../api/typhoon-track/typhoon-track.service'; -import { MetadataService } from '../api/metadata/metadata.service'; -import { AdminLevel } from '../api/country/admin-level.enum'; -import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; -import { AdminAreaDynamicDataEntity } from '../api/admin-area-dynamic-data/admin-area-dynamic-data.entity'; -import { AdminAreaEntity } from '../api/admin-area/admin-area.entity'; -import { MockHelperService } from './mock-helper.service'; -import { MockService } from './mock.service'; -import { TyphoonScenario } from './enum/mock-scenario.enum'; @Injectable() export class ScriptsService { diff --git a/services/API-service/src/scripts/seed-admin-area-data.ts b/services/API-service/src/scripts/seed-admin-area-data.ts index e6f063450..d10f90f41 100644 --- a/services/API-service/src/scripts/seed-admin-area-data.ts +++ b/services/API-service/src/scripts/seed-admin-area-data.ts @@ -1,9 +1,11 @@ import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; -import { DataSource } from 'typeorm'; -import { SeedHelper } from './seed-helper'; + import { AdminLevel } from 'src/api/country/admin-level.enum'; +import { DataSource } from 'typeorm'; + import { AdminAreaDataService } from '../api/admin-area-data/admin-area-data.service'; +import { InterfaceScript } from './scripts.module'; +import { SeedHelper } from './seed-helper'; interface AdminAreaDataRecord { placeCode: string; diff --git a/services/API-service/src/scripts/seed-admin-area.ts b/services/API-service/src/scripts/seed-admin-area.ts index 3ace5a711..2248f1d8f 100644 --- a/services/API-service/src/scripts/seed-admin-area.ts +++ b/services/API-service/src/scripts/seed-admin-area.ts @@ -1,9 +1,10 @@ -import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; -import countries from './json/countries.json'; import fs from 'fs'; +import { Injectable } from '@nestjs/common'; + import { AdminAreaService } from '../api/admin-area/admin-area.service'; import { EventAreaService } from '../api/admin-area/services/event-area.service'; +import countries from './json/countries.json'; +import { InterfaceScript } from './scripts.module'; @Injectable() export class SeedAdminArea implements InterfaceScript { diff --git a/services/API-service/src/scripts/seed-helper.ts b/services/API-service/src/scripts/seed-helper.ts index 8d4094b31..c6aaf0c8f 100644 --- a/services/API-service/src/scripts/seed-helper.ts +++ b/services/API-service/src/scripts/seed-helper.ts @@ -1,6 +1,7 @@ import fs from 'fs'; -import csv from 'csv-parser'; import { Readable } from 'stream'; + +import csv from 'csv-parser'; import { DataSource } from 'typeorm'; export class SeedHelper { diff --git a/services/API-service/src/scripts/seed-init.ts b/services/API-service/src/scripts/seed-init.ts index 35ce840b6..fd7cdfbb3 100644 --- a/services/API-service/src/scripts/seed-init.ts +++ b/services/API-service/src/scripts/seed-init.ts @@ -1,41 +1,41 @@ import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; + import { DataSource } from 'typeorm'; + +import { + LeadTime, + LeadTimeUnit, +} from '../api/admin-area-dynamic-data/enum/lead-time.enum'; import { CountryEntity } from '../api/country/country.entity'; +import { CountryService } from '../api/country/country.service'; +import { NotificationInfoDto } from '../api/country/dto/notification-info.dto'; +import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { DisasterEntity } from '../api/disaster/disaster.entity'; import { AreaOfFocusEntity } from '../api/eap-actions/area-of-focus.entity'; import { EapActionEntity } from '../api/eap-actions/eap-action.entity'; -import { IndicatorMetadataEntity } from '../api/metadata/indicator-metadata.entity'; import { LeadTimeEntity } from '../api/lead-time/lead-time.entity'; +import { IndicatorMetadataEntity } from '../api/metadata/indicator-metadata.entity'; +import { LayerMetadataEntity } from '../api/metadata/layer-metadata.entity'; +import { NotificationInfoEntity } from '../api/notification/notifcation-info.entity'; import { UserRole } from '../api/user/user-role.enum'; import { UserStatus } from '../api/user/user-status.enum'; import { UserEntity } from '../api/user/user.entity'; -import { LayerMetadataEntity } from '../api/metadata/layer-metadata.entity'; -import { DisasterType } from '../api/disaster/disaster-type.enum'; -import { DisasterEntity } from '../api/disaster/disaster.entity'; -import { NotificationInfoEntity } from '../api/notification/notifcation-info.entity'; - -import leadTimes from './json/lead-times.json'; -import notificationInfo from './json/notification-info.json'; -import countries from './json/countries.json'; -import users from './json/users.json'; import areasOfFocus from './json/areas-of-focus.json'; +import countries from './json/countries.json'; +import disasters from './json/disasters.json'; import eapActions from './json/EAP-actions.json'; import indicatorMetadata from './json/indicator-metadata.json'; import layerMetadata from './json/layer-metadata.json'; -import disasters from './json/disasters.json'; - +import leadTimes from './json/lead-times.json'; +import notificationInfo from './json/notification-info.json'; +import users from './json/users.json'; +import { InterfaceScript } from './scripts.module'; import SeedAdminArea from './seed-admin-area'; -import { SeedHelper } from './seed-helper'; import SeedAdminAreaData from './seed-admin-area-data'; -import SeedRainfallData from './seed-rainfall-data'; -import SeedPointData from './seed-point-data'; -import { CountryService } from '../api/country/country.service'; -import { NotificationInfoDto } from '../api/country/dto/notification-info.dto'; +import { SeedHelper } from './seed-helper'; import SeedLineData from './seed-line-data'; -import { - LeadTime, - LeadTimeUnit, -} from '../api/admin-area-dynamic-data/enum/lead-time.enum'; +import SeedPointData from './seed-point-data'; +import SeedRainfallData from './seed-rainfall-data'; @Injectable() export class SeedInit implements InterfaceScript { diff --git a/services/API-service/src/scripts/seed-line-data.ts b/services/API-service/src/scripts/seed-line-data.ts index 0d5776a46..87c6931f0 100644 --- a/services/API-service/src/scripts/seed-line-data.ts +++ b/services/API-service/src/scripts/seed-line-data.ts @@ -1,10 +1,12 @@ import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; + import { DataSource } from 'typeorm'; -import { SeedHelper } from './seed-helper'; -import countries from './json/countries.json'; -import { LinesDataService } from '../api/lines-data/lines-data.service'; + import { LinesDataEnum } from '../api/lines-data/lines-data.entity'; +import { LinesDataService } from '../api/lines-data/lines-data.service'; +import countries from './json/countries.json'; +import { InterfaceScript } from './scripts.module'; +import { SeedHelper } from './seed-helper'; @Injectable() export class SeedLineData implements InterfaceScript { diff --git a/services/API-service/src/scripts/seed-point-data.ts b/services/API-service/src/scripts/seed-point-data.ts index c5e462c41..61d85688c 100644 --- a/services/API-service/src/scripts/seed-point-data.ts +++ b/services/API-service/src/scripts/seed-point-data.ts @@ -1,10 +1,12 @@ import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; + import { DataSource } from 'typeorm'; -import { SeedHelper } from './seed-helper'; -import countries from './json/countries.json'; + import { PointDataEnum } from '../api/point-data/point-data.entity'; import { PointDataService } from '../api/point-data/point-data.service'; +import countries from './json/countries.json'; +import { InterfaceScript } from './scripts.module'; +import { SeedHelper } from './seed-helper'; @Injectable() export class SeedPointData implements InterfaceScript { diff --git a/services/API-service/src/scripts/seed-prod.ts b/services/API-service/src/scripts/seed-prod.ts index 34b6a9057..f4a598d38 100644 --- a/services/API-service/src/scripts/seed-prod.ts +++ b/services/API-service/src/scripts/seed-prod.ts @@ -1,10 +1,12 @@ import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; + import { DataSource } from 'typeorm'; -import { UserEntity } from '../api/user/user.entity'; -import users from './json/users.json'; + import { UserRole } from '../api/user/user-role.enum'; import { UserStatus } from '../api/user/user-status.enum'; +import { UserEntity } from '../api/user/user.entity'; +import users from './json/users.json'; +import { InterfaceScript } from './scripts.module'; @Injectable() export class SeedProd implements InterfaceScript { diff --git a/services/API-service/src/scripts/seed-rainfall-data.ts b/services/API-service/src/scripts/seed-rainfall-data.ts index a08d48d1a..f46a78da6 100644 --- a/services/API-service/src/scripts/seed-rainfall-data.ts +++ b/services/API-service/src/scripts/seed-rainfall-data.ts @@ -1,10 +1,12 @@ -import { DisasterType } from './../api/disaster/disaster-type.enum'; import { Injectable } from '@nestjs/common'; -import { InterfaceScript } from './scripts.module'; + import { DataSource } from 'typeorm'; -import { SeedHelper } from './seed-helper'; + import { RainfallTriggersEntity } from '../api/rainfall-triggers/rainfall-triggers.entity'; +import { DisasterType } from './../api/disaster/disaster-type.enum'; import countries from './json/countries.json'; +import { InterfaceScript } from './scripts.module'; +import { SeedHelper } from './seed-helper'; @Injectable() export class SeedRainfallData implements InterfaceScript { diff --git a/services/API-service/src/shared/data.model.ts b/services/API-service/src/shared/data.model.ts index 1eb5662e3..4aa3ffc45 100644 --- a/services/API-service/src/shared/data.model.ts +++ b/services/API-service/src/shared/data.model.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; + import { LeadTime } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; import { Geometry } from './geo.model'; diff --git a/services/API-service/src/shared/helper.service.ts b/services/API-service/src/shared/helper.service.ts index ea607c9df..a10e2c406 100644 --- a/services/API-service/src/shared/helper.service.ts +++ b/services/API-service/src/shared/helper.service.ts @@ -1,15 +1,17 @@ import { Injectable } from '@nestjs/common'; -import { Readable } from 'typeorm/platform/PlatformTools'; -import { DisasterType } from '../api/disaster/disaster-type.enum'; -import { GeoJson, GeoJsonFeature } from './geo.model'; + import csv from 'csv-parser'; -import { DateDto } from '../api/event/dto/date.dto'; import { DataSource } from 'typeorm'; -import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; +import { Readable } from 'typeorm/platform/PlatformTools'; + import { LeadTime, LeadTimeUnit, } from '../api/admin-area-dynamic-data/enum/lead-time.enum'; +import { DisasterType } from '../api/disaster/disaster-type.enum'; +import { DateDto } from '../api/event/dto/date.dto'; +import { TriggerPerLeadTime } from '../api/event/trigger-per-lead-time.entity'; +import { GeoJson, GeoJsonFeature } from './geo.model'; @Injectable() export class HelperService { diff --git a/services/API-service/src/shared/pipes/validation.pipe.ts b/services/API-service/src/shared/pipes/validation.pipe.ts index eacc9a7bf..6420e979a 100644 --- a/services/API-service/src/shared/pipes/validation.pipe.ts +++ b/services/API-service/src/shared/pipes/validation.pipe.ts @@ -1,14 +1,15 @@ import { - PipeTransform, ArgumentMetadata, BadRequestException, HttpStatus, Injectable, + PipeTransform, } from '@nestjs/common'; -import { validate } from 'class-validator'; -import { plainToClass } from 'class-transformer'; import { HttpException } from '@nestjs/common/exceptions/http.exception'; +import { plainToClass } from 'class-transformer'; +import { validate } from 'class-validator'; + @Injectable() export class ValidationPipe implements PipeTransform { public async transform( diff --git a/services/API-service/src/typeorm.module.ts b/services/API-service/src/typeorm.module.ts index c92e0ba7d..451d21c9f 100644 --- a/services/API-service/src/typeorm.module.ts +++ b/services/API-service/src/typeorm.module.ts @@ -1,5 +1,7 @@ import { Global, Module } from '@nestjs/common'; + import { DataSource } from 'typeorm'; + import { AppDataSource } from '../appdatasource'; @Global()