From 6bc88d8c797e758f7e499301b8ea26075d148068 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 8 Oct 2024 11:39:56 +0200 Subject: [PATCH 01/66] yarn add zod --- packages/types/package.json | 3 +- yarn.lock | 281 ++++++++++++++++++++---------------- 2 files changed, 162 insertions(+), 122 deletions(-) diff --git a/packages/types/package.json b/packages/types/package.json index bce25c7086..7e0f98b367 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -22,6 +22,7 @@ "typescript": "5.5.2" }, "dependencies": { - "scim-patch": "^0.8.1" + "scim-patch": "^0.8.1", + "zod": "^3.23.8" } } diff --git a/yarn.lock b/yarn.lock index 1198e98ad6..bc18155a9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -764,20 +764,20 @@ "@azure/abort-controller" "^1.0.0" tslib "^2.2.0" -"@azure/identity@4.2.1", "@azure/identity@^3.4.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.2.1.tgz#22b366201e989b7b41c0e1690e103bd579c31e4c" - integrity sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q== +"@azure/identity@^3.4.1": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-3.4.2.tgz#6b01724c9caac7cadab6b63c76584345bda8e2de" + integrity sha512-0q5DL4uyR0EZ4RXQKD8MadGH6zTIcloUoS/RVbCpNpej4pwte0xpqYxk8K97Py2RiuUvI7F4GXpoT4046VfufA== dependencies: "@azure/abort-controller" "^1.0.0" "@azure/core-auth" "^1.5.0" "@azure/core-client" "^1.4.0" "@azure/core-rest-pipeline" "^1.1.0" "@azure/core-tracing" "^1.0.0" - "@azure/core-util" "^1.3.0" + "@azure/core-util" "^1.6.1" "@azure/logger" "^1.0.0" - "@azure/msal-browser" "^3.11.1" - "@azure/msal-node" "^2.9.2" + "@azure/msal-browser" "^3.5.0" + "@azure/msal-node" "^2.5.1" events "^3.0.0" jws "^4.0.0" open "^8.0.0" @@ -808,10 +808,10 @@ dependencies: tslib "^2.2.0" -"@azure/msal-browser@^3.11.1": - version "3.24.0" - resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-3.24.0.tgz#3208047672d0b0c943b0bef5f995d510d6582ae4" - integrity sha512-JGNV9hTYAa7lsum9IMIibn2kKczAojNihGo1hi7pG0kNrcKej530Fl6jxwM05A44/6I079CSn6WxYxbVhKUmWg== +"@azure/msal-browser@^3.5.0": + version "3.25.0" + resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-3.25.0.tgz#7ce0949977bc9e0c58319f7090c44fe5537104d4" + integrity sha512-a0Y7pmSy8SC1s9bvwr+REvyAA1nQcITlZvkElM2gNUPYFTTNUTEdcpg73TmawNucyMdZ9xb/GFcuhrLOqYAzwg== dependencies: "@azure/msal-common" "14.15.0" @@ -820,10 +820,10 @@ resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-14.15.0.tgz#0e27ac0bb88fe100f4f8d1605b64d5c268636a55" integrity sha512-ImAQHxmpMneJ/4S8BRFhjt1MZ3bppmpRPYYNyzeQPeFN288YKbb8TmmISQEbtfkQ1BPASvYZU5doIZOPBAqENQ== -"@azure/msal-node@^2.9.2": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-2.14.0.tgz#7881895d41b03d8b9b38a29550ba3bbb15f73b3c" - integrity sha512-rrfzIpG3Q1rHjVYZmHAEDidWAZZ2cgkxlIcMQ8dHebRISaZ2KCV33Q8Vs+uaV6lxweROabNxKFlR2lIKagZqYg== +"@azure/msal-node@^2.5.1": + version "2.15.0" + resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-2.15.0.tgz#50bf8e692a6656027c073a75d877a8a478aafdfd" + integrity sha512-gVPW8YLz92ZeCibQH2QUw96odJoiM3k/ZPH3f2HxptozmH6+OnyyvKXo/Egg39HAM230akarQKHf0W74UHlh0Q== dependencies: "@azure/msal-common" "14.15.0" jsonwebtoken "^9.0.0" @@ -2051,44 +2051,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.32.11": - version "0.0.0" - dependencies: - "@budibase/nano" "10.1.5" - "@budibase/pouchdb-replication-stream" "1.2.11" - "@budibase/shared-core" "0.0.0" - "@budibase/types" "0.0.0" - aws-cloudfront-sign "3.0.2" - aws-sdk "2.1030.0" - bcrypt "5.1.0" - bcryptjs "2.4.3" - bull "4.10.1" - correlation-id "4.0.0" - dd-trace "5.2.0" - dotenv "16.0.1" - ioredis "5.3.2" - joi "17.6.0" - jsonwebtoken "9.0.2" - knex "2.4.2" - koa-passport "^6.0.0" - koa-pino-logger "4.0.0" - lodash "4.17.21" - node-fetch "2.6.7" - passport-google-oauth "2.0.0" - passport-local "1.0.0" - passport-oauth2-refresh "^2.1.0" - pino "8.11.0" - pino-http "8.3.3" - posthog-node "4.0.1" - pouchdb "7.3.0" - pouchdb-find "7.2.2" - redlock "4.2.0" - rotating-file-stream "3.1.0" - sanitize-s3-objectkey "0.0.1" - semver "^7.5.4" - tar-fs "2.1.1" - uuid "^8.3.2" - "@budibase/handlebars-helpers@^0.13.2": version "0.13.2" resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.13.2.tgz#73ab51c464e91fd955b429017648e0257060db77" @@ -2131,47 +2093,6 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@npm:@budibase/pro@latest": - version "2.32.11" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.32.11.tgz#c94d534f829ca0ef252677757e157a7e58b87b4d" - integrity sha512-mOkqJpqHKWsfTWZwWcvBCYFUIluSUHltQNinc1ZRsg9rC3OKoHSDop6gzm744++H/GzGRN8V86kLhCgtNIlkpA== - dependencies: - "@anthropic-ai/sdk" "^0.27.3" - "@budibase/backend-core" "2.32.11" - "@budibase/shared-core" "2.32.11" - "@budibase/string-templates" "2.32.11" - "@budibase/types" "2.32.11" - "@koa/router" "8.0.8" - bull "4.10.1" - dd-trace "5.2.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/shared-core@2.32.11": - version "0.0.0" - dependencies: - "@budibase/types" "0.0.0" - cron-validate "1.4.5" - -"@budibase/string-templates@2.32.11": - version "0.0.0" - dependencies: - "@budibase/handlebars-helpers" "^0.13.2" - dayjs "^1.10.8" - handlebars "^4.7.8" - lodash.clonedeep "^4.5.0" - -"@budibase/types@2.32.11": - version "0.0.0" - dependencies: - scim-patch "^0.8.1" - "@bull-board/api@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-5.10.2.tgz#ae8ff6918b23897bf879a6ead3683f964374c4b3" @@ -7326,7 +7247,23 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@1.1.3, axios@1.6.3, axios@^0.21.1, axios@^1.0.0, axios@^1.1.3, axios@^1.4.0, axios@^1.5.0, axios@^1.6.2: +axios@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" + integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +axios@^1.0.0, axios@^1.1.3, axios@^1.4.0, axios@^1.5.0, axios@^1.6.2: version "1.6.3" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4" integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww== @@ -11126,7 +11063,14 @@ fast-url-parser@^1.1.3: dependencies: punycode "^1.3.2" -fast-xml-parser@4.2.5, fast-xml-parser@4.4.1, fast-xml-parser@^4.1.3, fast-xml-parser@^4.2.2, fast-xml-parser@^4.2.5: +fast-xml-parser@4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz#a6747a09296a6cb34f2ae634019bf1738f3b421f" + integrity sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g== + dependencies: + strnum "^1.0.5" + +fast-xml-parser@^4.1.3, fast-xml-parser@^4.2.2, fast-xml-parser@^4.2.5: version "4.4.1" resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz#86dbf3f18edf8739326447bcaac31b4ae7f6514f" integrity sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw== @@ -11375,6 +11319,11 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== +follow-redirects@^1.14.0: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + follow-redirects@^1.15.0: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" @@ -12457,7 +12406,12 @@ http-assert@^1.3.0: deep-equal "~1.0.1" http-errors "~1.8.0" -http-cache-semantics@3.8.1, http-cache-semantics@4.1.1, http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== + +http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== @@ -12977,6 +12931,11 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + is-builtin-module@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" @@ -13453,11 +13412,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -isobject@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" - integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== - isolated-vm@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/isolated-vm/-/isolated-vm-4.7.2.tgz#5670d5cce1d92004f9b825bec5b0b11fc7501b65" @@ -14362,7 +14316,14 @@ kill-port@^1.6.1: get-them-args "1.3.2" shell-exec "1.0.2" -kind-of@6.0.3, kind-of@^3.0.2, kind-of@^3.1.0, kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^3.0.2, kind-of@^3.1.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== + dependencies: + is-buffer "^1.1.5" + +kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -15982,7 +15943,7 @@ msgpackr-extract@^3.0.2: "@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.2" "@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.2" -msgpackr@1.10.1, msgpackr@^1.5.2: +msgpackr@^1.5.2: version "1.10.1" resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.10.1.tgz#51953bb4ce4f3494f0c4af3f484f01cfbb306555" integrity sha512-r5VRLv9qouXuLiIBrLpl2d5ZvPt8svdQTl5/vMvE4nzDMyEX4sgW5yWhuBBj5UmgwOTWj8CIdSXn5sAfsHAWIQ== @@ -16176,13 +16137,25 @@ node-domexception@1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@2.6.0, node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9, node-fetch@^2.7.0: +node-fetch@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + +node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" +node-fetch@^2.6.9, node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + node-forge@^1.2.1, node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -17318,7 +17291,15 @@ passport-strategy@1.x.x, passport-strategy@^1.0.0: resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4" integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA== -passport@0.6.0, passport@^0.4.0, passport@^0.6.0: +passport@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/passport/-/passport-0.4.1.tgz#941446a21cb92fc688d97a0861c38ce9f738f270" + integrity sha512-IxXgZZs8d7uFSt3eqNjM9NQ3g3uQCW5avD8mRNoXV99Yig50vjuaez6dQK2qC0kVWPRTujxY0dWgGfT09adjYg== + dependencies: + passport-strategy "1.x.x" + pause "0.0.1" + +passport@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/passport/-/passport-0.6.0.tgz#e869579fab465b5c0b291e841e6cc95c005fac9d" integrity sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug== @@ -18578,7 +18559,7 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== -psl@^1.1.33: +psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== @@ -19613,6 +19594,11 @@ sax@1.2.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== +sax@>=0.1.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" + integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== + sax@>=0.6.0: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -19685,13 +19671,33 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@7.5.3, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3, semver@~2.3.1: +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@7.5.3, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3: version "7.5.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +semver@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52" + integrity sha512-abLdIKCosKfpnmhS52NCTjO4RiLspDfsn37prjzGrp9im5DPJOgh82Os92vtwGh6XdQryKI/7SREZnV+aqiXrA== + seq-queue@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e" @@ -21270,7 +21276,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@4.1.3, "tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2, tough-cookie@~2.5.0: +"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== @@ -21280,6 +21286,14 @@ tough-cookie@4.1.3, "tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0 universalify "^0.2.0" url-parse "^1.5.3" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" @@ -21795,14 +21809,6 @@ unpipe@1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -unset-value@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-2.0.1.tgz#57bed0c22d26f28d69acde5df9a11b77c74d2df3" - integrity sha512-2hvrBfjUE00PkqN+q0XP6yRAOGrR06uSiUoIQGZkc7GxvQ9H7v8quUPNtZjMg4uux69i8HWpIjLPUKwCuRGyNg== - dependencies: - has-value "^2.0.2" - isobject "^4.0.0" - untildify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" @@ -22586,10 +22592,33 @@ xml-parse-from-string@^1.0.0: resolved "https://registry.yarnpkg.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" integrity sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g== -xml2js@0.1.x, xml2js@0.4.19, xml2js@0.5.0, xml2js@0.6.2, xml2js@^0.4.19, xml2js@^0.4.5: - version "0.6.2" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" - integrity sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA== +xml2js@0.1.x: + version "0.1.14" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.1.14.tgz#5274e67f5a64c5f92974cd85139e0332adc6b90c" + integrity sha512-pbdws4PPPNc1HPluSUKamY4GWMk592K7qwcj6BExbVOhhubub8+pMda/ql68b6L3luZs/OGjGSB5goV7SnmgnA== + dependencies: + sax ">=0.1.1" + +xml2js@0.4.19: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xml2js@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.5.0.tgz#d9440631fbb2ed800203fad106f2724f62c493b7" + integrity sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA== + dependencies: + sax ">=0.6.0" + xmlbuilder "~11.0.0" + +xml2js@^0.4.19, xml2js@^0.4.5: + version "0.4.23" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" + integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== dependencies: sax ">=0.6.0" xmlbuilder "~11.0.0" @@ -22599,6 +22628,11 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ== + xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" @@ -22846,3 +22880,8 @@ zip-stream@^6.0.1: archiver-utils "^5.0.0" compress-commons "^6.0.2" readable-stream "^4.0.0" + +zod@^3.23.8: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== From 5a8aba7f523f8c6a2a877121128257285992bbad Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 8 Oct 2024 11:41:04 +0200 Subject: [PATCH 02/66] zod validator --- .../server/src/middleware/zod-validator.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/server/src/middleware/zod-validator.ts diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts new file mode 100644 index 0000000000..6fb338e5e8 --- /dev/null +++ b/packages/server/src/middleware/zod-validator.ts @@ -0,0 +1,33 @@ +import { AnyZodObject } from "zod" +import { Ctx } from "@budibase/types" + +function validate(schema: AnyZodObject, property: "body" | "params") { + // Return a Koa middleware function + return (ctx: Ctx, next: any) => { + if (!schema) { + return next() + } + let params = null + if (ctx[property] != null) { + params = ctx[property] + } else if (property === "body" && ctx.request[property] != null) { + params = ctx.request[property] + } else if (ctx.request.get(property) != null) { + params = ctx.request.get(property) + } + + const { error } = schema.safeParse(params) + if (error) { + ctx.throw(400, `Invalid ${property} - ${error.message}`) + } + return next() + } +} + +export function validateBody(schema: AnyZodObject) { + return validate(schema, "body") +} + +// export function validateParams(schema: Joi.Schema) { +// return validate(schema, "params") +// } From 36410aac0bff05ff4f507613c1003c9268e3a036 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 4 Oct 2024 11:45:18 +0200 Subject: [PATCH 03/66] Display readable errors --- packages/server/package.json | 6 +- .../server/src/middleware/zod-validator.ts | 6 +- yarn.lock | 270 ++++++++---------- 3 files changed, 129 insertions(+), 153 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 76dd03b5a8..15e78fe7a8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -119,7 +119,8 @@ "uuid": "^8.3.2", "validate.js": "0.13.1", "worker-farm": "1.7.0", - "xml2js": "0.5.0" + "xml2js": "0.5.0", + "zod-validation-error": "^3.4.0" }, "devDependencies": { "@babel/preset-env": "7.16.11", @@ -158,7 +159,8 @@ "tsconfig-paths": "4.0.0", "typescript": "5.5.2", "update-dotenv": "1.1.1", - "yargs": "13.2.4" + "yargs": "13.2.4", + "zod": "^3.23.8" }, "nx": { "targets": { diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts index 6fb338e5e8..7b51d908c1 100644 --- a/packages/server/src/middleware/zod-validator.ts +++ b/packages/server/src/middleware/zod-validator.ts @@ -1,6 +1,8 @@ -import { AnyZodObject } from "zod" import { Ctx } from "@budibase/types" +import { AnyZodObject } from "zod" +import { fromZodError } from "zod-validation-error" + function validate(schema: AnyZodObject, property: "body" | "params") { // Return a Koa middleware function return (ctx: Ctx, next: any) => { @@ -18,7 +20,7 @@ function validate(schema: AnyZodObject, property: "body" | "params") { const { error } = schema.safeParse(params) if (error) { - ctx.throw(400, `Invalid ${property} - ${error.message}`) + ctx.throw(400, fromZodError(error)) } return next() } diff --git a/yarn.lock b/yarn.lock index bc18155a9d..9b258a2ba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -764,20 +764,20 @@ "@azure/abort-controller" "^1.0.0" tslib "^2.2.0" -"@azure/identity@^3.4.1": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-3.4.2.tgz#6b01724c9caac7cadab6b63c76584345bda8e2de" - integrity sha512-0q5DL4uyR0EZ4RXQKD8MadGH6zTIcloUoS/RVbCpNpej4pwte0xpqYxk8K97Py2RiuUvI7F4GXpoT4046VfufA== +"@azure/identity@4.2.1", "@azure/identity@^3.4.1": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.2.1.tgz#22b366201e989b7b41c0e1690e103bd579c31e4c" + integrity sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q== dependencies: "@azure/abort-controller" "^1.0.0" "@azure/core-auth" "^1.5.0" "@azure/core-client" "^1.4.0" "@azure/core-rest-pipeline" "^1.1.0" "@azure/core-tracing" "^1.0.0" - "@azure/core-util" "^1.6.1" + "@azure/core-util" "^1.3.0" "@azure/logger" "^1.0.0" - "@azure/msal-browser" "^3.5.0" - "@azure/msal-node" "^2.5.1" + "@azure/msal-browser" "^3.11.1" + "@azure/msal-node" "^2.9.2" events "^3.0.0" jws "^4.0.0" open "^8.0.0" @@ -808,7 +808,7 @@ dependencies: tslib "^2.2.0" -"@azure/msal-browser@^3.5.0": +"@azure/msal-browser@^3.11.1": version "3.25.0" resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-3.25.0.tgz#7ce0949977bc9e0c58319f7090c44fe5537104d4" integrity sha512-a0Y7pmSy8SC1s9bvwr+REvyAA1nQcITlZvkElM2gNUPYFTTNUTEdcpg73TmawNucyMdZ9xb/GFcuhrLOqYAzwg== @@ -820,7 +820,7 @@ resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-14.15.0.tgz#0e27ac0bb88fe100f4f8d1605b64d5c268636a55" integrity sha512-ImAQHxmpMneJ/4S8BRFhjt1MZ3bppmpRPYYNyzeQPeFN288YKbb8TmmISQEbtfkQ1BPASvYZU5doIZOPBAqENQ== -"@azure/msal-node@^2.5.1": +"@azure/msal-node@^2.9.2": version "2.15.0" resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-2.15.0.tgz#50bf8e692a6656027c073a75d877a8a478aafdfd" integrity sha512-gVPW8YLz92ZeCibQH2QUw96odJoiM3k/ZPH3f2HxptozmH6+OnyyvKXo/Egg39HAM230akarQKHf0W74UHlh0Q== @@ -2051,6 +2051,44 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@budibase/backend-core@2.32.12": + version "0.0.0" + dependencies: + "@budibase/nano" "10.1.5" + "@budibase/pouchdb-replication-stream" "1.2.11" + "@budibase/shared-core" "0.0.0" + "@budibase/types" "0.0.0" + aws-cloudfront-sign "3.0.2" + aws-sdk "2.1030.0" + bcrypt "5.1.0" + bcryptjs "2.4.3" + bull "4.10.1" + correlation-id "4.0.0" + dd-trace "5.2.0" + dotenv "16.0.1" + ioredis "5.3.2" + joi "17.6.0" + jsonwebtoken "9.0.2" + knex "2.4.2" + koa-passport "^6.0.0" + koa-pino-logger "4.0.0" + lodash "4.17.21" + node-fetch "2.6.7" + passport-google-oauth "2.0.0" + passport-local "1.0.0" + passport-oauth2-refresh "^2.1.0" + pino "8.11.0" + pino-http "8.3.3" + posthog-node "4.0.1" + pouchdb "7.3.0" + pouchdb-find "7.2.2" + redlock "4.2.0" + rotating-file-stream "3.1.0" + sanitize-s3-objectkey "0.0.1" + semver "^7.5.4" + tar-fs "2.1.1" + uuid "^8.3.2" + "@budibase/handlebars-helpers@^0.13.2": version "0.13.2" resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.13.2.tgz#73ab51c464e91fd955b429017648e0257060db77" @@ -2093,6 +2131,48 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" +"@budibase/pro@npm:@budibase/pro@latest": + version "2.32.12" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.32.12.tgz#a5a975ad223e40eb186576f9982e9bef583da906" + integrity sha512-18BeOwMKAkjrgIeyvXTnUc07pcFKdEg0aYqoOxkGsz182YUEk1r+unalvSSBW8hsKObZw1pkcx45dAFfI14wLA== + dependencies: + "@anthropic-ai/sdk" "^0.27.3" + "@budibase/backend-core" "2.32.12" + "@budibase/shared-core" "2.32.12" + "@budibase/string-templates" "2.32.12" + "@budibase/types" "2.32.12" + "@koa/router" "8.0.8" + bull "4.10.1" + dd-trace "5.2.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/shared-core@2.32.12": + version "0.0.0" + dependencies: + "@budibase/types" "0.0.0" + cron-validate "1.4.5" + +"@budibase/string-templates@2.32.12": + version "0.0.0" + dependencies: + "@budibase/handlebars-helpers" "^0.13.2" + dayjs "^1.10.8" + handlebars "^4.7.8" + lodash.clonedeep "^4.5.0" + +"@budibase/types@2.32.12": + version "0.0.0" + dependencies: + scim-patch "^0.8.1" + zod "^3.23.8" + "@bull-board/api@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-5.10.2.tgz#ae8ff6918b23897bf879a6ead3683f964374c4b3" @@ -7247,23 +7327,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" - integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^0.21.1: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - -axios@^1.0.0, axios@^1.1.3, axios@^1.4.0, axios@^1.5.0, axios@^1.6.2: +axios@1.1.3, axios@1.6.3, axios@^0.21.1, axios@^1.0.0, axios@^1.1.3, axios@^1.4.0, axios@^1.5.0, axios@^1.6.2: version "1.6.3" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4" integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww== @@ -11063,14 +11127,7 @@ fast-url-parser@^1.1.3: dependencies: punycode "^1.3.2" -fast-xml-parser@4.2.5: - version "4.2.5" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz#a6747a09296a6cb34f2ae634019bf1738f3b421f" - integrity sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g== - dependencies: - strnum "^1.0.5" - -fast-xml-parser@^4.1.3, fast-xml-parser@^4.2.2, fast-xml-parser@^4.2.5: +fast-xml-parser@4.2.5, fast-xml-parser@4.4.1, fast-xml-parser@^4.1.3, fast-xml-parser@^4.2.2, fast-xml-parser@^4.2.5: version "4.4.1" resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz#86dbf3f18edf8739326447bcaac31b4ae7f6514f" integrity sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw== @@ -11319,11 +11376,6 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.14.0: - version "1.15.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" - integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== - follow-redirects@^1.15.0: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" @@ -12406,12 +12458,7 @@ http-assert@^1.3.0: deep-equal "~1.0.1" http-errors "~1.8.0" -http-cache-semantics@3.8.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" - integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== - -http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: +http-cache-semantics@3.8.1, http-cache-semantics@4.1.1, http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== @@ -12931,11 +12978,6 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - is-builtin-module@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" @@ -13412,6 +13454,11 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== +isobject@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" + integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== + isolated-vm@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/isolated-vm/-/isolated-vm-4.7.2.tgz#5670d5cce1d92004f9b825bec5b0b11fc7501b65" @@ -14316,14 +14363,7 @@ kill-port@^1.6.1: get-them-args "1.3.2" shell-exec "1.0.2" -kind-of@^3.0.2, kind-of@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@6.0.3, kind-of@^3.0.2, kind-of@^3.1.0, kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -15943,7 +15983,7 @@ msgpackr-extract@^3.0.2: "@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.2" "@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.2" -msgpackr@^1.5.2: +msgpackr@1.10.1, msgpackr@^1.5.2: version "1.10.1" resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.10.1.tgz#51953bb4ce4f3494f0c4af3f484f01cfbb306555" integrity sha512-r5VRLv9qouXuLiIBrLpl2d5ZvPt8svdQTl5/vMvE4nzDMyEX4sgW5yWhuBBj5UmgwOTWj8CIdSXn5sAfsHAWIQ== @@ -16137,25 +16177,13 @@ node-domexception@1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== - -node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@2.6.0, node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9, node-fetch@^2.7.0: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.9, node-fetch@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1.2.1, node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -17291,15 +17319,7 @@ passport-strategy@1.x.x, passport-strategy@^1.0.0: resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4" integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA== -passport@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/passport/-/passport-0.4.1.tgz#941446a21cb92fc688d97a0861c38ce9f738f270" - integrity sha512-IxXgZZs8d7uFSt3eqNjM9NQ3g3uQCW5avD8mRNoXV99Yig50vjuaez6dQK2qC0kVWPRTujxY0dWgGfT09adjYg== - dependencies: - passport-strategy "1.x.x" - pause "0.0.1" - -passport@^0.6.0: +passport@0.6.0, passport@^0.4.0, passport@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/passport/-/passport-0.6.0.tgz#e869579fab465b5c0b291e841e6cc95c005fac9d" integrity sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug== @@ -18559,7 +18579,7 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== -psl@^1.1.28, psl@^1.1.33: +psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== @@ -19594,11 +19614,6 @@ sax@1.2.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== -sax@>=0.1.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" - integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== - sax@>=0.6.0: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -19671,33 +19686,13 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@7.5.3, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3: +"semver@2 || 3 || 4 || 5", semver@7.5.3, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3, semver@~2.3.1: version "7.5.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - -semver@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52" - integrity sha512-abLdIKCosKfpnmhS52NCTjO4RiLspDfsn37prjzGrp9im5DPJOgh82Os92vtwGh6XdQryKI/7SREZnV+aqiXrA== - seq-queue@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e" @@ -21276,7 +21271,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2: +tough-cookie@4.1.3, "tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2, tough-cookie@~2.5.0: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== @@ -21286,14 +21281,6 @@ touch@^3.1.0: universalify "^0.2.0" url-parse "^1.5.3" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" @@ -21809,6 +21796,14 @@ unpipe@1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +unset-value@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-2.0.1.tgz#57bed0c22d26f28d69acde5df9a11b77c74d2df3" + integrity sha512-2hvrBfjUE00PkqN+q0XP6yRAOGrR06uSiUoIQGZkc7GxvQ9H7v8quUPNtZjMg4uux69i8HWpIjLPUKwCuRGyNg== + dependencies: + has-value "^2.0.2" + isobject "^4.0.0" + untildify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" @@ -22592,33 +22587,10 @@ xml-parse-from-string@^1.0.0: resolved "https://registry.yarnpkg.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" integrity sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g== -xml2js@0.1.x: - version "0.1.14" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.1.14.tgz#5274e67f5a64c5f92974cd85139e0332adc6b90c" - integrity sha512-pbdws4PPPNc1HPluSUKamY4GWMk592K7qwcj6BExbVOhhubub8+pMda/ql68b6L3luZs/OGjGSB5goV7SnmgnA== - dependencies: - sax ">=0.1.1" - -xml2js@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xml2js@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.5.0.tgz#d9440631fbb2ed800203fad106f2724f62c493b7" - integrity sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xml2js@^0.4.19, xml2js@^0.4.5: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== +xml2js@0.1.x, xml2js@0.4.19, xml2js@0.5.0, xml2js@0.6.2, xml2js@^0.4.19, xml2js@^0.4.5: + version "0.6.2" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" + integrity sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA== dependencies: sax ">=0.6.0" xmlbuilder "~11.0.0" @@ -22628,11 +22600,6 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ== - xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" @@ -22881,6 +22848,11 @@ zip-stream@^6.0.1: compress-commons "^6.0.2" readable-stream "^4.0.0" +zod-validation-error@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-3.4.0.tgz#3a8a1f55c65579822d7faa190b51336c61bee2a6" + integrity sha512-ZOPR9SVY6Pb2qqO5XHt+MkkTRxGXb4EVtnjc9JpXUOtUB1T9Ru7mZOT361AN3MsetVe7R0a1KZshJDZdgp9miQ== + zod@^3.23.8: version "3.23.8" resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" From eea9eade5c0eedfeb578a9b688a3654ec93e7280 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 8 Oct 2024 12:40:09 +0200 Subject: [PATCH 04/66] Start types --- .../server/src/api/controllers/row/index.ts | 9 ++++--- packages/types/src/api/web/app/rows.ts | 27 +++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 680a7671d5..769a1dbe5e 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -17,6 +17,7 @@ import { GetRowResponse, PatchRowRequest, PatchRowResponse, + RequiredKeys, Row, RowAttachment, RowSearchParams, @@ -211,15 +212,17 @@ export async function search(ctx: Ctx) { await context.ensureSnippetContext(true) + const searchRequest = ctx.request.body + const enrichedQuery = await utils.enrichSearchContext( - { ...ctx.request.body.query }, + { ...searchRequest.query }, { user: sdk.users.getUserContextBindings(ctx.user), } ) - const searchParams: RowSearchParams = { - ...ctx.request.body, + const searchParams: RequiredKeys = { + ...searchRequest, query: enrichedQuery, tableId, viewId, diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index ce6f6f672d..166c6965c4 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -1,7 +1,8 @@ import { SearchFilters, RowSearchParams } from "../../../sdk" import { Row } from "../../../documents" -import { PaginationResponse, SortOrder } from "../../../api" +import { PaginationResponse, SortOrder, SortType } from "../../../api" import { ReadStream } from "fs" +import { z } from "zod" export interface SaveRowRequest extends Row {} @@ -13,7 +14,29 @@ export interface PatchRowRequest extends Row { export interface PatchRowResponse extends Row {} -export interface SearchRowRequest extends Omit {} +const searchRowRequest = z.object({ + table: z.string(), + query: z.object({ + allOr: z.boolean().optional(), + }), + paginate: z.boolean().optional(), + bookmark: z.union([z.string(), z.number()]).optional(), + limit: z.number().optional(), + sort: z.string().optional(), + sortOrder: z.nativeEnum(SortOrder).optional(), + sortType: z.nativeEnum(SortType).optional(), + version: z.string().optional(), + disableEscaping: z.boolean().optional(), + countRows: z.boolean().optional(), + + // viewId?: string + // query?: SearchFilters + + // fields?: string[] + // indexer?: () => Promise + // rows?: Row[] +}) +export type SearchRowRequest = z.infer export interface SearchViewRowRequest extends Pick< From d1a69a66607e43ca7ec80c308f474deef65de8d8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 11:40:29 +0200 Subject: [PATCH 05/66] Use validation --- packages/server/src/api/routes/row.ts | 3 +++ packages/server/src/middleware/zod-validator.ts | 2 +- packages/types/src/api/web/app/rows.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/routes/row.ts b/packages/server/src/api/routes/row.ts index e443b2daeb..fc09b8c81d 100644 --- a/packages/server/src/api/routes/row.ts +++ b/packages/server/src/api/routes/row.ts @@ -5,6 +5,8 @@ import { paramResource, paramSubResource } from "../../middleware/resourceId" import { permissions } from "@budibase/backend-core" import { internalSearchValidator } from "./utils/validators" import trimViewRowInfo from "../../middleware/trimViewRowInfo" +import { validateBody } from "../../middleware/zod-validator" +import { searchRowRequestValidator } from "@budibase/types" const { PermissionType, PermissionLevel } = permissions @@ -32,6 +34,7 @@ router .post( "/api/:sourceId/search", internalSearchValidator(), + validateBody(searchRowRequestValidator), paramResource("sourceId"), authorized(PermissionType.TABLE, PermissionLevel.READ), rowController.search diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts index 7b51d908c1..6611efbeb1 100644 --- a/packages/server/src/middleware/zod-validator.ts +++ b/packages/server/src/middleware/zod-validator.ts @@ -30,6 +30,6 @@ export function validateBody(schema: AnyZodObject) { return validate(schema, "body") } -// export function validateParams(schema: Joi.Schema) { +// export function validateParams(schema: AnyZodObject) { // return validate(schema, "params") // } diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 166c6965c4..e696430eb4 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -15,7 +15,6 @@ export interface PatchRowRequest extends Row { export interface PatchRowResponse extends Row {} const searchRowRequest = z.object({ - table: z.string(), query: z.object({ allOr: z.boolean().optional(), }), @@ -36,6 +35,7 @@ const searchRowRequest = z.object({ // indexer?: () => Promise // rows?: Row[] }) +export const searchRowRequestValidator = searchRowRequest export type SearchRowRequest = z.infer export interface SearchViewRowRequest From 76f155f31124656a9bba6c41c2fb995ed526655c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 12:31:10 +0200 Subject: [PATCH 06/66] Fix jest import issues --- packages/types/src/api/web/app/rows.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index e696430eb4..3aee8e754e 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -1,6 +1,10 @@ -import { SearchFilters, RowSearchParams } from "../../../sdk" +import { SearchFilters } from "../../../sdk" import { Row } from "../../../documents" -import { PaginationResponse, SortOrder, SortType } from "../../../api" +import { + PaginationResponse, + SortOrder, + SortType, +} from "../../../api/web/pagination" import { ReadStream } from "fs" import { z } from "zod" From b6731494e7138189d5dc36f3c2feeeccf033e303 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 12:39:14 +0200 Subject: [PATCH 07/66] Trim object --- packages/server/src/middleware/zod-validator.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts index 6611efbeb1..f990ee0642 100644 --- a/packages/server/src/middleware/zod-validator.ts +++ b/packages/server/src/middleware/zod-validator.ts @@ -10,18 +10,25 @@ function validate(schema: AnyZodObject, property: "body" | "params") { return next() } let params = null + let setClean: ((data: any) => void) | undefined if (ctx[property] != null) { params = ctx[property] + setClean = data => (ctx[property] = data) } else if (property === "body" && ctx.request[property] != null) { params = ctx.request[property] - } else if (ctx.request.get(property) != null) { - params = ctx.request.get(property) + setClean = data => (ctx.request[property] = data) + } else if (property === "params") { + params = ctx.request.query + setClean = data => (ctx.request.query = data) } - const { error } = schema.safeParse(params) - if (error) { - ctx.throw(400, fromZodError(error)) + const result = schema.safeParse(params) + if (!result.success) { + ctx.throw(400, fromZodError(result.error)) + } else { + setClean?.(result.data) } + return next() } } From 7b789e785369ff3ed121b677fb3340a75ba798f0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 13:11:32 +0200 Subject: [PATCH 08/66] Type query --- packages/types/src/api/web/app/rows.ts | 43 +++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 3aee8e754e..45e065cc59 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -1,4 +1,11 @@ -import { SearchFilters } from "../../../sdk" +import { + ArrayOperator, + BasicOperator, + LogicalOperator, + RangeOperator, + SearchFilterKey, + SearchFilters, +} from "../../../sdk" import { Row } from "../../../documents" import { PaginationResponse, @@ -18,9 +25,43 @@ export interface PatchRowRequest extends Row { export interface PatchRowResponse extends Row {} +// TODO: exclude InternalSearchFilterOperator.COMPLEX_ID_OPERATOR +const stringBasicFilter = z.record(z.string(), z.string()) +const basicFilter = z.record(z.string(), z.any()) +const arrayFilter = z.any() +const logicFilter = z.any() + +const stringOrNumber = z.union([z.string(), z.number()]) + +const queryFilterValidation: Record = { + [BasicOperator.STRING]: stringBasicFilter.optional(), + [BasicOperator.FUZZY]: stringBasicFilter.optional(), + [RangeOperator.RANGE]: z + .record( + z.string(), + z.union([ + z.object({ high: stringOrNumber, low: stringOrNumber }), + z.object({ high: stringOrNumber }), + z.object({ low: stringOrNumber }), + ]) + ) + .optional(), + [BasicOperator.EQUAL]: basicFilter.optional(), + [BasicOperator.NOT_EQUAL]: basicFilter.optional(), + [BasicOperator.EMPTY]: basicFilter.optional(), + [BasicOperator.NOT_EMPTY]: basicFilter.optional(), + [ArrayOperator.ONE_OF]: arrayFilter.optional(), + [ArrayOperator.CONTAINS]: arrayFilter.optional(), + [ArrayOperator.NOT_CONTAINS]: arrayFilter.optional(), + [ArrayOperator.CONTAINS_ANY]: arrayFilter.optional(), + [LogicalOperator.AND]: logicFilter.optional(), + [LogicalOperator.OR]: logicFilter.optional(), +} + const searchRowRequest = z.object({ query: z.object({ allOr: z.boolean().optional(), + ...queryFilterValidation, }), paginate: z.boolean().optional(), bookmark: z.union([z.string(), z.number()]).optional(), From 4324d9683306eb1667c0948313f39d8c5d83118d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 13:20:20 +0200 Subject: [PATCH 09/66] Add onEmptyFilter --- packages/types/src/api/web/app/rows.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 45e065cc59..4652ea7df5 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -1,6 +1,7 @@ import { ArrayOperator, BasicOperator, + EmptyFilterOption, LogicalOperator, RangeOperator, SearchFilterKey, @@ -59,10 +60,13 @@ const queryFilterValidation: Record = { } const searchRowRequest = z.object({ - query: z.object({ - allOr: z.boolean().optional(), - ...queryFilterValidation, - }), + query: z + .object({ + allOr: z.boolean().optional(), + onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(), + ...queryFilterValidation, + }) + .optional(), paginate: z.boolean().optional(), bookmark: z.union([z.string(), z.number()]).optional(), limit: z.number().optional(), From e6b3b4f2a1ef732460b850dd3f5afdcb22a88e6d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 13:33:27 +0200 Subject: [PATCH 10/66] Type array filter --- packages/types/src/api/web/app/rows.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 4652ea7df5..6cc5e575a6 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -29,7 +29,7 @@ export interface PatchRowResponse extends Row {} // TODO: exclude InternalSearchFilterOperator.COMPLEX_ID_OPERATOR const stringBasicFilter = z.record(z.string(), z.string()) const basicFilter = z.record(z.string(), z.any()) -const arrayFilter = z.any() +const arrayFilter = z.record(z.string(), z.union([z.any().array(), z.string()])) const logicFilter = z.any() const stringOrNumber = z.union([z.string(), z.number()]) From e095a596a151582d1070bd661a4579bfb491d0d8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 13:40:39 +0200 Subject: [PATCH 11/66] Type logic filter --- packages/types/src/api/web/app/rows.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 6cc5e575a6..a02081366c 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -30,7 +30,11 @@ export interface PatchRowResponse extends Row {} const stringBasicFilter = z.record(z.string(), z.string()) const basicFilter = z.record(z.string(), z.any()) const arrayFilter = z.record(z.string(), z.union([z.any().array(), z.string()])) -const logicFilter = z.any() +const logicFilter = z.lazy(() => + z.object({ + conditions: z.array(z.object(queryFilterValidation)), + }) +) const stringOrNumber = z.union([z.string(), z.number()]) From 60a5f4a2e72da9130cedb32c5ed4948d3eb2934b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 15:11:11 +0200 Subject: [PATCH 12/66] Types --- packages/server/src/api/controllers/row/index.ts | 13 ++++++++++++- packages/server/src/api/routes/tests/search.spec.ts | 1 + packages/types/src/api/web/app/rows.ts | 7 ------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 769a1dbe5e..0e4e305ce7 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -222,10 +222,21 @@ export async function search(ctx: Ctx) { ) const searchParams: RequiredKeys = { - ...searchRequest, query: enrichedQuery, tableId, viewId, + bookmark: searchRequest.bookmark, + paginate: searchRequest.paginate, + limit: searchRequest.limit, + sort: searchRequest.sort, + sortOrder: searchRequest.sortOrder, + sortType: searchRequest.sortType, + countRows: searchRequest.countRows, + version: searchRequest.version, + disableEscaping: searchRequest.disableEscaping, + fields: undefined, + indexer: undefined, + rows: undefined, } ctx.status = 200 diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 1ccc9bfdc9..a53f650d22 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -187,6 +187,7 @@ describe.each([ if (isInMemory) { return dataFilters.search(_.cloneDeep(rows), { ...this.query, + query: this.query.query!, }) } else { return config.api.row.search(tableOrViewId, this.query) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index a02081366c..013e349fe5 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -80,13 +80,6 @@ const searchRowRequest = z.object({ version: z.string().optional(), disableEscaping: z.boolean().optional(), countRows: z.boolean().optional(), - - // viewId?: string - // query?: SearchFilters - - // fields?: string[] - // indexer?: () => Promise - // rows?: Row[] }) export const searchRowRequestValidator = searchRowRequest export type SearchRowRequest = z.infer From 5cad93ff75eb1eb02669c1edb35e90457fa4e29f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 15:15:54 +0200 Subject: [PATCH 13/66] Fix --- packages/server/src/api/controllers/row/views.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/views.ts b/packages/server/src/api/controllers/row/views.ts index 622688deb6..9ceb14ed2c 100644 --- a/packages/server/src/api/controllers/row/views.ts +++ b/packages/server/src/api/controllers/row/views.ts @@ -35,7 +35,7 @@ export async function searchView( > = { tableId: view.tableId, viewId: view.id, - query: body.query, + query: body.query || {}, fields: viewFields, ...getSortOptions(body, view), limit: body.limit, From 8519cfc495b281dd6fbc588d4496ec9bf9852ecc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 14:05:57 +0100 Subject: [PATCH 14/66] Fix typing --- packages/server/src/api/controllers/row/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/utils/utils.ts b/packages/server/src/api/controllers/row/utils/utils.ts index 4188fcced3..5b60143792 100644 --- a/packages/server/src/api/controllers/row/utils/utils.ts +++ b/packages/server/src/api/controllers/row/utils/utils.ts @@ -175,7 +175,7 @@ export async function enrichArrayContext( } export async function enrichSearchContext( - fields: Record, + fields: Record | undefined, inputs = {}, helpers = true ): Promise> { From 3250ad49476c81520c5039240e535b17dc0b25ad Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 14:15:46 +0100 Subject: [PATCH 15/66] Allow nullable bookmarks --- .../src/api/routes/tests/search.spec.ts | 21 ++++++++++++++++--- packages/types/src/api/web/app/rows.ts | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index fe13e5311f..6600cf0da1 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -24,6 +24,7 @@ import { JsonFieldSubType, LogicalOperator, RelationshipType, + RequiredKeys, Row, RowSearchParams, SearchFilters, @@ -206,9 +207,23 @@ datasourceDescribe( private async performSearch(): Promise> { if (isInMemory) { - return dataFilters.search(_.cloneDeep(rows), { - ...this.query, - }) + const query: RequiredKeys> = { + sort: this.query.sort, + query: this.query.query || {}, + paginate: this.query.paginate, + bookmark: this.query.bookmark, + limit: this.query.limit, + sortOrder: this.query.sortOrder, + sortType: this.query.sortType, + version: this.query.version, + disableEscaping: this.query.disableEscaping, + countRows: this.query.countRows, + viewId: undefined, + fields: undefined, + indexer: undefined, + rows: undefined, + } + return dataFilters.search(_.cloneDeep(rows), query) } else { return config.api.row.search(tableOrViewId, this.query) } diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 013e349fe5..34ef1ee4c1 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -72,7 +72,7 @@ const searchRowRequest = z.object({ }) .optional(), paginate: z.boolean().optional(), - bookmark: z.union([z.string(), z.number()]).optional(), + bookmark: z.union([z.string(), z.number()]).nullable().optional(), limit: z.number().optional(), sort: z.string().optional(), sortOrder: z.nativeEnum(SortOrder).optional(), From cf7daf06027a9811e647cd06f33b123cdffbc3ed Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 14:16:10 +0100 Subject: [PATCH 16/66] Fix --- packages/server/src/api/routes/tests/search.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 6600cf0da1..2c13cac014 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -211,7 +211,7 @@ datasourceDescribe( sort: this.query.sort, query: this.query.query || {}, paginate: this.query.paginate, - bookmark: this.query.bookmark, + bookmark: this.query.bookmark ?? undefined, limit: this.query.limit, sortOrder: this.query.sortOrder, sortType: this.query.sortType, From 414d79d73c2db01a40b4a298abcec592a8867bbd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 14:16:26 +0100 Subject: [PATCH 17/66] Fix types --- packages/server/src/api/controllers/row/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index abc751b5e4..fbaf9f8462 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -255,7 +255,7 @@ export async function search(ctx: Ctx) { query: enrichedQuery, tableId, viewId, - bookmark: searchRequest.bookmark, + bookmark: searchRequest.bookmark ?? undefined, paginate: searchRequest.paginate, limit: searchRequest.limit, sort: searchRequest.sort, From 94f475c0607a001f131da6146b3b6fe55af63a2d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 16:09:03 +0100 Subject: [PATCH 18/66] Exclude InternalSearchFilterOperator.COMPLEX_ID_OPERATOR --- packages/types/src/api/web/app/rows.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 34ef1ee4c1..520983d353 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -2,6 +2,7 @@ import { ArrayOperator, BasicOperator, EmptyFilterOption, + InternalSearchFilterOperator, LogicalOperator, RangeOperator, SearchFilterKey, @@ -26,10 +27,15 @@ export interface PatchRowRequest extends Row { export interface PatchRowResponse extends Row {} -// TODO: exclude InternalSearchFilterOperator.COMPLEX_ID_OPERATOR -const stringBasicFilter = z.record(z.string(), z.string()) -const basicFilter = z.record(z.string(), z.any()) -const arrayFilter = z.record(z.string(), z.union([z.any().array(), z.string()])) +const fieldKey = z + .string() + .refine(s => s !== InternalSearchFilterOperator.COMPLEX_ID_OPERATOR, { + message: `Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`, + }) + +const stringBasicFilter = z.record(fieldKey, z.string()) +const basicFilter = z.record(fieldKey, z.any()) +const arrayFilter = z.record(fieldKey, z.union([z.any().array(), z.string()])) const logicFilter = z.lazy(() => z.object({ conditions: z.array(z.object(queryFilterValidation)), @@ -43,7 +49,7 @@ const queryFilterValidation: Record = { [BasicOperator.FUZZY]: stringBasicFilter.optional(), [RangeOperator.RANGE]: z .record( - z.string(), + fieldKey, z.union([ z.object({ high: stringOrNumber, low: stringOrNumber }), z.object({ high: stringOrNumber }), From ed6d434843f87dfc1287217c54baa9bfe8b3976c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 16:14:03 +0100 Subject: [PATCH 19/66] Fix --- packages/server/src/api/controllers/row/views.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/row/views.ts b/packages/server/src/api/controllers/row/views.ts index 7d0957b2fc..58bd40b529 100644 --- a/packages/server/src/api/controllers/row/views.ts +++ b/packages/server/src/api/controllers/row/views.ts @@ -29,19 +29,20 @@ export async function searchView( await context.ensureSnippetContext(true) - const searchOptions: RequiredKeys & - RequiredKeys< - Pick - > = { + const searchOptions: RequiredKeys = { tableId: view.tableId, viewId: view.id, query: body.query || {}, fields: viewFields, ...getSortOptions(body, view), limit: body.limit, - bookmark: body.bookmark, + bookmark: body.bookmark ?? undefined, paginate: body.paginate, countRows: body.countRows, + version: undefined, + disableEscaping: undefined, + indexer: undefined, + rows: undefined, } const result = await sdk.rows.search(searchOptions, { From 2fb4c11484cbf2a5eecdaacc6c0efba536544281 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Nov 2024 18:32:02 +0100 Subject: [PATCH 20/66] Update yarn.lock --- yarn.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index aaadbbe7bd..0e7f680619 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5751,13 +5751,6 @@ dependencies: "@types/koa" "*" -"@types/koa__router@8.0.8": - version "8.0.8" - resolved "https://registry.yarnpkg.com/@types/koa__router/-/koa__router-8.0.8.tgz#b1e0e9a512498777d3366bbdf0e853df27ec831c" - integrity sha512-9pGCaDtzCsj4HJ8HmGuqzk8+s57sPj4njWd08GG5o92n5Xp9io2snc40CPpXFhoKcZ8OKhuu6ht4gNou9e1C2w== - dependencies: - "@types/koa" "*" - "@types/lodash@4.14.200": version "4.14.200" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.200.tgz#435b6035c7eba9cdf1e039af8212c9e9281e7149" From 88773d1e6cb13beb41fa68950b50d7490aed9d70 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 13:42:54 +0100 Subject: [PATCH 21/66] Clean unused scripts --- package.json | 1 - scripts/buildx-multiarch.sh | 4 --- scripts/pinVersions.js | 46 ------------------------ scripts/releaseHelmChart.js | 28 --------------- scripts/resetVersions.sh | 7 ---- scripts/syncLocalDependencies.js | 60 -------------------------------- scripts/updateVersions.sh | 8 ----- 7 files changed, 154 deletions(-) delete mode 100755 scripts/buildx-multiarch.sh delete mode 100644 scripts/pinVersions.js delete mode 100755 scripts/releaseHelmChart.js delete mode 100755 scripts/resetVersions.sh delete mode 100755 scripts/syncLocalDependencies.js delete mode 100755 scripts/updateVersions.sh diff --git a/package.json b/package.json index e354f36d2a..31e4110a35 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "build:docker:dependencies": "docker build -f hosting/dependencies/Dockerfile -t budibase/dependencies:latest ./hosting", "publish:docker:couch": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/couchdb/Dockerfile -t budibase/couchdb:latest -t budibase/couchdb:v3.3.3 -t budibase/couchdb:v3.3.3-sqs-v2.1.1 --push ./hosting/couchdb", "publish:docker:dependencies": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/dependencies/Dockerfile -t budibase/dependencies:latest -t budibase/dependencies:v3.2.1 --push ./hosting", - "release:helm": "node scripts/releaseHelmChart", "env:multi:enable": "lerna run --stream env:multi:enable", "env:multi:disable": "lerna run --stream env:multi:disable", "env:selfhost:enable": "lerna run --stream env:selfhost:enable", diff --git a/scripts/buildx-multiarch.sh b/scripts/buildx-multiarch.sh deleted file mode 100755 index 07a8fdb5c1..0000000000 --- a/scripts/buildx-multiarch.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -sudo apt-get install -y qemu qemu-user-static -docker buildx create --name budibase -docker buildx use budibase diff --git a/scripts/pinVersions.js b/scripts/pinVersions.js deleted file mode 100644 index 44cbba1090..0000000000 --- a/scripts/pinVersions.js +++ /dev/null @@ -1,46 +0,0 @@ -const fs = require("fs") -const path = require("path") - -const MONOREPO_ROOT = "packages" - -const packages = getPackages() - -function getPackages() { - if (fs.existsSync(MONOREPO_ROOT)) { - return fs.readdirSync(MONOREPO_ROOT).map(pkg => path.join(MONOREPO_ROOT, pkg)) - } else { - return ["./"] - } -} - -function pinDeps(dependencies) { - for (let dependency in dependencies) { - if (dependency.startsWith("@budibase")) { - dependencies[dependency] = dependencies[dependency].replace("^", "") - } - } - return dependencies -} - -// iterate over the monorepo packages -for (let pkgPath of packages) { - // only directories - if (fs.statSync(pkgPath).isDirectory()) { - // get the package JSON file - const pkgJsonPath = path.join(pkgPath, "package.json") - if (!fs.existsSync(pkgJsonPath)) { - continue - } - const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath)) - - - // find any budibase dependencies, and pin them - pkgJson.dependencies = pinDeps(pkgJson.dependencies) - pkgJson.devDependencies = pinDeps(pkgJson.devDependencies) - - // update the package JSON files - fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2)) - } -} - -console.log("Pinned dev versions for budibase packages successfully.") diff --git a/scripts/releaseHelmChart.js b/scripts/releaseHelmChart.js deleted file mode 100755 index 45ae01df0e..0000000000 --- a/scripts/releaseHelmChart.js +++ /dev/null @@ -1,28 +0,0 @@ -const yaml = require("js-yaml") -const fs = require("fs") -const path = require("path") - -const CHART_PATH = path.join(__dirname, "../", "charts", "budibase", "Chart.yaml") -const UPGRADE_VERSION = process.env.BUDIBASE_RELEASE_VERSION - -if (!UPGRADE_VERSION) { - throw new Error("BUDIBASE_RELEASE_VERSION env var must be set.") -} - -try { - const chartFile = fs.readFileSync(CHART_PATH, "utf-8") - const chart = yaml.load(chartFile) - - // Upgrade app version in chart to match budibase release version - chart.appVersion = UPGRADE_VERSION - - // semantically version the chart - const [major, minor, patch] = chart.version.split(".") - const newPatch = parseInt(patch) + 1 - chart.version = [major, minor, newPatch].join(".") - const updatedChartYaml = yaml.dump(chart) - fs.writeFileSync(CHART_PATH, updatedChartYaml) -} catch (err) { - console.error("Error releasing helm chart") - throw err -} diff --git a/scripts/resetVersions.sh b/scripts/resetVersions.sh deleted file mode 100755 index 83411f5153..0000000000 --- a/scripts/resetVersions.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -echo "Resetting package versions" -yarn lerna exec "yarn version --no-git-tag-version --new-version=0.0.0" -echo "Updating dependencies" -node scripts/syncLocalDependencies.js "0.0.0" -git checkout package.json -echo "Package versions reset!" diff --git a/scripts/syncLocalDependencies.js b/scripts/syncLocalDependencies.js deleted file mode 100755 index 1c402e9a44..0000000000 --- a/scripts/syncLocalDependencies.js +++ /dev/null @@ -1,60 +0,0 @@ -const fs = require("fs") -const path = require("path") -const { execSync } = require("child_process") - -// Get the version argument from the command line -const version = process.argv[2] -if (!version) { - console.error("Usage: node update-workspace-dependencies.js ") - process.exit(1) -} - -// Get the list of workspaces with mismatched dependencies -const output = execSync("yarn --silent workspaces info --json", { - encoding: "utf-8", -}) -const data = JSON.parse(output) - -const workspaces = Object.keys(data).filter(key => { - return data[key].mismatchedWorkspaceDependencies?.length -}) - -// Loop through each workspace and update the dependencies -workspaces.forEach(workspace => { - const dependencies = data[workspace].mismatchedWorkspaceDependencies - - // Loop through each dependency and update its version in package.json - const packageJsonPath = path.join(data[workspace].location, "package.json") - const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) - let hasChanges = false - - dependencies.forEach(dependency => { - if (packageJson.dependencies?.[dependency]) { - packageJson.dependencies[dependency] = version - hasChanges = true - } - if (packageJson.devDependencies?.[dependency]) { - packageJson.devDependencies[dependency] = version - hasChanges = true - } - if (packageJson.peerDependencies?.[dependency]) { - packageJson.peerDependencies[dependency] = version - hasChanges = true - } - }) - - // Write changes to package.json if there are any - if (hasChanges) { - fs.writeFileSync( - packageJsonPath, - JSON.stringify(packageJson, null, 2) + "\n" - ) - } -}) - -const rootPackageJson = JSON.parse(fs.readFileSync("package.json", "utf-8")) -delete rootPackageJson["resolutions"] -fs.writeFileSync( - "package.json", - JSON.stringify(rootPackageJson, null, 2) + "\n" -) diff --git a/scripts/updateVersions.sh b/scripts/updateVersions.sh deleted file mode 100755 index 1d019fd886..0000000000 --- a/scripts/updateVersions.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -version=$(./scripts/getCurrentVersion.sh) -echo "Setting version $version" -yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" -echo "Updating dependencies" -node scripts/syncLocalDependencies.js $version -echo "Syncing yarn workspace" -yarn From 1e01f0d7575b5d66f0b18338d80c4bcf626f6d8d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:03:58 +0100 Subject: [PATCH 22/66] Update yarn.lock --- yarn.lock | 102 ------------------------------------------------------ 1 file changed, 102 deletions(-) diff --git a/yarn.lock b/yarn.lock index ceebc9ebdf..70d3c2d4b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2483,13 +2483,6 @@ resolved "https://registry.yarnpkg.com/@datadog/libdatadog/-/libdatadog-0.2.2.tgz#ac02c76ac9a38250dca740727c7cdf00244ce3d3" integrity sha512-rTWo96mEPTY5UbtGoFj8/wY0uKSViJhsPg/Z6aoFWBFXQ8b45Ix2e/yvf92AAwrhG+gPLTxEqTXh3kef2dP8Ow== -"@datadog/native-appsec@8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-8.1.1.tgz#76aa34697e6ecbd3d9ef7e6938d3cdcfa689b1f3" - integrity sha512-mf+Ym/AzET4FeUTXOs8hz0uLOSsVIUnavZPUx8YoKWK5lKgR2L+CLfEzOpjBwgFpDgbV8I1/vyoGelgGpsMKHA== - dependencies: - node-gyp-build "^3.9.0" - "@datadog/native-appsec@8.3.0": version "8.3.0" resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-8.3.0.tgz#91afd89d18d386be4da8a1b0e04500f2f8b5eb66" @@ -2497,14 +2490,6 @@ dependencies: node-gyp-build "^3.9.0" -"@datadog/native-iast-rewriter@2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.4.1.tgz#e8211f78c818906513fb96a549374da0382c7623" - integrity sha512-j3auTmyyn63e2y+SL28CGNy/l+jXQyh+pxqoGTacWaY5FW/dvo5nGQepAismgJ3qJ8VhQfVWRdxBSiT7wu9clw== - dependencies: - lru-cache "^7.14.0" - node-gyp-build "^4.5.0" - "@datadog/native-iast-rewriter@2.5.0": version "2.5.0" resolved "https://registry.yarnpkg.com/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.5.0.tgz#b613defe86e78168f750d1f1662d4ffb3cf002e6" @@ -2513,13 +2498,6 @@ lru-cache "^7.14.0" node-gyp-build "^4.5.0" -"@datadog/native-iast-taint-tracking@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-3.1.0.tgz#7b2ed7f8fad212d65e5ab03bcdea8b42a3051b2e" - integrity sha512-rw6qSjmxmu1yFHVvZLXFt/rVq2tUZXocNogPLB8n7MPpA0jijNGb109WokWw5ITImiW91GcGDuBW6elJDVKouQ== - dependencies: - node-gyp-build "^3.9.0" - "@datadog/native-iast-taint-tracking@3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-3.2.0.tgz#9fb6823d82f934e12c06ea1baa7399ca80deb2ec" @@ -2527,14 +2505,6 @@ dependencies: node-gyp-build "^3.9.0" -"@datadog/native-metrics@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@datadog/native-metrics/-/native-metrics-2.0.0.tgz#65bf03313ee419956361e097551db36173e85712" - integrity sha512-YklGVwUtmKGYqFf1MNZuOHvTYdKuR4+Af1XkWcMD8BwOAjxmd9Z+97328rCOY8TFUJzlGUPaXzB8j2qgG/BMwA== - dependencies: - node-addon-api "^6.1.0" - node-gyp-build "^3.9.0" - "@datadog/native-metrics@^3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@datadog/native-metrics/-/native-metrics-3.0.1.tgz#dc276c93785c0377a048e316f23b7c8ff3acfa84" @@ -2543,17 +2513,6 @@ node-addon-api "^6.1.0" node-gyp-build "^3.9.0" -"@datadog/pprof@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-5.3.0.tgz#c2f58d328ecced7f99887f1a559d7fe3aecb9219" - integrity sha512-53z2Q3K92T6Pf4vz4Ezh8kfkVEvLzbnVqacZGgcbkP//q0joFzO8q00Etw1S6NdnCX0XmX08ULaF4rUI5r14mw== - dependencies: - delay "^5.0.0" - node-gyp-build "<4.0" - p-limit "^3.1.0" - pprof-format "^2.1.0" - source-map "^0.7.4" - "@datadog/pprof@5.4.1": version "5.4.1" resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-5.4.1.tgz#08c9bcf5d8efb2eeafdfc9f5bb5402f79fb41266" @@ -3470,16 +3429,6 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@jsep-plugin/assignment@^1.2.1": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@jsep-plugin/assignment/-/assignment-1.3.0.tgz#fcfc5417a04933f7ceee786e8ab498aa3ce2b242" - integrity sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ== - -"@jsep-plugin/regex@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@jsep-plugin/regex/-/regex-1.0.4.tgz#cb2fc423220fa71c609323b9ba7f7d344a755fcc" - integrity sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg== - "@koa/cors@5.0.0": version "5.0.0" resolved "https://registry.yarnpkg.com/@koa/cors/-/cors-5.0.0.tgz#0029b5f057fa0d0ae0e37dd2c89ece315a0daffd" @@ -9311,43 +9260,6 @@ dc-polyfill@^0.1.4: resolved "https://registry.yarnpkg.com/dc-polyfill/-/dc-polyfill-0.1.6.tgz#c2940fa68ffb24a7bf127cc6cfdd15b39f0e7f02" integrity sha512-UV33cugmCC49a5uWAApM+6Ev9ZdvIUMTrtCO9fj96TPGOQiea54oeO3tiEVdVeo3J9N2UdJEmbS4zOkkEA35uQ== -dd-trace@5.23.0: - version "5.23.0" - resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-5.23.0.tgz#a0c11863406de440a6675648caf06e1d07d67ba8" - integrity sha512-nLvwSGpTMIk6S3sMSge6yFqqgqI573VgZc8MF31vl6K0ouJoE7OkVx9cmSVjS4CbSi525tcKq9z7tApsNLpVLQ== - dependencies: - "@datadog/native-appsec" "8.1.1" - "@datadog/native-iast-rewriter" "2.4.1" - "@datadog/native-iast-taint-tracking" "3.1.0" - "@datadog/native-metrics" "^2.0.0" - "@datadog/pprof" "5.3.0" - "@datadog/sketches-js" "^2.1.0" - "@opentelemetry/api" ">=1.0.0 <1.9.0" - "@opentelemetry/core" "^1.14.0" - crypto-randomuuid "^1.0.0" - dc-polyfill "^0.1.4" - ignore "^5.2.4" - import-in-the-middle "1.11.2" - int64-buffer "^0.1.9" - istanbul-lib-coverage "3.2.0" - jest-docblock "^29.7.0" - jsonpath-plus "^9.0.0" - koalas "^1.0.2" - limiter "1.1.5" - lodash.sortby "^4.7.0" - lru-cache "^7.14.0" - module-details-from-path "^1.0.3" - msgpack-lite "^0.1.26" - opentracing ">=0.12.1" - path-to-regexp "^0.1.10" - pprof-format "^2.1.0" - protobufjs "^7.2.5" - retry "^0.13.1" - rfdc "^1.3.1" - semver "^7.5.4" - shell-quote "^1.8.1" - tlhunter-sorted-set "^0.1.0" - dd-trace@5.26.0: version "5.26.0" resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-5.26.0.tgz#cc55061f66742bf01d0d7dc9f75c0e4937c82f40" @@ -14100,11 +14012,6 @@ jsdom@^21.1.1: ws "^8.13.0" xml-name-validator "^4.0.0" -jsep@^1.3.8: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsep/-/jsep-1.4.0.tgz#19feccbfa51d8a79f72480b4b8e40ce2e17152f0" - integrity sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw== - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -14208,15 +14115,6 @@ jsonparse@^1.2.0, jsonparse@^1.3.1: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsonpath-plus@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-9.0.0.tgz#bb8703ee481531142bca8dee9a42fe72b8358a7f" - integrity sha512-bqE77VIDStrOTV/czspZhTn+o27Xx9ZJRGVkdVShEtPoqsIx5yALv3lWVU6y+PqYvWPJNWE7ORCQheQkEe0DDA== - dependencies: - "@jsep-plugin/assignment" "^1.2.1" - "@jsep-plugin/regex" "^1.0.3" - jsep "^1.3.8" - jsonschema@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" From b8a2c4d6b3872a572eebe0e0e6d5af0448ce309a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:14:25 +0100 Subject: [PATCH 23/66] Lint --- packages/server/src/api/routes/tests/search.spec.ts | 1 - packages/server/src/middleware/zod-validator.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 5edc4f29ad..5384444067 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -24,7 +24,6 @@ import { JsonFieldSubType, LogicalOperator, RelationshipType, - RequiredKeys, Row, RowSearchParams, SearchFilters, diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts index f990ee0642..0ad346afc3 100644 --- a/packages/server/src/middleware/zod-validator.ts +++ b/packages/server/src/middleware/zod-validator.ts @@ -36,7 +36,3 @@ function validate(schema: AnyZodObject, property: "body" | "params") { export function validateBody(schema: AnyZodObject) { return validate(schema, "body") } - -// export function validateParams(schema: AnyZodObject) { -// return validate(schema, "params") -// } From 0cef937a14c5d40a8f663f7a1baf37aeaeafa217 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:15:19 +0100 Subject: [PATCH 24/66] Update deps --- packages/types/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/types/package.json b/packages/types/package.json index aa67a2e5b4..ae99d31838 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -20,10 +20,10 @@ "@types/redlock": "4.0.7", "rimraf": "3.0.2", "typescript": "5.5.2", - "koa-useragent": "^4.1.0" + "koa-useragent": "^4.1.0", + "zod": "^3.23.8" }, "dependencies": { - "scim-patch": "^0.8.1", - "zod": "^3.23.8" + "scim-patch": "^0.8.1" } } From ab00add0ff77d982bd6cedb279b2f04d8eafa87b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:23:03 +0100 Subject: [PATCH 25/66] Change to nullish --- packages/types/src/api/web/app/rows.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 520983d353..cb213f4a1e 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -78,11 +78,11 @@ const searchRowRequest = z.object({ }) .optional(), paginate: z.boolean().optional(), - bookmark: z.union([z.string(), z.number()]).nullable().optional(), + bookmark: z.union([z.string(), z.number()]).nullish(), limit: z.number().optional(), sort: z.string().optional(), sortOrder: z.nativeEnum(SortOrder).optional(), - sortType: z.nativeEnum(SortType).optional(), + sortType: z.nativeEnum(SortType).nullish(), version: z.string().optional(), disableEscaping: z.boolean().optional(), countRows: z.boolean().optional(), From 792388f1e10d98212fd36223f15ebaacbdbe1b52 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:23:46 +0100 Subject: [PATCH 26/66] Renames --- packages/types/src/api/web/app/{rows.ts => rows/index.ts} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename packages/types/src/api/web/app/{rows.ts => rows/index.ts} (96%) diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows/index.ts similarity index 96% rename from packages/types/src/api/web/app/rows.ts rename to packages/types/src/api/web/app/rows/index.ts index cb213f4a1e..001066d7fb 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows/index.ts @@ -7,13 +7,13 @@ import { RangeOperator, SearchFilterKey, SearchFilters, -} from "../../../sdk" -import { Row } from "../../../documents" +} from "../../../../sdk" +import { Row } from "../../../../documents" import { PaginationResponse, SortOrder, SortType, -} from "../../../api/web/pagination" +} from "../../../../api/web/pagination" import { ReadStream } from "fs" import { z } from "zod" From e3e82f2fb84ddea121634a6e8ad28a15a467bc19 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:33:31 +0100 Subject: [PATCH 27/66] Move types --- packages/types/src/api/web/app/rows/index.ts | 104 +----------------- packages/types/src/api/web/app/rows/search.ts | 100 +++++++++++++++++ 2 files changed, 104 insertions(+), 100 deletions(-) create mode 100644 packages/types/src/api/web/app/rows/search.ts diff --git a/packages/types/src/api/web/app/rows/index.ts b/packages/types/src/api/web/app/rows/index.ts index 001066d7fb..2642a8b04e 100644 --- a/packages/types/src/api/web/app/rows/index.ts +++ b/packages/types/src/api/web/app/rows/index.ts @@ -1,21 +1,9 @@ -import { - ArrayOperator, - BasicOperator, - EmptyFilterOption, - InternalSearchFilterOperator, - LogicalOperator, - RangeOperator, - SearchFilterKey, - SearchFilters, -} from "../../../../sdk" +import { SearchFilters } from "../../../../sdk" import { Row } from "../../../../documents" -import { - PaginationResponse, - SortOrder, - SortType, -} from "../../../../api/web/pagination" +import { SortOrder } from "../../../../api/web/pagination" import { ReadStream } from "fs" -import { z } from "zod" + +export * from "./search" export interface SaveRowRequest extends Row {} @@ -27,90 +15,6 @@ export interface PatchRowRequest extends Row { export interface PatchRowResponse extends Row {} -const fieldKey = z - .string() - .refine(s => s !== InternalSearchFilterOperator.COMPLEX_ID_OPERATOR, { - message: `Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`, - }) - -const stringBasicFilter = z.record(fieldKey, z.string()) -const basicFilter = z.record(fieldKey, z.any()) -const arrayFilter = z.record(fieldKey, z.union([z.any().array(), z.string()])) -const logicFilter = z.lazy(() => - z.object({ - conditions: z.array(z.object(queryFilterValidation)), - }) -) - -const stringOrNumber = z.union([z.string(), z.number()]) - -const queryFilterValidation: Record = { - [BasicOperator.STRING]: stringBasicFilter.optional(), - [BasicOperator.FUZZY]: stringBasicFilter.optional(), - [RangeOperator.RANGE]: z - .record( - fieldKey, - z.union([ - z.object({ high: stringOrNumber, low: stringOrNumber }), - z.object({ high: stringOrNumber }), - z.object({ low: stringOrNumber }), - ]) - ) - .optional(), - [BasicOperator.EQUAL]: basicFilter.optional(), - [BasicOperator.NOT_EQUAL]: basicFilter.optional(), - [BasicOperator.EMPTY]: basicFilter.optional(), - [BasicOperator.NOT_EMPTY]: basicFilter.optional(), - [ArrayOperator.ONE_OF]: arrayFilter.optional(), - [ArrayOperator.CONTAINS]: arrayFilter.optional(), - [ArrayOperator.NOT_CONTAINS]: arrayFilter.optional(), - [ArrayOperator.CONTAINS_ANY]: arrayFilter.optional(), - [LogicalOperator.AND]: logicFilter.optional(), - [LogicalOperator.OR]: logicFilter.optional(), -} - -const searchRowRequest = z.object({ - query: z - .object({ - allOr: z.boolean().optional(), - onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(), - ...queryFilterValidation, - }) - .optional(), - paginate: z.boolean().optional(), - bookmark: z.union([z.string(), z.number()]).nullish(), - limit: z.number().optional(), - sort: z.string().optional(), - sortOrder: z.nativeEnum(SortOrder).optional(), - sortType: z.nativeEnum(SortType).nullish(), - version: z.string().optional(), - disableEscaping: z.boolean().optional(), - countRows: z.boolean().optional(), -}) -export const searchRowRequestValidator = searchRowRequest -export type SearchRowRequest = z.infer - -export interface SearchViewRowRequest - extends Pick< - SearchRowRequest, - | "sort" - | "sortOrder" - | "sortType" - | "limit" - | "bookmark" - | "paginate" - | "query" - | "countRows" - > {} - -export interface SearchRowResponse { - rows: any[] -} - -export interface PaginatedSearchRowResponse - extends SearchRowResponse, - PaginationResponse {} - export interface ExportRowsRequest { rows?: string[] columns?: string[] diff --git a/packages/types/src/api/web/app/rows/search.ts b/packages/types/src/api/web/app/rows/search.ts new file mode 100644 index 0000000000..b74e490677 --- /dev/null +++ b/packages/types/src/api/web/app/rows/search.ts @@ -0,0 +1,100 @@ +import { + ArrayOperator, + BasicOperator, + EmptyFilterOption, + InternalSearchFilterOperator, + LogicalOperator, + RangeOperator, + SearchFilterKey, +} from "../../../../sdk" +import { Row } from "../../../../documents" +import { + PaginationResponse, + SortOrder, + SortType, +} from "../../../../api/web/pagination" +import { z } from "zod" + +const fieldKey = z + .string() + .refine(s => s !== InternalSearchFilterOperator.COMPLEX_ID_OPERATOR, { + message: `Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`, + }) + +const stringBasicFilter = z.record(fieldKey, z.string()) +const basicFilter = z.record(fieldKey, z.any()) +const arrayFilter = z.record(fieldKey, z.union([z.any().array(), z.string()])) +const logicFilter = z.lazy(() => + z.object({ + conditions: z.array(z.object(queryFilterValidation)), + }) +) + +const stringOrNumber = z.union([z.string(), z.number()]) + +const queryFilterValidation: Record = { + [BasicOperator.STRING]: stringBasicFilter.optional(), + [BasicOperator.FUZZY]: stringBasicFilter.optional(), + [RangeOperator.RANGE]: z + .record( + fieldKey, + z.union([ + z.object({ high: stringOrNumber, low: stringOrNumber }), + z.object({ high: stringOrNumber }), + z.object({ low: stringOrNumber }), + ]) + ) + .optional(), + [BasicOperator.EQUAL]: basicFilter.optional(), + [BasicOperator.NOT_EQUAL]: basicFilter.optional(), + [BasicOperator.EMPTY]: basicFilter.optional(), + [BasicOperator.NOT_EMPTY]: basicFilter.optional(), + [ArrayOperator.ONE_OF]: arrayFilter.optional(), + [ArrayOperator.CONTAINS]: arrayFilter.optional(), + [ArrayOperator.NOT_CONTAINS]: arrayFilter.optional(), + [ArrayOperator.CONTAINS_ANY]: arrayFilter.optional(), + [LogicalOperator.AND]: logicFilter.optional(), + [LogicalOperator.OR]: logicFilter.optional(), +} + +const searchRowRequest = z.object({ + query: z + .object({ + allOr: z.boolean().optional(), + onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(), + ...queryFilterValidation, + }) + .optional(), + paginate: z.boolean().optional(), + bookmark: z.union([z.string(), z.number()]).nullish(), + limit: z.number().optional(), + sort: z.string().optional(), + sortOrder: z.nativeEnum(SortOrder).optional(), + sortType: z.nativeEnum(SortType).nullish(), + version: z.string().optional(), + disableEscaping: z.boolean().optional(), + countRows: z.boolean().optional(), +}) + +export const searchRowRequestValidator = searchRowRequest + +export type SearchRowRequest = z.infer +export type SearchViewRowRequest = Pick< + SearchRowRequest, + | "sort" + | "sortOrder" + | "sortType" + | "limit" + | "bookmark" + | "paginate" + | "query" + | "countRows" +> + +export interface SearchRowResponse { + rows: Row[] +} + +export interface PaginatedSearchRowResponse + extends SearchRowResponse, + PaginationResponse {} From 7ed45f71d273b1d12f6c377181a1c40d850a5d22 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:35:24 +0100 Subject: [PATCH 28/66] Fix type tests --- .../src/api/routes/tests/search.spec.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 5384444067..8ba165ded0 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -24,6 +24,7 @@ import { JsonFieldSubType, LogicalOperator, RelationshipType, + RequiredKeys, Row, RowSearchParams, SearchFilters, @@ -208,9 +209,25 @@ if (descriptions.length) { private async performSearch(): Promise> { if (isInMemory) { - return dataFilters.search(_.cloneDeep(rows), { - ...this.query, - }) + const inMemoryQuery: RequiredKeys< + Omit + > = { + sort: this.query.sort, + query: { ...this.query.query }, + paginate: this.query.paginate, + bookmark: this.query.bookmark ?? undefined, + limit: this.query.limit, + sortOrder: this.query.sortOrder, + sortType: this.query.sortType ?? undefined, + version: this.query.version, + disableEscaping: this.query.disableEscaping, + countRows: this.query.countRows, + viewId: undefined, + fields: undefined, + indexer: undefined, + rows: undefined, + } + return dataFilters.search(_.cloneDeep(rows), inMemoryQuery) } else { return config.api.row.search(tableOrViewId, this.query) } From 0501980e45c25ef0f13c3240fb6168abcec75532 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:44:25 +0100 Subject: [PATCH 29/66] Fix types --- packages/server/src/api/controllers/row/index.ts | 2 +- packages/server/src/api/controllers/row/views.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index fbaf9f8462..2dc9381183 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -260,7 +260,7 @@ export async function search(ctx: Ctx) { limit: searchRequest.limit, sort: searchRequest.sort, sortOrder: searchRequest.sortOrder, - sortType: searchRequest.sortType, + sortType: searchRequest.sortType ?? undefined, countRows: searchRequest.countRows, version: searchRequest.version, disableEscaping: searchRequest.disableEscaping, diff --git a/packages/server/src/api/controllers/row/views.ts b/packages/server/src/api/controllers/row/views.ts index eb010fee98..0655a3b38f 100644 --- a/packages/server/src/api/controllers/row/views.ts +++ b/packages/server/src/api/controllers/row/views.ts @@ -57,7 +57,7 @@ function getSortOptions(request: SearchViewRowRequest, view: ViewV2) { return { sort: request.sort, sortOrder: request.sortOrder, - sortType: request.sortType, + sortType: request.sortType ?? undefined, } } if (view.sort) { From b17c6ab43add99011aecef589658c4c01d21c1af Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:01:28 +0000 Subject: [PATCH 30/66] Cleanup following bigint fixes. --- packages/backend-core/src/sql/sql.ts | 56 ++++++------------- packages/backend-core/src/sql/sqlTable.ts | 15 +++-- packages/pro | 2 +- .../server/src/integrations/googlesheets.ts | 4 +- .../src/sdk/app/rows/search/internal/sqs.ts | 2 +- packages/server/src/sdk/app/rows/sqlAlias.ts | 8 +-- packages/server/src/sdk/app/rows/utils.ts | 2 + packages/types/src/sdk/search.ts | 8 +-- 8 files changed, 36 insertions(+), 61 deletions(-) diff --git a/packages/backend-core/src/sql/sql.ts b/packages/backend-core/src/sql/sql.ts index d251ff672d..5f462ee144 100644 --- a/packages/backend-core/src/sql/sql.ts +++ b/packages/backend-core/src/sql/sql.ts @@ -284,13 +284,13 @@ class InternalBuilder { } private generateSelectStatement(): (string | Knex.Raw)[] | "*" { - const { endpoint, resource } = this.query + const { table, resource } = this.query if (!resource || !resource.fields || resource.fields.length === 0) { return "*" } - const alias = this.getTableName(endpoint.entityId) + const alias = this.getTableName(table) const schema = this.table.schema if (!this.isFullSelectStatementRequired()) { return [this.knex.raw("??", [`${alias}.*`])] @@ -496,7 +496,7 @@ class InternalBuilder { filterKey: string, whereCb: (filterKey: string, query: Knex.QueryBuilder) => Knex.QueryBuilder ): Knex.QueryBuilder { - const { relationships, endpoint, tableAliases: aliases, table } = this.query + const { relationships, schema, tableAliases: aliases, table } = this.query const fromAlias = aliases?.[table.name] || table.name const matches = (value: string) => filterKey.match(new RegExp(`^${value}\\.`)) @@ -537,7 +537,7 @@ class InternalBuilder { aliases?.[manyToMany.through] || relationship.through let throughTable = this.tableNameWithSchema(manyToMany.through, { alias: throughAlias, - schema: endpoint.schema, + schema, }) subQuery = subQuery // add a join through the junction table @@ -1010,28 +1010,10 @@ class InternalBuilder { return isSqs(this.table) } - getTableName(tableOrName?: Table | string): string { - let table: Table - if (typeof tableOrName === "string") { - const name = tableOrName - if (this.query.table?.name === name) { - table = this.query.table - } else if (this.query.table.name === name) { - table = this.query.table - } else if (!this.query.tables[name]) { - // This can legitimately happen in custom queries, where the user is - // querying against a table that may not have been imported into - // Budibase. - return name - } else { - table = this.query.tables[name] - } - } else if (tableOrName) { - table = tableOrName - } else { + getTableName(table?: Table): string { + if (!table) { table = this.table } - let name = table.name if (isSqs(table) && table._id) { // SQS uses the table ID rather than the table name @@ -1242,7 +1224,7 @@ class InternalBuilder { ): Knex.QueryBuilder { const sqlClient = this.client const knex = this.knex - const { resource, tableAliases: aliases, endpoint, tables } = this.query + const { resource, tableAliases: aliases, schema, tables } = this.query const fields = resource?.fields || [] for (let relationship of relationships) { const { @@ -1266,7 +1248,7 @@ class InternalBuilder { throughAlias = (throughTable && aliases?.[throughTable]) || throughTable let toTableWithSchema = this.tableNameWithSchema(toTable, { alias: toAlias, - schema: endpoint.schema, + schema, }) const requiredFields = [ ...(relatedTable?.primary || []), @@ -1310,7 +1292,7 @@ class InternalBuilder { if (isManyToMany) { let throughTableWithSchema = this.tableNameWithSchema(throughTable, { alias: throughAlias, - schema: endpoint.schema, + schema, }) subQuery = subQuery.join(throughTableWithSchema, function () { this.on(`${toAlias}.${toPrimary}`, "=", `${throughAlias}.${toKey}`) @@ -1401,8 +1383,7 @@ class InternalBuilder { toPrimary?: string }[] ): Knex.QueryBuilder { - const { tableAliases: aliases, endpoint } = this.query - const schema = endpoint.schema + const { tableAliases: aliases, schema } = this.query const toTable = tables.to, fromTable = tables.from, throughTable = tables.through @@ -1462,7 +1443,7 @@ class InternalBuilder { return this.knex( this.tableNameWithSchema(this.query.table.name, { alias, - schema: this.query.endpoint.schema, + schema: this.query.schema, }) ) } @@ -1556,9 +1537,8 @@ class InternalBuilder { limits?: { base: number; query: number } } = {} ): Knex.QueryBuilder { - let { endpoint, filters, paginate, relationships, table } = this.query + let { operation, filters, paginate, relationships, table } = this.query const { limits } = opts - const counting = endpoint.operation === Operation.COUNT // start building the query let query = this.qualifiedKnex() @@ -1578,7 +1558,7 @@ class InternalBuilder { foundLimit = paginate.limit } // counting should not sort, limit or offset - if (!counting) { + if (operation !== Operation.COUNT) { // add the found limit if supplied if (foundLimit != null) { query = query.limit(foundLimit) @@ -1590,7 +1570,7 @@ class InternalBuilder { } const aggregations = this.query.resource?.aggregations || [] - if (counting) { + if (operation === Operation.COUNT) { query = this.addDistinctCount(query) } else if (aggregations.length > 0) { query = this.addAggregations(query, aggregations) @@ -1599,7 +1579,7 @@ class InternalBuilder { } // have to add after as well (this breaks MS-SQL) - if (!counting) { + if (operation !== Operation.COUNT) { query = this.addSorting(query) } @@ -1738,13 +1718,11 @@ class SqlQueryBuilder extends SqlTableQueryBuilder { return {} } const input = this._query({ + operation: Operation.READ, datasource: json.datasource, + schema: json.schema, table: json.table, tables: json.tables, - endpoint: { - ...json.endpoint, - operation: Operation.READ, - }, resource: { fields: [] }, filters: json.extra?.idFilter, paginate: { limit: 1 }, diff --git a/packages/backend-core/src/sql/sqlTable.ts b/packages/backend-core/src/sql/sqlTable.ts index 5b76e155f9..8e15d3d4ef 100644 --- a/packages/backend-core/src/sql/sqlTable.ts +++ b/packages/backend-core/src/sql/sqlTable.ts @@ -239,14 +239,13 @@ class SqlTableQueryBuilder { * @return the operation that was found in the JSON. */ _operation(json: EnrichedQueryJson): Operation { - return json.endpoint.operation + return json.operation } _tableQuery(json: EnrichedQueryJson): SqlQuery | SqlQuery[] { let client = knex({ client: this.sqlClient }).schema - let schemaName = json?.endpoint?.schema - if (schemaName) { - client = client.withSchema(schemaName) + if (json?.schema) { + client = client.withSchema(json.schema) } let query: Knex.SchemaBuilder @@ -268,8 +267,8 @@ class SqlTableQueryBuilder { // renameColumn does not work for MySQL, so return a raw query if (this.sqlClient === SqlClient.MY_SQL && json.meta?.renamed) { const updatedColumn = json.meta.renamed.updated - const tableName = schemaName - ? `\`${schemaName}\`.\`${json.table.name}\`` + const tableName = json?.schema + ? `\`${json.schema}\`.\`${json.table.name}\`` : `\`${json.table.name}\`` return { sql: `alter table ${tableName} rename column \`${json.meta.renamed.old}\` to \`${updatedColumn}\`;`, @@ -290,8 +289,8 @@ class SqlTableQueryBuilder { if (this.sqlClient === SqlClient.MS_SQL && json.meta?.renamed) { const oldColumn = json.meta.renamed.old const updatedColumn = json.meta.renamed.updated - const tableName = schemaName - ? `${schemaName}.${json.table.name}` + const tableName = json?.schema + ? `${json.schema}.${json.table.name}` : `${json.table.name}` const sql = getNativeSql(query) if (Array.isArray(sql)) { diff --git a/packages/pro b/packages/pro index 6f38253253..49265a7430 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 6f38253253ee364aea636add990083ca5cda3bde +Subproject commit 49265a7430c590968ba65890a91dd398e5312941 diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 6492a651e1..0eeb38c78f 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -383,7 +383,7 @@ export class GoogleSheetsIntegration implements DatasourcePlus { async query(json: EnrichedQueryJson): Promise { const sheet = json.table.name - switch (json.endpoint.operation) { + switch (json.operation) { case Operation.CREATE: return this.create({ sheet, row: json.body as Row }) case Operation.BULK_CREATE: @@ -426,7 +426,7 @@ export class GoogleSheetsIntegration implements DatasourcePlus { return this.deleteTable(json?.table?.name) default: throw new Error( - `GSheets integration does not support "${json.endpoint.operation}".` + `GSheets integration does not support "${json.operation}".` ) } } diff --git a/packages/server/src/sdk/app/rows/search/internal/sqs.ts b/packages/server/src/sdk/app/rows/search/internal/sqs.ts index 9bfa0ecd27..19380bde43 100644 --- a/packages/server/src/sdk/app/rows/search/internal/sqs.ts +++ b/packages/server/src/sdk/app/rows/search/internal/sqs.ts @@ -231,7 +231,7 @@ async function runSqlQuery( tables.map(table => table._id!).concat(relationshipJunctionTableIds) ) if (opts?.countTotalRows) { - json.endpoint.operation = Operation.COUNT + json.operation = Operation.COUNT } const processSQLQuery = async (json: EnrichedQueryJson) => { const query = builder._query(json, { diff --git a/packages/server/src/sdk/app/rows/sqlAlias.ts b/packages/server/src/sdk/app/rows/sqlAlias.ts index 62e0db9aad..f3c3edc053 100644 --- a/packages/server/src/sdk/app/rows/sqlAlias.ts +++ b/packages/server/src/sdk/app/rows/sqlAlias.ts @@ -3,7 +3,6 @@ import { DatasourcePlusQueryResponse, EnrichedQueryJson, Operation, - QueryJson, Row, SearchFilters, SqlClient, @@ -69,13 +68,12 @@ export default class AliasTables { this.charSeq = new CharSequence() } - isAliasingEnabled(json: QueryJson, datasource?: Datasource) { - const operation = json.endpoint.operation + isAliasingEnabled(json: EnrichedQueryJson, datasource?: Datasource) { const fieldLength = json.resource?.fields?.length if ( !fieldLength || fieldLength <= 0 || - DISABLED_OPERATIONS.includes(operation) + DISABLED_OPERATIONS.includes(json.operation) ) { return false } @@ -85,7 +83,7 @@ export default class AliasTables { } try { const sqlClient = getSQLClient(datasource) - const isWrite = WRITE_OPERATIONS.includes(operation) + const isWrite = WRITE_OPERATIONS.includes(json.operation) const isDisabledClient = DISABLED_WRITE_CLIENTS.includes(sqlClient) if (isWrite && isDisabledClient) { return false diff --git a/packages/server/src/sdk/app/rows/utils.ts b/packages/server/src/sdk/app/rows/utils.ts index 977cdb9bd2..50170dd8bd 100644 --- a/packages/server/src/sdk/app/rows/utils.ts +++ b/packages/server/src/sdk/app/rows/utils.ts @@ -118,9 +118,11 @@ export async function enrichQueryJson( } return { + operation: json.endpoint.operation, table, tables, datasource, + schema: json.endpoint.schema, ...json, } } diff --git a/packages/types/src/sdk/search.ts b/packages/types/src/sdk/search.ts index e25390bdd0..fdc2fafe57 100644 --- a/packages/types/src/sdk/search.ts +++ b/packages/types/src/sdk/search.ts @@ -184,14 +184,12 @@ export interface QueryJson { tableAliases?: Record } -export interface EnrichedQueryJson extends QueryJson { +export interface EnrichedQueryJson extends Omit { + operation: Operation table: Table tables: Record datasource?: Datasource -} - -export interface QueryJsonRequest extends Omit { - endpoint: QueryJson["endpoint"] & { datasourceId: string; entityId: string } + schema?: string } export interface QueryOptions { From f6ad53f442c8a4c93f37d37339d959c3496f6f51 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:17:09 +0000 Subject: [PATCH 31/66] Follow-up PR to bigint fixes. --- .../server/src/api/controllers/datasource.ts | 2 -- .../server/src/integrations/base/query.ts | 34 +++++++++++++------ .../src/integrations/microsoftSqlServer.ts | 4 +-- packages/server/src/integrations/oracle.ts | 6 +--- .../src/integrations/tests/sqlAlias.spec.ts | 2 +- .../src/tests/utilities/api/datasource.ts | 1 - 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index 42d657cf6c..97cf8db299 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -23,13 +23,11 @@ import { Table, RowValue, DynamicVariable, - QueryJsonRequest, } from "@budibase/types" import sdk from "../../sdk" import { builderSocket } from "../../websockets" import { isEqual } from "lodash" import { processTable } from "../../sdk/app/tables/getters" -import { makeExternalQuery } from "../../integrations/base/query" export async function fetch(ctx: UserCtx) { ctx.body = await sdk.datasources.fetch() diff --git a/packages/server/src/integrations/base/query.ts b/packages/server/src/integrations/base/query.ts index 6555a5de51..2cbbbecc8d 100644 --- a/packages/server/src/integrations/base/query.ts +++ b/packages/server/src/integrations/base/query.ts @@ -1,27 +1,39 @@ -import { DatasourcePlusQueryResponse, QueryJson } from "@budibase/types" +import { + DatasourcePlusQueryResponse, + EnrichedQueryJson, + QueryJson, +} from "@budibase/types" import { getIntegration } from "../index" import sdk from "../../sdk" import { enrichQueryJson } from "../../sdk/app/rows/utils" +function isEnriched( + json: QueryJson | EnrichedQueryJson +): json is EnrichedQueryJson { + return "datasource" in json +} + export async function makeExternalQuery( - json: QueryJson + json: QueryJson | EnrichedQueryJson ): Promise { - const enrichedJson = await enrichQueryJson(json) - if (!enrichedJson.datasource) { + if (!isEnriched(json)) { + json = await enrichQueryJson(json) + if (json.datasource) { + json.datasource = await sdk.datasources.enrich(json.datasource) + } + } + + if (!json.datasource) { throw new Error("No datasource provided for external query") } - enrichedJson.datasource = await sdk.datasources.enrich( - enrichedJson.datasource - ) - - const Integration = await getIntegration(enrichedJson.datasource.source) + const Integration = await getIntegration(json.datasource.source) // query is the opinionated function if (!Integration.prototype.query) { throw "Datasource does not support query." } - const integration = new Integration(enrichedJson.datasource.config) - return integration.query(enrichedJson) + const integration = new Integration(json.datasource.config) + return integration.query(json) } diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index a7a0b53312..2fac306590 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -509,8 +509,8 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { async query(json: EnrichedQueryJson): Promise { const schema = this.config.schema await this.connect() - if (schema && schema !== DEFAULT_SCHEMA && json?.endpoint) { - json.endpoint.schema = schema + if (schema && schema !== DEFAULT_SCHEMA) { + json.schema = schema } const operation = this._operation(json) const queryFn = (query: any, op: string) => this.internalQuery(query, op) diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index ded21487f6..d8708d9053 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -572,11 +572,7 @@ class OracleIntegration extends Sql implements DatasourcePlus { return response.rows as Row[] } else { // get the last row that was updated - if ( - response.lastRowid && - json.endpoint?.entityId && - operation !== Operation.DELETE - ) { + if (response.lastRowid && operation !== Operation.DELETE) { const lastRow = await this.internalQuery({ sql: `SELECT * FROM "${json.table.name}" WHERE ROWID = '${response.lastRowid}'`, }) diff --git a/packages/server/src/integrations/tests/sqlAlias.spec.ts b/packages/server/src/integrations/tests/sqlAlias.spec.ts index 4de84f689e..0f43e41755 100644 --- a/packages/server/src/integrations/tests/sqlAlias.spec.ts +++ b/packages/server/src/integrations/tests/sqlAlias.spec.ts @@ -269,7 +269,7 @@ describe("Captures of real examples", () => { fields: string[] = ["a"] ): EnrichedQueryJson { return { - endpoint: { datasourceId: "", entityId: "", operation: op }, + operation: op, resource: { fields, }, diff --git a/packages/server/src/tests/utilities/api/datasource.ts b/packages/server/src/tests/utilities/api/datasource.ts index ebd1b9f7c7..0bc365661e 100644 --- a/packages/server/src/tests/utilities/api/datasource.ts +++ b/packages/server/src/tests/utilities/api/datasource.ts @@ -4,7 +4,6 @@ import { Datasource, FetchDatasourceInfoResponse, FieldType, - QueryJsonRequest, RelationshipType, UpdateDatasourceRequest, UpdateDatasourceResponse, From 69aa5efcd1aad9227bb7a3e8790add668516af85 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:23:18 +0000 Subject: [PATCH 32/66] Fix sqlAlias.spec.ts --- packages/server/src/api/routes/tests/search.spec.ts | 2 +- .../tests/sqlQueryJson/basicFetchWithRelationships.json | 6 +----- .../src/integrations/tests/sqlQueryJson/createSimple.json | 6 +----- .../tests/sqlQueryJson/createWithRelationships.json | 6 +----- .../src/integrations/tests/sqlQueryJson/deleteSimple.json | 6 +----- .../integrations/tests/sqlQueryJson/enrichRelationship.json | 6 +----- .../integrations/tests/sqlQueryJson/fetchManyToMany.json | 6 +----- .../tests/sqlQueryJson/filterByRelationship.json | 6 +----- .../tests/sqlQueryJson/manyRelationshipFilters.json | 6 +----- .../integrations/tests/sqlQueryJson/updateRelationship.json | 6 +----- .../src/integrations/tests/sqlQueryJson/updateSimple.json | 6 +----- 11 files changed, 11 insertions(+), 51 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 5384444067..6a56ec37c6 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -3329,7 +3329,7 @@ if (descriptions.length) { }) isSql && - describe("primaryDisplay", () => { + describe.only("primaryDisplay", () => { beforeAll(async () => { let toRelateTableId = await createTable({ name: { diff --git a/packages/server/src/integrations/tests/sqlQueryJson/basicFetchWithRelationships.json b/packages/server/src/integrations/tests/sqlQueryJson/basicFetchWithRelationships.json index 27d6efec29..c61d66d684 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/basicFetchWithRelationships.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/basicFetchWithRelationships.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "persons", - "operation": "READ" - }, + "operation": "READ", "resource": { "fields": [ "a.year", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/createSimple.json b/packages/server/src/integrations/tests/sqlQueryJson/createSimple.json index 474be32cf2..ac487e4e90 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/createSimple.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/createSimple.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_0ed5835e5552496285df546030f7c4ae", - "entityId": "people", - "operation": "CREATE" - }, + "operation": "CREATE", "resource": { "fields": ["a.name", "a.age"] }, diff --git a/packages/server/src/integrations/tests/sqlQueryJson/createWithRelationships.json b/packages/server/src/integrations/tests/sqlQueryJson/createWithRelationships.json index 060197dd01..571fbcf4ac 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/createWithRelationships.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/createWithRelationships.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "persons", - "operation": "CREATE" - }, + "operation": "CREATE", "resource": { "fields": [ "a.year", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/deleteSimple.json b/packages/server/src/integrations/tests/sqlQueryJson/deleteSimple.json index d9fc34165f..4a73fc2e8b 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/deleteSimple.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/deleteSimple.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "compositetable", - "operation": "DELETE" - }, + "operation": "DELETE", "resource": { "fields": ["a.keyparttwo", "a.keypartone", "a.name"] }, diff --git a/packages/server/src/integrations/tests/sqlQueryJson/enrichRelationship.json b/packages/server/src/integrations/tests/sqlQueryJson/enrichRelationship.json index f24b46859f..3972982168 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/enrichRelationship.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/enrichRelationship.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_44a967caf37a435f84fe01cd6dfe8f81", - "entityId": "tasks", - "operation": "READ" - }, + "operation": "READ", "resource": { "fields": [ "a.executorid", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/fetchManyToMany.json b/packages/server/src/integrations/tests/sqlQueryJson/fetchManyToMany.json index b746e05c5e..55ddde917f 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/fetchManyToMany.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/fetchManyToMany.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_44a967caf37a435f84fe01cd6dfe8f81", - "entityId": "products", - "operation": "READ" - }, + "operation": "READ", "resource": { "fields": [ "a.productname", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/filterByRelationship.json b/packages/server/src/integrations/tests/sqlQueryJson/filterByRelationship.json index 6a9717f5dd..6930c900a2 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/filterByRelationship.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/filterByRelationship.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "products", - "operation": "READ" - }, + "operation": "READ", "resource": { "fields": [ "a.productname", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/manyRelationshipFilters.json b/packages/server/src/integrations/tests/sqlQueryJson/manyRelationshipFilters.json index 23f56796a9..5f5ebb95f3 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/manyRelationshipFilters.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/manyRelationshipFilters.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_44a967caf37a435f84fe01cd6dfe8f81", - "entityId": "tasks", - "operation": "READ" - }, + "operation": "READ", "resource": { "fields": [ "a.executorid", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/updateRelationship.json b/packages/server/src/integrations/tests/sqlQueryJson/updateRelationship.json index 8171e22c64..59a978904f 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/updateRelationship.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/updateRelationship.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "persons", - "operation": "UPDATE" - }, + "operation": "UPDATE", "resource": { "fields": [ "a.year", diff --git a/packages/server/src/integrations/tests/sqlQueryJson/updateSimple.json b/packages/server/src/integrations/tests/sqlQueryJson/updateSimple.json index 8171e22c64..59a978904f 100644 --- a/packages/server/src/integrations/tests/sqlQueryJson/updateSimple.json +++ b/packages/server/src/integrations/tests/sqlQueryJson/updateSimple.json @@ -1,9 +1,5 @@ { - "endpoint": { - "datasourceId": "datasource_plus_8066e56456784eb2a00129d31be5c3e7", - "entityId": "persons", - "operation": "UPDATE" - }, + "operation": "UPDATE", "resource": { "fields": [ "a.year", From 29a6a6683ba9916c5326f47e7462c74a4e88c63f Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:34:52 +0000 Subject: [PATCH 33/66] Fix link. --- packages/server/src/api/routes/datasource.ts | 5 +---- .../src/api/routes/tests/queries/generic-sql.spec.ts | 8 +------- packages/server/src/api/routes/tests/search.spec.ts | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/server/src/api/routes/datasource.ts b/packages/server/src/api/routes/datasource.ts index 22f9a77cc9..9ec792632a 100644 --- a/packages/server/src/api/routes/datasource.ts +++ b/packages/server/src/api/routes/datasource.ts @@ -2,10 +2,7 @@ import Router from "@koa/router" import * as datasourceController from "../controllers/datasource" import authorized from "../../middleware/authorized" import { permissions } from "@budibase/backend-core" -import { - datasourceValidator, - datasourceQueryValidator, -} from "./utils/validators" +import { datasourceValidator } from "./utils/validators" const router: Router = new Router() diff --git a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts index 001f4890fd..e7ddc0df22 100644 --- a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts +++ b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts @@ -1,10 +1,4 @@ -import { - Datasource, - Operation, - Query, - QueryPreview, - TableSourceType, -} from "@budibase/types" +import { Datasource, Query, QueryPreview } from "@budibase/types" import { DatabaseName, datasourceDescribe, diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 6a56ec37c6..5384444067 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -3329,7 +3329,7 @@ if (descriptions.length) { }) isSql && - describe.only("primaryDisplay", () => { + describe("primaryDisplay", () => { beforeAll(async () => { let toRelateTableId = await createTable({ name: { From 00dc5d60a2df119dbd834a390bc7fb71198a5b69 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:35:36 +0000 Subject: [PATCH 34/66] Update pro reference. --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 49265a7430..aa6517bfbc 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 49265a7430c590968ba65890a91dd398e5312941 +Subproject commit aa6517bfbc463b3aac4ae53245dcce3d8bb130e4 From f91d442ad46169b2f97856263dfc98f4a591eee3 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 16:48:28 +0000 Subject: [PATCH 35/66] Remove exited containers when running tests. --- .../core/utilities/testContainerUtils.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index 71d7fa32db..727b290183 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -25,7 +25,7 @@ function getTestcontainers(): ContainerInfo[] { // We use --format json to make sure the output is nice and machine-readable, // and we use --no-trunc so that the command returns full container IDs so we // can filter on them correctly. - return execSync("docker ps --format json --no-trunc") + return execSync("docker ps --all --format json --no-trunc") .toString() .split("\n") .filter(x => x.length > 0) @@ -37,6 +37,10 @@ function getTestcontainers(): ContainerInfo[] { ) } +function removeContainer(container: ContainerInfo) { + execSync(`docker rm ${container.ID}`) +} + export function getContainerByImage(image: string) { const containers = getTestcontainers().filter(x => x.Image.startsWith(image)) if (containers.length > 1) { @@ -49,6 +53,10 @@ export function getContainerByImage(image: string) { return containers[0] } +function getContainerByName(name: string) { + return getTestcontainers().find(x => x.Names === name) +} + export function getContainerById(id: string) { return getTestcontainers().find(x => x.ID === id) } @@ -116,6 +124,16 @@ export async function startContainer(container: GenericContainer) { key = imageName.split("@")[0] } key = key.replace(/\//g, "-").replace(/:/g, "-") + const name = `${key}_testcontainer` + + // If a container has died it hangs around and future attempts to start a + // container with the same name will fail. What we do here is if we find a + // matching container and it has exited, we remove it before carrying on. This + // removes the need to do this removal manually. + const existingContainer = getContainerByName(name) + if (existingContainer?.State === "exited") { + removeContainer(existingContainer) + } container = container .withReuse() From 3cf2dbe37ce40c0cab4b9f3ffde523bbd6802db1 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 17:16:23 +0000 Subject: [PATCH 36/66] Make sure we're always using the current docker context. --- globalSetup.ts | 28 +++++++++++++++++++ .../core/utilities/testContainerUtils.ts | 27 ++++++++++++++++++ .../src/api/routes/tests/search.spec.ts | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/globalSetup.ts b/globalSetup.ts index 07a0cec5e2..9ebda5626d 100644 --- a/globalSetup.ts +++ b/globalSetup.ts @@ -6,6 +6,26 @@ import { import { ContainerInfo } from "dockerode" import path from "path" import lockfile from "proper-lockfile" +import { execSync } from "child_process" + +interface DockerContext { + Name: string + Description: string + DockerEndpoint: string + ContextType: string + Error: string +} + +function getCurrentDockerContext(): DockerContext { + const out = execSync("docker context ls --format json") + for (const line of out.toString().split("\n")) { + const parsed = JSON.parse(line) + if (parsed.Current) { + return parsed as DockerContext + } + } + throw new Error("No current Docker context") +} async function getBudibaseContainers() { const client = await getContainerRuntimeClient() @@ -27,6 +47,14 @@ async function killContainers(containers: ContainerInfo[]) { } export default async function setup() { + // For whatever reason, testcontainers doesn't always use the correct current + // docker context. This bit of code forces the issue by finding the current + // context and setting it as the DOCKER_HOST environment + if (!process.env.DOCKER_HOST) { + const dockerContext = getCurrentDockerContext() + process.env.DOCKER_HOST = dockerContext.DockerEndpoint + } + const lockPath = path.resolve(__dirname, "globalSetup.ts") // If you run multiple tests at the same time, it's possible for the CouchDB // shared container to get started multiple times despite having an diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index 727b290183..339656cf09 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -78,7 +78,34 @@ export function getExposedV4Port(container: ContainerInfo, port: number) { return getExposedV4Ports(container).find(x => x.container === port)?.host } +interface DockerContext { + Name: string + Description: string + DockerEndpoint: string + ContextType: string + Error: string +} + +function getCurrentDockerContext(): DockerContext { + const out = execSync("docker context ls --format json") + for (const line of out.toString().split("\n")) { + const parsed = JSON.parse(line) + if (parsed.Current) { + return parsed as DockerContext + } + } + throw new Error("No current Docker context") +} + export function setupEnv(...envs: any[]) { + // For whatever reason, testcontainers doesn't always use the correct current + // docker context. This bit of code forces the issue by finding the current + // context and setting it as the DOCKER_HOST environment + if (!process.env.DOCKER_HOST) { + const dockerContext = getCurrentDockerContext() + process.env.DOCKER_HOST = dockerContext.DockerEndpoint + } + // We start couchdb in globalSetup.ts, in the root of the monorepo, so it // should be relatively safe to look for it by its image name. const couch = getContainerByImage("budibase/couchdb") diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 5384444067..6a56ec37c6 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -3329,7 +3329,7 @@ if (descriptions.length) { }) isSql && - describe("primaryDisplay", () => { + describe.only("primaryDisplay", () => { beforeAll(async () => { let toRelateTableId = await createTable({ name: { From 3bff9f2e551005a98a6448d4faeacde1509fa425 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 17:23:16 +0000 Subject: [PATCH 37/66] Unfocus test. --- packages/server/src/api/routes/tests/search.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 6a56ec37c6..5384444067 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -3329,7 +3329,7 @@ if (descriptions.length) { }) isSql && - describe.only("primaryDisplay", () => { + describe("primaryDisplay", () => { beforeAll(async () => { let toRelateTableId = await createTable({ name: { From 4f915f45225b1d30ddaba1924c576a7846e492c4 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 28 Nov 2024 17:37:40 +0000 Subject: [PATCH 38/66] Update pro reference. --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index abdfb720c5..d9245f3d6d 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit abdfb720c5583256e0334330ccbea1abcbe3d434 +Subproject commit d9245f3d6d0b41ec2e6b3406b791f9e7448882cb From 9982b5d9076e3a837ec155d4bb94e74712151abf Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 10:57:15 +0100 Subject: [PATCH 39/66] Change bbui dependencies from rollup to vite --- packages/bbui/package.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index aeb7418526..02cb81c2c4 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -14,17 +14,12 @@ "./spectrum-icons-vite.js": "./src/spectrum-icons-vite.js" }, "scripts": { - "build": "rollup -c" + "build": "vite build" }, "devDependencies": { - "@rollup/plugin-commonjs": "^16.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^11.2.1", + "@sveltejs/vite-plugin-svelte": "1.4.0", "postcss": "^8.2.9", - "rollup": "^2.45.2", - "rollup-plugin-postcss": "^4.0.0", - "rollup-plugin-svelte": "^7.1.0", - "rollup-plugin-terser": "^7.0.2" + "vite-plugin-commonjs": "^0.10.4" }, "keywords": [ "svelte" From f8855bb0c103eb9be492a6e3a42d4bd2b1abc084 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 10:59:34 +0100 Subject: [PATCH 40/66] Replace rollup.config for vite.config --- packages/bbui/rollup.config.js | 32 -------------------------------- packages/bbui/vite.config.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 32 deletions(-) delete mode 100644 packages/bbui/rollup.config.js create mode 100644 packages/bbui/vite.config.js diff --git a/packages/bbui/rollup.config.js b/packages/bbui/rollup.config.js deleted file mode 100644 index da274e0ba5..0000000000 --- a/packages/bbui/rollup.config.js +++ /dev/null @@ -1,32 +0,0 @@ -import svelte from "rollup-plugin-svelte" -import resolve from "@rollup/plugin-node-resolve" -import commonjs from "@rollup/plugin-commonjs" -import json from "@rollup/plugin-json" -import { terser } from "rollup-plugin-terser" -import postcss from "rollup-plugin-postcss" - -export default { - input: "src/index.js", - output: { - sourcemap: true, - format: "esm", - file: "dist/bbui.es.js", - }, - onwarn(warning, warn) { - // suppress eval warnings - if (warning.code === "EVAL") { - return - } - warn(warning) - }, - plugins: [ - resolve(), - commonjs(), - svelte({ - emitCss: true, - }), - postcss(), - terser(), - json(), - ], -} diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js new file mode 100644 index 0000000000..3d8afe8c07 --- /dev/null +++ b/packages/bbui/vite.config.js @@ -0,0 +1,29 @@ +import { defineConfig } from "vite" +import { svelte } from "@sveltejs/vite-plugin-svelte" +import postcss from "postcss" + +export default defineConfig({ + // https://vite.dev/guide/dep-pre-bundling#monorepos-and-linked-dependencies + optimizeDeps: { + include: ["shared-core"], + }, + build: { + sourcemap: true, + lib: { + entry: "src/index.js", + formats: ["es"], + fileName: "bbui.es", + }, + commonjsOptions: { + include: [/shared-core/, /node_modules/], + }, + }, + plugins: [ + svelte({ + emitCss: true, + }), + ], + css: { + postcss, + }, +}) From dee85857f9d1ba1e88324400c9e8b5d5b758eee8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 11:12:39 +0100 Subject: [PATCH 41/66] bbui use alias instead of packages --- packages/bbui/vite.config.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index 3d8afe8c07..4c7da1c43e 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -1,12 +1,9 @@ import { defineConfig } from "vite" import { svelte } from "@sveltejs/vite-plugin-svelte" import postcss from "postcss" +import path from "path" export default defineConfig({ - // https://vite.dev/guide/dep-pre-bundling#monorepos-and-linked-dependencies - optimizeDeps: { - include: ["shared-core"], - }, build: { sourcemap: true, lib: { @@ -14,9 +11,6 @@ export default defineConfig({ formats: ["es"], fileName: "bbui.es", }, - commonjsOptions: { - include: [/shared-core/, /node_modules/], - }, }, plugins: [ svelte({ @@ -26,4 +20,10 @@ export default defineConfig({ css: { postcss, }, + resolve: { + alias: { + "@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"), + "@budibase/types": path.resolve(__dirname, "../types/src"), + }, + }, }) From 18cd0169d848f0a46be732efe9b31f6737ec4d8f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 11:37:51 +0100 Subject: [PATCH 42/66] Remove unused nx dependency --- packages/bbui/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 02cb81c2c4..28f2dfce13 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -91,8 +91,7 @@ "dependsOn": [ { "projects": [ - "@budibase/string-templates", - "@budibase/shared-core" + "@budibase/string-templates" ], "target": "build" } From a73165470e5ad3c93480829662dbe8d8a318d6ac Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 10:31:44 +0100 Subject: [PATCH 43/66] Only build sourcemap for !prod --- packages/bbui/vite.config.js | 45 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index 4c7da1c43e..b8a997dc4d 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -3,27 +3,30 @@ import { svelte } from "@sveltejs/vite-plugin-svelte" import postcss from "postcss" import path from "path" -export default defineConfig({ - build: { - sourcemap: true, - lib: { - entry: "src/index.js", - formats: ["es"], - fileName: "bbui.es", +export default defineConfig(({ mode }) => { + const isProduction = mode === "production" + return { + build: { + sourcemap: !isProduction, + lib: { + entry: "src/index.js", + formats: ["es"], + fileName: "bbui.es", + }, }, - }, - plugins: [ - svelte({ - emitCss: true, - }), - ], - css: { - postcss, - }, - resolve: { - alias: { - "@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"), - "@budibase/types": path.resolve(__dirname, "../types/src"), + plugins: [ + svelte({ + emitCss: true, + }), + ], + css: { + postcss, }, - }, + resolve: { + alias: { + "@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"), + "@budibase/types": path.resolve(__dirname, "../types/src"), + }, + }, + } }) From a7c2dd8171f880950dc3df6866cdfc13341a316f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 10:36:13 +0100 Subject: [PATCH 44/66] Clean unused post-css --- packages/bbui/package.json | 4 +--- packages/bbui/vite.config.js | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 28f2dfce13..1720cc7ca8 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -17,9 +17,7 @@ "build": "vite build" }, "devDependencies": { - "@sveltejs/vite-plugin-svelte": "1.4.0", - "postcss": "^8.2.9", - "vite-plugin-commonjs": "^0.10.4" + "@sveltejs/vite-plugin-svelte": "1.4.0" }, "keywords": [ "svelte" diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index b8a997dc4d..a084b16262 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -1,6 +1,5 @@ import { defineConfig } from "vite" import { svelte } from "@sveltejs/vite-plugin-svelte" -import postcss from "postcss" import path from "path" export default defineConfig(({ mode }) => { @@ -19,9 +18,6 @@ export default defineConfig(({ mode }) => { emitCss: true, }), ], - css: { - postcss, - }, resolve: { alias: { "@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"), From 687afc61ad823c13f627cd07c0bac9994a7f6938 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 09:35:02 +0100 Subject: [PATCH 45/66] Update yarn.lock --- yarn.lock | 586 ++---------------------------------------------------- 1 file changed, 12 insertions(+), 574 deletions(-) diff --git a/yarn.lock b/yarn.lock index f52cdc79a5..6bc709e45d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4024,19 +4024,6 @@ resolved "https://registry.yarnpkg.com/@redis/time-series/-/time-series-1.0.4.tgz#af85eb080f6934580e4d3b58046026b6c2b18717" integrity sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng== -"@rollup/plugin-commonjs@^16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz#169004d56cd0f0a1d0f35915d31a036b0efe281f" - integrity sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - "@rollup/plugin-commonjs@^17.1.0": version "17.1.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d" @@ -4078,18 +4065,6 @@ dependencies: "@rollup/pluginutils" "^3.0.8" -"@rollup/plugin-node-resolve@^11.2.1": - version "11.2.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" - integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.19.0" - "@rollup/plugin-node-resolve@^15.2.3": version "15.2.3" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" @@ -4136,14 +4111,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@rollup/pluginutils@^4.1.0": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" - integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== - dependencies: - estree-walker "^2.0.1" - picomatch "^2.2.2" - "@rollup/pluginutils@^5.0.1": version "5.0.2" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz#012b8f53c71e4f6f9cb317e311df1404f56e7a33" @@ -5301,11 +5268,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@trysound/sax@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" - integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -6064,13 +6026,6 @@ dependencies: "@types/node" "*" -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - "@types/resolve@1.20.2": version "1.20.2" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" @@ -7608,11 +7563,6 @@ bn.js@^5.0.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== - boolean@^3.0.1: version "3.2.0" resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.2.0.tgz#9e5294af4e98314494cbb17979fa54ca159f116b" @@ -7738,7 +7688,7 @@ browserify-sign@^4.0.0: readable-stream "^2.3.8" safe-buffer "^5.2.1" -browserslist@^4.0.0, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.21.5: +browserslist@^4.21.3, browserslist@^4.21.5: version "4.21.5" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== @@ -8041,17 +7991,7 @@ camelcase@^6.2.0, camelcase@^6.3.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-api@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" - integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== - dependencies: - browserslist "^4.0.0" - caniuse-lite "^1.0.0" - lodash.memoize "^4.1.2" - lodash.uniq "^4.5.0" - -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449: +caniuse-lite@^1.0.30001449: version "1.0.30001460" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001460.tgz#31d2e26f0a2309860ed3eff154e03890d9d851a7" integrity sha512-Bud7abqjvEjipUkpLs4D7gR0l8hBYBHoa+tGtKJHvT2AYzLp1z7EmVkUT4ERpVUfca8S2HGIVs883D8pUH1ZzQ== @@ -8414,11 +8354,6 @@ color@^3.1.3: color-convert "^1.9.3" color-string "^1.6.0" -colord@^2.9.1: - version "2.9.3" - resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" - integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== - colorette@2.0.19, colorette@^2.0.7: version "2.0.19" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" @@ -8573,13 +8508,6 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -concat-with-sourcemaps@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" - integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== - dependencies: - source-map "^0.6.1" - condense-newlines@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f" @@ -8982,30 +8910,6 @@ crypto-randomuuid@^1.0.0: resolved "https://registry.yarnpkg.com/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz#acf583e5e085e867ae23e107ff70279024f9e9e7" integrity sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA== -css-declaration-sorter@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.3.1.tgz#be5e1d71b7a992433fb1c542c7a1b835e45682ec" - integrity sha512-fBffmak0bPAnyqc/HO8C3n2sHrp9wcqQz6ES9koRF2/mLOVAx9zIQ3Y7R29sYCteTPqMCwns4WYQoCX91Xl3+w== - -css-select@^4.1.3: - version "4.3.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" - integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== - dependencies: - boolbase "^1.0.0" - css-what "^6.0.1" - domhandler "^4.3.1" - domutils "^2.8.0" - nth-check "^2.0.1" - -css-tree@^1.1.2, css-tree@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" - integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== - dependencies: - mdn-data "2.0.14" - source-map "^0.6.1" - css-tree@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20" @@ -9014,11 +8918,6 @@ css-tree@^2.3.1: mdn-data "2.0.30" source-map-js "^1.0.1" -css-what@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - css.escape@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" @@ -9029,62 +8928,6 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^5.2.14: - version "5.2.14" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.2.14.tgz#309def4f7b7e16d71ab2438052093330d9ab45d8" - integrity sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A== - dependencies: - css-declaration-sorter "^6.3.1" - cssnano-utils "^3.1.0" - postcss-calc "^8.2.3" - postcss-colormin "^5.3.1" - postcss-convert-values "^5.1.3" - postcss-discard-comments "^5.1.2" - postcss-discard-duplicates "^5.1.0" - postcss-discard-empty "^5.1.1" - postcss-discard-overridden "^5.1.0" - postcss-merge-longhand "^5.1.7" - postcss-merge-rules "^5.1.4" - postcss-minify-font-values "^5.1.0" - postcss-minify-gradients "^5.1.1" - postcss-minify-params "^5.1.4" - postcss-minify-selectors "^5.2.1" - postcss-normalize-charset "^5.1.0" - postcss-normalize-display-values "^5.1.0" - postcss-normalize-positions "^5.1.1" - postcss-normalize-repeat-style "^5.1.1" - postcss-normalize-string "^5.1.0" - postcss-normalize-timing-functions "^5.1.0" - postcss-normalize-unicode "^5.1.1" - postcss-normalize-url "^5.1.0" - postcss-normalize-whitespace "^5.1.1" - postcss-ordered-values "^5.1.3" - postcss-reduce-initial "^5.1.2" - postcss-reduce-transforms "^5.1.0" - postcss-svgo "^5.1.0" - postcss-unique-selectors "^5.1.1" - -cssnano-utils@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-3.1.0.tgz#95684d08c91511edfc70d2636338ca37ef3a6861" - integrity sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA== - -cssnano@^5.0.1: - version "5.1.15" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.15.tgz#ded66b5480d5127fcb44dac12ea5a983755136bf" - integrity sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw== - dependencies: - cssnano-preset-default "^5.2.14" - lilconfig "^2.0.3" - yaml "^1.10.2" - -csso@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529" - integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA== - dependencies: - css-tree "^1.1.2" - cssom@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" @@ -9924,15 +9767,6 @@ dom-accessibility-api@^0.6.3: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== -dom-serializer@^1.0.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" - integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.0" - entities "^2.0.0" - dom-serializer@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" @@ -9947,7 +9781,7 @@ dom-walk@^0.1.0: resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== -domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: +domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== @@ -9966,13 +9800,6 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" -domhandler@^4.2.0, domhandler@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" - integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== - dependencies: - domelementtype "^2.2.0" - domhandler@^5.0.1, domhandler@^5.0.2: version "5.0.3" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" @@ -9980,15 +9807,6 @@ domhandler@^5.0.1, domhandler@^5.0.2: dependencies: domelementtype "^2.3.0" -domutils@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" - integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - domutils@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c" @@ -10276,11 +10094,6 @@ enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" -entities@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" - integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== - entities@^4.2.0, entities@^4.3.0, entities@^4.4.0, entities@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" @@ -11577,13 +11390,6 @@ generate-function@^2.3.1: dependencies: is-property "^1.0.2" -generic-names@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-4.0.0.tgz#0bd8a2fd23fe8ea16cbd0a279acd69c06933d9a3" - integrity sha512-ySFolZQfw9FoDb3ed9d80Cm9f0+r7qj+HJkWjeD9RBfpxEVTlVhol+gvaQB/78WbwYfbnNh8nWHHBSlg072y6A== - dependencies: - loader-utils "^3.2.0" - generic-pool@3.9.0, generic-pool@^3.8.2: version "3.9.0" resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.9.0.tgz#36f4a678e963f4fdb8707eab050823abc4e8f5e4" @@ -12548,16 +12354,6 @@ iconv-lite@0.6.3, iconv-lite@^0.6.2, iconv-lite@^0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -icss-replace-symbols@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" - integrity sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg== - -icss-utils@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" - integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== - idb-wrapper@^1.5.0: version "1.7.2" resolved "https://registry.yarnpkg.com/idb-wrapper/-/idb-wrapper-1.7.2.tgz#8251afd5e77fe95568b1c16152eb44b396767ea2" @@ -12621,13 +12417,6 @@ immediate@~3.0.5: resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== -import-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" - integrity sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg== - dependencies: - import-from "^3.0.0" - import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -12636,13 +12425,6 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-from/-/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966" - integrity sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== - dependencies: - resolve-from "^5.0.0" - import-in-the-middle@1.11.2: version "1.11.2" resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.11.2.tgz#dd848e72b63ca6cd7c34df8b8d97fc9baee6174f" @@ -14838,7 +14620,7 @@ lie@3.1.1: dependencies: immediate "~3.0.5" -lilconfig@^2.0.3, lilconfig@^2.0.5: +lilconfig@^2.0.5: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== @@ -14878,11 +14660,6 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" -loader-utils@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576" - integrity sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw== - local-pkg@^0.4.2: version "0.4.3" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" @@ -15013,7 +14790,7 @@ lodash.keys@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-4.2.0.tgz#a08602ac12e4fb83f91fc1fb7a360a4d9ba35205" integrity sha512-J79MkJcp7Df5mizHiVNpjoHXLi4HLjh9VLS/M7lQSGoQ+0oQ+lWEigREkqKyizPB1IawvQLLKY8mzEcm1tkyxQ== -lodash.memoize@4.x, lodash.memoize@^4.1.2: +lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== @@ -15048,11 +14825,6 @@ lodash.union@^4.6.0: resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" integrity sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw== -lodash.uniq@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" - integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== - lodash.without@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" @@ -15370,11 +15142,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -mdn-data@2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" - integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== - mdn-data@2.0.30: version "2.0.30" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc" @@ -16207,11 +15974,6 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - notepack.io@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/notepack.io/-/notepack.io-3.0.1.tgz#2c2c9de1bd4e64a79d34e33c413081302a0d4019" @@ -16341,13 +16103,6 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - dependencies: - boolbase "^1.0.0" - nunjucks@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/nunjucks/-/nunjucks-3.2.4.tgz#f0878eef528ce7b0aa35d67cc6898635fd74649e" @@ -16861,7 +16616,7 @@ p-pipe@3.1.0: resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-3.1.0.tgz#48b57c922aa2e1af6a6404cb7c6bf0eb9cc8e60e" integrity sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw== -p-queue@6.6.2, p-queue@^6.6.2: +p-queue@6.6.2: version "6.6.2" resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== @@ -17317,7 +17072,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatc resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pify@5.0.0, pify@^5.0.0: +pify@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== @@ -17509,53 +17264,7 @@ possible-typed-array-names@^1.0.0: resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== -postcss-calc@^8.2.3: - version "8.2.4" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.2.4.tgz#77b9c29bfcbe8a07ff6693dc87050828889739a5" - integrity sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q== - dependencies: - postcss-selector-parser "^6.0.9" - postcss-value-parser "^4.2.0" - -postcss-colormin@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.3.1.tgz#86c27c26ed6ba00d96c79e08f3ffb418d1d1988f" - integrity sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - colord "^2.9.1" - postcss-value-parser "^4.2.0" - -postcss-convert-values@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.1.3.tgz#04998bb9ba6b65aa31035d669a6af342c5f9d393" - integrity sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA== - dependencies: - browserslist "^4.21.4" - postcss-value-parser "^4.2.0" - -postcss-discard-comments@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz#8df5e81d2925af2780075840c1526f0660e53696" - integrity sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ== - -postcss-discard-duplicates@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz#9eb4fe8456706a4eebd6d3b7b777d07bad03e848" - integrity sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw== - -postcss-discard-empty@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz#e57762343ff7f503fe53fca553d18d7f0c369c6c" - integrity sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A== - -postcss-discard-overridden@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz#7e8c5b53325747e9d90131bb88635282fb4a276e" - integrity sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw== - -postcss-load-config@^3.0.0, postcss-load-config@^3.1.4: +postcss-load-config@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== @@ -17563,184 +17272,6 @@ postcss-load-config@^3.0.0, postcss-load-config@^3.1.4: lilconfig "^2.0.5" yaml "^1.10.2" -postcss-merge-longhand@^5.1.7: - version "5.1.7" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz#24a1bdf402d9ef0e70f568f39bdc0344d568fb16" - integrity sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ== - dependencies: - postcss-value-parser "^4.2.0" - stylehacks "^5.1.1" - -postcss-merge-rules@^5.1.4: - version "5.1.4" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.1.4.tgz#2f26fa5cacb75b1402e213789f6766ae5e40313c" - integrity sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - cssnano-utils "^3.1.0" - postcss-selector-parser "^6.0.5" - -postcss-minify-font-values@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz#f1df0014a726083d260d3bd85d7385fb89d1f01b" - integrity sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-minify-gradients@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz#f1fe1b4f498134a5068240c2f25d46fcd236ba2c" - integrity sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw== - dependencies: - colord "^2.9.1" - cssnano-utils "^3.1.0" - postcss-value-parser "^4.2.0" - -postcss-minify-params@^5.1.4: - version "5.1.4" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.1.4.tgz#c06a6c787128b3208b38c9364cfc40c8aa5d7352" - integrity sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw== - dependencies: - browserslist "^4.21.4" - cssnano-utils "^3.1.0" - postcss-value-parser "^4.2.0" - -postcss-minify-selectors@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz#d4e7e6b46147b8117ea9325a915a801d5fe656c6" - integrity sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg== - dependencies: - postcss-selector-parser "^6.0.5" - -postcss-modules-extract-imports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" - integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== - -postcss-modules-local-by-default@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" - integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== - dependencies: - icss-utils "^5.0.0" - postcss-selector-parser "^6.0.2" - postcss-value-parser "^4.1.0" - -postcss-modules-scope@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" - integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== - dependencies: - postcss-selector-parser "^6.0.4" - -postcss-modules-values@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" - integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== - dependencies: - icss-utils "^5.0.0" - -postcss-modules@^4.0.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/postcss-modules/-/postcss-modules-4.3.1.tgz#517c06c09eab07d133ae0effca2c510abba18048" - integrity sha512-ItUhSUxBBdNamkT3KzIZwYNNRFKmkJrofvC2nWab3CPKhYBQ1f27XXh1PAPE27Psx58jeelPsxWB/+og+KEH0Q== - dependencies: - generic-names "^4.0.0" - icss-replace-symbols "^1.1.0" - lodash.camelcase "^4.3.0" - postcss-modules-extract-imports "^3.0.0" - postcss-modules-local-by-default "^4.0.0" - postcss-modules-scope "^3.0.0" - postcss-modules-values "^4.0.0" - string-hash "^1.1.1" - -postcss-normalize-charset@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz#9302de0b29094b52c259e9b2cf8dc0879879f0ed" - integrity sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg== - -postcss-normalize-display-values@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz#72abbae58081960e9edd7200fcf21ab8325c3da8" - integrity sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-positions@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz#ef97279d894087b59325b45c47f1e863daefbb92" - integrity sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-repeat-style@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz#e9eb96805204f4766df66fd09ed2e13545420fb2" - integrity sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-string@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz#411961169e07308c82c1f8c55f3e8a337757e228" - integrity sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-timing-functions@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz#d5614410f8f0b2388e9f240aa6011ba6f52dafbb" - integrity sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-normalize-unicode@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz#f67297fca3fea7f17e0d2caa40769afc487aa030" - integrity sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA== - dependencies: - browserslist "^4.21.4" - postcss-value-parser "^4.2.0" - -postcss-normalize-url@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz#ed9d88ca82e21abef99f743457d3729a042adcdc" - integrity sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew== - dependencies: - normalize-url "^6.0.1" - postcss-value-parser "^4.2.0" - -postcss-normalize-whitespace@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz#08a1a0d1ffa17a7cc6efe1e6c9da969cc4493cfa" - integrity sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA== - dependencies: - postcss-value-parser "^4.2.0" - -postcss-ordered-values@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz#b6fd2bd10f937b23d86bc829c69e7732ce76ea38" - integrity sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ== - dependencies: - cssnano-utils "^3.1.0" - postcss-value-parser "^4.2.0" - -postcss-reduce-initial@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.1.2.tgz#798cd77b3e033eae7105c18c9d371d989e1382d6" - integrity sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg== - dependencies: - browserslist "^4.21.4" - caniuse-api "^3.0.0" - -postcss-reduce-transforms@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz#333b70e7758b802f3dd0ddfe98bb1ccfef96b6e9" - integrity sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ== - dependencies: - postcss-value-parser "^4.2.0" - postcss-safe-parser@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" @@ -17751,7 +17282,7 @@ postcss-scss@^4.0.8: resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== -postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: +postcss-selector-parser@^6.0.11: version "6.0.13" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== @@ -17759,26 +17290,6 @@ postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.2, postcss-selecto cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-svgo@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.1.0.tgz#0a317400ced789f233a28826e77523f15857d80d" - integrity sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA== - dependencies: - postcss-value-parser "^4.2.0" - svgo "^2.7.0" - -postcss-unique-selectors@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz#a9f273d1eacd09e9aa6088f4b0507b18b1b541b6" - integrity sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA== - dependencies: - postcss-selector-parser "^6.0.5" - -postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - postcss-values-parser@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" @@ -17797,7 +17308,7 @@ postcss-values-parser@^6.0.2: is-url-superb "^4.0.0" quote-unquote "^1.0.0" -postcss@^8.1.7, postcss@^8.2.9, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.29, postcss@^8.4.5: +postcss@^8.1.7, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.29, postcss@^8.4.5: version "8.4.41" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== @@ -18283,11 +17794,6 @@ promise-retry@^2.0.1: err-code "^2.0.2" retry "^0.12.0" -promise.series@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/promise.series/-/promise.series-0.2.0.tgz#2cc7ebe959fc3a6619c04ab4dbdc9e452d864bbd" - integrity sha512-VWQJyU2bcDTgZw8kpfBpB/ejZASlCrzwz5f2hjb/zlujOEB4oeiAhHygAWq8ubsX2GVkD4kCU5V2dwOTaCY5EQ== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -19024,7 +18530,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== -resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.21.0, resolve@^1.22.1, resolve@^1.22.3, resolve@^1.22.4: +resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.21.0, resolve@^1.22.1, resolve@^1.22.3, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -19158,33 +18664,6 @@ rollup-plugin-polyfill-node@^0.13.0: dependencies: "@rollup/plugin-inject" "^5.0.4" -rollup-plugin-postcss@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz#15e9462f39475059b368ce0e49c800fa4b1f7050" - integrity sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w== - dependencies: - chalk "^4.1.0" - concat-with-sourcemaps "^1.1.0" - cssnano "^5.0.1" - import-cwd "^3.0.0" - p-queue "^6.6.2" - pify "^5.0.0" - postcss-load-config "^3.0.0" - postcss-modules "^4.0.0" - promise.series "^0.2.0" - resolve "^1.19.0" - rollup-pluginutils "^2.8.2" - safe-identifier "^0.4.2" - style-inject "^0.3.0" - -rollup-plugin-svelte@^7.1.0: - version "7.1.6" - resolved "https://registry.yarnpkg.com/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.6.tgz#44a4ea6c6e8ed976824d9fd40c78d048515e5838" - integrity sha512-nVFRBpGWI2qUY1OcSiEEA/kjCY2+vAjO9BI8SzA7NRrh2GTunLd6w2EYmnMt/atgdg8GvcNjLsmZmbQs/u4SQA== - dependencies: - "@rollup/pluginutils" "^4.1.0" - resolve.exports "^2.0.0" - rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -19207,7 +18686,7 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" -rollup@^2.36.2, rollup@^2.45.2: +rollup@^2.36.2: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== @@ -19314,11 +18793,6 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-identifier@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/safe-identifier/-/safe-identifier-0.4.2.tgz#cf6bfca31c2897c588092d1750d30ef501d59fcb" - integrity sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w== - safe-regex-test@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" @@ -20003,11 +19477,6 @@ ssri@^9.0.0, ssri@^9.0.1: dependencies: minipass "^3.1.1" -stable@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" - integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" @@ -20106,11 +19575,6 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string-hash@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" - integrity sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A== - string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -20350,24 +19814,11 @@ stubs@^3.0.0: resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" integrity "sha1-6NK6H6nJBXAwPAMLaQD31fiavls= sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==" -style-inject@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/style-inject/-/style-inject-0.3.0.tgz#d21c477affec91811cc82355832a700d22bf8dd3" - integrity sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw== - style-mod@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/style-mod/-/style-mod-4.0.3.tgz#136c4abc905f82a866a18b39df4dc08ec762b1ad" integrity sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw== -stylehacks@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.1.1.tgz#7934a34eb59d7152149fa69d6e9e56f2fc34bcc9" - integrity sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw== - dependencies: - browserslist "^4.21.4" - postcss-selector-parser "^6.0.4" - stylus-lookup@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/stylus-lookup/-/stylus-lookup-3.0.2.tgz#c9eca3ff799691020f30b382260a67355fefdddd" @@ -20600,19 +20051,6 @@ svg.select.js@^3.0.1: dependencies: svg.js "^2.6.5" -svgo@^2.7.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.8.0.tgz#4ff80cce6710dc2795f0c7c74101e6764cfccd24" - integrity sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg== - dependencies: - "@trysound/sax" "0.2.0" - commander "^7.2.0" - css-select "^4.1.3" - css-tree "^1.1.3" - csso "^4.2.0" - picocolors "^1.0.0" - stable "^0.1.8" - swagger-jsdoc@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/swagger-jsdoc/-/swagger-jsdoc-6.1.0.tgz#c2b86321f2c4dde8947b418fe8a4bc94431d5522" From 6221922b3322bf735b36f7a4f573d842418311b7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 09:38:18 +0100 Subject: [PATCH 46/66] Update bundle refs --- packages/bbui/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1720cc7ca8..aa36474aed 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -4,10 +4,10 @@ "version": "0.0.0", "license": "MPL-2.0", "svelte": "src/index.js", - "module": "dist/bbui.es.js", + "module": "dist/bbui.es.mjs", "exports": { ".": { - "import": "./dist/bbui.es.js" + "import": "./dist/bbui.es.mjs" }, "./package.json": "./package.json", "./spectrum-icons-rollup.js": "./src/spectrum-icons-rollup.js", From 115b1db968ec1be5125637d08f22a6d59e8d2f58 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 09:40:16 +0100 Subject: [PATCH 47/66] Add css into the bundle --- packages/bbui/package.json | 3 ++- packages/bbui/vite.config.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index aa36474aed..c8732aca63 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -17,7 +17,8 @@ "build": "vite build" }, "devDependencies": { - "@sveltejs/vite-plugin-svelte": "1.4.0" + "@sveltejs/vite-plugin-svelte": "1.4.0", + "vite-plugin-css-injected-by-js": "3.5.2" }, "keywords": [ "svelte" diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index a084b16262..997c616fd5 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -1,6 +1,7 @@ import { defineConfig } from "vite" import { svelte } from "@sveltejs/vite-plugin-svelte" import path from "path" +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js" export default defineConfig(({ mode }) => { const isProduction = mode === "production" @@ -17,6 +18,7 @@ export default defineConfig(({ mode }) => { svelte({ emitCss: true, }), + cssInjectedByJsPlugin(), ], resolve: { alias: { From ef5ecb565a45e99cb78e28defb2487e75aea5e14 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 09:43:04 +0100 Subject: [PATCH 48/66] `check-lockfile` only for non-oss --- .github/workflows/budibase_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 1258bddcca..90b747f07e 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -281,6 +281,7 @@ jobs: check-lockfile: runs-on: ubuntu-latest + if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase') steps: - name: Checkout repo uses: actions/checkout@v4 From 6f8f866b7e39761ad96f5ecf4036dc651c507979 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Thu, 28 Nov 2024 23:37:20 +0530 Subject: [PATCH 49/66] fix: loop context lost when max iterations are reached. Add/test cases for the same --- .../tests/scenarios/looping.spec.ts | 38 +++++++++++++++++++ packages/server/src/constants/index.ts | 1 - packages/server/src/threads/automation.ts | 20 +++------- .../documents/app/automation/automation.ts | 1 + 4 files changed, 45 insertions(+), 15 deletions(-) diff --git a/packages/server/src/automations/tests/scenarios/looping.spec.ts b/packages/server/src/automations/tests/scenarios/looping.spec.ts index 9c5313e9da..66614e716a 100644 --- a/packages/server/src/automations/tests/scenarios/looping.spec.ts +++ b/packages/server/src/automations/tests/scenarios/looping.spec.ts @@ -152,6 +152,44 @@ describe("Loop automations", () => { ) }) + it("ensure the loop stops if the max iterations are reached", async () => { + const builder = createAutomationBuilder({ + name: "Test Loop max iterations", + }) + + const results = await builder + .appAction({ fields: {} }) + .loop({ + option: LoopStepType.ARRAY, + binding: ["test", "test2", "test3"], + iterations: 2, + }) + .serverLog({ text: "{{loop.currentItem}}" }) + .serverLog({ text: "{{steps.1.iterations}}" }) + .run() + + expect(results.steps[1].outputs.iterations).toBe(2) + }) + + it("should run an automation with loop and max iterations to ensure context correctness further down the tree", async () => { + const builder = createAutomationBuilder({ + name: "Test context down tree with Loop and max iterations", + }) + + const results = await builder + .appAction({ fields: {} }) + .loop({ + option: LoopStepType.ARRAY, + binding: ["test", "test2", "test3"], + iterations: 2, + }) + .serverLog({ text: "{{loop.currentItem}}" }) + .serverLog({ text: "{{steps.1.iterations}}" }) + .run() + + expect(results.steps[2].outputs.message).toContain("- 2") + }) + it("should run an automation where a loop is successfully run twice", async () => { const builder = createAutomationBuilder({ name: "Test Trigger with Loop and Create Row", diff --git a/packages/server/src/constants/index.ts b/packages/server/src/constants/index.ts index 604a81cd9f..89e2f26516 100644 --- a/packages/server/src/constants/index.ts +++ b/packages/server/src/constants/index.ts @@ -137,7 +137,6 @@ export enum InvalidColumns { export enum AutomationErrors { INCORRECT_TYPE = "INCORRECT_TYPE", - MAX_ITERATIONS = "MAX_ITERATIONS_REACHED", FAILURE_CONDITION = "FAILURE_CONDITION_MET", } diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 33e11a6ac0..051b485a54 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -392,6 +392,7 @@ class Orchestrator { let iterationCount = 0 let shouldCleanup = true + let reachedMaxIterations = false for (let loopStepIndex = 0; loopStepIndex < iterations; loopStepIndex++) { try { @@ -419,19 +420,8 @@ class Orchestrator { loopStepIndex === env.AUTOMATION_MAX_ITERATIONS || (loopStep.inputs.iterations && loopStepIndex === maxIterations) ) { - this.updateContextAndOutput( - pathStepIdx + 1, - steps[stepToLoopIndex], - { - items: this.loopStepOutputs, - iterations: loopStepIndex, - }, - { - status: AutomationErrors.MAX_ITERATIONS, - success: true, - } - ) - shouldCleanup = false + reachedMaxIterations = true + shouldCleanup = true break } @@ -480,7 +470,9 @@ class Orchestrator { success: true, } : { - success: true, + success: reachedMaxIterations + ? AutomationStepStatus.MAX_ITERATIONS + : true, items: this.loopStepOutputs, iterations: iterationCount, } diff --git a/packages/types/src/documents/app/automation/automation.ts b/packages/types/src/documents/app/automation/automation.ts index 1af892d8d1..71530c7939 100644 --- a/packages/types/src/documents/app/automation/automation.ts +++ b/packages/types/src/documents/app/automation/automation.ts @@ -174,6 +174,7 @@ export enum AutomationFeature { export enum AutomationStepStatus { NO_ITERATIONS = "no_iterations", + MAX_ITERATIONS = "max_iterations_reached", } export enum AutomationStatus { From 26f2c69fb94e8fdb065000983dc94f65253a610d Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Fri, 29 Nov 2024 15:30:20 +0530 Subject: [PATCH 50/66] fix PR comment for keeping status boolean and adding status conditionally --- packages/server/src/threads/automation.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 051b485a54..7e8f947580 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -470,13 +470,15 @@ class Orchestrator { success: true, } : { - success: reachedMaxIterations - ? AutomationStepStatus.MAX_ITERATIONS - : true, + success: true, items: this.loopStepOutputs, iterations: iterationCount, } + if (reachedMaxIterations && iterations !== 0) { + tempOutput.status = AutomationStepStatus.MAX_ITERATIONS + } + // Loop Step clean up this.executionOutput.steps.splice(pathStepIdx, 0, { id: steps[stepToLoopIndex].id, From 5a524be591b99db1953a674d52fa84c0489e1ddd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 11:03:13 +0100 Subject: [PATCH 51/66] dist/bbui.es.mjs -> dist/bbui.mjs --- packages/bbui/package.json | 4 ++-- packages/bbui/vite.config.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index c8732aca63..35f6676fdc 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -4,10 +4,10 @@ "version": "0.0.0", "license": "MPL-2.0", "svelte": "src/index.js", - "module": "dist/bbui.es.mjs", + "module": "dist/bbui.mjs", "exports": { ".": { - "import": "./dist/bbui.es.mjs" + "import": "./dist/bbui.mjs" }, "./package.json": "./package.json", "./spectrum-icons-rollup.js": "./src/spectrum-icons-rollup.js", diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index 997c616fd5..bf0f9fc26d 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -11,7 +11,6 @@ export default defineConfig(({ mode }) => { lib: { entry: "src/index.js", formats: ["es"], - fileName: "bbui.es", }, }, plugins: [ From f83ce2fca16838d4b7dc12e27e73256eb74e0b39 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 29 Nov 2024 10:30:06 +0000 Subject: [PATCH 52/66] Bump version to 3.2.15 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index be6673e7ae..cf93c66be9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.2.14", + "version": "3.2.15", "npmClient": "yarn", "concurrency": 20, "command": { From 16030cbb39c3bf51dee77c277d367f18e088feeb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 11:34:54 +0100 Subject: [PATCH 53/66] Add missing script --- scripts/syncLocalDependencies.js | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 scripts/syncLocalDependencies.js diff --git a/scripts/syncLocalDependencies.js b/scripts/syncLocalDependencies.js new file mode 100755 index 0000000000..1c402e9a44 --- /dev/null +++ b/scripts/syncLocalDependencies.js @@ -0,0 +1,60 @@ +const fs = require("fs") +const path = require("path") +const { execSync } = require("child_process") + +// Get the version argument from the command line +const version = process.argv[2] +if (!version) { + console.error("Usage: node update-workspace-dependencies.js ") + process.exit(1) +} + +// Get the list of workspaces with mismatched dependencies +const output = execSync("yarn --silent workspaces info --json", { + encoding: "utf-8", +}) +const data = JSON.parse(output) + +const workspaces = Object.keys(data).filter(key => { + return data[key].mismatchedWorkspaceDependencies?.length +}) + +// Loop through each workspace and update the dependencies +workspaces.forEach(workspace => { + const dependencies = data[workspace].mismatchedWorkspaceDependencies + + // Loop through each dependency and update its version in package.json + const packageJsonPath = path.join(data[workspace].location, "package.json") + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) + let hasChanges = false + + dependencies.forEach(dependency => { + if (packageJson.dependencies?.[dependency]) { + packageJson.dependencies[dependency] = version + hasChanges = true + } + if (packageJson.devDependencies?.[dependency]) { + packageJson.devDependencies[dependency] = version + hasChanges = true + } + if (packageJson.peerDependencies?.[dependency]) { + packageJson.peerDependencies[dependency] = version + hasChanges = true + } + }) + + // Write changes to package.json if there are any + if (hasChanges) { + fs.writeFileSync( + packageJsonPath, + JSON.stringify(packageJson, null, 2) + "\n" + ) + } +}) + +const rootPackageJson = JSON.parse(fs.readFileSync("package.json", "utf-8")) +delete rootPackageJson["resolutions"] +fs.writeFileSync( + "package.json", + JSON.stringify(rootPackageJson, null, 2) + "\n" +) From d2f7694afaeb5b24b716bf38dc6110c720dc4f88 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 29 Nov 2024 10:36:19 +0000 Subject: [PATCH 54/66] Bump version to 3.2.16 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index cf93c66be9..74e0cde617 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.2.15", + "version": "3.2.16", "npmClient": "yarn", "concurrency": 20, "command": { From 79d89e5f0ccc1d7c3837690048955e2e6d83fbc2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 12:17:46 +0100 Subject: [PATCH 55/66] Update pro for oss --- package.json | 4 ++-- yarn.lock | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 31e4110a35..2e9a2cc9af 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@types/node": "20.10.0", "@types/proper-lockfile": "^4.1.4", "@typescript-eslint/parser": "6.9.0", + "cross-spawn": "7.0.6", "depcheck": "^1.4.7", "esbuild": "^0.18.17", "esbuild-node-externals": "^1.14.0", @@ -29,8 +30,7 @@ "svelte-eslint-parser": "^0.33.1", "typescript": "5.5.2", "typescript-eslint": "^7.3.1", - "yargs": "^17.7.2", - "cross-spawn": "7.0.6" + "yargs": "^17.7.2" }, "scripts": { "get-past-client-version": "node scripts/getPastClientVersion.js", diff --git a/yarn.lock b/yarn.lock index 6bc709e45d..44781eab4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2196,7 +2196,7 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@3.2.14": +"@budibase/backend-core@3.2.16": version "0.0.0" dependencies: "@budibase/nano" "10.1.5" @@ -2280,15 +2280,15 @@ through2 "^2.0.0" "@budibase/pro@npm:@budibase/pro@latest": - version "3.2.14" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-3.2.14.tgz#2ea1ef4372803304ac3a06ce77620ce54a09dd02" - integrity sha512-ski7NeXOdDIjC0vapo+hxr8/VnbDhmOLF5TdvoLBgviMk7ij2rNPI2dNs+6kQuVXAEVJPD6bJ4Ke0z2d5YcYrQ== + version "3.2.16" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-3.2.16.tgz#571751c5ab288ecbdd14791e4dab207b9523150f" + integrity sha512-HRKfpyYk+fJ87rOAvuBw1EcBv33xliSEf/ww7Wmvzx/xdxas6a7ZHoblw0BU8tnb5Q2rmYTf61RlqOIC4iC+0Q== dependencies: "@anthropic-ai/sdk" "^0.27.3" - "@budibase/backend-core" "3.2.14" - "@budibase/shared-core" "3.2.14" - "@budibase/string-templates" "3.2.14" - "@budibase/types" "3.2.14" + "@budibase/backend-core" "3.2.16" + "@budibase/shared-core" "3.2.16" + "@budibase/string-templates" "3.2.16" + "@budibase/types" "3.2.16" "@koa/router" "13.1.0" bull "4.10.1" dd-trace "5.26.0" @@ -2301,13 +2301,13 @@ scim-patch "^0.8.1" scim2-parse-filter "^0.2.8" -"@budibase/shared-core@3.2.14": +"@budibase/shared-core@3.2.16": version "0.0.0" dependencies: "@budibase/types" "0.0.0" cron-validate "1.4.5" -"@budibase/string-templates@3.2.14": +"@budibase/string-templates@3.2.16": version "0.0.0" dependencies: "@budibase/handlebars-helpers" "^0.13.2" @@ -2315,7 +2315,7 @@ handlebars "^4.7.8" lodash.clonedeep "^4.5.0" -"@budibase/types@3.2.14": +"@budibase/types@3.2.16": version "0.0.0" dependencies: scim-patch "^0.8.1" From a6022c11a5e1ab2826b4950d5fa23b2ef083e06f Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Fri, 29 Nov 2024 16:52:55 +0530 Subject: [PATCH 56/66] fix loop not counting as step, test case failing --- .../server/src/automations/tests/scenarios/looping.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/automations/tests/scenarios/looping.spec.ts b/packages/server/src/automations/tests/scenarios/looping.spec.ts index 66614e716a..0baa69b3bc 100644 --- a/packages/server/src/automations/tests/scenarios/looping.spec.ts +++ b/packages/server/src/automations/tests/scenarios/looping.spec.ts @@ -168,7 +168,7 @@ describe("Loop automations", () => { .serverLog({ text: "{{steps.1.iterations}}" }) .run() - expect(results.steps[1].outputs.iterations).toBe(2) + expect(results.steps[0].outputs.iterations).toBe(2) }) it("should run an automation with loop and max iterations to ensure context correctness further down the tree", async () => { @@ -187,7 +187,7 @@ describe("Loop automations", () => { .serverLog({ text: "{{steps.1.iterations}}" }) .run() - expect(results.steps[2].outputs.message).toContain("- 2") + expect(results.steps[1].outputs.message).toContain("- 2") }) it("should run an automation where a loop is successfully run twice", async () => { From b48f2d83bad0082915cc0ea6c4a94ebf24a2f89a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 12:31:26 +0100 Subject: [PATCH 57/66] Add flag --- packages/types/src/sdk/featureFlag.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/sdk/featureFlag.ts b/packages/types/src/sdk/featureFlag.ts index 64a7362e9f..387b7e884a 100644 --- a/packages/types/src/sdk/featureFlag.ts +++ b/packages/types/src/sdk/featureFlag.ts @@ -4,8 +4,8 @@ export enum FeatureFlag { AUTOMATION_BRANCHING = "AUTOMATION_BRANCHING", AI_CUSTOM_CONFIGS = "AI_CUSTOM_CONFIGS", DEFAULT_VALUES = "DEFAULT_VALUES", - BUDIBASE_AI = "BUDIBASE_AI", + USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR", } export interface TenantFeatureFlags { From 0ea5117a295cd6afd25cfcc0619149389da2f0f9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:04:09 +0100 Subject: [PATCH 58/66] Use record to provide typings --- packages/backend-core/src/features/features.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/features/features.ts b/packages/backend-core/src/features/features.ts index b3f016e88a..7f53f9b7d3 100644 --- a/packages/backend-core/src/features/features.ts +++ b/packages/backend-core/src/features/features.ts @@ -266,12 +266,13 @@ export class FlagSet, T extends { [key: string]: V }> { // new flag, add it here and use the `fetch` and `get` functions to access it. // All of the machinery in this file is to make sure that flags have their // default values set correctly and their types flow through the system. -export const flags = new FlagSet({ +const flagsConfig: Record> = { [FeatureFlag.DEFAULT_VALUES]: Flag.boolean(true), [FeatureFlag.AUTOMATION_BRANCHING]: Flag.boolean(true), [FeatureFlag.AI_CUSTOM_CONFIGS]: Flag.boolean(true), [FeatureFlag.BUDIBASE_AI]: Flag.boolean(true), -}) +} +export const flags = new FlagSet(flagsConfig) type UnwrapPromise = T extends Promise ? U : T export type FeatureFlags = UnwrapPromise> From 40f50710e56e442aca5b581bc749d33f262bebe5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 12:54:34 +0100 Subject: [PATCH 59/66] Clean old flags --- packages/types/src/sdk/featureFlag.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/types/src/sdk/featureFlag.ts b/packages/types/src/sdk/featureFlag.ts index 387b7e884a..98e744324c 100644 --- a/packages/types/src/sdk/featureFlag.ts +++ b/packages/types/src/sdk/featureFlag.ts @@ -1,6 +1,4 @@ export enum FeatureFlag { - PER_CREATOR_PER_USER_PRICE = "PER_CREATOR_PER_USER_PRICE", - PER_CREATOR_PER_USER_PRICE_ALERT = "PER_CREATOR_PER_USER_PRICE_ALERT", AUTOMATION_BRANCHING = "AUTOMATION_BRANCHING", AI_CUSTOM_CONFIGS = "AI_CUSTOM_CONFIGS", DEFAULT_VALUES = "DEFAULT_VALUES", From 96916a469d112a19fe9b9a39d7620d0523b7bdec Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:05:03 +0100 Subject: [PATCH 60/66] Configure flag --- packages/backend-core/src/features/features.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend-core/src/features/features.ts b/packages/backend-core/src/features/features.ts index 7f53f9b7d3..650254fcb2 100644 --- a/packages/backend-core/src/features/features.ts +++ b/packages/backend-core/src/features/features.ts @@ -271,6 +271,7 @@ const flagsConfig: Record> = { [FeatureFlag.AUTOMATION_BRANCHING]: Flag.boolean(true), [FeatureFlag.AI_CUSTOM_CONFIGS]: Flag.boolean(true), [FeatureFlag.BUDIBASE_AI]: Flag.boolean(true), + [FeatureFlag.USE_ZOD_VALIDATOR]: Flag.boolean(env.isDev()), } export const flags = new FlagSet(flagsConfig) From ccbf282c69ef4f4373de6a54513d60c94f3e7f30 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:07:24 +0100 Subject: [PATCH 61/66] Flag zod --- packages/server/src/middleware/zod-validator.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/server/src/middleware/zod-validator.ts b/packages/server/src/middleware/zod-validator.ts index 0ad346afc3..e8cc2c470a 100644 --- a/packages/server/src/middleware/zod-validator.ts +++ b/packages/server/src/middleware/zod-validator.ts @@ -1,11 +1,16 @@ -import { Ctx } from "@budibase/types" +import { features } from "@budibase/backend-core" +import { Ctx, FeatureFlag } from "@budibase/types" import { AnyZodObject } from "zod" import { fromZodError } from "zod-validation-error" function validate(schema: AnyZodObject, property: "body" | "params") { // Return a Koa middleware function - return (ctx: Ctx, next: any) => { + return async (ctx: Ctx, next: any) => { + if (!(await features.flags.isEnabled(FeatureFlag.USE_ZOD_VALIDATOR))) { + return next() + } + if (!schema) { return next() } From a2f1977376762889ab9bee6c57611bd4650d3e85 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:12:30 +0100 Subject: [PATCH 62/66] Add validation for search view --- packages/server/src/api/routes/row.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/api/routes/row.ts b/packages/server/src/api/routes/row.ts index fc09b8c81d..61cdee0c2f 100644 --- a/packages/server/src/api/routes/row.ts +++ b/packages/server/src/api/routes/row.ts @@ -90,6 +90,7 @@ router router.post( "/api/v2/views/:viewId/search", internalSearchValidator(), + validateBody(searchRowRequestValidator), authorizedResource(PermissionType.VIEW, PermissionLevel.READ, "viewId"), rowController.views.searchView ) From 26be5740857eb2475fa7d51760494dbe201720d8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:15:32 +0100 Subject: [PATCH 63/66] Fix nullish --- packages/types/src/api/web/app/rows/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/api/web/app/rows/search.ts b/packages/types/src/api/web/app/rows/search.ts index b74e490677..7ba23bceca 100644 --- a/packages/types/src/api/web/app/rows/search.ts +++ b/packages/types/src/api/web/app/rows/search.ts @@ -68,7 +68,7 @@ const searchRowRequest = z.object({ paginate: z.boolean().optional(), bookmark: z.union([z.string(), z.number()]).nullish(), limit: z.number().optional(), - sort: z.string().optional(), + sort: z.string().nullish(), sortOrder: z.nativeEnum(SortOrder).optional(), sortType: z.nativeEnum(SortType).nullish(), version: z.string().optional(), From 57c466366360b034d5b59fe4fc346e7e18e44d87 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:49:43 +0100 Subject: [PATCH 64/66] Fix types --- packages/server/src/api/controllers/row/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 2dc9381183..cc5491e54f 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -258,7 +258,7 @@ export async function search(ctx: Ctx) { bookmark: searchRequest.bookmark ?? undefined, paginate: searchRequest.paginate, limit: searchRequest.limit, - sort: searchRequest.sort, + sort: searchRequest.sort ?? undefined, sortOrder: searchRequest.sortOrder, sortType: searchRequest.sortType ?? undefined, countRows: searchRequest.countRows, From a2730279d4e82a33496d4b60515e1d25356725d4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 29 Nov 2024 13:51:31 +0100 Subject: [PATCH 65/66] Fix types --- packages/server/src/api/routes/tests/search.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 8ba165ded0..c66197334e 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -212,7 +212,7 @@ if (descriptions.length) { const inMemoryQuery: RequiredKeys< Omit > = { - sort: this.query.sort, + sort: this.query.sort ?? undefined, query: { ...this.query.query }, paginate: this.query.paginate, bookmark: this.query.bookmark ?? undefined, From 39859e10ed32c8c25f0f540087b858be18a3b135 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:12:13 +0000 Subject: [PATCH 66/66] Don't fetch account for identifyTenantGroup posthog event (#15092) * Don't fetch account for identifyTenantGroup posthog event * Support self hosted * Fix types --- .../backend-core/src/events/identification.ts | 16 +--------------- .../src/migrations/functions/backfill/global.ts | 9 +++++---- .../worker/src/api/controllers/global/users.ts | 13 +++++-------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/packages/backend-core/src/events/identification.ts b/packages/backend-core/src/events/identification.ts index 69bf7009b2..6117f4b485 100644 --- a/packages/backend-core/src/events/identification.ts +++ b/packages/backend-core/src/events/identification.ts @@ -121,7 +121,7 @@ const identifyInstallationGroup = async ( const identifyTenantGroup = async ( tenantId: string, - account: Account | undefined, + hosting: Hosting, timestamp?: string | number ): Promise => { const id = await getEventTenantId(tenantId) @@ -129,26 +129,12 @@ const identifyTenantGroup = async ( const installationId = await getInstallationId() const environment = getDeploymentEnvironment() - let hosting: Hosting - let profession: string | undefined - let companySize: string | undefined - - if (account) { - profession = account.profession - companySize = account.size - hosting = account.hosting - } else { - hosting = getHostingFromEnv() - } - const group: TenantGroup = { id, type, hosting, environment, installationId, - profession, - companySize, } await identifyGroup(group, timestamp) diff --git a/packages/server/src/migrations/functions/backfill/global.ts b/packages/server/src/migrations/functions/backfill/global.ts index a56c92492b..7f718cee2f 100644 --- a/packages/server/src/migrations/functions/backfill/global.ts +++ b/packages/server/src/migrations/functions/backfill/global.ts @@ -9,11 +9,12 @@ import { db as dbUtils, } from "@budibase/backend-core" import { - QuotaUsage, - CloudAccount, App, - TenantBackfillSucceededEvent, + CloudAccount, Event, + Hosting, + QuotaUsage, + TenantBackfillSucceededEvent, User, } from "@budibase/types" import env from "../../../environment" @@ -125,7 +126,7 @@ export const run = async (db: any) => { try { await events.identification.identifyTenantGroup( tenantId, - account, + env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD, timestamp ) } catch (e) { diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index 2479a50d9e..e977d5ff5d 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -6,12 +6,12 @@ import { AddSSoUserRequest, BulkUserRequest, BulkUserResponse, - CloudAccount, CreateAdminUserRequest, CreateAdminUserResponse, Ctx, DeleteInviteUserRequest, DeleteInviteUsersRequest, + Hosting, InviteUserRequest, InviteUsersRequest, InviteUsersResponse, @@ -26,7 +26,6 @@ import { UserIdentifier, } from "@budibase/types" import { - accounts, users, cache, ErrorCode, @@ -192,12 +191,10 @@ export const adminUser = async ( lastName: familyName, }) - // events - let account: CloudAccount | undefined - if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { - account = await accounts.getAccountByTenantId(tenantId) - } - await events.identification.identifyTenantGroup(tenantId, account) + await events.identification.identifyTenantGroup( + tenantId, + env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD + ) ctx.body = { _id: finalUser._id!,