Merge branch 'develop' into bug/sev2/generate-select-statement-null-pointer-fix

This commit is contained in:
Mel O'Hagan 2022-07-08 09:03:36 +01:00
commit d51710532b
36 changed files with 137 additions and 148 deletions

View File

@ -11,8 +11,8 @@ sources:
- https://github.com/Budibase/budibase
- https://budibase.com
type: application
version: 0.2.10
appVersion: 1.0.48
version: 0.2.11
appVersion: 1.0.214
dependencies:
- name: couchdb
version: 3.6.1

View File

@ -1,5 +1,5 @@
{
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -20,7 +20,7 @@
"test:watch": "jest --watchAll"
},
"dependencies": {
"@budibase/types": "^1.0.212-alpha.15",
"@budibase/types": "^1.0.219-alpha.11",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",
"bcrypt": "5.0.1",

View File

@ -20,6 +20,8 @@ const {
internalApi,
} = require("./middleware")
const { invalidateUser } = require("./cache/user")
// Strategies
passport.use(new LocalStrategy(local.options, local.authenticate))
passport.use(new JwtStrategy(jwt.options, jwt.authenticate))
@ -149,6 +151,8 @@ async function updateUserOAuth(userId, oAuthConfig) {
}
await db.put(dbUser)
await invalidateUser(userId)
} catch (e) {
console.error("Could not update OAuth details for current user", e)
}

View File

@ -1,10 +1,10 @@
const NonErrors = ["AccountError"]
function isSuppressed(e) {
function isSuppressed(e?: any) {
return e && e["suppressAlert"]
}
module.exports.logAlert = (message, e) => {
export function logAlert(message: string, e?: any) {
if (e && NonErrors.includes(e.name) && isSuppressed(e)) {
return
}
@ -14,3 +14,7 @@ module.exports.logAlert = (message, e) => {
}
console.error(`bb-alert: ${message} ${errorJson}`)
}
export default {
logAlert,
}

View File

@ -291,11 +291,6 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/types@^1.0.206":
version "1.0.208"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.208.tgz#c45cb494fb5b85229e15a34c6ac1805bae5be867"
integrity sha512-zKIHg6TGK+soVxMNZNrGypP3DCrd3jhlUQEFeQ+rZR6/tCue1G74bjzydY5FjnLEsXeLH1a0hkS5HulTmvQ2bA==
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "^1.0.212-alpha.15",
"@budibase/string-templates": "^1.0.219-alpha.11",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -5,7 +5,7 @@
const displayLimit = 5
$: badges = value?.slice(0, displayLimit) ?? []
$: badges = Array.isArray(value) ? value.slice(0, displayLimit) : []
$: leftover = (value?.length ?? 0) - badges.length
</script>

View File

@ -16,4 +16,4 @@
"runMode": 1,
"openMode": 0
}
}
}

View File

@ -36,5 +36,9 @@ filterTests(['all'], () => {
})
cy.addCustomSourceOptions(totalRadioButtons)
}
after(() => {
cy.deleteAllApps()
})
})
})

View File

@ -9,10 +9,11 @@ filterTests(["smoke", "all"], () => {
before(() => {
cy.login()
cy.deleteApp("Cypress Tests")
cy.createApp("Cypress Tests")
cy.createApp("Cypress Tests", false)
// Create new user
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 1000})
cy.wait(500)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000})
cy.createUser(bbUserEmail)
cy.contains("bbuser").click()
cy.wait(500)

View File

@ -6,11 +6,11 @@ filterTests(["smoke", "all"], () => {
before(() => {
cy.login()
cy.deleteApp("Cypress Tests")
cy.createApp("Cypress Tests")
cy.createApp("Cypress Tests", false)
})
it("should create a user via basic onboarding", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 1000})
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000})
cy.createUser("bbuser@test.com")
cy.get(interact.SPECTRUM_TABLE).should("contain", "bbuser")
})
@ -45,15 +45,16 @@ filterTests(["smoke", "all"], () => {
if(i < 1){
cy.createApp(name)
} else {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.get(interact.CREATE_APP_BUTTON, { timeout: 1000 }).click({ force: true })
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000})
cy.wait(1000)
cy.get(interact.CREATE_APP_BUTTON, { timeout: 2000 }).click({ force: true })
cy.createAppFromScratch(name)
}
}
}
})
// Navigate back to the user
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 500})
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000})
cy.get(interact.SPECTRUM_SIDENAV).contains("Users").click()
cy.get(interact.SPECTRUM_TABLE, { timeout: 500 }).contains("bbuser").click()
for (let i = 0; i < 3; i++) {
@ -173,14 +174,16 @@ filterTests(["smoke", "all"], () => {
it("Should edit user details within user details page", () => {
// Add First name
cy.get(interact.FIELD, { timeout: 500 }).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 500 }).type("bb")
cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => {
cy.wait(500)
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).wait(500).clear().click().type("bb")
})
// Add Last name
cy.get(interact.FIELD).eq(3).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).type("test")
cy.get(interact.FIELD, { timeout: 1000 }).eq(3).within(() => {
cy.wait(500)
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).click().wait(500).clear().type("test")
})
cy.get(interact.FIELD).eq(0).click()
cy.get(interact.FIELD, { timeout: 1000 }).eq(0).click()
// Reload page
cy.reload()
@ -188,8 +191,8 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', "bb")
})
cy.get(interact.FIELD).eq(3).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 500 }).should('have.value', "test")
cy.get(interact.FIELD, { timeout: 1000 }).eq(3).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).should('have.value', "test")
})
})

View File

@ -103,6 +103,8 @@ filterTests(["smoke", "all"], () => {
}
cy.get("button").contains("Update password").click({ force: true })
})
// Remove users name
cy.updateUserInformation()
})
})
})

View File

@ -5,6 +5,7 @@ filterTests(["all"], () => {
context("Application Overview screen", () => {
before(() => {
cy.login()
cy.deleteAllApps()
cy.createTestApp()
})
@ -300,7 +301,7 @@ filterTests(["all"], () => {
})
it("Should allow editing of the app details.", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(".appTable .app-row-actions button")
.contains("Manage")
.eq(0)
@ -315,7 +316,8 @@ filterTests(["all"], () => {
cy.updateAppName("sample name")
//publish and check its disabled
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.wait(500)
cy.get(".appTable .app-row-actions button")
.contains("Edit")
.eq(0)
@ -331,8 +333,8 @@ filterTests(["all"], () => {
cy.wait(1000)
})
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.get(".appTable .app-row-actions button", { timeout: 1000 })
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 })
cy.get(".appTable .app-row-actions button", { timeout: 5000 })
.contains("Manage")
.eq(0)
.click({ force: true })

View File

@ -6,11 +6,12 @@ filterTests(['all'], () => {
context("Publish Application Workflow", () => {
before(() => {
cy.login()
cy.createTestApp()
cy.deleteAllApps()
cy.createApp("Cypress Tests", false)
})
it("Should reflect the unpublished status correctly", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(interact.APP_TABLE_STATUS, { timeout: 3000 }).eq(0)
.within(() => {
@ -29,6 +30,7 @@ filterTests(['all'], () => {
it("Should publish an application and correctly reflect that", () => {
//Assuming the previous test was run and the unpublished app is open in edit mode.
cy.closeModal()
cy.get(interact.TOPRIGHTNAV_BUTTON_SPECTRUM).contains("Publish").click({ force : true })
cy.get(interact.DEPLOY_APP_MODAL).should("be.visible")
@ -72,7 +74,7 @@ filterTests(['all'], () => {
it("Should unpublish an application using the link and reflect the status change", () => {
//Assuming the previous test app exists and is published
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(interact.APP_TABLE_STATUS).eq(0)
.within(() => {
@ -85,6 +87,7 @@ filterTests(['all'], () => {
cy.get(interact.APP_TABLE_APP_NAME).click({ force: true })
})
cy.closeModal()
cy.get(interact.DEPLOYMENT_TOP_GLOBE).should("exist").click({ force: true })
cy.get("[data-cy='publish-popover-menu']")
@ -97,7 +100,8 @@ filterTests(['all'], () => {
cy.get(interact.CONFIRM_WRAP_BUTTON).click({ force: true }
)})
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 6000 })
cy.wait(500)
cy.get(interact.APP_TABLE_STATUS, { timeout: 1000 }).eq(0).contains("Unpublished")
})

View File

@ -51,7 +51,8 @@ filterTests(['smoke', 'all'], () => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 })
// Start create app process. If apps already exist, click second button
cy.get(interact.CREATE_APP_BUTTON, { timeout: 1000 }).click({ force: true })
cy.wait(1000)
cy.get(interact.CREATE_APP_BUTTON, { timeout: 3000 }).click({ force: true })
const appName = "Cypress Tests"
cy.get(interact.SPECTRUM_MODAL).within(() => {
@ -86,7 +87,7 @@ filterTests(['smoke', 'all'], () => {
const appName = "Cypress Tests"
cy.createApp(appName, false)
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.applicationInAppTable(appName)
cy.deleteApp(appName)

View File

@ -111,6 +111,7 @@ filterTests(["all"], () => {
// Save relationship & reload page
cy.get(".spectrum-Button").contains("Save").click({ force: true })
cy.reload()
cy.wait(1000)
})
// Confirm table length & relationship name
cy.get(".spectrum-Table", { timeout: 1000 })

View File

@ -151,7 +151,7 @@ filterTests(["all"], () => {
cy.get("@query").its("response.body").should("not.be.empty")
// Save query
cy.get(".spectrum-Button").contains("Save Query").click({ force: true })
cy.get(".hierarchy-items-container").should("contain", queryName)
cy.get(".spectrum-Tabs-content", { timeout: 2000 }).should("contain", queryName)
})
it("should switch to schema with no tables", () => {
@ -231,10 +231,9 @@ filterTests(["all"], () => {
// Run and Save query
cy.get(".spectrum-Button").contains("Run Query").click({ force: true })
cy.wait(500)
cy.get(".spectrum-Button", { timeout: 500 }).contains("Save Query").click({ force: true })
//cy.reload()
//cy.wait(500)
cy.get(".nav-item").should("contain", queryRename)
cy.get(".spectrum-Button", { timeout: 2000 }).contains("Save Query").click({ force: true })
cy.reload({ timeout: 5000 })
cy.get(".nav-item", { timeout: 2000 }).should("contain", queryRename)
})
it("should delete a query", () => {

View File

@ -12,7 +12,7 @@ filterTests(["all"], () => {
const appName = "Cypress Tests"
const appRename = "Cypress Renamed"
// Rename app, Search for app, Confirm name was changed
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
renameApp(appName, appRename)
cy.reload()
cy.searchForApplication(appRename)
@ -39,7 +39,7 @@ filterTests(["all"], () => {
.click({ force: true })
})
// Rename app, Search for app, Confirm name was changed
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
renameApp(appName, appRename, true)
cy.get(interact.APP_TABLE).find(interact.WRAPPER).should("have.length", 1)
cy.applicationInAppTable(appRename)
@ -47,7 +47,7 @@ filterTests(["all"], () => {
it("Should try to rename an application to have no name", () => {
const appName = "Cypress Tests"
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
renameApp(appName, " ", false, true)
// Close modal and confirm name has not been changed
cy.get(interact.SPECTRUM_DIALOG_GRID, { timeout: 1000 }).contains("Cancel").click()
@ -57,7 +57,7 @@ filterTests(["all"], () => {
xit("Should create two applications with the same name", () => {
// It is not possible to have applications with the same name
const appName = "Cypress Tests"
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(interact.SPECTRUM_BUTTON), { timeout: 500 }
.contains("Create app")
.click({ force: true })
@ -80,18 +80,15 @@ filterTests(["all"], () => {
const appName = "Cypress Tests"
const numberName = 12345
const specialCharName = "£$%^"
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
renameApp(appName, numberName)
cy.reload()
cy.applicationInAppTable(numberName)
cy.reload()
renameApp(numberName, specialCharName)
cy.get(interact.ERROR).should(
"have.text",
"App name must be letters, numbers and spaces only"
)
// Set app name back to Cypress Tests
cy.reload()
renameApp(numberName, appName)
})

View File

@ -134,15 +134,18 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => {
const shouldCreateDefaultTable =
typeof addDefaultTable != "boolean" ? true : addDefaultTable
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(`[data-cy="create-app-btn"]`, { timeout: 2000 }).click({ force: true })
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 })
cy.wait(1000)
cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true })
// If apps already exist
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
.its("body")
.then(val => {
if (val.length > 0) {
cy.get(`[data-cy="create-app-btn"]`).click({ force: true })
cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({
force: true,
})
}
})

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -69,10 +69,10 @@
}
},
"dependencies": {
"@budibase/bbui": "^1.0.212-alpha.15",
"@budibase/client": "^1.0.212-alpha.15",
"@budibase/frontend-core": "^1.0.212-alpha.15",
"@budibase/string-templates": "^1.0.212-alpha.15",
"@budibase/bbui": "^1.0.219-alpha.11",
"@budibase/client": "^1.0.219-alpha.11",
"@budibase/frontend-core": "^1.0.219-alpha.11",
"@budibase/string-templates": "^1.0.219-alpha.11",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -53,7 +53,7 @@ export default class IntercomClient {
* @returns Intercom global object
*/
show(user = {}) {
if (!this.initialised) return
if (!this.initialised || !user?.admin) return
return window.Intercom("boot", {
app_id: this.token,

View File

@ -22,10 +22,8 @@
RelationshipTypes,
ALLOWABLE_STRING_OPTIONS,
ALLOWABLE_NUMBER_OPTIONS,
ALLOWABLE_JSON_OPTIONS,
ALLOWABLE_STRING_TYPES,
ALLOWABLE_NUMBER_TYPES,
ALLOWABLE_JSON_TYPES,
SWITCHABLE_TYPES,
} from "constants/backend"
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils"
@ -255,11 +253,6 @@
ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1
) {
return ALLOWABLE_NUMBER_OPTIONS
} else if (
originalName &&
ALLOWABLE_JSON_TYPES.indexOf(field.type) !== -1
) {
return ALLOWABLE_JSON_OPTIONS
} else if (!external) {
return [
...Object.values(fieldDefinitions),

View File

@ -158,13 +158,9 @@ export const ALLOWABLE_NUMBER_TYPES = ALLOWABLE_NUMBER_OPTIONS.map(
opt => opt.type
)
export const ALLOWABLE_JSON_OPTIONS = [FIELDS.JSON, FIELDS.ARRAY]
export const ALLOWABLE_JSON_TYPES = ALLOWABLE_JSON_OPTIONS.map(opt => opt.type)
export const SWITCHABLE_TYPES = [
...ALLOWABLE_STRING_TYPES,
...ALLOWABLE_NUMBER_TYPES,
...ALLOWABLE_JSON_TYPES,
]
export const IntegrationTypes = {

View File

@ -64,6 +64,8 @@ export function createAuthStore() {
name: user.account?.name,
user_id: user._id,
tenant: user.tenantId,
admin: user?.admin?.global,
builder: user?.builder?.global,
"Company size": user.account?.size,
"Job role": user.account?.profession,
})

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {

View File

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

View File

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "^1.0.212-alpha.15",
"@budibase/bbui": "^1.0.219-alpha.11",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -77,11 +77,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "^1.0.212-alpha.15",
"@budibase/client": "^1.0.212-alpha.15",
"@budibase/pro": "1.0.212-alpha.15",
"@budibase/string-templates": "^1.0.212-alpha.15",
"@budibase/types": "^1.0.212-alpha.15",
"@budibase/backend-core": "^1.0.219-alpha.11",
"@budibase/client": "^1.0.219-alpha.11",
"@budibase/pro": "1.0.219-alpha.11",
"@budibase/string-templates": "^1.0.219-alpha.11",
"@budibase/types": "^1.0.219-alpha.11",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View File

@ -8,6 +8,7 @@ const {
refreshOAuthToken,
updateUserOAuth,
} = require("@budibase/backend-core/auth")
const { user: userCache } = require("@budibase/backend-core/cache")
const { getGlobalIDFromUserMetadataID } = require("../db/utils")
const { isSQL } = require("../integrations/utils")
@ -112,15 +113,9 @@ class QueryRunner {
info.code === 401 &&
!this.hasRefreshedOAuth
) {
await this.refreshOAuth2(this.ctx)
// Attempt to refresh the access token from the provider
this.hasRefreshedOAuth = true
const authResponse = await this.refreshOAuth2(this.ctx)
if (!authResponse || authResponse.err) {
// In this event the user may have oAuth issues that
// could require re-authenticating with their provider.
throw new Error("OAuth2 access token could not be refreshed")
}
}
this.hasRerun = true
@ -174,8 +169,7 @@ class QueryRunner {
const { configId } = ctx.auth
if (!providerType || !oauth2?.refreshToken) {
console.error("No refresh token found for authenticated user")
return
throw new Error("No refresh token found for authenticated user")
}
const resp = await refreshOAuthToken(
@ -186,9 +180,16 @@ class QueryRunner {
// Refresh session flow. Should be in same location as refreshOAuthToken
// There are several other properties available in 'resp'
if (!resp.error) {
if (!resp.err) {
const globalUserId = getGlobalIDFromUserMetadataID(_id)
await updateUserOAuth(globalUserId, resp)
this.ctx.user = await userCache.getUser(globalUserId)
} else {
// In this event the user may have oAuth issues that
// could require re-authenticating with their provider.
throw new Error(
"OAuth2 access token could not be refreshed: " + resp.err.toString()
)
}
return resp

View File

@ -1080,12 +1080,11 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.212-alpha.15":
version "1.0.212-alpha.15"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.212-alpha.15.tgz#90ad9fed55a1e08c3ae69069e5d01e51477afd13"
integrity sha512-auIkpv9/W6iA1brt4vUtZivTS/8baqgPATOb+CCGzCukcDvrxkBQEEepAz0DYonKlFznsKSMkjOvgAY70wcm2Q==
"@budibase/backend-core@1.0.218":
version "1.0.218"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.218.tgz#be101c8baf220fa3fc55d63071bb38fc6c8cf4d8"
integrity sha512-v9+bvQ2+OsK7eGyDHzMuPawTu2LovRCsuArFeMnaG/AbexkqnbB74w+h3vh/2npuHzrnk8RZkM2c4pp/ycqfKw==
dependencies:
"@budibase/types" "^1.0.212-alpha.15"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
bcrypt "5.0.1"
@ -1162,13 +1161,12 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@1.0.212-alpha.15":
version "1.0.212-alpha.15"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.212-alpha.15.tgz#b1fe270960828ee5e096b7f958114c3782303deb"
integrity sha512-sAUeauSROZiTdQUB8PSjVrGi+C//sMvxs5B4kSBgu0+pJ5kDaa6jOd291dMfDFgVTlHQJvzGM0Z+FXooYIHLAQ==
"@budibase/pro@1.0.218":
version "1.0.218"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.218.tgz#b9e5bb95cca996dc1f7f783a3a02e51cbbf3df55"
integrity sha512-LJpV4rYPP9DzMNkL2Y0euZplkubBKBE+gc5JBTMt1l9Fwn2Sri/Y5bQ+U8fjczjmHxYnZLrFwH+o6LCnk/QJow==
dependencies:
"@budibase/backend-core" "1.0.212-alpha.15"
"@budibase/types" "1.0.212-alpha.12"
"@budibase/backend-core" "1.0.218"
node-fetch "^2.6.1"
"@budibase/standard-components@^0.9.139":
@ -1189,16 +1187,6 @@
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
"@budibase/types@1.0.212-alpha.12":
version "1.0.212-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.212-alpha.12.tgz#d45aa03d18f9ddc20d66e034072c0dc759eaf1ed"
integrity sha512-o4ZXUuqW6ryLj9/LptXBRwPPofl6PB5eo+HDt7KNMq7beVSC48uS+N/cQEF325OKrrulZRAGEStnUaLkFz3M9A==
"@budibase/types@^1.0.212-alpha.15":
version "1.0.218"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.218.tgz#534dd41c4a42a9061256c75b46bd78ec27ce47cd"
integrity sha512-X5mNdkHZtjEp/B+5mrtcTTUAj76XkF1U6/kEA9sQ9XHano9b22u/gbXTm/VdSuwqTXwN9abh5xAHhZDNSCrgiw==
"@bull-board/api@3.7.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af"

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.0.212-alpha.15",
"version": "1.0.219-alpha.11",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -34,10 +34,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "^1.0.212-alpha.15",
"@budibase/pro": "1.0.212-alpha.15",
"@budibase/string-templates": "^1.0.212-alpha.15",
"@budibase/types": "^1.0.212-alpha.15",
"@budibase/backend-core": "^1.0.219-alpha.11",
"@budibase/pro": "1.0.219-alpha.11",
"@budibase/string-templates": "^1.0.219-alpha.11",
"@budibase/types": "^1.0.219-alpha.11",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View File

@ -293,12 +293,11 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.212-alpha.15":
version "1.0.212-alpha.15"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.212-alpha.15.tgz#90ad9fed55a1e08c3ae69069e5d01e51477afd13"
integrity sha512-auIkpv9/W6iA1brt4vUtZivTS/8baqgPATOb+CCGzCukcDvrxkBQEEepAz0DYonKlFznsKSMkjOvgAY70wcm2Q==
"@budibase/backend-core@1.0.218":
version "1.0.218"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.218.tgz#be101c8baf220fa3fc55d63071bb38fc6c8cf4d8"
integrity sha512-v9+bvQ2+OsK7eGyDHzMuPawTu2LovRCsuArFeMnaG/AbexkqnbB74w+h3vh/2npuHzrnk8RZkM2c4pp/ycqfKw==
dependencies:
"@budibase/types" "^1.0.212-alpha.15"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
bcrypt "5.0.1"
@ -326,24 +325,13 @@
uuid "8.3.2"
zlib "1.0.5"
"@budibase/pro@1.0.212-alpha.15":
version "1.0.212-alpha.15"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.212-alpha.15.tgz#b1fe270960828ee5e096b7f958114c3782303deb"
integrity sha512-sAUeauSROZiTdQUB8PSjVrGi+C//sMvxs5B4kSBgu0+pJ5kDaa6jOd291dMfDFgVTlHQJvzGM0Z+FXooYIHLAQ==
dependencies:
"@budibase/backend-core" "1.0.212-alpha.15"
"@budibase/types" "1.0.212-alpha.12"
node-fetch "^2.6.1"
"@budibase/types@1.0.212-alpha.12":
version "1.0.212-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.212-alpha.12.tgz#d45aa03d18f9ddc20d66e034072c0dc759eaf1ed"
integrity sha512-o4ZXUuqW6ryLj9/LptXBRwPPofl6PB5eo+HDt7KNMq7beVSC48uS+N/cQEF325OKrrulZRAGEStnUaLkFz3M9A==
"@budibase/types@^1.0.212-alpha.15":
"@budibase/pro@1.0.218":
version "1.0.218"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.218.tgz#534dd41c4a42a9061256c75b46bd78ec27ce47cd"
integrity sha512-X5mNdkHZtjEp/B+5mrtcTTUAj76XkF1U6/kEA9sQ9XHano9b22u/gbXTm/VdSuwqTXwN9abh5xAHhZDNSCrgiw==
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.218.tgz#b9e5bb95cca996dc1f7f783a3a02e51cbbf3df55"
integrity sha512-LJpV4rYPP9DzMNkL2Y0euZplkubBKBE+gc5JBTMt1l9Fwn2Sri/Y5bQ+U8fjczjmHxYnZLrFwH+o6LCnk/QJow==
dependencies:
"@budibase/backend-core" "1.0.218"
node-fetch "^2.6.1"
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"

View File

@ -36,10 +36,11 @@ cd ../budibase-pro
# Install NPM credentials
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
# Sync backend-core version in packages/pro/package.json
# Sync budibase dependency versions in packages/pro/package.json
# Ensures pro does not use out of date dependency
cd packages/pro
jq '.dependencies."@budibase/backend-core"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
jq '.dependencies."@budibase/types"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
# Go back to pro repo root
cd -
@ -91,4 +92,4 @@ cd -
git add packages/server/package.json
git add packages/worker/package.json
git commit -m "Update pro version to $VERSION"
git push
git push