diff --git a/package.json b/package.json index 5652f30..706ed17 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "typescript": "^5.5.4", "typescript-eslint": "^8.7.0" }, - "packageManager": "pnpm@9.12.0", + "packageManager": "pnpm@9.12.3", "types": "./dist/index.d.ts", "lint-staged": { "*.{ts,tsx,js}": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f49e40..f89a02b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,19 +10,19 @@ importers: devDependencies: '@types/node': specifier: ^22.7.4 - version: 22.7.4 + version: 22.8.7 '@typescript-eslint/eslint-plugin': specifier: ^8.7.0 - version: 8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2) + version: 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0)(typescript@5.6.3))(eslint@9.14.0)(typescript@5.6.3) '@typescript-eslint/parser': specifier: ^8.7.0 - version: 8.8.0(eslint@9.12.0)(typescript@5.6.2) + version: 8.12.2(eslint@9.14.0)(typescript@5.6.3) eslint: specifier: ^9.11.1 - version: 9.12.0 + version: 9.14.0 eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.12.0))(eslint@9.12.0)(prettier@3.3.3) + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0))(eslint@9.14.0)(prettier@3.3.3) husky: specifier: ^9.1.4 version: 9.1.6 @@ -37,22 +37,22 @@ importers: version: 0.0.7(prettier@3.3.3) prettier-plugin-organize-imports: specifier: ^4.0.0 - version: 4.1.0(prettier@3.3.3)(typescript@5.6.2) + version: 4.1.0(prettier@3.3.3)(typescript@5.6.3) prettier-plugin-packagejson: specifier: ^2.5.1 - version: 2.5.2(prettier@3.3.3) + version: 2.5.3(prettier@3.3.3) sortpack: specifier: ^2.4.0 version: 2.4.0 typedoc: specifier: ^0.26.5 - version: 0.26.8(typescript@5.6.2) + version: 0.26.11(typescript@5.6.3) typescript: specifier: ^5.5.4 - version: 5.6.2 + version: 5.6.3 typescript-eslint: specifier: ^8.7.0 - version: 8.8.0(eslint@9.12.0)(typescript@5.6.2) + version: 8.12.2(eslint@9.14.0)(typescript@5.6.3) packages: @@ -131,46 +131,46 @@ packages: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/config-array@0.18.0': resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.6.0': - resolution: {integrity: sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==} + '@eslint/core@0.7.0': + resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.1.0': resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.12.0': - resolution: {integrity: sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==} + '@eslint/js@9.14.0': + resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.0': - resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + '@eslint/plugin-kit@0.2.2': + resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@humanfs/core@0.19.0': - resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} - '@humanfs/node@0.16.5': - resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': @@ -181,6 +181,10 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} + '@humanwhocodes/retry@0.4.0': + resolution: {integrity: sha512-xnRgu9DxZbkWak/te3fcytNyp8MTbuiZIaueg2rgEvBuN55n04nwLYLU9TX/VVlusc9L2ZNXi99nUFNkHXtr5g==} + engines: {node: '>=18.18'} + '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -215,20 +219,20 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@shikijs/core@1.21.0': - resolution: {integrity: sha512-zAPMJdiGuqXpZQ+pWNezQAk5xhzRXBNiECFPcJLtUdsFM3f//G95Z15EHTnHchYycU8kIIysqGgxp8OVSj1SPQ==} + '@shikijs/core@1.22.2': + resolution: {integrity: sha512-bvIQcd8BEeR1yFvOYv6HDiyta2FFVePbzeowf5pPS1avczrPK+cjmaxxh0nx5QzbON7+Sv0sQfQVciO7bN72sg==} - '@shikijs/engine-javascript@1.21.0': - resolution: {integrity: sha512-jxQHNtVP17edFW4/0vICqAVLDAxmyV31MQJL4U/Kg+heQALeKYVOWo0sMmEZ18FqBt+9UCdyqGKYE7bLRtk9mg==} + '@shikijs/engine-javascript@1.22.2': + resolution: {integrity: sha512-iOvql09ql6m+3d1vtvP8fLCVCK7BQD1pJFmHIECsujB0V32BJ0Ab6hxk1ewVSMFA58FI0pR2Had9BKZdyQrxTw==} - '@shikijs/engine-oniguruma@1.21.0': - resolution: {integrity: sha512-AIZ76XocENCrtYzVU7S4GY/HL+tgHGbVU+qhiDyNw1qgCA5OSi4B4+HY4BtAoJSMGuD/L5hfTzoRVbzEm2WTvg==} + '@shikijs/engine-oniguruma@1.22.2': + resolution: {integrity: sha512-GIZPAGzQOy56mGvWMoZRPggn0dTlBf1gutV5TdceLCZlFNqWmuc7u+CzD0Gd9vQUTgLbrt0KLzz6FNprqYAxlA==} - '@shikijs/types@1.21.0': - resolution: {integrity: sha512-tzndANDhi5DUndBtpojEq/42+dpUF2wS7wdCDQaFtIXm3Rd1QkrcVgSSRLOvEwexekihOXfbYJINW37g96tJRw==} + '@shikijs/types@1.22.2': + resolution: {integrity: sha512-NCWDa6LGZqTuzjsGfXOBWfjS/fDIbDdmVDug+7ykVe1IKT4c1gakrvlfFYp5NhAXH/lyqLM8wsAPo5wNy73Feg==} - '@shikijs/vscode-textmate@9.2.2': - resolution: {integrity: sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==} + '@shikijs/vscode-textmate@9.3.0': + resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -242,14 +246,14 @@ packages: '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} - '@types/node@22.7.4': - resolution: {integrity: sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==} + '@types/node@22.8.7': + resolution: {integrity: sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q==} '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@typescript-eslint/eslint-plugin@8.8.0': - resolution: {integrity: sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==} + '@typescript-eslint/eslint-plugin@8.12.2': + resolution: {integrity: sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -259,8 +263,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.8.0': - resolution: {integrity: sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==} + '@typescript-eslint/parser@8.12.2': + resolution: {integrity: sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -269,12 +273,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@8.8.0': - resolution: {integrity: sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==} + '@typescript-eslint/scope-manager@8.12.2': + resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.8.0': - resolution: {integrity: sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==} + '@typescript-eslint/type-utils@8.12.2': + resolution: {integrity: sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -282,12 +286,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@8.8.0': - resolution: {integrity: sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==} + '@typescript-eslint/types@8.12.2': + resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.8.0': - resolution: {integrity: sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==} + '@typescript-eslint/typescript-estree@8.12.2': + resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -295,14 +299,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@8.8.0': - resolution: {integrity: sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==} + '@typescript-eslint/utils@8.12.2': + resolution: {integrity: sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@8.8.0': - resolution: {integrity: sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==} + '@typescript-eslint/visitor-keys@8.12.2': + resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.2.0': @@ -313,8 +317,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -547,20 +551,20 @@ packages: eslint-config-prettier: optional: true - eslint-scope@8.1.0: - resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} + eslint-scope@8.2.0: + resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.1.0: - resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.12.0: - resolution: {integrity: sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==} + eslint@9.14.0: + resolution: {integrity: sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -569,8 +573,8 @@ packages: jiti: optional: true - espree@10.2.0: - resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -1025,8 +1029,8 @@ packages: vue-tsc: optional: true - prettier-plugin-packagejson@2.5.2: - resolution: {integrity: sha512-w+TmoLv2pIa+siplW1cCj2ujEXQQS6z7wmWLOiLQK/2QVl7Wy6xh/ZUpqQw8tbKMXDodmSW4GONxlA33xpdNOg==} + prettier-plugin-packagejson@2.5.3: + resolution: {integrity: sha512-ATMEEXr+ywls1kgrZEWl4SBPEm0uDdyDAjyNzUC0/Z8WZTD3RqbJcQDR+Dau+wYkW9KHK6zqQIsFyfn+9aduWg==} peerDependencies: prettier: '>= 1.16.0' peerDependenciesMeta: @@ -1052,8 +1056,8 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - regex@4.3.3: - resolution: {integrity: sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==} + regex@4.4.0: + resolution: {integrity: sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==} resolve-from@3.0.0: resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} @@ -1098,8 +1102,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.21.0: - resolution: {integrity: sha512-apCH5BoWTrmHDPGgg3RF8+HAAbEL/CdbYr8rMw7eIrdhCkZHdVGat5mMNlRtd1erNG01VPMIKHNQ0Pj2HMAiog==} + shiki@1.22.2: + resolution: {integrity: sha512-3IZau0NdGKXhH2bBlUk4w1IHNxPh6A5B2sUpyY+8utLu2j/h1QpFkAaUA1bAMxOWWGtTWcAh531vnS4NJKS/lA==} signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -1174,6 +1178,10 @@ packages: resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} engines: {node: ^14.18.0 || >=16.0.0} + synckit@0.9.2: + resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} + engines: {node: ^14.18.0 || >=16.0.0} + text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -1188,8 +1196,8 @@ packages: trim-lines@3.0.1: resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + ts-api-utils@1.4.0: + resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -1201,15 +1209,15 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typedoc@0.26.8: - resolution: {integrity: sha512-QBF0BMbnNeUc6U7pRHY7Jb8pjhmiNWZNQT8LU6uk9qP9t3goP9bJptdlNqMC0wBB2w9sQrxjZt835bpRSSq1LA==} + typedoc@0.26.11: + resolution: {integrity: sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==} engines: {node: '>= 18'} hasBin: true peerDependencies: typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x - typescript-eslint@8.8.0: - resolution: {integrity: sha512-BjIT/VwJ8+0rVO01ZQ2ZVnjE1svFBiRczcpr1t1Yxt7sT25VSbPfrJtDsQ8uQTy2pilX5nI9gwxhUyLULNentw==} + typescript-eslint@8.12.2: + resolution: {integrity: sha512-UbuVUWSrHVR03q9CWx+JDHeO6B/Hr9p4U5lRH++5tq/EbFq1faYZe50ZSBePptgfIKLEti0aPQ3hFgnPVcd8ZQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1222,8 +1230,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true @@ -1284,8 +1292,8 @@ packages: engines: {node: '>= 14'} hasBin: true - yaml@2.5.1: - resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} + yaml@2.6.0: + resolution: {integrity: sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==} engines: {node: '>= 14'} hasBin: true @@ -1415,12 +1423,12 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 - '@eslint-community/eslint-utils@4.4.0(eslint@9.12.0)': + '@eslint-community/eslint-utils@4.4.1(eslint@9.14.0)': dependencies: - eslint: 9.12.0 + eslint: 9.14.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} '@eslint/config-array@0.18.0': dependencies: @@ -1430,13 +1438,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/core@0.6.0': {} + '@eslint/core@0.7.0': {} '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 debug: 4.3.7 - espree: 10.2.0 + espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.0 @@ -1446,25 +1454,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.12.0': {} + '@eslint/js@9.14.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.2.0': + '@eslint/plugin-kit@0.2.2': dependencies: levn: 0.4.1 - '@humanfs/core@0.19.0': {} + '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.5': + '@humanfs/node@0.16.6': dependencies: - '@humanfs/core': 0.19.0 + '@humanfs/core': 0.19.1 '@humanwhocodes/retry': 0.3.1 '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.1': {} + '@humanwhocodes/retry@0.4.0': {} + '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -1496,32 +1506,32 @@ snapshots: '@pkgr/core@0.1.1': {} - '@shikijs/core@1.21.0': + '@shikijs/core@1.22.2': dependencies: - '@shikijs/engine-javascript': 1.21.0 - '@shikijs/engine-oniguruma': 1.21.0 - '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/engine-javascript': 1.22.2 + '@shikijs/engine-oniguruma': 1.22.2 + '@shikijs/types': 1.22.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 hast-util-to-html: 9.0.3 - '@shikijs/engine-javascript@1.21.0': + '@shikijs/engine-javascript@1.22.2': dependencies: - '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/types': 1.22.2 + '@shikijs/vscode-textmate': 9.3.0 oniguruma-to-js: 0.4.3 - '@shikijs/engine-oniguruma@1.21.0': + '@shikijs/engine-oniguruma@1.22.2': dependencies: - '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/types': 1.22.2 + '@shikijs/vscode-textmate': 9.3.0 - '@shikijs/types@1.21.0': + '@shikijs/types@1.22.2': dependencies: - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 - '@shikijs/vscode-textmate@9.2.2': {} + '@shikijs/vscode-textmate@9.3.0': {} '@types/estree@1.0.6': {} @@ -1535,100 +1545,100 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/node@22.7.4': + '@types/node@22.8.7': dependencies: undici-types: 6.19.8 '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0)(typescript@5.6.3))(eslint@9.14.0)(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.8.0(eslint@9.12.0)(typescript@5.6.2) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/type-utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.8.0 - eslint: 9.12.0 + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.12.2(eslint@9.14.0)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.12.2 + '@typescript-eslint/type-utils': 8.12.2(eslint@9.14.0)(typescript@5.6.3) + '@typescript-eslint/utils': 8.12.2(eslint@9.14.0)(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.12.2 + eslint: 9.14.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.2) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2)': + '@typescript-eslint/parser@8.12.2(eslint@9.14.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.8.0 + '@typescript-eslint/scope-manager': 8.12.2 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.12.2 debug: 4.3.7 - eslint: 9.12.0 + eslint: 9.14.0 optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.8.0': + '@typescript-eslint/scope-manager@8.12.2': dependencies: - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/visitor-keys': 8.8.0 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/visitor-keys': 8.12.2 - '@typescript-eslint/type-utils@8.8.0(eslint@9.12.0)(typescript@5.6.2)': + '@typescript-eslint/type-utils@8.12.2(eslint@9.14.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) + '@typescript-eslint/utils': 8.12.2(eslint@9.14.0)(typescript@5.6.3) debug: 4.3.7 - ts-api-utils: 1.3.0(typescript@5.6.2) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - eslint - supports-color - '@typescript-eslint/types@8.8.0': {} + '@typescript-eslint/types@8.12.2': {} - '@typescript-eslint/typescript-estree@8.8.0(typescript@5.6.2)': + '@typescript-eslint/typescript-estree@8.12.2(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/visitor-keys': 8.8.0 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/visitor-keys': 8.12.2 debug: 4.3.7 fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.2) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.8.0(eslint@9.12.0)(typescript@5.6.2)': + '@typescript-eslint/utils@8.12.2(eslint@9.14.0)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - eslint: 9.12.0 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) + '@typescript-eslint/scope-manager': 8.12.2 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) + eslint: 9.14.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@8.8.0': + '@typescript-eslint/visitor-keys@8.12.2': dependencies: - '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/types': 8.12.2 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.12.1 + acorn: 8.14.0 - acorn@8.12.1: {} + acorn@8.14.0: {} ajv@6.12.6: dependencies: @@ -1804,41 +1814,41 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.12.0): + eslint-config-prettier@9.1.0(eslint@9.14.0): dependencies: - eslint: 9.12.0 + eslint: 9.14.0 optional: true - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.12.0))(eslint@9.12.0)(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0))(eslint@9.14.0)(prettier@3.3.3): dependencies: - eslint: 9.12.0 + eslint: 9.14.0 prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.12.0) + eslint-config-prettier: 9.1.0(eslint@9.14.0) - eslint-scope@8.1.0: + eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.1.0: {} + eslint-visitor-keys@4.2.0: {} - eslint@9.12.0: + eslint@9.14.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) - '@eslint-community/regexpp': 4.11.1 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) + '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.18.0 - '@eslint/core': 0.6.0 + '@eslint/core': 0.7.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.12.0 - '@eslint/plugin-kit': 0.2.0 - '@humanfs/node': 0.16.5 + '@eslint/js': 9.14.0 + '@eslint/plugin-kit': 0.2.2 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.0 '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 ajv: 6.12.6 @@ -1846,9 +1856,9 @@ snapshots: cross-spawn: 7.0.3 debug: 4.3.7 escape-string-regexp: 4.0.0 - eslint-scope: 8.1.0 - eslint-visitor-keys: 4.1.0 - espree: 10.2.0 + eslint-scope: 8.2.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -1867,11 +1877,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.2.0: + espree@10.3.0: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.1.0 + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 4.2.0 esprima@4.0.1: {} @@ -2255,7 +2265,7 @@ snapshots: oniguruma-to-js@0.4.3: dependencies: - regex: 4.3.3 + regex: 4.4.0 optionator@0.9.4: dependencies: @@ -2315,15 +2325,15 @@ snapshots: transitivePeerDependencies: - supports-color - prettier-plugin-organize-imports@4.1.0(prettier@3.3.3)(typescript@5.6.2): + prettier-plugin-organize-imports@4.1.0(prettier@3.3.3)(typescript@5.6.3): dependencies: prettier: 3.3.3 - typescript: 5.6.2 + typescript: 5.6.3 - prettier-plugin-packagejson@2.5.2(prettier@3.3.3): + prettier-plugin-packagejson@2.5.3(prettier@3.3.3): dependencies: sort-package-json: 2.10.1 - synckit: 0.9.1 + synckit: 0.9.2 optionalDependencies: prettier: 3.3.3 @@ -2337,7 +2347,7 @@ snapshots: queue-microtask@1.2.3: {} - regex@4.3.3: {} + regex@4.4.0: {} resolve-from@3.0.0: {} @@ -2372,13 +2382,13 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.21.0: + shiki@1.22.2: dependencies: - '@shikijs/core': 1.21.0 - '@shikijs/engine-javascript': 1.21.0 - '@shikijs/engine-oniguruma': 1.21.0 - '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/core': 1.22.2 + '@shikijs/engine-javascript': 1.22.2 + '@shikijs/engine-oniguruma': 1.22.2 + '@shikijs/types': 1.22.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 signal-exit@4.1.0: {} @@ -2450,6 +2460,11 @@ snapshots: '@pkgr/core': 0.1.1 tslib: 2.7.0 + synckit@0.9.2: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.7.0 + text-table@0.2.0: {} to-fast-properties@2.0.0: {} @@ -2460,9 +2475,9 @@ snapshots: trim-lines@3.0.1: {} - ts-api-utils@1.3.0(typescript@5.6.2): + ts-api-utils@1.4.0(typescript@5.6.3): dependencies: - typescript: 5.6.2 + typescript: 5.6.3 tslib@2.7.0: {} @@ -2470,29 +2485,29 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typedoc@0.26.8(typescript@5.6.2): + typedoc@0.26.11(typescript@5.6.3): dependencies: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - shiki: 1.21.0 - typescript: 5.6.2 - yaml: 2.5.1 + shiki: 1.22.2 + typescript: 5.6.3 + yaml: 2.6.0 - typescript-eslint@8.8.0(eslint@9.12.0)(typescript@5.6.2): + typescript-eslint@8.12.2(eslint@9.14.0)(typescript@5.6.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2) - '@typescript-eslint/parser': 8.8.0(eslint@9.12.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/eslint-plugin': 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0)(typescript@5.6.3))(eslint@9.14.0)(typescript@5.6.3) + '@typescript-eslint/parser': 8.12.2(eslint@9.14.0)(typescript@5.6.3) + '@typescript-eslint/utils': 8.12.2(eslint@9.14.0)(typescript@5.6.3) optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - eslint - supports-color typescript@3.9.10: {} - typescript@5.6.2: {} + typescript@5.6.3: {} uc.micro@2.1.0: {} @@ -2557,7 +2572,7 @@ snapshots: yaml@2.5.0: {} - yaml@2.5.1: {} + yaml@2.6.0: {} yocto-queue@0.1.0: {} diff --git a/src/http.ts b/src/http.ts index 2081321..12179b4 100644 --- a/src/http.ts +++ b/src/http.ts @@ -167,6 +167,8 @@ enum HttpType { Put = "PUT", } +type RequestOptions = Pick; + /** * Helps build lemmy HTTP requests. */ @@ -174,7 +176,7 @@ export class LemmyHttp { #apiUrl: string; #headers: { [key: string]: string } = {}; #pictrsUrl: string; - #fetchFunction = fetch.bind(globalThis); + #fetchFunction: typeof fetch = fetch.bind(globalThis); /** * Generates a new instance of LemmyHttp. @@ -204,8 +206,13 @@ export class LemmyHttp { * * `HTTP.GET /site` */ - getSite() { - return this.#wrapper(HttpType.Get, "/site", {}); + getSite(options?: RequestOptions) { + return this.#wrapper( + HttpType.Get, + "/site", + {}, + options, + ); } /** @@ -213,11 +220,12 @@ export class LemmyHttp { * * `HTTP.POST /site` */ - createSite(form: CreateSite) { + createSite(form: CreateSite, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/site", form, + options, ); } @@ -226,8 +234,13 @@ export class LemmyHttp { * * `HTTP.PUT /site` */ - editSite(form: EditSite) { - return this.#wrapper(HttpType.Put, "/site", form); + editSite(form: EditSite, options?: RequestOptions) { + return this.#wrapper( + HttpType.Put, + "/site", + form, + options, + ); } /** @@ -235,11 +248,12 @@ export class LemmyHttp { * * `HTTP.POST /user/leave_admin` */ - leaveAdmin() { + leaveAdmin(options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/leave_admin", {}, + options, ); } @@ -250,11 +264,12 @@ export class LemmyHttp { * * `HTTP.POST /user/totp/generate` */ - generateTotpSecret() { + generateTotpSecret(options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/totp/generate", {}, + options, ); } @@ -264,11 +279,12 @@ export class LemmyHttp { * * `HTTP.GET /user/export_settings` */ - exportSettings() { + exportSettings(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/export_settings", {}, + options, ); } @@ -277,11 +293,12 @@ export class LemmyHttp { * * `HTTP.POST /user/import_settings` */ - importSettings(form: any) { + importSettings(form: any, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/import_settings", form, + options, ); } @@ -290,11 +307,12 @@ export class LemmyHttp { * * `HTTP.GET /user/list_logins` */ - listLogins() { + listLogins(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/list_logins", {}, + options, ); } @@ -303,11 +321,12 @@ export class LemmyHttp { * * `HTTP.GET /user/validate_auth` */ - validateAuth() { + validateAuth(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/validate_auth", {}, + options, ); } @@ -316,11 +335,12 @@ export class LemmyHttp { * * `HTTP.GET /account/list_media` */ - listMedia(form: ListMedia = {}) { + listMedia(form: ListMedia = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/account/list_media", form, + options, ); } @@ -329,11 +349,12 @@ export class LemmyHttp { * * `HTTP.GET /admin/list_all_media` */ - listAllMedia(form: ListMedia = {}) { + listAllMedia(form: ListMedia = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/admin/list_all_media", form, + options, ); } @@ -346,11 +367,12 @@ export class LemmyHttp { * * `HTTP.POST /user/totp/update` */ - updateTotp(form: UpdateTotp) { + updateTotp(form: UpdateTotp, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/totp/update", form, + options, ); } @@ -359,11 +381,12 @@ export class LemmyHttp { * * `HTTP.GET /modlog` */ - getModlog(form: GetModlog = {}) { + getModlog(form: GetModlog = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/modlog", form, + options, ); } @@ -372,8 +395,13 @@ export class LemmyHttp { * * `HTTP.GET /search` */ - search(form: Search) { - return this.#wrapper(HttpType.Get, "/search", form); + search(form: Search, options?: RequestOptions) { + return this.#wrapper( + HttpType.Get, + "/search", + form, + options, + ); } /** @@ -381,11 +409,12 @@ export class LemmyHttp { * * `HTTP.GET /resolve_object` */ - resolveObject(form: ResolveObject) { + resolveObject(form: ResolveObject, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/resolve_object", form, + options, ); } @@ -394,11 +423,12 @@ export class LemmyHttp { * * `HTTP.POST /community` */ - createCommunity(form: CreateCommunity) { + createCommunity(form: CreateCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community", form, + options, ); } @@ -407,11 +437,12 @@ export class LemmyHttp { * * `HTTP.GET /community` */ - getCommunity(form: GetCommunity = {}) { + getCommunity(form: GetCommunity = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/community", form, + options, ); } @@ -420,11 +451,12 @@ export class LemmyHttp { * * `HTTP.PUT /community` */ - editCommunity(form: EditCommunity) { + editCommunity(form: EditCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/community", form, + options, ); } @@ -433,11 +465,12 @@ export class LemmyHttp { * * `HTTP.GET /community/list` */ - listCommunities(form: ListCommunities = {}) { + listCommunities(form: ListCommunities = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/community/list", form, + options, ); } @@ -446,11 +479,12 @@ export class LemmyHttp { * * `HTTP.POST /community/follow` */ - followCommunity(form: FollowCommunity) { + followCommunity(form: FollowCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/follow", form, + options, ); } @@ -482,11 +516,12 @@ export class LemmyHttp { * * `HTTP.POST /community/block` */ - blockCommunity(form: BlockCommunity) { + blockCommunity(form: BlockCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/block", form, + options, ); } @@ -495,11 +530,12 @@ export class LemmyHttp { * * `HTTP.POST /community/delete` */ - deleteCommunity(form: DeleteCommunity) { + deleteCommunity(form: DeleteCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/delete", form, + options, ); } @@ -508,11 +544,12 @@ export class LemmyHttp { * * `HTTP.PUT /community/hide` */ - hideCommunity(form: HideCommunity) { + hideCommunity(form: HideCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/community/hide", form, + options, ); } @@ -521,11 +558,12 @@ export class LemmyHttp { * * `HTTP.POST /community/remove` */ - removeCommunity(form: RemoveCommunity) { + removeCommunity(form: RemoveCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/remove", form, + options, ); } @@ -534,11 +572,12 @@ export class LemmyHttp { * * `HTTP.POST /community/transfer` */ - transferCommunity(form: TransferCommunity) { + transferCommunity(form: TransferCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/transfer", form, + options, ); } @@ -547,11 +586,12 @@ export class LemmyHttp { * * `HTTP.POST /community/ban_user` */ - banFromCommunity(form: BanFromCommunity) { + banFromCommunity(form: BanFromCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/ban_user", form, + options, ); } @@ -560,11 +600,12 @@ export class LemmyHttp { * * `HTTP.POST /community/mod` */ - addModToCommunity(form: AddModToCommunity) { + addModToCommunity(form: AddModToCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/community/mod", form, + options, ); } @@ -573,11 +614,12 @@ export class LemmyHttp { * * `HTTP.GET /community/random` */ - getRandomCommunity(form: GetRandomCommunity) { + getRandomCommunity(form: GetRandomCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/community/random", form, + options, ); } @@ -586,11 +628,12 @@ export class LemmyHttp { * * `HTTP.POST /post` */ - createPost(form: CreatePost) { + createPost(form: CreatePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post", form, + options, ); } @@ -599,8 +642,13 @@ export class LemmyHttp { * * `HTTP.GET /post` */ - getPost(form: GetPost = {}) { - return this.#wrapper(HttpType.Get, "/post", form); + getPost(form: GetPost = {}, options?: RequestOptions) { + return this.#wrapper( + HttpType.Get, + "/post", + form, + options, + ); } /** @@ -608,8 +656,13 @@ export class LemmyHttp { * * `HTTP.PUT /post` */ - editPost(form: EditPost) { - return this.#wrapper(HttpType.Put, "/post", form); + editPost(form: EditPost, options?: RequestOptions) { + return this.#wrapper( + HttpType.Put, + "/post", + form, + options, + ); } /** @@ -617,11 +670,12 @@ export class LemmyHttp { * * `HTTP.POST /post/delete` */ - deletePost(form: DeletePost) { + deletePost(form: DeletePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/delete", form, + options, ); } @@ -630,11 +684,12 @@ export class LemmyHttp { * * `HTTP.POST /post/remove` */ - removePost(form: RemovePost) { + removePost(form: RemovePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/remove", form, + options, ); } @@ -643,11 +698,12 @@ export class LemmyHttp { * * `HTTP.POST /post/mark_as_read` */ - markPostAsRead(form: MarkPostAsRead) { + markPostAsRead(form: MarkPostAsRead, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/mark_as_read", form, + options, ); } @@ -656,11 +712,12 @@ export class LemmyHttp { * * `HTTP.POST /post/hide` */ - hidePost(form: HidePost) { + hidePost(form: HidePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/hide", form, + options, ); } @@ -669,11 +726,12 @@ export class LemmyHttp { * * `HTTP.POST /post/lock` */ - lockPost(form: LockPost) { + lockPost(form: LockPost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/lock", form, + options, ); } @@ -682,11 +740,12 @@ export class LemmyHttp { * * `HTTP.POST /post/feature` */ - featurePost(form: FeaturePost) { + featurePost(form: FeaturePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/feature", form, + options, ); } @@ -695,11 +754,12 @@ export class LemmyHttp { * * `HTTP.GET /post/list` */ - getPosts(form: GetPosts = {}) { + getPosts(form: GetPosts = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/post/list", form, + options, ); } @@ -708,11 +768,12 @@ export class LemmyHttp { * * `HTTP.POST /post/like` */ - likePost(form: CreatePostLike) { + likePost(form: CreatePostLike, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/like", form, + options, ); } @@ -721,11 +782,12 @@ export class LemmyHttp { * * `HTTP.GET /post/like/list` */ - listPostLikes(form: ListPostLikes) { + listPostLikes(form: ListPostLikes, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/post/like/list", form, + options, ); } @@ -734,11 +796,12 @@ export class LemmyHttp { * * `HTTP.PUT /post/save` */ - savePost(form: SavePost) { + savePost(form: SavePost, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/post/save", form, + options, ); } @@ -747,11 +810,12 @@ export class LemmyHttp { * * `HTTP.POST /post/report` */ - createPostReport(form: CreatePostReport) { + createPostReport(form: CreatePostReport, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/post/report", form, + options, ); } @@ -760,11 +824,12 @@ export class LemmyHttp { * * `HTTP.PUT /post/report/resolve` */ - resolvePostReport(form: ResolvePostReport) { + resolvePostReport(form: ResolvePostReport, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/post/report/resolve", form, + options, ); } @@ -773,11 +838,12 @@ export class LemmyHttp { * * `HTTP.GET /post/report/list` */ - listPostReports(form: ListPostReports) { + listPostReports(form: ListPostReports, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/post/report/list", form, + options, ); } @@ -786,11 +852,12 @@ export class LemmyHttp { * * `HTTP.GET /post/site_metadata` */ - getSiteMetadata(form: GetSiteMetadata) { + getSiteMetadata(form: GetSiteMetadata, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/post/site_metadata", form, + options, ); } @@ -799,11 +866,12 @@ export class LemmyHttp { * * `HTTP.POST /comment` */ - createComment(form: CreateComment) { + createComment(form: CreateComment, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment", form, + options, ); } @@ -812,11 +880,12 @@ export class LemmyHttp { * * `HTTP.PUT /comment` */ - editComment(form: EditComment) { + editComment(form: EditComment, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/comment", form, + options, ); } @@ -825,11 +894,12 @@ export class LemmyHttp { * * `HTTP.POST /comment/delete` */ - deleteComment(form: DeleteComment) { + deleteComment(form: DeleteComment, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment/delete", form, + options, ); } @@ -838,11 +908,12 @@ export class LemmyHttp { * * `HTTP.POST /comment/remove` */ - removeComment(form: RemoveComment) { + removeComment(form: RemoveComment, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment/remove", form, + options, ); } @@ -851,11 +922,15 @@ export class LemmyHttp { * * `HTTP.POST /comment/mark_as_read` */ - markCommentReplyAsRead(form: MarkCommentReplyAsRead) { + markCommentReplyAsRead( + form: MarkCommentReplyAsRead, + options?: RequestOptions, + ) { return this.#wrapper( HttpType.Post, "/comment/mark_as_read", form, + options, ); } @@ -864,11 +939,12 @@ export class LemmyHttp { * * `HTTP.POST /comment/like` */ - likeComment(form: CreateCommentLike) { + likeComment(form: CreateCommentLike, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment/like", form, + options, ); } @@ -877,11 +953,12 @@ export class LemmyHttp { * * `HTTP.GET /comment/like/list` */ - listCommentLikes(form: ListCommentLikes) { + listCommentLikes(form: ListCommentLikes, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/comment/like/list", form, + options, ); } @@ -890,11 +967,12 @@ export class LemmyHttp { * * `HTTP.PUT /comment/save` */ - saveComment(form: SaveComment) { + saveComment(form: SaveComment, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/comment/save", form, + options, ); } @@ -903,11 +981,12 @@ export class LemmyHttp { * * `HTTP.POST /comment/distinguish` */ - distinguishComment(form: DistinguishComment) { + distinguishComment(form: DistinguishComment, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment/distinguish", form, + options, ); } @@ -916,11 +995,12 @@ export class LemmyHttp { * * `HTTP.GET /comment/list` */ - getComments(form: GetComments = {}) { + getComments(form: GetComments = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/comment/list", form, + options, ); } @@ -929,11 +1009,12 @@ export class LemmyHttp { * * `HTTP.GET /comment` */ - getComment(form: GetComment) { + getComment(form: GetComment, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/comment", form, + options, ); } @@ -942,11 +1023,12 @@ export class LemmyHttp { * * `HTTP.POST /comment/report` */ - createCommentReport(form: CreateCommentReport) { + createCommentReport(form: CreateCommentReport, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/comment/report", form, + options, ); } @@ -955,11 +1037,12 @@ export class LemmyHttp { * * `HTTP.PUT /comment/report/resolve` */ - resolveCommentReport(form: ResolveCommentReport) { + resolveCommentReport(form: ResolveCommentReport, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/comment/report/resolve", form, + options, ); } @@ -968,11 +1051,12 @@ export class LemmyHttp { * * `HTTP.GET /comment/report/list` */ - listCommentReports(form: ListCommentReports) { + listCommentReports(form: ListCommentReports, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/comment/report/list", form, + options, ); } @@ -981,11 +1065,12 @@ export class LemmyHttp { * * `HTTP.GET /private_message/list` */ - getPrivateMessages(form: GetPrivateMessages) { + getPrivateMessages(form: GetPrivateMessages, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/private_message/list", form, + options, ); } @@ -994,11 +1079,12 @@ export class LemmyHttp { * * `HTTP.POST /private_message` */ - createPrivateMessage(form: CreatePrivateMessage) { + createPrivateMessage(form: CreatePrivateMessage, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/private_message", form, + options, ); } @@ -1007,11 +1093,12 @@ export class LemmyHttp { * * `HTTP.PUT /private_message` */ - editPrivateMessage(form: EditPrivateMessage) { + editPrivateMessage(form: EditPrivateMessage, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/private_message", form, + options, ); } @@ -1020,11 +1107,12 @@ export class LemmyHttp { * * `HTTP.POST /private_message/delete` */ - deletePrivateMessage(form: DeletePrivateMessage) { + deletePrivateMessage(form: DeletePrivateMessage, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/private_message/delete", form, + options, ); } @@ -1033,11 +1121,15 @@ export class LemmyHttp { * * `HTTP.POST /private_message/mark_as_read` */ - markPrivateMessageAsRead(form: MarkPrivateMessageAsRead) { + markPrivateMessageAsRead( + form: MarkPrivateMessageAsRead, + options?: RequestOptions, + ) { return this.#wrapper( HttpType.Post, "/private_message/mark_as_read", form, + options, ); } @@ -1046,11 +1138,14 @@ export class LemmyHttp { * * `HTTP.POST /private_message/report` */ - createPrivateMessageReport(form: CreatePrivateMessageReport) { + createPrivateMessageReport( + form: CreatePrivateMessageReport, + options?: RequestOptions, + ) { return this.#wrapper< CreatePrivateMessageReport, PrivateMessageReportResponse - >(HttpType.Post, "/private_message/report", form); + >(HttpType.Post, "/private_message/report", form, options); } /** @@ -1058,11 +1153,14 @@ export class LemmyHttp { * * `HTTP.PUT /private_message/report/resolve` */ - resolvePrivateMessageReport(form: ResolvePrivateMessageReport) { + resolvePrivateMessageReport( + form: ResolvePrivateMessageReport, + options?: RequestOptions, + ) { return this.#wrapper< ResolvePrivateMessageReport, PrivateMessageReportResponse - >(HttpType.Put, "/private_message/report/resolve", form); + >(HttpType.Put, "/private_message/report/resolve", form, options); } /** @@ -1070,11 +1168,14 @@ export class LemmyHttp { * * `HTTP.GET /private_message/report/list` */ - listPrivateMessageReports(form: ListPrivateMessageReports) { + listPrivateMessageReports( + form: ListPrivateMessageReports, + options?: RequestOptions, + ) { return this.#wrapper< ListPrivateMessageReports, ListPrivateMessageReportsResponse - >(HttpType.Get, "/private_message/report/list", form); + >(HttpType.Get, "/private_message/report/list", form, options); } /** @@ -1082,11 +1183,12 @@ export class LemmyHttp { * * `HTTP.POST /user/register` */ - register(form: Register) { + register(form: Register, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/register", form, + options, ); } @@ -1095,11 +1197,12 @@ export class LemmyHttp { * * `HTTP.POST /user/login` */ - login(form: Login) { + login(form: Login, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/login", form, + options, ); } @@ -1108,11 +1211,12 @@ export class LemmyHttp { * * `HTTP.POST /user/logout` */ - logout() { + logout(options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/logout", {}, + options, ); } @@ -1121,11 +1225,12 @@ export class LemmyHttp { * * `HTTP.GET /user` */ - getPersonDetails(form: GetPersonDetails = {}) { + getPersonDetails(form: GetPersonDetails = {}, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user", form, + options, ); } @@ -1134,11 +1239,12 @@ export class LemmyHttp { * * `HTTP.GET /user/mention` */ - getPersonMentions(form: GetPersonMentions) { + getPersonMentions(form: GetPersonMentions, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/mention", form, + options, ); } @@ -1147,11 +1253,15 @@ export class LemmyHttp { * * `HTTP.POST /user/mention/mark_as_read` */ - markPersonMentionAsRead(form: MarkPersonMentionAsRead) { + markPersonMentionAsRead( + form: MarkPersonMentionAsRead, + options?: RequestOptions, + ) { return this.#wrapper( HttpType.Post, "/user/mention/mark_as_read", form, + options, ); } @@ -1160,11 +1270,12 @@ export class LemmyHttp { * * `HTTP.GET /user/replies` */ - getReplies(form: GetReplies) { + getReplies(form: GetReplies, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/replies", form, + options, ); } @@ -1173,11 +1284,12 @@ export class LemmyHttp { * * `HTTP.POST /user/ban` */ - banPerson(form: BanPerson) { + banPerson(form: BanPerson, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/ban", form, + options, ); } @@ -1186,11 +1298,12 @@ export class LemmyHttp { * * `HTTP.GET /user/banned` */ - getBannedPersons() { + getBannedPersons(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/banned", {}, + options, ); } @@ -1199,11 +1312,12 @@ export class LemmyHttp { * * `HTTP.POST /user/block` */ - blockPerson(form: BlockPerson) { + blockPerson(form: BlockPerson, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/block", form, + options, ); } @@ -1212,11 +1326,12 @@ export class LemmyHttp { * * `HTTP.GET /user/get_captcha` */ - getCaptcha() { + getCaptcha(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/get_captcha", {}, + options, ); } @@ -1225,11 +1340,12 @@ export class LemmyHttp { * * `HTTP.POST /user/delete_account` */ - deleteAccount(form: DeleteAccount) { + deleteAccount(form: DeleteAccount, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/delete_account", form, + options, ); } @@ -1238,11 +1354,12 @@ export class LemmyHttp { * * `HTTP.POST /user/password_reset` */ - passwordReset(form: PasswordReset) { + passwordReset(form: PasswordReset, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/password_reset", form, + options, ); } @@ -1251,11 +1368,15 @@ export class LemmyHttp { * * `HTTP.POST /user/password_change` */ - passwordChangeAfterReset(form: PasswordChangeAfterReset) { + passwordChangeAfterReset( + form: PasswordChangeAfterReset, + options?: RequestOptions, + ) { return this.#wrapper( HttpType.Post, "/user/password_change", form, + options, ); } @@ -1264,11 +1385,12 @@ export class LemmyHttp { * * `HTTP.POST /user/mark_all_as_read` */ - markAllAsRead() { + markAllAsRead(options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/mark_all_as_read", {}, + options, ); } @@ -1277,11 +1399,12 @@ export class LemmyHttp { * * `HTTP.PUT /user/save_user_settings` */ - saveUserSettings(form: SaveUserSettings) { + saveUserSettings(form: SaveUserSettings, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/user/save_user_settings", form, + options, ); } @@ -1290,11 +1413,12 @@ export class LemmyHttp { * * `HTTP.PUT /user/change_password` */ - changePassword(form: ChangePassword) { + changePassword(form: ChangePassword, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/user/change_password", form, + options, ); } @@ -1303,11 +1427,12 @@ export class LemmyHttp { * * `HTTP.GET /user/report_count` */ - getReportCount(form: GetReportCount) { + getReportCount(form: GetReportCount, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/report_count", form, + options, ); } @@ -1316,11 +1441,12 @@ export class LemmyHttp { * * `HTTP.GET /user/unread_count` */ - getUnreadCount() { + getUnreadCount(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/user/unread_count", {}, + options, ); } @@ -1329,11 +1455,12 @@ export class LemmyHttp { * * `HTTP.POST /user/verify_email` */ - verifyEmail(form: VerifyEmail) { + verifyEmail(form: VerifyEmail, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/user/verify_email", form, + options, ); } @@ -1342,11 +1469,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/add` */ - addAdmin(form: AddAdmin) { + addAdmin(form: AddAdmin, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/add", form, + options, ); } @@ -1355,11 +1483,12 @@ export class LemmyHttp { * * `HTTP.GET /admin/registration_application/count` */ - getUnreadRegistrationApplicationCount() { + getUnreadRegistrationApplicationCount(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/admin/registration_application/count", {}, + options, ); } @@ -1368,11 +1497,14 @@ export class LemmyHttp { * * `HTTP.GET /admin/registration_application/list` */ - listRegistrationApplications(form: ListRegistrationApplications) { + listRegistrationApplications( + form: ListRegistrationApplications, + options?: RequestOptions, + ) { return this.#wrapper< ListRegistrationApplications, ListRegistrationApplicationsResponse - >(HttpType.Get, "/admin/registration_application/list", form); + >(HttpType.Get, "/admin/registration_application/list", form, options); } /** @@ -1380,11 +1512,14 @@ export class LemmyHttp { * * `HTTP.PUT /admin/registration_application/approve` */ - approveRegistrationApplication(form: ApproveRegistrationApplication) { + approveRegistrationApplication( + form: ApproveRegistrationApplication, + options?: RequestOptions, + ) { return this.#wrapper< ApproveRegistrationApplication, RegistrationApplicationResponse - >(HttpType.Put, "/admin/registration_application/approve", form); + >(HttpType.Put, "/admin/registration_application/approve", form, options); } /** @@ -1392,11 +1527,14 @@ export class LemmyHttp { * * `HTTP.GET /admin/registration_application` */ - getRegistrationApplication(form: GetRegistrationApplication) { + getRegistrationApplication( + form: GetRegistrationApplication, + options?: RequestOptions, + ) { return this.#wrapper< GetRegistrationApplication, RegistrationApplicationResponse - >(HttpType.Get, "/admin/registration_application", form); + >(HttpType.Get, "/admin/registration_application", form, options); } /** @@ -1404,11 +1542,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/purge/person` */ - purgePerson(form: PurgePerson) { + purgePerson(form: PurgePerson, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/purge/person", form, + options, ); } @@ -1417,11 +1556,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/purge/community` */ - purgeCommunity(form: PurgeCommunity) { + purgeCommunity(form: PurgeCommunity, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/purge/community", form, + options, ); } @@ -1430,11 +1570,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/purge/post` */ - purgePost(form: PurgePost) { + purgePost(form: PurgePost, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/purge/post", form, + options, ); } @@ -1443,11 +1584,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/purge/comment` */ - purgeComment(form: PurgeComment) { + purgeComment(form: PurgeComment, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/purge/comment", form, + options, ); } @@ -1456,11 +1598,12 @@ export class LemmyHttp { * * `HTTP.POST /custom_emoji` */ - createCustomEmoji(form: CreateCustomEmoji) { + createCustomEmoji(form: CreateCustomEmoji, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/custom_emoji", form, + options, ); } @@ -1469,11 +1612,12 @@ export class LemmyHttp { * * `HTTP.PUT /custom_emoji` */ - editCustomEmoji(form: EditCustomEmoji) { + editCustomEmoji(form: EditCustomEmoji, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/custom_emoji", form, + options, ); } @@ -1482,11 +1626,12 @@ export class LemmyHttp { * * `HTTP.Post /custom_emoji/delete` */ - deleteCustomEmoji(form: DeleteCustomEmoji) { + deleteCustomEmoji(form: DeleteCustomEmoji, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/custom_emoji/delete", form, + options, ); } @@ -1495,11 +1640,12 @@ export class LemmyHttp { * * `HTTP.GET /custom_emoji/list` */ - listCustomEmojis(form: ListCustomEmojis) { + listCustomEmojis(form: ListCustomEmojis, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/custom_emoji/list", form, + options, ); } @@ -1508,11 +1654,12 @@ export class LemmyHttp { * * `HTTP.POST /admin/tagline` */ - createTagline(form: CreateTagline) { + createTagline(form: CreateTagline, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/tagline", form, + options, ); } @@ -1521,11 +1668,12 @@ export class LemmyHttp { * * `HTTP.PUT /admin/tagline` */ - editTagline(form: UpdateTagline) { + editTagline(form: UpdateTagline, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/admin/tagline", form, + options, ); } @@ -1534,11 +1682,12 @@ export class LemmyHttp { * * `HTTP.Post /admin/tagline/delete` */ - deleteTagline(form: DeleteTagline) { + deleteTagline(form: DeleteTagline, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/admin/tagline/delete", form, + options, ); } @@ -1547,11 +1696,12 @@ export class LemmyHttp { * * `HTTP.GET /admin/tagline/list` */ - listTaglines(form: ListTaglines) { + listTaglines(form: ListTaglines, options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/admin/tagline/list", form, + options, ); } @@ -1560,11 +1710,12 @@ export class LemmyHttp { * * `HTTP.POST /oauth_provider` */ - createOAuthProvider(form: CreateOAuthProvider) { + createOAuthProvider(form: CreateOAuthProvider, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/oauth_provider", form, + options, ); } @@ -1573,11 +1724,12 @@ export class LemmyHttp { * * `HTTP.PUT /oauth_provider` */ - editOAuthProvider(form: EditOAuthProvider) { + editOAuthProvider(form: EditOAuthProvider, options?: RequestOptions) { return this.#wrapper( HttpType.Put, "/oauth_provider", form, + options, ); } @@ -1586,11 +1738,12 @@ export class LemmyHttp { * * `HTTP.Post /oauth_provider/delete` */ - deleteOAuthProvider(form: DeleteOAuthProvider) { + deleteOAuthProvider(form: DeleteOAuthProvider, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/oauth_provider/delete", form, + options, ); } @@ -1599,11 +1752,12 @@ export class LemmyHttp { * * `HTTP.Post /oauth/authenticate` */ - authenticateWithOAuth(form: AuthenticateWithOauth) { + authenticateWithOAuth(form: AuthenticateWithOauth, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/oauth/authenticate", form, + options, ); } @@ -1612,11 +1766,12 @@ export class LemmyHttp { * * `HTTP.Get /federated_instances` */ - getFederatedInstances() { + getFederatedInstances(options?: RequestOptions) { return this.#wrapper( HttpType.Get, "/federated_instances", {}, + options, ); } @@ -1625,24 +1780,29 @@ export class LemmyHttp { * * `HTTP.Post /site/block` */ - blockInstance(form: BlockInstance) { + blockInstance(form: BlockInstance, options?: RequestOptions) { return this.#wrapper( HttpType.Post, "/site/block", form, + options, ); } /** * Upload an image to the server. */ - async uploadImage({ image }: UploadImage): Promise { + async uploadImage( + { image }: UploadImage, + options?: RequestOptions, + ): Promise { const formData = createFormData(image); let url: string | undefined = undefined; let delete_url: string | undefined = undefined; const response = await this.#fetchFunction(this.#pictrsUrl, { + ...options, method: HttpType.Post, body: formData as unknown as BodyInit, headers: this.#headers, @@ -1670,10 +1830,14 @@ export class LemmyHttp { /** * Delete a pictrs image */ - async deleteImage({ token, filename }: DeleteImage): Promise { + async deleteImage( + { token, filename }: DeleteImage, + options?: RequestOptions, + ): Promise { const deleteUrl = `${this.#pictrsUrl}/delete/${token}/${filename}`; const response = await this.#fetchFunction(deleteUrl, { + ...options, method: HttpType.Get, headers: this.#headers, }); @@ -1689,16 +1853,19 @@ export class LemmyHttp { type_: HttpType, endpoint: string, form: BodyType, + options: RequestOptions | undefined, ): Promise { let response: Response; if (type_ === HttpType.Get) { const getUrl = `${this.#buildFullUrl(endpoint)}?${encodeGetParams(form)}`; response = await this.#fetchFunction(getUrl, { + ...options, method: HttpType.Get, headers: this.#headers, }); } else { response = await this.#fetchFunction(this.#buildFullUrl(endpoint), { + ...options, method: type_, headers: { "Content-Type": "application/json",