From b2c2bde720fb638a5184feeea6e7ac4dbb88b011 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 22:37:19 +0000 Subject: [PATCH 1/4] Bump next from 14.2.25 to 14.2.26 in /examples/nextjs-api-sales Bumps [next](https://github.com/vercel/next.js) from 14.2.25 to 14.2.26. - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v14.2.25...v14.2.26) --- updated-dependencies: - dependency-name: next dependency-version: 14.2.26 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- examples/nextjs-api-sales/package.json | 2 +- examples/nextjs-api-sales/yarn.lock | 108 ++++++++++++------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/examples/nextjs-api-sales/package.json b/examples/nextjs-api-sales/package.json index 8ef2294666..fa313c8cd6 100644 --- a/examples/nextjs-api-sales/package.json +++ b/examples/nextjs-api-sales/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "bulma": "^0.9.3", - "next": "14.2.25", + "next": "14.2.26", "node-fetch": "^3.2.10", "sass": "^1.52.3", "react": "17.0.2", diff --git a/examples/nextjs-api-sales/yarn.lock b/examples/nextjs-api-sales/yarn.lock index f5ac1f3b0c..39ccd73d3e 100644 --- a/examples/nextjs-api-sales/yarn.lock +++ b/examples/nextjs-api-sales/yarn.lock @@ -46,10 +46,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@next/env@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.25.tgz#936d10b967e103e49a4bcea1e97292d5605278dd" - integrity sha512-JnzQ2cExDeG7FxJwqAksZ3aqVJrHjFwZQAEJ9gQZSoEhIow7SNoKZzju/AwQ+PLIR4NY8V0rhcVozx/2izDO0w== +"@next/env@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.26.tgz#5d55f72d2edb7246607c78f61e7d3ff21516bc2e" + integrity sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA== "@next/eslint-plugin-next@12.1.0": version "12.1.0" @@ -58,50 +58,50 @@ dependencies: glob "7.1.7" -"@next/swc-darwin-arm64@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.25.tgz#7bcccfda0c0ff045c45fbe34c491b7368e373e3d" - integrity sha512-09clWInF1YRd6le00vt750s3m7SEYNehz9C4PUcSu3bAdCTpjIV4aTYQZ25Ehrr83VR1rZeqtKUPWSI7GfuKZQ== +"@next/swc-darwin-arm64@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.26.tgz#84b31a22149b2c49f5c5b29cddd7acb3a84d7e1c" + integrity sha512-zDJY8gsKEseGAxG+C2hTMT0w9Nk9N1Sk1qV7vXYz9MEiyRoF5ogQX2+vplyUMIfygnjn9/A04I6yrUTRTuRiyQ== -"@next/swc-darwin-x64@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.25.tgz#b489e209d7b405260b73f69a38186ed150fb7a08" - integrity sha512-V+iYM/QR+aYeJl3/FWWU/7Ix4b07ovsQ5IbkwgUK29pTHmq+5UxeDr7/dphvtXEq5pLB/PucfcBNh9KZ8vWbug== +"@next/swc-darwin-x64@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.26.tgz#50a5eb37972d313951f76f36f1f0b7100d063ebd" + integrity sha512-U0adH5ryLfmTDkahLwG9sUQG2L0a9rYux8crQeC92rPhi3jGQEY47nByQHrVrt3prZigadwj/2HZ1LUUimuSbg== -"@next/swc-linux-arm64-gnu@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.25.tgz#ba064fabfdce0190d9859493d8232fffa84ef2e2" - integrity sha512-LFnV2899PJZAIEHQ4IMmZIgL0FBieh5keMnriMY1cK7ompR+JUd24xeTtKkcaw8QmxmEdhoE5Mu9dPSuDBgtTg== +"@next/swc-linux-arm64-gnu@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.26.tgz#c4278c157623b05886e37ff17194811aca1c2d00" + integrity sha512-SINMl1I7UhfHGM7SoRiw0AbwnLEMUnJ/3XXVmhyptzriHbWvPPbbm0OEVG24uUKhuS1t0nvN/DBvm5kz6ZIqpg== -"@next/swc-linux-arm64-musl@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.25.tgz#bf0018267e4e0fbfa1524750321f8cae855144a3" - integrity sha512-QC5y5PPTmtqFExcKWKYgUNkHeHE/z3lUsu83di488nyP0ZzQ3Yse2G6TCxz6nNsQwgAx1BehAJTZez+UQxzLfw== +"@next/swc-linux-arm64-musl@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.26.tgz#5751132764b7a1f13a5a3fe447b03d564eb29705" + integrity sha512-s6JaezoyJK2DxrwHWxLWtJKlqKqTdi/zaYigDXUJ/gmx/72CrzdVZfMvUc6VqnZ7YEvRijvYo+0o4Z9DencduA== -"@next/swc-linux-x64-gnu@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.25.tgz#64f5a6016a7148297ee80542e0fd788418a32472" - integrity sha512-y6/ML4b9eQ2D/56wqatTJN5/JR8/xdObU2Fb1RBidnrr450HLCKr6IJZbPqbv7NXmje61UyxjF5kvSajvjye5w== +"@next/swc-linux-x64-gnu@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.26.tgz#74312cac45704762faa73e0880be6549027303af" + integrity sha512-FEXeUQi8/pLr/XI0hKbe0tgbLmHFRhgXOUiPScz2hk0hSmbGiU8aUqVslj/6C6KA38RzXnWoJXo4FMo6aBxjzg== -"@next/swc-linux-x64-musl@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.25.tgz#58dc636d7c55828478159546f7b95ab1e902301c" - integrity sha512-sPX0TSXHGUOZFvv96GoBXpB3w4emMqKeMgemrSxI7A6l55VBJp/RKYLwZIB9JxSqYPApqiREaIIap+wWq0RU8w== +"@next/swc-linux-x64-musl@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.26.tgz#5d96464d71d2000ec704e650a1a86bb9d73f760d" + integrity sha512-BUsomaO4d2DuXhXhgQCVt2jjX4B4/Thts8nDoIruEJkhE5ifeQFtvW5c9JkdOtYvE5p2G0hcwQ0UbRaQmQwaVg== -"@next/swc-win32-arm64-msvc@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.25.tgz#93562d447c799bded1e89c1a62d5195a2a8c6c0d" - integrity sha512-ReO9S5hkA1DU2cFCsGoOEp7WJkhFzNbU/3VUF6XxNGUCQChyug6hZdYL/istQgfT/GWE6PNIg9cm784OI4ddxQ== +"@next/swc-win32-arm64-msvc@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.26.tgz#859472b532b11499b8f5c2237f54401456286913" + integrity sha512-5auwsMVzT7wbB2CZXQxDctpWbdEnEW/e66DyXO1DcgHxIyhP06awu+rHKshZE+lPLIGiwtjo7bsyeuubewwxMw== -"@next/swc-win32-ia32-msvc@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.25.tgz#ad85a33466be1f41d083211ea21adc0d2c6e6554" - integrity sha512-DZ/gc0o9neuCDyD5IumyTGHVun2dCox5TfPQI/BJTYwpSNYM3CZDI4i6TOdjeq1JMo+Ug4kPSMuZdwsycwFbAw== +"@next/swc-win32-ia32-msvc@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.26.tgz#e52e9bd0c43b7a469b03eda6d7a07c3d0c28f549" + integrity sha512-GQWg/Vbz9zUGi9X80lOeGsz1rMH/MtFO/XqigDznhhhTfDlDoynCM6982mPCbSlxJ/aveZcKtTlwfAjwhyxDpg== -"@next/swc-win32-x64-msvc@14.2.25": - version "14.2.25" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.25.tgz#3969c66609e683ec63a6a9f320a855f7be686a08" - integrity sha512-KSznmS6eFjQ9RJ1nEc66kJvtGIL1iZMYmGEXsZPh2YtnLtqrgdVvKXJY2ScjjoFnG6nGLyPFR0UiEvDwVah4Tw== +"@next/swc-win32-x64-msvc@14.2.26": + version "14.2.26" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.26.tgz#6f42a3ae16ae15c5c5e36efa9b7e291c86ab1275" + integrity sha512-2rdB3T1/Gp7bv1eQTTm9d1Y1sv9UuJ2LAwOE0Pe2prHKe32UNscj7YS13fRB37d0GAiGNR+Y7ZcW8YjDI8Ns0w== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1253,12 +1253,12 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -next@14.2.25: - version "14.2.25" - resolved "https://registry.yarnpkg.com/next/-/next-14.2.25.tgz#0657551fde6a97f697cf9870e9ccbdaa465c6008" - integrity sha512-N5M7xMc4wSb4IkPvEV5X2BRRXUmhVHNyaXwEM86+voXthSZz8ZiRyQW4p9mwAoAPIm6OzuVZtn7idgEJeAJN3Q== +next@14.2.26: + version "14.2.26" + resolved "https://registry.yarnpkg.com/next/-/next-14.2.26.tgz#b918b3fc5c55e1a67aada1347907675713687721" + integrity sha512-b81XSLihMwCfwiUVRRja3LphLo4uBBMZEzBBWMaISbKTwOmq3wPknIETy/8000tr7Gq4WmbuFYPS7jOYIf+ZJw== dependencies: - "@next/env" "14.2.25" + "@next/env" "14.2.26" "@swc/helpers" "0.5.5" busboy "1.6.0" caniuse-lite "^1.0.30001579" @@ -1266,15 +1266,15 @@ next@14.2.25: postcss "8.4.31" styled-jsx "5.1.1" optionalDependencies: - "@next/swc-darwin-arm64" "14.2.25" - "@next/swc-darwin-x64" "14.2.25" - "@next/swc-linux-arm64-gnu" "14.2.25" - "@next/swc-linux-arm64-musl" "14.2.25" - "@next/swc-linux-x64-gnu" "14.2.25" - "@next/swc-linux-x64-musl" "14.2.25" - "@next/swc-win32-arm64-msvc" "14.2.25" - "@next/swc-win32-ia32-msvc" "14.2.25" - "@next/swc-win32-x64-msvc" "14.2.25" + "@next/swc-darwin-arm64" "14.2.26" + "@next/swc-darwin-x64" "14.2.26" + "@next/swc-linux-arm64-gnu" "14.2.26" + "@next/swc-linux-arm64-musl" "14.2.26" + "@next/swc-linux-x64-gnu" "14.2.26" + "@next/swc-linux-x64-musl" "14.2.26" + "@next/swc-win32-arm64-msvc" "14.2.26" + "@next/swc-win32-ia32-msvc" "14.2.26" + "@next/swc-win32-x64-msvc" "14.2.26" node-domexception@^1.0.0: version "1.0.0" From 1b460e2f221a9df63017a76187bf46d96653da69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 14:09:45 +0000 Subject: [PATCH 2/4] Bump vite from 4.5.3 to 4.5.13 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.3 to 4.5.13. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.13/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.13/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 4.5.13 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- yarn.lock | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7d54ebcb0f..0d2990d5b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2788,6 +2788,28 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" +"@budibase/pro@*": + version "3.8.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-3.8.6.tgz#d1317022e5b8ab9cea35f9418aae28e855f5f18b" + integrity sha512-vhfZfwM3ZhfaIjfFWHQCgMLAqhLoXLkuAnsTjoslacjYr6pqcdq4IQM/rR8NYKCPWo0RbtuyG+Wy8bKiLMSLfA== + dependencies: + "@anthropic-ai/sdk" "^0.27.3" + "@budibase/backend-core" "*" + "@budibase/shared-core" "*" + "@budibase/string-templates" "*" + "@budibase/types" "*" + "@koa/router" "13.1.0" + bull "4.10.1" + dd-trace "5.43.0" + joi "17.6.0" + jsonwebtoken "9.0.2" + lru-cache "^7.14.1" + memorystream "^0.3.1" + node-fetch "2.6.7" + openai "4.59.0" + scim-patch "^0.8.1" + scim2-parse-filter "^0.2.8" + "@budibase/vm-browserify@^1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@budibase/vm-browserify/-/vm-browserify-1.1.4.tgz#eecb001bd9521cb7647e26fb4d2d29d0a4dce262" @@ -17834,7 +17856,7 @@ pgpass@1.x: dependencies: split2 "^4.1.0" -picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.1: +picocolors@^1.0.0, picocolors@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== @@ -18080,16 +18102,7 @@ postcss-values-parser@^6.0.2: is-url-superb "^4.0.0" quote-unquote "^1.0.0" -postcss@^8.1.7, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27: - version "8.4.41" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" - integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== - dependencies: - nanoid "^3.3.7" - picocolors "^1.0.1" - source-map-js "^1.2.0" - -postcss@^8.4.38, postcss@^8.4.39, postcss@^8.4.48: +postcss@^8.1.7, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.38, postcss@^8.4.39, postcss@^8.4.48: version "8.4.49" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== @@ -21051,11 +21064,6 @@ timekeeper@2.2.0: resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.2.0.tgz#9645731fce9e3280a18614a57a9d1b72af3ca368" integrity sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A== -timekeeper@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.3.1.tgz#2deb6e0b95d93625fda84c18d47f84a99e4eba01" - integrity sha512-LeQRS7/4JcC0PgdSFnfUiStQEdiuySlCj/5SJ18D+T1n9BoY7PxKFfCwLulpHXoLUFr67HxBddQdEX47lDGx1g== - tiny-glob@^0.2.9: version "0.2.9" resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" @@ -21290,7 +21298,7 @@ tsconfig-paths@^3.10.1, tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tsconfig-paths@^4.1.2, tsconfig-paths@^4.2.0: +tsconfig-paths@^4.1.2: version "4.2.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== @@ -21925,9 +21933,9 @@ vite-plugin-static-copy@^0.17.0: picocolors "^1.0.0" "vite@^3.0.0 || ^4.0.0", vite@^4.5.0: - version "4.5.3" - resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a" - integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg== + version "4.5.13" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.13.tgz#778534a947112c6c455e89737730fae5d458a294" + integrity sha512-Hgp8IF/yZDzKsN1hQWOuQZbrKiaFsbQud+07jJ8h9m9PaHWkpvZ5u55Xw5yYjWRXwRQ4jwFlJvY7T7FUJG9MCA== dependencies: esbuild "^0.18.10" postcss "^8.4.27" From 30547d61005fe1021ee9431f033dc07b3439271f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 22 Apr 2025 16:10:11 +0200 Subject: [PATCH 3/4] Update yarn.lock --- yarn.lock | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/yarn.lock b/yarn.lock index d2c39e1168..3c0d1833a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2788,28 +2788,6 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@*": - version "3.8.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-3.8.6.tgz#d1317022e5b8ab9cea35f9418aae28e855f5f18b" - integrity sha512-vhfZfwM3ZhfaIjfFWHQCgMLAqhLoXLkuAnsTjoslacjYr6pqcdq4IQM/rR8NYKCPWo0RbtuyG+Wy8bKiLMSLfA== - dependencies: - "@anthropic-ai/sdk" "^0.27.3" - "@budibase/backend-core" "*" - "@budibase/shared-core" "*" - "@budibase/string-templates" "*" - "@budibase/types" "*" - "@koa/router" "13.1.0" - bull "4.10.1" - dd-trace "5.43.0" - joi "17.6.0" - jsonwebtoken "9.0.2" - lru-cache "^7.14.1" - memorystream "^0.3.1" - node-fetch "2.6.7" - openai "4.59.0" - scim-patch "^0.8.1" - scim2-parse-filter "^0.2.8" - "@budibase/vm-browserify@^1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@budibase/vm-browserify/-/vm-browserify-1.1.4.tgz#eecb001bd9521cb7647e26fb4d2d29d0a4dce262" @@ -21066,6 +21044,11 @@ timekeeper@2.2.0: resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.2.0.tgz#9645731fce9e3280a18614a57a9d1b72af3ca368" integrity sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A== +timekeeper@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.3.1.tgz#2deb6e0b95d93625fda84c18d47f84a99e4eba01" + integrity sha512-LeQRS7/4JcC0PgdSFnfUiStQEdiuySlCj/5SJ18D+T1n9BoY7PxKFfCwLulpHXoLUFr67HxBddQdEX47lDGx1g== + tiny-glob@^0.2.9: version "0.2.9" resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" @@ -21300,7 +21283,7 @@ tsconfig-paths@^3.10.1, tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tsconfig-paths@^4.1.2: +tsconfig-paths@^4.1.2, tsconfig-paths@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== From 277fee77f168d302aa0d9e4530aaeebe963422c4 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 23 Apr 2025 10:02:59 +0100 Subject: [PATCH 4/4] Prefer get account by tenantId (#15991) * Prefer get account by tenantId * fix * Fix worker unit tests * Fix scim unit test * lint * Rename to remove I prefix --- .../backend-core/src/accounts/accounts.ts | 16 ++++++------- packages/backend-core/src/cache/user.ts | 8 +++---- packages/backend-core/src/users/db.ts | 4 ++-- packages/backend-core/src/users/utils.ts | 2 +- .../core/utilities/structures/accounts.ts | 14 +++++++++++ .../types/src/documents/account/account.ts | 23 +++++++++++++++++++ .../src/api/routes/global/tests/scim.spec.ts | 2 +- .../src/api/routes/global/tests/users.spec.ts | 10 +++++--- 8 files changed, 60 insertions(+), 19 deletions(-) diff --git a/packages/backend-core/src/accounts/accounts.ts b/packages/backend-core/src/accounts/accounts.ts index a16d0f1074..938cfcafc8 100644 --- a/packages/backend-core/src/accounts/accounts.ts +++ b/packages/backend-core/src/accounts/accounts.ts @@ -1,7 +1,11 @@ import API from "./api" import env from "../environment" import { Header } from "../constants" -import { CloudAccount, HealthStatusResponse } from "@budibase/types" +import { + CloudAccount, + HealthStatusResponse, + AccountDetail, +} from "@budibase/types" const api = new API(env.ACCOUNT_PORTAL_URL) @@ -15,15 +19,11 @@ const EXIT_EARLY = env.SELF_HOSTED || env.DISABLE_ACCOUNT_PORTAL export const getAccount = async ( email: string -): Promise => { +): Promise => { if (EXIT_EARLY) { return } - const payload = { - email, - } - const response = await api.post(`/api/accounts/search`, { - body: payload, + const response = await api.get(`/api/v2/admin/account?email=${email}`, { headers: { [Header.API_KEY]: env.ACCOUNT_PORTAL_API_KEY, }, @@ -33,7 +33,7 @@ export const getAccount = async ( throw new Error(`Error getting account by email ${email}`) } - const json: CloudAccount[] = await response.json() + const json: AccountDetail[] = await response.json() return json[0] } diff --git a/packages/backend-core/src/cache/user.ts b/packages/backend-core/src/cache/user.ts index 9de09a431d..a8269002e5 100644 --- a/packages/backend-core/src/cache/user.ts +++ b/packages/backend-core/src/cache/user.ts @@ -6,7 +6,7 @@ import env from "../environment" import * as accounts from "../accounts" import { UserDB } from "../users" import { sdk } from "@budibase/shared-core" -import { User, UserMetadata } from "@budibase/types" +import { CloudAccount, User, UserMetadata } from "@budibase/types" const EXPIRY_SECONDS = 3600 @@ -18,7 +18,7 @@ async function populateFromDB(userId: string, tenantId: string) { const user = await db.get(userId) user.budibaseAccess = true if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { - const account = await accounts.getAccount(user.email) + const account = await accounts.getAccountByTenantId(tenantId) if (account) { user.account = account user.accountPortalAccess = true @@ -39,10 +39,10 @@ async function populateUsersFromDB( const users = getUsersResponse.filter(x => x) await Promise.all( - users.map(async (user: any) => { + users.map(async (user: User & { account?: CloudAccount }) => { user.budibaseAccess = true if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { - const account = await accounts.getAccount(user.email) + const account = await accounts.getAccountByTenantId(user.tenantId) if (account) { user.account = account user.accountPortalAccess = true diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index ac3c9e30ab..5e924937a6 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -529,8 +529,8 @@ export class UserDB { if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { // root account holder can't be deleted from inside budibase - const email = dbUser.email - const account = await accountSdk.getAccount(email) + const tenantId = dbUser.tenantId + const account = await accountSdk.getAccountByTenantId(tenantId) if (account) { if (dbUser.userId === getIdentity()!._id) { throw new HTTPError('Please visit "Account" to delete this user', 400) diff --git a/packages/backend-core/src/users/utils.ts b/packages/backend-core/src/users/utils.ts index c769e47a78..0b043ceeff 100644 --- a/packages/backend-core/src/users/utils.ts +++ b/packages/backend-core/src/users/utils.ts @@ -74,7 +74,7 @@ export async function validateUniqueUser(email: string, tenantId: string) { // check root account users in account portal if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { const account = await accountSdk.getAccount(email) - if (account && account.verified && account.tenantId !== tenantId) { + if (account) { throw new EmailUnavailableError(email) } } diff --git a/packages/backend-core/tests/core/utilities/structures/accounts.ts b/packages/backend-core/tests/core/utilities/structures/accounts.ts index 7910f3c423..101537f06d 100644 --- a/packages/backend-core/tests/core/utilities/structures/accounts.ts +++ b/packages/backend-core/tests/core/utilities/structures/accounts.ts @@ -6,6 +6,7 @@ import { AccountSSOProviderType, AuthType, CloudAccount, + AccountDetail, Hosting, SSOAccount, } from "@budibase/types" @@ -43,6 +44,19 @@ export const cloudAccount = (): CloudAccount => { } } +export const accountDetail = (): AccountDetail => { + const account = cloudAccount() + return { + id: account.accountId, + email: account.email, + name: account.accountName, + displayName: account.name!, + customerId: null, + createdAt: new Date(account.createdAt), + tenants: [], + } +} + function providerType(): AccountSSOProviderType { return sample(Object.values(AccountSSOProviderType)) as AccountSSOProviderType } diff --git a/packages/types/src/documents/account/account.ts b/packages/types/src/documents/account/account.ts index aac5bf2d20..accaa8d4c5 100644 --- a/packages/types/src/documents/account/account.ts +++ b/packages/types/src/documents/account/account.ts @@ -67,6 +67,29 @@ export interface CloudAccount extends Account { budibaseUserId: string } +export interface TenantDetail { + id: string + name: string + hosting: Hosting + installation?: { + id: string + version: string + } + license?: { + key: string + session?: string + } +} +export interface AccountDetail { + id: string + email: string + name: string + displayName: string + customerId: string | null + createdAt: Date + tenants: TenantDetail[] +} + export const isCloudAccount = (account: Account): account is CloudAccount => account.hosting === Hosting.CLOUD diff --git a/packages/worker/src/api/routes/global/tests/scim.spec.ts b/packages/worker/src/api/routes/global/tests/scim.spec.ts index 7f23bc9460..e0cf98a509 100644 --- a/packages/worker/src/api/routes/global/tests/scim.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim.spec.ts @@ -648,7 +648,7 @@ describe("scim", () => { budibaseUserId: user.id, email: user.emails![0].value, } - mocks.accounts.getAccount.mockResolvedValue(account) + mocks.accounts.getAccountByTenantId.mockResolvedValue(account) await deleteScimUser(user.id, { expect: { diff --git a/packages/worker/src/api/routes/global/tests/users.spec.ts b/packages/worker/src/api/routes/global/tests/users.spec.ts index 239877b71a..22af48266f 100644 --- a/packages/worker/src/api/routes/global/tests/users.spec.ts +++ b/packages/worker/src/api/routes/global/tests/users.spec.ts @@ -284,7 +284,7 @@ describe("/api/global/users", () => { it("should not be able to create user with the same email as an account", async () => { const user = structures.users.user() - const account = structures.accounts.cloudAccount() + const account = structures.accounts.accountDetail() accounts.getAccount.mockReturnValueOnce(Promise.resolve(account)) const response = await config.api.users.saveUser(user, 400) @@ -743,7 +743,9 @@ describe("/api/global/users", () => { it("should not be able to destroy account owner", async () => { const user = await config.createUser() const account = structures.accounts.cloudAccount() - accounts.getAccount.mockReturnValueOnce(Promise.resolve(account)) + accounts.getAccountByTenantId.mockReturnValueOnce( + Promise.resolve(account) + ) const response = await config.api.users.deleteUser(user._id!, 400) @@ -754,7 +756,9 @@ describe("/api/global/users", () => { const user = await config.user! const account = structures.accounts.cloudAccount() account.email = user.email - accounts.getAccount.mockReturnValueOnce(Promise.resolve(account)) + accounts.getAccountByTenantId.mockReturnValueOnce( + Promise.resolve(account) + ) const response = await config.api.users.deleteUser(user._id!, 400)