From: Jérôme Benoit Date: Mon, 21 Jun 2021 19:45:51 +0000 (+0200) Subject: Keep track of authorize request idtag status. X-Git-Tag: v1.0.24~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=163547b1c0d9b1062891962feedb127fc0c1cc94;p=e-mobility-charging-stations-simulator.git Keep track of authorize request idtag status. And use it to add sanity check at start transaction. Signed-off-by: Jérôme Benoit --- diff --git a/package-lock.json b/package-lock.json index 63522cea..000e8bca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -960,22 +960,14 @@ } }, "@es-joy/jsdoccomment": { - "version": "0.8.0-alpha.2", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.8.0-alpha.2.tgz", - "integrity": "sha512-fjRY13Bh8sxDZkzO27U2R9L6xFqkh5fAbHuMGvGLXLfrTes8nTTMyOi6wIPt+CG0XPAxEUge8cDjhG+0aag6ew==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.8.0.tgz", + "integrity": "sha512-Xd3GzYsL2sz2pcdtYt5Q0Wz1ol/o9Nt2UQL4nFPDcaEomvPmwjJsbjkKx1SKhl2h3TgwazNBLdcNr2m0UiGiFA==", "dev": true, "requires": { "comment-parser": "^1.1.5", "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "1.0.0-alpha.23" - }, - "dependencies": { - "jsdoc-type-pratt-parser": { - "version": "1.0.0-alpha.23", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.0.0-alpha.23.tgz", - "integrity": "sha512-COtimMd97eo5W0h6R9ISFj9ufg/9EiAzVAeQpKBJ1xJs/x8znWE155HGBDR2rwOuZsCes1gBXGmFVfvRZxGrhg==", - "dev": true - } + "jsdoc-type-pratt-parser": "1.0.4" } }, "@eslint/eslintrc": { @@ -1480,9 +1472,9 @@ } }, "@octokit/core": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.0.tgz", - "integrity": "sha512-IKcyllVQe6KPwPPFIaKdbhNNQhmmHIj69PXOseBF6/NglXoKHVe79syEfZj0bz7sP87MOl5jLZadV3slgdZ1vQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", + "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", "dev": true, "requires": { "@octokit/auth-token": "^2.4.4", @@ -1546,12 +1538,12 @@ "dev": true }, "@octokit/plugin-rest-endpoint-methods": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.1.tgz", - "integrity": "sha512-vvWbPtPqLyIzJ7A4IPdTl+8IeuKAwMJ4LjvmqWOOdfSuqWQYZXq2CEd0hsnkidff2YfKlguzujHs/reBdAx8Sg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.1.tgz", + "integrity": "sha512-3B2iguGmkh6bQQaVOtCsS0gixrz8Lg0v4JuXPqBcFqLKuJtxAUf3K88RxMEf/naDOI73spD+goJ/o7Ie7Cvdjg==", "dev": true, "requires": { - "@octokit/types": "^6.13.1", + "@octokit/types": "^6.16.2", "deprecation": "^2.3.1" } }, @@ -1595,15 +1587,15 @@ } }, "@octokit/rest": { - "version": "18.5.3", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.5.3.tgz", - "integrity": "sha512-KPAsUCr1DOdLVbZJgGNuE/QVLWEaVBpFQwDAz/2Cnya6uW2wJ/P5RVGk0itx7yyN1aGa8uXm2pri4umEqG1JBA==", + "version": "18.6.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.6.0.tgz", + "integrity": "sha512-MdHuXHDJM7e5sUBe3K9tt7th0cs4csKU5Bb52LRi2oHAeIMrMZ4XqaTrEv660HoUPoM1iDlnj27Ab/Nh3MtwlA==", "dev": true, "requires": { - "@octokit/core": "^3.2.3", + "@octokit/core": "^3.5.0", "@octokit/plugin-paginate-rest": "^2.6.2", "@octokit/plugin-request-log": "^1.0.2", - "@octokit/plugin-rest-endpoint-methods": "5.0.1" + "@octokit/plugin-rest-endpoint-methods": "5.3.1" } }, "@octokit/types": { @@ -1897,16 +1889,15 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.27.0.tgz", - "integrity": "sha512-DsLqxeUfLVNp3AO7PC3JyaddmEHTtI9qTSAs+RB6ja27QvIM0TA8Cizn1qcS6vOu+WDLFJzkwkgweiyFhssDdQ==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.0.tgz", + "integrity": "sha512-KcF6p3zWhf1f8xO84tuBailV5cN92vhS+VT7UJsPzGBm9VnQqfI9AsiMUFUCYHTYPg1uCCo+HyiDnpDuvkAMfQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.27.0", - "@typescript-eslint/scope-manager": "4.27.0", + "@typescript-eslint/experimental-utils": "4.28.0", + "@typescript-eslint/scope-manager": "4.28.0", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", "regexpp": "^3.1.0", "semver": "^7.3.5", "tsutils": "^3.21.0" @@ -1954,15 +1945,15 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.27.0.tgz", - "integrity": "sha512-n5NlbnmzT2MXlyT+Y0Jf0gsmAQzCnQSWXKy4RGSXVStjDvS5we9IWbh7qRVKdGcxT0WYlgcCYUK/HRg7xFhvjQ==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.0.tgz", + "integrity": "sha512-9XD9s7mt3QWMk82GoyUpc/Ji03vz4T5AYlHF9DcoFNfJ/y3UAclRsfGiE2gLfXtyC+JRA3trR7cR296TEb1oiQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.27.0", - "@typescript-eslint/types": "4.27.0", - "@typescript-eslint/typescript-estree": "4.27.0", + "@typescript-eslint/scope-manager": "4.28.0", + "@typescript-eslint/types": "4.28.0", + "@typescript-eslint/typescript-estree": "4.28.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1979,14 +1970,14 @@ } }, "@typescript-eslint/parser": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.27.0.tgz", - "integrity": "sha512-XpbxL+M+gClmJcJ5kHnUpBGmlGdgNvy6cehgR6ufyxkEJMGP25tZKCaKyC0W/JVpuhU3VU1RBn7SYUPKSMqQvQ==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.0.tgz", + "integrity": "sha512-7x4D22oPY8fDaOCvkuXtYYTQ6mTMmkivwEzS+7iml9F9VkHGbbZ3x4fHRwxAb5KeuSkLqfnYjs46tGx2Nour4A==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.27.0", - "@typescript-eslint/types": "4.27.0", - "@typescript-eslint/typescript-estree": "4.27.0", + "@typescript-eslint/scope-manager": "4.28.0", + "@typescript-eslint/types": "4.28.0", + "@typescript-eslint/typescript-estree": "4.28.0", "debug": "^4.3.1" }, "dependencies": { @@ -2008,29 +1999,29 @@ } }, "@typescript-eslint/scope-manager": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.27.0.tgz", - "integrity": "sha512-DY73jK6SEH6UDdzc6maF19AHQJBFVRf6fgAXHPXCGEmpqD4vYgPEzqpFz1lf/daSbOcMpPPj9tyXXDPW2XReAw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.0.tgz", + "integrity": "sha512-eCALCeScs5P/EYjwo6se9bdjtrh8ByWjtHzOkC4Tia6QQWtQr3PHovxh3TdYTuFcurkYI4rmFsRFpucADIkseg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.27.0", - "@typescript-eslint/visitor-keys": "4.27.0" + "@typescript-eslint/types": "4.28.0", + "@typescript-eslint/visitor-keys": "4.28.0" } }, "@typescript-eslint/types": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.27.0.tgz", - "integrity": "sha512-I4ps3SCPFCKclRcvnsVA/7sWzh7naaM/b4pBO2hVxnM3wrU51Lveybdw5WoIktU/V4KfXrTt94V9b065b/0+wA==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.0.tgz", + "integrity": "sha512-p16xMNKKoiJCVZY5PW/AfILw2xe1LfruTcfAKBj3a+wgNYP5I9ZEKNDOItoRt53p4EiPV6iRSICy8EPanG9ZVA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.27.0.tgz", - "integrity": "sha512-KH03GUsUj41sRLLEy2JHstnezgpS5VNhrJouRdmh6yNdQ+yl8w5LrSwBkExM+jWwCJa7Ct2c8yl8NdtNRyQO6g==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.0.tgz", + "integrity": "sha512-m19UQTRtxMzKAm8QxfKpvh6OwQSXaW1CdZPoCaQuLwAq7VZMNuhJmZR4g5281s2ECt658sldnJfdpSZZaxUGMQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.27.0", - "@typescript-eslint/visitor-keys": "4.27.0", + "@typescript-eslint/types": "4.28.0", + "@typescript-eslint/visitor-keys": "4.28.0", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -2054,9 +2045,9 @@ } }, "globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -2100,12 +2091,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.27.0.tgz", - "integrity": "sha512-es0GRYNZp0ieckZ938cEANfEhsfHrzuLrePukLKtY3/KPXcq1Xd555Mno9/GOgXhKzn0QfkDLVgqWO3dGY80bg==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.0.tgz", + "integrity": "sha512-PjJyTWwrlrvM5jazxYF5ZPs/nl0kHDZMVbuIcbpawVXaDPelp3+S9zpOz5RmVUfS/fD5l5+ZXNKnWhNYjPzCvw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.27.0", + "@typescript-eslint/types": "4.28.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -5912,9 +5903,9 @@ } }, "eslint-plugin-jsdoc": { - "version": "35.3.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-35.3.2.tgz", - "integrity": "sha512-r3qfbByMZ4O5Y8O6aHxo1AdgdpwTQSD72anIZuhjNI6ZkMtjhpSkkPN3cY/tsZtmWeMH+1pB/nblWIAr3F0lxA==", + "version": "35.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-35.4.0.tgz", + "integrity": "sha512-0cr+NkPTxpTiMCtYOd8W5fd2IyC/CmaTHKb+0bzkpP9p8HfmJ3B2/M6FWj97rQJOLwLMkx+g2MIEZsrttpbFmQ==", "dev": true, "requires": { "@es-joy/jsdoccomment": "^0.8.0-alpha.2", @@ -11869,30 +11860,30 @@ "dev": true }, "release-it": { - "version": "14.9.0", - "resolved": "https://registry.npmjs.org/release-it/-/release-it-14.9.0.tgz", - "integrity": "sha512-Pn9GH60jKkL+dUkVxCyyiIhA9oySu/Q+8F9aExCggcppxfZbhRCxMgmk/iFh+/oejdzQq9zCZSudA2CmWOSKxQ==", + "version": "14.10.0", + "resolved": "https://registry.npmjs.org/release-it/-/release-it-14.10.0.tgz", + "integrity": "sha512-BwL7W3VPILma+MwO2kEtZaAL0/G/mZafg4xgpfxy4MVxLd+28lBp22EDF2gS4GXHmcblawyV2IdbWo/56QIyJw==", "dev": true, "requires": { "@iarna/toml": "2.2.5", - "@octokit/rest": "18.5.3", + "@octokit/rest": "18.6.0", "async-retry": "1.3.1", "chalk": "4.1.1", "cosmiconfig": "7.0.0", "debug": "4.3.1", "deprecated-obj": "2.0.0", - "execa": "5.0.0", + "execa": "5.1.1", "find-up": "5.0.0", "form-data": "4.0.0", "git-url-parse": "11.4.4", - "globby": "11.0.3", + "globby": "11.0.4", "got": "11.8.2", "import-cwd": "3.0.0", - "inquirer": "8.1.0", + "inquirer": "8.1.1", "is-ci": "3.0.0", "lodash": "4.17.21", - "mime-types": "2.1.30", - "ora": "5.4.0", + "mime-types": "2.1.31", + "ora": "5.4.1", "os-name": "4.0.0", "parse-json": "5.2.0", "semver": "7.3.5", @@ -11998,6 +11989,17 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "boxen": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.0.1.tgz", @@ -12022,6 +12024,16 @@ } } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "cacheable-request": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", @@ -12177,9 +12189,9 @@ "dev": true }, "execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { "cross-spawn": "^7.0.3", @@ -12239,9 +12251,9 @@ } }, "globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -12277,6 +12289,12 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", @@ -12284,9 +12302,9 @@ "dev": true }, "inquirer": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.1.0.tgz", - "integrity": "sha512-1nKYPoalt1vMBfCMtpomsUc32wmOoWXAoq3kM/5iTfxyQ2f/BxjixQpC+mbZ7BI0JUXHED4/XPXekDVtJNpXYw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.1.1.tgz", + "integrity": "sha512-hUDjc3vBkh/uk1gPfMAD/7Z188Q8cvTGl0nxwaCdwSbzFh6ZKkZh+s2ozVxbE5G9ZNRyeY0+lgbAIOUFsFf98w==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", @@ -12420,18 +12438,18 @@ } }, "mime-db": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", - "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", "dev": true }, "mime-types": { - "version": "2.1.30", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", - "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", "dev": true, "requires": { - "mime-db": "1.47.0" + "mime-db": "1.48.0" } }, "mimic-fn": { @@ -12482,6 +12500,23 @@ "mimic-fn": "^2.1.0" } }, + "ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "requires": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + } + }, "os-name": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/os-name/-/os-name-4.0.0.tgz", @@ -12704,6 +12739,17 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "registry-auth-token": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", @@ -13213,9 +13259,9 @@ } }, "rollup": { - "version": "2.52.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.1.tgz", - "integrity": "sha512-/SPqz8UGnp4P1hq6wc9gdTqA2bXQXGx13TtoL03GBm6qGRI6Hm3p4Io7GeiHNLl0BsQAne1JNYY+q/apcY933w==", + "version": "2.52.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.2.tgz", + "integrity": "sha512-4RlFC3k2BIHlUsJ9mGd8OO+9Lm2eDF5P7+6DNQOp5sx+7N/1tFM01kELfbxlMX3MxT6owvLB1ln4S3QvvQlbUA==", "dev": true, "requires": { "fsevents": "~2.3.2" diff --git a/package.json b/package.json index 80cadaf9..d0d6bd19 100644 --- a/package.json +++ b/package.json @@ -78,14 +78,14 @@ "@types/node": "^14.17.3", "@types/uuid": "^8.3.0", "@types/ws": "^7.4.5", - "@typescript-eslint/eslint-plugin": "^4.27.0", - "@typescript-eslint/parser": "^4.27.0", + "@typescript-eslint/eslint-plugin": "^4.28.0", + "@typescript-eslint/parser": "^4.28.0", "auto-changelog": "^2.3.0", "clinic": "^9.0.0", "cross-env": "^7.0.3", "eslint": "^7.29.0", "eslint-plugin-import": "^2.23.4", - "eslint-plugin-jsdoc": "^35.3.2", + "eslint-plugin-jsdoc": "^35.4.0", "eslint-plugin-node": "^11.1.0", "expect": "^27.0.2", "mbt": "^1.2.1", @@ -93,8 +93,8 @@ "mochawesome": "^6.2.2", "npm-check": "^5.9.2", "nyc": "^15.1.0", - "release-it": "^14.9.0", - "rollup": "^2.52.1", + "release-it": "^14.10.0", + "rollup": "^2.52.2", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^2.0.0", diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 942410eb..44a48794 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -130,7 +130,7 @@ export default class AutomaticTransactionGenerator { const tagId = self.chargingStation.getRandomTagId(); if (self.chargingStation.getAutomaticTransactionGeneratorRequireAuthorize()) { // Authorize tagId - const authorizeResponse = await self.chargingStation.ocppRequestService.sendAuthorize(tagId); + const authorizeResponse = await self.chargingStation.ocppRequestService.sendAuthorize(connectorId, tagId); if (authorizeResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) { logger.info(self.logPrefix(connectorId) + ' start transaction for tagID ' + tagId); // Start transaction diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 0f2034fa..a5530c5e 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -144,7 +144,7 @@ export default class ChargingStation { public getTransactionIdTag(transactionId: number): string | undefined { for (const connector in this.connectors) { if (Utils.convertToInt(connector) > 0 && this.getConnector(Utils.convertToInt(connector)).transactionId === transactionId) { - return this.getConnector(Utils.convertToInt(connector)).idTag; + return this.getConnector(Utils.convertToInt(connector)).transactionIdTag; } } } @@ -219,7 +219,7 @@ export default class ChargingStation { return; } if (measurand !== MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER && !this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData).value.includes(measurand)) { - logger.warn(`${this.logPrefix()} Trying to get MeterValues measurand ${measurand} ${phase ? `on phase ${phase} ` : ''}in template on connectorId ${connectorId} not found in '${StandardParametersKey.MeterValuesSampledData}' OCPP parameter`); + logger.debug(`${this.logPrefix()} Trying to get MeterValues measurand ${measurand} ${phase ? `on phase ${phase} ` : ''}in template on connectorId ${connectorId} not found in '${StandardParametersKey.MeterValuesSampledData}' OCPP parameter`); return; } const sampledValueTemplates: SampledValueTemplate[] = this.getConnector(connectorId).MeterValues; @@ -386,9 +386,11 @@ export default class ChargingStation { } public resetTransactionOnConnector(connectorId: number): void { + this.getConnector(connectorId).authorized = false; this.getConnector(connectorId).transactionStarted = false; + delete this.getConnector(connectorId).authorizeIdTag; delete this.getConnector(connectorId).transactionId; - delete this.getConnector(connectorId).idTag; + delete this.getConnector(connectorId).transactionIdTag; this.getConnector(connectorId).transactionEnergyActiveImportRegisterValue = 0; delete this.getConnector(connectorId).transactionBeginMeterValue; this.stopMeterValues(connectorId); @@ -1027,6 +1029,7 @@ export default class ChargingStation { } private initTransactionAttributesOnConnector(connectorId: number): void { + this.getConnector(connectorId).authorized = false; this.getConnector(connectorId).transactionStarted = false; this.getConnector(connectorId).energyActiveImportRegisterValue = 0; this.getConnector(connectorId).transactionEnergyActiveImportRegisterValue = 0; diff --git a/src/charging-station/ocpp/1.6/OCCP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCCP16IncomingRequestService.ts index 0ef5fa0c..bbb70b9e 100644 --- a/src/charging-station/ocpp/1.6/OCCP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCCP16IncomingRequestService.ts @@ -277,7 +277,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer } } if (!authorized) { - const authorizeResponse = await this.chargingStation.ocppRequestService.sendAuthorize(commandPayload.idTag); + const authorizeResponse = await this.chargingStation.ocppRequestService.sendAuthorize(transactionConnectorID, commandPayload.idTag); if (authorizeResponse?.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { authorized = true; } diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index f009a4ab..eb502d6e 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -61,11 +61,12 @@ export default class OCPP16RequestService extends OCPPRequestService { } } - public async sendAuthorize(idTag?: string): Promise { + public async sendAuthorize(connectorId: number, idTag?: string): Promise { try { const payload: AuthorizeRequest = { ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG }, }; + this.chargingStation.getConnector(connectorId).authorizeIdTag = idTag; return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.AUTHORIZE) as OCPP16AuthorizeResponse; } catch (error) { this.handleRequestError(OCPP16RequestCommand.AUTHORIZE, error); @@ -93,6 +94,7 @@ export default class OCPP16RequestService extends OCPPRequestService { for (const connector in this.chargingStation.connectors) { if (Utils.convertToInt(connector) > 0 && this.chargingStation.getConnector(Utils.convertToInt(connector))?.transactionId === transactionId) { connectorId = Utils.convertToInt(connector); + break; } } const transactionEndMeterValue = OCPP16ServiceUtils.buildTransactionEndMeterValue(this.chargingStation, connectorId, meterStop); diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index df211827..edfb9903 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -46,6 +46,10 @@ export default class OCPP16ResponseService extends OCPPResponseService { logger.error(this.chargingStation.logPrefix() + ' Trying to start a transaction on a non existing connector Id ' + connectorId.toString()); return; } + if (this.chargingStation.getConnector(connectorId).authorized && this.chargingStation.getConnector(connectorId).authorizeIdTag !== requestPayload.idTag) { + logger.error(this.chargingStation.logPrefix() + ' Trying to start a transaction with an idTag ' + requestPayload.idTag + ' different from the authorize request one ' + this.chargingStation.getConnector(connectorId).authorizeIdTag + ' on connector Id ' + connectorId.toString()); + return; + } if (this.chargingStation.getConnector(connectorId)?.transactionStarted) { logger.debug(this.chargingStation.logPrefix() + ' Trying to start a transaction on an already used connector ' + connectorId.toString() + ': %j', this.chargingStation.getConnector(connectorId)); return; @@ -54,7 +58,7 @@ export default class OCPP16ResponseService extends OCPPResponseService { if (payload.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { this.chargingStation.getConnector(connectorId).transactionStarted = true; this.chargingStation.getConnector(connectorId).transactionId = payload.transactionId; - this.chargingStation.getConnector(connectorId).idTag = requestPayload.idTag; + this.chargingStation.getConnector(connectorId).transactionIdTag = requestPayload.idTag; this.chargingStation.getConnector(connectorId).transactionEnergyActiveImportRegisterValue = 0; this.chargingStation.getConnector(connectorId).transactionBeginMeterValue = OCPP16ServiceUtils.buildTransactionBeginMeterValue(this.chargingStation, connectorId, requestPayload.meterStart); @@ -122,6 +126,20 @@ export default class OCPP16ResponseService extends OCPPResponseService { } private handleResponseAuthorize(payload: OCPP16AuthorizeResponse, requestPayload: AuthorizeRequest): void { - logger.debug(this.chargingStation.logPrefix() + ' Authorize response received: %j to Authorize request: %j', payload, requestPayload); + let authorizeConnectorId: number; + for (const connector in this.chargingStation.connectors) { + if (Utils.convertToInt(connector) > 0 && this.chargingStation.getConnector(Utils.convertToInt(connector))?.authorizeIdTag === requestPayload.idTag) { + authorizeConnectorId = Utils.convertToInt(connector); + break; + } + } + if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) { + this.chargingStation.getConnector(authorizeConnectorId).authorized = true; + logger.debug(`${this.chargingStation.logPrefix()} IdTag ${requestPayload.idTag} authorized on connector ${authorizeConnectorId}`); + } else { + this.chargingStation.getConnector(authorizeConnectorId).authorized = false; + delete this.chargingStation.getConnector(authorizeConnectorId).authorizeIdTag; + logger.debug(`${this.chargingStation.logPrefix()} IdTag ${requestPayload.idTag} refused with status ${payload.idTagInfo.status} on connector ${authorizeConnectorId}`); + } } } diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 459e9b72..2b00ccb9 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -111,7 +111,7 @@ export default abstract class OCPPRequestService { public abstract sendHeartbeat(): Promise; public abstract sendBootNotification(chargePointModel: string, chargePointVendor: string, chargeBoxSerialNumber?: string, firmwareVersion?: string, chargePointSerialNumber?: string, iccid?: string, imsi?: string, meterSerialNumber?: string, meterType?: string): Promise; public abstract sendStatusNotification(connectorId: number, status: ChargePointStatus, errorCode?: ChargePointErrorCode): Promise; - public abstract sendAuthorize(idTag?: string): Promise; + public abstract sendAuthorize(connectorId: number, idTag?: string): Promise; public abstract sendStartTransaction(connectorId: number, idTag?: string): Promise; public abstract sendStopTransaction(transactionId: number, meterStop: number, idTag?: string, reason?: StopTransactionReason): Promise; public abstract sendMeterValues(connectorId: number, transactionId: number, interval: number, self: OCPPRequestService): Promise; diff --git a/src/types/Connectors.ts b/src/types/Connectors.ts index 44bdb917..36ba5231 100644 --- a/src/types/Connectors.ts +++ b/src/types/Connectors.ts @@ -13,10 +13,12 @@ export interface Connector { bootStatus?: ChargePointStatus; status?: ChargePointStatus; MeterValues: SampledValueTemplate[]; + authorizeIdTag?: string; + authorized?: boolean; transactionStarted?: boolean; transactionId?: number; transactionSetInterval?: NodeJS.Timeout; - idTag?: string; + transactionIdTag?: string; energyActiveImportRegisterValue?: number; // In Wh transactionEnergyActiveImportRegisterValue?: number; // In Wh transactionBeginMeterValue?: MeterValue; diff --git a/src/types/ocpp/1.6/Transaction.ts b/src/types/ocpp/1.6/Transaction.ts index 030a2f25..41bd344e 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -31,8 +31,8 @@ export interface IdTagInfo { export interface AuthorizeRequest { idTag: string; - } + export interface OCPP16AuthorizeResponse { idTagInfo: IdTagInfo; }