diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1c1999347..e7daae08dd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,11 +52,8 @@ jobs: run: npm run test:integration publish: - name: Publish + name: Package publish needs: - - build - - lint - - test_unit - test_integration runs-on: self-hosted steps: @@ -67,6 +64,8 @@ jobs: publish-docs: name: Docs publish + needs: + - test_integration runs-on: self-hosted steps: - name: Checkout code @@ -85,6 +84,10 @@ jobs: - name: Generate docs run: npm run doc + - name: Extract version + id: pkg + run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + - name: Checkout docs branch uses: actions/checkout@v4 with: @@ -100,5 +103,5 @@ jobs: git config user.name "GitHub Actions" git config user.email "actions@github.com" git add . - git commit -m "Update documentation" + git commit -m "Update documentation for version v${{ steps.pkg.outputs.version }}" git push diff --git a/package-lock.json b/package-lock.json index 78947e2315..9e1fcfe8f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,25 +17,25 @@ }, "devDependencies": { "@swc-node/register": "^1.6.8", - "@swc/helpers": "^0.5.2", + "@swc/helpers": "^0.5.3", "@types/express": "^4.17.18", - "@types/node": "^20.8.2", + "@types/node": "^20.8.3", "@types/oauth": "^0.9.2", - "@types/sinon": "^10.0.18", + "@types/sinon": "^10.0.19", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "ava": "^5.3.1", "dotenv": "^16.3.1", - "eslint": "^8.50.0", + "eslint": "^8.51.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.28.1", "prettier": "^3.0.3", - "prettier-plugin-jsdoc": "1.0.2", - "sinon": "^16.0.0", + "prettier-plugin-jsdoc": "^1.1.1", + "sinon": "^16.1.0", "ts-node": "^10.9.1", - "typedoc": "^0.25.1", + "typedoc": "^0.25.2", "typedoc-plugin-extras": "^3.0.0", "typescript": "^5.2.2" } @@ -122,9 +122,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -532,9 +532,9 @@ "peer": true }, "node_modules/@swc/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.3.tgz", + "integrity": "sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==", "dev": true, "dependencies": { "tslib": "^2.4.0" @@ -642,12 +642,12 @@ "dev": true }, "node_modules/@types/mdast": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.13.tgz", - "integrity": "sha512-HjiGiWedR0DVFkeNljpa6Lv4/IZU1+30VY5d747K7lBudFc3R0Ibr6yJ9lN3BE28VnZyDfLF/VB1Ql1ZIbKrmg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", "dev": true, "dependencies": { - "@types/unist": "^2" + "@types/unist": "*" } }, "node_modules/@types/mime": { @@ -663,9 +663,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", - "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", + "version": "20.8.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.3.tgz", + "integrity": "sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==", "dev": true }, "node_modules/@types/oauth": { @@ -717,9 +717,9 @@ } }, "node_modules/@types/sinon": { - "version": "10.0.18", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.18.tgz", - "integrity": "sha512-OpQC9ug8BcnNxue2WF5aTruMaDRFn6NyfaE4DmAKOlQMn54b7CnCvDFV3wj5fk/HbSSTYmOYs2bTb5ShANjyQg==", + "version": "10.0.19", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.19.tgz", + "integrity": "sha512-MWZNGPSchIdDfb5FL+VFi4zHsHbNOTQEgjqFQk7HazXSXwUU9PAX3z9XBqb3AJGYr9YwrtCtaSMsT3brYsN/jQ==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" @@ -732,9 +732,9 @@ "dev": true }, "node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -1913,6 +1913,19 @@ "node": ">=6" } }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/diff": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", @@ -2133,15 +2146,15 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2790,12 +2803,12 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, @@ -2988,9 +3001,9 @@ } }, "node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3732,23 +3745,14 @@ "dev": true }, "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { "json-buffer": "3.0.1" } }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/language-subtag-registry": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", @@ -3924,23 +3928,23 @@ } }, "node_modules/mdast-util-from-markdown": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", - "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", @@ -3948,12 +3952,12 @@ } }, "node_modules/mdast-util-to-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", - "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0" + "@types/mdast": "^4.0.0" }, "funding": { "type": "opencollective", @@ -3986,9 +3990,9 @@ } }, "node_modules/micromark": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", - "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", "dev": true, "funding": [ { @@ -4004,26 +4008,26 @@ "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-core-commonmark": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", - "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "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==", "dev": true, "funding": [ { @@ -4037,27 +4041,27 @@ ], "dependencies": { "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-destination": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", - "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", "dev": true, "funding": [ { @@ -4070,15 +4074,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-label": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", - "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", "dev": true, "funding": [ { @@ -4091,16 +4095,16 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-space": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", - "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", "dev": true, "funding": [ { @@ -4113,14 +4117,14 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-title": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", - "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", "dev": true, "funding": [ { @@ -4133,16 +4137,16 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-whitespace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", - "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", "dev": true, "funding": [ { @@ -4155,16 +4159,16 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-character": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", - "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", + "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", "dev": true, "funding": [ { @@ -4177,14 +4181,14 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-chunked": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", - "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", "dev": true, "funding": [ { @@ -4197,13 +4201,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-classify-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", - "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", "dev": true, "funding": [ { @@ -4216,15 +4220,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-combine-extensions": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", - "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", "dev": true, "funding": [ { @@ -4237,14 +4241,14 @@ } ], "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", - "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.0.tgz", + "integrity": "sha512-pIgcsGxpHEtTG/rPJRz/HOLSqp5VTuIIjXlPI+6JSDlK2oljApusG6KzpS8AF0ENUMCHlC/IBb5B9xdFiVlm5Q==", "dev": true, "funding": [ { @@ -4257,13 +4261,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-decode-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", - "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", "dev": true, "funding": [ { @@ -4277,15 +4281,15 @@ ], "dependencies": { "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", - "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", "dev": true, "funding": [ { @@ -4299,9 +4303,9 @@ ] }, "node_modules/micromark-util-html-tag-name": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", - "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", "dev": true, "funding": [ { @@ -4315,9 +4319,9 @@ ] }, "node_modules/micromark-util-normalize-identifier": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", - "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", "dev": true, "funding": [ { @@ -4330,13 +4334,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-resolve-all": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", - "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", "dev": true, "funding": [ { @@ -4349,13 +4353,13 @@ } ], "dependencies": { - "micromark-util-types": "^1.0.0" + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-sanitize-uri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", - "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", "dev": true, "funding": [ { @@ -4368,15 +4372,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-subtokenize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", - "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", "dev": true, "funding": [ { @@ -4389,16 +4393,16 @@ } ], "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", - "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", "dev": true, "funding": [ { @@ -4412,9 +4416,9 @@ ] }, "node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", "dev": true, "funding": [ { @@ -4492,15 +4496,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5034,14 +5029,14 @@ } }, "node_modules/prettier-plugin-jsdoc": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-1.0.2.tgz", - "integrity": "sha512-mhLT3qiSmfzjOEDvgLntX3XmSJaiDrgoN7WmOp4IH2mZ6LhbvZAnPDJH3Rs0k1O6WR7HcmM92fU1ArB0ALLG+A==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-1.1.1.tgz", + "integrity": "sha512-yA13k0StQ+g0RJBrmo2IldVSp3ANXlJdsNzQNhGtQ0LY7JFC+u01No/1Z9xp0ZhT4u98BXlPAc4SC0iambqy5A==", "dev": true, "dependencies": { "binary-searching": "^2.0.5", "comment-parser": "^1.4.0", - "mdast-util-from-markdown": "^1.2.0" + "mdast-util-from-markdown": "^2.0.0" }, "engines": { "node": ">=14.13.1 || >=16.0.0" @@ -5288,18 +5283,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/safe-array-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", @@ -5448,9 +5431,9 @@ } }, "node_modules/sinon": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-16.0.0.tgz", - "integrity": "sha512-B8AaZZm9CT5pqe4l4uWJztfD/mOTa7dL8Qo0W4+s+t74xECOgSZDDQCBjNgIK3+n4kyxQrSTv2V5ul8K25qkiQ==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-16.1.0.tgz", + "integrity": "sha512-ZSgzF0vwmoa8pq0GEynqfdnpEDyP1PkYmEChnkjW0Vyh8IDlyFEJ+fkMhCP0il6d5cJjPl2PUsnUSAuP5sttOQ==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0", @@ -5941,9 +5924,9 @@ } }, "node_modules/typedoc": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.1.tgz", - "integrity": "sha512-c2ye3YUtGIadxN2O6YwPEXgrZcvhlZ6HlhWZ8jQRNzwLPn2ylhdGqdR8HbyDRyALP8J6lmSANILCkkIdNPFxqA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.2.tgz", + "integrity": "sha512-286F7BeATBiWe/qC4PCOCKlSTwfnsLbC/4cZ68oGBbvAqb9vV33quEOXx7q176OXotD+JdEerdQ1OZGJ818lnA==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -6023,12 +6006,12 @@ } }, "node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", @@ -6044,24 +6027,6 @@ "punycode": "^2.1.0" } }, - "node_modules/uvu": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", - "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", - "dev": true, - "dependencies": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - }, - "bin": { - "uvu": "bin.js" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index 1a03563f76..ea128585cb 100644 --- a/package.json +++ b/package.json @@ -63,25 +63,25 @@ }, "devDependencies": { "@swc-node/register": "^1.6.8", - "@swc/helpers": "^0.5.2", + "@swc/helpers": "^0.5.3", "@types/express": "^4.17.18", - "@types/node": "^20.8.2", + "@types/node": "^20.8.3", "@types/oauth": "^0.9.2", - "@types/sinon": "^10.0.18", + "@types/sinon": "^10.0.19", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "ava": "^5.3.1", "dotenv": "^16.3.1", - "eslint": "^8.50.0", + "eslint": "^8.51.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.28.1", "prettier": "^3.0.3", - "prettier-plugin-jsdoc": "1.0.2", - "sinon": "^16.0.0", + "prettier-plugin-jsdoc": "^1.1.1", + "sinon": "^16.1.0", "ts-node": "^10.9.1", - "typedoc": "^0.25.1", + "typedoc": "^0.25.2", "typedoc-plugin-extras": "^3.0.0", "typescript": "^5.2.2" }, diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index b4f5599454..70eb8a8043 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -3,7 +3,7 @@ import type { Callback } from '../callback'; import type { Client } from './client'; import type { Config } from '../config'; import type { RequestConfig } from '../requestConfig'; -import axios, { AxiosError, AxiosInstance } from 'axios'; +import axios, { AxiosError, AxiosInstance, AxiosResponse } from 'axios'; const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; @@ -86,43 +86,55 @@ export class BaseClient implements Client { async sendRequest(requestConfig: RequestConfig, callback: Callback, telemetryData?: any): Promise; async sendRequest(requestConfig: RequestConfig, callback: Callback | never): Promise { try { - const modifiedRequestConfig = { - ...requestConfig, - headers: this.removeUndefinedProperties({ - Authorization: await AuthenticationService.getAuthenticationToken(this.config.authentication, { - baseURL: this.config.host, - url: this.instance.getUri(requestConfig), - method: requestConfig.method!, - }), - ...requestConfig.headers, + const response = await this.sendRequestFullResponse(requestConfig); + + return this.handleSuccessResponse(response.data, callback); + } catch (e: any) { + return this.handleFailedResponse(e, callback); + } + } + + async sendRequestFullResponse(requestConfig: RequestConfig): Promise> { + const modifiedRequestConfig = { + ...requestConfig, + headers: this.removeUndefinedProperties({ + Authorization: await AuthenticationService.getAuthenticationToken(this.config.authentication, { + baseURL: this.config.host, + url: this.instance.getUri(requestConfig), + method: requestConfig.method!, }), - }; + ...requestConfig.headers, + }), + }; - const response = await this.instance.request(modifiedRequestConfig); + return this.instance.request(modifiedRequestConfig); + } - const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); - const defaultResponseHandler = (data: T): T => data; + handleSuccessResponse(response: any, callback?: Callback | never): T | void { + const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); + const defaultResponseHandler = (data: T): T => data; - const responseHandler = callbackResponseHandler ?? defaultResponseHandler; + const responseHandler = callbackResponseHandler ?? defaultResponseHandler; - this.config.middlewares?.onResponse?.(response.data); + this.config.middlewares?.onResponse?.(response.data); - return responseHandler(response.data); - } catch (e: any) { - const err = - this.config.newErrorHandling && axios.isAxiosError(e) && e.response ? this.buildNewErrorHandlingResponse(e) : e; + return responseHandler(response); + } - const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); - const defaultErrorHandler = (error: Error) => { - throw error; - }; + handleFailedResponse(e: Error, callback?: Callback | never): void { + const err = + this.config.newErrorHandling && axios.isAxiosError(e) && e.response ? this.buildNewErrorHandlingResponse(e) : e; - const errorHandler = callbackErrorHandler ?? defaultErrorHandler; + const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); + const defaultErrorHandler = (error: Error) => { + throw error; + }; - this.config.middlewares?.onError?.(err); + const errorHandler = callbackErrorHandler ?? defaultErrorHandler; - return errorHandler(err); - } + this.config.middlewares?.onError?.(err); + + return errorHandler(err); } private buildNewErrorHandlingResponse(error: AxiosError) { diff --git a/src/clients/client.ts b/src/clients/client.ts index dd2d9ee363..2f697f1f6f 100644 --- a/src/clients/client.ts +++ b/src/clients/client.ts @@ -1,7 +1,12 @@ +import type { AxiosResponse } from 'axios'; import type { Callback } from '../callback'; import type { RequestConfig } from '../requestConfig'; export interface Client { sendRequest(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise; sendRequest(requestConfig: RequestConfig, callback?: Callback, telemetryData?: any): Promise; + + sendRequestFullResponse(requestConfig: RequestConfig): Promise>; + handleSuccessResponse(response: any, callback?: Callback | undefined | never): T | void; + handleFailedResponse(e: Error, callback?: Callback | never): void; } diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 8d0d69a668..4b0c5f6f30 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -218,7 +218,7 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; @@ -235,21 +235,29 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. */ - async getAvatarImageByID(parameters: Parameters.GetAvatarImageByID, callback?: never): Promise; - async getAvatarImageByID( + async getAvatarImageByID(parameters: Parameters.GetAvatarImageByID, callback?: never): Promise; + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, method: 'GET', + responseType: 'arraybuffer', params: { size: parameters.size, format: parameters.format, }, }; - return this.client.sendRequest(config, callback); + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); } /** diff --git a/src/version2/models/avatarWithDetails.ts b/src/version2/models/avatarWithDetails.ts new file mode 100644 index 0000000000..15f5f99071 --- /dev/null +++ b/src/version2/models/avatarWithDetails.ts @@ -0,0 +1,6 @@ +export interface AvatarWithDetails { + /** The content type of the avatar. Expected values include 'image/png', 'image/svg+xml', or any other valid MIME type. */ + contentType: 'image/png' | 'image/svg+xml' | string; + /** The binary representation of the avatar image. */ + avatar: ArrayBuffer; +} diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts index f919287b7a..1eafdef71f 100644 --- a/src/version2/models/index.ts +++ b/src/version2/models/index.ts @@ -33,6 +33,7 @@ export * from './availableWorkflowTriggerTypes'; export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; +export * from './avatarWithDetails'; export * from './bulkChangeOwnerDetails'; export * from './bulkCreateCustomFieldOptionRequest'; export * from './bulkCustomFieldOptionCreateRequest'; diff --git a/src/version2/parameters/getAvatarImageByID.ts b/src/version2/parameters/getAvatarImageByID.ts index 12d9ad0164..87f3dba8dc 100644 --- a/src/version2/parameters/getAvatarImageByID.ts +++ b/src/version2/parameters/getAvatarImageByID.ts @@ -2,9 +2,9 @@ export interface GetAvatarImageByID { /** The icon type of the avatar. */ type: string; /** The ID of the avatar. */ - id: number; + id: number | string; /** The size of the avatar image. If not provided the default size is returned. */ - size?: string | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; + size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string; /** The format to return the avatar image in. If not provided the original content format is returned. */ - format?: string; + format?: 'png' | 'svg' | string; } diff --git a/src/version3/avatars.ts b/src/version3/avatars.ts index 85926c85e1..f72b006ffd 100644 --- a/src/version3/avatars.ts +++ b/src/version3/avatars.ts @@ -218,7 +218,7 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; @@ -235,21 +235,29 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. */ - async getAvatarImageByID(parameters: Parameters.GetAvatarImageByID, callback?: never): Promise; - async getAvatarImageByID( + async getAvatarImageByID(parameters: Parameters.GetAvatarImageByID, callback?: never): Promise; + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, method: 'GET', + responseType: 'arraybuffer', params: { size: parameters.size, format: parameters.format, }, }; - return this.client.sendRequest(config, callback); + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); } /** diff --git a/src/version3/models/avatarWithDetails.ts b/src/version3/models/avatarWithDetails.ts new file mode 100644 index 0000000000..15f5f99071 --- /dev/null +++ b/src/version3/models/avatarWithDetails.ts @@ -0,0 +1,6 @@ +export interface AvatarWithDetails { + /** The content type of the avatar. Expected values include 'image/png', 'image/svg+xml', or any other valid MIME type. */ + contentType: 'image/png' | 'image/svg+xml' | string; + /** The binary representation of the avatar image. */ + avatar: ArrayBuffer; +} diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 075dbd0258..08434ae9f3 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -29,6 +29,7 @@ export * from './availableDashboardGadgetsResponse'; export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; +export * from './avatarWithDetails'; export * from './bulkChangeOwnerDetails'; export * from './bulkCreateCustomFieldOptionRequest'; export * from './bulkCustomFieldOptionCreateRequest'; diff --git a/src/version3/parameters/getAllSystemAvatars.ts b/src/version3/parameters/getAllSystemAvatars.ts index 8283ea14a3..c1d371e2df 100644 --- a/src/version3/parameters/getAllSystemAvatars.ts +++ b/src/version3/parameters/getAllSystemAvatars.ts @@ -1,4 +1,4 @@ export interface GetAllSystemAvatars { /** The avatar type. */ - type: string; + type: 'issuetype' | 'project' | 'user' | string; } diff --git a/src/version3/parameters/getAvatarImageByID.ts b/src/version3/parameters/getAvatarImageByID.ts index f4dae48ca5..87f3dba8dc 100644 --- a/src/version3/parameters/getAvatarImageByID.ts +++ b/src/version3/parameters/getAvatarImageByID.ts @@ -2,9 +2,9 @@ export interface GetAvatarImageByID { /** The icon type of the avatar. */ type: string; /** The ID of the avatar. */ - id: number; + id: number | string; /** The size of the avatar image. If not provided the default size is returned. */ - size?: string; + size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string; /** The format to return the avatar image in. If not provided the original content format is returned. */ - format?: string; + format?: 'png' | 'svg' | string; } diff --git a/tests/integration/constants.ts b/tests/integration/constants.ts index 3f92b1f6ce..752c3e7ca8 100644 --- a/tests/integration/constants.ts +++ b/tests/integration/constants.ts @@ -7,5 +7,5 @@ export namespace Constants { export const testIssueDescription = 'Test description'; export const testIssueSummary = 'Test issue summary'; export const testProjectKey = 'AUTOTEST'; - export const testProjectName = 'Jira.js project for lib automatic1 tests'; + export const testProjectName = 'Jira.js project for lib automatic tests'; } diff --git a/tests/integration/version2/avatars.test.ts b/tests/integration/version2/avatars.test.ts new file mode 100644 index 0000000000..6cecbfa04f --- /dev/null +++ b/tests/integration/version2/avatars.test.ts @@ -0,0 +1,22 @@ +import { Avatar } from '../../../src/version3/models'; +import { getVersion2Client } from '../utils'; +import test from 'ava'; + +const client = getVersion2Client(); + +let avatar: Avatar | undefined; + +test.serial('should get all system avatars', async t => { + const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); + + avatar = systemAvatars.system?.[0]; + + t.truthy(!!avatar); +}); + +test.serial('should return avatar image with contentType', async t => { + const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + + t.is(avatarWithDetails.contentType, 'image/svg+xml'); + t.truthy(avatarWithDetails.avatar instanceof Uint8Array); +}); diff --git a/tests/integration/version3/avatars.test.ts b/tests/integration/version3/avatars.test.ts new file mode 100644 index 0000000000..3a3b4b8101 --- /dev/null +++ b/tests/integration/version3/avatars.test.ts @@ -0,0 +1,22 @@ +import { Avatar } from '../../../src/version3/models'; +import { getVersion3Client } from '../utils'; +import test from 'ava'; + +const client = getVersion3Client(); + +let avatar: Avatar | undefined; + +test.serial('should get all system avatars', async t => { + const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); + + avatar = systemAvatars.system?.[0]; + + t.truthy(!!avatar); +}); + +test.serial('should return avatar image with contentType', async t => { + const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + + t.is(avatarWithDetails.contentType, 'image/svg+xml'); + t.truthy(avatarWithDetails.avatar instanceof Uint8Array); +});