Merge branch 'develop' of github.com:Budibase/budibase into fix/BUDI-6754

This commit is contained in:
mike12345567 2023-04-04 13:37:59 +01:00
commit e128642bce
28 changed files with 2789 additions and 3894 deletions

2
.nvmrc
View File

@ -1 +1 @@
v14.19.3
v14.20.1

14
.nxignore Normal file
View File

@ -0,0 +1,14 @@
node_modules
**/node_modules
**/dist/
**/.routify/
**/coverage/
**/yarn-error.log
**/prebuilds/
**/build/
packages/server/builder/*
packages/server/client/*

View File

@ -1 +1 @@
3.11.1
3.10.0

View File

@ -1,2 +1,2 @@
nodejs 14.19.3
nodejs 14.20.1
python 3.10.0

View File

@ -1,9 +1,7 @@
{
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"npmClient": "yarn",
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"command": {
"publish": {
"ignoreChanges": [

10
nx.json Normal file
View File

@ -0,0 +1,10 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test"]
}
}
}
}

View File

@ -12,7 +12,7 @@
"husky": "^7.0.1",
"js-yaml": "^4.1.0",
"kill-port": "^1.6.1",
"lerna": "3.14.1",
"lerna": "^6.6.1",
"madge": "^6.0.0",
"prettier": "^2.3.1",
"prettier-plugin-svelte": "^2.3.0",
@ -24,10 +24,10 @@
"scripts": {
"setup": "node ./hosting/scripts/setup.js && yarn && yarn bootstrap && yarn build && yarn dev",
"bootstrap": "lerna bootstrap && lerna link && ./scripts/link-dependencies.sh",
"build": "lerna run build",
"build:dev": "lerna run prebuild && tsc --build --watch --preserveWatchOutput",
"build:backend": "lerna run build --ignore @budibase/client --ignore @budibase/bbui --ignore @budibase/builder --ignore @budibase/cli",
"build:sdk": "lerna run build:sdk",
"build": "lerna run --stream build",
"build:dev": "lerna run --stream prebuild && tsc --build --watch --preserveWatchOutput",
"build:backend": "lerna run --stream build --ignore @budibase/client --ignore @budibase/bbui --ignore @budibase/builder --ignore @budibase/cli",
"build:sdk": "lerna run --stream build:sdk",
"deps:circular": "madge packages/server/dist/index.js packages/worker/src/index.ts packages/backend-core/dist/src/index.js packages/cli/src/index.js --circular",
"release": "lerna publish ${RELEASE_VERSION_TYPE:-patch} --yes --force-publish && yarn release:pro",
"release:develop": "lerna publish prerelease --yes --force-publish --dist-tag develop --exact && yarn release:pro:develop",
@ -36,15 +36,15 @@
"restore": "yarn run clean && yarn run bootstrap && yarn run build",
"nuke": "yarn run nuke:packages && yarn run nuke:docker",
"nuke:packages": "yarn run restore",
"nuke:docker": "lerna run --parallel dev:stack:nuke",
"nuke:docker": "lerna run --stream --parallel dev:stack:nuke",
"clean": "lerna clean",
"kill-builder": "kill-port 3000",
"kill-server": "kill-port 4001 4002",
"kill-all": "yarn run kill-builder && yarn run kill-server",
"dev": "yarn run kill-all && lerna link && lerna run --parallel dev:builder --concurrency 1",
"dev:noserver": "yarn run kill-builder && lerna link && lerna run dev:stack:up && lerna run --parallel dev:builder --concurrency 1 --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker",
"dev:server": "yarn run kill-server && lerna run --parallel dev:builder --concurrency 1 --scope @budibase/backend-core --scope @budibase/worker --scope @budibase/server",
"test": "lerna run test --stream",
"dev": "yarn run kill-all && lerna link && lerna run --stream --parallel dev:builder --concurrency 1 --stream",
"dev:noserver": "yarn run kill-builder && lerna link && lerna run --stream dev:stack:up && lerna run --stream --parallel dev:builder --concurrency 1 --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker",
"dev:server": "yarn run kill-server && lerna run --stream --parallel dev:builder --concurrency 1 --scope @budibase/backend-core --scope @budibase/worker --scope @budibase/server",
"test": "lerna run --stream test --stream",
"test:pro": "bash scripts/pro/test.sh",
"lint:eslint": "eslint packages && eslint qa-core",
"lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --check \"qa-core/**/*.{js,ts,svelte}\"",
@ -52,12 +52,12 @@
"lint:fix:eslint": "eslint --fix packages qa-core",
"lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --write \"qa-core/**/*.{js,ts,svelte}\"",
"lint:fix": "yarn run lint:fix:prettier && yarn run lint:fix:eslint",
"build:specs": "lerna run specs",
"build:docker": "lerna run build:docker && npm run build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION && cd -",
"build:docker:pre": "lerna run build && lerna run predocker",
"build:specs": "lerna run --stream specs",
"build:docker": "lerna run --stream build:docker && npm run build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION && cd -",
"build:docker:pre": "lerna run --stream build && lerna run --stream predocker",
"build:docker:proxy": "docker build hosting/proxy -t proxy-service",
"build:docker:selfhost": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh latest && cd -",
"build:docker:develop": "node scripts/pinVersions && lerna run build:docker && npm run build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -",
"build:docker:selfhost": "lerna run --stream build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh latest && cd -",
"build:docker:develop": "node scripts/pinVersions && lerna run --stream build:docker && npm run build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -",
"build:docker:airgap": "node hosting/scripts/airgapped/airgappedDockerBuild",
"build:digitalocean": "cd hosting/digitalocean && ./build.sh && cd -",
"build:docker:single:multiarch": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/single/Dockerfile -t budibase:latest .",
@ -66,16 +66,16 @@
"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.2.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",
"build:docs": "lerna run build:docs",
"build:docs": "lerna run --stream build:docs",
"release:helm": "node scripts/releaseHelmChart",
"env:multi:enable": "lerna run env:multi:enable",
"env:multi:disable": "lerna run env:multi:disable",
"env:selfhost:enable": "lerna run env:selfhost:enable",
"env:selfhost:disable": "lerna run env:selfhost:disable",
"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",
"env:selfhost:disable": "lerna run --stream env:selfhost:disable",
"env:localdomain:enable": "./scripts/localdomain.sh enable",
"env:localdomain:disable": "./scripts/localdomain.sh disable",
"env:account:enable": "lerna run env:account:enable",
"env:account:disable": "lerna run env:account:disable",
"env:account:enable": "lerna run --stream env:account:enable",
"env:account:disable": "lerna run --stream env:account:disable",
"mode:self": "yarn env:selfhost:enable && yarn env:multi:disable && yarn env:account:disable",
"mode:cloud": "yarn env:selfhost:disable && yarn env:multi:enable && yarn env:account:disable",
"mode:account": "yarn mode:cloud && yarn env:account:enable",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -24,7 +24,7 @@
"dependencies": {
"@budibase/nano": "10.1.2",
"@budibase/pouchdb-replication-stream": "1.2.10",
"@budibase/types": "2.4.44-alpha.4",
"@budibase/types": "2.4.44-alpha.5",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-cloudfront-sign": "2.2.0",

View File

@ -1,6 +1,7 @@
import fetch from "node-fetch"
import * as sso from "./sso"
import { ssoCallbackUrl } from "../utils"
import { validEmail } from "../../../utils"
import {
ConfigType,
OIDCInnerConfig,
@ -11,6 +12,7 @@ import {
JwtClaims,
SaveSSOUserFunction,
} from "@budibase/types"
const OIDCStrategy = require("@techpass/passport-openidconnect").Strategy
export function buildVerifyFn(saveUserFn: SaveSSOUserFunction) {
@ -86,15 +88,6 @@ function getEmail(profile: SSOProfile, jwtClaims: JwtClaims) {
)
}
function validEmail(value: string) {
return (
value &&
!!value.match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
)
)
}
/**
* Create an instance of the oidc passport strategy. This wrapper fetches the configuration
* from couchDB rather than environment variables, using this factory is necessary for dynamically configuring passport.

View File

@ -1,2 +1,3 @@
export * from "./hashing"
export * from "./utils"
export * from "./stringUtils"

View File

@ -0,0 +1,8 @@
export function validEmail(value: string) {
return (
value &&
!!value.match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
)
)
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,8 +38,8 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "1.2.1",
"@budibase/shared-core": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/shared-core": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@spectrum-css/accordion": "3.0.24",
"@spectrum-css/actionbutton": "1.0.1",
"@spectrum-css/actiongroup": "1.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -58,11 +58,11 @@
}
},
"dependencies": {
"@budibase/bbui": "2.4.44-alpha.4",
"@budibase/client": "2.4.44-alpha.4",
"@budibase/frontend-core": "2.4.44-alpha.4",
"@budibase/shared-core": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/bbui": "2.4.44-alpha.5",
"@budibase/client": "2.4.44-alpha.5",
"@budibase/frontend-core": "2.4.44-alpha.5",
"@budibase/shared-core": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "dist/index.js",
"bin": {
@ -29,9 +29,9 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/types": "2.4.44-alpha.4",
"@budibase/backend-core": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@budibase/types": "2.4.44-alpha.5",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,11 +19,11 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "2.4.44-alpha.4",
"@budibase/frontend-core": "2.4.44-alpha.4",
"@budibase/shared-core": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/types": "2.4.44-alpha.4",
"@budibase/bbui": "2.4.44-alpha.5",
"@budibase/frontend-core": "2.4.44-alpha.5",
"@budibase/shared-core": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@budibase/types": "2.4.44-alpha.5",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -1,13 +1,13 @@
{
"name": "@budibase/frontend-core",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "2.4.44-alpha.4",
"@budibase/shared-core": "2.4.44-alpha.4",
"@budibase/bbui": "2.4.44-alpha.5",
"@budibase/shared-core": "2.4.44-alpha.5",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -44,12 +44,12 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "2.4.44-alpha.4",
"@budibase/client": "2.4.44-alpha.4",
"@budibase/pro": "2.4.44-alpha.4",
"@budibase/shared-core": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/types": "2.4.44-alpha.4",
"@budibase/backend-core": "2.4.44-alpha.5",
"@budibase/client": "2.4.44-alpha.5",
"@budibase/pro": "2.4.44-alpha.5",
"@budibase/shared-core": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@budibase/types": "2.4.44-alpha.5",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",
@ -99,7 +99,7 @@
"node-fetch": "2.6.7",
"open": "8.4.0",
"pg": "8.5.1",
"pino-pretty": "4.0.0",
"pino-pretty": "5.1.3",
"posthog-node": "1.3.0",
"pouchdb": "7.3.0",
"pouchdb-adapter-memory": "7.2.2",

View File

@ -1290,14 +1290,14 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.4.tgz#cc72db65d1d7e522dceff8adb2cdcf1434ca7d6a"
integrity sha512-dD6543k4k/vQAnQOvZHG2ERhf3keSY1w/vMA2nwwyk2/DDKE0TjNgEk+0JEy+WG7yyjP8/TrXrjKJmWr3+mGCw==
"@budibase/backend-core@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.5.tgz#072082d5322a27b9cfaee75718ddcf464afaec13"
integrity sha512-TRiepsq3MlQ0ZqZoRJDmYUUTb31gURPvHs6CmfqR1wP0sh+yf+5PgmLQDLLXTHOZ7b461yp5KDVC9OjNsna3WQ==
dependencies:
"@budibase/nano" "10.1.2"
"@budibase/pouchdb-replication-stream" "1.2.10"
"@budibase/types" "2.4.44-alpha.4"
"@budibase/types" "2.4.44-alpha.5"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-cloudfront-sign "2.2.0"
@ -1429,15 +1429,15 @@
pouchdb-promise "^6.0.4"
through2 "^2.0.0"
"@budibase/pro@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.4.tgz#d869ce64af40dcabca6341e103ab92de78a77b0d"
integrity sha512-RcUlogGuC820zXK0G0LwEeSnrUEAb3F6bKvpANH3ZZnN1fsvnUlYCItEOPCaolPo8NJO1nD675+D80FKlMHMmA==
"@budibase/pro@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.5.tgz#c748dfc16f5b30226c4006ae42a07636e5499102"
integrity sha512-HTKFiglaRb3aii4XakLezyLteo4SAg2ZumH6o/FSaRPrcN4KlPjxVCSxhXVSxu3m6GMdbcGLlah7+lK6iHnyEA==
dependencies:
"@budibase/backend-core" "2.4.44-alpha.4"
"@budibase/backend-core" "2.4.44-alpha.5"
"@budibase/shared-core" "2.4.44-alpha.1"
"@budibase/string-templates" "2.4.44-alpha.1"
"@budibase/types" "2.4.44-alpha.4"
"@budibase/types" "2.4.44-alpha.5"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
@ -1490,10 +1490,10 @@
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.1.tgz#1679657aa180d9c59afa1dffa611bff0638bd933"
integrity sha512-Sq+8HfM75EBMoOvKYFwELdlxmVN6wNZMofDjT/2G+9aF+Zfe5Tzw69C+unmdBgcGGjGCHEYWSz4mF0v8FPAGbg==
"@budibase/types@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.4.tgz#975407c6f14d98f844b69b2bf36d28dfb2570fd0"
integrity sha512-TuaFkd5EvqhZEIVVLGtZiOpJtW2ZtmWpz4ES6DTw/CctB0AtuLZ/Qlw7nv51TaktYQ2dEiguY6smJhJrO1iuEQ==
"@budibase/types@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.5.tgz#42c56241ab29ef81a048b93bc84644b69e41e63b"
integrity sha512-ACco4vREtv1un3aMH2sTKI8kD+/Hly2ee9AZw9YxFlsl78sOkvBPD25ki7oc8GH2pjLQ1Sjw7yG3SgW8MIsdbg==
dependencies:
scim-patch "^0.7.0"
@ -5031,14 +5031,6 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.1.0:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chalk@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
@ -5625,10 +5617,10 @@ date-utils@*:
resolved "https://registry.yarnpkg.com/date-utils/-/date-utils-1.2.21.tgz#61fb16cdc1274b3c9acaaffe9fc69df8720a2b64"
integrity sha512-wJMBjqlwXR0Iv0wUo/lFbhSQ7MmG1hl36iuxuE91kW+5b5sWbase73manEqNH9sOLFAMG83B4ffNKq9/Iq0FVA==
dateformat@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
dateformat@^4.5.1:
version "4.6.3"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5"
integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==
dayjs@^1.10.4, dayjs@^1.10.5:
version "1.11.3"
@ -9315,12 +9307,7 @@ join-component@^1.1.0:
resolved "https://registry.yarnpkg.com/join-component/-/join-component-1.1.0.tgz#b8417b750661a392bee2c2537c68b2a9d4977cd5"
integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ==
joycon@^2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/joycon/-/joycon-2.2.5.tgz#8d4cf4cbb2544d7b7583c216fcdfec19f6be1615"
integrity sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ==
joycon@^3.0.1:
joycon@^3.0.0, joycon@^3.0.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03"
integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==
@ -11640,22 +11627,23 @@ pino-http@^5.0.1:
pino "^6.13.0"
pino-std-serializers "^4.0.0"
pino-pretty@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-4.0.0.tgz#afbff81f946342b9d6eabc434942fe490e02faa9"
integrity sha512-YLy/n3dMXYWOodSm530gelkSAJGmEp29L9pqiycInlIae5FEJPWAkMRO3JFMbIFtjD2Ve4SH2aBcz2aRreGpBQ==
pino-pretty@5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-5.1.3.tgz#c4085093d1dffda359ab52731f87d96f7f832dc9"
integrity sha512-Zj+0TVdYKkAAIx9EUCL5e4TttwgsaFvJh2ceIMQeFCY8ak9tseEZQGSgpvyjEj1/iIVGIh5tdhkGEQWSMILKHA==
dependencies:
"@hapi/bourne" "^2.0.0"
args "^5.0.1"
chalk "^3.0.0"
dateformat "^3.0.3"
chalk "^4.0.0"
dateformat "^4.5.1"
fast-safe-stringify "^2.0.7"
jmespath "^0.15.0"
joycon "^2.2.5"
joycon "^3.0.0"
pump "^3.0.0"
readable-stream "^3.6.0"
rfdc "^1.3.0"
split2 "^3.1.1"
strip-json-comments "^3.0.1"
strip-json-comments "^3.1.1"
pino-std-serializers@^3.1.0:
version "3.2.0"
@ -12699,7 +12687,7 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
rfdc@^1.2.0:
rfdc@^1.2.0, rfdc@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/shared-core",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Shared data utils",
"main": "dist/cjs/src/index.js",
"types": "dist/mjs/src/index.d.ts",
@ -20,7 +20,7 @@
"dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\""
},
"dependencies": {
"@budibase/types": "2.4.44-alpha.4"
"@budibase/types": "2.4.44-alpha.5"
},
"devDependencies": {
"concurrently": "^7.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase types",
"main": "dist/cjs/index.js",
"types": "dist/mjs/index.d.ts",

View File

@ -1,8 +1,15 @@
import { ScimResource, ScimMeta, ScimPatchOperation } from "scim-patch"
import { ScimResource, ScimMeta } from "scim-patch"
import { ScimListResponse } from "./shared"
type BooleanString = boolean | "True" | "true" | "False" | "false"
type Emails =
| {
value: string
type: "work"
primary: boolean
}[]
export interface ScimUserResponse extends ScimResource {
schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"]
id: string
@ -18,13 +25,7 @@ export interface ScimUserResponse extends ScimResource {
givenName: string
}
active: BooleanString
emails: [
{
value: string
type: "work"
primary: true
}
]
emails?: Emails
}
export interface ScimCreateUserRequest {
@ -35,13 +36,7 @@ export interface ScimCreateUserRequest {
externalId: string
userName: string
active: BooleanString
emails: [
{
primary: true
type: "work"
value: string
}
]
emails?: Emails
meta: {
resourceType: "User"
}

View File

@ -53,12 +53,7 @@ export interface User extends Document {
dayPassRecordedAt?: string
userGroups?: string[]
onboardedAt?: string
scimInfo?: {
isSync: boolean
userName: string
externalId: string
displayName?: string
}
scimInfo?: { isSync: true } & Record<string, any>
}
export enum UserStatus {

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "2.4.44-alpha.4",
"version": "2.4.44-alpha.5",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "2.4.44-alpha.4",
"@budibase/pro": "2.4.44-alpha.4",
"@budibase/string-templates": "2.4.44-alpha.4",
"@budibase/types": "2.4.44-alpha.4",
"@budibase/backend-core": "2.4.44-alpha.5",
"@budibase/pro": "2.4.44-alpha.5",
"@budibase/string-templates": "2.4.44-alpha.5",
"@budibase/types": "2.4.44-alpha.5",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",
@ -66,7 +66,7 @@
"passport-google-oauth": "2.0.0",
"passport-jwt": "4.0.0",
"passport-local": "1.0.0",
"pino-pretty": "4.8.0",
"pino-pretty": "5.1.3",
"pouchdb": "7.3.0",
"pouchdb-all-dbs": "1.1.1",
"server-destroy": "1.0.1"

View File

@ -2,6 +2,7 @@ import tk from "timekeeper"
import _ from "lodash"
import { mocks, structures } from "@budibase/backend-core/tests"
import {
ScimCreateUserRequest,
ScimGroupResponse,
ScimUpdateRequest,
ScimUserResponse,
@ -176,7 +177,9 @@ describe("scim", () => {
const response = await getScimUsers({
params: {
filter: encodeURI(
`emails[type eq "work"].value eq "${userToFetch?.emails[0].value}"`
`emails[type eq "work"].value eq "${
userToFetch?.emails![0].value
}"`
),
},
})
@ -259,6 +262,61 @@ describe("scim", () => {
expect(events.user.created).toBeCalledTimes(1)
})
it("if the username is an email, the user name will be used as email", async () => {
const email = structures.generator.email()
const body: ScimCreateUserRequest = structures.scim.createUserRequest(
{ username: email }
)
delete body.emails
await postScimUser({ body })
const user = await config.getUser(email)
expect(user).toBeDefined()
expect(user.email).toEqual(email)
})
it("if multiple emails are provided, the first primary one is used as email", async () => {
const email = structures.generator.email()
const body: ScimCreateUserRequest = {
...structures.scim.createUserRequest(),
emails: [
{
primary: false,
type: "work",
value: structures.generator.email(),
},
{
primary: true,
type: "work",
value: email,
},
{
primary: true,
type: "work",
value: structures.generator.email(),
},
],
}
await postScimUser({ body })
const user = await config.getUser(email)
expect(user).toBeDefined()
expect(user.email).toEqual(email)
})
it("if no email is provided and the user name is not an email, an exception is thrown", async () => {
const body: ScimCreateUserRequest = structures.scim.createUserRequest(
{ username: structures.generator.name() }
)
delete body.emails
await postScimUser({ body }, { expect: 500 })
})
})
})
@ -392,21 +450,23 @@ describe("scim", () => {
)
it("supports updating unmapped fields", async () => {
const value = structures.generator.letter()
const body: ScimUpdateRequest = {
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Operations: [
{
op: "Add",
path: "preferredLanguage",
value: structures.generator.letter(),
value,
},
],
}
const response = await patchScimUser({ id: user.id, body })
const expectedScimUser: ScimUserResponse = {
const expectedScimUser = {
...user,
preferredLanguage: value,
}
expect(response).toEqual(expectedScimUser)

View File

@ -475,14 +475,14 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.4.tgz#cc72db65d1d7e522dceff8adb2cdcf1434ca7d6a"
integrity sha512-dD6543k4k/vQAnQOvZHG2ERhf3keSY1w/vMA2nwwyk2/DDKE0TjNgEk+0JEy+WG7yyjP8/TrXrjKJmWr3+mGCw==
"@budibase/backend-core@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.5.tgz#072082d5322a27b9cfaee75718ddcf464afaec13"
integrity sha512-TRiepsq3MlQ0ZqZoRJDmYUUTb31gURPvHs6CmfqR1wP0sh+yf+5PgmLQDLLXTHOZ7b461yp5KDVC9OjNsna3WQ==
dependencies:
"@budibase/nano" "10.1.2"
"@budibase/pouchdb-replication-stream" "1.2.10"
"@budibase/types" "2.4.44-alpha.4"
"@budibase/types" "2.4.44-alpha.5"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-cloudfront-sign "2.2.0"
@ -564,15 +564,15 @@
pouchdb-promise "^6.0.4"
through2 "^2.0.0"
"@budibase/pro@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.4.tgz#d869ce64af40dcabca6341e103ab92de78a77b0d"
integrity sha512-RcUlogGuC820zXK0G0LwEeSnrUEAb3F6bKvpANH3ZZnN1fsvnUlYCItEOPCaolPo8NJO1nD675+D80FKlMHMmA==
"@budibase/pro@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.5.tgz#c748dfc16f5b30226c4006ae42a07636e5499102"
integrity sha512-HTKFiglaRb3aii4XakLezyLteo4SAg2ZumH6o/FSaRPrcN4KlPjxVCSxhXVSxu3m6GMdbcGLlah7+lK6iHnyEA==
dependencies:
"@budibase/backend-core" "2.4.44-alpha.4"
"@budibase/backend-core" "2.4.44-alpha.5"
"@budibase/shared-core" "2.4.44-alpha.1"
"@budibase/string-templates" "2.4.44-alpha.1"
"@budibase/types" "2.4.44-alpha.4"
"@budibase/types" "2.4.44-alpha.5"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
@ -607,10 +607,10 @@
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.1.tgz#1679657aa180d9c59afa1dffa611bff0638bd933"
integrity sha512-Sq+8HfM75EBMoOvKYFwELdlxmVN6wNZMofDjT/2G+9aF+Zfe5Tzw69C+unmdBgcGGjGCHEYWSz4mF0v8FPAGbg==
"@budibase/types@2.4.44-alpha.4":
version "2.4.44-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.4.tgz#975407c6f14d98f844b69b2bf36d28dfb2570fd0"
integrity sha512-TuaFkd5EvqhZEIVVLGtZiOpJtW2ZtmWpz4ES6DTw/CctB0AtuLZ/Qlw7nv51TaktYQ2dEiguY6smJhJrO1iuEQ==
"@budibase/types@2.4.44-alpha.5":
version "2.4.44-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.5.tgz#42c56241ab29ef81a048b93bc84644b69e41e63b"
integrity sha512-ACco4vREtv1un3aMH2sTKI8kD+/Hly2ee9AZw9YxFlsl78sOkvBPD25ki7oc8GH2pjLQ1Sjw7yG3SgW8MIsdbg==
dependencies:
scim-patch "^0.7.0"
@ -5765,10 +5765,10 @@ join-component@^1.1.0:
resolved "https://registry.yarnpkg.com/join-component/-/join-component-1.1.0.tgz#b8417b750661a392bee2c2537c68b2a9d4977cd5"
integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ==
joycon@^2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/joycon/-/joycon-2.2.5.tgz#8d4cf4cbb2544d7b7583c216fcdfec19f6be1615"
integrity sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ==
joycon@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03"
integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==
js-tokens@^4.0.0:
version "4.0.0"
@ -7265,10 +7265,10 @@ pino-http@^5.0.1:
pino "^6.13.0"
pino-std-serializers "^4.0.0"
pino-pretty@4.8.0:
version "4.8.0"
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-4.8.0.tgz#f2f3055bf222456217b14ffb04d8be0a0cc17fce"
integrity sha512-mhQfHG4rw5ZFpWL44m0Utjo4GC2+HMfdNvxyA8lLw0sIqn6fCf7uQe6dPckUcW/obly+OQHD7B/MTso6LNizYw==
pino-pretty@5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-5.1.3.tgz#c4085093d1dffda359ab52731f87d96f7f832dc9"
integrity sha512-Zj+0TVdYKkAAIx9EUCL5e4TttwgsaFvJh2ceIMQeFCY8ak9tseEZQGSgpvyjEj1/iIVGIh5tdhkGEQWSMILKHA==
dependencies:
"@hapi/bourne" "^2.0.0"
args "^5.0.1"
@ -7276,7 +7276,7 @@ pino-pretty@4.8.0:
dateformat "^4.5.1"
fast-safe-stringify "^2.0.7"
jmespath "^0.15.0"
joycon "^2.2.5"
joycon "^3.0.0"
pump "^3.0.0"
readable-stream "^3.6.0"
rfdc "^1.3.0"

6279
yarn.lock

File diff suppressed because it is too large Load Diff