From 5beaaf97802220dea9879213ef92912eff6475b1 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 19 Sep 2023 16:45:02 -0700 Subject: [PATCH 01/14] Run npm update --- package-lock.json | 1092 ++++++++++++++++----------------------------- 1 file changed, 382 insertions(+), 710 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8403176..47897cda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,12 +45,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz", - "integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.10", + "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" }, "engines": { @@ -114,21 +114,21 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", - "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, @@ -211,33 +211,33 @@ "dev": true }, "node_modules/@esbuild-kit/cjs-loader": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", - "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.4.tgz", + "integrity": "sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==", "dev": true, "dependencies": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" + "@esbuild-kit/core-utils": "^3.2.3", + "get-tsconfig": "^4.7.0" } }, "node_modules/@esbuild-kit/core-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", - "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", + "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", "dev": true, "dependencies": { - "esbuild": "~0.17.6", + "esbuild": "~0.18.20", "source-map-support": "^0.5.21" } }, "node_modules/@esbuild-kit/esm-loader": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", - "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", + "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", "dev": true, "dependencies": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" + "@esbuild-kit/core-utils": "^3.3.2", + "get-tsconfig": "^4.7.0" } }, "node_modules/@esbuild/android-arm": { @@ -481,9 +481,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -608,9 +608,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", - "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", + "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -640,18 +640,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -788,17 +788,6 @@ "zod": "^3.21.4" } }, - "node_modules/@seamapi/types/node_modules/type-fest": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.3.1.tgz", - "integrity": "sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -806,9 +795,9 @@ "dev": true }, "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", "dev": true, "peer": true }, @@ -826,9 +815,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.9.tgz", - "integrity": "sha512-fxaKquqYcPOGwE7tC1anJaPJ0GHyOVzfA2oUoXECjBjrtsIz4YJvtNYsq8LUcjEUehEF+jGpx8Z+lFrtT6z0tg==", + "version": "18.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.17.tgz", + "integrity": "sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -838,9 +827,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", "dev": true, "peer": true }, @@ -860,17 +849,17 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", - "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", + "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", "dev": true, "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/type-utils": "6.4.1", - "@typescript-eslint/utils": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/type-utils": "6.7.2", + "@typescript-eslint/utils": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -896,15 +885,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", - "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", + "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/typescript-estree": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4" }, "engines": { @@ -924,13 +913,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", - "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", + "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1" + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -941,14 +930,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", - "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", + "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.4.1", - "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/utils": "6.7.2", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -969,9 +958,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", - "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", + "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -982,13 +971,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", - "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", + "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1009,18 +998,18 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", - "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", + "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", "dev": true, "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", "semver": "^7.5.4" }, "engines": { @@ -1035,12 +1024,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", - "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", + "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/types": "6.7.2", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1198,16 +1187,16 @@ } }, "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", "is-string": "^1.0.7" }, "engines": { @@ -1227,17 +1216,17 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", - "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" + "get-intrinsic": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -1247,15 +1236,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -1266,15 +1255,15 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -1285,15 +1274,16 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", - "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", "dev": true, "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1", "is-array-buffer": "^3.0.2", "is-shared-array-buffer": "^1.0.2" @@ -2008,21 +1998,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/concurrently/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -2176,13 +2151,29 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dev": true, + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "peer": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -2194,9 +2185,9 @@ } }, "node_modules/del": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-7.0.0.tgz", - "integrity": "sha512-tQbV/4u5WVB8HMJr08pgw0b6nG4RGt/tj+7Numvq+zqcvUFeMaIWWOUFltiU+6go8BSO2/ogsB4EasDaj0y68Q==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/del/-/del-7.1.0.tgz", + "integrity": "sha512-v2KyNk7efxhlyHpjEvfyxaAihKKK0nWCuf6ZtqZcFFpQRG0bJ12Qsr0RpvsICMjAAZ8DOVCxrlqpxISlMHC4Kg==", "dev": true, "dependencies": { "globby": "^13.1.2", @@ -2216,12 +2207,12 @@ } }, "node_modules/del-cli": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.0.0.tgz", - "integrity": "sha512-rENFhUaYcjoMODwFhhlON+ogN7DoG+4+GFN+bsA1XeDt4w2OKQnQadFP1thHSAlK9FAtl88qgP66wOV+eFZZiQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.1.0.tgz", + "integrity": "sha512-xwMeh2acluWeccsfzE7VLsG3yTr7nWikbfw+xhMnpRrF15pGSkw+3/vJZWlGoE4I86UiLRNHicmKt4tkIX9Jtg==", "dev": true, "dependencies": { - "del": "^7.0.0", + "del": "^7.1.0", "meow": "^10.1.3" }, "bin": { @@ -2321,19 +2312,19 @@ } }, "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", "dev": true, "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.2", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", + "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", @@ -2349,23 +2340,23 @@ "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.12", "is-weakref": "^1.0.2", "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.0", "typed-array-byte-length": "^1.0.0", "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -2394,400 +2385,64 @@ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", "dev": true, - "peer": true, - "dependencies": { - "has": "^1.0.3" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "peer": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/esbuild": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.17.19", - "@esbuild/android-arm64": "0.17.19", - "@esbuild/android-x64": "0.17.19", - "@esbuild/darwin-arm64": "0.17.19", - "@esbuild/darwin-x64": "0.17.19", - "@esbuild/freebsd-arm64": "0.17.19", - "@esbuild/freebsd-x64": "0.17.19", - "@esbuild/linux-arm": "0.17.19", - "@esbuild/linux-arm64": "0.17.19", - "@esbuild/linux-ia32": "0.17.19", - "@esbuild/linux-loong64": "0.17.19", - "@esbuild/linux-mips64el": "0.17.19", - "@esbuild/linux-ppc64": "0.17.19", - "@esbuild/linux-riscv64": "0.17.19", - "@esbuild/linux-s390x": "0.17.19", - "@esbuild/linux-x64": "0.17.19", - "@esbuild/netbsd-x64": "0.17.19", - "@esbuild/openbsd-x64": "0.17.19", - "@esbuild/sunos-x64": "0.17.19", - "@esbuild/win32-arm64": "0.17.19", - "@esbuild/win32-ia32": "0.17.19", - "@esbuild/win32-x64": "0.17.19" - } - }, - "node_modules/esbuild/node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" + "peer": true, + "dependencies": { + "has": "^1.0.3" } }, - "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", - "cpu": [ - "ia32" - ], + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "peer": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, "engines": { - "node": ">=12" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esbuild/node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", - "cpu": [ - "x64" - ], + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escalade": { @@ -2812,16 +2467,16 @@ } }, "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.12.4", @@ -3060,15 +2715,16 @@ } }, "node_modules/eslint-plugin-n": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.0.2.tgz", - "integrity": "sha512-Y66uDfUNbBzypsr0kELWrIz+5skicECrLUqlWuXawNSLUq3ltGlCwu6phboYYOTSnoTdHgTLrc+5Ydo6KjzZog==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.1.0.tgz", + "integrity": "sha512-3wv/TooBst0N4ND+pnvffHuz9gNPmk/NkLwAxOt2JykTl/hcuECe6yhTtLJcZjIxtZwN+GX92ACp/QTLpHA3Hg==", "dev": true, "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", "eslint-plugin-es-x": "^7.1.0", + "get-tsconfig": "^4.7.0", "ignore": "^5.2.4", "is-core-module": "^2.12.1", "minimatch": "^3.1.2", @@ -3256,6 +2912,18 @@ "node": ">=8" } }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -3508,22 +3176,23 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/for-each": { @@ -3576,16 +3245,16 @@ "dev": true }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -3737,6 +3406,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/globalthis": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", @@ -4448,6 +4129,18 @@ "node": ">=10" } }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/istanbul-reports": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", @@ -4497,6 +4190,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -4528,6 +4227,15 @@ "json5": "lib/cli.js" } }, + "node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -5011,15 +4719,15 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", - "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -5029,28 +4737,28 @@ } }, "node_modules/object.groupby": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", - "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "es-abstract": "^1.21.2", + "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1" } }, "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -5303,15 +5011,15 @@ } }, "node_modules/pino": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.0.tgz", - "integrity": "sha512-olUADJByk4twxccmAxb1RiGKOSvddHugCV3wkqjyv+3Sooa2KLrmXrKEWOKi0XPCLasRR5jBXxioE1jxUa4KzQ==", + "version": "8.15.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.1.tgz", + "integrity": "sha512-Cp4QzUQrvWCRJaQ8Lzv0mJzXVk4z2jlq8JNKMGaixC2Pz5L4l2p95TkuRvYbrEbe85NQsDKrAd4zalf7Ml6WiA==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "v1.0.0", + "pino-abstract-transport": "v1.1.0", "pino-std-serializers": "^6.0.0", "process-warning": "^2.0.0", "quick-format-unescaped": "^4.0.3", @@ -5325,9 +5033,9 @@ } }, "node_modules/pino-abstract-transport": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz", - "integrity": "sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", "dev": true, "dependencies": { "readable-stream": "^4.0.0", @@ -5535,9 +5243,9 @@ } }, "node_modules/prettier": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", - "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5761,15 +5469,15 @@ "dev": true }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -5788,9 +5496,9 @@ } }, "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "version": "1.22.6", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", + "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", "dev": true, "peer": true, "dependencies": { @@ -5938,14 +5646,14 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", - "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", + "get-intrinsic": "^1.2.1", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -6048,6 +5756,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "peer": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6137,12 +5860,15 @@ } }, "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", "dev": true, + "dependencies": { + "whatwg-url": "^7.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/source-map-support": { @@ -6155,6 +5881,15 @@ "source-map": "^0.6.0" } }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", @@ -6188,9 +5923,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", + "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", "dev": true }, "node_modules/split2": { @@ -6256,15 +5991,15 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -6274,30 +6009,30 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dev": true, "peer": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6453,15 +6188,18 @@ } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -6608,9 +6346,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", - "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, "engines": { "node": ">=16.13.0" @@ -6706,59 +6444,6 @@ } } }, - "node_modules/tsup/node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsup/node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" - } - }, "node_modules/tsup/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -6768,27 +6453,15 @@ "node": ">=8" } }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "dev": true, - "dependencies": { - "whatwg-url": "^7.0.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/tsx": { - "version": "3.12.7", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.7.tgz", - "integrity": "sha512-C2Ip+jPmqKd1GWVQDvz/Eyc6QJbGfE7NrR3fx5BpEHMZsEHoIxHL1j+lKdGobr8ovEyqeNkPLSKp6SCSOt7gmw==", + "version": "3.12.10", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.10.tgz", + "integrity": "sha512-2+46h4xvUt1aLDNvk5YBT8Uzw+b7BolGbn7iSMucYqCXZiDc+1IMghLVdw8kKjING32JFOeO+Am9posvjkeclA==", "dev": true, "dependencies": { "@esbuild-kit/cjs-loader": "^2.4.2", - "@esbuild-kit/core-utils": "^3.0.0", - "@esbuild-kit/esm-loader": "^2.5.5" + "@esbuild-kit/core-utils": "^3.3.0", + "@esbuild-kit/esm-loader": "^2.6.3" }, "bin": { "tsx": "dist/cli.js" @@ -6810,12 +6483,11 @@ } }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.3.1.tgz", + "integrity": "sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==", "engines": { - "node": ">=10" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6891,9 +6563,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", From b1323b3de47226684c2cc937cc6272086523e0f9 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 19 Sep 2023 16:29:07 -0700 Subject: [PATCH 02/14] Add client with workspaces.get --- package-lock.json | 99 +++++++++++++++++++++- package.json | 3 +- src/lib/seam/connect/auth.ts | 68 +++++++++++++++ src/lib/seam/connect/client-options.ts | 55 ++++++++++++ src/lib/seam/connect/client.ts | 111 +++++++++++++++++++++++-- 5 files changed, 322 insertions(+), 14 deletions(-) create mode 100644 src/lib/seam/connect/auth.ts create mode 100644 src/lib/seam/connect/client-options.ts diff --git a/package-lock.json b/package-lock.json index 47897cda..da8e6bb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@seamapi/types": "^1.12.0" + "@seamapi/types": "^1.13.0", + "axios": "^1.5.0" }, "devDependencies": { "@types/node": "^18.11.18", @@ -774,9 +775,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.12.0.tgz", - "integrity": "sha512-FvuoAJ94WLAMukg3/dCzXt50tXtFYe6TFkWAgb5TG2PHnwGVZTokOgvFyNp/elOf7kUYjWSrnX4OtAVKMDrMJQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.13.0.tgz", + "integrity": "sha512-6joTzfVxDzanJplOfYupig0yeCA8mY2tgypNAdquYBV7bGR9uQGvLg1HMzKXG71CgRmoca04YuI2f2hJnnf3nQ==", "dependencies": { "type-fest": "^4.1.0" }, @@ -1316,6 +1317,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -1422,6 +1428,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1870,6 +1886,17 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "9.5.0", "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", @@ -2245,6 +2272,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -3195,6 +3230,25 @@ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -3218,6 +3272,19 @@ "node": ">=8.0.0" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4524,6 +4591,25 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -5287,6 +5373,11 @@ "integrity": "sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg==", "dev": true }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", diff --git a/package.json b/package.json index fb82e2c8..90d288ba 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,8 @@ "npm": ">= 8.1.0" }, "dependencies": { - "@seamapi/types": "^1.12.0" + "@seamapi/types": "^1.13.0", + "axios": "^1.5.0" }, "devDependencies": { "@types/node": "^18.11.18", diff --git a/src/lib/seam/connect/auth.ts b/src/lib/seam/connect/auth.ts new file mode 100644 index 00000000..b01e51b5 --- /dev/null +++ b/src/lib/seam/connect/auth.ts @@ -0,0 +1,68 @@ +import type { + SeamHttpOptionsWithApiKey, + SeamHttpOptionsWithClientSessionToken, +} from './client-options.js' + +type Headers = Record + +export const getAuthHeadersForApiKey = ({ + apiKey, +}: SeamHttpOptionsWithApiKey): Headers => { + if (isClientSessionToken(apiKey)) { + throw new InvalidSeamTokenError( + 'A Client Session Token cannot be used as an apiKey', + ) + } + + if (isAccessToken(apiKey)) { + throw new InvalidSeamTokenError( + 'An access token cannot be used as an apiKey without specifying a workspaceId', + ) + } + + if (isJwt(apiKey) || !isSeamToken(apiKey)) { + throw new InvalidSeamTokenError( + `Unknown or Invalid apiKey format, expected token to start with ${tokenPrefix}`, + ) + } + + return { + authorization: `Bearer ${apiKey}`, + } +} + +export const getAuthHeadersForClientSessionToken = ({ + clientSessionToken, +}: SeamHttpOptionsWithClientSessionToken): Headers => { + if (!isClientSessionToken(clientSessionToken)) { + throw new InvalidSeamTokenError( + `Unknown or invalid clientSessionToken format, expected token to start with ${clientSessionTokenPrefix}`, + ) + } + + return { + authorization: `Bearer ${clientSessionToken}`, + 'client-session-token': clientSessionToken, + } +} + +export class InvalidSeamTokenError extends Error { + constructor(message: string) { + super(`SeamHttp received an authorization invalid token: ${message}`) + this.name = this.constructor.name + Error.captureStackTrace(this, this.constructor) + } +} + +const tokenPrefix = 'seam_' + +const clientSessionTokenPrefix = 'seam_cst' + +const isClientSessionToken = (token: string): boolean => + token.startsWith(clientSessionTokenPrefix) + +const isAccessToken = (token: string): boolean => token.startsWith('seam_at') + +const isJwt = (token: string): boolean => token.startsWith('ey') + +const isSeamToken = (token: string): boolean => token.startsWith(tokenPrefix) diff --git a/src/lib/seam/connect/client-options.ts b/src/lib/seam/connect/client-options.ts new file mode 100644 index 00000000..b51cd484 --- /dev/null +++ b/src/lib/seam/connect/client-options.ts @@ -0,0 +1,55 @@ +import type { AxiosRequestConfig } from 'axios' + +export type SeamHttpOptions = + | SeamHttpOptionsWithApiKey + | SeamHttpOptionsWithClientSessionToken + +interface SeamHttpCommonOptions { + endpoint?: string + axiosOptions?: AxiosRequestConfig +} + +export interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions { + apiKey: string +} + +export const isSeamHttpOptionsWithApiKey = ( + options: SeamHttpOptions, +): options is SeamHttpOptionsWithApiKey => { + if (!('apiKey' in options)) return false + + if ('clientSessionToken' in options && options.clientSessionToken != null) { + throw new InvalidSeamHttpOptionsError( + 'The clientSessionToken option cannot be used with the apiKey option.', + ) + } + + return true +} + +export interface SeamHttpOptionsWithClientSessionToken + extends SeamHttpCommonOptions { + clientSessionToken: string +} + +export const isSeamHttpOptionsWithClientSessionToken = ( + options: SeamHttpOptions, +): options is SeamHttpOptionsWithClientSessionToken => { + if (!('clientSessionToken' in options)) return false + + if ('apiKey' in options && options.apiKey != null) { + throw new InvalidSeamHttpOptionsError( + 'The clientSessionToken option cannot be used with the apiKey option.', + ) + } + + return true +} + +export class InvalidSeamHttpOptionsError extends Error { + constructor(message: string) { + super(`SeamHttp received invalid options: ${message}`) + this.name = this.constructor.name + Error.captureStackTrace(this, this.constructor) + } +} diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index a3926c8d..b4e5d8d4 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -1,19 +1,112 @@ +import axios, { type Axios } from 'axios' + +import { + getAuthHeadersForApiKey, + getAuthHeadersForClientSessionToken, +} from './auth.js' +import { + InvalidSeamHttpOptionsError, + isSeamHttpOptionsWithApiKey, + isSeamHttpOptionsWithClientSessionToken, + type SeamHttpOptions, + type SeamHttpOptionsWithApiKey, + type SeamHttpOptionsWithClientSessionToken, +} from './client-options.js' + export class SeamHttp { - static fromApiKey(_apiKey: string): SeamHttp { - return new SeamHttp() + client: Axios + + constructor(apiKeyOrOptions: string | SeamHttpOptions) { + const options = parseOptions( + typeof apiKeyOrOptions === 'string' + ? { apiKey: apiKeyOrOptions } + : apiKeyOrOptions, + ) + + const axiosOptions = { + baseURL: options.endpoint, + ...options.axiosOptions, + headers: options.axiosOptions.headers ?? {}, + } + + if (isSeamHttpOptionsWithApiKey(options)) { + this.client = axios.create({ + ...axiosOptions, + headers: { + ...getAuthHeadersForApiKey(options), + ...axiosOptions.headers, + }, + }) + return + } + + if (isSeamHttpOptionsWithClientSessionToken(options)) { + this.client = axios.create({ + ...axiosOptions, + headers: { + ...getAuthHeadersForClientSessionToken(options), + ...axiosOptions.headers, + }, + }) + return + } + + throw new InvalidSeamHttpOptionsError( + 'Must specify an apiKey or clientSessionToken', + ) } - static fromClientSessionToken(): SeamHttp { - return new SeamHttp() + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttp { + const opts = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(opts)) { + throw new InvalidSeamHttpOptionsError('Missing apiKey') + } + return new SeamHttp(opts) } - static async fromPublishableKey(): Promise { - return new SeamHttp() + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttp { + const opts = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(opts)) { + throw new InvalidSeamHttpOptionsError('Missing clientSessionToken') + } + return new SeamHttp(opts) } - workspaces = { - async get(): Promise { - return null + public readonly workspaces = { + get: async (): Promise<{ workspace_id: string }> => { + const { + data: { workspace }, + } = await this.client.get('/workspaces/get') + return workspace }, } } + +const parseOptions = (options: SeamHttpOptions): Required => { + const endpoint = + options.endpoint ?? + globalThis?.process?.env?.['SEAM_ENDPOINT'] ?? + globalThis?.process?.env?.['SEAM_API_URL'] ?? + 'https://connect.getseam.com' + + const apiKey = + 'apiKey' in options + ? options.apiKey + : globalThis.process?.env?.['SEAM_API_KEY'] + + return { + ...options, + ...(apiKey != null ? { apiKey } : {}), + endpoint, + axiosOptions: options.axiosOptions ?? {}, + } +} From eb4a66ddc82e636aca42a7692801b515c4444331 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 18:11:28 -0700 Subject: [PATCH 03/14] Update seamapi types --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index da8e6bb4..431858a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@seamapi/types": "^1.13.0", + "@seamapi/types": "^1.14.0", "axios": "^1.5.0" }, "devDependencies": { @@ -775,9 +775,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.13.0.tgz", - "integrity": "sha512-6joTzfVxDzanJplOfYupig0yeCA8mY2tgypNAdquYBV7bGR9uQGvLg1HMzKXG71CgRmoca04YuI2f2hJnnf3nQ==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.14.0.tgz", + "integrity": "sha512-HuOzETOB/Tiw4srjKmAfvYzaeJaMMC04p8I6NHYvrZKf7fLLInlkKlaAn5xPl4Hy46hV2qb2S+Hkgf1WzLlcQA==", "dependencies": { "type-fest": "^4.1.0" }, diff --git a/package.json b/package.json index 90d288ba..d13d7532 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "npm": ">= 8.1.0" }, "dependencies": { - "@seamapi/types": "^1.13.0", + "@seamapi/types": "^1.14.0", "axios": "^1.5.0" }, "devDependencies": { From 8decfeb9d8c82732ca5dacc580c6fbe31c738c03 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 18:25:33 -0700 Subject: [PATCH 04/14] Setup basic structure --- package-lock.json | 3 +- package.json | 3 +- src/lib/seam/connect/auth.ts | 28 ++++++++++--- src/lib/seam/connect/client.ts | 50 +++++------------------ src/lib/seam/connect/routes/workspaces.ts | 35 ++++++++++++++++ 5 files changed, 72 insertions(+), 47 deletions(-) create mode 100644 src/lib/seam/connect/routes/workspaces.ts diff --git a/package-lock.json b/package-lock.json index 431858a3..5dbdefdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "license": "MIT", "dependencies": { "@seamapi/types": "^1.14.0", - "axios": "^1.5.0" + "axios": "^1.5.0", + "type-fest": "^4.3.1" }, "devDependencies": { "@types/node": "^18.11.18", diff --git a/package.json b/package.json index d13d7532..154156a9 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,8 @@ }, "dependencies": { "@seamapi/types": "^1.14.0", - "axios": "^1.5.0" + "axios": "^1.5.0", + "type-fest": "^4.3.1" }, "devDependencies": { "@types/node": "^18.11.18", diff --git a/src/lib/seam/connect/auth.ts b/src/lib/seam/connect/auth.ts index b01e51b5..09d19757 100644 --- a/src/lib/seam/connect/auth.ts +++ b/src/lib/seam/connect/auth.ts @@ -1,11 +1,29 @@ -import type { - SeamHttpOptionsWithApiKey, - SeamHttpOptionsWithClientSessionToken, +import { + InvalidSeamHttpOptionsError, + isSeamHttpOptionsWithApiKey, + isSeamHttpOptionsWithClientSessionToken, + type SeamHttpOptions, + type SeamHttpOptionsWithApiKey, + type SeamHttpOptionsWithClientSessionToken, } from './client-options.js' type Headers = Record -export const getAuthHeadersForApiKey = ({ +export const getAuthHeaders = (options: SeamHttpOptions): Headers => { + if (isSeamHttpOptionsWithApiKey(options)) { + return getAuthHeadersForApiKey(options) + } + + if (isSeamHttpOptionsWithClientSessionToken(options)) { + return getAuthHeadersForClientSessionToken(options) + } + + throw new InvalidSeamHttpOptionsError( + 'Must specify an apiKey or clientSessionToken', + ) +} + +const getAuthHeadersForApiKey = ({ apiKey, }: SeamHttpOptionsWithApiKey): Headers => { if (isClientSessionToken(apiKey)) { @@ -31,7 +49,7 @@ export const getAuthHeadersForApiKey = ({ } } -export const getAuthHeadersForClientSessionToken = ({ +const getAuthHeadersForClientSessionToken = ({ clientSessionToken, }: SeamHttpOptionsWithClientSessionToken): Headers => { if (!isClientSessionToken(clientSessionToken)) { diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index b4e5d8d4..1495ad0b 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -1,9 +1,6 @@ import axios, { type Axios } from 'axios' -import { - getAuthHeadersForApiKey, - getAuthHeadersForClientSessionToken, -} from './auth.js' +import { getAuthHeaders } from './auth.js' import { InvalidSeamHttpOptionsError, isSeamHttpOptionsWithApiKey, @@ -12,6 +9,7 @@ import { type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClientSessionToken, } from './client-options.js' +import { Workspaces } from './routes/workspaces.js' export class SeamHttp { client: Axios @@ -23,37 +21,14 @@ export class SeamHttp { : apiKeyOrOptions, ) - const axiosOptions = { + this.client = axios.create({ baseURL: options.endpoint, ...options.axiosOptions, - headers: options.axiosOptions.headers ?? {}, - } - - if (isSeamHttpOptionsWithApiKey(options)) { - this.client = axios.create({ - ...axiosOptions, - headers: { - ...getAuthHeadersForApiKey(options), - ...axiosOptions.headers, - }, - }) - return - } - - if (isSeamHttpOptionsWithClientSessionToken(options)) { - this.client = axios.create({ - ...axiosOptions, - headers: { - ...getAuthHeadersForClientSessionToken(options), - ...axiosOptions.headers, - }, - }) - return - } - - throw new InvalidSeamHttpOptionsError( - 'Must specify an apiKey or clientSessionToken', - ) + headers: { + ...getAuthHeaders(options), + ...options.axiosOptions.headers, + }, + }) } static fromApiKey( @@ -81,13 +56,8 @@ export class SeamHttp { return new SeamHttp(opts) } - public readonly workspaces = { - get: async (): Promise<{ workspace_id: string }> => { - const { - data: { workspace }, - } = await this.client.get('/workspaces/get') - return workspace - }, + get workspaces(): Workspaces { + return new Workspaces(this.client) } } diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts new file mode 100644 index 00000000..b97937e4 --- /dev/null +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -0,0 +1,35 @@ +import type { Routes } from '@seamapi/types/connect' +import type { Axios } from 'axios' +import type { SetNonNullable } from 'type-fest' +// import type { Workspace } from @seamapi/types + +export class Workspaces { + #client: Axios + + constructor(client: Axios) { + this.#client = client + } + + async get(params: WorkspacesGetParams = {}): Promise { + const { + data: { workspace }, + } = await this.#client.get('/workspaces/get', { + params, + }) + return workspace + } +} + +export type WorkspacesGetParams = SetNonNullable< + Required +> + +export type WorkspacesGetResponse = SetNonNullable< + Required +> + +// UPSTREAM: Should come from @seamapi/types/connect +// export type { Workspace } from '@seamapi/types/connect' +export interface Workspace { + workspace_id: string +} From 95eefea6d7ca7eb56a095b6d21114661794303c5 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 19:34:19 -0700 Subject: [PATCH 05/14] Add some TODO notes --- src/lib/seam/connect/client-options.ts | 6 ++++++ src/lib/seam/connect/client.ts | 10 ++++++++++ src/lib/seam/connect/routes/workspaces.ts | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/seam/connect/client-options.ts b/src/lib/seam/connect/client-options.ts index b51cd484..1abec908 100644 --- a/src/lib/seam/connect/client-options.ts +++ b/src/lib/seam/connect/client-options.ts @@ -53,3 +53,9 @@ export class InvalidSeamHttpOptionsError extends Error { Error.captureStackTrace(this, this.constructor) } } + +// TODO: withSessionToken { sessionToken } or withMultiWorkspaceApiKey { apiKey }? +// export interface SeamHttpOptionsWithSessionToken extends SeamHttpCommonOptions { +// workspaceId: string +// apiKey: string +// } diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index 1495ad0b..6cdb58b1 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -21,12 +21,15 @@ export class SeamHttp { : apiKeyOrOptions, ) + // TODO: axiosRetry? Allow options to configure this if so this.client = axios.create({ baseURL: options.endpoint, + withCredentials: isSeamHttpOptionsWithClientSessionToken(options), ...options.axiosOptions, headers: { ...getAuthHeaders(options), ...options.axiosOptions.headers, + // TODO: User-Agent }, }) } @@ -56,6 +59,13 @@ export class SeamHttp { return new SeamHttp(opts) } + // TODO + // static fromPublishableKey and deprecate getClientSessionToken + + // TODO: Should we keep makeRequest? + // Better to implement error handling and wrapping in an error handler. + // makeRequest + get workspaces(): Workspaces { return new Workspaces(this.client) } diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index b97937e4..00ff241a 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -1,7 +1,7 @@ +// TODO: This file is generated from route spec import type { Routes } from '@seamapi/types/connect' import type { Axios } from 'axios' import type { SetNonNullable } from 'type-fest' -// import type { Workspace } from @seamapi/types export class Workspaces { #client: Axios @@ -29,6 +29,7 @@ export type WorkspacesGetResponse = SetNonNullable< > // UPSTREAM: Should come from @seamapi/types/connect +// import type { Workspace } from @seamapi/types // export type { Workspace } from '@seamapi/types/connect' export interface Workspace { workspace_id: string From 187a36e828029bb511668c3e35f3409ff4621e77 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 20:01:21 -0700 Subject: [PATCH 06/14] Add support for legacy behavior override --- src/lib/seam/connect/client-options.ts | 1 + src/lib/seam/connect/client.ts | 10 +++++++- src/lib/seam/connect/legacy/workspaces.ts | 31 +++++++++++++++++++++++ src/lib/seam/connect/routes/workspaces.ts | 6 ++--- 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/lib/seam/connect/legacy/workspaces.ts diff --git a/src/lib/seam/connect/client-options.ts b/src/lib/seam/connect/client-options.ts index 1abec908..df3bbefa 100644 --- a/src/lib/seam/connect/client-options.ts +++ b/src/lib/seam/connect/client-options.ts @@ -7,6 +7,7 @@ export type SeamHttpOptions = interface SeamHttpCommonOptions { endpoint?: string axiosOptions?: AxiosRequestConfig + enableLegacyMethodBehaivor?: boolean } export interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions { diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index 6cdb58b1..10e5105d 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -9,11 +9,14 @@ import { type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClientSessionToken, } from './client-options.js' +import { LegacyWorkspaces } from './legacy/workspaces.js' import { Workspaces } from './routes/workspaces.js' export class SeamHttp { client: Axios + #legacy: boolean + constructor(apiKeyOrOptions: string | SeamHttpOptions) { const options = parseOptions( typeof apiKeyOrOptions === 'string' @@ -21,6 +24,8 @@ export class SeamHttp { : apiKeyOrOptions, ) + this.#legacy = options.enableLegacyMethodBehaivor + // TODO: axiosRetry? Allow options to configure this if so this.client = axios.create({ baseURL: options.endpoint, @@ -67,7 +72,9 @@ export class SeamHttp { // makeRequest get workspaces(): Workspaces { - return new Workspaces(this.client) + const workspaces = new Workspaces(this.client) + if (this.#legacy) return new LegacyWorkspaces(this.client) + return workspaces } } @@ -88,5 +95,6 @@ const parseOptions = (options: SeamHttpOptions): Required => { ...(apiKey != null ? { apiKey } : {}), endpoint, axiosOptions: options.axiosOptions ?? {}, + enableLegacyMethodBehaivor: false, } } diff --git a/src/lib/seam/connect/legacy/workspaces.ts b/src/lib/seam/connect/legacy/workspaces.ts new file mode 100644 index 00000000..d870a9c9 --- /dev/null +++ b/src/lib/seam/connect/legacy/workspaces.ts @@ -0,0 +1,31 @@ +// TODO: Example of non-generated overrides to methods to preserve legacy behavior +import type { Routes } from '@seamapi/types/connect' +import type { SetNonNullable } from 'type-fest' + +import { Workspaces } from 'lib/seam/connect/routes/workspaces.js' + +export class LegacyWorkspaces extends Workspaces { + override async get(params: WorkspacesGetParams = {}): Promise { + const { + data: { workspace }, + } = await this.client.get('/workspaces/get', { + params, + }) + return workspace + } +} + +export type WorkspacesGetParams = SetNonNullable< + Required +> + +export type WorkspacesGetResponse = SetNonNullable< + Required +> + +// UPSTREAM: Should come from @seamapi/types/connect +// import type { Workspace } from @seamapi/types +// export type { Workspace } from '@seamapi/types/connect' +export interface Workspace { + workspace_id: string +} diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index 00ff241a..b21ae010 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -4,16 +4,16 @@ import type { Axios } from 'axios' import type { SetNonNullable } from 'type-fest' export class Workspaces { - #client: Axios + client: Axios constructor(client: Axios) { - this.#client = client + this.client = client } async get(params: WorkspacesGetParams = {}): Promise { const { data: { workspace }, - } = await this.#client.get('/workspaces/get', { + } = await this.client.get('/workspaces/get', { params, }) return workspace From 52579285545eb79530671224428f5bb03f663ddf Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 20:04:19 -0700 Subject: [PATCH 07/14] Fix tests --- src/lib/seam/connect/client.test.ts | 2 +- test/seam/connect/client.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/seam/connect/client.test.ts b/src/lib/seam/connect/client.test.ts index 2a8aca40..97085e10 100644 --- a/src/lib/seam/connect/client.test.ts +++ b/src/lib/seam/connect/client.test.ts @@ -3,5 +3,5 @@ import test from 'ava' import { SeamHttp } from './client.js' test('SeamHttp: fromApiKey', (t) => { - t.truthy(SeamHttp.fromApiKey('some-api-key')) + t.truthy(SeamHttp.fromApiKey('seam_some-api-key')) }) diff --git a/test/seam/connect/client.test.ts b/test/seam/connect/client.test.ts index 85abc31a..5403e751 100644 --- a/test/seam/connect/client.test.ts +++ b/test/seam/connect/client.test.ts @@ -3,5 +3,5 @@ import test from 'ava' import { SeamHttp } from '@seamapi/http/connect' test('SeamHttp: fromApiKey', (t) => { - t.truthy(SeamHttp.fromApiKey('some-api-key')) + t.truthy(SeamHttp.fromApiKey('seam_some-api-key')) }) From db3ede428cb3532f3308bf65bcf91f3f20dc0954 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 20 Sep 2023 20:06:45 -0700 Subject: [PATCH 08/14] Move type packages to optional peerDependencies --- package-lock.json | 21 ++++++++++++++++++--- package.json | 18 +++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5dbdefdb..78681b0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,10 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@seamapi/types": "^1.14.0", - "axios": "^1.5.0", - "type-fest": "^4.3.1" + "axios": "^1.5.0" }, "devDependencies": { + "@seamapi/types": "^1.14.0", "@types/node": "^18.11.18", "ava": "^5.0.1", "c8": "^8.0.0", @@ -30,11 +29,24 @@ "tsc-alias": "^1.8.2", "tsup": "^7.2.0", "tsx": "^3.12.1", + "type-fest": "^4.3.1", "typescript": "^5.1.0" }, "engines": { "node": ">=16.13.0", "npm": ">= 8.1.0" + }, + "peerDependencies": { + "@seamapi/types": "^1.0.0", + "type-fest": "^4.0.0" + }, + "peerDependenciesMeta": { + "@seamapi/types": { + "optional": true + }, + "type-fest": { + "optional": true + } } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -779,6 +791,7 @@ "version": "1.14.0", "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.14.0.tgz", "integrity": "sha512-HuOzETOB/Tiw4srjKmAfvYzaeJaMMC04p8I6NHYvrZKf7fLLInlkKlaAn5xPl4Hy46hV2qb2S+Hkgf1WzLlcQA==", + "dev": true, "dependencies": { "type-fest": "^4.1.0" }, @@ -6578,6 +6591,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.3.1.tgz", "integrity": "sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==", + "dev": true, "engines": { "node": ">=16" }, @@ -7048,6 +7062,7 @@ "version": "3.22.2", "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz", "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==", + "dev": true, "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index 154156a9..70e5d3ee 100644 --- a/package.json +++ b/package.json @@ -70,12 +70,23 @@ "node": ">=16.13.0", "npm": ">= 8.1.0" }, + "peerDependencies": { + "@seamapi/types": "^1.0.0", + "type-fest": "^4.0.0" + }, + "peerDependenciesMeta": { + "@seamapi/types": { + "optional": true + }, + "type-fest": { + "optional": true + } + }, "dependencies": { - "@seamapi/types": "^1.14.0", - "axios": "^1.5.0", - "type-fest": "^4.3.1" + "axios": "^1.5.0" }, "devDependencies": { + "@seamapi/types": "^1.14.0", "@types/node": "^18.11.18", "ava": "^5.0.1", "c8": "^8.0.0", @@ -92,6 +103,7 @@ "tsc-alias": "^1.8.2", "tsup": "^7.2.0", "tsx": "^3.12.1", + "type-fest": "^4.3.1", "typescript": "^5.1.0" } } From 86083cdcf29b652c595fb153148cb332245c0100 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 14:08:51 -0700 Subject: [PATCH 09/14] Apply suggestions from code review --- src/lib/seam/connect/auth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/seam/connect/auth.ts b/src/lib/seam/connect/auth.ts index 09d19757..ee5c4fdc 100644 --- a/src/lib/seam/connect/auth.ts +++ b/src/lib/seam/connect/auth.ts @@ -34,13 +34,13 @@ const getAuthHeadersForApiKey = ({ if (isAccessToken(apiKey)) { throw new InvalidSeamTokenError( - 'An access token cannot be used as an apiKey without specifying a workspaceId', + 'An access token cannot be used as an apiKey', ) } if (isJwt(apiKey) || !isSeamToken(apiKey)) { throw new InvalidSeamTokenError( - `Unknown or Invalid apiKey format, expected token to start with ${tokenPrefix}`, + `Unknown or invalid apiKey format, expected token to start with ${tokenPrefix}`, ) } @@ -66,7 +66,7 @@ const getAuthHeadersForClientSessionToken = ({ export class InvalidSeamTokenError extends Error { constructor(message: string) { - super(`SeamHttp received an authorization invalid token: ${message}`) + super(`SeamHttp received an invalid token: ${message}`) this.name = this.constructor.name Error.captureStackTrace(this, this.constructor) } From 73fb0e09612c4fa074a3718b1b5f6b3a490c6ee3 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:04:48 -0700 Subject: [PATCH 10/14] Use globalThis without .? --- src/lib/seam/connect/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index 10e5105d..c58c9260 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -81,8 +81,8 @@ export class SeamHttp { const parseOptions = (options: SeamHttpOptions): Required => { const endpoint = options.endpoint ?? - globalThis?.process?.env?.['SEAM_ENDPOINT'] ?? - globalThis?.process?.env?.['SEAM_API_URL'] ?? + globalThis.process?.env?.['SEAM_ENDPOINT'] ?? + globalThis.process?.env?.['SEAM_API_URL'] ?? 'https://connect.getseam.com' const apiKey = From 43a7cf9d92b5e9578a569c58ca9c4eefc706436f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:06:54 -0700 Subject: [PATCH 11/14] Use RouteResponse and RouteRequestParams --- src/lib/seam/connect/legacy/workspaces.ts | 18 ++++++------------ src/lib/seam/connect/routes/workspaces.ts | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/lib/seam/connect/legacy/workspaces.ts b/src/lib/seam/connect/legacy/workspaces.ts index d870a9c9..8072f225 100644 --- a/src/lib/seam/connect/legacy/workspaces.ts +++ b/src/lib/seam/connect/legacy/workspaces.ts @@ -1,11 +1,12 @@ -// TODO: Example of non-generated overrides to methods to preserve legacy behavior -import type { Routes } from '@seamapi/types/connect' +import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' import type { SetNonNullable } from 'type-fest' import { Workspaces } from 'lib/seam/connect/routes/workspaces.js' export class LegacyWorkspaces extends Workspaces { - override async get(params: WorkspacesGetParams = {}): Promise { + override async get( + params: WorkspacesGetParams = {}, + ): Promise { const { data: { workspace }, } = await this.client.get('/workspaces/get', { @@ -16,16 +17,9 @@ export class LegacyWorkspaces extends Workspaces { } export type WorkspacesGetParams = SetNonNullable< - Required + Required> > export type WorkspacesGetResponse = SetNonNullable< - Required + Required> > - -// UPSTREAM: Should come from @seamapi/types/connect -// import type { Workspace } from @seamapi/types -// export type { Workspace } from '@seamapi/types/connect' -export interface Workspace { - workspace_id: string -} diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index b21ae010..dd0c53f9 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -1,5 +1,4 @@ -// TODO: This file is generated from route spec -import type { Routes } from '@seamapi/types/connect' +import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' import type { Axios } from 'axios' import type { SetNonNullable } from 'type-fest' @@ -10,7 +9,9 @@ export class Workspaces { this.client = client } - async get(params: WorkspacesGetParams = {}): Promise { + async get( + params: WorkspacesGetParams = {}, + ): Promise { const { data: { workspace }, } = await this.client.get('/workspaces/get', { @@ -21,16 +22,9 @@ export class Workspaces { } export type WorkspacesGetParams = SetNonNullable< - Required + Required> > export type WorkspacesGetResponse = SetNonNullable< - Required + Required> > - -// UPSTREAM: Should come from @seamapi/types/connect -// import type { Workspace } from @seamapi/types -// export type { Workspace } from '@seamapi/types/connect' -export interface Workspace { - workspace_id: string -} From 93ba26439d68f8ccc85e9329806e0549b16a3592 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:08:35 -0700 Subject: [PATCH 12/14] Do not destructure data --- src/lib/seam/connect/legacy/workspaces.ts | 13 +++++++------ src/lib/seam/connect/routes/workspaces.ts | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/lib/seam/connect/legacy/workspaces.ts b/src/lib/seam/connect/legacy/workspaces.ts index 8072f225..be80de9f 100644 --- a/src/lib/seam/connect/legacy/workspaces.ts +++ b/src/lib/seam/connect/legacy/workspaces.ts @@ -7,12 +7,13 @@ export class LegacyWorkspaces extends Workspaces { override async get( params: WorkspacesGetParams = {}, ): Promise { - const { - data: { workspace }, - } = await this.client.get('/workspaces/get', { - params, - }) - return workspace + const { data } = await this.client.get( + '/workspaces/get', + { + params, + }, + ) + return data.workspace } } diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index dd0c53f9..a8601b40 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -12,12 +12,13 @@ export class Workspaces { async get( params: WorkspacesGetParams = {}, ): Promise { - const { - data: { workspace }, - } = await this.client.get('/workspaces/get', { - params, - }) - return workspace + const { data } = await this.client.get( + '/workspaces/get', + { + params, + }, + ) + return data.workspace } } From c2ad7680b11f6fd99daef1c59eae0834b8f618b7 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:38:40 -0700 Subject: [PATCH 13/14] Update parseOptions --- src/lib/seam/connect/client.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index c58c9260..11e6b43e 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -18,12 +18,7 @@ export class SeamHttp { #legacy: boolean constructor(apiKeyOrOptions: string | SeamHttpOptions) { - const options = parseOptions( - typeof apiKeyOrOptions === 'string' - ? { apiKey: apiKeyOrOptions } - : apiKeyOrOptions, - ) - + const options = parseOptions(apiKeyOrOptions) this.#legacy = options.enableLegacyMethodBehaivor // TODO: axiosRetry? Allow options to configure this if so @@ -78,7 +73,14 @@ export class SeamHttp { } } -const parseOptions = (options: SeamHttpOptions): Required => { +const parseOptions = ( + apiKeyOrOptions: string | SeamHttpOptions, +): Required => { + const options = + typeof apiKeyOrOptions === 'string' + ? { apiKey: apiKeyOrOptions } + : apiKeyOrOptions + const endpoint = options.endpoint ?? globalThis.process?.env?.['SEAM_ENDPOINT'] ?? From 2a9ad4a6a7cd818414684aa19bc2ab8628637d66 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:59:09 -0700 Subject: [PATCH 14/14] Make route classes work stand alone --- src/lib/seam/connect/axios.ts | 23 +++++++++ src/lib/seam/connect/client.ts | 57 ++++------------------- src/lib/seam/connect/legacy/workspaces.ts | 4 +- src/lib/seam/connect/parse-options.ts | 28 +++++++++++ src/lib/seam/connect/routes/workspaces.ts | 18 +++++-- 5 files changed, 76 insertions(+), 54 deletions(-) create mode 100644 src/lib/seam/connect/axios.ts create mode 100644 src/lib/seam/connect/parse-options.ts diff --git a/src/lib/seam/connect/axios.ts b/src/lib/seam/connect/axios.ts new file mode 100644 index 00000000..d55336c0 --- /dev/null +++ b/src/lib/seam/connect/axios.ts @@ -0,0 +1,23 @@ +import axios, { type Axios } from 'axios' + +import { getAuthHeaders } from './auth.js' +import { + isSeamHttpOptionsWithClientSessionToken, + type SeamHttpOptions, +} from './client-options.js' + +export const createAxiosClient = ( + options: Required, +): Axios => { + // TODO: axiosRetry? Allow options to configure this if so + return axios.create({ + baseURL: options.endpoint, + withCredentials: isSeamHttpOptionsWithClientSessionToken(options), + ...options.axiosOptions, + headers: { + ...getAuthHeaders(options), + ...options.axiosOptions.headers, + // TODO: User-Agent + }, + }) +} diff --git a/src/lib/seam/connect/client.ts b/src/lib/seam/connect/client.ts index 11e6b43e..ca7c1d36 100644 --- a/src/lib/seam/connect/client.ts +++ b/src/lib/seam/connect/client.ts @@ -1,6 +1,6 @@ -import axios, { type Axios } from 'axios' +import type { Axios } from 'axios' -import { getAuthHeaders } from './auth.js' +import { createAxiosClient } from './axios.js' import { InvalidSeamHttpOptionsError, isSeamHttpOptionsWithApiKey, @@ -9,8 +9,9 @@ import { type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClientSessionToken, } from './client-options.js' -import { LegacyWorkspaces } from './legacy/workspaces.js' -import { Workspaces } from './routes/workspaces.js' +import { LegacyWorkspacesHttp } from './legacy/workspaces.js' +import { parseOptions } from './parse-options.js' +import { WorkspacesHttp } from './routes/workspaces.js' export class SeamHttp { client: Axios @@ -20,18 +21,7 @@ export class SeamHttp { constructor(apiKeyOrOptions: string | SeamHttpOptions) { const options = parseOptions(apiKeyOrOptions) this.#legacy = options.enableLegacyMethodBehaivor - - // TODO: axiosRetry? Allow options to configure this if so - this.client = axios.create({ - baseURL: options.endpoint, - withCredentials: isSeamHttpOptionsWithClientSessionToken(options), - ...options.axiosOptions, - headers: { - ...getAuthHeaders(options), - ...options.axiosOptions.headers, - // TODO: User-Agent - }, - }) + this.client = createAxiosClient(options) } static fromApiKey( @@ -66,37 +56,8 @@ export class SeamHttp { // Better to implement error handling and wrapping in an error handler. // makeRequest - get workspaces(): Workspaces { - const workspaces = new Workspaces(this.client) - if (this.#legacy) return new LegacyWorkspaces(this.client) - return workspaces - } -} - -const parseOptions = ( - apiKeyOrOptions: string | SeamHttpOptions, -): Required => { - const options = - typeof apiKeyOrOptions === 'string' - ? { apiKey: apiKeyOrOptions } - : apiKeyOrOptions - - const endpoint = - options.endpoint ?? - globalThis.process?.env?.['SEAM_ENDPOINT'] ?? - globalThis.process?.env?.['SEAM_API_URL'] ?? - 'https://connect.getseam.com' - - const apiKey = - 'apiKey' in options - ? options.apiKey - : globalThis.process?.env?.['SEAM_API_KEY'] - - return { - ...options, - ...(apiKey != null ? { apiKey } : {}), - endpoint, - axiosOptions: options.axiosOptions ?? {}, - enableLegacyMethodBehaivor: false, + get workspaces(): WorkspacesHttp { + if (this.#legacy) return new LegacyWorkspacesHttp(this.client) + return new WorkspacesHttp(this.client) } } diff --git a/src/lib/seam/connect/legacy/workspaces.ts b/src/lib/seam/connect/legacy/workspaces.ts index be80de9f..c6909acd 100644 --- a/src/lib/seam/connect/legacy/workspaces.ts +++ b/src/lib/seam/connect/legacy/workspaces.ts @@ -1,9 +1,9 @@ import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' import type { SetNonNullable } from 'type-fest' -import { Workspaces } from 'lib/seam/connect/routes/workspaces.js' +import { WorkspacesHttp } from 'lib/seam/connect/routes/workspaces.js' -export class LegacyWorkspaces extends Workspaces { +export class LegacyWorkspacesHttp extends WorkspacesHttp { override async get( params: WorkspacesGetParams = {}, ): Promise { diff --git a/src/lib/seam/connect/parse-options.ts b/src/lib/seam/connect/parse-options.ts new file mode 100644 index 00000000..47a84472 --- /dev/null +++ b/src/lib/seam/connect/parse-options.ts @@ -0,0 +1,28 @@ +import type { SeamHttpOptions } from './client-options.js' +export const parseOptions = ( + apiKeyOrOptions: string | SeamHttpOptions, +): Required => { + const options = + typeof apiKeyOrOptions === 'string' + ? { apiKey: apiKeyOrOptions } + : apiKeyOrOptions + + const endpoint = + options.endpoint ?? + globalThis.process?.env?.['SEAM_ENDPOINT'] ?? + globalThis.process?.env?.['SEAM_API_URL'] ?? + 'https://connect.getseam.com' + + const apiKey = + 'apiKey' in options + ? options.apiKey + : globalThis.process?.env?.['SEAM_API_KEY'] + + return { + ...options, + ...(apiKey != null ? { apiKey } : {}), + endpoint, + axiosOptions: options.axiosOptions ?? {}, + enableLegacyMethodBehaivor: false, + } +} diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index a8601b40..5e54330e 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -1,12 +1,22 @@ import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' -import type { Axios } from 'axios' +import { Axios } from 'axios' import type { SetNonNullable } from 'type-fest' -export class Workspaces { +import { createAxiosClient } from 'lib/seam/connect/axios.js' +import type { SeamHttpOptions } from 'lib/seam/connect/client-options.js' +import { parseOptions } from 'lib/seam/connect/parse-options.js' + +export class WorkspacesHttp { client: Axios - constructor(client: Axios) { - this.client = client + constructor(apiKeyOrOptionsOrClient: Axios | string | SeamHttpOptions) { + if (apiKeyOrOptionsOrClient instanceof Axios) { + this.client = apiKeyOrOptionsOrClient + return + } + + const options = parseOptions(apiKeyOrOptionsOrClient) + this.client = createAxiosClient(options) } async get(