From 0c37c57a4bd704eefc783fd55729512bf166b759 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 5 Jan 2023 18:03:36 +0000 Subject: [PATCH 01/18] Fix for #9249 - there was an issue with the updating of attachment URLs when importing an app/backup, this resolves it by utilising pagination in the CouchDB find API, making sure to iterate through all documents when there is a larger number. --- .../server/src/sdk/app/backups/imports.ts | 96 ++++++++++++------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/packages/server/src/sdk/app/backups/imports.ts b/packages/server/src/sdk/app/backups/imports.ts index 4c2a721c2c..8a67122594 100644 --- a/packages/server/src/sdk/app/backups/imports.ts +++ b/packages/server/src/sdk/app/backups/imports.ts @@ -1,5 +1,5 @@ import { db as dbCore, objectStore } from "@budibase/backend-core" -import { Database } from "@budibase/types" +import { Database, Row } from "@budibase/types" import { getAutomationParams, TABLE_ROW_PREFIX } from "../../../db/utils" import { budibaseTempDir } from "../../../utilities/budibaseDir" import { DB_EXPORT_FILE, GLOBAL_DB_EXPORT_FILE } from "./constants" @@ -17,6 +17,9 @@ import { const uuid = require("uuid/v4") const tar = require("tar") +// default limit - seems to work well for performance +const FIND_LIMIT = 25 + type TemplateType = { file?: { type: string @@ -25,9 +28,29 @@ type TemplateType = { key?: string } +function generateAttachmentFindParams( + attachmentCols: string[], + bookmark: null | string +) { + const params: CouchFindOptions = { + selector: { + _id: { + $regex: `^${TABLE_ROW_PREFIX}`, + }, + }, + limit: FIND_LIMIT, + } + attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) + if (bookmark) { + params.bookmark = bookmark + } + return params +} + async function updateAttachmentColumns(prodAppId: string, db: Database) { // iterate through attachment documents and update them const tables = await sdk.tables.getAllInternalTables(db) + let updatedRows: Row[] = [] for (let table of tables) { const attachmentCols: string[] = [] for (let [key, column] of Object.entries(table.schema)) { @@ -39,44 +62,45 @@ async function updateAttachmentColumns(prodAppId: string, db: Database) { if (attachmentCols.length === 0) { continue } - // use the CouchDB Mango query API to lookup rows that have attachments - const params: CouchFindOptions = { - selector: { - _id: { - $regex: `^${TABLE_ROW_PREFIX}`, - }, - }, - } - attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) - const { rows } = await dbCore.directCouchFind(db.name, params) - for (let row of rows) { - for (let column of attachmentCols) { - if (!Array.isArray(row[column])) { - continue - } - row[column] = row[column].map((attachment: RowAttachment) => { - // URL looks like: /prod-budi-app-assets/appId/attachments/file.csv - const urlParts = attachment.url.split("/") - // drop the first empty element - urlParts.shift() - // get the prefix - const prefix = urlParts.shift() - // remove the app ID - urlParts.shift() - // add new app ID - urlParts.unshift(prodAppId) - const key = urlParts.join("/") - return { - ...attachment, - key, - url: `/${prefix}/${key}`, + let bookmark: null | string = null, + rowsLength = 0 + do { + const params = generateAttachmentFindParams(attachmentCols, bookmark) + // use the CouchDB Mango query API to lookup rows that have attachments + const resp = await dbCore.directCouchFind(db.name, params) + bookmark = resp.bookmark + rowsLength = resp.rows.length + const rows = resp.rows + for (let row of rows) { + for (let column of attachmentCols) { + if (!Array.isArray(row[column])) { + continue } - }) + row[column] = row[column].map((attachment: RowAttachment) => { + // URL looks like: /prod-budi-app-assets/appId/attachments/file.csv + const urlParts = attachment.url.split("/") + // drop the first empty element + urlParts.shift() + // get the prefix + const prefix = urlParts.shift() + // remove the app ID + urlParts.shift() + // add new app ID + urlParts.unshift(prodAppId) + const key = urlParts.join("/") + return { + ...attachment, + key, + url: `/${prefix}/${key}`, + } + }) + } } - } - // write back the updated attachments - await db.bulkDocs(rows) + updatedRows = updatedRows.concat(rows) + } while (rowsLength === FIND_LIMIT) } + // write back the updated attachments + await db.bulkDocs(updatedRows) } async function updateAutomations(prodAppId: string, db: Database) { From 156a447ba62ce1f31ad05d0d8cea94998b8d3f36 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Fri, 6 Jan 2023 09:50:16 +0000 Subject: [PATCH 02/18] move helm log annotations --- charts/budibase/templates/app-service-deployment.yaml | 6 +++--- charts/budibase/templates/proxy-service-deployment.yaml | 6 +++--- charts/budibase/templates/worker-service-deployment.yaml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index e955992c66..9abfbe6c06 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: io.kompose.service: app-service @@ -23,6 +20,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.globals.logAnnotations }} +{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ end }} creationTimestamp: null labels: io.kompose.service: app-service diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 00c12271db..fee323c443 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy @@ -23,6 +20,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.globals.logAnnotations }} +{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 7168764d56..166f1d5e03 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: io.kompose.service: worker-service @@ -24,6 +21,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.globals.logAnnotations }} +{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ end }} creationTimestamp: null labels: io.kompose.service: worker-service From cf90282303874c87a3f53f8e5cdf215dfa1d46bb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 12:47:12 +0000 Subject: [PATCH 03/18] Moving some stuff around to make more testable. --- .../server/src/sdk/app/backups/imports.ts | 96 ++++++------------- .../server/src/sdk/app/rows/attachments.ts | 60 ++++++++++++ packages/server/src/sdk/app/rows/index.ts | 5 + packages/server/src/sdk/index.ts | 2 + 4 files changed, 98 insertions(+), 65 deletions(-) create mode 100644 packages/server/src/sdk/app/rows/attachments.ts create mode 100644 packages/server/src/sdk/app/rows/index.ts diff --git a/packages/server/src/sdk/app/backups/imports.ts b/packages/server/src/sdk/app/backups/imports.ts index 8a67122594..4893f69588 100644 --- a/packages/server/src/sdk/app/backups/imports.ts +++ b/packages/server/src/sdk/app/backups/imports.ts @@ -4,22 +4,18 @@ import { getAutomationParams, TABLE_ROW_PREFIX } from "../../../db/utils" import { budibaseTempDir } from "../../../utilities/budibaseDir" import { DB_EXPORT_FILE, GLOBAL_DB_EXPORT_FILE } from "./constants" import { downloadTemplate } from "../../../utilities/fileSystem" -import { FieldTypes, ObjectStoreBuckets } from "../../../constants" +import { ObjectStoreBuckets } from "../../../constants" import { join } from "path" import fs from "fs" import sdk from "../../" import { Automation, AutomationTriggerStepId, - CouchFindOptions, RowAttachment, } from "@budibase/types" const uuid = require("uuid/v4") const tar = require("tar") -// default limit - seems to work well for performance -const FIND_LIMIT = 25 - type TemplateType = { file?: { type: string @@ -28,23 +24,23 @@ type TemplateType = { key?: string } -function generateAttachmentFindParams( - attachmentCols: string[], - bookmark: null | string -) { - const params: CouchFindOptions = { - selector: { - _id: { - $regex: `^${TABLE_ROW_PREFIX}`, - }, - }, - limit: FIND_LIMIT, +function rewriteAttachmentUrl(appId: string, attachment: RowAttachment) { + // URL looks like: /prod-budi-app-assets/appId/attachments/file.csv + const urlParts = attachment.url.split("/") + // drop the first empty element + urlParts.shift() + // get the prefix + const prefix = urlParts.shift() + // remove the app ID + urlParts.shift() + // add new app ID + urlParts.unshift(appId) + const key = urlParts.join("/") + return { + ...attachment, + key, + url: `/${prefix}/${key}`, } - attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) - if (bookmark) { - params.bookmark = bookmark - } - return params } async function updateAttachmentColumns(prodAppId: string, db: Database) { @@ -52,52 +48,22 @@ async function updateAttachmentColumns(prodAppId: string, db: Database) { const tables = await sdk.tables.getAllInternalTables(db) let updatedRows: Row[] = [] for (let table of tables) { - const attachmentCols: string[] = [] - for (let [key, column] of Object.entries(table.schema)) { - if (column.type === FieldTypes.ATTACHMENT) { - attachmentCols.push(key) - } - } - // no attachment columns, nothing to do - if (attachmentCols.length === 0) { - continue - } - let bookmark: null | string = null, - rowsLength = 0 - do { - const params = generateAttachmentFindParams(attachmentCols, bookmark) - // use the CouchDB Mango query API to lookup rows that have attachments - const resp = await dbCore.directCouchFind(db.name, params) - bookmark = resp.bookmark - rowsLength = resp.rows.length - const rows = resp.rows - for (let row of rows) { - for (let column of attachmentCols) { - if (!Array.isArray(row[column])) { - continue + const { rows, columns } = await sdk.rows.getRowsWithAttachments( + db.name, + table + ) + updatedRows = updatedRows.concat( + rows.map(row => { + for (let column of columns) { + if (Array.isArray(row[column])) { + row[column] = row[column].map((attachment: RowAttachment) => + rewriteAttachmentUrl(prodAppId, attachment) + ) } - row[column] = row[column].map((attachment: RowAttachment) => { - // URL looks like: /prod-budi-app-assets/appId/attachments/file.csv - const urlParts = attachment.url.split("/") - // drop the first empty element - urlParts.shift() - // get the prefix - const prefix = urlParts.shift() - // remove the app ID - urlParts.shift() - // add new app ID - urlParts.unshift(prodAppId) - const key = urlParts.join("/") - return { - ...attachment, - key, - url: `/${prefix}/${key}`, - } - }) } - } - updatedRows = updatedRows.concat(rows) - } while (rowsLength === FIND_LIMIT) + return row + }) + ) } // write back the updated attachments await db.bulkDocs(updatedRows) diff --git a/packages/server/src/sdk/app/rows/attachments.ts b/packages/server/src/sdk/app/rows/attachments.ts new file mode 100644 index 0000000000..67f58f8f2c --- /dev/null +++ b/packages/server/src/sdk/app/rows/attachments.ts @@ -0,0 +1,60 @@ +import { CouchFindOptions, Table, Row } from "@budibase/types" +import { db as dbCore } from "@budibase/backend-core" +import { DocumentType, SEPARATOR } from "../../../db/utils" +import { FieldTypes } from "../../../constants" + +// default limit - seems to work well for performance +export const FIND_LIMIT = 25 + +function generateAttachmentFindParams( + tableId: string, + attachmentCols: string[], + bookmark: null | string +) { + const params: CouchFindOptions = { + selector: { + _id: { + $regex: `^${DocumentType.ROW}${SEPARATOR}${tableId}`, + }, + }, + limit: FIND_LIMIT, + } + attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) + if (bookmark) { + params.bookmark = bookmark + } + return params +} + +export async function getRowsWithAttachments(appId: string, table: Table) { + // iterate through attachment documents and update them + const db = dbCore.getDB(appId) + const attachmentCols: string[] = [] + for (let [key, column] of Object.entries(table.schema)) { + if (column.type === FieldTypes.ATTACHMENT) { + attachmentCols.push(key) + } + } + // no attachment columns, nothing to do + if (attachmentCols.length === 0) { + return { rows: [], columns: [] } + } + let bookmark: null | string = null, + rowsLength = 0, + rowList: Row[] = [] + do { + const params = generateAttachmentFindParams( + table._id!, + attachmentCols, + bookmark + ) + // use the CouchDB Mango query API to lookup rows that have attachments + const resp = await dbCore.directCouchFind(db.name, params) + bookmark = resp.bookmark + rowsLength = resp.rows.length + const rows = resp.rows + rowList = rowList.concat(rows) + } while (rowsLength === FIND_LIMIT) + // write back the updated attachments + return { rows: rowList, columns: attachmentCols } +} diff --git a/packages/server/src/sdk/app/rows/index.ts b/packages/server/src/sdk/app/rows/index.ts new file mode 100644 index 0000000000..f21928141c --- /dev/null +++ b/packages/server/src/sdk/app/rows/index.ts @@ -0,0 +1,5 @@ +import * as attachments from "./attachments" + +export default { + ...attachments, +} diff --git a/packages/server/src/sdk/index.ts b/packages/server/src/sdk/index.ts index 19df8b4388..2ee40992c8 100644 --- a/packages/server/src/sdk/index.ts +++ b/packages/server/src/sdk/index.ts @@ -2,6 +2,7 @@ import { default as backups } from "./app/backups" import { default as tables } from "./app/tables" import { default as automations } from "./app/automations" import { default as applications } from "./app/applications" +import { default as rows } from "./app/rows" import { default as users } from "./users" const sdk = { @@ -9,6 +10,7 @@ const sdk = { tables, automations, applications, + rows, users, } From 76825c38b9b0232a91be7df49a1a9532ab941fe1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 13:33:22 +0000 Subject: [PATCH 04/18] Adding test cases for the attachment re-write feature, mocking the direct couch find functionality. --- .../src/api/routes/tests/analytics.spec.js | 2 +- .../server/src/sdk/app/backups/imports.ts | 2 +- packages/server/src/sdk/app/rows/index.ts | 2 + packages/server/src/sdk/app/rows/rows.ts | 18 +++++ .../server/src/sdk/tests/attachments.spec.ts | 79 +++++++++++++++++++ 5 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 packages/server/src/sdk/app/rows/rows.ts create mode 100644 packages/server/src/sdk/tests/attachments.spec.ts diff --git a/packages/server/src/api/routes/tests/analytics.spec.js b/packages/server/src/api/routes/tests/analytics.spec.js index 51196943e1..f8b3a6763f 100644 --- a/packages/server/src/api/routes/tests/analytics.spec.js +++ b/packages/server/src/api/routes/tests/analytics.spec.js @@ -1,5 +1,5 @@ const setup = require("./utilities") -const { events, constants, db } = require("@budibase/backend-core") +const { events, constants } = require("@budibase/backend-core") describe("/static", () => { let request = setup.getRequest() diff --git a/packages/server/src/sdk/app/backups/imports.ts b/packages/server/src/sdk/app/backups/imports.ts index 4893f69588..a5527dcd40 100644 --- a/packages/server/src/sdk/app/backups/imports.ts +++ b/packages/server/src/sdk/app/backups/imports.ts @@ -43,7 +43,7 @@ function rewriteAttachmentUrl(appId: string, attachment: RowAttachment) { } } -async function updateAttachmentColumns(prodAppId: string, db: Database) { +export async function updateAttachmentColumns(prodAppId: string, db: Database) { // iterate through attachment documents and update them const tables = await sdk.tables.getAllInternalTables(db) let updatedRows: Row[] = [] diff --git a/packages/server/src/sdk/app/rows/index.ts b/packages/server/src/sdk/app/rows/index.ts index f21928141c..12a44ded67 100644 --- a/packages/server/src/sdk/app/rows/index.ts +++ b/packages/server/src/sdk/app/rows/index.ts @@ -1,5 +1,7 @@ import * as attachments from "./attachments" +import * as rows from "./rows" export default { ...attachments, + ...rows, } diff --git a/packages/server/src/sdk/app/rows/rows.ts b/packages/server/src/sdk/app/rows/rows.ts new file mode 100644 index 0000000000..8709180f0b --- /dev/null +++ b/packages/server/src/sdk/app/rows/rows.ts @@ -0,0 +1,18 @@ +import { db as dbCore, context } from "@budibase/backend-core" +import { Database, Row } from "@budibase/types" +import { getRowParams } from "../../../db/utils" + +export async function getAllInternalRows(appId?: string) { + let db: Database + if (appId) { + db = dbCore.getDB(appId) + } else { + db = context.getAppDB() + } + const response = await db.allDocs( + getRowParams(null, null, { + include_docs: true, + }) + ) + return response.rows.map(row => row.doc) as Row[] +} diff --git a/packages/server/src/sdk/tests/attachments.spec.ts b/packages/server/src/sdk/tests/attachments.spec.ts new file mode 100644 index 0000000000..a340018171 --- /dev/null +++ b/packages/server/src/sdk/tests/attachments.spec.ts @@ -0,0 +1,79 @@ +import newid from "../../db/newid" + +const attachment = { + size: 73479, + name: "2022-12-14 11_11_44-.png", + url: "/prod-budi-app-assets/app_bbb/attachments/a.png", + extension: "png", + key: "app_bbb/attachments/a.png", +} + +const row = { + _id: "ro_ta_aaa", + photo: [attachment], + otherCol: "string", +} + +const table = { + _id: "ta_aaa", + name: "photos", + schema: { + photo: { + type: "attachment", + name: "photo", + }, + otherCol: { + type: "string", + name: "otherCol", + }, + }, +} + +jest.mock("@budibase/backend-core", () => { + const core = jest.requireActual("@budibase/backend-core") + return { + ...core, + db: { + ...core.db, + directCouchFind: jest.fn(), + }, + } +}) + +import { db as dbCore } from "@budibase/backend-core" +import sdk from "../index" + +describe("should be able to re-write attachment URLs", () => { + it("it should update URLs on a number of rows over the limit", async () => { + const db = dbCore.getDB("app_aaa") + await db.put(table) + const limit = 30 + let rows = [] + for (let i = 0; i < limit; i++) { + const rowToWrite = { + ...row, + _id: `${row._id}_${newid()}`, + } + const { rev } = await db.put(rowToWrite) + rows.push({ + ...rowToWrite, + _rev: rev, + }) + } + + dbCore.directCouchFind + // @ts-ignore + .mockReturnValueOnce({ rows: rows.slice(0, 25), bookmark: "aaa" }) + .mockReturnValueOnce({ rows: rows.slice(25, limit), bookmark: "bbb" }) + await sdk.backups.updateAttachmentColumns(db.name, db) + const finalRows = await sdk.rows.getAllInternalRows(db.name) + for (let rowToCheck of finalRows) { + expect(rowToCheck.otherCol).toBe(row.otherCol) + expect(rowToCheck.photo[0].url).not.toBe(row.photo[0].url) + expect(rowToCheck.photo[0].url).toBe( + `/prod-budi-app-assets/${db.name}/attachments/a.png` + ) + expect(rowToCheck.photo[0].key).toBe(`${db.name}/attachments/a.png`) + } + }) +}) From 60371d828e233421d65b22e79d973d418faef76a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 16:46:50 +0000 Subject: [PATCH 05/18] Linting. --- package.json | 4 +- .../TestConfiguration/userManagement.ts | 220 ++- .../internal-api/fixtures/applications.ts | 5 +- .../internal-api/fixtures/userManagement.ts | 136 +- .../applications/applications.spec.ts | 6 +- .../internal-api/screens/screens.spec.ts | 5 +- .../userManagement/appSpecificRoles.spec.ts | 1200 +++++++++-------- .../userManagement/userManagement.spec.ts | 140 +- .../applications/applications.spec.ts | 8 +- 9 files changed, 902 insertions(+), 822 deletions(-) diff --git a/package.json b/package.json index ac09edf5ae..f28f2a7c91 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "dev:server": "yarn run kill-server && lerna run --parallel dev:builder --concurrency 1 --scope @budibase/backend-core --scope @budibase/worker --scope @budibase/server", "test": "lerna run test && yarn test:pro", "test:pro": "bash scripts/pro/test.sh", - "lint:eslint": "eslint packages", + "lint:eslint": "eslint packages && eslint qa-core", "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\"", "lint": "yarn run lint:eslint && yarn run lint:prettier", "lint:fix:eslint": "eslint --fix packages qa-core", @@ -84,4 +84,4 @@ "install:pro": "bash scripts/pro/install.sh", "dep:clean": "yarn clean && yarn bootstrap" } -} \ No newline at end of file +} diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 12a52034cc..20909e8e86 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -4,130 +4,128 @@ import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" export default class UserManagementApi { - api: InternalAPIClient + api: InternalAPIClient - constructor(apiClient: InternalAPIClient) { - this.api = apiClient - } + constructor(apiClient: InternalAPIClient) { + this.api = apiClient + } - async search(): Promise<[Response, Partial[]]> { - const response = await this.api.post(`/global/users/search`, {}) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.data.length).toBeGreaterThan(0) - return [response, json] - } + async search(): Promise<[Response, Partial[]]> { + const response = await this.api.post(`/global/users/search`, {}) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.data.length).toBeGreaterThan(0) + return [response, json] + } - 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 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 getAll(): Promise<[Response, Partial[]]> { - 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 getAll(): Promise<[Response, Partial[]]> { + 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] + } - // 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: { - users: userList, - groups: [] - } - } - const response = await this.api.post(`/global/users/bulk`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.created.unsuccessful.length).toEqual(0) - expect(json.created.successful.length).toEqual(body.create.users.length) - 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: { + users: userList, + groups: [], + }, } + const response = await this.api.post(`/global/users/bulk`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.created.unsuccessful.length).toEqual(0) + expect(json.created.successful.length).toEqual(body.create.users.length) + return [response, json] + } - async deleteMultiple(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] - } - 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) - expect(json.message).toEqual(`User ${userId} deleted.`) - return [response, json] + async deleteMultiple(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] + } + 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) + expect(json.message).toEqual(`User ${userId} deleted.`) + return [response, json] + } - 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) - expect(json.unsuccessful.length).toEqual(0) - expect(json.successful.length).toEqual(body.length) + 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) + expect(json.unsuccessful.length).toEqual(0) + expect(json.successful.length).toEqual(body.length) - return [response, json] - } + return [response, json] + } - async getRoles(): Promise<[Response, Role[]]> { - const response = await this.api.get(`/roles`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - return [response, json] - } + async getRoles(): Promise<[Response, Role[]]> { + const response = await this.api.get(`/roles`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } - 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) - expect(json._id).toEqual(body._id) - expect(json._rev).not.toEqual(body._rev) - return [response, json] - } + 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) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + 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 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 getInfo(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] - } + 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) + 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] - } + 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] + } - 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 + 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] + } +} diff --git a/qa-core/src/config/internal-api/fixtures/applications.ts b/qa-core/src/config/internal-api/fixtures/applications.ts index 0ce69bb889..45d82cf4f0 100644 --- a/qa-core/src/config/internal-api/fixtures/applications.ts +++ b/qa-core/src/config/internal-api/fixtures/applications.ts @@ -13,13 +13,12 @@ export const generateApp = ( // Applications type doesn't work here, save to add useTemplate parameter? export const appFromTemplate = (): any => { - return ({ + 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/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index c036589089..90ea6bd738 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,80 +1,82 @@ -import generator from "../../generator"; -import { User } from "@budibase/types"; - +import generator from "../../generator" +import { User } from "@budibase/types" const generateDeveloper = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - builder: { - global: true - } - }) + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true, + }, + } } const generateAdmin = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: true - }, - builder: { - global: true - } - }) + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true, + }, + builder: { + global: true, + }, + } } const generateAppUser = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: false - }, - builder: { - global: false - } - }) - + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false, + }, + builder: { + global: false, + }, + } } export const generateInviteUser = (): Object[] => { - const randomId = generator.guid(); - return [{ - email: `pedro+${randomId}@budibase.com`, - userInfo: { - userGroups: [] - } - }] - + const randomId = generator.guid() + return [ + { + email: `pedro+${randomId}@budibase.com`, + userInfo: { + userGroups: [], + }, + }, + ] } -export const generateUser = (amount: number = 1, role?: string): Partial[] => { - const userList: Partial[] = []; - 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; - } +export const generateUser = ( + amount: number = 1, + role?: string +): Partial[] => { + const userList: Partial[] = [] + 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 + } + return userList +} 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 7d889b7e87..70724232bb 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,10 @@ 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, appFromTemplate } 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,7 +21,6 @@ describe("Internal API - Application creation, update, publish and delete", () = await config.afterAll() }) - it("Get applications without applications", async () => { await config.applications.fetchEmptyAppList() }) 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 1d2a21a8c7..06d2115af4 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,10 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { App } from "@budibase/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import { generateApp, appFromTemplate } 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 2447a31558..502ce3d767 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -1,627 +1,705 @@ 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, appFromTemplate } 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 { + 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() - const config = new TestConfiguration(api) + 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() + // 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(appFromTemplate()) + 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 app = await config.applications.create(appFromTemplate()) + 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") + + // publish app + await config.applications.publish(app.appId) + // check published app renders + config.applications.api.appId = db.getProdAppID(app.appId!) + await config.applications.canRender() + }) + + 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()) }) - afterAll(async () => { - await config.afterAll() + 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("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) + 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(appFromTemplate()) - config.applications.api.appId = app.appId + 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 [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("BASIC") + 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 + ) + }) + }) + + 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: { + [prodAppId]: "BASIC", + }, + } + 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("BASIC") + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with BASIC 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) + expect(appPackageJson.screens[0].routing.roleId).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) + 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) - //const app = await config.applications.create(generateApp()) - //config.applications.api.appId = app.appId + // Create App + 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 + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(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) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [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("ADMIN") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("POWER") - // publish app - await config.applications.publish(app.appId) - // check published app renders - config.applications.api.appId = db.getProdAppID(app.appId!) - await config.applications.canRender() + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + await config.applications.publish(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 [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("Add POWER user to app", async () => { - const powerUser = generateUser(1, 'developer') - expect(powerUser[0].builder?.global).toEqual(true) + 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) - const [createUserResponse, createUserJson] = await config.users.addMultiple(powerUser) + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - 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!) - 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) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [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("POWER") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + 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.appId) + 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("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) - 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) + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - 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) - 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) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) - 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") + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) - 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()) - }) + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - it("Check Table access for developer", async () => { - const developer = generateUser(1, 'developer') - expect(developer[0].builder?.global).toEqual(true) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - const [createUserResponse, createUserJson] = await config.users.addMultiple(developer) + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - 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 - ) - }) + // 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) - 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 - // 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!) + // 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]: "BASIC", - } - } - await config.users.updateInfo(body) + // 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("BASIC") + 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.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - // login with BASIC user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + // 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) - expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") - }) - - 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: { - [prodAppId]: "POWER", - } - } - 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("POWER") - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(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 [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: { - [prodAppId]: "ADMIN", - } - } - 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("ADMIN") - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - 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) - }) + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) }) - 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) + 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 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) + //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) - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - 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.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - await config.applications.publish(app.appId) - 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.appId) - 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.appId) - 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.appId) - 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.appId) - 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) - }) + // 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.appId) + 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.appId) + 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) + }) + }) }) 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 32820b8b7f..ea235d7cc7 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -5,86 +5,84 @@ import { generateUser } from "../../../config/internal-api/fixtures/userManageme import { User } from "@budibase/types" describe("Internal API - User Management & Permissions", () => { - const api = new InternalAPIClient() - const config = new TestConfiguration(api) + 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() - }) + // 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() - }) + afterAll(async () => { + await config.afterAll() + }) - it("Add Users with different roles", async () => { - await config.users.search() - await config.users.getRoles() + it("Add Users with different roles", async () => { + await config.users.search() + await config.users.getRoles() - 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) + 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) - const userList = [...admin, ...developer, ...appUser] + const userList = [...admin, ...developer, ...appUser] - await config.users.addMultiple(userList) + await config.users.addMultiple(userList) - const [allUsersResponse, allUsersJson] = await config.users.getAll() - expect(allUsersJson.length).toBeGreaterThan(0) + const [allUsersResponse, allUsersJson] = await config.users.getAll() + expect(allUsersJson.length).toBeGreaterThan(0) + }) + it("Delete User", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const userId = userJson.created.successful[0]._id + 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.addMultiple(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + userJson.created.successful[0]._id + ) + const body: User = { + ...userInfoJson, + password: "newPassword", + } + await config.users.forcePasswordReset(body) + }) - }) - - it("Delete User", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultiple(appUser) - const userId = userJson.created.successful[0]._id - 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.addMultiple(appUser) - const [userInfoResponse, userInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - password: "newPassword" - - } - await config.users.forcePasswordReset(body) - }) - - it("Change User information", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - 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", - lastName: "newLastName", - builder: { - global: true - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) - expect(changedUserInfoJson.builder?.global).toBeDefined() - expect(changedUserInfoJson.builder?.global).toEqual(true) - }) - - + it("Change User information", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + 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", + lastName: "newLastName", + builder: { + global: true, + }, + } + await config.users.updateInfo(body) + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(userJson.created.successful[0]._id) + expect(changedUserInfoJson.builder?.global).toBeDefined() + expect(changedUserInfoJson.builder?.global).toEqual(true) + }) }) diff --git a/qa-core/src/tests/public-api/applications/applications.spec.ts b/qa-core/src/tests/public-api/applications/applications.spec.ts index ae0be01b75..cf85e6daf2 100644 --- a/qa-core/src/tests/public-api/applications/applications.spec.ts +++ b/qa-core/src/tests/public-api/applications/applications.spec.ts @@ -73,15 +73,15 @@ describe("Public API - /applications endpoints", () => { }) it("POST - unpublish an unpublished application", async () => { - const [response] = await config.applications.unpublish( - config.context._id - ) + const [response] = await config.applications.unpublish(config.context._id) expect(response).toHaveStatusCode(400) }) it("DELETE - delete a published application and the dev application", async () => { await config.applications.publish(config.context._id) - const [response, deletion] = await config.applications.delete(config.context._id) + const [response, deletion] = await config.applications.delete( + config.context._id + ) expect(response).toHaveStatusCode(200) expect(deletion._id).toEqual(config.context._id) From 3601bd1f4d2512fd4fe60e7b7a52e7942509aaad Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 16:52:18 +0000 Subject: [PATCH 06/18] Adding pre-commit check for qa-core and examples. --- package.json | 2 +- qa-core/src/config/internal-api/TestConfiguration/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f28f2a7c91..7da8db506d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test": "lerna run test && yarn test:pro", "test:pro": "bash scripts/pro/test.sh", "lint:eslint": "eslint packages && eslint qa-core", - "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\"", + "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --check \"qa-core/**/*.{js,ts,svelte}\"", "lint": "yarn run lint:eslint && yarn run lint:prettier", "lint:fix:eslint": "eslint --fix packages qa-core", "lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --write \"qa-core/**/*.{js,ts,svelte}\"", diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index a82c1fdf03..08ca0d3cf3 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -26,7 +26,10 @@ export default class TestConfiguration { } 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) { From 10f57ab75321d1475f84567f8ced3d6045b2d0b7 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 6 Jan 2023 17:06:40 +0000 Subject: [PATCH 07/18] v2.2.11-alpha.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 0ab98dfb4f..f9217ff0a5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e6cd21b660..8bf00e14f9 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -23,7 +23,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.11-alpha.1", + "@budibase/types": "2.2.11-alpha.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 39d61e1ab9..77cd6fe7ed 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.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", + "@budibase/string-templates": "2.2.11-alpha.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 e22ca2bd89..453b5446eb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.11-alpha.1", - "@budibase/client": "2.2.11-alpha.1", - "@budibase/frontend-core": "2.2.11-alpha.1", - "@budibase/string-templates": "2.2.11-alpha.1", + "@budibase/bbui": "2.2.11-alpha.2", + "@budibase/client": "2.2.11-alpha.2", + "@budibase/frontend-core": "2.2.11-alpha.2", + "@budibase/string-templates": "2.2.11-alpha.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 51910a09a9..0dfb466565 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", - "@budibase/string-templates": "2.2.11-alpha.1", - "@budibase/types": "2.2.11-alpha.1", + "@budibase/backend-core": "2.2.11-alpha.2", + "@budibase/string-templates": "2.2.11-alpha.2", + "@budibase/types": "2.2.11-alpha.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 2704cf1aa2..ea1fa187cd 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", - "@budibase/frontend-core": "2.2.11-alpha.1", - "@budibase/string-templates": "2.2.11-alpha.1", + "@budibase/bbui": "2.2.11-alpha.2", + "@budibase/frontend-core": "2.2.11-alpha.2", + "@budibase/string-templates": "2.2.11-alpha.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 55a251e3ac..241e860102 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", + "@budibase/bbui": "2.2.11-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 7aa3d4ff28..58bacc8e00 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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 d5db19ef7e..9eda09ea66 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.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", - "@budibase/client": "2.2.11-alpha.1", + "@budibase/backend-core": "2.2.11-alpha.2", + "@budibase/client": "2.2.11-alpha.2", "@budibase/pro": "2.2.11-alpha.1", - "@budibase/string-templates": "2.2.11-alpha.1", - "@budibase/types": "2.2.11-alpha.1", + "@budibase/string-templates": "2.2.11-alpha.2", + "@budibase/types": "2.2.11-alpha.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 b1d1084cf0..f52d6a8e30 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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 9c4fe2a049..05820ae203 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.11-alpha.1", + "version": "2.2.11-alpha.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 301e5085d1..a3593b2a89 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.11-alpha.1", + "version": "2.2.11-alpha.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.11-alpha.1", + "@budibase/backend-core": "2.2.11-alpha.2", "@budibase/pro": "2.2.11-alpha.1", - "@budibase/string-templates": "2.2.11-alpha.1", - "@budibase/types": "2.2.11-alpha.1", + "@budibase/string-templates": "2.2.11-alpha.2", + "@budibase/types": "2.2.11-alpha.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From faf173bd7fd4dea06c67273e2af19df26ab1b02a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 6 Jan 2023 17:10:16 +0000 Subject: [PATCH 08/18] Update pro version to 2.2.11-alpha.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 9eda09ea66..e9613265f6 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.11-alpha.2", "@budibase/client": "2.2.11-alpha.2", - "@budibase/pro": "2.2.11-alpha.1", + "@budibase/pro": "2.2.11-alpha.2", "@budibase/string-templates": "2.2.11-alpha.2", "@budibase/types": "2.2.11-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index f101097628..1157ee5823 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.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.1.tgz#adb8835b0db1f671eacc226f39788d6b696353ee" - integrity sha512-8VWYTRbEuhXUWfb/ic9PblWdu6nRidM5Sqo0UK6WXCl9RN0V41UancnyhcWbUf0k9sdm52Y0ESYRr4nzhqU0Fw== +"@budibase/backend-core@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.2.tgz#d9cdb57792b84640633732d9bb10c0cc06638fcb" + integrity sha512-Hll1TeIOpLf6KjIXmX05+1hAwA62d/fib6DrqhImMN8ySq9QHGfP0Btet9pf1qHHpVrMv+mZdUkbV72RynJqRA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.11-alpha.1" + "@budibase/types" "2.2.11-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1373,13 +1373,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.1.tgz#ed435fa569d090330cacb782129d4af796601f3d" - integrity sha512-bOMR4nJo/8BAKTiluIH81sf/boB4Iq2dDSvvCl5b3VR4evPRnGQwzFeOPFfi9jKkYJy7F74b/RWjl38VQe3atQ== +"@budibase/pro@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.2.tgz#6422db277c6d0c9d5bc2970793757a5e5e0abea2" + integrity sha512-UZxmuEBz/1oeOX8+KzWi0OYexhonf98fC4i7N+wtt5XoJW3hQ1jUli2PqyGWBf3jQhJAsW2v6vo8bCec83ezlQ== dependencies: - "@budibase/backend-core" "2.2.11-alpha.1" - "@budibase/types" "2.2.11-alpha.1" + "@budibase/backend-core" "2.2.11-alpha.2" + "@budibase/types" "2.2.11-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1404,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.1.tgz#a879f21608389763e20cdcd4ddc60146b0666260" - integrity sha512-KKld6dGyEqJzU62/gb1+S58O+3LW3BIdvtaV7oNxGE32snNh3iNSTBjFkVJU1gNlk+iAMvLCvkFNqDd3Kca+5Q== +"@budibase/types@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.2.tgz#a30a50aebaa5a14d4c91727cb61a75011f5c5b6a" + integrity sha512-zM17hAXFqh0FoyZXlIe4JZIWPvT/laJ+IB45uOZmIqnLV4XakMLa3g37fi3CVz2pgu3xQPp10t9Nyk3YFuLfsA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index a3593b2a89..a6f6a105ea 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.11-alpha.2", - "@budibase/pro": "2.2.11-alpha.1", + "@budibase/pro": "2.2.11-alpha.2", "@budibase/string-templates": "2.2.11-alpha.2", "@budibase/types": "2.2.11-alpha.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 62f3201de1..4e19315b0a 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.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.1.tgz#adb8835b0db1f671eacc226f39788d6b696353ee" - integrity sha512-8VWYTRbEuhXUWfb/ic9PblWdu6nRidM5Sqo0UK6WXCl9RN0V41UancnyhcWbUf0k9sdm52Y0ESYRr4nzhqU0Fw== +"@budibase/backend-core@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.2.tgz#d9cdb57792b84640633732d9bb10c0cc06638fcb" + integrity sha512-Hll1TeIOpLf6KjIXmX05+1hAwA62d/fib6DrqhImMN8ySq9QHGfP0Btet9pf1qHHpVrMv+mZdUkbV72RynJqRA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.11-alpha.1" + "@budibase/types" "2.2.11-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -520,23 +520,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.1.tgz#ed435fa569d090330cacb782129d4af796601f3d" - integrity sha512-bOMR4nJo/8BAKTiluIH81sf/boB4Iq2dDSvvCl5b3VR4evPRnGQwzFeOPFfi9jKkYJy7F74b/RWjl38VQe3atQ== +"@budibase/pro@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.2.tgz#6422db277c6d0c9d5bc2970793757a5e5e0abea2" + integrity sha512-UZxmuEBz/1oeOX8+KzWi0OYexhonf98fC4i7N+wtt5XoJW3hQ1jUli2PqyGWBf3jQhJAsW2v6vo8bCec83ezlQ== dependencies: - "@budibase/backend-core" "2.2.11-alpha.1" - "@budibase/types" "2.2.11-alpha.1" + "@budibase/backend-core" "2.2.11-alpha.2" + "@budibase/types" "2.2.11-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.11-alpha.1": - version "2.2.11-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.1.tgz#a879f21608389763e20cdcd4ddc60146b0666260" - integrity sha512-KKld6dGyEqJzU62/gb1+S58O+3LW3BIdvtaV7oNxGE32snNh3iNSTBjFkVJU1gNlk+iAMvLCvkFNqDd3Kca+5Q== +"@budibase/types@2.2.11-alpha.2": + version "2.2.11-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.2.tgz#a30a50aebaa5a14d4c91727cb61a75011f5c5b6a" + integrity sha512-zM17hAXFqh0FoyZXlIe4JZIWPvT/laJ+IB45uOZmIqnLV4XakMLa3g37fi3CVz2pgu3xQPp10t9Nyk3YFuLfsA== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From f73ab8812277481538d9b0b507e5dbaa164c64ea Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 6 Jan 2023 17:13:14 +0000 Subject: [PATCH 09/18] v2.2.11 --- 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 37a965a594..c6c7f9e17c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.10", + "version": "2.2.11", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index fd33bf6d85..15882d8b38 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.10", + "version": "2.2.11", "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.10", + "@budibase/types": "^2.2.11", "@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 9e0cfdcaa8..d268de4061 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.10", + "version": "2.2.11", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/string-templates": "^2.2.10", + "@budibase/string-templates": "^2.2.11", "@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 d87a45905d..9c532dcb2f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.10", + "version": "2.2.11", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.10", - "@budibase/client": "^2.2.10", - "@budibase/frontend-core": "^2.2.10", - "@budibase/string-templates": "^2.2.10", + "@budibase/bbui": "^2.2.11", + "@budibase/client": "^2.2.11", + "@budibase/frontend-core": "^2.2.11", + "@budibase/string-templates": "^2.2.11", "@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 6e9309de41..2bfb020219 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.10", + "version": "2.2.11", "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.10", - "@budibase/string-templates": "^2.2.10", - "@budibase/types": "^2.2.10", + "@budibase/backend-core": "^2.2.11", + "@budibase/string-templates": "^2.2.11", + "@budibase/types": "^2.2.11", "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 dc80413566..40f75ba9ee 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.10", + "version": "2.2.11", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^2.2.10", - "@budibase/frontend-core": "^2.2.10", - "@budibase/string-templates": "^2.2.10", + "@budibase/bbui": "^2.2.11", + "@budibase/frontend-core": "^2.2.11", + "@budibase/string-templates": "^2.2.11", "@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 19af2fa445..34f332fc96 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.10", + "version": "2.2.11", "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.10", + "@budibase/bbui": "^2.2.11", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index fb6647248f..db65bf176d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.10", + "version": "2.2.11", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 7949d472c4..85318ab2e5 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.10", + "version": "2.2.11", "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.10", - "@budibase/client": "^2.2.10", + "@budibase/backend-core": "^2.2.11", + "@budibase/client": "^2.2.11", "@budibase/pro": "2.2.10", - "@budibase/string-templates": "^2.2.10", - "@budibase/types": "^2.2.10", + "@budibase/string-templates": "^2.2.11", + "@budibase/types": "^2.2.11", "@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 f1135031c0..4aa04d25f7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.10", + "version": "2.2.11", "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 0e1e09c2ac..8e2a25859d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.10", + "version": "2.2.11", "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 f72e5f8c10..5963d2864a 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.10", + "version": "2.2.11", "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.10", + "@budibase/backend-core": "^2.2.11", "@budibase/pro": "2.2.10", - "@budibase/string-templates": "^2.2.10", - "@budibase/types": "^2.2.10", + "@budibase/string-templates": "^2.2.11", + "@budibase/types": "^2.2.11", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 6e34e717cc47baf0b25d0ed6d2bdca75164c79dc Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 6 Jan 2023 17:16:57 +0000 Subject: [PATCH 10/18] Update pro version to 2.2.11 --- 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 85318ab2e5..f2aa0b5d1e 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.11", "@budibase/client": "^2.2.11", - "@budibase/pro": "2.2.10", + "@budibase/pro": "2.2.11", "@budibase/string-templates": "^2.2.11", "@budibase/types": "^2.2.11", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 95df35498c..c6c1b721c4 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.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.10.tgz#0fe86fdfa4c55e5f371f72b6f560e09b9e543f46" - integrity sha512-9+2s2yQ30MgslF/3Fdds9IrVDgf0YP7Q4KkKpmAnT0AX2i8+UFRu3DYhjXduSZ3V/RQRRliNy1HzzagmGWIQFA== +"@budibase/backend-core@2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11.tgz#ea84971474e2ebd1c518469544bb92894fda647f" + integrity sha512-1hnZ7iR5Yhuwhd935Ei6mjdeyHo7JMTGvsqHvLnTrkOZ0+OO98goawZZXm8EHNIpYn7FT0gKu+te6jK5iOpIaQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.10" + "@budibase/types" "^2.2.11" "@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.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.10.tgz#935f4cf97288d8d4ae147107045cd3e27bbd937c" - integrity sha512-ceXFPeLqw2p3ynlDpAMlCUu86ex1PD9bwlQdsuSzXovd3Rxm3OxJ/Bw/TMayApp6gvGPsuBZIQELdrCuu4yNzg== +"@budibase/pro@2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11.tgz#5619ae125a64e76f52552493805a3cccb5bc8a63" + integrity sha512-54VgY/fSJvwIKBRZe6pJolDA6Ur+YVr+V5lUIibPsdIcS/hrCklECYVVAdlL5sALOSUs4vFUYcvJtJ2v1Ttu5Q== dependencies: - "@budibase/backend-core" "2.2.10" - "@budibase/types" "2.2.10" + "@budibase/backend-core" "2.2.11" + "@budibase/types" "2.2.11" "@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.10", "@budibase/types@^2.2.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10.tgz#ca6c4f796a7ac7ca0a689147af9d0f26bef0b79e" - integrity sha512-mQAeMt++jXmPXD0RK/Hs0ScJIGtYlSTGOtm8WvNjIVMm155xHrChFVT+LObFFbQkYMI5BLJ1tmHHf21r432D5A== +"@budibase/types@2.2.11", "@budibase/types@^2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11.tgz#38496d7a845811c4710a99ba99be428eda79b983" + integrity sha512-0kiSkugOR0YzuSCFNaPEPjiLT0n630Ixva2EBhG/2S0TmyCZfUTs2OItGmNsk8OBGNxWPTdidW4NYwkKrGaaoA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 5963d2864a..66b266164e 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.11", - "@budibase/pro": "2.2.10", + "@budibase/pro": "2.2.11", "@budibase/string-templates": "^2.2.11", "@budibase/types": "^2.2.11", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 5b459798bf..11586f7eb6 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.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.10.tgz#0fe86fdfa4c55e5f371f72b6f560e09b9e543f46" - integrity sha512-9+2s2yQ30MgslF/3Fdds9IrVDgf0YP7Q4KkKpmAnT0AX2i8+UFRu3DYhjXduSZ3V/RQRRliNy1HzzagmGWIQFA== +"@budibase/backend-core@2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11.tgz#ea84971474e2ebd1c518469544bb92894fda647f" + integrity sha512-1hnZ7iR5Yhuwhd935Ei6mjdeyHo7JMTGvsqHvLnTrkOZ0+OO98goawZZXm8EHNIpYn7FT0gKu+te6jK5iOpIaQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.10" + "@budibase/types" "^2.2.11" "@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.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.10.tgz#935f4cf97288d8d4ae147107045cd3e27bbd937c" - integrity sha512-ceXFPeLqw2p3ynlDpAMlCUu86ex1PD9bwlQdsuSzXovd3Rxm3OxJ/Bw/TMayApp6gvGPsuBZIQELdrCuu4yNzg== +"@budibase/pro@2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11.tgz#5619ae125a64e76f52552493805a3cccb5bc8a63" + integrity sha512-54VgY/fSJvwIKBRZe6pJolDA6Ur+YVr+V5lUIibPsdIcS/hrCklECYVVAdlL5sALOSUs4vFUYcvJtJ2v1Ttu5Q== dependencies: - "@budibase/backend-core" "2.2.10" - "@budibase/types" "2.2.10" + "@budibase/backend-core" "2.2.11" + "@budibase/types" "2.2.11" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.10", "@budibase/types@^2.2.10": - version "2.2.10" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10.tgz#ca6c4f796a7ac7ca0a689147af9d0f26bef0b79e" - integrity sha512-mQAeMt++jXmPXD0RK/Hs0ScJIGtYlSTGOtm8WvNjIVMm155xHrChFVT+LObFFbQkYMI5BLJ1tmHHf21r432D5A== +"@budibase/types@2.2.11", "@budibase/types@^2.2.11": + version "2.2.11" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11.tgz#38496d7a845811c4710a99ba99be428eda79b983" + integrity sha512-0kiSkugOR0YzuSCFNaPEPjiLT0n630Ixva2EBhG/2S0TmyCZfUTs2OItGmNsk8OBGNxWPTdidW4NYwkKrGaaoA== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From b17f655e3874a75858d30311fd9501721d04dfba Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 6 Jan 2023 17:47:30 +0000 Subject: [PATCH 11/18] v2.2.12-alpha.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 c6c7f9e17c..e5d938baaa 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.11", + "version": "2.2.12-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 3f2cbb5510..c174a3e293 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.11", + "version": "2.2.12-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -23,7 +23,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.11", + "@budibase/types": "2.2.12-alpha.0", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index d268de4061..4873714f2a 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.11", + "version": "2.2.12-alpha.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.2.11", + "@budibase/string-templates": "2.2.12-alpha.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 9c532dcb2f..f029e1ec80 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.11", + "version": "2.2.12-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.11", - "@budibase/client": "^2.2.11", - "@budibase/frontend-core": "^2.2.11", - "@budibase/string-templates": "^2.2.11", + "@budibase/bbui": "2.2.12-alpha.0", + "@budibase/client": "2.2.12-alpha.0", + "@budibase/frontend-core": "2.2.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.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 2bfb020219..e5f25e8bba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.11", + "version": "2.2.12-alpha.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.2.11", - "@budibase/string-templates": "^2.2.11", - "@budibase/types": "^2.2.11", + "@budibase/backend-core": "2.2.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.0", + "@budibase/types": "2.2.12-alpha.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 40f75ba9ee..3b24db4563 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.11", + "version": "2.2.12-alpha.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.2.11", - "@budibase/frontend-core": "^2.2.11", - "@budibase/string-templates": "^2.2.11", + "@budibase/bbui": "2.2.12-alpha.0", + "@budibase/frontend-core": "2.2.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.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 34f332fc96..f8050d1e7d 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.11", + "version": "2.2.12-alpha.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.2.11", + "@budibase/bbui": "2.2.12-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index db65bf176d..af5b121498 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.11", + "version": "2.2.12-alpha.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 61589dc7e3..4bc26393f9 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.11", + "version": "2.2.12-alpha.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.2.11", - "@budibase/client": "^2.2.11", + "@budibase/backend-core": "2.2.12-alpha.0", + "@budibase/client": "2.2.12-alpha.0", "@budibase/pro": "2.2.11", - "@budibase/string-templates": "^2.2.11", - "@budibase/types": "^2.2.11", + "@budibase/string-templates": "2.2.12-alpha.0", + "@budibase/types": "2.2.12-alpha.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 4aa04d25f7..4291b27fc3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.11", + "version": "2.2.12-alpha.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 d7a3055ba8..3a52fa9523 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.11", + "version": "2.2.12-alpha.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 21d65e52ae..a964fc9aa9 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.11", + "version": "2.2.12-alpha.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.2.11", + "@budibase/backend-core": "2.2.12-alpha.0", "@budibase/pro": "2.2.11", - "@budibase/string-templates": "^2.2.11", - "@budibase/types": "^2.2.11", + "@budibase/string-templates": "2.2.12-alpha.0", + "@budibase/types": "2.2.12-alpha.0", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From f70ba6bff4ed8f3c853a8689e46dd5884558dc38 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 9 Jan 2023 08:21:48 +0000 Subject: [PATCH 12/18] Add workaround to preserve creation date on chart publishing (#9219) Employ the same workaround added to the chart publishing in `release-develop` workflow. See: https://github.com/Budibase/budibase/pull/9099 --- .github/workflows/release-selfhost.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index cbf8a002f4..12fb8f5a9d 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -67,16 +67,24 @@ jobs: uses: azure/setup-helm@v1 id: helm-install + # due to helm repo index issue: https://github.com/helm/helm/issues/7363 + # we need to create new package in a different dir, merge the index and move the package back - name: Build and release helm chart run: | git config user.name "Budibase Helm Bot" git config user.email "<>" git reset --hard git pull - helm package charts/budibase --version "$RELEASE_VERSION" --app-version "$RELEASE_VERSION" + mkdir sync + echo "Packaging chart to sync dir" + helm package charts/budibase --version "$RELEASE_VERSION" --app-version "$RELEASE_VERSION" --destination sync + echo "Packaging successful" git checkout gh-pages - mv *.tgz docs - helm repo index docs + echo "Indexing helm repo" + helm repo index --merge docs/index.yaml sync + mv -f sync/* docs + rm -rf sync + echo "Pushing new helm release" git add -A git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}" git push From 3f4487180fc417ebbc37ec33bae640e5008286a2 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 9 Jan 2023 08:34:25 +0000 Subject: [PATCH 13/18] v2.2.12-alpha.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 e5d938baaa..3586a4c958 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c174a3e293..aebbf2f690 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -23,7 +23,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.12-alpha.0", + "@budibase/types": "2.2.12-alpha.1", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4873714f2a..3d8c11a22a 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.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.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 f029e1ec80..66fd0af664 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.12-alpha.0", - "@budibase/client": "2.2.12-alpha.0", - "@budibase/frontend-core": "2.2.12-alpha.0", - "@budibase/string-templates": "2.2.12-alpha.0", + "@budibase/bbui": "2.2.12-alpha.1", + "@budibase/client": "2.2.12-alpha.1", + "@budibase/frontend-core": "2.2.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.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 e5f25e8bba..57d294b28e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", - "@budibase/string-templates": "2.2.12-alpha.0", - "@budibase/types": "2.2.12-alpha.0", + "@budibase/backend-core": "2.2.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.1", + "@budibase/types": "2.2.12-alpha.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 3b24db4563..857f957141 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", - "@budibase/frontend-core": "2.2.12-alpha.0", - "@budibase/string-templates": "2.2.12-alpha.0", + "@budibase/bbui": "2.2.12-alpha.1", + "@budibase/frontend-core": "2.2.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.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 f8050d1e7d..2d82f50a7e 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", + "@budibase/bbui": "2.2.12-alpha.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index af5b121498..dd25f5ba80 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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 4bc26393f9..3b42691589 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.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", - "@budibase/client": "2.2.12-alpha.0", + "@budibase/backend-core": "2.2.12-alpha.1", + "@budibase/client": "2.2.12-alpha.1", "@budibase/pro": "2.2.11", - "@budibase/string-templates": "2.2.12-alpha.0", - "@budibase/types": "2.2.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.1", + "@budibase/types": "2.2.12-alpha.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 4291b27fc3..2b54736fbc 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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 3a52fa9523..5242a4a7a0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.12-alpha.0", + "version": "2.2.12-alpha.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 a964fc9aa9..5efca565a5 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.12-alpha.0", + "version": "2.2.12-alpha.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.12-alpha.0", + "@budibase/backend-core": "2.2.12-alpha.1", "@budibase/pro": "2.2.11", - "@budibase/string-templates": "2.2.12-alpha.0", - "@budibase/types": "2.2.12-alpha.0", + "@budibase/string-templates": "2.2.12-alpha.1", + "@budibase/types": "2.2.12-alpha.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 21a4a34ac1b59baef8976203280e9235f9ade3ae Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 9 Jan 2023 08:37:58 +0000 Subject: [PATCH 14/18] Update pro version to 2.2.12-alpha.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 3b42691589..3b7395cf9c 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.12-alpha.1", "@budibase/client": "2.2.12-alpha.1", - "@budibase/pro": "2.2.11", + "@budibase/pro": "2.2.12-alpha.1", "@budibase/string-templates": "2.2.12-alpha.1", "@budibase/types": "2.2.12-alpha.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 1157ee5823..c7bc65b635 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.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.2.tgz#d9cdb57792b84640633732d9bb10c0cc06638fcb" - integrity sha512-Hll1TeIOpLf6KjIXmX05+1hAwA62d/fib6DrqhImMN8ySq9QHGfP0Btet9pf1qHHpVrMv+mZdUkbV72RynJqRA== +"@budibase/backend-core@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.1.tgz#5200aead8cba9df9314ff72f26efd830a1c81282" + integrity sha512-kql6ng/gIe4fRG72irZnPNdxihNEXmmUCqqgTYQALObdc393JVVrur5FqK4KPLzv0k85Vd7NK/BBSiCCdOr8UA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.11-alpha.2" + "@budibase/types" "2.2.12-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1373,13 +1373,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.2.tgz#6422db277c6d0c9d5bc2970793757a5e5e0abea2" - integrity sha512-UZxmuEBz/1oeOX8+KzWi0OYexhonf98fC4i7N+wtt5XoJW3hQ1jUli2PqyGWBf3jQhJAsW2v6vo8bCec83ezlQ== +"@budibase/pro@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.1.tgz#30fee3f4de0234690ea7461df6717476e3e7b520" + integrity sha512-EoFS2UnY/XvYf/HxFllV3VlXnTYtzr0PHA58LHGVERSYI2uBPj/4gTYQaVC5qiYnr1EfFii6G3dKG18BGPt0hQ== dependencies: - "@budibase/backend-core" "2.2.11-alpha.2" - "@budibase/types" "2.2.11-alpha.2" + "@budibase/backend-core" "2.2.12-alpha.1" + "@budibase/types" "2.2.12-alpha.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1404,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.2.tgz#a30a50aebaa5a14d4c91727cb61a75011f5c5b6a" - integrity sha512-zM17hAXFqh0FoyZXlIe4JZIWPvT/laJ+IB45uOZmIqnLV4XakMLa3g37fi3CVz2pgu3xQPp10t9Nyk3YFuLfsA== +"@budibase/types@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.1.tgz#10baf30b43d2b1341761066bcad07f3f5c244614" + integrity sha512-gYQCQ1lzzJ7CaIK9zdZaAQtTJETTEaRHAOTqUmd/EIkVYTyvNxdGW0YBYOcie/DbE7AV3W2aFB7RCZp8TyCHvA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 5efca565a5..e8cc6d48aa 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.12-alpha.1", - "@budibase/pro": "2.2.11", + "@budibase/pro": "2.2.12-alpha.1", "@budibase/string-templates": "2.2.12-alpha.1", "@budibase/types": "2.2.12-alpha.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 4e19315b0a..76ec4fa15c 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.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.11-alpha.2.tgz#d9cdb57792b84640633732d9bb10c0cc06638fcb" - integrity sha512-Hll1TeIOpLf6KjIXmX05+1hAwA62d/fib6DrqhImMN8ySq9QHGfP0Btet9pf1qHHpVrMv+mZdUkbV72RynJqRA== +"@budibase/backend-core@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.1.tgz#5200aead8cba9df9314ff72f26efd830a1c81282" + integrity sha512-kql6ng/gIe4fRG72irZnPNdxihNEXmmUCqqgTYQALObdc393JVVrur5FqK4KPLzv0k85Vd7NK/BBSiCCdOr8UA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.11-alpha.2" + "@budibase/types" "2.2.12-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -520,23 +520,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.11-alpha.2.tgz#6422db277c6d0c9d5bc2970793757a5e5e0abea2" - integrity sha512-UZxmuEBz/1oeOX8+KzWi0OYexhonf98fC4i7N+wtt5XoJW3hQ1jUli2PqyGWBf3jQhJAsW2v6vo8bCec83ezlQ== +"@budibase/pro@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.1.tgz#30fee3f4de0234690ea7461df6717476e3e7b520" + integrity sha512-EoFS2UnY/XvYf/HxFllV3VlXnTYtzr0PHA58LHGVERSYI2uBPj/4gTYQaVC5qiYnr1EfFii6G3dKG18BGPt0hQ== dependencies: - "@budibase/backend-core" "2.2.11-alpha.2" - "@budibase/types" "2.2.11-alpha.2" + "@budibase/backend-core" "2.2.12-alpha.1" + "@budibase/types" "2.2.12-alpha.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.11-alpha.2": - version "2.2.11-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.11-alpha.2.tgz#a30a50aebaa5a14d4c91727cb61a75011f5c5b6a" - integrity sha512-zM17hAXFqh0FoyZXlIe4JZIWPvT/laJ+IB45uOZmIqnLV4XakMLa3g37fi3CVz2pgu3xQPp10t9Nyk3YFuLfsA== +"@budibase/types@2.2.12-alpha.1": + version "2.2.12-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.1.tgz#10baf30b43d2b1341761066bcad07f3f5c244614" + integrity sha512-gYQCQ1lzzJ7CaIK9zdZaAQtTJETTEaRHAOTqUmd/EIkVYTyvNxdGW0YBYOcie/DbE7AV3W2aFB7RCZp8TyCHvA== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From a2334ddb973b7d45e9f0bff0edd93b6956405e83 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Mon, 9 Jan 2023 12:04:21 +0000 Subject: [PATCH 15/18] more generic annotations & pod specific --- .../budibase/templates/app-service-deployment.yaml | 4 ++-- .../templates/proxy-service-deployment.yaml | 4 ++-- .../templates/worker-service-deployment.yaml | 4 ++-- charts/budibase/values.yaml | 13 ++++++++++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 9abfbe6c06..634e279a46 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -20,8 +20,8 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ if .Values.globals.appServiceAnnotations }} +{{ toYaml .Values.globals.appServiceAnnotations | indent 4 }} {{ end }} creationTimestamp: null labels: diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index fee323c443..d6a4a29124 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -20,8 +20,8 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ if .Values.globals.proxyServiceAnnotations }} +{{ toYaml .Values.globals.proxyServiceAnnotations | indent 4 }} {{ end }} creationTimestamp: null labels: diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 166f1d5e03..7e8dfa09f6 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -21,8 +21,8 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} +{{ if .Values.globals.workerServiceAnnotations }} +{{ toYaml .Values.globals.workerServiceAnnotations | indent 4 }} {{ end }} creationTimestamp: null labels: diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 1d49a46d59..c0824c0142 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -22,12 +22,23 @@ serviceAccount: podAnnotations: {} -# logAnnotations: +# appServiceAnnotations: # co.elastic.logs/multiline.type: pattern # co.elastic.logs/multiline.pattern: '^[[:space:]]' # co.elastic.logs/multiline.negate: false # co.elastic.logs/multiline.match: after +# workerServiceAnnotations: +# co.elastic.logs/multiline.type: pattern +# co.elastic.logs/multiline.pattern: '^[[:space:]]' +# co.elastic.logs/multiline.negate: false +# co.elastic.logs/multiline.match: after + +# proxyServiceAnnotations: +# co.elastic.logs/module: nginx +# co.elastic.logs/fileset.stdout: access +# co.elastic.logs/fileset.stderr: error + podSecurityContext: {} # fsGroup: 2000 From 332532c978b03d5084b5820ab95c9df0534091a0 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 9 Jan 2023 12:37:51 +0000 Subject: [PATCH 16/18] v2.2.12-alpha.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 3586a4c958..8850acbac0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index aebbf2f690..1b166f8cb7 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -23,7 +23,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.12-alpha.1", + "@budibase/types": "2.2.12-alpha.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3d8c11a22a..e4e5f92d58 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.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.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 66fd0af664..f11b450aac 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.12-alpha.1", - "@budibase/client": "2.2.12-alpha.1", - "@budibase/frontend-core": "2.2.12-alpha.1", - "@budibase/string-templates": "2.2.12-alpha.1", + "@budibase/bbui": "2.2.12-alpha.2", + "@budibase/client": "2.2.12-alpha.2", + "@budibase/frontend-core": "2.2.12-alpha.2", + "@budibase/string-templates": "2.2.12-alpha.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 57d294b28e..0475082614 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", - "@budibase/string-templates": "2.2.12-alpha.1", - "@budibase/types": "2.2.12-alpha.1", + "@budibase/backend-core": "2.2.12-alpha.2", + "@budibase/string-templates": "2.2.12-alpha.2", + "@budibase/types": "2.2.12-alpha.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 857f957141..2ca170a60c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", - "@budibase/frontend-core": "2.2.12-alpha.1", - "@budibase/string-templates": "2.2.12-alpha.1", + "@budibase/bbui": "2.2.12-alpha.2", + "@budibase/frontend-core": "2.2.12-alpha.2", + "@budibase/string-templates": "2.2.12-alpha.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 2d82f50a7e..8f4e280a4a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", + "@budibase/bbui": "2.2.12-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index dd25f5ba80..a64d036e28 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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 3b7395cf9c..1ef804dd45 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.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", - "@budibase/client": "2.2.12-alpha.1", + "@budibase/backend-core": "2.2.12-alpha.2", + "@budibase/client": "2.2.12-alpha.2", "@budibase/pro": "2.2.12-alpha.1", - "@budibase/string-templates": "2.2.12-alpha.1", - "@budibase/types": "2.2.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.2", + "@budibase/types": "2.2.12-alpha.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 2b54736fbc..0f99bafecd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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 5242a4a7a0..d8a854b3d6 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.12-alpha.1", + "version": "2.2.12-alpha.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 e8cc6d48aa..1310f95d88 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.12-alpha.1", + "version": "2.2.12-alpha.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.12-alpha.1", + "@budibase/backend-core": "2.2.12-alpha.2", "@budibase/pro": "2.2.12-alpha.1", - "@budibase/string-templates": "2.2.12-alpha.1", - "@budibase/types": "2.2.12-alpha.1", + "@budibase/string-templates": "2.2.12-alpha.2", + "@budibase/types": "2.2.12-alpha.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From d8f900fa6213d3bd2772e5622b132dd9ca9e911c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 9 Jan 2023 12:41:18 +0000 Subject: [PATCH 17/18] Update pro version to 2.2.12-alpha.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 1ef804dd45..f0040afe38 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.12-alpha.2", "@budibase/client": "2.2.12-alpha.2", - "@budibase/pro": "2.2.12-alpha.1", + "@budibase/pro": "2.2.12-alpha.2", "@budibase/string-templates": "2.2.12-alpha.2", "@budibase/types": "2.2.12-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c7bc65b635..f4571d58a3 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.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.1.tgz#5200aead8cba9df9314ff72f26efd830a1c81282" - integrity sha512-kql6ng/gIe4fRG72irZnPNdxihNEXmmUCqqgTYQALObdc393JVVrur5FqK4KPLzv0k85Vd7NK/BBSiCCdOr8UA== +"@budibase/backend-core@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.2.tgz#5fd62c585e950f5a5c29f301e3acc4b3757908b8" + integrity sha512-AiZzLWHgGA5hazbtBDAE2dRjxEPMXn437rSWKN4Vx77VplhHTvV4XPmdr4wiRpBmr4C8NGyQJMRW1CddB1qIJw== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.12-alpha.1" + "@budibase/types" "2.2.12-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1373,13 +1373,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.1.tgz#30fee3f4de0234690ea7461df6717476e3e7b520" - integrity sha512-EoFS2UnY/XvYf/HxFllV3VlXnTYtzr0PHA58LHGVERSYI2uBPj/4gTYQaVC5qiYnr1EfFii6G3dKG18BGPt0hQ== +"@budibase/pro@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.2.tgz#dbcb12ea725d2b2a81e62bd3068801f2b289fe1d" + integrity sha512-9D0+5L6ElSKT1DEV5W7AE1q9UdtoYStjEBF1ePS2aUXRzqmVTEJSqNLs3WjWE5DcN16Ui3VodjJPftsBzwR6HQ== dependencies: - "@budibase/backend-core" "2.2.12-alpha.1" - "@budibase/types" "2.2.12-alpha.1" + "@budibase/backend-core" "2.2.12-alpha.2" + "@budibase/types" "2.2.12-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1404,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.1.tgz#10baf30b43d2b1341761066bcad07f3f5c244614" - integrity sha512-gYQCQ1lzzJ7CaIK9zdZaAQtTJETTEaRHAOTqUmd/EIkVYTyvNxdGW0YBYOcie/DbE7AV3W2aFB7RCZp8TyCHvA== +"@budibase/types@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.2.tgz#390959555517f11dc95147518e89f400c59dd520" + integrity sha512-Dz/3kdSkBRyf+AQyaPbAwq6hxD1kQuHht+4C3pyebbHUL440ZhZhJ1o2AAFc8SF1/9SqAk/NFaktAY2vCyRlOQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 1310f95d88..ad249e99ad 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.12-alpha.2", - "@budibase/pro": "2.2.12-alpha.1", + "@budibase/pro": "2.2.12-alpha.2", "@budibase/string-templates": "2.2.12-alpha.2", "@budibase/types": "2.2.12-alpha.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 76ec4fa15c..2bb3689fa2 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.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.1.tgz#5200aead8cba9df9314ff72f26efd830a1c81282" - integrity sha512-kql6ng/gIe4fRG72irZnPNdxihNEXmmUCqqgTYQALObdc393JVVrur5FqK4KPLzv0k85Vd7NK/BBSiCCdOr8UA== +"@budibase/backend-core@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.2.tgz#5fd62c585e950f5a5c29f301e3acc4b3757908b8" + integrity sha512-AiZzLWHgGA5hazbtBDAE2dRjxEPMXn437rSWKN4Vx77VplhHTvV4XPmdr4wiRpBmr4C8NGyQJMRW1CddB1qIJw== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.12-alpha.1" + "@budibase/types" "2.2.12-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -520,23 +520,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.1.tgz#30fee3f4de0234690ea7461df6717476e3e7b520" - integrity sha512-EoFS2UnY/XvYf/HxFllV3VlXnTYtzr0PHA58LHGVERSYI2uBPj/4gTYQaVC5qiYnr1EfFii6G3dKG18BGPt0hQ== +"@budibase/pro@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.2.tgz#dbcb12ea725d2b2a81e62bd3068801f2b289fe1d" + integrity sha512-9D0+5L6ElSKT1DEV5W7AE1q9UdtoYStjEBF1ePS2aUXRzqmVTEJSqNLs3WjWE5DcN16Ui3VodjJPftsBzwR6HQ== dependencies: - "@budibase/backend-core" "2.2.12-alpha.1" - "@budibase/types" "2.2.12-alpha.1" + "@budibase/backend-core" "2.2.12-alpha.2" + "@budibase/types" "2.2.12-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.12-alpha.1": - version "2.2.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.1.tgz#10baf30b43d2b1341761066bcad07f3f5c244614" - integrity sha512-gYQCQ1lzzJ7CaIK9zdZaAQtTJETTEaRHAOTqUmd/EIkVYTyvNxdGW0YBYOcie/DbE7AV3W2aFB7RCZp8TyCHvA== +"@budibase/types@2.2.12-alpha.2": + version "2.2.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.2.tgz#390959555517f11dc95147518e89f400c59dd520" + integrity sha512-Dz/3kdSkBRyf+AQyaPbAwq6hxD1kQuHht+4C3pyebbHUL440ZhZhJ1o2AAFc8SF1/9SqAk/NFaktAY2vCyRlOQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From c9d8668062898855420bab2f77c1d5b6a95bd1af Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 9 Jan 2023 15:42:09 +0000 Subject: [PATCH 18/18] Licensing updates for environment variables. --- packages/backend-core/src/constants/db.ts | 1 + packages/server/src/api/routes/index.ts | 2 ++ packages/types/src/sdk/licensing/feature.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/backend-core/src/constants/db.ts b/packages/backend-core/src/constants/db.ts index 92392457d6..f7d15b3880 100644 --- a/packages/backend-core/src/constants/db.ts +++ b/packages/backend-core/src/constants/db.ts @@ -77,6 +77,7 @@ export const StaticDatabases = { apiKeys: "apikeys", usageQuota: "usage_quota", licenseInfo: "license_info", + environmentVariables: "environmentvariables", }, }, // contains information about tenancy and so on diff --git a/packages/server/src/api/routes/index.ts b/packages/server/src/api/routes/index.ts index 8d6b1754a7..9dc119ec83 100644 --- a/packages/server/src/api/routes/index.ts +++ b/packages/server/src/api/routes/index.ts @@ -33,6 +33,7 @@ export { default as publicRoutes } from "./public" const appBackupRoutes = pro.appBackups const scheduleRoutes = pro.schedules +const environmentVariableRoutes = pro.environmentVariables export const mainRoutes: Router[] = [ appBackupRoutes, @@ -63,6 +64,7 @@ export const mainRoutes: Router[] = [ migrationRoutes, pluginRoutes, scheduleRoutes, + environmentVariableRoutes, // these need to be handled last as they still use /api/:tableId // this could be breaking as koa may recognise other routes as this tableRoutes, diff --git a/packages/types/src/sdk/licensing/feature.ts b/packages/types/src/sdk/licensing/feature.ts index f06a8d1382..a39bcab18b 100644 --- a/packages/types/src/sdk/licensing/feature.ts +++ b/packages/types/src/sdk/licensing/feature.ts @@ -1,4 +1,5 @@ export enum Feature { USER_GROUPS = "userGroups", APP_BACKUPS = "appBackups", + ENVIRONMENT_VARIABLES = "environmentVariables", }