From 8d180df7b57230b748002e3396e2c9401ac4c231 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 11 May 2024 18:05:11 +0400 Subject: [PATCH 1/9] Dependencies updated --- .github/workflows/ci.yaml | 8 +- examples/package-lock.json | 44 +-- examples/package.json | 4 +- package-lock.json | 587 ++++++++++++++++++------------------- package.json | 22 +- 5 files changed, 320 insertions(+), 345 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25103bb032..e238ef589a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,9 @@ -name: ci -on: push +name: CI + +on: + push: + repository_dispatch: + types: [ pr-approved ] jobs: build: diff --git a/examples/package-lock.json b/examples/package-lock.json index 0afc186ab4..c94a22ca73 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -12,9 +12,9 @@ "jira.js": "latest" }, "devDependencies": { - "@types/node": "^20.11.20", + "@types/node": "^20.12.11", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.5" } }, "node_modules/@cspotcode/source-map-support": { @@ -55,9 +55,9 @@ } }, "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true }, "node_modules/@tsconfig/node12": { @@ -79,9 +79,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.11.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", - "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -120,11 +120,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -164,9 +164,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -196,11 +196,11 @@ } }, "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==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/jira.js/-/jira.js-3.0.5.tgz", + "integrity": "sha512-czIz7IxSGgW8eO9POYV7KTyLfRvrUvnw0DWfRZp4zWwPtiTNL8tkDa4E8HuFeOBk/aCG2SG0mJ/kdrKInn3cQw==", "dependencies": { - "axios": "^1.6.3", + "axios": "^1.6.8", "form-data": "^4.0.0", "tslib": "^2.6.2" } @@ -284,9 +284,9 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/examples/package.json b/examples/package.json index 13a547caf4..5b4a38cfc3 100644 --- a/examples/package.json +++ b/examples/package.json @@ -12,9 +12,9 @@ }, "license": "MIT", "devDependencies": { - "@types/node": "^20.11.20", + "@types/node": "^20.12.11", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.5" }, "dependencies": { "jira.js": "latest" diff --git a/package-lock.json b/package-lock.json index 0f1578eabd..2c3e2b839c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jira.js", - "version": "3.0.5", + "version": "4.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jira.js", - "version": "3.0.5", + "version": "4.0.0", "license": "MIT", "dependencies": { "axios": "^1.6.8", @@ -14,13 +14,13 @@ "tslib": "^2.6.2" }, "devDependencies": { - "@swc-node/register": "^1.9.0", - "@swc/helpers": "^0.5.6", - "@types/node": "^18.19.24", + "@swc-node/register": "^1.9.1", + "@swc/helpers": "^0.5.11", + "@types/node": "^18.19.33", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", - "ava": "^6.1.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "ava": "^6.1.3", "dotenv": "^16.4.5", "eslint": "^8.57.0", "eslint-config-airbnb-base": "^15.0.0", @@ -28,20 +28,11 @@ "eslint-plugin-import": "^2.29.1", "prettier": "^3.2.5", "prettier-plugin-jsdoc": "^1.3.0", - "sinon": "^17.0.1", + "sinon": "^17.0.2", "ts-node": "^10.9.2", - "typedoc": "^0.25.12", + "typedoc": "^0.25.13", "typedoc-plugin-extras": "^3.0.0", - "typescript": "^5.4.2" - } - }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "typescript": "^5.4.5" } }, "node_modules/@cspotcode/source-map-support": { @@ -184,9 +175,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "node_modules/@jridgewell/resolve-uri": { @@ -351,9 +342,9 @@ "dev": true }, "node_modules/@swc-node/core": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.13.0.tgz", - "integrity": "sha512-lFPD4nmy4ifAOVMChFjwlpXN5KQXvegqeyuzz1KQz42q1lf+cL3Qux1/GteGuZjh8HC+Rj1RdNrHpE/MCfJSTw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.13.1.tgz", + "integrity": "sha512-emB5l2nZsXjUEAuusqjYvWnQMLWZp6K039Mv8aq5SX1rsNM/N7DNhw1i4/DX7AyzNZ0tT+ASWyTvqEURldp5HA==", "dev": true, "engines": { "node": ">= 10" @@ -363,17 +354,17 @@ "url": "https://github.com/sponsors/Brooooooklyn" }, "peerDependencies": { - "@swc/core": ">= 1.3", + "@swc/core": ">= 1.4.13", "@swc/types": ">= 0.1" } }, "node_modules/@swc-node/register": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.9.0.tgz", - "integrity": "sha512-i0iYInD4q5v3xQC6bKvs0QtfUxu197CU5qKALmpxEqTYs7sIhQ7KFLe3kP+eAR4gRkJTvAgjQgrokXLN2jZrOw==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.9.1.tgz", + "integrity": "sha512-z//TBXJdRWXoISCXlQmVz+NMm8Qm/UvcfKiGC0tSJdfeVYf5EZkGqvk2OiRH4SIJ6OGFfS9T0YrvA2pDKzWtPA==", "dev": true, "dependencies": { - "@swc-node/core": "^1.13.0", + "@swc-node/core": "^1.13.1", "@swc-node/sourcemap-support": "^0.5.0", "colorette": "^2.0.20", "debug": "^4.3.4", @@ -385,7 +376,7 @@ "url": "https://github.com/sponsors/Brooooooklyn" }, "peerDependencies": { - "@swc/core": ">= 1.3", + "@swc/core": ">= 1.4.13", "typescript": ">= 4.3" } }, @@ -400,9 +391,9 @@ } }, "node_modules/@swc/core": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.4.8.tgz", - "integrity": "sha512-uY2RSJcFPgNOEg12RQZL197LZX+MunGiKxsbxmh22VfVxrOYGRvh4mPANFlrD1yb38CgmW1wI6YgIi8LkIwmWg==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.5.5.tgz", + "integrity": "sha512-M8O22EEgdSONLd+7KRrXj8pn+RdAZZ7ISnPjE9KCQQlI0kkFNEquWR+uFdlFxQfwlyCe/Zb6uGXGDvtcov4IMg==", "dev": true, "hasInstallScript": true, "peer": true, @@ -418,16 +409,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.4.8", - "@swc/core-darwin-x64": "1.4.8", - "@swc/core-linux-arm-gnueabihf": "1.4.8", - "@swc/core-linux-arm64-gnu": "1.4.8", - "@swc/core-linux-arm64-musl": "1.4.8", - "@swc/core-linux-x64-gnu": "1.4.8", - "@swc/core-linux-x64-musl": "1.4.8", - "@swc/core-win32-arm64-msvc": "1.4.8", - "@swc/core-win32-ia32-msvc": "1.4.8", - "@swc/core-win32-x64-msvc": "1.4.8" + "@swc/core-darwin-arm64": "1.5.5", + "@swc/core-darwin-x64": "1.5.5", + "@swc/core-linux-arm-gnueabihf": "1.5.5", + "@swc/core-linux-arm64-gnu": "1.5.5", + "@swc/core-linux-arm64-musl": "1.5.5", + "@swc/core-linux-x64-gnu": "1.5.5", + "@swc/core-linux-x64-musl": "1.5.5", + "@swc/core-win32-arm64-msvc": "1.5.5", + "@swc/core-win32-ia32-msvc": "1.5.5", + "@swc/core-win32-x64-msvc": "1.5.5" }, "peerDependencies": { "@swc/helpers": "^0.5.0" @@ -439,9 +430,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.8.tgz", - "integrity": "sha512-hhQCffRTgzpTIbngSnC30vV6IJVTI9FFBF954WEsshsecVoCGFiMwazBbrkLG+RwXENTrMhgeREEFh6R3KRgKQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.5.5.tgz", + "integrity": "sha512-Ol5ZwZYdTOZsv2NwjcT/qVVALKzVFeh+IJ4GNarr3P99+38Dkwi81OqCI1o/WaDXQYKAQC/V+CzMbkEuJJfq9Q==", "cpu": [ "arm64" ], @@ -456,9 +447,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.8.tgz", - "integrity": "sha512-P3ZBw8Jr8rKhY/J8d+6WqWriqngGTgHwtFeJ8MIakQJTbdYbFgXSZxcvDiERg3psbGeFXaUaPI0GO6BXv9k/OQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.5.5.tgz", + "integrity": "sha512-XHWpKBIPKYLgh5/lV2PYjO84lkzf5JR51kjiloyz2Pa9HIV8tHoAP8bYdJwm4nUp2I7KcEh3pPH0AVu5LpxMKw==", "cpu": [ "x64" ], @@ -473,9 +464,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.8.tgz", - "integrity": "sha512-PP9JIJt19bUWhAGcQW6qMwTjZOcMyzkvZa0/LWSlDm0ORYVLmDXUoeQbGD3e0Zju9UiZxyulnpjEN0ZihJgPTA==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.5.5.tgz", + "integrity": "sha512-vtoWNCWAe+CNSqtqIwFnIH48qgPPlUZKoQ4EVFeMM+7/kDi6SeNxoh5TierJs5bKAWxD49VkPvRoWFCk6V62mA==", "cpu": [ "arm" ], @@ -490,9 +481,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.8.tgz", - "integrity": "sha512-HvEWnwKHkoVUr5iftWirTApFJ13hGzhAY2CMw4lz9lur2m+zhPviRRED0FCI6T95Knpv7+8eUOr98Z7ctrG6DQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.5.5.tgz", + "integrity": "sha512-L4l7M78U6h/rCAxId+y5Vu+1KfDRF6dJZtitFcaT293guiUQFwJv8gLxI4Jh5wFtZ0fYd0QaCuvh2Ip79CzGMg==", "cpu": [ "arm64" ], @@ -507,9 +498,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.8.tgz", - "integrity": "sha512-kY8+qa7k/dEeBq9p0Hrta18QnJPpsiJvDQSLNaTIFpdM3aEM9zbkshWz8gaX5VVGUEALowCBUWqmzO4VaqM+2w==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.5.5.tgz", + "integrity": "sha512-DkzJc13ukXa7oJpyn24BjIgsiOybYrc+IxjsQyfNlDrrs1QXP4elStcpkD02SsIuSyHjZV8Hw2HFBMQB3OHPrA==", "cpu": [ "arm64" ], @@ -524,9 +515,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.8.tgz", - "integrity": "sha512-0WWyIw432wpO/zeGblwq4f2YWam4pn8Z/Ig4KzHMgthR/KmiLU3f0Z7eo45eVmq5vcU7Os1zi/Zb65OOt09q/w==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.5.5.tgz", + "integrity": "sha512-kj4ZwWJGeBEUzHrRQP2VudN+kkkYH7OI1dPVDc6kWQx5X4329JeKOas4qY0l7gDVjBbRwN9IbbPI6TIn2KfAug==", "cpu": [ "x64" ], @@ -541,9 +532,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.8.tgz", - "integrity": "sha512-p4yxvVS05rBNCrBaSTa20KK88vOwtg8ifTW7ec/yoab0bD5EwzzB8KbDmLLxE6uziFa0sdjF0dfRDwSZPex37Q==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.5.5.tgz", + "integrity": "sha512-6pTorCs4mYhPhYtC4jNOnhGgjNd3DZcRoZ9P0tzXXP69aCbYjvlgNH/NRvAROp9AaVFeZ7a7PmCWb6+Rbe7NKg==", "cpu": [ "x64" ], @@ -558,9 +549,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.8.tgz", - "integrity": "sha512-jKuXihxAaqUnbFfvPxtmxjdJfs87F1GdBf33il+VUmSyWCP4BE6vW+/ReDAe8sRNsKyrZ3UH1vI5q1n64csBUA==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.5.5.tgz", + "integrity": "sha512-o0/9pstmEjwZyrY/bA+mymF0zH7E+GT/XCVqdKeWW9Wn3gTTyWa5MZnrFgI2THQ+AXwdglMB/Zo76ARQPaz/+A==", "cpu": [ "arm64" ], @@ -575,9 +566,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.8.tgz", - "integrity": "sha512-O0wT4AGHrX8aBeH6c2ADMHgagAJc5Kf6W48U5moyYDAkkVnKvtSc4kGhjWhe1Yl0sI0cpYh2In2FxvYsb44eWw==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.5.5.tgz", + "integrity": "sha512-B+nypUwsmCuaH6RtKWgiPCb+ENjxstJPPJeMJvBqlJqyCaIkZzN4M07Ozi3xVv1VG21SRkd6G3xIqRoalrNc0Q==", "cpu": [ "ia32" ], @@ -592,9 +583,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.8.tgz", - "integrity": "sha512-C2AYc3A2o+ECciqsJWRgIpp83Vk5EaRzHe7ed/xOWzVd0MsWR+fweEsyOjlmzHfpUxJSi46Ak3/BIZJlhZbXbg==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.5.5.tgz", + "integrity": "sha512-ry83ki9ZX0Q+GWGnqc2J618Z+FvKE8Ajn42F8EYi8Wj0q6Jz3mj+pJzgzakk2INm2ldEZ+FaRPipn4ozsZDcBg==", "cpu": [ "x64" ], @@ -616,25 +607,28 @@ "peer": true }, "node_modules/@swc/helpers": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.6.tgz", - "integrity": "sha512-aYX01Ke9hunpoCexYAgQucEpARGQ5w/cqHFrIR+e9gdKb1QWTsVJuTJ2ozQzIAxLyRQe/m+2RqzkyOOGiMKRQA==", + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.11.tgz", + "integrity": "sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==", "dev": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@swc/types": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.5.tgz", - "integrity": "sha512-myfUej5naTBWnqOCc/MdVOLVjXUXtIA+NpDrDBKJtLLg2shUjBu3cZmB/85RyitKc55+lUUyl7oRfLOvkr2hsw==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.6.tgz", + "integrity": "sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==", "dev": true, - "peer": true + "peer": true, + "dependencies": { + "@swc/counter": "^0.1.3" + } }, "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true }, "node_modules/@tsconfig/node12": { @@ -692,9 +686,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz", - "integrity": "sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw==", + "version": "18.19.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", + "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -728,25 +722,25 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", - "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz", + "integrity": "sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/type-utils": "7.2.0", - "@typescript-eslint/utils": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/type-utils": "7.8.0", + "@typescript-eslint/utils": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -763,19 +757,19 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", - "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.8.0.tgz", + "integrity": "sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/typescript-estree": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -791,16 +785,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", - "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", + "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0" + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -808,18 +802,18 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", - "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz", + "integrity": "sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.2.0", - "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/utils": "7.8.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -835,12 +829,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", - "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -848,22 +842,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", - "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", + "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -876,21 +870,21 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", - "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.8.0.tgz", + "integrity": "sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/typescript-estree": "7.2.0", - "semver": "^7.5.4" + "@types/json-schema": "^7.0.15", + "@types/semver": "^7.5.8", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", + "semver": "^7.6.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -901,16 +895,16 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", - "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.2.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.8.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -924,9 +918,9 @@ "dev": true }, "node_modules/@vercel/nft": { - "version": "0.26.4", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", - "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", + "version": "0.26.5", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.5.tgz", + "integrity": "sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==", "dev": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.5", @@ -968,9 +962,9 @@ } }, "node_modules/acorn-import-attributes": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.2.tgz", - "integrity": "sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -1109,15 +1103,16 @@ } }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -1136,35 +1131,17 @@ "node": ">=8" } }, - "node_modules/array.prototype.filter": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz", - "integrity": "sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", - "integrity": "sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", + "es-abstract": "^1.23.2", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" }, "engines": { @@ -1265,9 +1242,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/ava": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ava/-/ava-6.1.2.tgz", - "integrity": "sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/ava/-/ava-6.1.3.tgz", + "integrity": "sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==", "dev": true, "dependencies": { "@vercel/nft": "^0.26.2", @@ -1315,7 +1292,7 @@ "ava": "entrypoints/cli.mjs" }, "engines": { - "node": "^18.18 || ^20.8 || ^21" + "node": "^18.18 || ^20.8 || ^21 || ^22" }, "peerDependencies": { "@ava/typescript": "*" @@ -1942,9 +1919,9 @@ } }, "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "dev": true, "engines": { "node": ">=8" @@ -2027,9 +2004,9 @@ "dev": true }, "node_modules/enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz", + "integrity": "sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -2040,9 +2017,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.1.tgz", - "integrity": "sha512-r+YVn6hTqQb+P5kK0u3KeDqrmhHKm+OhU/Mw4jSL4eQtOxXmp75fXIUUb3sUqFZOlb/YtW5JRaIfEC3UyjYUZQ==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", @@ -2082,13 +2059,13 @@ "regexp.prototype.flags": "^1.5.2", "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.5", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", "which-typed-array": "^1.1.15" }, @@ -2099,12 +2076,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true - }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -3005,9 +2976,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", - "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" @@ -3086,12 +3057,13 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3780,18 +3752,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -3976,9 +3936,9 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", - "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz", + "integrity": "sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==", "dev": true, "funding": [ { @@ -4329,9 +4289,9 @@ } }, "node_modules/micromark-util-subtokenize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", - "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz", + "integrity": "sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==", "dev": true, "funding": [ { @@ -4439,9 +4399,9 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -4554,9 +4514,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -4646,28 +4606,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", - "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -4677,27 +4638,28 @@ } }, "node_modules/object.groupby": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", - "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "dependencies": { - "array.prototype.filter": "^1.0.3", - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.0.0" + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -4716,17 +4678,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -4763,9 +4725,9 @@ } }, "node_modules/p-map": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.1.tgz", - "integrity": "sha512-2wnaR0XL/FDOj+TgpDuRb2KTjLnu3Fma6b1ZUwGY7LcqenMcvP/YFpjpbPKY6WVGsbuJZRuoUz8iPrt8ORnAFw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", "dev": true, "engines": { "node": ">=18" @@ -4857,9 +4819,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", + "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", "dev": true }, "node_modules/path-type": { @@ -5198,13 +5160,10 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -5335,17 +5294,17 @@ "dev": true }, "node_modules/sinon": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz", - "integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.2.tgz", + "integrity": "sha512-uihLiaB9FhzesElPDFZA7hDcNABzsVHwr3YfmM9sBllVwab3l0ltGlRV1XhpNfIacNDLGD1QRZNLs5nU5+hTuA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0", + "@sinonjs/commons": "^3.0.1", "@sinonjs/fake-timers": "^11.2.2", "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.5", - "supports-color": "^7.2.0" + "diff": "^5.2.0", + "nise": "^5.1.9", + "supports-color": "^7" }, "funding": { "type": "opencollective", @@ -5482,14 +5441,17 @@ } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5602,9 +5564,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -5828,9 +5790,9 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "dependencies": { "call-bind": "^1.0.7", @@ -5848,9 +5810,9 @@ } }, "node_modules/typedoc": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", - "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", + "version": "0.25.13", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.13.tgz", + "integrity": "sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -5878,9 +5840,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6103,6 +6065,15 @@ "node": ">=8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index f55b516491..1dcd7d2974 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "jira.js", - "version": "3.0.5", + "version": "4.0.0", "description": "A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.", "main": "out/index.js", "types": "out/index.d.ts", "repository": "https://github.com/MrRefactoring/jira.js.git", - "author": "Vladislav Tupikin ", + "author": "Vladislav Tupikin ", "license": "MIT", "keywords": [ "jira", @@ -65,13 +65,13 @@ } }, "devDependencies": { - "@swc-node/register": "^1.9.0", - "@swc/helpers": "^0.5.6", - "@types/node": "^18.19.24", + "@swc-node/register": "^1.9.1", + "@swc/helpers": "^0.5.11", + "@types/node": "^18.19.33", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", - "ava": "^6.1.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "ava": "^6.1.3", "dotenv": "^16.4.5", "eslint": "^8.57.0", "eslint-config-airbnb-base": "^15.0.0", @@ -79,11 +79,11 @@ "eslint-plugin-import": "^2.29.1", "prettier": "^3.2.5", "prettier-plugin-jsdoc": "^1.3.0", - "sinon": "^17.0.1", + "sinon": "^17.0.2", "ts-node": "^10.9.2", - "typedoc": "^0.25.12", + "typedoc": "^0.25.13", "typedoc-plugin-extras": "^3.0.0", - "typescript": "^5.4.2" + "typescript": "^5.4.5" }, "dependencies": { "axios": "^1.6.8", From fdb0e80da53eb21893dddc60768817d6782e4d7a Mon Sep 17 00:00:00 2001 From: Chalenge Masekera Date: Sat, 11 May 2024 10:09:21 -0400 Subject: [PATCH 2/9] add rate limiting headers to error response (#309) Signed-off-by: Chalenge Masekera <5385518+chalenge@users.noreply.github.com> --- src/clients/baseClient.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index 2578332b53..c0132b82b9 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -8,6 +8,8 @@ import type { RequestConfig } from '../requestConfig'; const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; +const RETRY_AFTER = 'Retry-After'; +const RATE_LIMIT_RESET = 'X-RateLimit-Reset'; export class BaseClient implements Client { private instance: AxiosInstance; @@ -133,11 +135,19 @@ export class BaseClient implements Client { } private buildErrorHandlingResponse(error: AxiosError) { + const headers = error.response?.headers ?? {}; + const responseData = error.response?.data ?? {}; + const data = typeof responseData === 'object' ? responseData : { data: responseData }; + return { code: error.code, + headers: this.removeUndefinedProperties({ + [RETRY_AFTER]: headers[RETRY_AFTER], + [RATE_LIMIT_RESET]: headers[RATE_LIMIT_RESET], + }), status: error.response?.status, statusText: error.response?.statusText, - ...(error.response?.data ?? {}), + ...data, }; } } From 4a17531eaf629bcb9631aba95479c71ca664bf88 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Mon, 13 May 2024 00:59:24 +0400 Subject: [PATCH 3/9] Agile endpoints updated --- CHANGELOG.md | 2 + src/agile/backlog.ts | 24 +- src/agile/board.ts | 39 +- src/agile/builds.ts | 2 +- src/agile/client/agileClient.ts | 4 + src/agile/deployments.ts | 2 +- src/agile/developmentInformation.ts | 36 +- src/agile/devopsComponents.ts | 189 ++++++++++ src/agile/epic.ts | 27 +- src/agile/featureFlags.ts | 4 +- src/agile/index.ts | 2 + src/agile/issue.ts | 16 +- src/agile/models/avatarUrls.ts | 1 - src/agile/models/board.ts | 62 +-- src/agile/models/createBoard.ts | 62 +-- src/agile/models/getAllBoards.ts | 2 +- src/agile/models/getAllQuickFilters.ts | 16 +- src/agile/models/getBoard.ts | 71 ++-- src/agile/models/getBoardByFilterId.ts | 12 +- src/agile/models/getBuildByKey.ts | 6 +- src/agile/models/getComponentById.ts | 59 +++ src/agile/models/getConfiguration.ts | 38 +- src/agile/models/getDeploymentByKey.ts | 8 +- .../models/getDeploymentGatingStatusByKey.ts | 4 +- src/agile/models/getFeatureFlagById.ts | 4 +- src/agile/models/getFeaturesForBoard.ts | 40 +- src/agile/models/getIncidentById.ts | 72 ++++ src/agile/models/getLinkedWorkspaceById.ts | 7 + src/agile/models/getLinkedWorkspaces.ts | 5 + src/agile/models/getQuickFilter.ts | 6 +- src/agile/models/getRemoteLinkById.ts | 18 +- src/agile/models/getRepository.ts | 12 +- src/agile/models/getReviewById.ts | 59 +++ src/agile/models/getVulnerabilityById.ts | 115 ++++++ src/agile/models/getWorkspaces.ts | 5 + src/agile/models/index.ts | 13 +- src/agile/models/issue.ts | 289 +++++++------- src/agile/models/issueTransition.ts | 59 +-- src/agile/models/jsonType.ts | 16 +- src/agile/models/linkGroup.ts | 20 +- src/agile/models/project.ts | 22 +- src/agile/models/scope.ts | 48 +++ src/agile/models/searchResults.ts | 16 +- src/agile/models/statusCategory.ts | 9 +- src/agile/models/submitComponents.ts | 29 ++ src/agile/models/submitEntity.ts | 29 ++ .../models/submitOperationsWorkspaces.ts | 5 + src/agile/models/submitRemoteLinks.ts | 2 +- src/agile/models/submitVulnerabilities.ts | 28 ++ src/agile/models/toggleFeatures.ts | 40 +- src/agile/models/user.ts | 23 +- src/agile/operations.ts | 357 ++++++++++++++++++ src/agile/parameters/deleteComponentById.ts | 4 + .../parameters/deleteComponentsByProperty.ts | 5 + .../parameters/deleteEntityByProperty.ts | 5 + src/agile/parameters/deleteIncidentById.ts | 4 + src/agile/parameters/deleteReviewById.ts | 4 + src/agile/parameters/deleteWorkspaces.ts | 3 + src/agile/parameters/getAllBoards.ts | 5 + src/agile/parameters/getComponentById.ts | 4 + src/agile/parameters/getIncidentById.ts | 4 + src/agile/parameters/getReviewById.ts | 4 + src/agile/parameters/getWorkspaces.ts | 3 + src/agile/parameters/index.ts | 13 + src/agile/parameters/submitComponents.ts | 78 ++++ src/agile/parameters/submitEntity.ts | 21 ++ .../parameters/submitOperationsWorkspaces.ts | 4 + src/agile/remoteLinks.ts | 2 +- src/agile/securityInformation.ts | 31 +- src/agile/sprint.ts | 46 +-- 70 files changed, 1754 insertions(+), 522 deletions(-) create mode 100644 src/agile/devopsComponents.ts create mode 100644 src/agile/models/getComponentById.ts create mode 100644 src/agile/models/getIncidentById.ts create mode 100644 src/agile/models/getLinkedWorkspaceById.ts create mode 100644 src/agile/models/getLinkedWorkspaces.ts create mode 100644 src/agile/models/getReviewById.ts create mode 100644 src/agile/models/getVulnerabilityById.ts create mode 100644 src/agile/models/getWorkspaces.ts create mode 100644 src/agile/models/scope.ts create mode 100644 src/agile/models/submitComponents.ts create mode 100644 src/agile/models/submitEntity.ts create mode 100644 src/agile/models/submitOperationsWorkspaces.ts create mode 100644 src/agile/models/submitVulnerabilities.ts create mode 100644 src/agile/operations.ts create mode 100644 src/agile/parameters/deleteComponentById.ts create mode 100644 src/agile/parameters/deleteComponentsByProperty.ts create mode 100644 src/agile/parameters/deleteEntityByProperty.ts create mode 100644 src/agile/parameters/deleteIncidentById.ts create mode 100644 src/agile/parameters/deleteReviewById.ts create mode 100644 src/agile/parameters/deleteWorkspaces.ts create mode 100644 src/agile/parameters/getComponentById.ts create mode 100644 src/agile/parameters/getIncidentById.ts create mode 100644 src/agile/parameters/getReviewById.ts create mode 100644 src/agile/parameters/getWorkspaces.ts create mode 100644 src/agile/parameters/submitComponents.ts create mode 100644 src/agile/parameters/submitEntity.ts create mode 100644 src/agile/parameters/submitOperationsWorkspaces.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ec8cd11c2..dd4e57872b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Jira.js changelog +### 4.0.0 + ### 3.0.5 - Dependencies updated diff --git a/src/agile/backlog.ts b/src/agile/backlog.ts index cbd1d0101d..d596232039 100644 --- a/src/agile/backlog.ts +++ b/src/agile/backlog.ts @@ -1,21 +1,19 @@ import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Backlog { constructor(private client: Client) {} /** - * Move issues to the backlog. - * + * Move issues to the backlog.\ * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may * be moved at once. */ async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; /** - * Move issues to the backlog. - * + * Move issues to the backlog.\ * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may * be moved at once. */ @@ -36,18 +34,20 @@ export class Backlog { } /** - * Move issues to the backlog of a particular board (if they are already on that board). This operation is equivalent - * to remove future and active sprints from a given set of issues if the board has sprints If the board does not have - * sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once. + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. */ async moveIssuesToBacklogForBoard( parameters: Parameters.MoveIssuesToBacklogForBoard, callback: Callback, ): Promise; /** - * Move issues to the backlog of a particular board (if they are already on that board). This operation is equivalent - * to remove future and active sprints from a given set of issues if the board has sprints If the board does not have - * sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once. + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. */ async moveIssuesToBacklogForBoard( parameters: Parameters.MoveIssuesToBacklogForBoard, @@ -62,8 +62,8 @@ export class Backlog { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/board.ts b/src/agile/board.ts index 5c224d2109..e6dbd3a395 100644 --- a/src/agile/board.ts +++ b/src/agile/board.ts @@ -1,19 +1,31 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { Paginated } from '../paginated'; import { RequestConfig } from '../requestConfig'; export class Board { constructor(private client: Client) {} - /** Returns all boards. This only includes boards that the user has permission to view. */ + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ async getAllBoards( parameters: Parameters.GetAllBoards | undefined, callback: Callback, ): Promise; - /** Returns all boards. This only includes boards that the user has permission to view. */ + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; async getAllBoards( parameters?: Parameters.GetAllBoards, @@ -34,6 +46,7 @@ export class Board { negateLocationFiltering: parameters?.negateLocationFiltering, orderBy: parameters?.orderBy, expand: parameters?.expand, + projectTypeLocation: parameters?.projectTypeLocation, filterId: parameters?.filterId, }, }; @@ -101,10 +114,10 @@ export class Board { url: '/rest/agile/1.0/board', method: 'POST', data: { - name: parameters.name, - type: parameters.type, filterId: parameters.filterId, location: parameters.location, + name: parameters.name, + type: parameters.type, }, }; @@ -465,15 +478,17 @@ export class Board { } /** - * Move issues from the backlog to the board (if they are already in the backlog of that board). This operation either - * moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) Or transitions the - * issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at once. + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. */ async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; /** - * Move issues from the backlog to the board (if they are already in the backlog of that board). This operation either - * moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) Or transitions the - * issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at once. + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. */ async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; async moveIssuesToBoard( @@ -485,8 +500,8 @@ export class Board { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/builds.ts b/src/agile/builds.ts index 1e55fc1fa0..87bdecbb5c 100644 --- a/src/agile/builds.ts +++ b/src/agile/builds.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Builds { diff --git a/src/agile/client/agileClient.ts b/src/agile/client/agileClient.ts index fc073b481a..7f98f186ac 100644 --- a/src/agile/client/agileClient.ts +++ b/src/agile/client/agileClient.ts @@ -5,9 +5,11 @@ import { Builds, Deployments, DevelopmentInformation, + DevopsComponents, Epic, FeatureFlags, Issue, + Operations, RemoteLinks, SecurityInformation, Sprint, @@ -19,9 +21,11 @@ export class AgileClient extends BaseClient { builds = new Builds(this); deployments = new Deployments(this); developmentInformation = new DevelopmentInformation(this); + devopsComponents = new DevopsComponents(this); epic = new Epic(this); featureFlags = new FeatureFlags(this); issue = new Issue(this); + operations = new Operations(this); remoteLinks = new RemoteLinks(this); securityInformation = new SecurityInformation(this); sprint = new Sprint(this); diff --git a/src/agile/deployments.ts b/src/agile/deployments.ts index 0ef2a56683..ef7d7a309c 100644 --- a/src/agile/deployments.ts +++ b/src/agile/deployments.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Deployments { diff --git a/src/agile/developmentInformation.ts b/src/agile/developmentInformation.ts index 84f3abd848..6522636350 100644 --- a/src/agile/developmentInformation.ts +++ b/src/agile/developmentInformation.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class DevelopmentInformation { @@ -99,26 +99,24 @@ export class DevelopmentInformation { } /** - * Deletes development information entities which have all the provided properties. Entities will be deleted that - * match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or - * equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be - * supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will - * eventually be removed from Jira. + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. */ async deleteByProperties( parameters: Parameters.DeleteByProperties, callback: Callback, ): Promise; /** - * Deletes development information entities which have all the provided properties. Entities will be deleted that - * match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or - * equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be - * supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will - * eventually be removed from Jira. + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. */ async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; async deleteByProperties( @@ -137,9 +135,9 @@ export class DevelopmentInformation { } /** - * Checks if development information which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity - * or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */ @@ -148,9 +146,9 @@ export class DevelopmentInformation { callback: Callback, ): Promise; /** - * Checks if development information which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity - * or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */ diff --git a/src/agile/devopsComponents.ts b/src/agile/devopsComponents.ts new file mode 100644 index 0000000000..b53e2e40c4 --- /dev/null +++ b/src/agile/devopsComponents.ts @@ -0,0 +1,189 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class DevopsComponents { + constructor(private client: Client) {} + + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback: Callback, + ): Promise; + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: never, + ): Promise; + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + components: parameters.components, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: never, + ): Promise; + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: never, + ): Promise; + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; + async deleteComponentById( + parameters: Parameters.DeleteComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/epic.ts b/src/agile/epic.ts index 2838a8f01a..67305a777f 100644 --- a/src/agile/epic.ts +++ b/src/agile/epic.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Epic { @@ -82,25 +82,6 @@ export class Epic { return this.client.sendRequest(config, callback); } - /** Returns searched epics according to provided parameters. */ - async searchEpics(parameters: Parameters.SearchEpics | undefined, callback: Callback): Promise; - /** Returns searched epics according to provided parameters. */ - async searchEpics(parameters?: Parameters.SearchEpics, callback?: never): Promise; - async searchEpics(parameters?: Parameters.SearchEpics, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/search', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - excludeDone: parameters?.excludeDone, - query: parameters?.query, - projectKey: parameters?.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - /** * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. * **Note:** This operation does not work for epics in next-gen projects. @@ -143,10 +124,10 @@ export class Epic { url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, method: 'POST', data: { - name: parameters.name, - summary: parameters.summary, color: parameters.color, done: parameters.done, + name: parameters.name, + summary: parameters.summary, }, }; @@ -240,8 +221,8 @@ export class Epic { url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, method: 'PUT', data: { - rankBeforeEpic: parameters.rankBeforeEpic, rankAfterEpic: parameters.rankAfterEpic, + rankBeforeEpic: parameters.rankBeforeEpic, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/featureFlags.ts b/src/agile/featureFlags.ts index cec77ba7d1..4b5494c6f0 100644 --- a/src/agile/featureFlags.ts +++ b/src/agile/featureFlags.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class FeatureFlags { @@ -110,7 +110,7 @@ export class FeatureFlags { url: '/rest/featureflags/0.1/bulkByProperties', method: 'DELETE', params: { - _updateSequenceId: parameters?.updateSequenceId, + _updateSequenceId: parameters.updateSequenceId, }, }; diff --git a/src/agile/index.ts b/src/agile/index.ts index 998d88ae3f..435eec8955 100644 --- a/src/agile/index.ts +++ b/src/agile/index.ts @@ -3,9 +3,11 @@ export * from './board'; export * from './builds'; export * from './deployments'; export * from './developmentInformation'; +export * from './devopsComponents'; export * from './epic'; export * from './featureFlags'; export * from './issue'; +export * from './operations'; export * from './remoteLinks'; export * from './securityInformation'; export * from './sprint'; diff --git a/src/agile/issue.ts b/src/agile/issue.ts index ddea844daa..15e224d421 100644 --- a/src/agile/issue.ts +++ b/src/agile/issue.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Issue { @@ -15,7 +15,7 @@ export class Issue { * * If rankCustomFieldId is not defined, the default rank field will be used. */ - async rankIssues(parameters: Parameters.RankIssues | undefined, callback: Callback): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; /** * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. * @@ -24,16 +24,16 @@ export class Issue { * * If rankCustomFieldId is not defined, the default rank field will be used. */ - async rankIssues(parameters?: Parameters.RankIssues, callback?: never): Promise; - async rankIssues(parameters?: Parameters.RankIssues, callback?: Callback): Promise { + async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/agile/1.0/issue/rank', method: 'PUT', data: { - issues: parameters?.issues, - rankBeforeIssue: parameters?.rankBeforeIssue, - rankAfterIssue: parameters?.rankAfterIssue, - rankCustomFieldId: parameters?.rankCustomFieldId, + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/models/avatarUrls.ts b/src/agile/models/avatarUrls.ts index 6fcacf202d..cda993d7f3 100644 --- a/src/agile/models/avatarUrls.ts +++ b/src/agile/models/avatarUrls.ts @@ -1,4 +1,3 @@ -/** Details about the avatars for an item. */ export interface AvatarUrls { /** The URL of the item's 16x16 pixel avatar. */ '16x16'?: string; diff --git a/src/agile/models/board.ts b/src/agile/models/board.ts index a7d91c6d77..0ebb1a9234 100644 --- a/src/agile/models/board.ts +++ b/src/agile/models/board.ts @@ -1,59 +1,59 @@ /** Details about a board. */ export interface Board { - /** The ID of the board. */ - id?: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; + /** Whether the user is active. */ + active?: boolean; avatarUrls?: { + /** The URL of the user's 16x16 pixel avatar. */ + '16x16'?: string; /** The URL of the user's 24x24 pixel avatar. */ '24x24'?: string; /** The URL of the user's 32x32 pixel avatar. */ '32x32'?: string; /** The URL of the user's 48x48 pixel avatar. */ '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; }; - }[]; - groups?: { - name?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/createBoard.ts b/src/agile/models/createBoard.ts index c0f01da7a5..06ceba0fa0 100644 --- a/src/agile/models/createBoard.ts +++ b/src/agile/models/createBoard.ts @@ -1,59 +1,59 @@ /** Details about a board. */ export interface CreateBoard { - /** The ID of the board. */ - id: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; + /** Whether the user is active. */ + active?: boolean; avatarUrls?: { + /** The URL of the user's 16x16 pixel avatar. */ + '16x16'?: string; /** The URL of the user's 24x24 pixel avatar. */ '24x24'?: string; /** The URL of the user's 32x32 pixel avatar. */ '32x32'?: string; /** The URL of the user's 48x48 pixel avatar. */ '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; }; - }[]; - groups?: { - name?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/getAllBoards.ts b/src/agile/models/getAllBoards.ts index 88ae94b38e..0b49271ec2 100644 --- a/src/agile/models/getAllBoards.ts +++ b/src/agile/models/getAllBoards.ts @@ -1,9 +1,9 @@ import { Board } from './board'; export interface GetAllBoards { + isLast?: boolean; maxResults?: number; startAt?: number; total?: number; - isLast?: boolean; values: Board[]; } diff --git a/src/agile/models/getAllQuickFilters.ts b/src/agile/models/getAllQuickFilters.ts index 96eb9f5d1b..f7cdb23ea9 100644 --- a/src/agile/models/getAllQuickFilters.ts +++ b/src/agile/models/getAllQuickFilters.ts @@ -1,14 +1,14 @@ export interface GetAllQuickFilters { - maxResults?: number; - startAt?: number; - total?: number; - isLast?: boolean; - values?: { - id?: number; + isLast: boolean; + maxResults: number; + startAt: number; + total: number; + values: { boardId?: number; - name?: string; - jql?: string; description?: string; + id?: number; + jql?: string; + name?: string; position?: number; }[]; } diff --git a/src/agile/models/getBoard.ts b/src/agile/models/getBoard.ts index 97fcc7a68e..e53bd87b66 100644 --- a/src/agile/models/getBoard.ts +++ b/src/agile/models/getBoard.ts @@ -1,59 +1,52 @@ +import { AvatarUrls } from './avatarUrls'; + /** Details about a board. */ export interface GetBoard { - /** The ID of the board. */ - id?: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; - avatarUrls?: { - /** The URL of the user's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the user's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the user's 48x48 pixel avatar. */ - '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; - }; - }[]; - groups?: { - name?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/getBoardByFilterId.ts b/src/agile/models/getBoardByFilterId.ts index 49f5242da3..980ba768d4 100644 --- a/src/agile/models/getBoardByFilterId.ts +++ b/src/agile/models/getBoardByFilterId.ts @@ -1,11 +1,11 @@ export interface GetBoardByFilterId { - maxResults?: number; - startAt?: number; - total?: number; - isLast?: boolean; - values?: { + isLast: boolean; + maxResults: number; + startAt: number; + total: number; + values: { id?: number; - self?: string; name?: string; + self?: string; }[]; } diff --git a/src/agile/models/getBuildByKey.ts b/src/agile/models/getBuildByKey.ts index cb886e7606..c22eae5bd0 100644 --- a/src/agile/models/getBuildByKey.ts +++ b/src/agile/models/getBuildByKey.ts @@ -5,7 +5,7 @@ export interface GetBuildByKey { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** * An ID that relates a sequence of builds. Depending on your use case this might be a project ID, pipeline ID, plan * key etc. - whatever logical unit you use to group a sequence of builds. @@ -58,7 +58,7 @@ export interface GetBuildByKey { * - `cancelled` - The build has been cancelled or stopped. * - `unknown` - The build is in an unknown state. */ - state: string; + state: 'pending' | 'in_progress' | 'successful' | 'failed' | 'cancelled' | 'unknown' | string; /** The last-updated timestamp to present to the user as a summary of the state of the build. */ lastUpdated: string; /** @@ -101,7 +101,7 @@ export interface GetBuildByKey { /** The name of the ref the build ran on */ name: string; /** - * An identifer for the ref. + * An identifier for the ref. * * In most cases this should be the URL of the tag/branch etc. in the SCM provider. * diff --git a/src/agile/models/getComponentById.ts b/src/agile/models/getComponentById.ts new file mode 100644 index 0000000000..bbf18cf66e --- /dev/null +++ b/src/agile/models/getComponentById.ts @@ -0,0 +1,59 @@ +/** Data related to a specific component in a specific workspace that is affected by incidents.* */ +export interface GetComponentById { + /** + * The DevOpsComponentData schema version used for this devops component data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the DevOps Component. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this DevOps Component in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each DevOps + * Component and increment that on each update to Jira). + * + * Updates for a DevOps Component that are received with an updateSqeuenceId lower than what is currently stored will + * be ignored. + */ + updateSequenceNumber: number; + /** The human-readable name for the DevOps Component. Will be shown in the UI. */ + name: string; + /** The human-readable name for the Provider that owns this DevOps Component. Will be shown in the UI. */ + providerName?: string; + /** A description of the DevOps Component in Markdown format. Will be shown in the UI. */ + description: string; + /** + * A URL users can use to link to a summary view of this devops component, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the component in that project). + */ + url: string; + /** A URL to display a logo representing this devops component, if available. */ + avatarUrl: string; + /** The tier of the component. Will be shown in the UI. */ + tier: 'Tier 1' | 'Tier 2' | 'Tier 3' | 'Tier 4' | string; + /** The type of the component. Will be shown in the UI. */ + componentType: + | 'Service' + | 'Application' + | 'Library' + | 'Capability' + | 'Cloud resource' + | 'Data pipeline' + | 'Machine learning model' + | 'UI element' + | 'Website' + | 'Other' + | string; + /** + * The last-updated timestamp to present to the user the last time the DevOps Component was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; +} diff --git a/src/agile/models/getConfiguration.ts b/src/agile/models/getConfiguration.ts index 689a9aaa3b..d9c84a3768 100644 --- a/src/agile/models/getConfiguration.ts +++ b/src/agile/models/getConfiguration.ts @@ -1,39 +1,39 @@ export interface GetConfiguration { - id?: number; - name?: string; - type?: string; - self?: string; - location?: { - type?: string; - projectKeyOrId?: string; - }; - filter?: { - id?: string; - self?: string; - }; - subQuery?: { - query?: string; - }; columnConfig?: { columns?: { + max?: number; + min?: number; name?: string; statuses?: { id?: string; self?: string; }[]; - min?: number; - max?: number; }[]; constraintType?: string; }; estimation?: { - type?: string; field?: { - fieldId?: string; displayName?: string; + fieldId?: string; }; + type?: string; + }; + filter?: { + id?: string; + self?: string; + }; + id?: number; + location?: { + projectKeyOrId?: string; + type?: 'project' | 'user' | string; }; + name?: string; ranking?: { rankCustomFieldId?: number; }; + self?: string; + subQuery?: { + query?: string; + }; + type?: string; } diff --git a/src/agile/models/getDeploymentByKey.ts b/src/agile/models/getDeploymentByKey.ts index 34097b386f..318669bbb5 100644 --- a/src/agile/models/getDeploymentByKey.ts +++ b/src/agile/models/getDeploymentByKey.ts @@ -32,8 +32,10 @@ export interface GetDeploymentByKey { * information etc. for the deployment. */ label?: string; + /** The duration of the deployment (in seconds). */ + duration?: number; /** The state of the deployment */ - state: string; + state: 'unknown' | 'pending' | 'in_progress' | 'cancelled' | 'failed' | 'rolled_back' | 'successful' | string; /** * This object models the Continuous Delivery (CD) Pipeline concept, an automated process (usually comprised of * multiple stages) @@ -55,7 +57,7 @@ export interface GetDeploymentByKey { /** The name of the environment to present to the user. */ displayName: string; /** The type of the environment. */ - type: string; + type: 'unmapped' | 'development' | 'testing' | 'staging' | 'production' | string; }; /** A list of commands to be actioned for this Deployment */ commands?: { @@ -67,5 +69,5 @@ export interface GetDeploymentByKey { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; } diff --git a/src/agile/models/getDeploymentGatingStatusByKey.ts b/src/agile/models/getDeploymentGatingStatusByKey.ts index 9032c0d173..90dce6465e 100644 --- a/src/agile/models/getDeploymentGatingStatusByKey.ts +++ b/src/agile/models/getDeploymentGatingStatusByKey.ts @@ -9,10 +9,10 @@ export interface GetDeploymentGatingStatusByKey { /** Time the deployment gating status was updated. */ updatedTimestamp?: string; /** The gating status */ - gatingStatus?: string; + gatingStatus?: 'allowed' | 'prevented' | 'awaiting' | 'invalid' | string; details?: { /** The type of the gating status details. */ - type: string; + type: 'issue' | string; /** An issue key that references an issue in Jira. */ issueKey: string; /** diff --git a/src/agile/models/getFeatureFlagById.ts b/src/agile/models/getFeatureFlagById.ts index 7142e418e1..a2e667ae06 100644 --- a/src/agile/models/getFeatureFlagById.ts +++ b/src/agile/models/getFeatureFlagById.ts @@ -5,7 +5,7 @@ export interface GetFeatureFlagById { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** The identifier for the Feature Flag. Must be unique for a given Provider. */ id: string; /** @@ -119,7 +119,7 @@ export interface GetFeatureFlagById { /** The name of the environment. */ name: string; /** The 'type' or 'category' of environment this environment belongs to. */ - type?: string; + type?: 'development' | 'testing' | 'staging' | 'production' | string; }; /** Status information about a single Feature Flag. */ status: { diff --git a/src/agile/models/getFeaturesForBoard.ts b/src/agile/models/getFeaturesForBoard.ts index d1f86cc621..cd56e08e9d 100644 --- a/src/agile/models/getFeaturesForBoard.ts +++ b/src/agile/models/getFeaturesForBoard.ts @@ -1,21 +1,41 @@ export interface GetFeaturesForBoard { features?: { - boardFeature?: string; + boardFeature?: + | 'SIMPLE_ROADMAP' + | 'BACKLOG' + | 'SPRINTS' + | 'CALENDAR' + | 'DEVTOOLS' + | 'REPORTS' + | 'ESTIMATION' + | 'PAGES' + | 'CODE' + | 'SECURITY' + | 'REQUESTS' + | 'INCIDENTS' + | 'RELEASES' + | 'DEPLOYMENTS' + | 'ISSUE_NAVIGATOR' + | 'ON_CALL_SCHEDULE' + | 'BOARD' + | 'GOALS' + | 'LIST_VIEW' + | string; boardId?: number; - state?: string; - localisedName?: string; - localisedDescription?: string; - learnMoreLink?: string; + featureId?: string; + featureType?: 'BASIC' | 'ESTIMATION' | string; imageUri?: string; - featureType?: string; + learnMoreArticleId?: string; + learnMoreLink?: string; + localisedDescription?: string; localisedGroup?: string; + localisedName?: string; permissibleEstimationTypes?: { - value?: string; - localisedName?: string; localisedDescription?: string; + localisedName?: string; + value?: 'STORY_POINTS' | 'ORIGINAL_ESTIMATE' | string; }[]; - featureId?: string; - learnMoreArticleId?: string; + state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON' | string; toggleLocked?: boolean; }[]; } diff --git a/src/agile/models/getIncidentById.ts b/src/agile/models/getIncidentById.ts new file mode 100644 index 0000000000..09963f749c --- /dev/null +++ b/src/agile/models/getIncidentById.ts @@ -0,0 +1,72 @@ +/** + * Data related to a specific incident in a specific container that the incident is present in. Must specify at least + * one association to a component.* + */ +export interface GetIncidentById { + /** + * The IncidentData schema version used for this incident data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Incident. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Incident in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Incident and + * increment that on each update to Jira). + * + * Updates for a Incident that are received with an updateSqeuenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** The IDs of the Components impacted by this Incident. Must be unique for a given Provider. */ + affectedComponents: string[]; + /** + * The human-readable summary for the Incident. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + summary: string; + /** A description of the issue in Markdown format. Will be shown in the UI and used when creating Jira Issues. */ + description: string; + /** + * A URL users can use to link to a summary view of this incident, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the incident in that project). + */ + url: string; + /** + * The timestamp to present to the user that shows when the Incident was raised. + * + * Expected format is an RFC3339 formatted string. + */ + createdDate: string; + /** + * The last-updated timestamp to present to the user the last time the Incident was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** + * Severity information for a single Incident. + * + * This is the severity information that will be presented to the user on e.g. the Jira Incidents screen. + */ + severity?: { + /** The severity level of the Incident with P1 being the highest and P5 being the lowest */ + level: 'P1' | 'P2' | 'P3' | 'P4' | 'P5' | 'unknown' | string; + }; + /** The current status of the Incident. */ + status: 'open' | 'resolved' | 'unknown' | string; + /** The IDs of the Jira issues related to this Incident. Must be unique for a given Provider. */ + associations?: { + /** The type of the association being made */ + associationType?: 'issueIdOrKeys' | 'serviceIdOrKeys' | 'ati:cloud:compass:event-source' | string; + values?: string[]; + }[]; +} diff --git a/src/agile/models/getLinkedWorkspaceById.ts b/src/agile/models/getLinkedWorkspaceById.ts new file mode 100644 index 0000000000..eb9eaf1467 --- /dev/null +++ b/src/agile/models/getLinkedWorkspaceById.ts @@ -0,0 +1,7 @@ +/** The Security Workspace information stored for the given ID. */ +export interface GetLinkedWorkspaceById { + /** The Security Workspace ID */ + workspaceId: string; + /** Latest date and time that the Security Workspace was updated in Jira. */ + updatedAt: string; +} diff --git a/src/agile/models/getLinkedWorkspaces.ts b/src/agile/models/getLinkedWorkspaces.ts new file mode 100644 index 0000000000..c127cd2dad --- /dev/null +++ b/src/agile/models/getLinkedWorkspaces.ts @@ -0,0 +1,5 @@ +/** The payload of linked Security Workspace IDs. */ +export interface GetLinkedWorkspaces { + /** The IDs of Security Workspaces that are linked to this Jira site. */ + workspaceIds: string[]; +} diff --git a/src/agile/models/getQuickFilter.ts b/src/agile/models/getQuickFilter.ts index 9e9cdb9035..f48dad99e1 100644 --- a/src/agile/models/getQuickFilter.ts +++ b/src/agile/models/getQuickFilter.ts @@ -1,8 +1,8 @@ export interface GetQuickFilter { - id?: number; boardId?: number; - name?: string; - jql?: string; description?: string; + id?: number; + jql?: string; + name?: string; position?: number; } diff --git a/src/agile/models/getRemoteLinkById.ts b/src/agile/models/getRemoteLinkById.ts index b33cf3de6d..6f0e6f80d1 100644 --- a/src/agile/models/getRemoteLinkById.ts +++ b/src/agile/models/getRemoteLinkById.ts @@ -1,11 +1,11 @@ -/** Data related to a single Remote Link. */ +/** Data related to a single Remote Link.* */ export interface GetRemoteLinkById { /** * The schema version used for this data. * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** The identifier for the Remote Link. Must be unique for a given Provider. */ id: string; /** @@ -31,7 +31,17 @@ export interface GetRemoteLinkById { * The type of the Remote Link. The current supported types are 'document', 'alert', 'test', 'security', 'logFile', * 'prototype', 'coverage', 'bugReport' and 'other' */ - type: string; + type: + | 'document' + | 'alert' + | 'test' + | 'security' + | 'logFile' + | 'prototype' + | 'coverage' + | 'bugReport' + | 'other' + | string; /** * An optional description to attach to this Remote Link. * @@ -49,7 +59,7 @@ export interface GetRemoteLinkById { * they correspond to are equivalent to atlaskit's [Lozenge](https://atlaskit.atlassian.com/packages/core/lozenge) * component. */ - appearance: string; + appearance: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'prototype' | 'success' | string; /** * The human-readable description for the Remote Link status. * diff --git a/src/agile/models/getRepository.ts b/src/agile/models/getRepository.ts index bdfcc04426..c1678061bf 100644 --- a/src/agile/models/getRepository.ts +++ b/src/agile/models/getRepository.ts @@ -31,7 +31,7 @@ export interface GetRepository { */ updateSequenceId: number; /** The set of flags for this commit */ - flags?: string[]; + flags?: ('MERGE_COMMIT' | string)[]; /** * The commit message. Max length is 1024 characters. If anything longer is supplied, it will be truncated down to * 1024 characters. @@ -56,7 +56,7 @@ export interface GetRepository { /** The URL of this file. Max length is 2000 characters. */ url: string; /** The operation performed on this file */ - changeType: string; + changeType: 'ADDED' | 'COPIED' | 'DELETED' | 'MODIFIED' | 'MOVED' | 'UNKNOWN' | string; /** Number of lines added to the file */ linesAdded: number; /** Number of lines removed from the file */ @@ -110,7 +110,7 @@ export interface GetRepository { */ updateSequenceId: number; /** The set of flags for this commit */ - flags?: string[]; + flags?: ('MERGE_COMMIT' | string)[]; /** * The commit message. Max length is 1024 characters. If anything longer is supplied, it will be truncated down to * 1024 characters. @@ -135,7 +135,7 @@ export interface GetRepository { /** The URL of this file. Max length is 2000 characters. */ url: string; /** The operation performed on this file */ - changeType: string; + changeType: 'ADDED' | 'COPIED' | 'DELETED' | 'MODIFIED' | 'MOVED' | 'UNKNOWN' | string; /** Number of lines added to the file */ linesAdded: number; /** Number of lines removed from the file */ @@ -176,7 +176,7 @@ export interface GetRepository { * The status of the pull request. In the case of concurrent updates, priority is given in the order OPEN, MERGED, * DECLINED, UNKNOWN */ - status: string; + status: 'OPEN' | 'MERGED' | 'DECLINED' | 'UNKNOWN' | string; /** Title of the pull request. Max length is 1024 characters. */ title: string; /** Describes the author of a particular entity */ @@ -202,7 +202,7 @@ export interface GetRepository { /** The list of reviewers of this pull request */ reviewers?: { /** The approval status of this reviewer, default is UNAPPROVED. */ - approvalStatus?: string; + approvalStatus?: 'APPROVED' | 'UNAPPROVED' | string; /** The email address of this reviewer. Max length is 254 characters. */ email?: string; /** The Atlassian Account ID (AAID) of this reviewer. Max length is 128 characters. */ diff --git a/src/agile/models/getReviewById.ts b/src/agile/models/getReviewById.ts new file mode 100644 index 0000000000..1e1af90b20 --- /dev/null +++ b/src/agile/models/getReviewById.ts @@ -0,0 +1,59 @@ +/** Data related to a specific post-incident review. Must specify at least one association to an incident.* */ +export interface GetReviewById { + /** + * The PostIncidentReviewData schema version used for this post-incident review data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Review. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Review in the case of out-of-order receipt of update requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Review and + * increment that on each update to Jira). + * + * Updates for a Review that are received with an updateSqeuenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** The IDs of the Incidents covered by this Review. Must be unique for a given Provider. */ + reviews: string[]; + /** + * The human-readable summary for the Post-Incident Review. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + summary: string; + /** A description of the review in Markdown format. Will be shown in the UI and used when creating Jira Issues. */ + description: string; + /** + * A URL users can use to link to a summary view of this review, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the review in that project). + */ + url: string; + /** + * The timestamp to present to the user that shows when the Review was raised. + * + * Expected format is an RFC3339 formatted string. + */ + createdDate: string; + /** + * The last-updated timestamp to present to the user the last time the Review was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** The current status of the Post-Incident Review. */ + status: 'in progress' | 'outstanding actions' | 'completed' | 'unknown' | string; + /** The IDs of the Jira issues related to this Incident. Must be unique for a given Provider. */ + associations?: { + /** The type of the association being made */ + associationType?: 'issueIdOrKeys' | 'serviceIdOrKeys' | 'ati:cloud:compass:event-source' | string; + values?: string[]; + }[]; +} diff --git a/src/agile/models/getVulnerabilityById.ts b/src/agile/models/getVulnerabilityById.ts new file mode 100644 index 0000000000..0dfcf13ab0 --- /dev/null +++ b/src/agile/models/getVulnerabilityById.ts @@ -0,0 +1,115 @@ +/** + * Data related to a specific vulnerability in a specific workspace that the vulnerability is present in. Must specify + * at least one association.* + */ +export interface GetVulnerabilityById { + /** + * The VulnerabilityData schema version used for this vulnerability data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Vulnerability. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Vulnerability in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Vulnerability + * and increment that on each update to Jira). + * + * Updates for a Vulnerability that are received with an updateSequenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** + * The identifier of the Container where this Vulnerability was found. Must be unique for a given Provider. This must + * follow this regex pattern: `[a-zA-Z0-9\\-_.~@:{}=]+(/[a-zA-Z0-9\\-_.~@:{}=]+)*` + */ + containerId: string; + /** + * The human-readable name for the Vulnerability. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + displayName: string; + /** + * A description of the issue in markdown format that will be shown in the UI and used when creating Jira Issues. HTML + * tags are not supported in the markdown format. For creating a new line `\n` can be used. Read more about the + * accepted markdown transformations + * [here](https://atlaskit.atlassian.com/packages/editor/editor-markdown-transformer). + */ + description: string; + /** + * A URL users can use to link to a summary view of this vulnerability, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the vulnerability in that project). + */ + url: string; + /** The type of Vulnerability detected. */ + type: 'sca' | 'sast' | 'dast' | 'unknown' | string; + /** + * The timestamp to present to the user that shows when the Vulnerability was introduced. + * + * Expected format is an RFC3339 formatted string. + */ + introducedDate: string; + /** + * The last-updated timestamp to present to the user the last time the Vulnerability was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** + * Severity information for a single Vulnerability. + * + * This is the severity information that will be presented to the user on e.g. the Jira Security screen. + */ + severity: { + /** The severity level of the Vulnerability. */ + level: 'critical' | 'high' | 'medium' | 'low' | 'unknown' | string; + }; + /** The identifying information for the Vulnerability. */ + identifiers?: { + /** The display name of the Vulnerability identified. */ + displayName: string; + /** A URL users can use to link to the definition of the Vulnerability identified. */ + url: string; + }[]; + /** The current status of the Vulnerability. */ + status: 'open' | 'closed' | 'ignored' | 'unknown' | string; + /** Extra information (optional). This data will be shown in the security feature under the vulnerability displayName. */ + additionalInfo?: { + /** The content of the additionalInfo. */ + content: string; + /** Optional URL linking to the information */ + url?: string; + }; + /** + * The associations (e.g. Jira issue) to add in addition to the currently stored associations of the Security + * Vulnerability. + */ + addAssociations?: {}[]; + /** The associations (e.g. Jira issue) to remove from currently stored associations of the Security Vulnerability. */ + removeAssociations?: {}[]; + /** + * An ISO-8601 Date-time string representing the last time the provider updated associations on this entity. + * + * Expected format is an RFC3339 formatted string. + */ + associationsLastUpdated?: string; + /** + * A sequence number to compare when writing entity associations to the database. + * + * This can be any monotonically increasing number. A highly recommended implementation is to use epoch millis. + * + * This is an optional field. If it is not provided it will default to being equal to the corresponding entity's + * `updateSequenceNumber`. + * + * Associations are written following a LastWriteWins strategy, association that are received with an + * associationsUpdateSequenceNumber lower than what is currently stored will be ignored. + */ + associationsUpdateSequenceNumber?: number; +} diff --git a/src/agile/models/getWorkspaces.ts b/src/agile/models/getWorkspaces.ts new file mode 100644 index 0000000000..d4c6037343 --- /dev/null +++ b/src/agile/models/getWorkspaces.ts @@ -0,0 +1,5 @@ +/** The payload of Operations Workspace Ids. */ +export interface GetWorkspaces { + /** The IDs of Operations Workspaces that are available to this Jira site. */ + workspaceIds: string[]; +} diff --git a/src/agile/models/index.ts b/src/agile/models/index.ts index ce8d4fcaec..2ced13b5d0 100644 --- a/src/agile/models/index.ts +++ b/src/agile/models/index.ts @@ -10,15 +10,22 @@ export * from './getAllQuickFilters'; export * from './getBoard'; export * from './getBoardByFilterId'; export * from './getBuildByKey'; +export * from './getComponentById'; export * from './getConfiguration'; export * from './getDeploymentByKey'; export * from './getDeploymentGatingStatusByKey'; export * from './getFeatureFlagById'; export * from './getFeaturesForBoard'; +export * from './getIncidentById'; +export * from './getLinkedWorkspaceById'; +export * from './getLinkedWorkspaces'; export * from './getQuickFilter'; export * from './getRemoteLinkById'; export * from './getReportsForBoard'; export * from './getRepository'; +export * from './getReviewById'; +export * from './getVulnerabilityById'; +export * from './getWorkspaces'; export * from './group'; export * from './issue'; export * from './issueTransition'; @@ -28,6 +35,7 @@ export * from './linkedSecurityWorkspaceIds'; export * from './linkedWorkspace'; export * from './linkGroup'; export * from './operations'; +export * from './scope'; export * from './progress'; export * from './project'; export * from './projects'; @@ -37,10 +45,13 @@ export * from './status'; export * from './statusCategory'; export * from './storeDevelopmentInformation'; export * from './submitBuilds'; +export * from './submitComponents'; export * from './submitDeployments'; +export * from './submitEntity'; export * from './submitFeatureFlags'; +export * from './submitOperationsWorkspaces'; export * from './submitRemoteLinks'; -export * from './submittedVulnerabilitiesResult'; +export * from './submitVulnerabilities'; export * from './toggleFeatures'; export * from './user'; export * from './version'; diff --git a/src/agile/models/issue.ts b/src/agile/models/issue.ts index 88498d6f54..dbb296af89 100644 --- a/src/agile/models/issue.ts +++ b/src/agile/models/issue.ts @@ -1,94 +1,15 @@ -import { Fields } from './fields'; import { Operations } from './operations'; +import { Fields } from './fields'; +import { Scope } from './scope'; +import { StatusCategory } from './statusCategory'; +import { AvatarUrls } from './avatarUrls'; /** Details about an issue. */ export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id?: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key?: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The URL of the status. */ - self?: string; - statusColor?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - /** A status category. */ - statusCategory?: { - /** The URL of the status category. */ - self?: string; - /** The ID of the status category. */ - id?: number; - /** The key of the status category. */ - key?: string; - /** The name of the color used to represent the status category. */ - colorName?: string; - /** The name of the status category. */ - name?: string; - }; - }; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; - }[]; - operations?: Operations; - /** A list of editable field details. */ - editmeta?: { - /** A list of editable field details. */ - fields?: any; - }; /** A page of changelogs. */ changelog?: { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; /** The list of changelogs. */ histories?: { - /** The ID of the changelog. */ - id?: string; /** * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * @@ -100,132 +21,196 @@ export interface Issue { * parameters have fallback values. */ author?: { - /** The URL of the user. */ - self?: string; /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** Details about the avatars for an item. */ - avatarUrls?: { - /** The URL of the item's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the item's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the item's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the item's 48x48 pixel avatar. */ - '48x48'?: string; - }; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' + * (application user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; /** Whether the user is active. */ active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** The URL of the user. */ + self?: string; /** * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned * as null. */ timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' - * (application user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; }; /** The date on which the change took place. */ created?: string; - /** The list of items changed. */ - items?: { - /** The name of the field changed. */ - field?: string; - /** The type of the field changed. */ - fieldtype?: string; - /** The ID of the field changed. */ - fieldId?: string; - /** The details of the original value. */ - from?: string; - /** The details of the original value as a string. */ - fromString?: string; - /** The details of the new value. */ - to?: string; - /** The details of the new value as a string. */ - toString?: string; - }[]; /** Details of issue history metadata. */ historyMetadata?: { - /** The type of the history record. */ - type?: string; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; /** The activity described in the history record. */ activityDescription?: string; /** The key of the activity described in the history record. */ activityDescriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; /** Details of user or system associated with a issue history metadata item. */ actor?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; /** Details of user or system associated with a issue history metadata item. */ - generator?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + cause?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; /** Details of user or system associated with a issue history metadata item. */ - cause?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + generator?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; - /** Additional arbitrary information about the history record. */ - extraData?: {}; + /** The type of the history record. */ + type?: string; }; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: { + /** The name of the field changed. */ + field?: string; + /** The ID of the field changed. */ + fieldId?: string; + /** The type of the field changed. */ + fieldtype?: string; + /** The details of the original value. */ + from?: string; + /** The details of the original value as a string. */ + fromString?: string; + /** The details of the new value. */ + to?: string; + /** The details of the new value as a string. */ + toString?: string; + }[]; }[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; }; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; + /** A list of editable field details. */ + editmeta?: { + fields?: {}; + }; + /** Expand options that include additional issue details in the response. */ + expand?: string; + fields?: Fields; fieldsToInclude?: { - included?: string[]; actuallyIncluded?: string[]; excluded?: string[]; + included?: string[]; }; - fields?: Fields; + /** The ID of the issue. */ + id?: string; + /** The key of the issue. */ + key?: string; + /** The ID and name of each field present on the issue. */ + names?: {}; + operations?: Operations; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The URL of the issue details. */ + self?: string; + /** The transitions that can be performed on the issue. */ + transitions?: { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: StatusCategory; + }; + }[]; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; } diff --git a/src/agile/models/issueTransition.ts b/src/agile/models/issueTransition.ts index 8f645db08a..bb35bb723f 100644 --- a/src/agile/models/issueTransition.ts +++ b/src/agile/models/issueTransition.ts @@ -1,51 +1,58 @@ +import { Scope } from './scope'; + /** Details of an issue transition. */ export interface IssueTransition { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; /** The ID of the issue transition. Required when specifying a transition to undertake. */ id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; /** The name of the issue transition. */ name?: string; /** A status. */ to?: { - /** The URL of the status. */ - self?: string; /** The description of the status. */ description?: string; /** The URL of the icon used to represent the status. */ iconUrl?: string; - /** The name of the status. */ - name?: string; /** The ID of the status. */ id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; /** A status category. */ statusCategory?: { - /** The URL of the status category. */ - self?: string; + /** The name of the color used to represent the status category. */ + colorName?: string; /** The ID of the status category. */ id?: number; /** The key of the status category. */ key?: string; - /** The name of the color used to represent the status category. */ - colorName?: string; /** The name of the status category. */ name?: string; + /** The URL of the status category. */ + self: string; }; }; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; } diff --git a/src/agile/models/jsonType.ts b/src/agile/models/jsonType.ts index 2b50ec5e12..2ab70a13fc 100644 --- a/src/agile/models/jsonType.ts +++ b/src/agile/models/jsonType.ts @@ -1,15 +1,15 @@ /** The schema of a field. */ export interface JsonType { - /** The data type of the field. */ - type: string; - /** When the data type is an array, the name of the field items within the array. */ - items?: string; - /** If the field is a system field, the name of the field. */ - system?: string; + /** If the field is a custom field, the configuration of the field. */ + configuration?: {}; /** If the field is a custom field, the URI of the field. */ custom?: string; /** If the field is a custom field, the custom ID of the field. */ customId?: number; - /** If the field is a custom field, the configuration of the field. */ - configuration?: {}; + /** When the data type is an array, the name of the field items within the array. */ + items?: string; + /** If the field is a system field, the name of the field. */ + system?: string; + /** The data type of the field. */ + type: string; } diff --git a/src/agile/models/linkGroup.ts b/src/agile/models/linkGroup.ts index cd6b15c95b..8d7f1f19eb 100644 --- a/src/agile/models/linkGroup.ts +++ b/src/agile/models/linkGroup.ts @@ -1,26 +1,26 @@ /** Details a link group, which defines issue operations. */ export interface LinkGroup { - id?: string; - styleClass?: string; + groups?: LinkGroup[]; /** Details about the operations available in this version. */ header?: { - id?: string; - styleClass?: string; + href?: string; iconClass?: string; + id?: string; label?: string; + styleClass?: string; title?: string; - href?: string; weight?: number; }; - weight?: number; + id?: string; links?: { - id?: string; - styleClass?: string; + href?: string; iconClass?: string; + id?: string; label?: string; + styleClass?: string; title?: string; - href?: string; weight?: number; }[]; - groups?: LinkGroup[]; + styleClass?: string; + weight?: number; } diff --git a/src/agile/models/project.ts b/src/agile/models/project.ts index e834b7c433..f39fb048d4 100644 --- a/src/agile/models/project.ts +++ b/src/agile/models/project.ts @@ -2,22 +2,32 @@ import { AvatarUrls } from './avatarUrls'; /** Details about a project. */ export interface Project { - /** The URL of the project details. */ - self: string; + avatarUrls: AvatarUrls; /** The ID of the project. */ id: string; /** The key of the project. */ key: string; /** The name of the project. */ name: string; + /** A project category. */ + projectCategory: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id: string; + /** The description of the project category. */ + name: string; + /** The URL of the project category. */ + self: string; + }; /** * The [project * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the * project. */ - projectTypeKey: string; - /** Whether the project is simplified. */ + projectTypeKey: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self: string; + /** Whether or not the project is simplified. */ simplified: boolean; - /** The avatar URLs of the project. */ - avatarUrls: AvatarUrls; } diff --git a/src/agile/models/scope.ts b/src/agile/models/scope.ts new file mode 100644 index 0000000000..a99ccf76d0 --- /dev/null +++ b/src/agile/models/scope.ts @@ -0,0 +1,48 @@ +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** Details about a project. */ + project?: { + avatarUrls?: { + /** The URL of the item's 16x16 pixel avatar. */ + '16x16'?: string; + /** The URL of the item's 24x24 pixel avatar. */ + '24x24'?: string; + /** The URL of the item's 32x32 pixel avatar. */ + '32x32'?: string; + /** The URL of the item's 48x48 pixel avatar. */ + '48x48'?: string; + }; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** A project category. */ + projectCategory?: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The description of the project category. */ + name?: string; + /** The URL of the project category. */ + self?: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + }; + /** The type of scope. */ + type?: 'PROJECT' | 'TEMPLATE' | string; +} diff --git a/src/agile/models/searchResults.ts b/src/agile/models/searchResults.ts index 985bb2b51a..015ea5b3d2 100644 --- a/src/agile/models/searchResults.ts +++ b/src/agile/models/searchResults.ts @@ -4,18 +4,18 @@ import { Issue } from './issue'; export interface SearchResults { /** Expand options that include additional search result details in the response. */ expand?: string; - /** The index of the first item returned on the page. */ - startAt: number; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The number of results on the page. */ - total: number; /** The list of issues found by the search. */ issues: Issue[]; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; + /** The maximum number of results that could be on the page. */ + maxResults: number; /** The ID and name of each field in the search results. */ names?: {}; /** The schema describing the field types in the search results. */ schema?: {}; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** Any warnings related to the JQL query. */ + warningMessages?: string[]; } diff --git a/src/agile/models/statusCategory.ts b/src/agile/models/statusCategory.ts index 68d40e3a47..c00f2328fc 100644 --- a/src/agile/models/statusCategory.ts +++ b/src/agile/models/statusCategory.ts @@ -1,12 +1,13 @@ +/** A status category. */ export interface StatusCategory { - /** The URL of the status category. */ - self: string; + /** The name of the color used to represent the status category. */ + colorName: string; /** The ID of the status category. */ id: number; /** The key of the status category. */ key: string; - /** The name of the color used to represent the status category. */ - colorName: string; /** The name of the status category. */ name: string; + /** The URL of the status category. */ + self: string; } diff --git a/src/agile/models/submitComponents.ts b/src/agile/models/submitComponents.ts new file mode 100644 index 0000000000..69bee0d8e4 --- /dev/null +++ b/src/agile/models/submitComponents.ts @@ -0,0 +1,29 @@ +/** The result of a successful submitDevopsComponents request.* */ +export interface SubmitComponents { + /** + * The IDs of Components that have been accepted for submission. + * + * A Component may be rejected if it was only associated with unknown project keys. + * + * Note that a Component that isn't updated due to it's updateSequenceNumber being out of order is not considered a + * failed submission. + */ + acceptedComponents?: string[]; + /** + * Details of Components that have not been accepted for submission, usually due to a problem with the request data. + * + * The object (if present) will be keyed by Component ID and include any errors associated with that Component that + * have prevented it being submitted. + */ + failedComponents?: {}; + /** + * Project keys that are not known on this Jira instance (if any). + * + * These may be invalid keys (e.g. `UTF` is sometimes incorrectly identified as a Jira project key), or they may be + * for projects that no longer exist. + * + * If a Component has been associated with project keys other than those in this array it will still be stored against + * those valid keys. If a Component was only associated with project keys deemed to be invalid it won't be persisted. + */ + unknownProjectKeys?: string[]; +} diff --git a/src/agile/models/submitEntity.ts b/src/agile/models/submitEntity.ts new file mode 100644 index 0000000000..206e465f32 --- /dev/null +++ b/src/agile/models/submitEntity.ts @@ -0,0 +1,29 @@ +/** The result of a successful submitIncidents request.* */ +export interface SubmitEntity { + /** + * The IDs of Incidents that have been accepted for submission. + * + * A Incident may be rejected if it was only associated with unknown project keys. + * + * Note that a Incident that isn't updated due to it's updateSequenceNumber being out of order is not considered a + * failed submission. + */ + acceptedIncidents?: string[]; + /** + * Details of Incidents that have not been accepted for submission, usually due to a problem with the request data. + * + * The object (if present) will be keyed by Incident ID and include any errors associated with that Incident that have + * prevented it being submitted. + */ + failedIncidents?: {}; + /** + * Project keys that are not known on this Jira instance (if any). + * + * These may be invalid keys (e.g. `UTF` is sometimes incorrectly identified as a Jira project key), or they may be + * for projects that no longer exist. + * + * If a Incident has been associated with project keys other than those in this array it will still be stored against + * those valid keys. If a Incident was only associated with project keys deemed to be invalid it won't be persisted. + */ + unknownProjectKeys?: string[]; +} diff --git a/src/agile/models/submitOperationsWorkspaces.ts b/src/agile/models/submitOperationsWorkspaces.ts new file mode 100644 index 0000000000..822c737b0d --- /dev/null +++ b/src/agile/models/submitOperationsWorkspaces.ts @@ -0,0 +1,5 @@ +/** The result of a successful submitOperationsWorkspaces request.* */ +export interface SubmitOperationsWorkspaces { + /** The IDs of Operations Workspaces that have been linked to the Jira site in this request. */ + acceptedWorkspaceIds?: string[]; +} diff --git a/src/agile/models/submitRemoteLinks.ts b/src/agile/models/submitRemoteLinks.ts index 8184fd4bdd..ec203f74a5 100644 --- a/src/agile/models/submitRemoteLinks.ts +++ b/src/agile/models/submitRemoteLinks.ts @@ -1,4 +1,4 @@ -/** The result of a successful `submitRemoteLinks` request. */ +/** The result of a successful `submitRemoteLinks` request.* */ export interface SubmitRemoteLinks { /** * The IDs of Remote Links that have been accepted for submission. diff --git a/src/agile/models/submitVulnerabilities.ts b/src/agile/models/submitVulnerabilities.ts new file mode 100644 index 0000000000..4f401d89e2 --- /dev/null +++ b/src/agile/models/submitVulnerabilities.ts @@ -0,0 +1,28 @@ +/** The result of a successful submitVulnerabilities request.* */ +export interface SubmitVulnerabilities { + /** + * The IDs of Vulnerabilities that have been accepted for submission. + * + * A Vulnerability may be rejected if it was only associated with unknown project keys. + * + * Note that a Vulnerability that isn't updated due to it's updateSequenceNumber being out of order is not considered + * a failed submission. + */ + acceptedVulnerabilities?: string[]; + /** + * Details of Vulnerabilities that have not been accepted for submission, usually due to a problem with the request + * data. + * + * The object (if present) will be keyed by Vulnerability ID and include any errors associated with that Vulnerability + * that have prevented it being submitted. + */ + failedVulnerabilities?: {}; + /** + * Associations (e.g. Service IDs) that are not known on this Jira instance (if any). + * + * If a Vulnerability has been associated with any other association other than those in this array it will still be + * stored against those valid associations. If a Vulnerability was only associated with the associations in this + * array, it is deemed to be invalid and it won't be persisted. + */ + unknownAssociations?: {}[]; +} diff --git a/src/agile/models/toggleFeatures.ts b/src/agile/models/toggleFeatures.ts index ae231fffce..f2476d46c4 100644 --- a/src/agile/models/toggleFeatures.ts +++ b/src/agile/models/toggleFeatures.ts @@ -1,21 +1,41 @@ export interface ToggleFeatures { features?: { - boardFeature?: string; + boardFeature?: + | 'SIMPLE_ROADMAP' + | 'BACKLOG' + | 'SPRINTS' + | 'CALENDAR' + | 'DEVTOOLS' + | 'REPORTS' + | 'ESTIMATION' + | 'PAGES' + | 'CODE' + | 'SECURITY' + | 'REQUESTS' + | 'INCIDENTS' + | 'RELEASES' + | 'DEPLOYMENTS' + | 'ISSUE_NAVIGATOR' + | 'ON_CALL_SCHEDULE' + | 'BOARD' + | 'GOALS' + | 'LIST_VIEW' + | string; boardId?: number; - state?: string; - localisedName?: string; - localisedDescription?: string; - learnMoreLink?: string; + featureId?: string; + featureType?: 'BASIC' | 'ESTIMATION' | string; imageUri?: string; - featureType?: string; + learnMoreArticleId?: string; + learnMoreLink?: string; + localisedDescription?: string; localisedGroup?: string; + localisedName?: string; permissibleEstimationTypes?: { - value?: string; - localisedName?: string; localisedDescription?: string; + localisedName?: string; + value?: 'STORY_POINTS' | 'ORIGINAL_ESTIMATE' | string; }[]; - featureId?: string; - learnMoreArticleId?: string; + state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON' | string; toggleLocked?: boolean; }[]; } diff --git a/src/agile/models/user.ts b/src/agile/models/user.ts index 28fea25b86..4aa52b3852 100644 --- a/src/agile/models/user.ts +++ b/src/agile/models/user.ts @@ -10,16 +10,18 @@ * fallback values. */ export interface User { - /** The URL of the user. */ - self: string; /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress: string | null; - /** Details about the avatars for an item. */ + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType: string; + /** Whether the user is active. */ + active: boolean; avatarUrls: { /** The URL of the item's 16x16 pixel avatar. */ '16x16'?: string; @@ -32,16 +34,13 @@ export interface User { }; /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ displayName: string; - /** Whether the user is active. */ - active: boolean; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress: string; + /** The URL of the user. */ + self: string; /** * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as * null. */ timeZone: string | null; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType: string; } diff --git a/src/agile/operations.ts b/src/agile/operations.ts new file mode 100644 index 0000000000..989e08fe1b --- /dev/null +++ b/src/agile/operations.ts @@ -0,0 +1,357 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Operations { + constructor(private client: Client) {} + + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback: Callback, + ): Promise; + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: never, + ): Promise; + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds.join(','), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback: Callback, + ): Promise; + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces', + method: 'GET', + params: { + workspaceId: parameters.workspaceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity( + parameters: Parameters.SubmitEntity, + callback: Callback, + ): Promise; + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; + async submitEntity( + parameters: Parameters.SubmitEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulk', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: never, + ): Promise; + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: never, + ): Promise; + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; + async deleteIncidentById( + parameters: Parameters.DeleteIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById( + parameters: Parameters.GetReviewById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; + async getReviewById( + parameters: Parameters.GetReviewById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/parameters/deleteComponentById.ts b/src/agile/parameters/deleteComponentById.ts new file mode 100644 index 0000000000..15a660635b --- /dev/null +++ b/src/agile/parameters/deleteComponentById.ts @@ -0,0 +1,4 @@ +export interface DeleteComponentById { + /** The ID of the Component to delete. */ + componentId: string; +} diff --git a/src/agile/parameters/deleteComponentsByProperty.ts b/src/agile/parameters/deleteComponentsByProperty.ts new file mode 100644 index 0000000000..e715119766 --- /dev/null +++ b/src/agile/parameters/deleteComponentsByProperty.ts @@ -0,0 +1,5 @@ +export interface DeleteComponentsByProperty { + accountId?: string; + createdBy?: string; + [key: string]: any; +} diff --git a/src/agile/parameters/deleteEntityByProperty.ts b/src/agile/parameters/deleteEntityByProperty.ts new file mode 100644 index 0000000000..dd57022b17 --- /dev/null +++ b/src/agile/parameters/deleteEntityByProperty.ts @@ -0,0 +1,5 @@ +export interface DeleteEntityByProperty { + accountId?: string; + createdBy?: string; + [key: string]: any; +} diff --git a/src/agile/parameters/deleteIncidentById.ts b/src/agile/parameters/deleteIncidentById.ts new file mode 100644 index 0000000000..6de2b2e0c3 --- /dev/null +++ b/src/agile/parameters/deleteIncidentById.ts @@ -0,0 +1,4 @@ +export interface DeleteIncidentById { + /** The ID of the Incident to delete. */ + incidentId: string; +} diff --git a/src/agile/parameters/deleteReviewById.ts b/src/agile/parameters/deleteReviewById.ts new file mode 100644 index 0000000000..82e9fd3290 --- /dev/null +++ b/src/agile/parameters/deleteReviewById.ts @@ -0,0 +1,4 @@ +export interface DeleteReviewById { + /** The ID of the Review to delete. */ + reviewId: string; +} diff --git a/src/agile/parameters/deleteWorkspaces.ts b/src/agile/parameters/deleteWorkspaces.ts new file mode 100644 index 0000000000..58b4e4bb15 --- /dev/null +++ b/src/agile/parameters/deleteWorkspaces.ts @@ -0,0 +1,3 @@ +export interface DeleteWorkspaces { + workspaceIds: string[]; +} diff --git a/src/agile/parameters/getAllBoards.ts b/src/agile/parameters/getAllBoards.ts index c3c386f68d..250ab880ab 100644 --- a/src/agile/parameters/getAllBoards.ts +++ b/src/agile/parameters/getAllBoards.ts @@ -30,4 +30,9 @@ export interface GetAllBoards { expand?: string; /** Filters results to boards that are relevant to a filter. Not supported for next-gen boards. */ filterId?: number; + /** + * Filters results to boards that are relevant to a project types. Support Jira Software, Jira Service Management. + * Valid values: software, service_desk. By default software. + */ + projectTypeLocation?: string[]; } diff --git a/src/agile/parameters/getComponentById.ts b/src/agile/parameters/getComponentById.ts new file mode 100644 index 0000000000..d03ea86017 --- /dev/null +++ b/src/agile/parameters/getComponentById.ts @@ -0,0 +1,4 @@ +export interface GetComponentById { + /** The ID of the Component to fetch. */ + componentId: string; +} diff --git a/src/agile/parameters/getIncidentById.ts b/src/agile/parameters/getIncidentById.ts new file mode 100644 index 0000000000..45586630ea --- /dev/null +++ b/src/agile/parameters/getIncidentById.ts @@ -0,0 +1,4 @@ +export interface GetIncidentById { + /** The ID of the Incident to fetch. */ + incidentId: string; +} diff --git a/src/agile/parameters/getReviewById.ts b/src/agile/parameters/getReviewById.ts new file mode 100644 index 0000000000..4480a55e56 --- /dev/null +++ b/src/agile/parameters/getReviewById.ts @@ -0,0 +1,4 @@ +export interface GetReviewById { + /** The ID of the Review to fetch. */ + reviewId: string; +} diff --git a/src/agile/parameters/getWorkspaces.ts b/src/agile/parameters/getWorkspaces.ts new file mode 100644 index 0000000000..fe5e3b30e7 --- /dev/null +++ b/src/agile/parameters/getWorkspaces.ts @@ -0,0 +1,3 @@ +export interface GetWorkspaces { + workspaceId: string; +} diff --git a/src/agile/parameters/index.ts b/src/agile/parameters/index.ts index f7a9ac6ac2..060a110180 100644 --- a/src/agile/parameters/index.ts +++ b/src/agile/parameters/index.ts @@ -80,3 +80,16 @@ export * from './submitWorkspaces'; export * from './swapSprint'; export * from './toggleFeatures'; export * from './updateSprint'; +export * from './getIncidentById'; +export * from './deleteIncidentById'; +export * from './deleteReviewById'; +export * from './getReviewById'; +export * from './deleteEntityByProperty'; +export * from './submitEntity'; +export * from './getWorkspaces'; +export * from './deleteWorkspaces'; +export * from './submitOperationsWorkspaces'; +export * from './submitComponents'; +export * from './deleteComponentById'; +export * from './deleteComponentsByProperty'; +export * from './getComponentById'; diff --git a/src/agile/parameters/submitComponents.ts b/src/agile/parameters/submitComponents.ts new file mode 100644 index 0000000000..0af35f6448 --- /dev/null +++ b/src/agile/parameters/submitComponents.ts @@ -0,0 +1,78 @@ +export interface SubmitComponents { + /** + * Properties assigned to incidents/components/review data that can then be used for delete / query operations. + * + * Examples might be an account or user ID that can then be used to clean up data if an account is removed from the + * Provider system. + * + * Properties are supplied as key/value pairs, and a maximum of 5 properties can be supplied, keys cannot contain ':' + * or start with '_'. + */ + properties?: {}; + components: { + /** + * The DevOpsComponentData schema version used for this devops component data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the DevOps Component. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this DevOps Component in the case of out-of-order receipt of + * update requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each DevOps + * Component and increment that on each update to Jira). + * + * Updates for a DevOps Component that are received with an updateSequenceId lower than what is currently stored + * will be ignored. + */ + updateSequenceNumber: number; + /** The human-readable name for the DevOps Component. Will be shown in the UI. */ + name: string; + /** The human-readable name for the Provider that owns this DevOps Component. Will be shown in the UI. */ + providerName?: string; + /** A description of the DevOps Component in Markdown format. Will be shown in the UI. */ + description: string; + /** + * A URL users can use to link to a summary view of this devops component, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the component in that project). + */ + url: string; + /** A URL to display a logo representing this devops component, if available. */ + avatarUrl: string; + /** The tier of the component. Will be shown in the UI. */ + tier: 'Tier 1' | 'Tier 2' | 'Tier 3' | 'Tier 4' | string; + /** The type of the component. Will be shown in the UI. */ + componentType: + | 'Service' + | 'Application' + | 'Library' + | 'Capability' + | 'Cloud resource' + | 'Data pipeline' + | 'Machine learning model' + | 'UI element' + | 'Website' + | 'Other' + | string; + /** + * The last-updated timestamp to present to the user the last time the DevOps Component was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + }[]; + /** + * Information about the provider. This is useful for auditing, logging, debugging, and other internal uses. It is not + * considered private information. Hence, it may not contain personally identifiable information. + */ + providerMetadata?: { + /** An optional name of the source of the incidents. */ + product?: string; + }; +} diff --git a/src/agile/parameters/submitEntity.ts b/src/agile/parameters/submitEntity.ts new file mode 100644 index 0000000000..12ce1f2d02 --- /dev/null +++ b/src/agile/parameters/submitEntity.ts @@ -0,0 +1,21 @@ +export interface SubmitEntity { + /** + * Properties assigned to incidents/components/review data that can then be used for delete / query operations. + * + * Examples might be an account or user ID that can then be used to clean up data if an account is removed from the + * Provider system. + * + * Properties are supplied as key/value pairs, and a maximum of 5 properties can be supplied, keys cannot contain ':' + * or start with '_'. + */ + properties?: {}; + /** + * Information about the provider. This is useful for auditing, logging, debugging, and other internal uses. It is not + * considered private information. Hence, it may not contain personally identifiable information. + */ + providerMetadata?: { + /** An optional name of the source of the incidents. */ + product?: string; + }; + [key: string]: any; +} diff --git a/src/agile/parameters/submitOperationsWorkspaces.ts b/src/agile/parameters/submitOperationsWorkspaces.ts new file mode 100644 index 0000000000..fe885a29da --- /dev/null +++ b/src/agile/parameters/submitOperationsWorkspaces.ts @@ -0,0 +1,4 @@ +export interface SubmitOperationsWorkspaces { + /** The IDs of Operations Workspaces that are available to this Jira site. */ + workspaceIds?: string[]; +} diff --git a/src/agile/remoteLinks.ts b/src/agile/remoteLinks.ts index 0da91b9725..4981626111 100644 --- a/src/agile/remoteLinks.ts +++ b/src/agile/remoteLinks.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class RemoteLinks { diff --git a/src/agile/securityInformation.ts b/src/agile/securityInformation.ts index 06893fbfb1..36ca396a8e 100644 --- a/src/agile/securityInformation.ts +++ b/src/agile/securityInformation.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class SecurityInformation { @@ -42,6 +42,8 @@ export class SecurityInformation { * * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 */ async deleteLinkedWorkspaces( parameters: Parameters.DeleteLinkedWorkspaces, @@ -52,6 +54,8 @@ export class SecurityInformation { * * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 */ async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; async deleteLinkedWorkspaces( @@ -77,7 +81,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaces(callback: Callback): Promise; + async getLinkedWorkspaces(callback: Callback): Promise; /** * Retrieve all Security Workspaces linked with the Jira site. * @@ -86,8 +90,8 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaces(callback?: never): Promise; - async getLinkedWorkspaces(callback?: Callback): Promise { + async getLinkedWorkspaces(callback?: never): Promise; + async getLinkedWorkspaces(callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/security/1.0/linkedWorkspaces', method: 'GET', @@ -104,7 +108,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback: Callback, ): Promise; @@ -116,11 +120,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback?: never, ): Promise; - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback?: Callback, ): Promise { @@ -150,7 +154,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'WRITE' scope for Connect apps. */ - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback: Callback, ): Promise; @@ -172,11 +176,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'WRITE' scope for Connect apps. */ - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback?: never, ): Promise; - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback?: Callback, ): Promise { @@ -184,6 +188,7 @@ export class SecurityInformation { url: '/rest/security/1.0/bulk', method: 'POST', data: { + operationType: parameters.operationType, properties: parameters.properties, vulnerabilities: parameters.vulnerabilities, providerMetadata: parameters.providerMetadata, @@ -252,7 +257,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback: Callback, ): Promise; @@ -264,11 +269,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback?: never, ): Promise; - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback?: Callback, ): Promise { diff --git a/src/agile/sprint.ts b/src/agile/sprint.ts index fc00cba687..83ea97225a 100644 --- a/src/agile/sprint.ts +++ b/src/agile/sprint.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Sprint { @@ -29,11 +29,11 @@ export class Sprint { url: '/rest/agile/1.0/sprint', method: 'POST', data: { - name: parameters.name, - startDate: parameters.startDate, endDate: parameters.endDate, - originBoardId: parameters.originBoardId, goal: parameters.goal, + name: parameters.name, + originBoardId: parameters.originBoardId, + startDate: parameters.startDate, }, }; @@ -65,7 +65,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -83,7 +83,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -103,16 +103,16 @@ export class Sprint { url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, method: 'POST', data: { - id: parameters.id, - self: parameters.self, - state: parameters.state, - name: parameters.name, - startDate: parameters.startDate, - endDate: parameters.endDate, completeDate: parameters.completeDate, createdDate: parameters.createdDate, - originBoardId: parameters.originBoardId, + endDate: parameters.endDate, goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, }, }; @@ -125,7 +125,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -140,7 +140,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -157,16 +157,16 @@ export class Sprint { url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, method: 'PUT', data: { - id: parameters.id, - self: parameters.self, - state: parameters.state, - name: parameters.name, - startDate: parameters.startDate, - endDate: parameters.endDate, completeDate: parameters.completeDate, createdDate: parameters.createdDate, - originBoardId: parameters.originBoardId, + endDate: parameters.endDate, goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, }, }; @@ -247,8 +247,8 @@ export class Sprint { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, }; From 1500de9cf0a3e3553aa96ae20577b17f72467e2f Mon Sep 17 00:00:00 2001 From: Dmitry Shilov Date: Thu, 16 May 2024 10:29:28 +0200 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20Adds=20new=20HttpException=20class?= =?UTF-8?q?=20which=20will=20be=20return=20instead=20of=20th=E2=80=A6=20(#?= =?UTF-8?q?308)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Adds new HttpException class which will be return instead of the plain object in case of error. * feat: Adds new HttpException class which will be return instead of the plain object in case of error. * feat: Adds new HttpException class which will be return instead of the plain object in case of error. * feat: Adds new HttpException class which will be return instead of the plain object in case of error. * feat: Adds new HttpException class which will be return instead of the plain object in case of error. --- README.md | 29 ++++++++ src/callback.ts | 4 +- src/clients/baseClient.ts | 52 ++++++++----- src/clients/httpException.ts | 137 +++++++++++++++++++++++++++++++++++ src/clients/index.ts | 1 + src/config.ts | 3 +- 6 files changed, 204 insertions(+), 22 deletions(-) create mode 100644 src/clients/httpException.ts diff --git a/README.md b/README.md index 6315e6b872..bb1431746c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Usability, consistency, and performance are key focuses of jira.js, and it also - [Basic](#basic-authentication) - [OAuth 2.0](#oauth-20) - [Personal access token](#personal-access-token) + - [Error handling](#error-handling) - [Example and using algorithm](#example-and-using-algorithm) - [Decreasing Webpack bundle size](#decreasing-webpack-bundle-size) - [Take a look at our other products](#take-a-look-at-our-other-products) @@ -123,6 +124,34 @@ const client = new Version3Client({ }); ``` +#### Error handling +Starting from version 4.0.0, the library has a new error handling system. +Now, all errors are instances of + - the `HttpException` class in case the Axios has response from the server; + - the `AxiosError` class in case something went wrong before sending the request. + +The `HttpException` class tries to parse different sorts of responses from the server to provide a unified error class. + +If the original error is required, you can get it from the `cause` property of the `HttpException` class. + +```typescript +try { + const users = await this.client.userSearch.findUsers({ query: email }); + // ... +} catch (error: uknown) { + if (error instanceof HttpException) { + console.log(error.message); + console.log(error.cause); // original error (AxiosError | Error) + console.log(error.cause.response?.headers); // headers from the server + } else if (error instanceof AxiosError) { + console.log(error.message); + console.log(error.code); // error code, for instance AxiosError.ETIMEDOUT + } else { + console.log(error); + } +} +```` + #### Example and using algorithm 1. Example diff --git a/src/callback.ts b/src/callback.ts index 68b0e11669..9bcc05f52a 100644 --- a/src/callback.ts +++ b/src/callback.ts @@ -1,3 +1,3 @@ -import { AxiosError } from 'axios'; +import { Config } from './config'; -export type Callback = (err: AxiosError | null, data?: T) => void; +export type Callback = (err: Config.Error | null, data?: T) => void; diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index c0132b82b9..d3bea4ad13 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -1,9 +1,10 @@ -import axios, { AxiosError, AxiosInstance, AxiosResponse } from 'axios'; +import axios, { AxiosInstance, AxiosResponse } from 'axios'; import type { Callback } from '../callback'; import type { Client } from './client'; import type { Config } from '../config'; import { getAuthenticationToken } from '../services/authenticationService'; import type { RequestConfig } from '../requestConfig'; +import { HttpException, isObject } from './httpException'; const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; @@ -91,7 +92,7 @@ export class BaseClient implements Client { const response = await this.sendRequestFullResponse(requestConfig); return this.handleSuccessResponse(response.data, callback); - } catch (e: any) { + } catch (e: unknown) { return this.handleFailedResponse(e, callback); } } @@ -119,11 +120,11 @@ export class BaseClient implements Client { return responseHandler(response); } - handleFailedResponse(e: Error, callback?: Callback | never): void { - const err = axios.isAxiosError(e) && e.response ? this.buildErrorHandlingResponse(e) : e; + handleFailedResponse(e: unknown, callback?: Callback | never): void { + const err = this.buildErrorHandlingResponse(e); const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); - const defaultErrorHandler = (error: Error) => { + const defaultErrorHandler = (error: Config.Error) => { throw error; }; @@ -134,20 +135,33 @@ export class BaseClient implements Client { return errorHandler(err); } - private buildErrorHandlingResponse(error: AxiosError) { - const headers = error.response?.headers ?? {}; - const responseData = error.response?.data ?? {}; - const data = typeof responseData === 'object' ? responseData : { data: responseData }; + private buildErrorHandlingResponse(e: unknown): Config.Error { + if (axios.isAxiosError(e) && e.response) { + return new HttpException( + { + code: e.code, + message: e.message, + data: e.response.data, + status: e.response?.status, + statusText: e.response?.statusText, + }, + e.response.status, + { cause: e }, + ); + } - return { - code: error.code, - headers: this.removeUndefinedProperties({ - [RETRY_AFTER]: headers[RETRY_AFTER], - [RATE_LIMIT_RESET]: headers[RATE_LIMIT_RESET], - }), - status: error.response?.status, - statusText: error.response?.statusText, - ...data, - }; + if (axios.isAxiosError(e)) { + return e; + } + + if (isObject(e) && isObject((e as Record).response)) { + return new HttpException((e as Record).response); + } + + if (e instanceof Error) { + return new HttpException(e); + } + + return new HttpException('Unknown error occurred.', 500, { cause: e }); } } diff --git a/src/clients/httpException.ts b/src/clients/httpException.ts new file mode 100644 index 0000000000..0e71522f8c --- /dev/null +++ b/src/clients/httpException.ts @@ -0,0 +1,137 @@ +export const isUndefined = (obj: any): obj is undefined => typeof obj === 'undefined'; + +export const isNil = (val: any): val is null | undefined => isUndefined(val) || val === null; + +export const isObject = (fn: any): fn is object => !isNil(fn) && typeof fn === 'object'; + +export const isString = (val: any): val is string => typeof val === 'string'; + +export const isNumber = (val: any): val is number => typeof val === 'number'; + +export interface HttpExceptionOptions { + /** Original cause of the error */ + cause?: unknown; + description?: string; +} + +export const DEFAULT_EXCEPTION_STATUS = 500; +export const DEFAULT_EXCEPTION_MESSAGE = 'Something went wrong'; +export const DEFAULT_EXCEPTION_CODE = 'INTERNAL_SERVER_ERROR'; +export const DEFAULT_EXCEPTION_STATUS_TEXT = 'Internal server error'; + +/** Defines the base HTTP exception, which is handled by the default Exceptions Handler. */ +export class HttpException extends Error { + /** + * Instantiate a plain HTTP Exception. + * + * @example + * throw new HttpException('message', HttpStatus.BAD_REQUEST); + * throw new HttpException('custom message', HttpStatus.BAD_REQUEST, { + * cause: new Error('Cause Error'), + * }); + * + * @param response String, object describing the error condition or the error cause. + * @param status HTTP response status code. + * @param options An object used to add an error cause. Configures error chaining support + * @usageNotes + * The constructor arguments define the response and the HTTP response status code. + * - The `response` argument (required) defines the JSON response body. alternatively, it can also be + * an error object that is used to define an error [cause](https://nodejs.org/en/blog/release/v16.9.0/#error-cause). + * - The `status` argument (optional) defines the HTTP Status Code. + * - The `options` argument (optional) defines additional error options. Currently, it supports the `cause` attribute, + * and can be used as an alternative way to specify the error cause: `const error = new HttpException('description', 400, { cause: new Error() });` + * + * By default, the JSON response body contains two properties: + * - `statusCode`: the Http Status Code. + * - `message`: a short description of the HTTP error by default; override this + * by supplying a string in the `response` parameter. + * + * The `status` argument is required, and should be a valid HTTP status code. + * Best practice is to use the `HttpStatus` enum imported from `nestjs/common`. + * @see https://nodejs.org/en/blog/release/v16.9.0/#error-cause + * @see https://github.com/microsoft/TypeScript/issues/45167 + */ + constructor( + public readonly response: string | Record, + status?: number, + options?: HttpExceptionOptions, + ) { + super(); + + this.name = this.initName(); + this.cause = this.initCause(response, options); + this.code = this.initCode(response); + this.message = this.initMessage(response); + this.status = this.initStatus(response, status); + this.statusText = this.initStatusText(response, this.status); + } + + public readonly cause?: unknown; + public readonly code?: string; + public readonly status: number; + public readonly statusText?: string; + + protected initMessage(response: string | Record) { + if (isString(response)) { + return response; + } + + if (isObject(response) && isString((response as Record).message)) { + return (response as Record).message; + } + + if (this.constructor) { + return this.constructor.name.match(/[A-Z][a-z]+|[0-9]+/g)?.join(' ') ?? 'Error'; + } + + return DEFAULT_EXCEPTION_MESSAGE; + } + + protected initCause(response: string | Record, options?: HttpExceptionOptions): unknown { + if (options?.cause) { + return options.cause; + } + + if (isObject(response) && isObject((response as Record).cause)) { + return (response as Record).cause; + } + + return undefined; + } + + protected initCode(response: string | Record): string { + if (isObject(response) && isString((response as Record).code)) { + return (response as Record).code; + } + + return DEFAULT_EXCEPTION_CODE; + } + + protected initName(): string { + return this.constructor.name; + } + + protected initStatus(response: string | Record, status?: number): number { + if (status) { + return status; + } + + if (isObject(response) && isNumber((response as Record).status)) { + return (response as Record).status; + } + + if (isObject(response) && isNumber((response as Record).statusCode)) { + return (response as Record).statusCode; + } + + return DEFAULT_EXCEPTION_STATUS; + } + + protected initStatusText(response: string | Record, status?: number): string | undefined { + if (isObject(response) && isString((response as Record).statusText)) { + return (response as Record).statusText; + } + + return status ? undefined : DEFAULT_EXCEPTION_STATUS_TEXT; + } +} diff --git a/src/clients/index.ts b/src/clients/index.ts index 64086d442d..08682970ec 100644 --- a/src/clients/index.ts +++ b/src/clients/index.ts @@ -1,5 +1,6 @@ export * from './baseClient'; export * from './client'; +export * from './httpException'; export { AgileClient, AgileModels, AgileParameters } from '../agile'; diff --git a/src/config.ts b/src/config.ts index 0ef049e40c..5d661c62dc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,7 @@ import { AxiosError } from 'axios'; import { RequestConfig } from './requestConfig'; import { UtilityTypes } from './utilityTypes'; +import { HttpException } from './clients'; export interface Config { host: string; @@ -14,7 +15,7 @@ export interface Config { export namespace Config { export type BaseRequestConfig = RequestConfig; - export type Error = AxiosError; + export type Error = AxiosError | HttpException; export type Authentication = UtilityTypes.XOR3< { From 2a50bb9f24722af9297e0c34a668547bc4c627fa Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Fri, 17 May 2024 12:55:00 +0400 Subject: [PATCH 5/9] README updated --- README.md | 19 ++-- package-lock.json | 221 +++++++++++++++++++++------------------------- package.json | 6 +- 3 files changed, 115 insertions(+), 131 deletions(-) diff --git a/README.md b/README.md index bb1431746c..fc5021a5a9 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,8 @@ const client = new Version3Client({ ``` #### Error handling -Starting from version 4.0.0, the library has a new error handling system. -Now, all errors are instances of +Starting from version 4.0.0, the library has a new error handling system. +Now, all errors are instances of - the `HttpException` class in case the Axios has response from the server; - the `AxiosError` class in case something went wrong before sending the request. @@ -141,7 +141,7 @@ try { } catch (error: uknown) { if (error instanceof HttpException) { console.log(error.message); - console.log(error.cause); // original error (AxiosError | Error) + console.log(error.cause); // original error (AxiosError | Error) console.log(error.cause.response?.headers); // headers from the server } else if (error instanceof AxiosError) { console.log(error.message); @@ -226,16 +226,17 @@ Available groups: - [backlog](https://developer.atlassian.com/cloud/jira/software/rest/api-group-backlog/#api-group-backlog) - [board](https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-group-board) - - [epic](https://developer.atlassian.com/cloud/jira/software/rest/api-group-epic/#api-group-epic) - - [issue](https://developer.atlassian.com/cloud/jira/software/rest/api-group-issue/#api-group-issue) - - [sprint](https://developer.atlassian.com/cloud/jira/software/rest/api-group-sprint/#api-group-sprint) + - [builds](https://developer.atlassian.com/cloud/jira/software/rest/api-group-builds/#api-group-builds) + - [deployments](https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-group-deployments) - [developmentInformation](https://developer.atlassian.com/cloud/jira/software/rest/api-group-development-information/#api-group-development-information) + - [devopsComponents](https://developer.atlassian.com/cloud/jira/software/rest/api-group-devops-components/#api-group-devops-components) + - [epic](https://developer.atlassian.com/cloud/jira/software/rest/api-group-epic/#api-group-epic) - [featureFlags](https://developer.atlassian.com/cloud/jira/software/rest/api-group-feature-flags/#api-group-feature-flags) - - [deployments](https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-group-deployments) - - [builds](https://developer.atlassian.com/cloud/jira/software/rest/api-group-builds/#api-group-builds) + - [issue](https://developer.atlassian.com/cloud/jira/software/rest/api-group-issue/#api-group-issue) + - [operations](https://developer.atlassian.com/cloud/jira/software/rest/api-group-operations/#api-group-operations) - [remoteLinks](https://developer.atlassian.com/cloud/jira/software/rest/api-group-remote-links/#api-group-remote-links) - [securityInformation](https://developer.atlassian.com/cloud/jira/software/rest/api-group-security-information/#api-group-security-information) - - [otherOperations](https://developer.atlassian.com/cloud/jira/software/rest/api-group-other-operations/#api-group-other-operations) + - [sprint](https://developer.atlassian.com/cloud/jira/software/rest/api-group-sprint/#api-group-sprint)
Version 2 Cloud REST API group diff --git a/package-lock.json b/package-lock.json index 2c3e2b839c..734f173f01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,8 +18,8 @@ "@swc/helpers": "^0.5.11", "@types/node": "^18.19.33", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", + "@typescript-eslint/eslint-plugin": "^7.9.0", + "@typescript-eslint/parser": "^7.9.0", "ava": "^6.1.3", "dotenv": "^16.4.5", "eslint": "^8.57.0", @@ -28,7 +28,7 @@ "eslint-plugin-import": "^2.29.1", "prettier": "^3.2.5", "prettier-plugin-jsdoc": "^1.3.0", - "sinon": "^17.0.2", + "sinon": "^18.0.0", "ts-node": "^10.9.2", "typedoc": "^0.25.13", "typedoc-plugin-extras": "^3.0.0", @@ -391,15 +391,15 @@ } }, "node_modules/@swc/core": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.5.5.tgz", - "integrity": "sha512-M8O22EEgdSONLd+7KRrXj8pn+RdAZZ7ISnPjE9KCQQlI0kkFNEquWR+uFdlFxQfwlyCe/Zb6uGXGDvtcov4IMg==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.5.7.tgz", + "integrity": "sha512-U4qJRBefIJNJDRCCiVtkfa/hpiZ7w0R6kASea+/KLp+vkus3zcLSB8Ub8SvKgTIxjWpwsKcZlPf5nrv4ls46SQ==", "dev": true, "hasInstallScript": true, "peer": true, "dependencies": { "@swc/counter": "^0.1.2", - "@swc/types": "^0.1.5" + "@swc/types": "0.1.7" }, "engines": { "node": ">=10" @@ -409,16 +409,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.5.5", - "@swc/core-darwin-x64": "1.5.5", - "@swc/core-linux-arm-gnueabihf": "1.5.5", - "@swc/core-linux-arm64-gnu": "1.5.5", - "@swc/core-linux-arm64-musl": "1.5.5", - "@swc/core-linux-x64-gnu": "1.5.5", - "@swc/core-linux-x64-musl": "1.5.5", - "@swc/core-win32-arm64-msvc": "1.5.5", - "@swc/core-win32-ia32-msvc": "1.5.5", - "@swc/core-win32-x64-msvc": "1.5.5" + "@swc/core-darwin-arm64": "1.5.7", + "@swc/core-darwin-x64": "1.5.7", + "@swc/core-linux-arm-gnueabihf": "1.5.7", + "@swc/core-linux-arm64-gnu": "1.5.7", + "@swc/core-linux-arm64-musl": "1.5.7", + "@swc/core-linux-x64-gnu": "1.5.7", + "@swc/core-linux-x64-musl": "1.5.7", + "@swc/core-win32-arm64-msvc": "1.5.7", + "@swc/core-win32-ia32-msvc": "1.5.7", + "@swc/core-win32-x64-msvc": "1.5.7" }, "peerDependencies": { "@swc/helpers": "^0.5.0" @@ -430,9 +430,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.5.5.tgz", - "integrity": "sha512-Ol5ZwZYdTOZsv2NwjcT/qVVALKzVFeh+IJ4GNarr3P99+38Dkwi81OqCI1o/WaDXQYKAQC/V+CzMbkEuJJfq9Q==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.5.7.tgz", + "integrity": "sha512-bZLVHPTpH3h6yhwVl395k0Mtx8v6CGhq5r4KQdAoPbADU974Mauz1b6ViHAJ74O0IVE5vyy7tD3OpkQxL/vMDQ==", "cpu": [ "arm64" ], @@ -447,9 +447,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.5.5.tgz", - "integrity": "sha512-XHWpKBIPKYLgh5/lV2PYjO84lkzf5JR51kjiloyz2Pa9HIV8tHoAP8bYdJwm4nUp2I7KcEh3pPH0AVu5LpxMKw==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.5.7.tgz", + "integrity": "sha512-RpUyu2GsviwTc2qVajPL0l8nf2vKj5wzO3WkLSHAHEJbiUZk83NJrZd1RVbEknIMO7+Uyjh54hEh8R26jSByaw==", "cpu": [ "x64" ], @@ -464,9 +464,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.5.5.tgz", - "integrity": "sha512-vtoWNCWAe+CNSqtqIwFnIH48qgPPlUZKoQ4EVFeMM+7/kDi6SeNxoh5TierJs5bKAWxD49VkPvRoWFCk6V62mA==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.5.7.tgz", + "integrity": "sha512-cTZWTnCXLABOuvWiv6nQQM0hP6ZWEkzdgDvztgHI/+u/MvtzJBN5lBQ2lue/9sSFYLMqzqff5EHKlFtrJCA9dQ==", "cpu": [ "arm" ], @@ -481,9 +481,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.5.5.tgz", - "integrity": "sha512-L4l7M78U6h/rCAxId+y5Vu+1KfDRF6dJZtitFcaT293guiUQFwJv8gLxI4Jh5wFtZ0fYd0QaCuvh2Ip79CzGMg==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.5.7.tgz", + "integrity": "sha512-hoeTJFBiE/IJP30Be7djWF8Q5KVgkbDtjySmvYLg9P94bHg9TJPSQoC72tXx/oXOgXvElDe/GMybru0UxhKx4g==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.5.5.tgz", - "integrity": "sha512-DkzJc13ukXa7oJpyn24BjIgsiOybYrc+IxjsQyfNlDrrs1QXP4elStcpkD02SsIuSyHjZV8Hw2HFBMQB3OHPrA==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.5.7.tgz", + "integrity": "sha512-+NDhK+IFTiVK1/o7EXdCeF2hEzCiaRSrb9zD7X2Z7inwWlxAntcSuzZW7Y6BRqGQH89KA91qYgwbnjgTQ22PiQ==", "cpu": [ "arm64" ], @@ -515,9 +515,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.5.5.tgz", - "integrity": "sha512-kj4ZwWJGeBEUzHrRQP2VudN+kkkYH7OI1dPVDc6kWQx5X4329JeKOas4qY0l7gDVjBbRwN9IbbPI6TIn2KfAug==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.5.7.tgz", + "integrity": "sha512-25GXpJmeFxKB+7pbY7YQLhWWjkYlR+kHz5I3j9WRl3Lp4v4UD67OGXwPe+DIcHqcouA1fhLhsgHJWtsaNOMBNg==", "cpu": [ "x64" ], @@ -532,9 +532,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.5.5.tgz", - "integrity": "sha512-6pTorCs4mYhPhYtC4jNOnhGgjNd3DZcRoZ9P0tzXXP69aCbYjvlgNH/NRvAROp9AaVFeZ7a7PmCWb6+Rbe7NKg==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.5.7.tgz", + "integrity": "sha512-0VN9Y5EAPBESmSPPsCJzplZHV26akC0sIgd3Hc/7S/1GkSMoeuVL+V9vt+F/cCuzr4VidzSkqftdP3qEIsXSpg==", "cpu": [ "x64" ], @@ -549,9 +549,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.5.5.tgz", - "integrity": "sha512-o0/9pstmEjwZyrY/bA+mymF0zH7E+GT/XCVqdKeWW9Wn3gTTyWa5MZnrFgI2THQ+AXwdglMB/Zo76ARQPaz/+A==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.5.7.tgz", + "integrity": "sha512-RtoNnstBwy5VloNCvmvYNApkTmuCe4sNcoYWpmY7C1+bPR+6SOo8im1G6/FpNem8AR5fcZCmXHWQ+EUmRWJyuA==", "cpu": [ "arm64" ], @@ -566,9 +566,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.5.5.tgz", - "integrity": "sha512-B+nypUwsmCuaH6RtKWgiPCb+ENjxstJPPJeMJvBqlJqyCaIkZzN4M07Ozi3xVv1VG21SRkd6G3xIqRoalrNc0Q==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.5.7.tgz", + "integrity": "sha512-Xm0TfvcmmspvQg1s4+USL3x8D+YPAfX2JHygvxAnCJ0EHun8cm2zvfNBcsTlnwYb0ybFWXXY129aq1wgFC9TpQ==", "cpu": [ "ia32" ], @@ -583,9 +583,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.5.5.tgz", - "integrity": "sha512-ry83ki9ZX0Q+GWGnqc2J618Z+FvKE8Ajn42F8EYi8Wj0q6Jz3mj+pJzgzakk2INm2ldEZ+FaRPipn4ozsZDcBg==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.5.7.tgz", + "integrity": "sha512-tp43WfJLCsKLQKBmjmY/0vv1slVywR5Q4qKjF5OIY8QijaEW7/8VwPyUyVoJZEnDgv9jKtUTG5PzqtIYPZGnyg==", "cpu": [ "x64" ], @@ -616,9 +616,9 @@ } }, "node_modules/@swc/types": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.6.tgz", - "integrity": "sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.7.tgz", + "integrity": "sha512-scHWahbHF0eyj3JsxG9CFJgFdFNaVQCNAimBlT6PzS3n/HptxqREjsm4OH6AN3lYcffZYSPxXW8ua2BEHp0lJQ==", "dev": true, "peer": true, "dependencies": { @@ -658,12 +658,6 @@ "@types/ms": "*" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -671,9 +665,9 @@ "dev": true }, "node_modules/@types/mdast": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", - "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, "dependencies": { "@types/unist": "*" @@ -694,12 +688,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/sinon": { "version": "17.0.3", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", @@ -722,21 +710,19 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz", - "integrity": "sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz", + "integrity": "sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.8.0", - "@typescript-eslint/type-utils": "7.8.0", - "@typescript-eslint/utils": "7.8.0", - "@typescript-eslint/visitor-keys": "7.8.0", - "debug": "^4.3.4", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/type-utils": "7.9.0", + "@typescript-eslint/utils": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.6.0", "ts-api-utils": "^1.3.0" }, "engines": { @@ -757,15 +743,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.8.0.tgz", - "integrity": "sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.9.0.tgz", + "integrity": "sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.8.0", - "@typescript-eslint/types": "7.8.0", - "@typescript-eslint/typescript-estree": "7.8.0", - "@typescript-eslint/visitor-keys": "7.8.0", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "debug": "^4.3.4" }, "engines": { @@ -785,13 +771,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", - "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz", + "integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.8.0", - "@typescript-eslint/visitor-keys": "7.8.0" + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -802,13 +788,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz", - "integrity": "sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz", + "integrity": "sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.8.0", - "@typescript-eslint/utils": "7.8.0", + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/utils": "7.9.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -829,9 +815,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", - "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", + "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -842,13 +828,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", - "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz", + "integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.8.0", - "@typescript-eslint/visitor-keys": "7.8.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -870,18 +856,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.8.0.tgz", - "integrity": "sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.9.0.tgz", + "integrity": "sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.15", - "@types/semver": "^7.5.8", - "@typescript-eslint/scope-manager": "7.8.0", - "@typescript-eslint/types": "7.8.0", - "@typescript-eslint/typescript-estree": "7.8.0", - "semver": "^7.6.0" + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -895,12 +878,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", - "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz", + "integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/types": "7.9.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -4481,9 +4464,9 @@ "dev": true }, "node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz", + "integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0", @@ -5294,16 +5277,16 @@ "dev": true }, "node_modules/sinon": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.2.tgz", - "integrity": "sha512-uihLiaB9FhzesElPDFZA7hDcNABzsVHwr3YfmM9sBllVwab3l0ltGlRV1XhpNfIacNDLGD1QRZNLs5nU5+hTuA==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz", + "integrity": "sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.1", "@sinonjs/fake-timers": "^11.2.2", "@sinonjs/samsam": "^8.0.0", "diff": "^5.2.0", - "nise": "^5.1.9", + "nise": "^6.0.0", "supports-color": "^7" }, "funding": { diff --git a/package.json b/package.json index 1dcd7d2974..ec68f28188 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,8 @@ "@swc/helpers": "^0.5.11", "@types/node": "^18.19.33", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", + "@typescript-eslint/eslint-plugin": "^7.9.0", + "@typescript-eslint/parser": "^7.9.0", "ava": "^6.1.3", "dotenv": "^16.4.5", "eslint": "^8.57.0", @@ -79,7 +79,7 @@ "eslint-plugin-import": "^2.29.1", "prettier": "^3.2.5", "prettier-plugin-jsdoc": "^1.3.0", - "sinon": "^17.0.2", + "sinon": "^18.0.0", "ts-node": "^10.9.2", "typedoc": "^0.25.13", "typedoc-plugin-extras": "^3.0.0", From b76f4ecfae414fce972a0c5b26609119e5e2f2e0 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Fri, 17 May 2024 13:49:46 +0400 Subject: [PATCH 6/9] CHANGELOG updated --- .github/workflows/publish.yml | 2 +- CHANGELOG.md | 3 +++ examples/package-lock.json | 8 ++++---- examples/package.json | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 345db9ccf5..672bb18eb0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -177,7 +177,7 @@ jobs: path: ./CHANGELOG.md - name: Parse Changelog Entry run: | - CHANGELOG_CONTENT=$(echo '${{ steps.changelog.outputs.content }}' | awk '/### ${{ steps.pkg.outputs.version }}/,/### /{print; if (/### / && !/### ${{ steps.pkg.outputs.version }}/){exit}}') + CHANGELOG_CONTENT=$(awk '/^### [0-9]+\.[0-9]+\.[0-9]+/ {if (p) exit; p=1} p' CHANGELOG.md) echo "CHANGELOG=$CHANGELOG_CONTENT" >> $GITHUB_ENV - name: Create GitHub Release uses: softprops/action-gh-release@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index dd4e57872b..b65297bc68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### 4.0.0 +- **#309** - Added rate limiting headers. Thanks to [Chalenge Masekera](https://github.com/chalenge). +- **#308** - Implemented a new error handling mechanism. Thanks to [Dmitry Shilov](https://github.com/bk201-). + ### 3.0.5 - Dependencies updated diff --git a/examples/package-lock.json b/examples/package-lock.json index c94a22ca73..0c22648341 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -12,7 +12,7 @@ "jira.js": "latest" }, "devDependencies": { - "@types/node": "^20.12.11", + "@types/node": "^20.12.12", "ts-node": "^10.9.2", "typescript": "^5.4.5" } @@ -79,9 +79,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", - "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/examples/package.json b/examples/package.json index 5b4a38cfc3..2cb42a8973 100644 --- a/examples/package.json +++ b/examples/package.json @@ -12,7 +12,7 @@ }, "license": "MIT", "devDependencies": { - "@types/node": "^20.12.11", + "@types/node": "^20.12.12", "ts-node": "^10.9.2", "typescript": "^5.4.5" }, From b7d1b96cc128931a20174f86907262d935ccbf54 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Fri, 17 May 2024 13:51:34 +0400 Subject: [PATCH 7/9] CHANGELOG updated --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b65297bc68..a6bf4f9001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ### 4.0.0 -- **#309** - Added rate limiting headers. Thanks to [Chalenge Masekera](https://github.com/chalenge). -- **#308** - Implemented a new error handling mechanism. Thanks to [Dmitry Shilov](https://github.com/bk201-). +- [**#309**](https://github.com/MrRefactoring/jira.js/pull/309) - Added rate limiting headers. Thanks to [Chalenge Masekera](https://github.com/chalenge). +- [**#308**](https://github.com/MrRefactoring/jira.js/pull/308) - Implemented a new error handling mechanism. Thanks to [Dmitry Shilov](https://github.com/bk201-). ### 3.0.5 From 749530565f8e437ba79f89e54800da19669cb402 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Fri, 17 May 2024 14:11:37 +0400 Subject: [PATCH 8/9] CHANGELOG updated --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6bf4f9001..de796ed819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - [**#309**](https://github.com/MrRefactoring/jira.js/pull/309) - Added rate limiting headers. Thanks to [Chalenge Masekera](https://github.com/chalenge). - [**#308**](https://github.com/MrRefactoring/jira.js/pull/308) - Implemented a new error handling mechanism. Thanks to [Dmitry Shilov](https://github.com/bk201-). +#### Breaking changes + +- The new error handling mechanism may affect your library usage. + ### 3.0.5 - Dependencies updated From 9e87267719b91d8913a171ae9a48e07c33095e29 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Fri, 17 May 2024 14:48:01 +0400 Subject: [PATCH 9/9] Self code-review --- src/agile/models/board.ts | 13 +++---------- src/agile/models/createBoard.ts | 13 +++---------- src/agile/models/projects.ts | 9 +++------ src/agile/models/scope.ts | 13 +++---------- src/agile/models/user.ts | 13 +++---------- src/clients/baseClient.ts | 2 -- 6 files changed, 15 insertions(+), 48 deletions(-) diff --git a/src/agile/models/board.ts b/src/agile/models/board.ts index 0ebb1a9234..96fc1d4a46 100644 --- a/src/agile/models/board.ts +++ b/src/agile/models/board.ts @@ -1,3 +1,5 @@ +import { AvatarUrls } from './avatarUrls'; + /** Details about a board. */ export interface Board { /** The users and groups who own the board. */ @@ -14,16 +16,7 @@ export interface Board { accountId?: string; /** Whether the user is active. */ active?: boolean; - avatarUrls?: { - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the user's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the user's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the user's 48x48 pixel avatar. */ - '48x48'?: string; - }; + avatarUrls?: AvatarUrls; /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ displayName?: string; /** The URL of the user. */ diff --git a/src/agile/models/createBoard.ts b/src/agile/models/createBoard.ts index 06ceba0fa0..a506fd0d0d 100644 --- a/src/agile/models/createBoard.ts +++ b/src/agile/models/createBoard.ts @@ -1,3 +1,5 @@ +import { AvatarUrls } from './avatarUrls'; + /** Details about a board. */ export interface CreateBoard { /** The users and groups who own the board. */ @@ -14,16 +16,7 @@ export interface CreateBoard { accountId?: string; /** Whether the user is active. */ active?: boolean; - avatarUrls?: { - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the user's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the user's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the user's 48x48 pixel avatar. */ - '48x48'?: string; - }; + avatarUrls?: AvatarUrls; /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ displayName?: string; /** The URL of the user. */ diff --git a/src/agile/models/projects.ts b/src/agile/models/projects.ts index b3fea9b4cc..99b2bcd597 100644 --- a/src/agile/models/projects.ts +++ b/src/agile/models/projects.ts @@ -1,14 +1,11 @@ +import { AvatarUrls } from './avatarUrls'; + export interface Projects { self: string; id: string; key: string; name: string; - avatarUrls: { - '48x48': string; - '24x24': string; - '16x16': string; - '32x32': string; - }; + avatarUrls: AvatarUrls; projectCategory: { self: string; id: string; diff --git a/src/agile/models/scope.ts b/src/agile/models/scope.ts index a99ccf76d0..0f0d631d05 100644 --- a/src/agile/models/scope.ts +++ b/src/agile/models/scope.ts @@ -1,3 +1,5 @@ +import { AvatarUrls } from './avatarUrls'; + /** * The projects the item is associated with. Indicated for items associated with [next-gen * projects](https://confluence.atlassian.com/x/loMyO). @@ -5,16 +7,7 @@ export interface Scope { /** Details about a project. */ project?: { - avatarUrls?: { - /** The URL of the item's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the item's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the item's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the item's 48x48 pixel avatar. */ - '48x48'?: string; - }; + avatarUrls?: AvatarUrls; /** The ID of the project. */ id?: string; /** The key of the project. */ diff --git a/src/agile/models/user.ts b/src/agile/models/user.ts index 4aa52b3852..58b4caf41a 100644 --- a/src/agile/models/user.ts +++ b/src/agile/models/user.ts @@ -1,3 +1,5 @@ +import { AvatarUrls } from './avatarUrls'; + /** * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* * @@ -22,16 +24,7 @@ export interface User { accountType: string; /** Whether the user is active. */ active: boolean; - avatarUrls: { - /** The URL of the item's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the item's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the item's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the item's 48x48 pixel avatar. */ - '48x48'?: string; - }; + avatarUrls: AvatarUrls; /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ displayName: string; /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index d3bea4ad13..5ade7e0b4b 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -9,8 +9,6 @@ import { HttpException, isObject } from './httpException'; const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; -const RETRY_AFTER = 'Retry-After'; -const RATE_LIMIT_RESET = 'X-RateLimit-Reset'; export class BaseClient implements Client { private instance: AxiosInstance;