diff --git a/package-lock.json b/package-lock.json index 546c7d5..5cec1c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,10 @@ "license": "MIT", "dependencies": { "@types/webextension-polyfill": "^0.10.0", - "jira.js": "^3.0.2", + "autocompleter": "^9.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.49.2", - "textcomplete": "^0.18.2", - "tributejs": "^5.1.3", - "ts-data-class": "^0.10.0", "webextension-polyfill": "^0.10.0" }, "devDependencies": { @@ -1744,7 +1741,8 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/at-least-node": { "version": "1.0.0", @@ -1764,6 +1762,11 @@ "node": ">=8.0.0" } }, + "node_modules/autocompleter": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-9.1.2.tgz", + "integrity": "sha512-L4DJ2UIsIy/YrTchKHHfyQRng2p8m9xpari1uHYZ/5DynQombeshF73uVQbrtdLxLSlK0R7ObhpnbPBkI8j8xA==" + }, "node_modules/autoprefixer": { "version": "10.4.13", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", @@ -1833,29 +1836,6 @@ "node": ">=4" } }, - "node_modules/axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", - "dependencies": { - "follow-redirects": "^1.15.4", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/axios/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -2445,6 +2425,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2997,6 +2978,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -3996,11 +3978,6 @@ "node": ">=6" } }, - "node_modules/eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==" - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -4273,25 +4250,6 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, - "node_modules/follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -5601,29 +5559,6 @@ "integrity": "sha512-z35ZSEcXHxLW4yumw0dF6L464NT36vmx3wxJw8MDpraBcWuNVgUPZgPJKcu1HekNgwlMFNqol7i/IpSbjhqwqA==", "dev": true }, - "node_modules/jira.js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jira.js/-/jira.js-3.0.2.tgz", - "integrity": "sha512-yysfjFYIFPE/hp8pJ/u3q6OBX/KYm4nMsmQym7JSO2pIJ4bIbdDLuz1DDGcHqi1DflfOSBKYc2BlJXTl5IZUEA==", - "dependencies": { - "axios": "^1.6.3", - "form-data": "^4.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/jira.js/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/jose": { "version": "4.13.1", "resolved": "https://registry.npmjs.org/jose/-/jose-4.13.1.tgz", @@ -5969,37 +5904,12 @@ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true }, - "node_modules/lodash.clone": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", - "integrity": "sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg==" - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, - "node_modules/lodash.isundefined": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz", - "integrity": "sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.omitby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", - "integrity": "sha512-5OrRcIVR75M288p4nbI2WLAf3ndw2GD9fyNv3Bc15+WCxJDdZ4lYndSxGd7hnG6PVjiJTeJE2dHEGhIuKGicIQ==" - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -6102,6 +6012,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, "engines": { "node": ">= 0.6" } @@ -6110,6 +6021,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -7243,11 +7155,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -8367,21 +8274,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/textarea-caret": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/textarea-caret/-/textarea-caret-3.1.0.tgz", - "integrity": "sha512-cXAvzO9pP5CGa6NKx0WYHl+8CHKZs8byMkt3PCJBCmq2a34YA9pO1NrQET5pzeqnBjBdToF5No4rrmkDUgQC2Q==" - }, - "node_modules/textcomplete": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/textcomplete/-/textcomplete-0.18.2.tgz", - "integrity": "sha512-Z7RocuECp4S/Dld2swLRdXPYqCCMZvKmwrZHp8MQA4UJHX171/MjLeAj0uENEJPpa8JOtU01PK0iuVQUoFjSfg==", - "dependencies": { - "eventemitter3": "^2.0.3", - "textarea-caret": "^3.0.1", - "undate": "^0.2.3" - } - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -8496,23 +8388,6 @@ "tree-kill": "cli.js" } }, - "node_modules/tributejs": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/tributejs/-/tributejs-5.1.3.tgz", - "integrity": "sha512-B5CXihaVzXw+1UHhNFyAwUTMDk1EfoLP5Tj1VhD9yybZ1I8DZJEv8tZ1l0RJo0t0tk9ZhR8eG5tEsaCvRigmdQ==" - }, - "node_modules/ts-data-class": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/ts-data-class/-/ts-data-class-0.10.0.tgz", - "integrity": "sha512-UnDgZ/kku2PxSJOL9z9IULqQngs4SltvmDaqCImNCH2vaTrptak9DLa0PTlinGUai1Z0MitvgaPZgLhLkBY7Og==", - "dependencies": { - "lodash.clone": "^4.5.0", - "lodash.clonedeep": "^4.5.0", - "lodash.isequal": "^4.5.0", - "lodash.isundefined": "^3.0.1", - "lodash.omitby": "^4.6.0" - } - }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -8598,7 +8473,8 @@ "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/tsutils": { "version": "3.21.0", @@ -8729,11 +8605,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undate": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/undate/-/undate-0.2.4.tgz", - "integrity": "sha512-k1WTRVhI076HYqP6e3pZPzS7K2xNAcuhCcWOPjHmR8SwU3byyKYvyNZ4XTEAd7Ofe40+wrEjNq6WmmO8WoUVNg==" - }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", @@ -10592,7 +10463,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "at-least-node": { "version": "1.0.0", @@ -10606,6 +10478,11 @@ "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", "dev": true }, + "autocompleter": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-9.1.2.tgz", + "integrity": "sha512-L4DJ2UIsIy/YrTchKHHfyQRng2p8m9xpari1uHYZ/5DynQombeshF73uVQbrtdLxLSlK0R7ObhpnbPBkI8j8xA==" + }, "autoprefixer": { "version": "10.4.13", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", @@ -10644,28 +10521,6 @@ "integrity": "sha512-b1WlTV8+XKLj9gZy2DZXgQiyDp9xkkoe2a6U6UbYccScq2wgH/YwCeI2/Jq2mgo0HzQxqJOjWZBLeA/mqsk5Mg==", "dev": true }, - "axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", - "requires": { - "follow-redirects": "^1.15.4", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - }, - "dependencies": { - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -11077,6 +10932,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -11484,7 +11340,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true }, "detective": { "version": "5.2.1", @@ -12248,11 +12105,6 @@ "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true }, - "eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==" - }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -12464,11 +12316,6 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, - "follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==" - }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -13385,28 +13232,6 @@ "integrity": "sha512-z35ZSEcXHxLW4yumw0dF6L464NT36vmx3wxJw8MDpraBcWuNVgUPZgPJKcu1HekNgwlMFNqol7i/IpSbjhqwqA==", "dev": true }, - "jira.js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jira.js/-/jira.js-3.0.2.tgz", - "integrity": "sha512-yysfjFYIFPE/hp8pJ/u3q6OBX/KYm4nMsmQym7JSO2pIJ4bIbdDLuz1DDGcHqi1DflfOSBKYc2BlJXTl5IZUEA==", - "requires": { - "axios": "^1.6.3", - "form-data": "^4.0.0", - "tslib": "^2.6.2" - }, - "dependencies": { - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "jose": { "version": "4.13.1", "resolved": "https://registry.npmjs.org/jose/-/jose-4.13.1.tgz", @@ -13711,37 +13536,12 @@ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true }, - "lodash.clone": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", - "integrity": "sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg==" - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, - "lodash.isundefined": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz", - "integrity": "sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==" - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.omitby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", - "integrity": "sha512-5OrRcIVR75M288p4nbI2WLAf3ndw2GD9fyNv3Bc15+WCxJDdZ4lYndSxGd7hnG6PVjiJTeJE2dHEGhIuKGicIQ==" - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -13819,12 +13619,14 @@ "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true }, "mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, "requires": { "mime-db": "1.52.0" } @@ -14605,11 +14407,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -15446,21 +15243,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "textarea-caret": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/textarea-caret/-/textarea-caret-3.1.0.tgz", - "integrity": "sha512-cXAvzO9pP5CGa6NKx0WYHl+8CHKZs8byMkt3PCJBCmq2a34YA9pO1NrQET5pzeqnBjBdToF5No4rrmkDUgQC2Q==" - }, - "textcomplete": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/textcomplete/-/textcomplete-0.18.2.tgz", - "integrity": "sha512-Z7RocuECp4S/Dld2swLRdXPYqCCMZvKmwrZHp8MQA4UJHX171/MjLeAj0uENEJPpa8JOtU01PK0iuVQUoFjSfg==", - "requires": { - "eventemitter3": "^2.0.3", - "textarea-caret": "^3.0.1", - "undate": "^0.2.3" - } - }, "thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -15553,23 +15335,6 @@ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true }, - "tributejs": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/tributejs/-/tributejs-5.1.3.tgz", - "integrity": "sha512-B5CXihaVzXw+1UHhNFyAwUTMDk1EfoLP5Tj1VhD9yybZ1I8DZJEv8tZ1l0RJo0t0tk9ZhR8eG5tEsaCvRigmdQ==" - }, - "ts-data-class": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/ts-data-class/-/ts-data-class-0.10.0.tgz", - "integrity": "sha512-UnDgZ/kku2PxSJOL9z9IULqQngs4SltvmDaqCImNCH2vaTrptak9DLa0PTlinGUai1Z0MitvgaPZgLhLkBY7Og==", - "requires": { - "lodash.clone": "^4.5.0", - "lodash.clonedeep": "^4.5.0", - "lodash.isequal": "^4.5.0", - "lodash.isundefined": "^3.0.1", - "lodash.omitby": "^4.6.0" - } - }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -15631,7 +15396,8 @@ "tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "tsutils": { "version": "3.21.0", @@ -15730,11 +15496,6 @@ "which-boxed-primitive": "^1.0.2" } }, - "undate": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/undate/-/undate-0.2.4.tgz", - "integrity": "sha512-k1WTRVhI076HYqP6e3pZPzS7K2xNAcuhCcWOPjHmR8SwU3byyKYvyNZ4XTEAd7Ofe40+wrEjNq6WmmO8WoUVNg==" - }, "unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", diff --git a/package.json b/package.json index 7af1e72..6596f82 100755 --- a/package.json +++ b/package.json @@ -15,12 +15,10 @@ "type": "module", "dependencies": { "@types/webextension-polyfill": "^0.10.0", - "jira.js": "^3.0.2", + "autocompleter": "^9.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.49.2", - "tributejs": "^5.1.3", - "ts-data-class": "^0.10.0", "webextension-polyfill": "^0.10.0" }, "devDependencies": { diff --git a/src/lib/jira.ts b/src/lib/jira.ts new file mode 100644 index 0000000..6ee72d1 --- /dev/null +++ b/src/lib/jira.ts @@ -0,0 +1,85 @@ +import { JiraCredentialStore, JiraCredentials } from './settings'; + +export class JiraIssue { + constructor(init?: Partial) { + Object.assign(this, init); + } + + key!: string; + summary!: string; + assignee!: string; +} + +export class JiraIssueRetriever { + private Credentials: JiraCredentials | null = null; + + async init(): Promise { + this.Credentials = await JiraCredentialStore.load(); + + if (!this.Credentials) { + throw new Error('Jira credentials not found'); + } + } + + async searchIssues(jql: string, startAt: number) : Promise<{issues: JiraIssue[], total: number}> { + if (!this.Credentials) { + throw new Error('Not initialized'); + } + + const params = { + 'jql': jql, + 'fields': 'summary,description,assignee', + 'startAt': startAt.toString(), + 'maxResults': '100', + } + + var url = new URL(this.Credentials.instanceUrl + '/rest/api/3/search'); + url.search = new URLSearchParams(params).toString(); + + const response = await fetch(url.toString(), { + method: 'GET', + headers: { + 'Authorization': `Basic ${btoa(`${this.Credentials.username}:${this.Credentials.apiToken}`)}`, + 'Accept': 'application/json', + } + }); + + if (!response.ok) { + throw new Error(`Failed to fetch issues: ${response.statusText}`); + } + + const rawIssueResponse = await response.json(); + + console.log(rawIssueResponse); + + const rawIssues = rawIssueResponse.issues; + const issues = rawIssues.map((rawIssue: any) => { + return new JiraIssue({ + key: rawIssue.key, + summary: rawIssue.fields.summary, + assignee: rawIssue.fields.assignee?.displayName || '', + }); + }); + + return { issues: issues, total: rawIssueResponse.total }; + } + + async getRecentlyUpdatedIssues(): Promise { + if (!this.Credentials) { + throw new Error('Not initialized'); + } + + const query = 'updated >= -30d order by updated DESC'; + + const initialResults = await this.searchIssues(query, 0); + const total = initialResults.total; + var issues = initialResults.issues; + + while (issues.length < total) { + const nextResults = await this.searchIssues(query, issues.length); + issues = issues.concat(nextResults.issues); + } + + return issues; + } +} diff --git a/src/utils/settings.ts b/src/lib/settings.ts similarity index 68% rename from src/utils/settings.ts rename to src/lib/settings.ts index 19b5b18..d651239 100644 --- a/src/utils/settings.ts +++ b/src/lib/settings.ts @@ -1,7 +1,6 @@ import browser from 'webextension-polyfill'; -import { DTClass, DTParsers } from 'ts-data-class'; -export class JiraCredentials /*extends DTClass */ { +export class JiraCredentials { constructor(init?: Partial) { Object.assign(this, init); } @@ -9,14 +8,6 @@ export class JiraCredentials /*extends DTClass */ { instanceUrl!: string; username!: string; apiToken!: string; - - // protected get parsers(): DTParsers { - // return { - // instanceUrl: (v) => (typeof v === "string" ? v : ""), - // username: (v) => (typeof v === "string" ? v : ""), - // apiToken: (v) => (typeof v === "string" ? v : ""), - // }; - // } } export class JiraCredentialStore { diff --git a/src/manifest/v3.mts b/src/manifest/v3.mts index fc234d4..fd774fe 100755 --- a/src/manifest/v3.mts +++ b/src/manifest/v3.mts @@ -18,7 +18,7 @@ const manifest: ManifestTypeV3 = { matches: [""], }, ], - permissions:[ "storage" ], + permissions:[ "storage", "webRequest" ], host_permissions: [ "https://*.atlassian.net/*", ] diff --git a/src/pages/background/index.js b/src/pages/background/index.js index 9e68657..d9de27c 100644 --- a/src/pages/background/index.js +++ b/src/pages/background/index.js @@ -1,16 +1,18 @@ import browser from 'webextension-polyfill'; -import { JiraIssue, JiraIssueRetriever } from '@src/utils/jira'; +import {JiraIssueRetriever} from '@src/lib/jira'; console.log("background script loaded"); -const jiraIssueRetriever = new JiraIssueRetriever(); - -browser.runtime.onMessage.addListener(async function (message) { +browser.runtime.onMessage.addListener(function (message, sender, sendResponse) { console.log("here"); if (message.type === "jiraSuggestions") { - await jiraIssueRetriever.init(); - const issues = await jiraIssueRetriever.getRecentlyUpdatedIssues(); - return issues; + const jiraIssueRetriever = new JiraIssueRetriever(); + jiraIssueRetriever.init().then(async () => { + const issues = await jiraIssueRetriever.getRecentlyUpdatedIssues(); + sendResponse(issues); + }); + + return true; } }); diff --git a/src/pages/content/index.tsx b/src/pages/content/index.tsx index d97e31c..d567dea 100644 --- a/src/pages/content/index.tsx +++ b/src/pages/content/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import { createRoot } from "react-dom/client"; -import Tribute from "tributejs"; -import { JiraIssueRetriever, JiraIssue } from "@src/utils/jira"; +import { JiraIssue } from "@src/lib/jira"; import browser from 'webextension-polyfill'; +import autocomplete, { AutocompleteItem } from "autocompleter"; import "./style.css"; @@ -14,20 +14,46 @@ async function init() { } const issues: JiraIssue[] = await browser.runtime.sendMessage({ type: "jiraSuggestions" }); - + console.log(issues); - var tribute = new Tribute({ - values: issues.map((issue: JiraIssue) => { - return { - key: issue.key + ": " + issue.summary, - value: issue.key + ": " + issue.summary, - }; - }) + type MyItem = JiraIssue & AutocompleteItem; + const te = document.getElementsByTagName("textarea")[0]; + + const autocompleteContainer = document.createElement("div"); + autocompleteContainer.classList.add("autocomplete"); + autocompleteContainer.role = "listbox"; + autocompleteContainer.style.backgroundColor = "white"; + autocompleteContainer.style.zIndex = "1"; + document.body.appendChild(autocompleteContainer); + + autocomplete({ + input: te, + emptyMsg: "No issues found", + fetch: (text: string, update: (items: JiraIssue[]) => void) => { + text = text.toLowerCase(); + const suggestions = issues.filter(n => n.summary.toLowerCase().includes(text)); + update(suggestions); + }, + onSelect: (item: JiraIssue) => { + te.value = `${item.key} - ${item.summary}`; + }, + render: (item: JiraIssue, currentValue: string) => { + const div = document.createElement("div"); + div.classList.add("autocomplete-entry"); + div.textContent = `${item.key} - ${item.summary}`; + + if (item.assignee) { + div.textContent += ` (${item.assignee})`; + } + + return div; + }, + click: e => e.fetch(), + container: autocompleteContainer, }); - const te = document.getElementsByTagName("textarea")[0]; - console.log(te); - tribute.attach(te); + + } document.addEventListener("DOMContentLoaded", init); diff --git a/src/pages/content/style.css b/src/pages/content/style.css index e69de29..c31fa72 100644 --- a/src/pages/content/style.css +++ b/src/pages/content/style.css @@ -0,0 +1,12 @@ +.autocomplete-entry { + background-color: #FFFFFF; + padding: 5px; + } + + .autocomplete-entry.selected { + background-color: #009ceb; + } + + .autocomplete-entry:hover { + background-color: #cbd1d3; + } \ No newline at end of file diff --git a/src/pages/popup/Popup.tsx b/src/pages/popup/Popup.tsx index 30998cb..72b8ea5 100644 --- a/src/pages/popup/Popup.tsx +++ b/src/pages/popup/Popup.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import { useForm } from "react-hook-form"; -import { JiraCredentialStore, JiraCredentials } from "@src/utils/settings"; +import { JiraCredentialStore, JiraCredentials } from "@src/lib/settings"; import logo from "@assets/img/logo.svg"; diff --git a/src/utils/autocomplete.ts b/src/utils/autocomplete.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/utils/jira.ts b/src/utils/jira.ts deleted file mode 100644 index 5b81b0c..0000000 --- a/src/utils/jira.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Version3Client, Config } from 'jira.js'; -import { JiraCredentialStore } from './settings'; -import {DTClass, DTParsers} from 'ts-data-class'; - -export class JiraIssue extends DTClass { - key!: string; - summary!: string; - assignee!: string; - - protected get parsers(): DTParsers { - return { - key: (v) => (typeof v === "string" ? v : ""), - summary: (v) => (typeof v === "string" ? v : ""), - assignee: (v) => (typeof v === "string" ? v : ""), - }; - } -} - -export class JiraIssueRetriever { - private jiraClient?: Version3Client; - - async init(): Promise { - const credentials = await JiraCredentialStore.load(); - - if (!credentials) { - throw new Error('Jira credentials not found'); - } - - const config: Config = { - host: credentials.instanceUrl, - authentication: { - basic: { - email: credentials.username, - apiToken: credentials.apiToken, - }, - }, - }; - - this.jiraClient = new Version3Client(config); - } - - async getRecentlyUpdatedIssues(): Promise { - if (!this.jiraClient) { - throw new Error('Jira client not initialized'); - } - - const response = await this.jiraClient.issueSearch.searchForIssuesUsingJql({ - jql: 'updated >= -30d order by updated DESC', - fields: ['summary', 'description', 'assignee'], - maxResults: 100, - }); - - const rawIssues = response.issues || []; - const issues = rawIssues.map((rawIssue) => { - return new JiraIssue({ - key: rawIssue.key, - summary: rawIssue.fields.summary, - assignee: rawIssue.fields.assignee?.displayName || '', - }); - }); - - return issues; - } -}