From cb2b861032ffbe6da489cf1973ee484da898a8f6 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 22 Nov 2022 16:52:56 +0000 Subject: [PATCH 001/114] Add User endpoints --- .../internal-api/TestConfiguration/index.ts | 3 + .../TestConfiguration/userManagement.ts | 43 ++++++++++++ .../internal-api/fixtures/userManagement.ts | 67 +++++++++++++++++++ .../userManagement/userManagement.spec.ts | 24 +++++++ 4 files changed, 137 insertions(+) create mode 100644 qa-core/src/config/internal-api/TestConfiguration/userManagement.ts create mode 100644 qa-core/src/config/internal-api/fixtures/userManagement.ts create mode 100644 qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index ab996f7144..8ce5e94bc3 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -4,6 +4,7 @@ import InternalAPIClient from "./InternalAPIClient" import TablesApi from "./tables" import RowApi from "./rows" import ScreenApi from "./screens" +import UserManagementApi from "./userManagement" export default class TestConfiguration { applications: ApplicationApi @@ -12,6 +13,7 @@ export default class TestConfiguration { context: T tables: TablesApi rows: RowApi + userManagement: UserManagementApi constructor(apiClient: InternalAPIClient) { this.applications = new ApplicationApi(apiClient) @@ -19,6 +21,7 @@ export default class TestConfiguration { this.rows = new RowApi(apiClient) this.auth = new AuthApi(apiClient) this.screen = new ScreenApi(apiClient) + this.userManagement = new UserManagementApi(apiClient) this.context = {} } diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts new file mode 100644 index 0000000000..3a66049fd0 --- /dev/null +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -0,0 +1,43 @@ +import { Response } from "node-fetch" +import { User } from "@budibase/types" +import InternalAPIClient from "./InternalAPIClient" +import { responseMessage } from "../fixtures/types/responseMessage" + +export default class UserManagementApi { + api: InternalAPIClient + + constructor(apiClient: InternalAPIClient) { + this.api = apiClient + } + + async searchUsers(): Promise<[Response, User[]]> { + const response = await this.api.post(`/global/users/search`, {}) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.length).toBeGreaterThan(0) + return [response, json] + } + + async getSelf(): Promise<[Response, User]> { + const response = await this.api.get(`/global/self`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } + + async getAllUsers(): Promise<[Response, User]> { + const response = await this.api.get(`/global/users`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } + + async inviteUsers(body: User[]): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/multi/invite`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.successful.length).toEqual(body.length) + expect(json.unsuccessful.length).toEqual(0) + return [response, json] + } +} diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts new file mode 100644 index 0000000000..ce15eb08e8 --- /dev/null +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -0,0 +1,67 @@ +import generator from "../../generator"; + +const randomId = generator.guid; +export const generateDeveloper = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true + } + }], + groups: [] + } +}) + +export const generateAdmin = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true + }, + builder: { + global: true + } + }], + groups: [] + } +}) +export const generateAppUser = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false + }, + builder: { + global: false + } + }], + groups: [] + } +}) + +export const generateInviteUser = (): any => ( + [{ + email: `pedro+${randomId()}@budibase.com`, + userInfo: { + admin: { + global: true + }, + builder: { + global: true + }, + userGroups: [] + } + }] +) \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts new file mode 100644 index 0000000000..67fee8e53d --- /dev/null +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -0,0 +1,24 @@ +import TestConfiguration from "../../../config/internal-api/TestConfiguration" +import { Application } from "@budibase/server/api/controllers/public/mapping/types" +import { db } from "@budibase/backend-core" +import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" +import generateApp from "../../../config/internal-api/fixtures/applications" +import generator from "../../../config/generator" +import generateScreen from "../../../config/internal-api/fixtures/screens" + +describe("Internal API - User Management", () => { + const api = new InternalAPIClient() + const config = new TestConfiguration(api) + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Get all users", async () => { + await config.userManagement.searchUsers() + }) +}) From 7f8e093a52727ff8273335bf2131ee094441e7b1 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 28 Nov 2022 22:13:07 +0000 Subject: [PATCH 002/114] Add verification --- .../TestConfiguration/userManagement.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 3a66049fd0..2ff9450939 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { User } from "@budibase/types" +import { User, UserDeletedEvent } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -14,7 +14,8 @@ export default class UserManagementApi { const response = await this.api.post(`/global/users/search`, {}) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.length).toBeGreaterThan(0) + expect(json.data.length).toBeGreaterThan(0) + expect(json.hasNextPage).toBe(false) return [response, json] } @@ -40,4 +41,21 @@ export default class UserManagementApi { expect(json.unsuccessful.length).toEqual(0) return [response, json] } + + async deleteUser(userId: string): Promise<[Response, responseMessage]> { + const body = { + delete: { + userIds: [ + userId + ] + } + } + const response = await this.api.post(`/global/users/bulk`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.deleted.successful.length).toEqual(1) + expect(json.deleted.unsuccessful.length).toEqual(0) + expect(json.deleted.successful[0].userId).toEqual(userId) + return [response, json] + } } From b9186cac9d3e45455b0627dd31f448a844422d9a Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 30 Nov 2022 11:02:11 +0000 Subject: [PATCH 003/114] Add tests for user management --- .../TestConfiguration/userManagement.ts | 31 +++-- .../internal-api/fixtures/userManagement.ts | 115 ++++++++++-------- .../userManagement/userManagement.spec.ts | 19 ++- 3 files changed, 103 insertions(+), 62 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 2ff9450939..17fe5e0b0f 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { User, UserDeletedEvent } from "@budibase/types" +import { Role, User, UserDeletedEvent } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -15,7 +15,6 @@ export default class UserManagementApi { const json = await response.json() expect(response).toHaveStatusCode(200) expect(json.data.length).toBeGreaterThan(0) - expect(json.hasNextPage).toBe(false) return [response, json] } @@ -26,19 +25,20 @@ export default class UserManagementApi { return [response, json] } - async getAllUsers(): Promise<[Response, User]> { + async getAllUsers(): Promise<[Response, User[]]> { const response = await this.api.get(`/global/users`) const json = await response.json() expect(response).toHaveStatusCode(200) + expect(json.length).toBeGreaterThan(0) return [response, json] } - async inviteUsers(body: User[]): Promise<[Response, responseMessage]> { - const response = await this.api.post(`/global/users/multi/invite`, { body }) + async addUsers(body: any): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/bulk`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.successful.length).toEqual(body.length) - expect(json.unsuccessful.length).toEqual(0) + expect(json.created.unsuccessful.length).toEqual(0) + expect(json.created.successful.length).toEqual(body.create.users.length) return [response, json] } @@ -58,4 +58,21 @@ export default class UserManagementApi { expect(json.deleted.successful[0].userId).toEqual(userId) return [response, json] } + + async inviteUser(body: any): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/multi/invite`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.created.successful.length).toEqual(body.length) + expect(json.created.unsuccessful.length).toEqual(0) + return [response, json] + } + + async getRoles(): Promise<[Response, Role[]]> { + const response = await this.api.get(`/roles`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.length).toEqual(4) + return [response, json] + } } diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index ce15eb08e8..6ada85bb49 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,59 +1,69 @@ import generator from "../../generator"; -const randomId = generator.guid; -export const generateDeveloper = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - builder: { - global: true - } - }], - groups: [] - } -}) +export const generateDeveloper = (): Object => { + const randomId = generator.guid(); + return ({ + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true + } + }], + groups: [] + } + }) +} -export const generateAdmin = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: true - }, - builder: { - global: true - } - }], - groups: [] +export const generateAdmin = (): Object => { + const randomId = generator.guid(); + return ({ + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true + }, + builder: { + global: true + } + }], + groups: [] + } + }) +} +export const generateAppUser = (): Object => { + const randomId = generator.guid(); + const user = { + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false + }, + builder: { + global: false + } + }], + groups: [] + } } -}) -export const generateAppUser = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: false - }, - builder: { - global: false - } - }], - groups: [] - } -}) + return user +} -export const generateInviteUser = (): any => ( - [{ - email: `pedro+${randomId()}@budibase.com`, +export const generateInviteUser = (): Object[] => { + const randomId = generator.guid(); + return [{ + email: `pedro+${randomId}@budibase.com`, userInfo: { admin: { global: true @@ -64,4 +74,5 @@ export const generateInviteUser = (): any => ( userGroups: [] } }] -) \ No newline at end of file + +} \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 67fee8e53d..62d27ec2a4 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -4,9 +4,9 @@ import { db } from "@budibase/backend-core" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" import generateApp from "../../../config/internal-api/fixtures/applications" import generator from "../../../config/generator" -import generateScreen from "../../../config/internal-api/fixtures/screens" +import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" -describe("Internal API - User Management", () => { +describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() const config = new TestConfiguration(api) @@ -18,7 +18,20 @@ describe("Internal API - User Management", () => { await config.afterAll() }) - it("Get all users", async () => { + it("Add Users with different roles", async () => { await config.userManagement.searchUsers() + await config.userManagement.getRoles() + + const [adminResponse, adminData] = await config.userManagement.addUsers(generateAdmin()) + const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) + const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) + + const [invitedUserResponse, invitedUserData] = await config.userManagement.addUsers(generateInviteUser()) + + const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() + expect(allUsersData.length).toEqual(4) + }) + + }) From 1c0767f549e4669574e8eef7f8f05625cabe4779 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 2 Dec 2022 18:42:56 +0000 Subject: [PATCH 004/114] Add users with all roles --- .../config/internal-api/TestConfiguration/userManagement.ts | 5 +++-- qa-core/src/config/internal-api/fixtures/userManagement.ts | 6 ------ .../internal-api/userManagement/userManagement.spec.ts | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 17fe5e0b0f..0bc8fd7b66 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -63,8 +63,9 @@ export default class UserManagementApi { const response = await this.api.post(`/global/users/multi/invite`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.created.successful.length).toEqual(body.length) - expect(json.created.unsuccessful.length).toEqual(0) + expect(json.unsuccessful.length).toEqual(0) + expect(json.successful.length).toEqual(body.length) + return [response, json] } diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 6ada85bb49..035f6162f1 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -65,12 +65,6 @@ export const generateInviteUser = (): Object[] => { return [{ email: `pedro+${randomId}@budibase.com`, userInfo: { - admin: { - global: true - }, - builder: { - global: true - }, userGroups: [] } }] diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 62d27ec2a4..c18b6aaeff 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -26,7 +26,7 @@ describe("Internal API - User Management & Permissions", () => { const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) - const [invitedUserResponse, invitedUserData] = await config.userManagement.addUsers(generateInviteUser()) + const [invitedUserResponse, invitedUserData] = await config.userManagement.inviteUser(generateInviteUser()) const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() expect(allUsersData.length).toEqual(4) From c0c8262561e48fa316f9772b093ae862c103c042 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 2 Dec 2022 18:59:08 +0000 Subject: [PATCH 005/114] Add generic login method --- .../config/internal-api/TestConfiguration/auth.ts | 14 +++++++++++++- .../config/internal-api/TestConfiguration/index.ts | 8 ++++++-- .../config/internal-api/fixtures/userManagement.ts | 4 ++-- .../internal-api/applications/applications.spec.ts | 2 +- .../src/tests/internal-api/screens/screens.spec.ts | 2 +- .../src/tests/internal-api/tables/tables.spec.ts | 2 +- .../userManagement/userManagement.spec.ts | 6 ++---- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/auth.ts b/qa-core/src/config/internal-api/TestConfiguration/auth.ts index d83c859ab3..d72502b417 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/auth.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/auth.ts @@ -8,7 +8,7 @@ export default class AuthApi { this.api = apiClient } - async login(): Promise<[Response, any]> { + async loginAsAdmin(): Promise<[Response, any]> { const response = await this.api.post(`/global/auth/default/login`, { body: { username: process.env.BB_ADMIN_USER_EMAIL, @@ -20,6 +20,18 @@ export default class AuthApi { return [response, cookie] } + async login(email: String, password: String): Promise<[Response, any]> { + const response = await this.api.post(`/global/auth/default/login`, { + body: { + username: email, + password: password, + }, + }) + const cookie = response.headers.get("set-cookie") + this.api.cookie = cookie as any + return [response, cookie] + } + async logout(): Promise { return this.api.post(`/global/auth/logout`) } diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index 8ce5e94bc3..b424b32416 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -25,8 +25,12 @@ export default class TestConfiguration { this.context = {} } - async beforeAll() { - await this.auth.login() + async loginAsAdmin() { + await this.auth.login(process.env.BB_ADMIN_USER_EMAIL, process.env.BB_ADMIN_USER_PASSWORD) + } + + async login(email: String, password: String) { + await this.auth.login(email, password) } async afterAll() { diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 035f6162f1..5c5979256f 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -61,9 +61,9 @@ export const generateAppUser = (): Object => { } export const generateInviteUser = (): Object[] => { - const randomId = generator.guid(); + //const randomId = generator.guid(); return [{ - email: `pedro+${randomId}@budibase.com`, + email: `pedro+test@budibase.com`, userInfo: { userGroups: [] } diff --git a/qa-core/src/tests/internal-api/applications/applications.spec.ts b/qa-core/src/tests/internal-api/applications/applications.spec.ts index 98895a6f28..c7738152c4 100644 --- a/qa-core/src/tests/internal-api/applications/applications.spec.ts +++ b/qa-core/src/tests/internal-api/applications/applications.spec.ts @@ -11,7 +11,7 @@ describe("Internal API - Application creation, update, publish and delete", () = const config = new TestConfiguration(api) beforeAll(async () => { - await config.beforeAll() + await config.loginAsAdmin() }) afterAll(async () => { diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index 218d71cb0d..1af13d0a11 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -11,7 +11,7 @@ describe("Internal API - /screens endpoints", () => { const appConfig = new TestConfiguration(api) beforeAll(async () => { - await config.beforeAll() + await config.loginAsAdmin() }) afterAll(async () => { diff --git a/qa-core/src/tests/internal-api/tables/tables.spec.ts b/qa-core/src/tests/internal-api/tables/tables.spec.ts index 4f9e4299cf..6b2d2240e5 100644 --- a/qa-core/src/tests/internal-api/tables/tables.spec.ts +++ b/qa-core/src/tests/internal-api/tables/tables.spec.ts @@ -13,7 +13,7 @@ describe("Internal API - Application creation, update, publish and delete", () = const config = new TestConfiguration(api) beforeAll(async () => { - await config.beforeAll() + await config.loginAsAdmin() }) afterAll(async () => { diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index c18b6aaeff..7e38409723 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -11,7 +11,7 @@ describe("Internal API - User Management & Permissions", () => { const config = new TestConfiguration(api) beforeAll(async () => { - await config.beforeAll() + await config.loginAsAdmin() }) afterAll(async () => { @@ -26,10 +26,8 @@ describe("Internal API - User Management & Permissions", () => { const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) - const [invitedUserResponse, invitedUserData] = await config.userManagement.inviteUser(generateInviteUser()) - const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() - expect(allUsersData.length).toEqual(4) + expect(allUsersData.length).toBeGreaterThan(0) }) From 0034bbbe2d0a5a51edb833a577898460c22fa2eb Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 2 Dec 2022 19:04:23 +0000 Subject: [PATCH 006/114] Record generated users passwords in test context --- .../userManagement/userManagement.spec.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 7e38409723..f7442a34fc 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -5,6 +5,7 @@ import InternalAPIClient from "../../../config/internal-api/TestConfiguration/In import generateApp from "../../../config/internal-api/fixtures/applications" import generator from "../../../config/generator" import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" +import generate from "../../../config/internal-api/fixtures/applications" describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() @@ -22,9 +23,14 @@ describe("Internal API - User Management & Permissions", () => { await config.userManagement.searchUsers() await config.userManagement.getRoles() - const [adminResponse, adminData] = await config.userManagement.addUsers(generateAdmin()) - const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) - const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) + // These need to be saved to the context so the passwords can be used to login + const admin = generateAdmin() + const developer = generateDeveloper() + const appUser = generateAppUser() + + const [adminResponse, adminData] = await config.userManagement.addUsers(admin) + const [devResponse, devData] = await config.userManagement.addUsers(developer) + const [userResponse, userData] = await config.userManagement.addUsers(appUser) const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() expect(allUsersData.length).toBeGreaterThan(0) From 895c29d45fdf94cc7f9f6dce273d43c70e90e652 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 5 Dec 2022 17:54:40 +0000 Subject: [PATCH 007/114] Add Tests for changes to user information/roles --- .../TestConfiguration/userManagement.ts | 36 +++++++++++++-- .../userManagement/userManagement.spec.ts | 46 ++++++++++++++++--- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 0bc8fd7b66..4bdec74cc4 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -33,7 +33,7 @@ export default class UserManagementApi { return [response, json] } - async addUsers(body: any): Promise<[Response, responseMessage]> { + async addUsers(body: any): Promise<[Response, any]> { const response = await this.api.post(`/global/users/bulk`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -42,7 +42,7 @@ export default class UserManagementApi { return [response, json] } - async deleteUser(userId: string): Promise<[Response, responseMessage]> { + async deleteMultipleUsers(userId: string[]): Promise<[Response, responseMessage]> { const body = { delete: { userIds: [ @@ -58,6 +58,13 @@ export default class UserManagementApi { expect(json.deleted.successful[0].userId).toEqual(userId) return [response, json] } + async deleteUser(userId: string): Promise<[Response, UserDeletedEvent]> { + const response = await this.api.del(`/global/users/${userId}`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.message).toEqual(`User ${userId} deleted.`) + return [response, json] + } async inviteUser(body: any): Promise<[Response, responseMessage]> { const response = await this.api.post(`/global/users/multi/invite`, { body }) @@ -76,4 +83,27 @@ export default class UserManagementApi { expect(json.length).toEqual(4) return [response, json] } -} + + async changeUserInformation(body: any): Promise<[Response, User]> { + const response = await this.api.post(`/global/users/`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } + + async forcePasswordReset(body: any): Promise<[Response, User]> { + const response = await this.api.post(`/global/users/`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } + + async getUserInformation(userId: string): Promise<[Response, User]> { + const response = await this.api.get(`/global/users/${userId}`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } +} \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index f7442a34fc..09b8501e0c 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -1,11 +1,7 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" -import { db } from "@budibase/backend-core" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import generateApp from "../../../config/internal-api/fixtures/applications" -import generator from "../../../config/generator" import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" -import generate from "../../../config/internal-api/fixtures/applications" describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() @@ -28,13 +24,49 @@ describe("Internal API - User Management & Permissions", () => { const developer = generateDeveloper() const appUser = generateAppUser() - const [adminResponse, adminData] = await config.userManagement.addUsers(admin) - const [devResponse, devData] = await config.userManagement.addUsers(developer) - const [userResponse, userData] = await config.userManagement.addUsers(appUser) + await config.userManagement.addUsers(admin) + await config.userManagement.addUsers(developer) + await config.userManagement.addUsers(appUser) const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() expect(allUsersData.length).toBeGreaterThan(0) + + + }) + + it("Delete User", async () => { + const appUser = generateAppUser() + const [userResponse, userData] = await config.userManagement.addUsers(appUser) + const userId = userData.created.successful[0]._id + await config.userManagement.deleteUser(userId) + }) + + it("Reset Password", async () => { + const appUser = generateAppUser() + const [userResponse, userData] = await config.userManagement.addUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userData.created.successful[0]._id) + const body = { + ...userInfoJson, + password: "newPassword" + + } + await config.userManagement.forcePasswordReset(body) + }) + + it("Change User information", async () => { + const appUser = generateAppUser() + const [userResponse, userData] = await config.userManagement.addUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userData.created.successful[0]._id) + const body = { + ...userInfoJson, + builder: { + global: true + } + } + const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) + expect(changedUserJson.builder?.global).toBeDefined() + expect(changedUserJson.builder?.global).toEqual(true) }) From d2a8923d0da700777cf90524cd94cde7f20fa2af Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 6 Dec 2022 16:14:00 +0000 Subject: [PATCH 008/114] Add tests for Roles --- .../TestConfiguration/applications.ts | 5 +- .../userManagement/userManagement.spec.ts | 94 +++++++++++++++++-- 2 files changed, 91 insertions(+), 8 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 13d0969854..7eeda01f0e 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -13,12 +13,13 @@ export default class AppApi { constructor(apiClient: InternalAPIClient) { this.api = apiClient } - + // TODO Fix the fetch apps to receive an optional number of apps and compare if the received app is more or less. + // each possible scenario should have its own method. async fetchEmptyAppList(): Promise<[Response, Application[]]> { const response = await this.api.get(`/applications?status=all`) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.length).toEqual(0) + expect(json.length).toBeGreaterThanOrEqual(0) return [response, json] } diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 09b8501e0c..1f5ac695a9 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -1,7 +1,9 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" +import generateApp from "../../../config/internal-api/fixtures/applications" import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" +import { User } from "@budibase/types" describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() @@ -46,7 +48,7 @@ describe("Internal API - User Management & Permissions", () => { const appUser = generateAppUser() const [userResponse, userData] = await config.userManagement.addUsers(appUser) const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userData.created.successful[0]._id) - const body = { + const body: User = { ...userInfoJson, password: "newPassword" @@ -56,18 +58,98 @@ describe("Internal API - User Management & Permissions", () => { it("Change User information", async () => { const appUser = generateAppUser() - const [userResponse, userData] = await config.userManagement.addUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userData.created.successful[0]._id) - const body = { + const [userResponse, userJson] = await config.userManagement.addUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) + const body: User = { ...userInfoJson, + firstName: "newFirstName", + lastName: "newLastName", builder: { global: true } } const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) - expect(changedUserJson.builder?.global).toBeDefined() - expect(changedUserJson.builder?.global).toEqual(true) + expect(changedUserJson._id).toEqual(userJson.created.successful[0]._id) + expect(changedUserJson._rev).not.toEqual(userJson.created.successful[0]._rev) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) + expect(changedUserInfoJson.builder?.global).toBeDefined() + expect(changedUserInfoJson.builder?.global).toEqual(true) }) + it("Add BASIC user to app", async () => { + const basicUser = generateAppUser() + + const [createUserResponse, createUserJson] = await config.userManagement.addUsers(basicUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId?.toString() || ""]: "BASIC", + } + } + const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) + expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) + expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("BASIC") + + }) + + it("Add ADMIN user to app", async () => { + const adminUser = generateAdmin() + + const [createUserResponse, createUserJson] = await config.userManagement.addUsers(adminUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId?.toString() || ""]: "ADMIN", + } + } + const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) + expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) + expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("ADMIN") + + }) + + it("Add POWER user to app", async () => { + const powerUser = generateDeveloper() + + const [createUserResponse, createUserJson] = await config.userManagement.addUsers(powerUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId?.toString() || ""]: "POWER", + } + } + const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) + expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) + expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("POWER") + + }) }) From c03ee6a61369c6c71a8cf2b89a90eea263bb010f Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 6 Dec 2022 16:16:07 +0000 Subject: [PATCH 009/114] Fix names --- .../userManagement/userManagement.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 1f5ac695a9..faea247204 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -30,8 +30,8 @@ describe("Internal API - User Management & Permissions", () => { await config.userManagement.addUsers(developer) await config.userManagement.addUsers(appUser) - const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() - expect(allUsersData.length).toBeGreaterThan(0) + const [allUsersResponse, allUsersJson] = await config.userManagement.getAllUsers() + expect(allUsersJson.length).toBeGreaterThan(0) @@ -39,15 +39,15 @@ describe("Internal API - User Management & Permissions", () => { it("Delete User", async () => { const appUser = generateAppUser() - const [userResponse, userData] = await config.userManagement.addUsers(appUser) - const userId = userData.created.successful[0]._id + const [userResponse, userJson] = await config.userManagement.addUsers(appUser) + const userId = userJson.created.successful[0]._id await config.userManagement.deleteUser(userId) }) it("Reset Password", async () => { const appUser = generateAppUser() - const [userResponse, userData] = await config.userManagement.addUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userData.created.successful[0]._id) + const [userResponse, userJson] = await config.userManagement.addUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) const body: User = { ...userInfoJson, password: "newPassword" From 4467d2b0050b798f1e94cbf2817f444cce2b166e Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 6 Dec 2022 18:20:02 +0000 Subject: [PATCH 010/114] Remove duplicated assertions --- .../TestConfiguration/userManagement.ts | 2 ++ .../userManagement/userManagement.spec.ts | 16 ++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 4bdec74cc4..33d53a6604 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -88,6 +88,8 @@ export default class UserManagementApi { const response = await this.api.post(`/global/users/`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) return [response, json] } diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index faea247204..099d79df1c 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -68,9 +68,7 @@ describe("Internal API - User Management & Permissions", () => { global: true } } - const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) - expect(changedUserJson._id).toEqual(userJson.created.successful[0]._id) - expect(changedUserJson._rev).not.toEqual(userJson.created.successful[0]._rev) + await config.userManagement.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) expect(changedUserInfoJson.builder?.global).toBeDefined() @@ -92,9 +90,7 @@ describe("Internal API - User Management & Permissions", () => { [app.appId?.toString() || ""]: "BASIC", } } - const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) - expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) - expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + await config.userManagement.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() @@ -117,9 +113,7 @@ describe("Internal API - User Management & Permissions", () => { [app.appId?.toString() || ""]: "ADMIN", } } - const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) - expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) - expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + await config.userManagement.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() @@ -142,9 +136,7 @@ describe("Internal API - User Management & Permissions", () => { [app.appId?.toString() || ""]: "POWER", } } - const [changedUserResponse, changedUserJson] = await config.userManagement.changeUserInformation(body) - expect(changedUserJson._id).toEqual(createUserJson.created.successful[0]._id) - expect(changedUserJson._rev).not.toEqual(createUserJson.created.successful[0]._rev) + await config.userManagement.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() From 6d87a38ab3b0a30ff3e451ec88d9a7d71dac1ec7 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 9 Dec 2022 17:34:59 +0000 Subject: [PATCH 011/114] Changes to types and user generation --- .../internal-api/TestConfiguration/index.ts | 8 +- .../TestConfiguration/userManagement.ts | 8 +- .../internal-api/fixtures/userManagement.ts | 99 ++++++++++--------- .../userManagement/userManagement.spec.ts | 92 +++++++++-------- 4 files changed, 118 insertions(+), 89 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index b424b32416..a82c1fdf03 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -13,7 +13,7 @@ export default class TestConfiguration { context: T tables: TablesApi rows: RowApi - userManagement: UserManagementApi + users: UserManagementApi constructor(apiClient: InternalAPIClient) { this.applications = new ApplicationApi(apiClient) @@ -21,15 +21,15 @@ export default class TestConfiguration { this.rows = new RowApi(apiClient) this.auth = new AuthApi(apiClient) this.screen = new ScreenApi(apiClient) - this.userManagement = new UserManagementApi(apiClient) + this.users = new UserManagementApi(apiClient) this.context = {} } async loginAsAdmin() { - await this.auth.login(process.env.BB_ADMIN_USER_EMAIL, process.env.BB_ADMIN_USER_PASSWORD) + await this.auth.login(process.env.BB_ADMIN_USER_EMAIL, process.env.BB_ADMIN_USER_PASSWORD) } - async login(email: String, password: String) { + async login(email: string, password: string) { await this.auth.login(email, password) } diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 33d53a6604..52f610ab17 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -33,7 +33,13 @@ export default class UserManagementApi { return [response, json] } - async addUsers(body: any): Promise<[Response, any]> { + async addMultipleUsers(userList: User[]): Promise<[Response, any]> { + const body = { + create: { + users: userList, + groups: [] + } + } const response = await this.api.post(`/global/users/bulk`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 5c5979256f..78374ae6e1 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,63 +1,51 @@ import generator from "../../generator"; +import { User } from "@budibase/types"; +import { generateUserMetadataID } from "@budibase/backend-core/src/db"; -export const generateDeveloper = (): Object => { + +const generateDeveloper = (): User => { const randomId = generator.guid(); return ({ - create: { - users: [{ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - builder: { - global: true - } - }], - groups: [] + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true } }) } -export const generateAdmin = (): Object => { +const generateAdmin = (): User => { const randomId = generator.guid(); return ({ - create: { - users: [{ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: true - }, - builder: { - global: true - } - }], - groups: [] + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true + }, + builder: { + global: true } }) } -export const generateAppUser = (): Object => { +const generateAppUser = (): User => { const randomId = generator.guid(); - const user = { - create: { - users: [{ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: false - }, - builder: { - global: false - } - }], - groups: [] + return ({ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false + }, + builder: { + global: false } - } - return user + }) + } export const generateInviteUser = (): Object[] => { @@ -69,4 +57,25 @@ export const generateInviteUser = (): Object[] => { } }] +} + +export const generateUser = (amount: number = 1, role?: string): User[] => { + const userList: User[] = []; + for (let i = 0; i < amount; i++) { + switch (role) { + case "admin": + userList.push(generateAdmin()); + break; + case "developer": + userList.push(generateDeveloper()); + break; + case "appUser": + userList.push(generateAppUser()); + break; + default: + userList.push(generateAppUser()); + break; + } + } + return userList } \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 099d79df1c..cd8d9cbf65 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -2,7 +2,7 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" import generateApp from "../../../config/internal-api/fixtures/applications" -import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" +import { generateUser } from "../../../config/internal-api/fixtures/userManagement" import { User } from "@budibase/types" describe("Internal API - User Management & Permissions", () => { @@ -18,19 +18,24 @@ describe("Internal API - User Management & Permissions", () => { }) it("Add Users with different roles", async () => { - await config.userManagement.searchUsers() - await config.userManagement.getRoles() + await config.users.searchUsers() + await config.users.getRoles() // These need to be saved to the context so the passwords can be used to login - const admin = generateAdmin() - const developer = generateDeveloper() - const appUser = generateAppUser() + const admin = generateUser(1, "admin") + expect(admin[0].builder?.global).toEqual(true) + expect(admin[0].admin?.global).toEqual(true) + const developer = generateUser(1, "developer") + expect(developer[0].builder?.global).toEqual(true) + const appUser = generateUser(1, "appUser") + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) - await config.userManagement.addUsers(admin) - await config.userManagement.addUsers(developer) - await config.userManagement.addUsers(appUser) + await config.users.addMultipleUsers(admin) + await config.users.addMultipleUsers(developer) + await config.users.addMultipleUsers(appUser) - const [allUsersResponse, allUsersJson] = await config.userManagement.getAllUsers() + const [allUsersResponse, allUsersJson] = await config.users.getAllUsers() expect(allUsersJson.length).toBeGreaterThan(0) @@ -38,28 +43,34 @@ describe("Internal API - User Management & Permissions", () => { }) it("Delete User", async () => { - const appUser = generateAppUser() - const [userResponse, userJson] = await config.userManagement.addUsers(appUser) + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) const userId = userJson.created.successful[0]._id - await config.userManagement.deleteUser(userId) + await config.users.deleteUser(userId) }) it("Reset Password", async () => { - const appUser = generateAppUser() - const [userResponse, userJson] = await config.userManagement.addUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) const body: User = { ...userInfoJson, password: "newPassword" } - await config.userManagement.forcePasswordReset(body) + await config.users.forcePasswordReset(body) }) it("Change User information", async () => { - const appUser = generateAppUser() - const [userResponse, userJson] = await config.userManagement.addUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) const body: User = { ...userInfoJson, firstName: "newFirstName", @@ -68,77 +79,80 @@ describe("Internal API - User Management & Permissions", () => { global: true } } - await config.userManagement.changeUserInformation(body) + await config.users.changeUserInformation(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(userJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) expect(changedUserInfoJson.builder?.global).toBeDefined() expect(changedUserInfoJson.builder?.global).toEqual(true) }) it("Add BASIC user to app", async () => { - const basicUser = generateAppUser() - - const [createUserResponse, createUserJson] = await config.userManagement.addUsers(basicUser) + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(appUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "BASIC", } } - await config.userManagement.changeUserInformation(body) + await config.users.changeUserInformation(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("BASIC") }) it("Add ADMIN user to app", async () => { - const adminUser = generateAdmin() - - const [createUserResponse, createUserJson] = await config.userManagement.addUsers(adminUser) + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(adminUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "ADMIN", } } - await config.userManagement.changeUserInformation(body) + await config.users.changeUserInformation(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("ADMIN") }) it("Add POWER user to app", async () => { - const powerUser = generateDeveloper() + const powerUser = generateUser(1, 'Developer') + expect(powerUser[0].builder?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.userManagement.addUsers(powerUser) + const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(powerUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "POWER", } } - await config.userManagement.changeUserInformation(body) + await config.users.changeUserInformation(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.userManagement.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("POWER") From b995575189b84575eb63ae278158619655644329 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 9 Dec 2022 17:49:45 +0000 Subject: [PATCH 012/114] Add partial user type --- .../internal-api/TestConfiguration/userManagement.ts | 8 ++++---- .../src/config/internal-api/fixtures/userManagement.ts | 10 +++++----- .../internal-api/userManagement/userManagement.spec.ts | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 52f610ab17..4a6dbfd1e1 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -10,7 +10,7 @@ export default class UserManagementApi { this.api = apiClient } - async searchUsers(): Promise<[Response, User[]]> { + async searchUsers(): Promise<[Response, Partial[]]> { const response = await this.api.post(`/global/users/search`, {}) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -18,14 +18,14 @@ export default class UserManagementApi { return [response, json] } - async getSelf(): Promise<[Response, User]> { + async getSelf(): Promise<[Response, Partial]> { const response = await this.api.get(`/global/self`) const json = await response.json() expect(response).toHaveStatusCode(200) return [response, json] } - async getAllUsers(): Promise<[Response, User[]]> { + async getAllUsers(): Promise<[Response, Partial[]]> { const response = await this.api.get(`/global/users`) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -33,7 +33,7 @@ export default class UserManagementApi { return [response, json] } - async addMultipleUsers(userList: User[]): Promise<[Response, any]> { + async addMultipleUsers(userList: Partial[]): Promise<[Response, any]> { const body = { create: { users: userList, diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 78374ae6e1..077f42ae57 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -3,7 +3,7 @@ import { User } from "@budibase/types"; import { generateUserMetadataID } from "@budibase/backend-core/src/db"; -const generateDeveloper = (): User => { +const generateDeveloper = (): Partial => { const randomId = generator.guid(); return ({ email: `pedro+${randomId}@budibase.com`, @@ -16,7 +16,7 @@ const generateDeveloper = (): User => { }) } -const generateAdmin = (): User => { +const generateAdmin = (): Partial => { const randomId = generator.guid(); return ({ email: `pedro+${randomId}@budibase.com`, @@ -31,7 +31,7 @@ const generateAdmin = (): User => { } }) } -const generateAppUser = (): User => { +const generateAppUser = (): Partial => { const randomId = generator.guid(); return ({ email: `pedro+${randomId}@budibase.com`, @@ -59,8 +59,8 @@ export const generateInviteUser = (): Object[] => { } -export const generateUser = (amount: number = 1, role?: string): User[] => { - const userList: User[] = []; +export const generateUser = (amount: number = 1, role?: string): Partial[] => { + const userList: Partial[] = []; for (let i = 0; i < amount; i++) { switch (role) { case "admin": diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index cd8d9cbf65..78cb6deca0 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -135,7 +135,7 @@ describe("Internal API - User Management & Permissions", () => { }) it("Add POWER user to app", async () => { - const powerUser = generateUser(1, 'Developer') + const powerUser = generateUser(1, 'developer') expect(powerUser[0].builder?.global).toEqual(true) const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(powerUser) @@ -153,8 +153,8 @@ describe("Internal API - User Management & Permissions", () => { await config.users.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("POWER") + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") }) From fbf50f0ddf931c96e56f2a78486a514324e5271a Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 9 Dec 2022 17:52:33 +0000 Subject: [PATCH 013/114] Remove explicit toString --- .../internal-api/userManagement/userManagement.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 78cb6deca0..4f6eefc247 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -105,8 +105,8 @@ describe("Internal API - User Management & Permissions", () => { await config.users.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("BASIC") + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") }) @@ -129,8 +129,8 @@ describe("Internal API - User Management & Permissions", () => { await config.users.changeUserInformation(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId?.toString() || ""]).toEqual("ADMIN") + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") }) From d390fe7d8d83aebdf607948cd80b062218639681 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 9 Dec 2022 18:00:13 +0000 Subject: [PATCH 014/114] Rename users methods --- .../TestConfiguration/userManagement.ts | 16 +++--- .../internal-api/fixtures/userManagement.ts | 4 +- .../userManagement/userManagement.spec.ts | 50 +++++++++---------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 4a6dbfd1e1..e323c3a098 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -10,7 +10,7 @@ export default class UserManagementApi { this.api = apiClient } - async searchUsers(): Promise<[Response, Partial[]]> { + async search(): Promise<[Response, Partial[]]> { const response = await this.api.post(`/global/users/search`, {}) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -25,7 +25,7 @@ export default class UserManagementApi { return [response, json] } - async getAllUsers(): Promise<[Response, Partial[]]> { + async getAll(): Promise<[Response, Partial[]]> { const response = await this.api.get(`/global/users`) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -33,7 +33,7 @@ export default class UserManagementApi { return [response, json] } - async addMultipleUsers(userList: Partial[]): Promise<[Response, any]> { + async addMultiple(userList: Partial[]): Promise<[Response, any]> { const body = { create: { users: userList, @@ -48,7 +48,7 @@ export default class UserManagementApi { return [response, json] } - async deleteMultipleUsers(userId: string[]): Promise<[Response, responseMessage]> { + async deleteMultiple(userId: string[]): Promise<[Response, responseMessage]> { const body = { delete: { userIds: [ @@ -64,7 +64,7 @@ export default class UserManagementApi { expect(json.deleted.successful[0].userId).toEqual(userId) return [response, json] } - async deleteUser(userId: string): Promise<[Response, UserDeletedEvent]> { + async delete(userId: string): Promise<[Response, UserDeletedEvent]> { const response = await this.api.del(`/global/users/${userId}`) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -72,7 +72,7 @@ export default class UserManagementApi { return [response, json] } - async inviteUser(body: any): Promise<[Response, responseMessage]> { + async invite(body: any): Promise<[Response, responseMessage]> { const response = await this.api.post(`/global/users/multi/invite`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -90,7 +90,7 @@ export default class UserManagementApi { return [response, json] } - async changeUserInformation(body: any): Promise<[Response, User]> { + async updateInfo(body: any): Promise<[Response, User]> { const response = await this.api.post(`/global/users/`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -108,7 +108,7 @@ export default class UserManagementApi { return [response, json] } - async getUserInformation(userId: string): Promise<[Response, User]> { + async getInfo(userId: string): Promise<[Response, User]> { const response = await this.api.get(`/global/users/${userId}`) const json = await response.json() expect(response).toHaveStatusCode(200) diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 077f42ae57..446ae3b0c5 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -49,9 +49,9 @@ const generateAppUser = (): Partial => { } export const generateInviteUser = (): Object[] => { - //const randomId = generator.guid(); + const randomId = generator.guid(); return [{ - email: `pedro+test@budibase.com`, + email: `pedro+${randomId}@budibase.com`, userInfo: { userGroups: [] } diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 4f6eefc247..92ecf96258 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -18,7 +18,7 @@ describe("Internal API - User Management & Permissions", () => { }) it("Add Users with different roles", async () => { - await config.users.searchUsers() + await config.users.search() await config.users.getRoles() // These need to be saved to the context so the passwords can be used to login @@ -31,11 +31,11 @@ describe("Internal API - User Management & Permissions", () => { expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - await config.users.addMultipleUsers(admin) - await config.users.addMultipleUsers(developer) - await config.users.addMultipleUsers(appUser) + await config.users.addMultiple(admin) + await config.users.addMultiple(developer) + await config.users.addMultiple(appUser) - const [allUsersResponse, allUsersJson] = await config.users.getAllUsers() + const [allUsersResponse, allUsersJson] = await config.users.getAll() expect(allUsersJson.length).toBeGreaterThan(0) @@ -46,17 +46,17 @@ describe("Internal API - User Management & Permissions", () => { const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) + const [userResponse, userJson] = await config.users.addMultiple(appUser) const userId = userJson.created.successful[0]._id - await config.users.deleteUser(userId) + await config.users.delete(userId) }) it("Reset Password", async () => { const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) const body: User = { ...userInfoJson, password: "newPassword" @@ -69,8 +69,8 @@ describe("Internal API - User Management & Permissions", () => { const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultipleUsers(appUser) - const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) const body: User = { ...userInfoJson, firstName: "newFirstName", @@ -79,9 +79,9 @@ describe("Internal API - User Management & Permissions", () => { global: true } } - await config.users.changeUserInformation(body) + await config.users.updateInfo(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(userJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) expect(changedUserInfoJson.builder?.global).toBeDefined() expect(changedUserInfoJson.builder?.global).toEqual(true) }) @@ -90,21 +90,21 @@ describe("Internal API - User Management & Permissions", () => { const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(appUser) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "BASIC", } } - await config.users.changeUserInformation(body) + await config.users.updateInfo(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") @@ -114,21 +114,21 @@ describe("Internal API - User Management & Permissions", () => { const adminUser = generateUser(1, "admin") expect(adminUser[0].builder?.global).toEqual(true) expect(adminUser[0].admin?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(adminUser) + const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "ADMIN", } } - await config.users.changeUserInformation(body) + await config.users.updateInfo(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") @@ -138,21 +138,21 @@ describe("Internal API - User Management & Permissions", () => { const powerUser = generateUser(1, 'developer') expect(powerUser[0].builder?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultipleUsers(powerUser) + const [createUserResponse, createUserJson] = await config.users.addMultiple(powerUser) const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId - const [userInfoResponse, userInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { [app.appId?.toString() || ""]: "POWER", } } - await config.users.changeUserInformation(body) + await config.users.updateInfo(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getUserInformation(createUserJson.created.successful[0]._id) + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") From 1765e10995aa1c436593a47d7e31f48255453ac2 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 9 Dec 2022 18:10:17 +0000 Subject: [PATCH 015/114] Remove toString --- .../internal-api/userManagement/userManagement.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 92ecf96258..e6277a5e7f 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -99,7 +99,7 @@ describe("Internal API - User Management & Permissions", () => { const body: User = { ...userInfoJson, roles: { - [app.appId?.toString() || ""]: "BASIC", + [app.appId]: "BASIC", } } await config.users.updateInfo(body) @@ -123,7 +123,7 @@ describe("Internal API - User Management & Permissions", () => { const body: User = { ...userInfoJson, roles: { - [app.appId?.toString() || ""]: "ADMIN", + [app.appId]: "ADMIN", } } await config.users.updateInfo(body) @@ -147,7 +147,7 @@ describe("Internal API - User Management & Permissions", () => { const body: User = { ...userInfoJson, roles: { - [app.appId?.toString() || ""]: "POWER", + [app.appId]: "POWER", } } await config.users.updateInfo(body) From 300b0b7b671a8b702e853992dfa1cb5bd1bcbbd0 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Sun, 11 Dec 2022 11:07:14 +0000 Subject: [PATCH 016/114] Add access tests for tables --- .../internal-api/TestConfiguration/tables.ts | 8 + .../TestConfiguration/userManagement.ts | 1 + .../internal-api/fixtures/userManagement.ts | 1 - .../userManagement/userManagement.spec.ts | 143 +++++++++++++++++- 4 files changed, 147 insertions(+), 6 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/tables.ts b/qa-core/src/config/internal-api/TestConfiguration/tables.ts index 5b7e1648a0..5e52b71c94 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/tables.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/tables.ts @@ -39,6 +39,14 @@ export default class TablesApi { return [response, json] } + async forbiddenSave(body: any): Promise<[Response, Table]> { + const response = await this.api.post(`/tables`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(403) + + return [response, json] + } + async delete( id: string, revId: string diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index e323c3a098..e602c37c8a 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -33,6 +33,7 @@ export default class UserManagementApi { return [response, json] } + // This endpoint is used for one or more users when we want add users with passwords set. async addMultiple(userList: Partial[]): Promise<[Response, any]> { const body = { create: { diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 446ae3b0c5..c036589089 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,6 +1,5 @@ import generator from "../../generator"; import { User } from "@budibase/types"; -import { generateUserMetadataID } from "@budibase/backend-core/src/db"; const generateDeveloper = (): Partial => { diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index e6277a5e7f..8110929b41 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -4,12 +4,15 @@ import InternalAPIClient from "../../../config/internal-api/TestConfiguration/In import generateApp from "../../../config/internal-api/fixtures/applications" import { generateUser } from "../../../config/internal-api/fixtures/userManagement" import { User } from "@budibase/types" +import { generateNewColumnForTable, generateTable } from "../../../config/internal-api/fixtures/table" +import generateScreen from "../../../config/internal-api/fixtures/screens" describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() const config = new TestConfiguration(api) - beforeAll(async () => { + // Before each test, login as admin. Some tests will require login as a different user + beforeEach(async () => { await config.loginAsAdmin() }) @@ -21,7 +24,6 @@ describe("Internal API - User Management & Permissions", () => { await config.users.search() await config.users.getRoles() - // These need to be saved to the context so the passwords can be used to login const admin = generateUser(1, "admin") expect(admin[0].builder?.global).toEqual(true) expect(admin[0].admin?.global).toEqual(true) @@ -31,9 +33,9 @@ describe("Internal API - User Management & Permissions", () => { expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) - await config.users.addMultiple(admin) - await config.users.addMultiple(developer) - await config.users.addMultiple(appUser) + const userList = [...admin, ...developer, ...appUser] + + await config.users.addMultiple(userList) const [allUsersResponse, allUsersJson] = await config.users.getAll() expect(allUsersJson.length).toBeGreaterThan(0) @@ -158,4 +160,135 @@ describe("Internal API - User Management & Permissions", () => { }) + it("Check Table access for app user", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + await config.login(appUser[0].email, appUser[0].password) + const newColumn = generateNewColumnForTable(createdTableData) + await config.tables.forbiddenSave( + newColumn) + await config.tables.forbiddenSave(generateTable()) + }) + //Incomplete Test + it("Check Screen access for app user", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + }) + + it("Check Table access for developer", async () => { + const developer = generateUser(1, 'developer') + expect(developer[0].builder?.global).toEqual(true) + + const [createUserResponse, createUserJson] = await config.users.addMultiple(developer) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + await config.login(developer[0].email, developer[0].password) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) + }) + + it("Check Screen access for developer", async () => { + + }) + + it("Check Table access for admin", async () => { + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + + await config.login(adminUser[0].email, adminUser[0].password) + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) + }) + + it("Check Screen access for admin", async () => { + + }) + }) From 912d6da874ef429534bcef53bbb2da746c846bd9 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 09:02:12 +0000 Subject: [PATCH 017/114] v2.1.46 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 79cb3df288..465ceff0df 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.1.46-alpha.3", + "version": "2.1.46", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4f3064ff56..2876ffb8ff 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "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": "2.1.46-alpha.3", + "@budibase/types": "^2.1.46", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 46e05c99ff..94f195cade 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "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": "2.1.46-alpha.3", + "@budibase/string-templates": "^2.1.46", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 5e84be066f..0dd47c4669 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.1.46-alpha.3", - "@budibase/client": "2.1.46-alpha.3", - "@budibase/frontend-core": "2.1.46-alpha.3", - "@budibase/string-templates": "2.1.46-alpha.3", + "@budibase/bbui": "^2.1.46", + "@budibase/client": "^2.1.46", + "@budibase/frontend-core": "^2.1.46", + "@budibase/string-templates": "^2.1.46", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 01f473ee6b..cfbeca726a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.1.46-alpha.3", - "@budibase/string-templates": "2.1.46-alpha.3", - "@budibase/types": "2.1.46-alpha.3", + "@budibase/backend-core": "^2.1.46", + "@budibase/string-templates": "^2.1.46", + "@budibase/types": "^2.1.46", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index b25f54b1b2..aa87cfb3e4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "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": "2.1.46-alpha.3", - "@budibase/frontend-core": "2.1.46-alpha.3", - "@budibase/string-templates": "2.1.46-alpha.3", + "@budibase/bbui": "^2.1.46", + "@budibase/frontend-core": "^2.1.46", + "@budibase/string-templates": "^2.1.46", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 9a33d7bb85..0a9f0e16eb 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.1.46-alpha.3", + "@budibase/bbui": "^2.1.46", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 1aec654a91..10eaea83d9 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index cafebd8476..82a3fe87dd 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.1.46-alpha.3", - "@budibase/client": "2.1.46-alpha.3", + "@budibase/backend-core": "^2.1.46", + "@budibase/client": "^2.1.46", "@budibase/pro": "2.1.46-alpha.3", - "@budibase/string-templates": "2.1.46-alpha.3", - "@budibase/types": "2.1.46-alpha.3", + "@budibase/string-templates": "^2.1.46", + "@budibase/types": "^2.1.46", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index df44116ec8..b946699bf2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index acb3fb1552..ae6fe62b28 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 181c60d098..cf264d02ca 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.1.46-alpha.3", + "version": "2.1.46", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.1.46-alpha.3", + "@budibase/backend-core": "^2.1.46", "@budibase/pro": "2.1.46-alpha.3", - "@budibase/string-templates": "2.1.46-alpha.3", - "@budibase/types": "2.1.46-alpha.3", + "@budibase/string-templates": "^2.1.46", + "@budibase/types": "^2.1.46", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 437096c2fba02e0ee113318d25943a3149608146 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 09:05:49 +0000 Subject: [PATCH 018/114] Update pro version to 2.1.46 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 82a3fe87dd..6a3d88823e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.1.46", "@budibase/client": "^2.1.46", - "@budibase/pro": "2.1.46-alpha.3", + "@budibase/pro": "2.1.46", "@budibase/string-templates": "^2.1.46", "@budibase/types": "^2.1.46", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index b9def35086..f2ff64c29c 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,12 +1273,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46-alpha.3.tgz#f8caf2af9a8d3a16d4c4280f365567581f9b55a2" - integrity sha512-osyuJq9db0DeUkaj4uANzo1mMt7SuKO5vSBITemLua0K8T8Z4r2ypE4muktEsfBdPxAH4cclMg/JaYl4RM8bwQ== +"@budibase/backend-core@2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46.tgz#292c522f1e55a8bc47a06575a4ceee032967094a" + integrity sha512-VPsbZpcxlYc3u1RtcLKhZzKWYg84iqcp5UADxZeTOCUqyYkFGElFZpM09FLVRV6UZsLLXVlE9Uva89I9EmgD8Q== dependencies: - "@budibase/types" "2.1.46-alpha.3" + "@budibase/types" "^2.1.46" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1360,13 +1360,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46-alpha.3.tgz#88e13775402561f1bd8d20483493a34082a6d8ab" - integrity sha512-B3z/Jk4g1ig8Wx62KmjAeYeITePxwrLHnSoy/Ugz6APNfNiXe7Y/ilQ5BFHWB0z/z3/8Vs1sOdP5c3/R5LpqDQ== +"@budibase/pro@2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46.tgz#7dada8f00152efff77aa338e6cc294023e72569e" + integrity sha512-ihsXMmGQzz8Dh94X1dQZCbXLxOFzHlmWYHL4g3CR4Gu0Vaoard7CR3WGAWY9HleF/ycWyPBMs6nzKyQ87pr3RQ== dependencies: - "@budibase/backend-core" "2.1.46-alpha.3" - "@budibase/types" "2.1.46-alpha.3" + "@budibase/backend-core" "2.1.46" + "@budibase/types" "2.1.46" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1390,10 +1390,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46-alpha.3.tgz#ffd96e1f3b006af5f0c0900e927d0454a2e61c53" - integrity sha512-JIO5qH/UYbIays/3dDovltiUEL3a4npXZIMlGgARzPQ5DW7ZB8hfJ5fXPt+BsbMXeaJAEsRbDkx82MDQs4y5Lg== +"@budibase/types@2.1.46", "@budibase/types@^2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46.tgz#f7358ffae35fc0e14d92e7a9739dbff8403ce870" + integrity sha512-wEb9Zip8wFJ0tBybNaGC0y8USfLuVuIJpwnWsgt+RAHAfggZyVk8TvHRt0BWodJbBCrqR4rYnYwoxRGY+JAe0Q== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index cf264d02ca..d9780a1db3 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.1.46", - "@budibase/pro": "2.1.46-alpha.3", + "@budibase/pro": "2.1.46", "@budibase/string-templates": "^2.1.46", "@budibase/types": "^2.1.46", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 79a3751218..561e386979 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,12 +470,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46-alpha.3.tgz#f8caf2af9a8d3a16d4c4280f365567581f9b55a2" - integrity sha512-osyuJq9db0DeUkaj4uANzo1mMt7SuKO5vSBITemLua0K8T8Z4r2ypE4muktEsfBdPxAH4cclMg/JaYl4RM8bwQ== +"@budibase/backend-core@2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46.tgz#292c522f1e55a8bc47a06575a4ceee032967094a" + integrity sha512-VPsbZpcxlYc3u1RtcLKhZzKWYg84iqcp5UADxZeTOCUqyYkFGElFZpM09FLVRV6UZsLLXVlE9Uva89I9EmgD8Q== dependencies: - "@budibase/types" "2.1.46-alpha.3" + "@budibase/types" "^2.1.46" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -507,22 +507,22 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46-alpha.3.tgz#88e13775402561f1bd8d20483493a34082a6d8ab" - integrity sha512-B3z/Jk4g1ig8Wx62KmjAeYeITePxwrLHnSoy/Ugz6APNfNiXe7Y/ilQ5BFHWB0z/z3/8Vs1sOdP5c3/R5LpqDQ== +"@budibase/pro@2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46.tgz#7dada8f00152efff77aa338e6cc294023e72569e" + integrity sha512-ihsXMmGQzz8Dh94X1dQZCbXLxOFzHlmWYHL4g3CR4Gu0Vaoard7CR3WGAWY9HleF/ycWyPBMs6nzKyQ87pr3RQ== dependencies: - "@budibase/backend-core" "2.1.46-alpha.3" - "@budibase/types" "2.1.46-alpha.3" + "@budibase/backend-core" "2.1.46" + "@budibase/types" "2.1.46" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.1.46-alpha.3": - version "2.1.46-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46-alpha.3.tgz#ffd96e1f3b006af5f0c0900e927d0454a2e61c53" - integrity sha512-JIO5qH/UYbIays/3dDovltiUEL3a4npXZIMlGgARzPQ5DW7ZB8hfJ5fXPt+BsbMXeaJAEsRbDkx82MDQs4y5Lg== +"@budibase/types@2.1.46", "@budibase/types@^2.1.46": + version "2.1.46" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46.tgz#f7358ffae35fc0e14d92e7a9739dbff8403ce870" + integrity sha512-wEb9Zip8wFJ0tBybNaGC0y8USfLuVuIJpwnWsgt+RAHAfggZyVk8TvHRt0BWodJbBCrqR4rYnYwoxRGY+JAe0Q== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From dcf6bd29dc38874d5656a8699fbde04a7b522eaa Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 10:21:57 +0000 Subject: [PATCH 019/114] v2.2.0 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 465ceff0df..790b6ca572 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.1.46", + "version": "2.2.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 2876ffb8ff..a23a8b28c1 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.1.46", + "version": "2.2.0", "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": "^2.1.46", + "@budibase/types": "^2.2.0", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 94f195cade..f5bbd03c60 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.1.46", + "version": "2.2.0", "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": "^2.1.46", + "@budibase/string-templates": "^2.2.0", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 0dd47c4669..98a5969896 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.1.46", + "version": "2.2.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.1.46", - "@budibase/client": "^2.1.46", - "@budibase/frontend-core": "^2.1.46", - "@budibase/string-templates": "^2.1.46", + "@budibase/bbui": "^2.2.0", + "@budibase/client": "^2.2.0", + "@budibase/frontend-core": "^2.2.0", + "@budibase/string-templates": "^2.2.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index cfbeca726a..72e62dd5a1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.1.46", - "@budibase/string-templates": "^2.1.46", - "@budibase/types": "^2.1.46", + "@budibase/backend-core": "^2.2.0", + "@budibase/string-templates": "^2.2.0", + "@budibase/types": "^2.2.0", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index aa87cfb3e4..8cd02011ca 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.1.46", + "version": "2.2.0", "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": "^2.1.46", - "@budibase/frontend-core": "^2.1.46", - "@budibase/string-templates": "^2.1.46", + "@budibase/bbui": "^2.2.0", + "@budibase/frontend-core": "^2.2.0", + "@budibase/string-templates": "^2.2.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 0a9f0e16eb..48ec714397 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.1.46", + "@budibase/bbui": "^2.2.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 10eaea83d9..3f9caf6419 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 6a3d88823e..6d530a646a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.1.46", - "@budibase/client": "^2.1.46", + "@budibase/backend-core": "^2.2.0", + "@budibase/client": "^2.2.0", "@budibase/pro": "2.1.46", - "@budibase/string-templates": "^2.1.46", - "@budibase/types": "^2.1.46", + "@budibase/string-templates": "^2.2.0", + "@budibase/types": "^2.2.0", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b946699bf2..ca0ecda7a6 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.1.46", + "version": "2.2.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index ae6fe62b28..50f7496928 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index d9780a1db3..9c9eb59128 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.1.46", + "version": "2.2.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.1.46", + "@budibase/backend-core": "^2.2.0", "@budibase/pro": "2.1.46", - "@budibase/string-templates": "^2.1.46", - "@budibase/types": "^2.1.46", + "@budibase/string-templates": "^2.2.0", + "@budibase/types": "^2.2.0", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 146cd61cffc1c8373d72353a16a0b3ff3d0fd65a Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 10:25:56 +0000 Subject: [PATCH 020/114] Update pro version to 2.2.0 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 6d530a646a..89757924a7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.0", "@budibase/client": "^2.2.0", - "@budibase/pro": "2.1.46", + "@budibase/pro": "2.2.0", "@budibase/string-templates": "^2.2.0", "@budibase/types": "^2.2.0", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index f2ff64c29c..cd5f98984a 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,12 +1273,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46.tgz#292c522f1e55a8bc47a06575a4ceee032967094a" - integrity sha512-VPsbZpcxlYc3u1RtcLKhZzKWYg84iqcp5UADxZeTOCUqyYkFGElFZpM09FLVRV6UZsLLXVlE9Uva89I9EmgD8Q== +"@budibase/backend-core@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.0.tgz#84eb3bfcb1039cc7aeec0e1fd9dce4b061ffe897" + integrity sha512-Of24pb8psDueeXiAUBncjzI+YYum0+nPCgw08dYxxNXmSSKbXP65tQaJo9+sOgsKp/2T/gjkY7rvfFTzIHt5/w== dependencies: - "@budibase/types" "^2.1.46" + "@budibase/types" "^2.2.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1360,13 +1360,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46.tgz#7dada8f00152efff77aa338e6cc294023e72569e" - integrity sha512-ihsXMmGQzz8Dh94X1dQZCbXLxOFzHlmWYHL4g3CR4Gu0Vaoard7CR3WGAWY9HleF/ycWyPBMs6nzKyQ87pr3RQ== +"@budibase/pro@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.0.tgz#8ceda792ff11b53834d933c391c289391ec6e291" + integrity sha512-RcyP9PQG76iMt6Lz31CkURiuTRUVgfu4CmcFEJZRJIpf3ZHO6lJqx7576HsVcPfp9573nGoqJS18+ha5xQWNnA== dependencies: - "@budibase/backend-core" "2.1.46" - "@budibase/types" "2.1.46" + "@budibase/backend-core" "2.2.0" + "@budibase/types" "2.2.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1390,10 +1390,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.1.46", "@budibase/types@^2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46.tgz#f7358ffae35fc0e14d92e7a9739dbff8403ce870" - integrity sha512-wEb9Zip8wFJ0tBybNaGC0y8USfLuVuIJpwnWsgt+RAHAfggZyVk8TvHRt0BWodJbBCrqR4rYnYwoxRGY+JAe0Q== +"@budibase/types@2.2.0", "@budibase/types@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.0.tgz#061baa04ca5461573b95a43632c820906907d838" + integrity sha512-F9LbRli/O6dYDCpU/bGCoFp1Rh29INV0wrtTGXBTDVYpouCXM+rwj9jUBh+8x+rBZ/S9z8V5auOis6RcD4dkqA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 9c9eb59128..5acaef02f1 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.0", - "@budibase/pro": "2.1.46", + "@budibase/pro": "2.2.0", "@budibase/string-templates": "^2.2.0", "@budibase/types": "^2.2.0", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 561e386979..438042a290 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,12 +470,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.46.tgz#292c522f1e55a8bc47a06575a4ceee032967094a" - integrity sha512-VPsbZpcxlYc3u1RtcLKhZzKWYg84iqcp5UADxZeTOCUqyYkFGElFZpM09FLVRV6UZsLLXVlE9Uva89I9EmgD8Q== +"@budibase/backend-core@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.0.tgz#84eb3bfcb1039cc7aeec0e1fd9dce4b061ffe897" + integrity sha512-Of24pb8psDueeXiAUBncjzI+YYum0+nPCgw08dYxxNXmSSKbXP65tQaJo9+sOgsKp/2T/gjkY7rvfFTzIHt5/w== dependencies: - "@budibase/types" "^2.1.46" + "@budibase/types" "^2.2.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -507,22 +507,22 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.46.tgz#7dada8f00152efff77aa338e6cc294023e72569e" - integrity sha512-ihsXMmGQzz8Dh94X1dQZCbXLxOFzHlmWYHL4g3CR4Gu0Vaoard7CR3WGAWY9HleF/ycWyPBMs6nzKyQ87pr3RQ== +"@budibase/pro@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.0.tgz#8ceda792ff11b53834d933c391c289391ec6e291" + integrity sha512-RcyP9PQG76iMt6Lz31CkURiuTRUVgfu4CmcFEJZRJIpf3ZHO6lJqx7576HsVcPfp9573nGoqJS18+ha5xQWNnA== dependencies: - "@budibase/backend-core" "2.1.46" - "@budibase/types" "2.1.46" + "@budibase/backend-core" "2.2.0" + "@budibase/types" "2.2.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.1.46", "@budibase/types@^2.1.46": - version "2.1.46" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.46.tgz#f7358ffae35fc0e14d92e7a9739dbff8403ce870" - integrity sha512-wEb9Zip8wFJ0tBybNaGC0y8USfLuVuIJpwnWsgt+RAHAfggZyVk8TvHRt0BWodJbBCrqR4rYnYwoxRGY+JAe0Q== +"@budibase/types@2.2.0", "@budibase/types@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.0.tgz#061baa04ca5461573b95a43632c820906907d838" + integrity sha512-F9LbRli/O6dYDCpU/bGCoFp1Rh29INV0wrtTGXBTDVYpouCXM+rwj9jUBh+8x+rBZ/S9z8V5auOis6RcD4dkqA== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 3160c51c8626a8e007d0402872195297a4e4ddb0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 12 Dec 2022 12:13:02 +0000 Subject: [PATCH 021/114] Fix for budibase plugin skeleton, which utilises the old import style. --- packages/backend-core/plugins.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/backend-core/plugins.ts diff --git a/packages/backend-core/plugins.ts b/packages/backend-core/plugins.ts new file mode 100644 index 0000000000..33354eaf64 --- /dev/null +++ b/packages/backend-core/plugins.ts @@ -0,0 +1 @@ +export * from "./src/plugin" From b37d51c8d9b040fdde14d6ad658ccf95692ec20d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 12 Dec 2022 12:42:11 +0000 Subject: [PATCH 022/114] Fix side nav styles --- packages/client/src/components/app/Layout.svelte | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 6582384569..1f0bed214a 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -275,7 +275,6 @@ justify-content: center; align-items: stretch; z-index: 1; - border-top: 1px solid var(--spectrum-global-color-gray-300); overflow: hidden; position: relative; } @@ -316,6 +315,12 @@ top: 0; left: 0; } + .layout--top .nav-wrapper { + border-bottom: 1px solid var(--spectrum-global-color-gray-300); + } + .layout--left .nav-wrapper { + border-right: 1px solid var(--spectrum-global-color-gray-300); + } .nav { display: flex; @@ -390,10 +395,6 @@ align-items: stretch; flex: 1 1 auto; z-index: 1; - border-top: 1px solid var(--spectrum-global-color-gray-300); - } - .layout--none .main-wrapper { - border-top: none; } .main { display: flex; @@ -487,7 +488,7 @@ } /* Desktop nav overrides */ - .desktop.layout--left { + .desktop.layout--left .layout-body { flex-direction: row; overflow: hidden; } @@ -523,6 +524,8 @@ top: 0; left: 0; box-shadow: 0 0 8px -1px rgba(0, 0, 0, 0.075); + border-bottom: 1px solid var(--spectrum-global-color-gray-300); + border-right: none; } /* Show close button in drawer */ From 8e3d5b74e17bebb6bf3258766eae51e616b9baae Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 13:13:05 +0000 Subject: [PATCH 023/114] v2.2.1 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 790b6ca572..1aa312ee0b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.0", + "version": "2.2.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a23a8b28c1..01c8ec2018 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.0", + "version": "2.2.1", "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": "^2.2.0", + "@budibase/types": "^2.2.1", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index f5bbd03c60..480f651804 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.0", + "version": "2.2.1", "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": "^2.2.0", + "@budibase/string-templates": "^2.2.1", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 98a5969896..8243cf96a3 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.0", + "version": "2.2.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.0", - "@budibase/client": "^2.2.0", - "@budibase/frontend-core": "^2.2.0", - "@budibase/string-templates": "^2.2.0", + "@budibase/bbui": "^2.2.1", + "@budibase/client": "^2.2.1", + "@budibase/frontend-core": "^2.2.1", + "@budibase/string-templates": "^2.2.1", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 72e62dd5a1..64e0cd5ff0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.0", - "@budibase/string-templates": "^2.2.0", - "@budibase/types": "^2.2.0", + "@budibase/backend-core": "^2.2.1", + "@budibase/string-templates": "^2.2.1", + "@budibase/types": "^2.2.1", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 8cd02011ca..027381e89f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.0", + "version": "2.2.1", "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": "^2.2.0", - "@budibase/frontend-core": "^2.2.0", - "@budibase/string-templates": "^2.2.0", + "@budibase/bbui": "^2.2.1", + "@budibase/frontend-core": "^2.2.1", + "@budibase/string-templates": "^2.2.1", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 48ec714397..72fd9388ee 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.0", + "@budibase/bbui": "^2.2.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 3f9caf6419..b73db204e9 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 89757924a7..9e43aa731c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.0", - "@budibase/client": "^2.2.0", + "@budibase/backend-core": "^2.2.1", + "@budibase/client": "^2.2.1", "@budibase/pro": "2.2.0", - "@budibase/string-templates": "^2.2.0", - "@budibase/types": "^2.2.0", + "@budibase/string-templates": "^2.2.1", + "@budibase/types": "^2.2.1", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ca0ecda7a6..3f6928ed4e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.0", + "version": "2.2.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 50f7496928..9ec4cf42a0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 5acaef02f1..5e22b2d69c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.0", + "version": "2.2.1", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.0", + "@budibase/backend-core": "^2.2.1", "@budibase/pro": "2.2.0", - "@budibase/string-templates": "^2.2.0", - "@budibase/types": "^2.2.0", + "@budibase/string-templates": "^2.2.1", + "@budibase/types": "^2.2.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 8c1a2cac107ee8cfcdb3e30d939e6b692b4e14c4 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 13:16:47 +0000 Subject: [PATCH 024/114] Update pro version to 2.2.1 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 9e43aa731c..dbfba0b3c3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.1", "@budibase/client": "^2.2.1", - "@budibase/pro": "2.2.0", + "@budibase/pro": "2.2.1", "@budibase/string-templates": "^2.2.1", "@budibase/types": "^2.2.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index cd5f98984a..d49bfc3c3b 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,12 +1273,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.0.tgz#84eb3bfcb1039cc7aeec0e1fd9dce4b061ffe897" - integrity sha512-Of24pb8psDueeXiAUBncjzI+YYum0+nPCgw08dYxxNXmSSKbXP65tQaJo9+sOgsKp/2T/gjkY7rvfFTzIHt5/w== +"@budibase/backend-core@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.1.tgz#92c2464a17cae3c26afa40066feda21911cef660" + integrity sha512-EMzgxOTWebSLXq1hZr+WF2pNsjOc81XwwlWQ0mxXjv7YahWPYFsMGRZyOLWMOF4i49fuMvbmF39FdFCIa1odcg== dependencies: - "@budibase/types" "^2.2.0" + "@budibase/types" "^2.2.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1360,13 +1360,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.0.tgz#8ceda792ff11b53834d933c391c289391ec6e291" - integrity sha512-RcyP9PQG76iMt6Lz31CkURiuTRUVgfu4CmcFEJZRJIpf3ZHO6lJqx7576HsVcPfp9573nGoqJS18+ha5xQWNnA== +"@budibase/pro@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.1.tgz#fe74a84c32746309ca4f264e8e2fcc423705f639" + integrity sha512-IF6C5PVw9sVEXjUsjGVD1kTbUvMB0RGafwHBKkjmH3Qjs1hTczKW/kNm7pFzse94SB9QJGig02hWngMQ8cvKrg== dependencies: - "@budibase/backend-core" "2.2.0" - "@budibase/types" "2.2.0" + "@budibase/backend-core" "2.2.1" + "@budibase/types" "2.2.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1390,10 +1390,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.0", "@budibase/types@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.0.tgz#061baa04ca5461573b95a43632c820906907d838" - integrity sha512-F9LbRli/O6dYDCpU/bGCoFp1Rh29INV0wrtTGXBTDVYpouCXM+rwj9jUBh+8x+rBZ/S9z8V5auOis6RcD4dkqA== +"@budibase/types@2.2.1", "@budibase/types@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.1.tgz#baeaaeb0fee01e3a3746eb58f3b9ecbe249094f1" + integrity sha512-o5FFz47yDq+Evgj22h+yvvpBk9qPUqrs53EKtVB8PwUiSjvt7vbQTotIgJd9CVslAW5274dfnOG4oB2LuG3fDg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 5e22b2d69c..73f7f3e611 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.1", - "@budibase/pro": "2.2.0", + "@budibase/pro": "2.2.1", "@budibase/string-templates": "^2.2.1", "@budibase/types": "^2.2.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 438042a290..b8b8c9448f 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,12 +470,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.0.tgz#84eb3bfcb1039cc7aeec0e1fd9dce4b061ffe897" - integrity sha512-Of24pb8psDueeXiAUBncjzI+YYum0+nPCgw08dYxxNXmSSKbXP65tQaJo9+sOgsKp/2T/gjkY7rvfFTzIHt5/w== +"@budibase/backend-core@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.1.tgz#92c2464a17cae3c26afa40066feda21911cef660" + integrity sha512-EMzgxOTWebSLXq1hZr+WF2pNsjOc81XwwlWQ0mxXjv7YahWPYFsMGRZyOLWMOF4i49fuMvbmF39FdFCIa1odcg== dependencies: - "@budibase/types" "^2.2.0" + "@budibase/types" "^2.2.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -507,22 +507,22 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.0.tgz#8ceda792ff11b53834d933c391c289391ec6e291" - integrity sha512-RcyP9PQG76iMt6Lz31CkURiuTRUVgfu4CmcFEJZRJIpf3ZHO6lJqx7576HsVcPfp9573nGoqJS18+ha5xQWNnA== +"@budibase/pro@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.1.tgz#fe74a84c32746309ca4f264e8e2fcc423705f639" + integrity sha512-IF6C5PVw9sVEXjUsjGVD1kTbUvMB0RGafwHBKkjmH3Qjs1hTczKW/kNm7pFzse94SB9QJGig02hWngMQ8cvKrg== dependencies: - "@budibase/backend-core" "2.2.0" - "@budibase/types" "2.2.0" + "@budibase/backend-core" "2.2.1" + "@budibase/types" "2.2.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.0", "@budibase/types@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.0.tgz#061baa04ca5461573b95a43632c820906907d838" - integrity sha512-F9LbRli/O6dYDCpU/bGCoFp1Rh29INV0wrtTGXBTDVYpouCXM+rwj9jUBh+8x+rBZ/S9z8V5auOis6RcD4dkqA== +"@budibase/types@2.2.1", "@budibase/types@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.1.tgz#baeaaeb0fee01e3a3746eb58f3b9ecbe249094f1" + integrity sha512-o5FFz47yDq+Evgj22h+yvvpBk9qPUqrs53EKtVB8PwUiSjvt7vbQTotIgJd9CVslAW5274dfnOG4oB2LuG3fDg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 5773f39659a9468043d190a542534ec45d974287 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 12 Dec 2022 16:32:37 +0000 Subject: [PATCH 025/114] Organize user and permissions tests --- .../userManagement/appSpecificRoles.spec.ts | 278 ++++++++++++++++++ .../userManagement/userManagement.spec.ts | 204 ------------- 2 files changed, 278 insertions(+), 204 deletions(-) create mode 100644 qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts new file mode 100644 index 0000000000..3fb97cf847 --- /dev/null +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -0,0 +1,278 @@ +import TestConfiguration from "../../../config/internal-api/TestConfiguration" +import { Application } from "@budibase/server/api/controllers/public/mapping/types" +import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" +import generateApp from "../../../config/internal-api/fixtures/applications" +import { generateUser } from "../../../config/internal-api/fixtures/userManagement" +import { User } from "@budibase/types" +import { generateNewColumnForTable, generateTable } from "../../../config/internal-api/fixtures/table" +import generateScreen from "../../../config/internal-api/fixtures/screens" + +describe("Internal API - App Specific Roles & Permissions", () => { + const api = new InternalAPIClient() + const config = new TestConfiguration(api) + + // Before each test, login as admin. Some tests will require login as a different user + beforeEach(async () => { + await config.loginAsAdmin() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Add BASIC user to app", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + }) + + it("Add ADMIN user to app", async () => { + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + + }) + + it("Add POWER user to app", async () => { + const powerUser = generateUser(1, 'developer') + expect(powerUser[0].builder?.global).toEqual(true) + + const [createUserResponse, createUserJson] = await config.users.addMultiple(powerUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + }) + + describe("Check Access for default roles", () => { + it("Check Table access for app user", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + await config.login(appUser[0].email, appUser[0].password) + const newColumn = generateNewColumnForTable(createdTableData) + await config.tables.forbiddenSave( + newColumn) + await config.tables.forbiddenSave(generateTable()) + }) + + it("Check Table access for developer", async () => { + const developer = generateUser(1, 'developer') + expect(developer[0].builder?.global).toEqual(true) + + const [createUserResponse, createUserJson] = await config.users.addMultiple(developer) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + await config.login(developer[0].email, developer[0].password) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) + }) + + it("Check Table access for admin", async () => { + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + + await config.login(adminUser[0].email, adminUser[0].password) + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) + }) + + it("Check Screen access for BASIC Role", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + + + }) + + it("Check Screen access for POWER role", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + }) + + it("Check Screen access for ADMIN role", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + + }) + }) + + + describe.skip("App Access for custom roles", () => { + it("Custom role access for level 1 permissions", async () => { }) + it("Custom role access for level 2 permissions", async () => { }) + it("Custom role access for level 3 permissions", async () => { }) + it("Custom role access for level 4 permissions", async () => { }) + it("Custom role access for level 5 permissions", async () => { }) + }) + +}) \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 8110929b41..32820b8b7f 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -1,11 +1,8 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import generateApp from "../../../config/internal-api/fixtures/applications" import { generateUser } from "../../../config/internal-api/fixtures/userManagement" import { User } from "@budibase/types" -import { generateNewColumnForTable, generateTable } from "../../../config/internal-api/fixtures/table" -import generateScreen from "../../../config/internal-api/fixtures/screens" describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() @@ -88,207 +85,6 @@ describe("Internal API - User Management & Permissions", () => { expect(changedUserInfoJson.builder?.global).toEqual(true) }) - it("Add BASIC user to app", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "BASIC", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") - - }) - - it("Add ADMIN user to app", async () => { - const adminUser = generateUser(1, "admin") - expect(adminUser[0].builder?.global).toEqual(true) - expect(adminUser[0].admin?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "ADMIN", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - - }) - - it("Add POWER user to app", async () => { - const powerUser = generateUser(1, 'developer') - expect(powerUser[0].builder?.global).toEqual(true) - - const [createUserResponse, createUserJson] = await config.users.addMultiple(powerUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "POWER", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") - - }) - - it("Check Table access for app user", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "BASIC", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") - - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) - await config.login(appUser[0].email, appUser[0].password) - const newColumn = generateNewColumnForTable(createdTableData) - await config.tables.forbiddenSave( - newColumn) - await config.tables.forbiddenSave(generateTable()) - }) - //Incomplete Test - it("Check Screen access for app user", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "BASIC", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") - - const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) - }) - - it("Check Table access for developer", async () => { - const developer = generateUser(1, 'developer') - expect(developer[0].builder?.global).toEqual(true) - - const [createUserResponse, createUserJson] = await config.users.addMultiple(developer) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "POWER", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") - - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) - await config.login(developer[0].email, developer[0].password) - const newColumn = generateNewColumnForTable(createdTableData) - const [addColumnResponse, addColumnData] = await config.tables.save( - newColumn, - true - ) - }) - - it("Check Screen access for developer", async () => { - - }) - - it("Check Table access for admin", async () => { - const adminUser = generateUser(1, "admin") - expect(adminUser[0].builder?.global).toEqual(true) - expect(adminUser[0].admin?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "ADMIN", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - - await config.login(adminUser[0].email, adminUser[0].password) - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) - const newColumn = generateNewColumnForTable(createdTableData) - const [addColumnResponse, addColumnData] = await config.tables.save( - newColumn, - true - ) - }) - - it("Check Screen access for admin", async () => { - - }) }) From 9c020a3617dd2b82a32bb9045219c392fdcc7c53 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 12 Dec 2022 16:33:32 +0000 Subject: [PATCH 026/114] using dist folder to allow importing constants for openAPI specs --- packages/server/specs/resources/query.js | 2 +- packages/server/specs/resources/table.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/specs/resources/query.js b/packages/server/specs/resources/query.js index 1442e46a04..10544ee7eb 100644 --- a/packages/server/specs/resources/query.js +++ b/packages/server/specs/resources/query.js @@ -1,6 +1,6 @@ const Resource = require("./utils/Resource") const { object } = require("./utils") -const { BaseQueryVerbs } = require("../../src/constants") +const { BaseQueryVerbs } = require("../../dist/constants") const query = { _id: "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e", diff --git a/packages/server/specs/resources/table.js b/packages/server/specs/resources/table.js index 523a3a9dfd..9bc57daf42 100644 --- a/packages/server/specs/resources/table.js +++ b/packages/server/specs/resources/table.js @@ -2,7 +2,7 @@ const { FieldTypes, RelationshipTypes, FormulaTypes, -} = require("../../src/constants") +} = require("../../dist/constants") const { object } = require("./utils") const Resource = require("./utils/Resource") From be086013150a06e113f7a8ef414f6244a909140e Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 16:52:02 +0000 Subject: [PATCH 027/114] v2.2.2 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 1aa312ee0b..25209c68cf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.1", + "version": "2.2.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 01c8ec2018..da9687491d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.1", + "version": "2.2.2", "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": "^2.2.1", + "@budibase/types": "^2.2.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 480f651804..92b9bc24fe 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.1", + "version": "2.2.2", "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": "^2.2.1", + "@budibase/string-templates": "^2.2.2", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 8243cf96a3..5301a4a111 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.1", + "version": "2.2.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.1", - "@budibase/client": "^2.2.1", - "@budibase/frontend-core": "^2.2.1", - "@budibase/string-templates": "^2.2.1", + "@budibase/bbui": "^2.2.2", + "@budibase/client": "^2.2.2", + "@budibase/frontend-core": "^2.2.2", + "@budibase/string-templates": "^2.2.2", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 64e0cd5ff0..0e998314ef 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.1", - "@budibase/string-templates": "^2.2.1", - "@budibase/types": "^2.2.1", + "@budibase/backend-core": "^2.2.2", + "@budibase/string-templates": "^2.2.2", + "@budibase/types": "^2.2.2", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 027381e89f..bc94329b0f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.1", + "version": "2.2.2", "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": "^2.2.1", - "@budibase/frontend-core": "^2.2.1", - "@budibase/string-templates": "^2.2.1", + "@budibase/bbui": "^2.2.2", + "@budibase/frontend-core": "^2.2.2", + "@budibase/string-templates": "^2.2.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 72fd9388ee..8819f8ceb9 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.1", + "@budibase/bbui": "^2.2.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index b73db204e9..ae5644d9ce 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index dbfba0b3c3..d2e3c5ef08 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.1", - "@budibase/client": "^2.2.1", + "@budibase/backend-core": "^2.2.2", + "@budibase/client": "^2.2.2", "@budibase/pro": "2.2.1", - "@budibase/string-templates": "^2.2.1", - "@budibase/types": "^2.2.1", + "@budibase/string-templates": "^2.2.2", + "@budibase/types": "^2.2.2", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 3f6928ed4e..e97a3af3ec 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.1", + "version": "2.2.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 9ec4cf42a0..6082c4cef7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 73f7f3e611..fa67868a2b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.1", + "version": "2.2.2", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.1", + "@budibase/backend-core": "^2.2.2", "@budibase/pro": "2.2.1", - "@budibase/string-templates": "^2.2.1", - "@budibase/types": "^2.2.1", + "@budibase/string-templates": "^2.2.2", + "@budibase/types": "^2.2.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From ab9ac6adb138c7c5a6aec89efe2f9faee33e2709 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 12 Dec 2022 16:56:13 +0000 Subject: [PATCH 028/114] Update pro version to 2.2.2 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index d2e3c5ef08..a52402263e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.2", "@budibase/client": "^2.2.2", - "@budibase/pro": "2.2.1", + "@budibase/pro": "2.2.2", "@budibase/string-templates": "^2.2.2", "@budibase/types": "^2.2.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index d49bfc3c3b..b69addc402 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,12 +1273,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.1.tgz#92c2464a17cae3c26afa40066feda21911cef660" - integrity sha512-EMzgxOTWebSLXq1hZr+WF2pNsjOc81XwwlWQ0mxXjv7YahWPYFsMGRZyOLWMOF4i49fuMvbmF39FdFCIa1odcg== +"@budibase/backend-core@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.2.tgz#f428d9192e3579bcec2a92bd3f51f7667f8f5986" + integrity sha512-xSjMNGmIIhg/BA+iAmhSAZzhUhERGqD1niRn5I2QguKzv/1AFDOq8RuKHXkkCoc/bkaVbrHoRYsGQp0eohdYvg== dependencies: - "@budibase/types" "^2.2.1" + "@budibase/types" "^2.2.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1360,13 +1360,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.1.tgz#fe74a84c32746309ca4f264e8e2fcc423705f639" - integrity sha512-IF6C5PVw9sVEXjUsjGVD1kTbUvMB0RGafwHBKkjmH3Qjs1hTczKW/kNm7pFzse94SB9QJGig02hWngMQ8cvKrg== +"@budibase/pro@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.2.tgz#2b15ad938cc303d672eca09ed77295d72053408c" + integrity sha512-fCrKTWjL5FJBVptJQLc7Cf/xovBrHWALG1Lu6/YwhFEw+SxPcFWCMISoRfYmMKuR70j4OhkfulmakkthLhuKOw== dependencies: - "@budibase/backend-core" "2.2.1" - "@budibase/types" "2.2.1" + "@budibase/backend-core" "2.2.2" + "@budibase/types" "2.2.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1390,10 +1390,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.1", "@budibase/types@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.1.tgz#baeaaeb0fee01e3a3746eb58f3b9ecbe249094f1" - integrity sha512-o5FFz47yDq+Evgj22h+yvvpBk9qPUqrs53EKtVB8PwUiSjvt7vbQTotIgJd9CVslAW5274dfnOG4oB2LuG3fDg== +"@budibase/types@2.2.2", "@budibase/types@^2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.2.tgz#8d425f01d037758003b31bc7b72db2ecde490723" + integrity sha512-FjkymgLKipU5mzzzNf2ZtvbXOMJLyJXrxAQIvNyhdCEXR4Pfn45b8RDpusKn/MgpaljLbsTrASttPBdNfOMT7w== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index fa67868a2b..4a38103c2c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.2", - "@budibase/pro": "2.2.1", + "@budibase/pro": "2.2.2", "@budibase/string-templates": "^2.2.2", "@budibase/types": "^2.2.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index b8b8c9448f..8f9e40732d 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,12 +470,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.1.tgz#92c2464a17cae3c26afa40066feda21911cef660" - integrity sha512-EMzgxOTWebSLXq1hZr+WF2pNsjOc81XwwlWQ0mxXjv7YahWPYFsMGRZyOLWMOF4i49fuMvbmF39FdFCIa1odcg== +"@budibase/backend-core@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.2.tgz#f428d9192e3579bcec2a92bd3f51f7667f8f5986" + integrity sha512-xSjMNGmIIhg/BA+iAmhSAZzhUhERGqD1niRn5I2QguKzv/1AFDOq8RuKHXkkCoc/bkaVbrHoRYsGQp0eohdYvg== dependencies: - "@budibase/types" "^2.2.1" + "@budibase/types" "^2.2.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -507,22 +507,22 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.1.tgz#fe74a84c32746309ca4f264e8e2fcc423705f639" - integrity sha512-IF6C5PVw9sVEXjUsjGVD1kTbUvMB0RGafwHBKkjmH3Qjs1hTczKW/kNm7pFzse94SB9QJGig02hWngMQ8cvKrg== +"@budibase/pro@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.2.tgz#2b15ad938cc303d672eca09ed77295d72053408c" + integrity sha512-fCrKTWjL5FJBVptJQLc7Cf/xovBrHWALG1Lu6/YwhFEw+SxPcFWCMISoRfYmMKuR70j4OhkfulmakkthLhuKOw== dependencies: - "@budibase/backend-core" "2.2.1" - "@budibase/types" "2.2.1" + "@budibase/backend-core" "2.2.2" + "@budibase/types" "2.2.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.1", "@budibase/types@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.1.tgz#baeaaeb0fee01e3a3746eb58f3b9ecbe249094f1" - integrity sha512-o5FFz47yDq+Evgj22h+yvvpBk9qPUqrs53EKtVB8PwUiSjvt7vbQTotIgJd9CVslAW5274dfnOG4oB2LuG3fDg== +"@budibase/types@2.2.2", "@budibase/types@^2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.2.tgz#8d425f01d037758003b31bc7b72db2ecde490723" + integrity sha512-FjkymgLKipU5mzzzNf2ZtvbXOMJLyJXrxAQIvNyhdCEXR4Pfn45b8RDpusKn/MgpaljLbsTrASttPBdNfOMT7w== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 4716cf1aa37f0ca6cdfbd35364e733a73dbd219d Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Wed, 14 Dec 2022 00:35:15 +0000 Subject: [PATCH 029/114] Fix for user enrichment call (updating to @budibase/nano fork) (#9038) * Fix for #9029 - this should fix the issue users have been experiencing with user enrichment calls in apps, essentially it utilises a fork of the nano library we use to interact with CouchDB, which has been updated to use a POST request rather than a GET request as it supports a larger set of data being sent as query parameters. * Incrementing Nano version to attempt to fix yarn registry issues. --- packages/backend-core/package.json | 2 +- .../backend-core/src/db/couch/DatabaseImpl.ts | 2 +- packages/backend-core/yarn.lock | 24 ++++++++--------- packages/types/package.json | 4 +-- packages/types/src/sdk/db.ts | 2 +- packages/types/yarn.lock | 26 +++++++++---------- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index da9687491d..35ea6432fd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@budibase/types": "^2.2.2", + "@budibase/nano": "10.1.1", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", @@ -35,7 +36,6 @@ "koa-passport": "4.1.4", "lodash": "4.17.21", "lodash.isarguments": "3.1.0", - "nano": "^10.1.0", "node-fetch": "2.6.7", "passport-google-oauth": "2.0.0", "passport-jwt": "4.0.0", diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index de06b4e8ee..9b4761d961 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -1,4 +1,4 @@ -import Nano from "nano" +import Nano from "@budibase/nano" import { AllDocsResponse, AnyDocument, diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index 0a25d5fb43..16de2cbaf8 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -470,6 +470,18 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@budibase/nano@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@budibase/nano/-/nano-10.1.1.tgz#36ccda4d9bb64b5ee14dd2b27a295b40739b1038" + integrity sha512-kbMIzMkjVtl+xI0UPwVU0/pn8/ccxTyfzwBz6Z+ZiN2oUSb0fJCe0qwA6o8dxwSa8nZu4MbGAeMJl3CJndmWtA== + dependencies: + "@types/tough-cookie" "^4.0.2" + axios "^1.1.3" + http-cookie-agent "^4.0.2" + node-abort-controller "^3.0.1" + qs "^6.11.0" + tough-cookie "^4.1.2" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -4022,18 +4034,6 @@ msgpackr@^1.5.2: optionalDependencies: msgpackr-extract "^2.1.2" -nano@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/nano/-/nano-10.1.0.tgz#afdd5a7440e62f09a8e23f41fcea328d27383922" - integrity sha512-COeN2TpLcHuSN44QLnPmfZCoCsKAg8/aelPOVqqm/2/MvRHDEA11/Kld5C4sLzDlWlhFZ3SO2WGJGevCsvcEzQ== - dependencies: - "@types/tough-cookie" "^4.0.2" - axios "^1.1.3" - http-cookie-agent "^4.0.2" - node-abort-controller "^3.0.1" - qs "^6.11.0" - tough-cookie "^4.1.2" - napi-macros@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" diff --git a/packages/types/package.json b/packages/types/package.json index 6082c4cef7..4bfa68e676 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -13,11 +13,11 @@ }, "jest": {}, "devDependencies": { - "@types/json5": "^2.2.0", + "@budibase/nano": "10.1.1", + "@types/json5": "2.2.0", "@types/koa": "2.13.4", "@types/node": "14.18.20", "@types/pouchdb": "6.4.0", - "nano": "10.1.0", "rimraf": "3.0.2", "typescript": "4.7.3" } diff --git a/packages/types/src/sdk/db.ts b/packages/types/src/sdk/db.ts index 84daed0f90..50078ed6cc 100644 --- a/packages/types/src/sdk/db.ts +++ b/packages/types/src/sdk/db.ts @@ -1,5 +1,5 @@ import PouchDB from "pouchdb" -import Nano from "nano" +import Nano from "@budibase/nano" import { AllDocsResponse, AnyDocument, Document } from "../" export type PouchOptions = { diff --git a/packages/types/yarn.lock b/packages/types/yarn.lock index f596c58997..20febd4075 100644 --- a/packages/types/yarn.lock +++ b/packages/types/yarn.lock @@ -2,6 +2,18 @@ # yarn lockfile v1 +"@budibase/nano@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@budibase/nano/-/nano-10.1.1.tgz#36ccda4d9bb64b5ee14dd2b27a295b40739b1038" + integrity sha512-kbMIzMkjVtl+xI0UPwVU0/pn8/ccxTyfzwBz6Z+ZiN2oUSb0fJCe0qwA6o8dxwSa8nZu4MbGAeMJl3CJndmWtA== + dependencies: + "@types/tough-cookie" "^4.0.2" + axios "^1.1.3" + http-cookie-agent "^4.0.2" + node-abort-controller "^3.0.1" + qs "^6.11.0" + tough-cookie "^4.1.2" + "@types/accepts@*": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.5.tgz#c34bec115cfc746e04fe5a059df4ce7e7b391575" @@ -75,7 +87,7 @@ resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.2.tgz#7315b4c4c54f82d13fa61c228ec5c2ea5cc9e0e1" integrity sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w== -"@types/json5@^2.2.0": +"@types/json5@2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-2.2.0.tgz#afff29abf9182a7d4a7e39105ca051f11c603d13" integrity sha512-NrVug5woqbvNZ0WX+Gv4R+L4TGddtmFek2u8RtccAgFZWtS9QXF2xCXY22/M4nzkaKF0q9Fc6M/5rxLDhfwc/A== @@ -483,18 +495,6 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nano@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/nano/-/nano-10.1.0.tgz#afdd5a7440e62f09a8e23f41fcea328d27383922" - integrity sha512-COeN2TpLcHuSN44QLnPmfZCoCsKAg8/aelPOVqqm/2/MvRHDEA11/Kld5C4sLzDlWlhFZ3SO2WGJGevCsvcEzQ== - dependencies: - "@types/tough-cookie" "^4.0.2" - axios "^1.1.3" - http-cookie-agent "^4.0.2" - node-abort-controller "^3.0.1" - qs "^6.11.0" - tough-cookie "^4.1.2" - node-abort-controller@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.0.1.tgz#f91fa50b1dee3f909afabb7e261b1e1d6b0cb74e" From f6cf315148e68030ffa48960c9cc3bc9a8821f71 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 14 Dec 2022 00:52:41 +0000 Subject: [PATCH 030/114] v2.2.3 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 25209c68cf..3f4bf5ad60 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.2", + "version": "2.2.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 35ea6432fd..2fcff45586 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,8 +20,8 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^2.2.2", "@budibase/nano": "10.1.1", + "@budibase/types": "^2.2.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 92b9bc24fe..dbf07e74f5 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.2", + "version": "2.2.3", "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": "^2.2.2", + "@budibase/string-templates": "^2.2.3", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 5301a4a111..f1dafbb2a5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.2", + "version": "2.2.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.2", - "@budibase/client": "^2.2.2", - "@budibase/frontend-core": "^2.2.2", - "@budibase/string-templates": "^2.2.2", + "@budibase/bbui": "^2.2.3", + "@budibase/client": "^2.2.3", + "@budibase/frontend-core": "^2.2.3", + "@budibase/string-templates": "^2.2.3", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 0e998314ef..8a5b69f5ce 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.2", - "@budibase/string-templates": "^2.2.2", - "@budibase/types": "^2.2.2", + "@budibase/backend-core": "^2.2.3", + "@budibase/string-templates": "^2.2.3", + "@budibase/types": "^2.2.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index bc94329b0f..d524e60c64 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.2", + "version": "2.2.3", "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": "^2.2.2", - "@budibase/frontend-core": "^2.2.2", - "@budibase/string-templates": "^2.2.2", + "@budibase/bbui": "^2.2.3", + "@budibase/frontend-core": "^2.2.3", + "@budibase/string-templates": "^2.2.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 8819f8ceb9..9f623143aa 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.2", + "@budibase/bbui": "^2.2.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index ae5644d9ce..31249b8a7d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index a52402263e..90125e2daf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.2", - "@budibase/client": "^2.2.2", + "@budibase/backend-core": "^2.2.3", + "@budibase/client": "^2.2.3", "@budibase/pro": "2.2.2", - "@budibase/string-templates": "^2.2.2", - "@budibase/types": "^2.2.2", + "@budibase/string-templates": "^2.2.3", + "@budibase/types": "^2.2.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index e97a3af3ec..6d878f4df8 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.2", + "version": "2.2.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 4bfa68e676..940a57bba5 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 4a38103c2c..e02c728cc5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.2", + "version": "2.2.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.2", + "@budibase/backend-core": "^2.2.3", "@budibase/pro": "2.2.2", - "@budibase/string-templates": "^2.2.2", - "@budibase/types": "^2.2.2", + "@budibase/string-templates": "^2.2.3", + "@budibase/types": "^2.2.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 5913df0359225c87a458d462883842cf0dc80a1d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 14 Dec 2022 00:56:53 +0000 Subject: [PATCH 031/114] Update pro version to 2.2.3 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 56 ++++++++++++++++++------------------ packages/worker/package.json | 2 +- packages/worker/yarn.lock | 56 ++++++++++++++++++------------------ 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 90125e2daf..f4fc9d32cb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.3", "@budibase/client": "^2.2.3", - "@budibase/pro": "2.2.2", + "@budibase/pro": "2.2.3", "@budibase/string-templates": "^2.2.3", "@budibase/types": "^2.2.3", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index b69addc402..529b229481 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,12 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.2.tgz#f428d9192e3579bcec2a92bd3f51f7667f8f5986" - integrity sha512-xSjMNGmIIhg/BA+iAmhSAZzhUhERGqD1niRn5I2QguKzv/1AFDOq8RuKHXkkCoc/bkaVbrHoRYsGQp0eohdYvg== +"@budibase/backend-core@2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.3.tgz#e2c3214bdbd6fa5cc95038816ecc40a9a0538be9" + integrity sha512-vGOWkQ8Xk6p6Lcvbtj6Z4UMoZoZlllMwmnWkwBbwr0am9bVFBF9k65Ca/vioA1egsvmM9hKCCQV6xeDcUz8qaQ== dependencies: - "@budibase/types" "^2.2.2" + "@budibase/nano" "10.1.1" + "@budibase/types" "^2.2.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1293,7 +1294,6 @@ koa-passport "4.1.4" lodash "4.17.21" lodash.isarguments "3.1.0" - nano "^10.1.0" node-fetch "2.6.7" passport-google-oauth "2.0.0" passport-jwt "4.0.0" @@ -1360,13 +1360,25 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.2.tgz#2b15ad938cc303d672eca09ed77295d72053408c" - integrity sha512-fCrKTWjL5FJBVptJQLc7Cf/xovBrHWALG1Lu6/YwhFEw+SxPcFWCMISoRfYmMKuR70j4OhkfulmakkthLhuKOw== +"@budibase/nano@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@budibase/nano/-/nano-10.1.1.tgz#36ccda4d9bb64b5ee14dd2b27a295b40739b1038" + integrity sha512-kbMIzMkjVtl+xI0UPwVU0/pn8/ccxTyfzwBz6Z+ZiN2oUSb0fJCe0qwA6o8dxwSa8nZu4MbGAeMJl3CJndmWtA== dependencies: - "@budibase/backend-core" "2.2.2" - "@budibase/types" "2.2.2" + "@types/tough-cookie" "^4.0.2" + axios "^1.1.3" + http-cookie-agent "^4.0.2" + node-abort-controller "^3.0.1" + qs "^6.11.0" + tough-cookie "^4.1.2" + +"@budibase/pro@2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.3.tgz#2e307353597e36df74f80d8affe4ba5686f895fb" + integrity sha512-o93ara4THEzMLyNyym+BzcPfB0S8XL4ayRnwbaUnF1cqwbJbiFUv4QR9PC2mrRW7f2EuyVdG2CiCh8EGi05f/A== + dependencies: + "@budibase/backend-core" "2.2.3" + "@budibase/types" "2.2.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1390,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.2", "@budibase/types@^2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.2.tgz#8d425f01d037758003b31bc7b72db2ecde490723" - integrity sha512-FjkymgLKipU5mzzzNf2ZtvbXOMJLyJXrxAQIvNyhdCEXR4Pfn45b8RDpusKn/MgpaljLbsTrASttPBdNfOMT7w== +"@budibase/types@2.2.3", "@budibase/types@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.3.tgz#81ecc4d04cf74698bcd7ea77cee226b0dfd9d949" + integrity sha512-+LnzJvxbsUtFnSvd9uki6N7OPwmqu4R8nLXuLzDJyknHVdrLgkAduv+0AZ6WIqjgl6ADVcvk48Et40s0wotZxw== "@bull-board/api@3.7.0": version "3.7.0" @@ -10720,18 +10732,6 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== -nano@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/nano/-/nano-10.1.0.tgz#afdd5a7440e62f09a8e23f41fcea328d27383922" - integrity sha512-COeN2TpLcHuSN44QLnPmfZCoCsKAg8/aelPOVqqm/2/MvRHDEA11/Kld5C4sLzDlWlhFZ3SO2WGJGevCsvcEzQ== - dependencies: - "@types/tough-cookie" "^4.0.2" - axios "^1.1.3" - http-cookie-agent "^4.0.2" - node-abort-controller "^3.0.1" - qs "^6.11.0" - tough-cookie "^4.1.2" - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" diff --git a/packages/worker/package.json b/packages/worker/package.json index e02c728cc5..c103804399 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.3", - "@budibase/pro": "2.2.2", + "@budibase/pro": "2.2.3", "@budibase/string-templates": "^2.2.3", "@budibase/types": "^2.2.3", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 8f9e40732d..ad7c6e14ba 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,12 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.2.tgz#f428d9192e3579bcec2a92bd3f51f7667f8f5986" - integrity sha512-xSjMNGmIIhg/BA+iAmhSAZzhUhERGqD1niRn5I2QguKzv/1AFDOq8RuKHXkkCoc/bkaVbrHoRYsGQp0eohdYvg== +"@budibase/backend-core@2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.3.tgz#e2c3214bdbd6fa5cc95038816ecc40a9a0538be9" + integrity sha512-vGOWkQ8Xk6p6Lcvbtj6Z4UMoZoZlllMwmnWkwBbwr0am9bVFBF9k65Ca/vioA1egsvmM9hKCCQV6xeDcUz8qaQ== dependencies: - "@budibase/types" "^2.2.2" + "@budibase/nano" "10.1.1" + "@budibase/types" "^2.2.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -490,7 +491,6 @@ koa-passport "4.1.4" lodash "4.17.21" lodash.isarguments "3.1.0" - nano "^10.1.0" node-fetch "2.6.7" passport-google-oauth "2.0.0" passport-jwt "4.0.0" @@ -507,22 +507,34 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.2.tgz#2b15ad938cc303d672eca09ed77295d72053408c" - integrity sha512-fCrKTWjL5FJBVptJQLc7Cf/xovBrHWALG1Lu6/YwhFEw+SxPcFWCMISoRfYmMKuR70j4OhkfulmakkthLhuKOw== +"@budibase/nano@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@budibase/nano/-/nano-10.1.1.tgz#36ccda4d9bb64b5ee14dd2b27a295b40739b1038" + integrity sha512-kbMIzMkjVtl+xI0UPwVU0/pn8/ccxTyfzwBz6Z+ZiN2oUSb0fJCe0qwA6o8dxwSa8nZu4MbGAeMJl3CJndmWtA== dependencies: - "@budibase/backend-core" "2.2.2" - "@budibase/types" "2.2.2" + "@types/tough-cookie" "^4.0.2" + axios "^1.1.3" + http-cookie-agent "^4.0.2" + node-abort-controller "^3.0.1" + qs "^6.11.0" + tough-cookie "^4.1.2" + +"@budibase/pro@2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.3.tgz#2e307353597e36df74f80d8affe4ba5686f895fb" + integrity sha512-o93ara4THEzMLyNyym+BzcPfB0S8XL4ayRnwbaUnF1cqwbJbiFUv4QR9PC2mrRW7f2EuyVdG2CiCh8EGi05f/A== + dependencies: + "@budibase/backend-core" "2.2.3" + "@budibase/types" "2.2.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.2", "@budibase/types@^2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.2.tgz#8d425f01d037758003b31bc7b72db2ecde490723" - integrity sha512-FjkymgLKipU5mzzzNf2ZtvbXOMJLyJXrxAQIvNyhdCEXR4Pfn45b8RDpusKn/MgpaljLbsTrASttPBdNfOMT7w== +"@budibase/types@2.2.3", "@budibase/types@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.3.tgz#81ecc4d04cf74698bcd7ea77cee226b0dfd9d949" + integrity sha512-+LnzJvxbsUtFnSvd9uki6N7OPwmqu4R8nLXuLzDJyknHVdrLgkAduv+0AZ6WIqjgl6ADVcvk48Et40s0wotZxw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -5493,18 +5505,6 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nano@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/nano/-/nano-10.1.0.tgz#afdd5a7440e62f09a8e23f41fcea328d27383922" - integrity sha512-COeN2TpLcHuSN44QLnPmfZCoCsKAg8/aelPOVqqm/2/MvRHDEA11/Kld5C4sLzDlWlhFZ3SO2WGJGevCsvcEzQ== - dependencies: - "@types/tough-cookie" "^4.0.2" - axios "^1.1.3" - http-cookie-agent "^4.0.2" - node-abort-controller "^3.0.1" - qs "^6.11.0" - tough-cookie "^4.1.2" - napi-macros@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" From d55172a9fb32eec9914a126f84547a02658af8fe Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 14 Dec 2022 23:15:02 +0000 Subject: [PATCH 032/114] Improve Role tests --- .../TestConfiguration/applications.ts | 10 +++++++- .../internal-api/fixtures/applications.ts | 17 +++++++++++-- .../applications/applications.spec.ts | 16 +++---------- .../internal-api/screens/screens.spec.ts | 2 +- .../userManagement/appSpecificRoles.spec.ts | 24 +++++++++++++------ 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 7eeda01f0e..53679e0bed 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -33,13 +33,21 @@ export default class AppApi { async canRender(): Promise<[Response, boolean]> { const response = await this.api.get("/routing/client") + expect(response).toHaveStatusCode(200) const json = await response.json() const publishedAppRenders = Object.keys(json.routes).length > 0 - expect(response).toHaveStatusCode(200) expect(publishedAppRenders).toBe(true) return [response, publishedAppRenders] } + async failRender(): Promise<[Response, responseMessage]> { + const response = await this.api.get("/routing/client") + const json = await response.json() + expect(response).toHaveStatusCode(404) + return [response, json] + } + + async getAppPackage(appId: string): Promise<[Response, AppPackageResponse]> { const response = await this.api.get(`/applications/${appId}/appPackage`) const json = await response.json() diff --git a/qa-core/src/config/internal-api/fixtures/applications.ts b/qa-core/src/config/internal-api/fixtures/applications.ts index 200aa9abff..0ce69bb889 100644 --- a/qa-core/src/config/internal-api/fixtures/applications.ts +++ b/qa-core/src/config/internal-api/fixtures/applications.ts @@ -1,7 +1,9 @@ import generator from "../../generator" import { Application } from "@budibase/server/api/controllers/public/mapping/types" +import { Template } from "@budibase/types" +import { App } from "@budibase/types" -const generate = ( +export const generateApp = ( overrides: Partial = {} ): Partial => ({ name: generator.word() + generator.hash(), @@ -9,4 +11,15 @@ const generate = ( ...overrides, }) -export default generate +// Applications type doesn't work here, save to add useTemplate parameter? +export const appFromTemplate = (): any => { + return ({ + name: generator.word(), + url: `/${generator.word()}`, + useTemplate: "true", + templateName: "Near Miss Register", + templateKey: "app/near-miss-register", + templateFile: undefined, + }) +} + diff --git a/qa-core/src/tests/internal-api/applications/applications.spec.ts b/qa-core/src/tests/internal-api/applications/applications.spec.ts index c7738152c4..2f0cdef411 100644 --- a/qa-core/src/tests/internal-api/applications/applications.spec.ts +++ b/qa-core/src/tests/internal-api/applications/applications.spec.ts @@ -2,7 +2,7 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import { db } from "@budibase/backend-core" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import generateApp from "../../../config/internal-api/fixtures/applications" +import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" import generator from "../../../config/generator" import generateScreen from "../../../config/internal-api/fixtures/screens" @@ -18,16 +18,7 @@ describe("Internal API - Application creation, update, publish and delete", () = await config.afterAll() }) - async function createAppFromTemplate() { - return config.applications.create({ - name: generator.word(), - url: `/${generator.word()}`, - useTemplate: "true", - templateName: "Near Miss Register", - templateKey: "app/near-miss-register", - templateFile: undefined, - }) - } + it("Get applications without applications", async () => { await config.applications.fetchEmptyAppList() }) @@ -59,8 +50,7 @@ describe("Internal API - Application creation, update, publish and delete", () = it("Publish app", async () => { // create the app - const appName = generator.word() - const app = await createAppFromTemplate() + const app = await config.applications.create(appFromTemplate()) config.applications.api.appId = app.appId // check preview renders diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index 1af13d0a11..1d2a21a8c7 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -1,7 +1,7 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { App } from "@budibase/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import generateApp from "../../../config/internal-api/fixtures/applications" +import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" import { Screen } from "@budibase/types" import generateScreen from "../../../config/internal-api/fixtures/screens" diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index 3fb97cf847..cfdd75f82e 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -1,11 +1,12 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import generateApp from "../../../config/internal-api/fixtures/applications" +import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" import { generateUser } from "../../../config/internal-api/fixtures/userManagement" import { User } from "@budibase/types" import { generateNewColumnForTable, generateTable } from "../../../config/internal-api/fixtures/table" import generateScreen from "../../../config/internal-api/fixtures/screens" +import { db } from "@budibase/backend-core" describe("Internal API - App Specific Roles & Permissions", () => { const api = new InternalAPIClient() @@ -26,7 +27,7 @@ describe("Internal API - App Specific Roles & Permissions", () => { expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - const app = await config.applications.create(generateApp()) + const app = await config.applications.create(appFromTemplate()) config.applications.api.appId = app.appId const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) @@ -50,7 +51,10 @@ describe("Internal API - App Specific Roles & Permissions", () => { expect(adminUser[0].admin?.global).toEqual(true) const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) - const app = await config.applications.create(generateApp()) + //const app = await config.applications.create(generateApp()) + //config.applications.api.appId = app.appId + + const app = await config.applications.create(appFromTemplate()) config.applications.api.appId = app.appId const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) @@ -66,6 +70,12 @@ describe("Internal API - App Specific Roles & Permissions", () => { expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + // publish app + await config.applications.publish(app.url) + // check published app renders + config.applications.api.appId = db.getProdAppID(app.appId!) + await config.applications.canRender() + }) it("Add POWER user to app", async () => { @@ -190,7 +200,9 @@ describe("Internal API - App Specific Roles & Permissions", () => { true ) }) + }) + describe("Screen Access for App specific roles", () => { it("Check Screen access for BASIC Role", async () => { const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) @@ -265,9 +277,7 @@ describe("Internal API - App Specific Roles & Permissions", () => { }) }) - - - describe.skip("App Access for custom roles", () => { + describe.skip("Screen Access for custom roles", () => { it("Custom role access for level 1 permissions", async () => { }) it("Custom role access for level 2 permissions", async () => { }) it("Custom role access for level 3 permissions", async () => { }) @@ -275,4 +285,4 @@ describe("Internal API - App Specific Roles & Permissions", () => { it("Custom role access for level 5 permissions", async () => { }) }) -}) \ No newline at end of file +}) From c3b6afbb6fa67beb8ac7aaef019c87dafb267367 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Dec 2022 09:22:28 +0000 Subject: [PATCH 033/114] Fix SQL table `_id` filtering (#9030) * Re-add support for filtering on _id using external SQL tables and fix filter key prefixes not working with _id field * Remove like operator from internal tables and only allow basic operators on SQL table _id column * Update data section filtering to respect new rules * Update automation section filtering to respect new rules * Update dynamic filter component to respect new rules --- .../SetupPanel/AutomationBlockSetup.svelte | 1 + .../backend/DataTable/DataTable.svelte | 1 + .../buttons/TableFilterButton.svelte | 2 ++ .../controls/FilterEditor/FilterDrawer.svelte | 20 ++++++----- .../controls/FilterEditor/FilterEditor.svelte | 6 ++-- packages/builder/src/helpers/searchFields.js | 10 +----- .../app/dynamic-filter/DynamicFilter.svelte | 8 ++--- .../app/dynamic-filter/FilterModal.svelte | 11 +++++-- packages/frontend-core/src/utils/lucene.js | 33 +++++++++++++------ .../api/controllers/row/ExternalRequest.ts | 21 ++++++++---- 10 files changed, 70 insertions(+), 43 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index d09faa34c9..a73db5648b 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -232,6 +232,7 @@ {filters} {bindings} {schemaFields} + datasource={{ type: "table", tableId }} panel={AutomationBindingPanel} fillWidth on:change={e => (tempFilters = e.detail)} diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index 4f5c3375bd..bdf2f46b2c 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -190,6 +190,7 @@ {filters} on:change={onFilter} disabled={!hasCols} + tableId={id} /> {/key} diff --git a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte index be9c6259c6..5db4eb5288 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte @@ -6,6 +6,7 @@ export let schema export let filters export let disabled = false + export let tableId const dispatch = createEventDispatcher() @@ -37,6 +38,7 @@ allowBindings={false} {filters} {schemaFields} + datasource={{ type: "table", tableId }} on:change={e => (tempValue = e.detail)} /> diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte index d495e37216..629e2024e7 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte @@ -25,7 +25,7 @@ export let panel = ClientBindingPanel export let allowBindings = true export let fillWidth = false - export let tableId + export let datasource const dispatch = createEventDispatcher() const { OperatorOptions } = Constants @@ -41,11 +41,7 @@ $: parseFilters(filters) $: dispatch("change", enrichFilters(rawFilters, matchAny)) - $: enrichedSchemaFields = getFields( - schemaFields || [], - { allowLinks: true }, - tableId - ) + $: enrichedSchemaFields = getFields(schemaFields || [], { allowLinks: true }) $: fieldOptions = enrichedSchemaFields.map(field => field.name) || [] $: valueTypeOptions = allowBindings ? ["Value", "Binding"] : ["Value"] @@ -119,7 +115,11 @@ const santizeOperator = filter => { // Ensure a valid operator is selected - const operators = getValidOperatorsForType(filter.type).map(x => x.value) + const operators = getValidOperatorsForType( + filter.type, + filter.field, + datasource + ).map(x => x.value) if (!operators.includes(filter.operator)) { filter.operator = operators[0] ?? OperatorOptions.Equals.value } @@ -201,7 +201,11 @@ /> onOperatorChange(filter, e.detail)} placeholder={null} diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 774ddbd834..427d8f8b97 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -7,7 +7,7 @@ const HBS_REGEX = /{{([^{].*?)}}/g * Returns the valid operator options for a certain data type * @param type the data type */ -export const getValidOperatorsForType = type => { +export const getValidOperatorsForType = (type, field, datasource) => { const Op = OperatorOptions const stringOps = [ Op.Equals, @@ -27,24 +27,37 @@ export const getValidOperatorsForType = type => { Op.NotEmpty, Op.In, ] + let ops = [] if (type === "string") { - return stringOps + ops = stringOps } else if (type === "number") { - return numOps + ops = numOps } else if (type === "options") { - return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty, Op.In] + ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty, Op.In] } else if (type === "array") { - return [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty, Op.ContainsAny] + ops = [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty, Op.ContainsAny] } else if (type === "boolean") { - return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty] + ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty] } else if (type === "longform") { - return stringOps + ops = stringOps } else if (type === "datetime") { - return numOps + ops = numOps } else if (type === "formula") { - return stringOps.concat([Op.MoreThan, Op.LessThan]) + ops = stringOps.concat([Op.MoreThan, Op.LessThan]) } - return [] + + // Filter out "like" for internal tables + const externalTable = datasource?.tableId?.includes("datasource_plus") + if (datasource?.type === "table" && !externalTable) { + ops = ops.filter(x => x !== Op.Like) + } + + // Only allow equal/not equal for _id in SQL tables + if (field === "_id" && externalTable) { + ops = [Op.Equals, Op.NotEquals] + } + + return ops } /** diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index a343553fc8..da3ff7bc53 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -25,6 +25,7 @@ import { processObjectSync } from "@budibase/string-templates" import { cloneDeep } from "lodash/fp" import { processFormulas, processDates } from "../../../utilities/rowProcessor" import { context } from "@budibase/backend-core" +import { removeKeyNumbering } from "./utils" export interface ManyRelationship { tableId?: string @@ -55,15 +56,21 @@ function buildFilters( let idCopy: undefined | string | any[] = cloneDeep(id) if (filters) { // need to map over the filters and make sure the _id field isn't present - for (let filter of Object.values(filters)) { - if (filter._id && primary) { - const parts = breakRowIdField(filter._id) - for (let field of primary) { - filter[field] = parts.shift() + let prefix = 1 + for (let operator of Object.values(filters)) { + for (let field of Object.keys(operator || {})) { + if (removeKeyNumbering(field) === "_id") { + if (primary) { + const parts = breakRowIdField(operator[field]) + for (let field of primary) { + operator[`${prefix}:${field}`] = parts.shift() + } + prefix++ + } + // make sure this field doesn't exist on any filter + delete operator[field] } } - // make sure this field doesn't exist on any filter - delete filter._id } } // there is no id, just use the user provided filters From fde4a72bebd2e1a54f9f59b1308ec1ab900ee18d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 09:37:40 +0000 Subject: [PATCH 034/114] v2.2.4 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 3f4bf5ad60..e9918a572b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.3", + "version": "2.2.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 2fcff45586..f7229afbf8 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.3", + "@budibase/types": "^2.2.4", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index dbf07e74f5..8b591fe1f0 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.3", + "version": "2.2.4", "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": "^2.2.3", + "@budibase/string-templates": "^2.2.4", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index f1dafbb2a5..0ff7553f32 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.3", + "version": "2.2.4", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.3", - "@budibase/client": "^2.2.3", - "@budibase/frontend-core": "^2.2.3", - "@budibase/string-templates": "^2.2.3", + "@budibase/bbui": "^2.2.4", + "@budibase/client": "^2.2.4", + "@budibase/frontend-core": "^2.2.4", + "@budibase/string-templates": "^2.2.4", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8a5b69f5ce..b738c8beec 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.3", - "@budibase/string-templates": "^2.2.3", - "@budibase/types": "^2.2.3", + "@budibase/backend-core": "^2.2.4", + "@budibase/string-templates": "^2.2.4", + "@budibase/types": "^2.2.4", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index d524e60c64..728fad16f2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.3", + "version": "2.2.4", "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": "^2.2.3", - "@budibase/frontend-core": "^2.2.3", - "@budibase/string-templates": "^2.2.3", + "@budibase/bbui": "^2.2.4", + "@budibase/frontend-core": "^2.2.4", + "@budibase/string-templates": "^2.2.4", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 9f623143aa..1928dff864 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.3", + "@budibase/bbui": "^2.2.4", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 31249b8a7d..e37dfaedf4 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index f4fc9d32cb..4142d8f6c4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.3", - "@budibase/client": "^2.2.3", + "@budibase/backend-core": "^2.2.4", + "@budibase/client": "^2.2.4", "@budibase/pro": "2.2.3", - "@budibase/string-templates": "^2.2.3", - "@budibase/types": "^2.2.3", + "@budibase/string-templates": "^2.2.4", + "@budibase/types": "^2.2.4", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6d878f4df8..5d340314c5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.3", + "version": "2.2.4", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 940a57bba5..0d7b1920b0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index c103804399..2c144609e8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.3", + "version": "2.2.4", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.3", + "@budibase/backend-core": "^2.2.4", "@budibase/pro": "2.2.3", - "@budibase/string-templates": "^2.2.3", - "@budibase/types": "^2.2.3", + "@budibase/string-templates": "^2.2.4", + "@budibase/types": "^2.2.4", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 92a881d480becae55e106f30d9e7fa0626bc9cba Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 09:41:31 +0000 Subject: [PATCH 035/114] Update pro version to 2.2.4 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 4142d8f6c4..184455d8e7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.4", "@budibase/client": "^2.2.4", - "@budibase/pro": "2.2.3", + "@budibase/pro": "2.2.4", "@budibase/string-templates": "^2.2.4", "@budibase/types": "^2.2.4", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 529b229481..4786dc3d24 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.3.tgz#e2c3214bdbd6fa5cc95038816ecc40a9a0538be9" - integrity sha512-vGOWkQ8Xk6p6Lcvbtj6Z4UMoZoZlllMwmnWkwBbwr0am9bVFBF9k65Ca/vioA1egsvmM9hKCCQV6xeDcUz8qaQ== +"@budibase/backend-core@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4.tgz#4fa83cb4b284573a02657a76c34b3095fe8f8961" + integrity sha512-F/9aXmO8xS6/o5kzyiSs5Jw61QoxqPIi+yXqmLmOOy3FtJdQT3QvvVphZSzWAVKGja4EH9DDfnJxt8zXE1MZWA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.3" + "@budibase/types" "^2.2.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.3.tgz#2e307353597e36df74f80d8affe4ba5686f895fb" - integrity sha512-o93ara4THEzMLyNyym+BzcPfB0S8XL4ayRnwbaUnF1cqwbJbiFUv4QR9PC2mrRW7f2EuyVdG2CiCh8EGi05f/A== +"@budibase/pro@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4.tgz#0a199e3f13b1c60b22f356cb3bac939e33a66232" + integrity sha512-l/IdyaVHlxmYcdY7BHsMGGNhKc14LPSgwat2J0soqqZgG8BYsNjukN+G8YbL4hVwCn/8ZvKVuokGMFp+b6ujzQ== dependencies: - "@budibase/backend-core" "2.2.3" - "@budibase/types" "2.2.3" + "@budibase/backend-core" "2.2.4" + "@budibase/types" "2.2.4" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.3", "@budibase/types@^2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.3.tgz#81ecc4d04cf74698bcd7ea77cee226b0dfd9d949" - integrity sha512-+LnzJvxbsUtFnSvd9uki6N7OPwmqu4R8nLXuLzDJyknHVdrLgkAduv+0AZ6WIqjgl6ADVcvk48Et40s0wotZxw== +"@budibase/types@2.2.4", "@budibase/types@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4.tgz#4baf9e54cbbdfb0a6d7e2b6f3eac50aab4712f8d" + integrity sha512-RIBkVKcdgyiWkvji3wxruW7N4WVSZGDs8gtSwmJmz74d6eKjE8GMLiIBkH1B6cWNtssSfhEoTANsNpbzK2/uvg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 2c144609e8..98d7c94d86 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.4", - "@budibase/pro": "2.2.3", + "@budibase/pro": "2.2.4", "@budibase/string-templates": "^2.2.4", "@budibase/types": "^2.2.4", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index ad7c6e14ba..395a3ae0d2 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.3.tgz#e2c3214bdbd6fa5cc95038816ecc40a9a0538be9" - integrity sha512-vGOWkQ8Xk6p6Lcvbtj6Z4UMoZoZlllMwmnWkwBbwr0am9bVFBF9k65Ca/vioA1egsvmM9hKCCQV6xeDcUz8qaQ== +"@budibase/backend-core@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4.tgz#4fa83cb4b284573a02657a76c34b3095fe8f8961" + integrity sha512-F/9aXmO8xS6/o5kzyiSs5Jw61QoxqPIi+yXqmLmOOy3FtJdQT3QvvVphZSzWAVKGja4EH9DDfnJxt8zXE1MZWA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.3" + "@budibase/types" "^2.2.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.3.tgz#2e307353597e36df74f80d8affe4ba5686f895fb" - integrity sha512-o93ara4THEzMLyNyym+BzcPfB0S8XL4ayRnwbaUnF1cqwbJbiFUv4QR9PC2mrRW7f2EuyVdG2CiCh8EGi05f/A== +"@budibase/pro@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4.tgz#0a199e3f13b1c60b22f356cb3bac939e33a66232" + integrity sha512-l/IdyaVHlxmYcdY7BHsMGGNhKc14LPSgwat2J0soqqZgG8BYsNjukN+G8YbL4hVwCn/8ZvKVuokGMFp+b6ujzQ== dependencies: - "@budibase/backend-core" "2.2.3" - "@budibase/types" "2.2.3" + "@budibase/backend-core" "2.2.4" + "@budibase/types" "2.2.4" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.3", "@budibase/types@^2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.3.tgz#81ecc4d04cf74698bcd7ea77cee226b0dfd9d949" - integrity sha512-+LnzJvxbsUtFnSvd9uki6N7OPwmqu4R8nLXuLzDJyknHVdrLgkAduv+0AZ6WIqjgl6ADVcvk48Et40s0wotZxw== +"@budibase/types@2.2.4", "@budibase/types@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4.tgz#4baf9e54cbbdfb0a6d7e2b6f3eac50aab4712f8d" + integrity sha512-RIBkVKcdgyiWkvji3wxruW7N4WVSZGDs8gtSwmJmz74d6eKjE8GMLiIBkH1B6cWNtssSfhEoTANsNpbzK2/uvg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 7fb565e9f48b587d3c2b223dd40f4f651746fca5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 15 Dec 2022 12:45:53 +0000 Subject: [PATCH 036/114] lock changes (#9047) --- packages/backend-core/src/redis/redlock.ts | 27 ++++++++++++++----- .../types/src/documents/account/account.ts | 2 ++ packages/types/src/sdk/locks.ts | 3 +++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/backend-core/src/redis/redlock.ts b/packages/backend-core/src/redis/redlock.ts index 586302c9b1..54b2c0a8d1 100644 --- a/packages/backend-core/src/redis/redlock.ts +++ b/packages/backend-core/src/redis/redlock.ts @@ -13,6 +13,18 @@ const getClient = async (type: LockType): Promise => { } return noRetryRedlock } + case LockType.DEFAULT: { + if (!noRetryRedlock) { + noRetryRedlock = await newRedlock(OPTIONS.DEFAULT) + } + return noRetryRedlock + } + case LockType.DELAY_500: { + if (!noRetryRedlock) { + noRetryRedlock = await newRedlock(OPTIONS.DELAY_500) + } + return noRetryRedlock + } default: { throw new Error(`Could not get redlock client: ${type}`) } @@ -41,6 +53,9 @@ export const OPTIONS = { // see https://www.awsarchitectureblog.com/2015/03/backoff.html retryJitter: 100, // time in ms }, + DELAY_500: { + retryDelay: 500, + }, } export const newRedlock = async (opts: Options = {}) => { @@ -55,19 +70,17 @@ export const doWithLock = async (opts: LockOptions, task: any) => { let lock try { // aquire lock - let name: string - if (opts.systemLock) { - name = opts.name - } else { - name = `${tenancy.getTenantId()}_${opts.name}` - } + let name: string = `lock:${tenancy.getTenantId()}_${opts.name}` if (opts.nameSuffix) { name = name + `_${opts.nameSuffix}` } lock = await redlock.lock(name, opts.ttl) // perform locked task - return task() + // need to await to ensure completion before unlocking + const result = await task() + return result } catch (e: any) { + console.log("lock error") // lock limit exceeded if (e.name === "LockError") { if (opts.type === LockType.TRY_ONCE) { diff --git a/packages/types/src/documents/account/account.ts b/packages/types/src/documents/account/account.ts index 70c3061c3f..cf92002744 100644 --- a/packages/types/src/documents/account/account.ts +++ b/packages/types/src/documents/account/account.ts @@ -3,6 +3,7 @@ import { Hosting, MonthlyQuotaName, PlanType, + PriceDuration, Quotas, StaticQuotaName, } from "../../sdk" @@ -46,6 +47,7 @@ export interface Account extends CreateAccount { tier: string // deprecated planType?: PlanType planTier?: number + planDuration?: PriceDuration stripeCustomerId?: string licenseKey?: string licenseKeyActivatedAt?: number diff --git a/packages/types/src/sdk/locks.ts b/packages/types/src/sdk/locks.ts index e2f1902762..e6809319b1 100644 --- a/packages/types/src/sdk/locks.ts +++ b/packages/types/src/sdk/locks.ts @@ -4,11 +4,14 @@ export enum LockType { * No retries will take place and no error will be thrown. */ TRY_ONCE = "try_once", + DEFAULT = "default", + DELAY_500 = "delay_500", } export enum LockName { MIGRATIONS = "migrations", TRIGGER_QUOTA = "trigger_quota", + SYNC_ACCOUNT_LICENSE = "sync_account_license", } export interface LockOptions { From 70d6dd985543b5aab08ba352e4b60144ddcd0859 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 13:04:16 +0000 Subject: [PATCH 037/114] v2.2.5 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index e9918a572b..1e22c0ee03 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.4", + "version": "2.2.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index f7229afbf8..d7a2a8a73d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.4", + "version": "2.2.5", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.4", + "@budibase/types": "^2.2.5", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 8b591fe1f0..e1e6c641ff 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.4", + "version": "2.2.5", "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": "^2.2.4", + "@budibase/string-templates": "^2.2.5", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 0ff7553f32..1e8e6db189 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.4", + "version": "2.2.5", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.4", - "@budibase/client": "^2.2.4", - "@budibase/frontend-core": "^2.2.4", - "@budibase/string-templates": "^2.2.4", + "@budibase/bbui": "^2.2.5", + "@budibase/client": "^2.2.5", + "@budibase/frontend-core": "^2.2.5", + "@budibase/string-templates": "^2.2.5", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index b738c8beec..889c75dabc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.4", + "version": "2.2.5", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.4", - "@budibase/string-templates": "^2.2.4", - "@budibase/types": "^2.2.4", + "@budibase/backend-core": "^2.2.5", + "@budibase/string-templates": "^2.2.5", + "@budibase/types": "^2.2.5", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 728fad16f2..146440f805 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.4", + "version": "2.2.5", "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": "^2.2.4", - "@budibase/frontend-core": "^2.2.4", - "@budibase/string-templates": "^2.2.4", + "@budibase/bbui": "^2.2.5", + "@budibase/frontend-core": "^2.2.5", + "@budibase/string-templates": "^2.2.5", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 1928dff864..97a0a17f1b 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.4", + "version": "2.2.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.2.4", + "@budibase/bbui": "^2.2.5", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e37dfaedf4..29d848f6c3 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.4", + "version": "2.2.5", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 184455d8e7..16acb83264 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.4", + "version": "2.2.5", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.4", - "@budibase/client": "^2.2.4", + "@budibase/backend-core": "^2.2.5", + "@budibase/client": "^2.2.5", "@budibase/pro": "2.2.4", - "@budibase/string-templates": "^2.2.4", - "@budibase/types": "^2.2.4", + "@budibase/string-templates": "^2.2.5", + "@budibase/types": "^2.2.5", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5d340314c5..b88ba9d38c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.4", + "version": "2.2.5", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 0d7b1920b0..49f20b28b2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.4", + "version": "2.2.5", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 98d7c94d86..7c0e64f761 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.4", + "version": "2.2.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.2.4", + "@budibase/backend-core": "^2.2.5", "@budibase/pro": "2.2.4", - "@budibase/string-templates": "^2.2.4", - "@budibase/types": "^2.2.4", + "@budibase/string-templates": "^2.2.5", + "@budibase/types": "^2.2.5", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 17b7911fe8972b9fab97dfb6794987f506d8bc98 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 13:08:36 +0000 Subject: [PATCH 038/114] Update pro version to 2.2.5 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 16acb83264..bc34f5ee14 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.5", "@budibase/client": "^2.2.5", - "@budibase/pro": "2.2.4", + "@budibase/pro": "2.2.5", "@budibase/string-templates": "^2.2.5", "@budibase/types": "^2.2.5", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 4786dc3d24..0cc1ae22b9 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4.tgz#4fa83cb4b284573a02657a76c34b3095fe8f8961" - integrity sha512-F/9aXmO8xS6/o5kzyiSs5Jw61QoxqPIi+yXqmLmOOy3FtJdQT3QvvVphZSzWAVKGja4EH9DDfnJxt8zXE1MZWA== +"@budibase/backend-core@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.5.tgz#3cbf4b4848f63a3b20e81f5c615fcb4e92bef643" + integrity sha512-H4j3puP4yYcFgpkTXBkBnEBMRRXq17UPKNFjTbqnfkJU6lNevcAa/XuYRXRzWLThfXrl0UDspNwV6hE8MRlehg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.4" + "@budibase/types" "^2.2.5" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4.tgz#0a199e3f13b1c60b22f356cb3bac939e33a66232" - integrity sha512-l/IdyaVHlxmYcdY7BHsMGGNhKc14LPSgwat2J0soqqZgG8BYsNjukN+G8YbL4hVwCn/8ZvKVuokGMFp+b6ujzQ== +"@budibase/pro@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.5.tgz#4d156215c559da74378b01bb92229fc30b81733d" + integrity sha512-Gg3Rih1GdzDhkKfFYeRfokkOWp36k3kuZ56j5VeaIiqULC4oBFkPoXflx9lI0UX3zRGrIhHx9cvw1UoqpXB7Dg== dependencies: - "@budibase/backend-core" "2.2.4" - "@budibase/types" "2.2.4" + "@budibase/backend-core" "2.2.5" + "@budibase/types" "2.2.5" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.4", "@budibase/types@^2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4.tgz#4baf9e54cbbdfb0a6d7e2b6f3eac50aab4712f8d" - integrity sha512-RIBkVKcdgyiWkvji3wxruW7N4WVSZGDs8gtSwmJmz74d6eKjE8GMLiIBkH1B6cWNtssSfhEoTANsNpbzK2/uvg== +"@budibase/types@2.2.5", "@budibase/types@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.5.tgz#801f2f305880208ad020fa3ac67e010c5672402f" + integrity sha512-20AqQAMWzFN3gJ+AgdI1qDGe+u0avpiUkxEM+MMcxXVUmqNFm6Z1KJ2AfCSOYgV7aMRPiLMOkdVms6Wm2Iv2Zg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 7c0e64f761..76602e682e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.5", - "@budibase/pro": "2.2.4", + "@budibase/pro": "2.2.5", "@budibase/string-templates": "^2.2.5", "@budibase/types": "^2.2.5", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 395a3ae0d2..3f2c461688 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4.tgz#4fa83cb4b284573a02657a76c34b3095fe8f8961" - integrity sha512-F/9aXmO8xS6/o5kzyiSs5Jw61QoxqPIi+yXqmLmOOy3FtJdQT3QvvVphZSzWAVKGja4EH9DDfnJxt8zXE1MZWA== +"@budibase/backend-core@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.5.tgz#3cbf4b4848f63a3b20e81f5c615fcb4e92bef643" + integrity sha512-H4j3puP4yYcFgpkTXBkBnEBMRRXq17UPKNFjTbqnfkJU6lNevcAa/XuYRXRzWLThfXrl0UDspNwV6hE8MRlehg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.4" + "@budibase/types" "^2.2.5" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4.tgz#0a199e3f13b1c60b22f356cb3bac939e33a66232" - integrity sha512-l/IdyaVHlxmYcdY7BHsMGGNhKc14LPSgwat2J0soqqZgG8BYsNjukN+G8YbL4hVwCn/8ZvKVuokGMFp+b6ujzQ== +"@budibase/pro@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.5.tgz#4d156215c559da74378b01bb92229fc30b81733d" + integrity sha512-Gg3Rih1GdzDhkKfFYeRfokkOWp36k3kuZ56j5VeaIiqULC4oBFkPoXflx9lI0UX3zRGrIhHx9cvw1UoqpXB7Dg== dependencies: - "@budibase/backend-core" "2.2.4" - "@budibase/types" "2.2.4" + "@budibase/backend-core" "2.2.5" + "@budibase/types" "2.2.5" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.4", "@budibase/types@^2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4.tgz#4baf9e54cbbdfb0a6d7e2b6f3eac50aab4712f8d" - integrity sha512-RIBkVKcdgyiWkvji3wxruW7N4WVSZGDs8gtSwmJmz74d6eKjE8GMLiIBkH1B6cWNtssSfhEoTANsNpbzK2/uvg== +"@budibase/types@2.2.5", "@budibase/types@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.5.tgz#801f2f305880208ad020fa3ac67e010c5672402f" + integrity sha512-20AqQAMWzFN3gJ+AgdI1qDGe+u0avpiUkxEM+MMcxXVUmqNFm6Z1KJ2AfCSOYgV7aMRPiLMOkdVms6Wm2Iv2Zg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 31c7a122f03041ff6ce3384d69fcced6f0f4e0ca Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Thu, 15 Dec 2022 15:13:12 +0000 Subject: [PATCH 039/114] Make looping arrow point in right direction (#9053) --- .../automation/AutomationBuilder/FlowChart/FlowItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 2d0a86d95c..d6e5fcb36d 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -180,7 +180,7 @@ onSelect(block) }} > - + From 76d99dbe2b39bdd2e4502d1a6057561b081453da Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 15:27:14 +0000 Subject: [PATCH 040/114] v2.2.6 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 1e22c0ee03..4e50e75925 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.5", + "version": "2.2.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index d7a2a8a73d..4c0ae9f1b5 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.5", + "@budibase/types": "^2.2.6", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index e1e6c641ff..15ac33bc4e 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.5", + "version": "2.2.6", "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": "^2.2.5", + "@budibase/string-templates": "^2.2.6", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 1e8e6db189..c039a28c8d 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.5", + "version": "2.2.6", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.5", - "@budibase/client": "^2.2.5", - "@budibase/frontend-core": "^2.2.5", - "@budibase/string-templates": "^2.2.5", + "@budibase/bbui": "^2.2.6", + "@budibase/client": "^2.2.6", + "@budibase/frontend-core": "^2.2.6", + "@budibase/string-templates": "^2.2.6", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 889c75dabc..6f2a6f7357 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.5", - "@budibase/string-templates": "^2.2.5", - "@budibase/types": "^2.2.5", + "@budibase/backend-core": "^2.2.6", + "@budibase/string-templates": "^2.2.6", + "@budibase/types": "^2.2.6", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 146440f805..87eaedbe6a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.5", + "version": "2.2.6", "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": "^2.2.5", - "@budibase/frontend-core": "^2.2.5", - "@budibase/string-templates": "^2.2.5", + "@budibase/bbui": "^2.2.6", + "@budibase/frontend-core": "^2.2.6", + "@budibase/string-templates": "^2.2.6", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 97a0a17f1b..af9e5c1143 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.5", + "@budibase/bbui": "^2.2.6", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 29d848f6c3..15e672610e 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index bc34f5ee14..6a68eeb8c7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.5", - "@budibase/client": "^2.2.5", + "@budibase/backend-core": "^2.2.6", + "@budibase/client": "^2.2.6", "@budibase/pro": "2.2.5", - "@budibase/string-templates": "^2.2.5", - "@budibase/types": "^2.2.5", + "@budibase/string-templates": "^2.2.6", + "@budibase/types": "^2.2.6", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b88ba9d38c..6a0c162bf3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.5", + "version": "2.2.6", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 49f20b28b2..f9e8098459 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 76602e682e..dedf93ac55 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.5", + "version": "2.2.6", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.5", + "@budibase/backend-core": "^2.2.6", "@budibase/pro": "2.2.5", - "@budibase/string-templates": "^2.2.5", - "@budibase/types": "^2.2.5", + "@budibase/string-templates": "^2.2.6", + "@budibase/types": "^2.2.6", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From bf93d5b6a301bd7aeb44672914180a4821dc63ec Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 15 Dec 2022 15:30:56 +0000 Subject: [PATCH 041/114] Update pro version to 2.2.6 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 6a68eeb8c7..a47b52b2b8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.6", "@budibase/client": "^2.2.6", - "@budibase/pro": "2.2.5", + "@budibase/pro": "2.2.6", "@budibase/string-templates": "^2.2.6", "@budibase/types": "^2.2.6", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 0cc1ae22b9..e72decdb65 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.5.tgz#3cbf4b4848f63a3b20e81f5c615fcb4e92bef643" - integrity sha512-H4j3puP4yYcFgpkTXBkBnEBMRRXq17UPKNFjTbqnfkJU6lNevcAa/XuYRXRzWLThfXrl0UDspNwV6hE8MRlehg== +"@budibase/backend-core@2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" + integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.5" + "@budibase/types" "^2.2.6" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.5.tgz#4d156215c559da74378b01bb92229fc30b81733d" - integrity sha512-Gg3Rih1GdzDhkKfFYeRfokkOWp36k3kuZ56j5VeaIiqULC4oBFkPoXflx9lI0UX3zRGrIhHx9cvw1UoqpXB7Dg== +"@budibase/pro@2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" + integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== dependencies: - "@budibase/backend-core" "2.2.5" - "@budibase/types" "2.2.5" + "@budibase/backend-core" "2.2.6" + "@budibase/types" "2.2.6" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.5", "@budibase/types@^2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.5.tgz#801f2f305880208ad020fa3ac67e010c5672402f" - integrity sha512-20AqQAMWzFN3gJ+AgdI1qDGe+u0avpiUkxEM+MMcxXVUmqNFm6Z1KJ2AfCSOYgV7aMRPiLMOkdVms6Wm2Iv2Zg== +"@budibase/types@2.2.6", "@budibase/types@^2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" + integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index dedf93ac55..0faa9adf53 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.6", - "@budibase/pro": "2.2.5", + "@budibase/pro": "2.2.6", "@budibase/string-templates": "^2.2.6", "@budibase/types": "^2.2.6", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 3f2c461688..2e85eae1c2 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.5.tgz#3cbf4b4848f63a3b20e81f5c615fcb4e92bef643" - integrity sha512-H4j3puP4yYcFgpkTXBkBnEBMRRXq17UPKNFjTbqnfkJU6lNevcAa/XuYRXRzWLThfXrl0UDspNwV6hE8MRlehg== +"@budibase/backend-core@2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" + integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.5" + "@budibase/types" "^2.2.6" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.5.tgz#4d156215c559da74378b01bb92229fc30b81733d" - integrity sha512-Gg3Rih1GdzDhkKfFYeRfokkOWp36k3kuZ56j5VeaIiqULC4oBFkPoXflx9lI0UX3zRGrIhHx9cvw1UoqpXB7Dg== +"@budibase/pro@2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" + integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== dependencies: - "@budibase/backend-core" "2.2.5" - "@budibase/types" "2.2.5" + "@budibase/backend-core" "2.2.6" + "@budibase/types" "2.2.6" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.5", "@budibase/types@^2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.5.tgz#801f2f305880208ad020fa3ac67e010c5672402f" - integrity sha512-20AqQAMWzFN3gJ+AgdI1qDGe+u0avpiUkxEM+MMcxXVUmqNFm6Z1KJ2AfCSOYgV7aMRPiLMOkdVms6Wm2Iv2Zg== +"@budibase/types@2.2.6", "@budibase/types@^2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" + integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 2264f83ebd2c4d9c321fb189c0491d292d00eb51 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 16 Dec 2022 10:22:48 +0000 Subject: [PATCH 042/114] Types/attaching license to account (#9065) * adding license type to account * removing planDuration --- packages/types/src/documents/account/account.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/types/src/documents/account/account.ts b/packages/types/src/documents/account/account.ts index cf92002744..a8684f8427 100644 --- a/packages/types/src/documents/account/account.ts +++ b/packages/types/src/documents/account/account.ts @@ -1,6 +1,7 @@ import { Feature, Hosting, + License, MonthlyQuotaName, PlanType, PriceDuration, @@ -47,7 +48,7 @@ export interface Account extends CreateAccount { tier: string // deprecated planType?: PlanType planTier?: number - planDuration?: PriceDuration + license?: License stripeCustomerId?: string licenseKey?: string licenseKeyActivatedAt?: number From 80d06fbad86675117ce37431ebe1135282f0a100 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 10:41:13 +0000 Subject: [PATCH 043/114] v2.2.7 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 4e50e75925..e47dc50106 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.6", + "version": "2.2.7", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4c0ae9f1b5..1db36e07cd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.6", + "@budibase/types": "^2.2.7", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 15ac33bc4e..8bc8d7edac 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.6", + "version": "2.2.7", "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": "^2.2.6", + "@budibase/string-templates": "^2.2.7", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index c039a28c8d..8d7ec2c469 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.6", + "version": "2.2.7", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.6", - "@budibase/client": "^2.2.6", - "@budibase/frontend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", + "@budibase/bbui": "^2.2.7", + "@budibase/client": "^2.2.7", + "@budibase/frontend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 6f2a6f7357..974a1ad264 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/backend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 87eaedbe6a..08e8f5e684 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.6", + "version": "2.2.7", "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": "^2.2.6", - "@budibase/frontend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", + "@budibase/bbui": "^2.2.7", + "@budibase/frontend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index af9e5c1143..476ed0e445 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.6", + "@budibase/bbui": "^2.2.7", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 15e672610e..620efaec08 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index a47b52b2b8..77e4a334d8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.6", - "@budibase/client": "^2.2.6", + "@budibase/backend-core": "^2.2.7", + "@budibase/client": "^2.2.7", "@budibase/pro": "2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6a0c162bf3..95d0c5a918 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.6", + "version": "2.2.7", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index f9e8098459..36d723c796 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 0faa9adf53..01d5a518d5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.6", + "@budibase/backend-core": "^2.2.7", "@budibase/pro": "2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 5c2d37620993e5e732aab0393f0cc2585d1eec61 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 10:45:37 +0000 Subject: [PATCH 044/114] Update pro version to 2.2.7 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 77e4a334d8..c8cad9d95b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.7", "@budibase/client": "^2.2.7", - "@budibase/pro": "2.2.6", + "@budibase/pro": "2.2.7", "@budibase/string-templates": "^2.2.7", "@budibase/types": "^2.2.7", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e72decdb65..8365a19d0f 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" - integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== +"@budibase/backend-core@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" + integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.6" + "@budibase/types" "^2.2.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" - integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== +"@budibase/pro@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" + integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== dependencies: - "@budibase/backend-core" "2.2.6" - "@budibase/types" "2.2.6" + "@budibase/backend-core" "2.2.7" + "@budibase/types" "2.2.7" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.6", "@budibase/types@^2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" - integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== +"@budibase/types@2.2.7", "@budibase/types@^2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" + integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 01d5a518d5..397651eacc 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.7", - "@budibase/pro": "2.2.6", + "@budibase/pro": "2.2.7", "@budibase/string-templates": "^2.2.7", "@budibase/types": "^2.2.7", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 2e85eae1c2..75a713bdf2 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" - integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== +"@budibase/backend-core@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" + integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.6" + "@budibase/types" "^2.2.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" - integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== +"@budibase/pro@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" + integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== dependencies: - "@budibase/backend-core" "2.2.6" - "@budibase/types" "2.2.6" + "@budibase/backend-core" "2.2.7" + "@budibase/types" "2.2.7" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.6", "@budibase/types@^2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" - integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== +"@budibase/types@2.2.7", "@budibase/types@^2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" + integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 0fa1e7b97bb3949d2fbd091d866321dee7e11f7b Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 16 Dec 2022 11:24:16 +0000 Subject: [PATCH 045/114] Add tests for app specific roles --- .../internal-api/TestConfiguration/auth.ts | 1 + .../TestConfiguration/userManagement.ts | 9 +++++ .../userManagement/appSpecificRoles.spec.ts | 33 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/qa-core/src/config/internal-api/TestConfiguration/auth.ts b/qa-core/src/config/internal-api/TestConfiguration/auth.ts index d72502b417..3fe57c50be 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/auth.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/auth.ts @@ -27,6 +27,7 @@ export default class AuthApi { password: password, }, }) + expect(response).toHaveStatusCode(200) const cookie = response.headers.get("set-cookie") this.api.cookie = cookie as any return [response, cookie] diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index e602c37c8a..b10eafa217 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -115,4 +115,13 @@ export default class UserManagementApi { expect(response).toHaveStatusCode(200) return [response, json] } + + async changeSelfPassword(body: Partial): Promise<[Response, User]> { + const response = await this.api.post(`/global/self`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } } \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index cfdd75f82e..f375cf3158 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -226,8 +226,26 @@ describe("Internal API - App Specific Roles & Permissions", () => { expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) + const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + await config.login(appUser[0].email, appUser[0].password) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + //Update password + const userWithNewPassword = { + ...selfInfoJson, + password: appUser[0].password + } + await config.users.changeSelfPassword(userWithNewPassword) + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for POWER role", async () => { @@ -251,6 +269,21 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) + const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + await config.login(appUser[0].email, appUser[0].password) + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(2) + expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for ADMIN role", async () => { From 712f1d1fc127f04f0e811e2b39b7214ca744c6df Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 16 Dec 2022 13:16:37 +0000 Subject: [PATCH 046/114] Environment variable type coercion fix (#9074) * Environment variable type coercion fix * Update .gitignore --- .gitignore | 1 + packages/server/src/environment.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e1d3e6db0e..915e2ea160 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ builder/* packages/server/runtime_apps/ .idea/ bb-airgapped.tar.gz +*.iml # Logs logs diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index bf5330f9b6..e900753be3 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -108,12 +108,12 @@ const environment = { } // threading can cause memory issues with node-ts in development -if (isDev() && module.exports.DISABLE_THREADING == null) { +if (isDev() && environment.DISABLE_THREADING == null) { environment._set("DISABLE_THREADING", "1") } // clean up any environment variable edge cases -for (let [key, value] of Object.entries(module.exports)) { +for (let [key, value] of Object.entries(environment)) { // handle the edge case of "0" to disable an environment variable if (value === "0") { // @ts-ignore From 1835b89b7252dd1365620d2d3813d8c123588c3c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 13:32:25 +0000 Subject: [PATCH 047/114] v2.2.8 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index e47dc50106..2b9efd53b9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.7", + "version": "2.2.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 1db36e07cd..6070a2cd50 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.7", + "@budibase/types": "^2.2.8", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 8bc8d7edac..aa16117fa7 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.7", + "version": "2.2.8", "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": "^2.2.7", + "@budibase/string-templates": "^2.2.8", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 8d7ec2c469..be2befbe44 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.7", + "version": "2.2.8", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.7", - "@budibase/client": "^2.2.7", - "@budibase/frontend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", + "@budibase/bbui": "^2.2.8", + "@budibase/client": "^2.2.8", + "@budibase/frontend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.8", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 974a1ad264..f38dc8105d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/backend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 08e8f5e684..cdd8f4941f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.7", + "version": "2.2.8", "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": "^2.2.7", - "@budibase/frontend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", + "@budibase/bbui": "^2.2.8", + "@budibase/frontend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.8", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 476ed0e445..e92d54c74a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.7", + "@budibase/bbui": "^2.2.8", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 620efaec08..d30c707649 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index c8cad9d95b..5295deb7f1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.7", - "@budibase/client": "^2.2.7", + "@budibase/backend-core": "^2.2.8", + "@budibase/client": "^2.2.8", "@budibase/pro": "2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 95d0c5a918..085e7b07cc 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.7", + "version": "2.2.8", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 36d723c796..5ed20d6b66 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 397651eacc..ee721db565 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.7", + "@budibase/backend-core": "^2.2.8", "@budibase/pro": "2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 7754ed5f35854131d0a99b413b37ec3ba301d9dc Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 13:36:26 +0000 Subject: [PATCH 048/114] Update pro version to 2.2.8 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 5295deb7f1..97783614a3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.8", "@budibase/client": "^2.2.8", - "@budibase/pro": "2.2.7", + "@budibase/pro": "2.2.8", "@budibase/string-templates": "^2.2.8", "@budibase/types": "^2.2.8", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 8365a19d0f..eb3ccd3b90 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" - integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== +"@budibase/backend-core@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.8.tgz#9a72bc9bab013f8322ab85cdab5c96b743aa2bcd" + integrity sha512-1wY+xVOCOyiLyhRokOu6VAfsU0WVu7U6Rbcmz1PMSJcYbricucH1XAThKISmKXPP6K3L8o/Ug+r4leI96yw1dQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.7" + "@budibase/types" "^2.2.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" - integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== +"@budibase/pro@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.8.tgz#5b42e85b1843dcc133001e4eb130f371f0c6e973" + integrity sha512-rg4Vq1vWu09DTpqtuiP9yqJ+XyuKoIb9/HTWo1nFfuxOkNBagDEmHJnp8Q+Kwhs+ubWpCGCyC2Ge15JsbLhCCw== dependencies: - "@budibase/backend-core" "2.2.7" - "@budibase/types" "2.2.7" + "@budibase/backend-core" "2.2.8" + "@budibase/types" "2.2.8" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.7", "@budibase/types@^2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" - integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== +"@budibase/types@2.2.8", "@budibase/types@^2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.8.tgz#fd681947d346c9262bb041f6ffea5a0691ff6ba5" + integrity sha512-mBhEkt+H4uzYuDDYcx7042EBoHUGungURhyi442NF6AWR60u4xbq9MoP+F5DGvSz8zAWQhO6gpkO3hNBeY2aGQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index ee721db565..0f6d6b9b35 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.8", - "@budibase/pro": "2.2.7", + "@budibase/pro": "2.2.8", "@budibase/string-templates": "^2.2.8", "@budibase/types": "^2.2.8", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 75a713bdf2..d4fdd2ace8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" - integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== +"@budibase/backend-core@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.8.tgz#9a72bc9bab013f8322ab85cdab5c96b743aa2bcd" + integrity sha512-1wY+xVOCOyiLyhRokOu6VAfsU0WVu7U6Rbcmz1PMSJcYbricucH1XAThKISmKXPP6K3L8o/Ug+r4leI96yw1dQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.7" + "@budibase/types" "^2.2.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" - integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== +"@budibase/pro@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.8.tgz#5b42e85b1843dcc133001e4eb130f371f0c6e973" + integrity sha512-rg4Vq1vWu09DTpqtuiP9yqJ+XyuKoIb9/HTWo1nFfuxOkNBagDEmHJnp8Q+Kwhs+ubWpCGCyC2Ge15JsbLhCCw== dependencies: - "@budibase/backend-core" "2.2.7" - "@budibase/types" "2.2.7" + "@budibase/backend-core" "2.2.8" + "@budibase/types" "2.2.8" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.7", "@budibase/types@^2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" - integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== +"@budibase/types@2.2.8", "@budibase/types@^2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.8.tgz#fd681947d346c9262bb041f6ffea5a0691ff6ba5" + integrity sha512-mBhEkt+H4uzYuDDYcx7042EBoHUGungURhyi442NF6AWR60u4xbq9MoP+F5DGvSz8zAWQhO6gpkO3hNBeY2aGQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From c0eb8c039ad0cf80714e766ee37c0a14d23d6721 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 16 Dec 2022 15:30:12 +0000 Subject: [PATCH 049/114] using production appID in BASIC screens test --- .../userManagement/appSpecificRoles.spec.ts | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index f375cf3158..cda597bb8c 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -204,45 +204,48 @@ describe("Internal API - App Specific Roles & Permissions", () => { describe("Screen Access for App specific roles", () => { it("Check Screen access for BASIC Role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId]: "BASIC", + [prodAppId]: "BASIC", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("BASIC") - const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) - const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) - const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) - await config.login(appUser[0].email, appUser[0].password) + // login with BASIC user + await config.login(appUser[0].email!, appUser[0].password!) const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - //Update password - const userWithNewPassword = { - ...selfInfoJson, - password: appUser[0].password - } - await config.users.changeSelfPassword(userWithNewPassword) - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(1) expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") @@ -255,35 +258,35 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { - [app.appId]: "POWER", + [app.appId!]: "POWER", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + expect(changedUserInfoJson.roles[app.appId!]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId!]).toEqual("POWER") - const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) - const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) - const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId!) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) - await config.login(appUser[0].email, appUser[0].password) + await config.login(appUser[0].email!, appUser[0].password!) const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(2) - expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for ADMIN role", async () => { @@ -307,7 +310,6 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - }) }) describe.skip("Screen Access for custom roles", () => { From 8cc8db7842f5612b2943e146d10cd62a9a4bd745 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 16 Dec 2022 18:17:30 +0000 Subject: [PATCH 050/114] Add for app specific custom roles --- .../TestConfiguration/userManagement.ts | 10 +- .../userManagement/appSpecificRoles.spec.ts | 334 +++++++++++++++++- 2 files changed, 327 insertions(+), 17 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index b10eafa217..12a52034cc 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { Role, User, UserDeletedEvent } from "@budibase/types" +import { Role, User, UserDeletedEvent, UserRoles } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -87,7 +87,6 @@ export default class UserManagementApi { const response = await this.api.get(`/roles`) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.length).toEqual(4) return [response, json] } @@ -124,4 +123,11 @@ export default class UserManagementApi { expect(json._rev).not.toEqual(body._rev) return [response, json] } + + async createRole(body: Partial): Promise<[Response, UserRoles]> { + const response = await this.api.post(`/roles`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } } \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index cda597bb8c..d27e846b22 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -252,72 +252,376 @@ describe("Internal API - App Specific Roles & Permissions", () => { }) it("Check Screen access for POWER role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId!]: "POWER", + [prodAppId]: "POWER", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId!]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId!]).toEqual("POWER") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("POWER") await config.screen.create(generateScreen("BASIC")) await config.screen.create(generateScreen("POWER")) await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId!) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) + // login with POWER user await config.login(appUser[0].email!, appUser[0].password!) - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(2) }) it("Check Screen access for ADMIN role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId]: "ADMIN", + [prodAppId]: "ADMIN", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("ADMIN") + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with ADMIN user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(3) }) }) - describe.skip("Screen Access for custom roles", () => { - it("Custom role access for level 1 permissions", async () => { }) - it("Custom role access for level 2 permissions", async () => { }) - it("Custom role access for level 3 permissions", async () => { }) - it("Custom role access for level 4 permissions", async () => { }) - it("Custom role access for level 5 permissions", async () => { }) + describe("Screen Access for custom roles", () => { + it("Custom role access for level 1 permissions", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "public", + name: "level 1" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 2 permissions", async () => {// Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "read_only", + name: "level 2" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 3 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "write", + name: "level 3" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 4 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "power", + name: "level 4" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 5 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "admin", + name: "level 5" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) }) }) From 3b1819952d9eea37634902d05a9055af8e13087f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 17 Dec 2022 14:13:06 +0000 Subject: [PATCH 051/114] Builder data section routing refactor (#8996) * Improve theming with spectrum badges and dedupe spectrum label usage * Update data section nav to match designs and use panel component * Fix main content layout in data section * Update data section routing for tables * Improve data section routing for tables to account for edge cases * Update internal and sample datasource routing * Update external datasource routing * Update routing for queries and make a top level concept like everything else * Update routing for views * Fix undefined reference when deleting datasource * Reduce network calls and fix issues with stale datasourcenavigator state * Update routing for REST queries and unify routes for normal queries and REST queries * Lint * Fix links for queries from datasource details page * Remove redundant API calls and improve table deletion logic * Improve data entity deletion logic and redirection and fix query details keying * Improve determination of selected item in datasource tree * Lint * Fix BBUI import * Fix datasource navigator selected state not working for internal DB or sample data --- packages/bbui/src/Badge/Badge.svelte | 13 + .../src/Table/RelationshipRenderer.svelte | 11 +- .../components/backend/DataTable/Table.svelte | 1 - .../DataTable/modals/CreateViewModal.svelte | 4 +- .../DatasourceNavigator.svelte | 132 ++++++---- .../popovers/EditDatasourcePopover.svelte | 19 +- .../popovers/EditQueryPopover.svelte | 16 +- .../TableNavigator/TableNavigator.svelte | 33 +-- .../popovers/EditTablePopover.svelte | 9 +- .../popovers/EditViewPopover.svelte | 7 +- .../src/components/design/Panel.svelte | 2 + .../integration}/DynamicVariableModal.svelte | 0 .../components/integration/QueryViewer.svelte | 245 +++++++++--------- .../integration}/RestBodyInput.svelte | 0 .../integration/RestQueryViewer.svelte} | 37 ++- packages/builder/src/helpers/urlStateSync.js | 19 +- .../app/[application]/data/_layout.svelte | 69 ++--- .../datasource/[datasourceId]/_layout.svelte | 23 ++ .../index.svelte | 52 ++-- .../[query]/_layout.svelte | 23 -- .../[selectedDatasource]/[query]/index.svelte | 39 --- .../[selectedDatasource]/_layout.svelte | 17 -- .../rest/[query]/_layout.svelte | 13 - .../datasource/bb_internal/_layout.svelte | 7 - .../data/datasource/bb_internal/index.svelte | 10 +- .../_layout.svelte | 8 - .../index.svelte | 19 +- .../data/datasource/index.svelte | 10 +- .../data/query/[queryId]/_layout.svelte | 22 ++ .../data/query/[queryId]/index.svelte | 18 ++ .../app/[application]/data/query/index.svelte | 16 ++ .../query/new/[datasourceId]/index.svelte | 38 +++ .../[application]/data/query/new/index.svelte | 5 + .../data/table/[selectedTable]/_layout.svelte | 13 - .../data/table/[tableId]/_layout.svelte | 20 ++ .../index.svelte | 6 +- .../[rowId]/[field]}/index.svelte | 6 +- .../relationship/[rowId]}/index.svelte | 0 .../relationship/index.svelte | 0 .../[application]/data/table/_layout.svelte | 19 -- .../app/[application]/data/table/index.svelte | 11 +- .../data/view/[selectedView]/_layout.svelte | 22 -- .../data/view/[viewName]/_layout.svelte | 20 ++ .../index.svelte | 0 .../app/[application]/data/view/index.svelte | 16 ++ .../builder/src/stores/backend/datasources.js | 160 ++++++------ .../builder/src/stores/backend/queries.js | 226 ++++++++-------- packages/builder/src/stores/backend/tables.js | 196 +++++++------- packages/builder/src/stores/backend/views.js | 88 ++++--- 49 files changed, 894 insertions(+), 846 deletions(-) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components => components/integration}/DynamicVariableModal.svelte (100%) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components => components/integration}/RestBodyInput.svelte (100%) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte => components/integration/RestQueryViewer.svelte} (98%) create mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/datasource/{[selectedDatasource] => [datasourceId]}/index.svelte (87%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/datasource_internal_bb_default/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/[queryId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/[queryId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/new/[datasourceId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/new/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/[tableId]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable] => [tableId]}/index.svelte (71%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable]/relationship/[selectedRow]/[selectedField] => [tableId]/relationship/[rowId]/[field]}/index.svelte (62%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable]/relationship/[selectedRow] => [tableId]/relationship/[rowId]}/index.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable] => [tableId]}/relationship/index.svelte (100%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/view/{[selectedView] => [viewName]}/index.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/index.svelte diff --git a/packages/bbui/src/Badge/Badge.svelte b/packages/bbui/src/Badge/Badge.svelte index 4bc701d983..8b54045297 100644 --- a/packages/bbui/src/Badge/Badge.svelte +++ b/packages/bbui/src/Badge/Badge.svelte @@ -10,10 +10,13 @@ export let green = false export let active = false export let inactive = false + export let hoverable = false + + diff --git a/packages/bbui/src/Table/RelationshipRenderer.svelte b/packages/bbui/src/Table/RelationshipRenderer.svelte index 4db0c63d95..b70eaeb07d 100644 --- a/packages/bbui/src/Table/RelationshipRenderer.svelte +++ b/packages/bbui/src/Table/RelationshipRenderer.svelte @@ -1,6 +1,7 @@ {#if $database?._id} @@ -44,8 +23,9 @@ border={idx > 0} icon={table._id === TableNames.USERS ? "UserGroup" : "Table"} text={table.name} - selected={$tables.selected?._id === table._id} - on:click={() => selectTable(table)} + selected={$isActive("./table/:tableId") && + $tables.selected?._id === table._id} + on:click={() => $goto(`./table/${table._id}`)} > {#if table._id !== TableNames.USERS} @@ -56,8 +36,9 @@ indentLevel={2} icon="Remove" text={viewName} - selected={selectedView === viewName} - on:click={() => onClickView(table, viewName)} + selected={$isActive("./view/:viewName") && + $views.selected?.name === viewName} + on:click={() => $goto(`./view/${viewName}`)} > - import { goto } from "@roxi/routify" + import { goto, params } from "@roxi/routify" import { store } from "builderStore" import { cloneDeep } from "lodash/fp" import { tables, datasources } from "stores/backend" @@ -41,17 +41,16 @@ } async function deleteTable() { - const wasSelectedTable = $tables.selected + const isSelected = $params.tableId === table._id try { await tables.delete(table) await store.actions.screens.delete(templateScreens) - await tables.fetch() if (table.type === "external") { await datasources.fetch() } notifications.success("Table deleted") - if (wasSelectedTable && wasSelectedTable._id === table._id) { - $goto("./table") + if (isSelected) { + $goto(`./datasource/${table.datasourceId}`) } } catch (error) { notifications.error("Error deleting table") diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index f543b34ddc..44eb1e9b7b 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -1,5 +1,5 @@ - - Query {integrationInfo?.friendlyName} - - Config -
-
- - -
- {#if queryConfig} -
- -
- Add a JavaScript function to transform the query result. - (query.transformer = e.detail)} - /> - -
-
- Results - - - - -
- - Below, you can preview the results from your query and change the schema. - -
- {#if data} - - - - - - - - - - - + {#if queryConfig} +
+ +