From f373dc213dc4f22b8a9f8596c0fd1a396c6ec7c3 Mon Sep 17 00:00:00 2001 From: Ilia Shupta Date: Tue, 15 Mar 2022 13:44:43 +0800 Subject: [PATCH 01/10] Allow fully qualified redis url use in koa ratelimit store --- packages/server/src/api/routes/public/index.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 800eae6101..59ab3e0a44 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -31,16 +31,23 @@ function getApiLimitPerSecond(): number { if (!env.isTest()) { const REDIS_OPTS = getRedisOptions() - RateLimit.defaultOptions({ - store: new Stores.Redis({ - // @ts-ignore + let options + if (REDIS_OPTS.redisProtocolUrl) { // fully qualified redis URL + options = { + url: REDIS_OPTS.redisProtocolUrl, + } + } else { + options = { socket: { host: REDIS_OPTS.host, port: REDIS_OPTS.port, }, password: REDIS_OPTS.opts.password, database: 1, - }), + } + } + RateLimit.defaultOptions({ + store: new Stores.Redis(options) }) } // rate limiting, allows for 2 requests per second From 18d85fd4ac9e3c3a22ccafc10afa93e647205164 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Mar 2022 10:52:24 +0000 Subject: [PATCH 02/10] Linting. --- packages/server/src/api/routes/public/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 59ab3e0a44..04446d543f 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -32,7 +32,8 @@ function getApiLimitPerSecond(): number { if (!env.isTest()) { const REDIS_OPTS = getRedisOptions() let options - if (REDIS_OPTS.redisProtocolUrl) { // fully qualified redis URL + if (REDIS_OPTS.redisProtocolUrl) { + // fully qualified redis URL options = { url: REDIS_OPTS.redisProtocolUrl, } @@ -47,7 +48,7 @@ if (!env.isTest()) { } } RateLimit.defaultOptions({ - store: new Stores.Redis(options) + store: new Stores.Redis(options), }) } // rate limiting, allows for 2 requests per second From 65ea8e4e4d146b2df9b6e1a9d1693e131053ffd3 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 15 Mar 2022 11:26:55 +0000 Subject: [PATCH 03/10] v1.0.89 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 7f1805759a..840c53d6c4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.88", + "version": "1.0.89", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index ae23e9164b..de40e8425f 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.88", + "version": "1.0.89", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index f71ea1ca3d..cce39cd6fb 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": "1.0.88", + "version": "1.0.89", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.88", + "@budibase/string-templates": "^1.0.89", "@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 48c3324580..b20be60880 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.88", + "version": "1.0.89", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.88", - "@budibase/client": "^1.0.88", - "@budibase/frontend-core": "^1.0.88", - "@budibase/string-templates": "^1.0.88", + "@budibase/bbui": "^1.0.89", + "@budibase/client": "^1.0.89", + "@budibase/frontend-core": "^1.0.89", + "@budibase/string-templates": "^1.0.89", "@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 d57e3d6931..c6d5e213a4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.88", + "version": "1.0.89", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 50252b508e..bf6ec29aeb 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.88", + "version": "1.0.89", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.88", - "@budibase/frontend-core": "^1.0.88", - "@budibase/string-templates": "^1.0.88", + "@budibase/bbui": "^1.0.89", + "@budibase/frontend-core": "^1.0.89", + "@budibase/string-templates": "^1.0.89", "@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 51ed5f1ca4..85e0ba174f 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.88", + "version": "1.0.89", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.88", + "@budibase/bbui": "^1.0.89", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index bddab29c31..f2cdb4684a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.88", + "version": "1.0.89", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.88", - "@budibase/client": "^1.0.88", - "@budibase/string-templates": "^1.0.88", + "@budibase/backend-core": "^1.0.89", + "@budibase/client": "^1.0.89", + "@budibase/string-templates": "^1.0.89", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a426988e8c..9cf6eac6ab 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.88", + "version": "1.0.89", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 1558474ab2..bb290ac9a8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.88", + "version": "1.0.89", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.88", - "@budibase/string-templates": "^1.0.88", + "@budibase/backend-core": "^1.0.89", + "@budibase/string-templates": "^1.0.89", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 65e857609a1b2ea908471e811262f195f85917c0 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 15 Mar 2022 12:03:16 +0000 Subject: [PATCH 04/10] fix button action export for csv --- packages/client/src/utils/buttonActions.js | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 25659cea98..17121f3ee6 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -241,6 +241,24 @@ const s3UploadHandler = async action => { } } +const convertToCsv = (headers, rows) => { + let csv = headers.map(key => `"${key}"`).join(",") + + for (let row of rows) { + csv = `${csv}\n${headers + .map(header => { + let val = row[header] + val = + typeof val === "object" + ? `"${JSON.stringify(val).replace(/"/g, "'")}"` + : `"${val}"` + return val.trim() + }) + .join(",")}` + } + return csv +} + const exportDataHandler = async action => { let selection = rowSelectionStore.actions.getSelection( action.parameters.tableComponentId @@ -252,7 +270,14 @@ const exportDataHandler = async action => { rows: selection.selectedRows, }) - download(JSON.stringify(data), `export.${action.parameters.type}`) + let dataToExport + const headers = Object.keys(data[0]) + if (action.parameters.type === "csv") { + dataToExport = convertToCsv(headers, data) + } else { + dataToExport = JSON.stringify(data) + } + download(dataToExport, `export.${action.parameters.type}`) } catch (error) { notificationStore.actions.error("There was an error exporting the data") } From 1dd2cf99d0ed8a50e760d3e2988a228b98c8b8d6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Mar 2022 19:24:34 +0000 Subject: [PATCH 05/10] Quick fix for #4914 - adding some checks in API middleware to confirm headers have been set correctly. --- .../server/src/api/routes/public/index.ts | 20 +++++++++++++----- packages/server/src/middleware/publicApi.js | 21 +++++++++++++++++++ 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 packages/server/src/middleware/publicApi.js diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 04446d543f..41a05d3bc7 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -5,6 +5,7 @@ import rowEndpoints from "./rows" import userEndpoints from "./users" import usage from "../../../middleware/usageQuota" import authorized from "../../../middleware/authorized" +import publicApiMiddleware from "../../../middleware/publicApi" import { paramResource, paramSubResource } from "../../../middleware/resourceId" import { CtxFn } from "./utils/Endpoint" import mapperMiddleware from "./middleware/mapper" @@ -101,17 +102,26 @@ function applyRoutes( const paramMiddleware = subResource ? paramSubResource(resource, subResource) : paramResource(resource) + function both(middleware: any, opts?: any) { + addMiddleware(endpoints.read, middleware, opts) + addMiddleware(endpoints.write, paramMiddleware, opts) + } + // add the public API headers check + both( + publicApiMiddleware({ + requiresAppId: + permType !== PermissionTypes.APP && permType !== PermissionTypes.USER, + }) + ) + // add the output mapper middleware + both(mapperMiddleware, { output: true }) // add the parameter capture middleware - addMiddleware(endpoints.read, paramMiddleware) - addMiddleware(endpoints.write, paramMiddleware) + both(paramMiddleware) // add the authorization middleware, using the correct perm type addMiddleware(endpoints.read, authorized(permType, PermissionLevels.READ)) addMiddleware(endpoints.write, authorized(permType, PermissionLevels.WRITE)) // add the usage quota middleware addMiddleware(endpoints.write, usage) - // add the output mapper middleware - addMiddleware(endpoints.read, mapperMiddleware, { output: true }) - addMiddleware(endpoints.write, mapperMiddleware, { output: true }) addToRouter(endpoints.read) addToRouter(endpoints.write) } diff --git a/packages/server/src/middleware/publicApi.js b/packages/server/src/middleware/publicApi.js new file mode 100644 index 0000000000..4638363602 --- /dev/null +++ b/packages/server/src/middleware/publicApi.js @@ -0,0 +1,21 @@ +const { Headers } = require("../../../backend-core/src/constants") +const { getAppId } = require("@budibase/backend-core/utils") + +module.exports = function ({ requiresAppId } = {}) { + return async (ctx, next) => { + const appId = getAppId(ctx) + if (requiresAppId && !appId) { + ctx.throw( + 400, + `Invalid app ID provided, please check the ${Headers.APP_ID} header.` + ) + } + if (!ctx.headers[Headers.API_KEY]) { + ctx.throw( + 400, + `Invalid API key provided, please check the ${Headers.API_KEY} header.` + ) + } + return next() + } +} From a37fc54fabd780d389e75429ef7901cbbe163a85 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Mar 2022 19:53:05 +0000 Subject: [PATCH 06/10] Fixing an issue that was breaking build. --- packages/server/src/middleware/publicApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/middleware/publicApi.js b/packages/server/src/middleware/publicApi.js index 4638363602..563612c1ea 100644 --- a/packages/server/src/middleware/publicApi.js +++ b/packages/server/src/middleware/publicApi.js @@ -1,4 +1,4 @@ -const { Headers } = require("../../../backend-core/src/constants") +const { Headers } = require("@budibase/backend-core/constants") const { getAppId } = require("@budibase/backend-core/utils") module.exports = function ({ requiresAppId } = {}) { From 8b4903f8f61f68e41fc7e46304f0437e9ef32293 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Mar 2022 20:17:41 +0000 Subject: [PATCH 07/10] Fixing issue found by test case. --- .../server/src/api/routes/public/index.ts | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 41a05d3bc7..57436def1d 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -5,7 +5,7 @@ import rowEndpoints from "./rows" import userEndpoints from "./users" import usage from "../../../middleware/usageQuota" import authorized from "../../../middleware/authorized" -import publicApiMiddleware from "../../../middleware/publicApi" +import publicApi from "../../../middleware/publicApi" import { paramResource, paramSubResource } from "../../../middleware/resourceId" import { CtxFn } from "./utils/Endpoint" import mapperMiddleware from "./middleware/mapper" @@ -102,26 +102,23 @@ function applyRoutes( const paramMiddleware = subResource ? paramSubResource(resource, subResource) : paramResource(resource) - function both(middleware: any, opts?: any) { - addMiddleware(endpoints.read, middleware, opts) - addMiddleware(endpoints.write, paramMiddleware, opts) - } - // add the public API headers check - both( - publicApiMiddleware({ - requiresAppId: - permType !== PermissionTypes.APP && permType !== PermissionTypes.USER, - }) - ) - // add the output mapper middleware - both(mapperMiddleware, { output: true }) + const publicApiMiddleware = publicApi({ + requiresAppId: + permType !== PermissionTypes.APP && permType !== PermissionTypes.USER, + }) + addMiddleware(endpoints.read, publicApiMiddleware) + addMiddleware(endpoints.write, publicApiMiddleware) // add the parameter capture middleware - both(paramMiddleware) + addMiddleware(endpoints.read, paramMiddleware) + addMiddleware(endpoints.write, paramMiddleware) // add the authorization middleware, using the correct perm type addMiddleware(endpoints.read, authorized(permType, PermissionLevels.READ)) addMiddleware(endpoints.write, authorized(permType, PermissionLevels.WRITE)) // add the usage quota middleware addMiddleware(endpoints.write, usage) + // add the output mapper middleware + addMiddleware(endpoints.read, mapperMiddleware, { output: true }) + addMiddleware(endpoints.write, mapperMiddleware, { output: true }) addToRouter(endpoints.read) addToRouter(endpoints.write) } From 96ea66f89853d9a9248de3af4c74d52fc9524e9a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 16 Mar 2022 10:22:06 +0000 Subject: [PATCH 08/10] send export file from backend --- packages/client/src/utils/buttonActions.js | 28 ++----------------- packages/frontend-core/src/api/rows.js | 7 +++-- .../src/api/controllers/row/external.js | 16 +++++++++-- .../src/api/controllers/row/internal.js | 13 +++++++-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 17121f3ee6..594bee6953 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -241,23 +241,6 @@ const s3UploadHandler = async action => { } } -const convertToCsv = (headers, rows) => { - let csv = headers.map(key => `"${key}"`).join(",") - - for (let row of rows) { - csv = `${csv}\n${headers - .map(header => { - let val = row[header] - val = - typeof val === "object" - ? `"${JSON.stringify(val).replace(/"/g, "'")}"` - : `"${val}"` - return val.trim() - }) - .join(",")}` - } - return csv -} const exportDataHandler = async action => { let selection = rowSelectionStore.actions.getSelection( @@ -268,16 +251,9 @@ const exportDataHandler = async action => { const data = await API.exportRows({ tableId: selection.tableId, rows: selection.selectedRows, + format: action.parameters.type, }) - - let dataToExport - const headers = Object.keys(data[0]) - if (action.parameters.type === "csv") { - dataToExport = convertToCsv(headers, data) - } else { - dataToExport = JSON.stringify(data) - } - download(dataToExport, `export.${action.parameters.type}`) + download(data, `${selection.tableId}.${action.parameters.type}`) } catch (error) { notificationStore.actions.error("There was an error exporting the data") } diff --git a/packages/frontend-core/src/api/rows.js b/packages/frontend-core/src/api/rows.js index 1b6efe624f..6a0d278cf7 100644 --- a/packages/frontend-core/src/api/rows.js +++ b/packages/frontend-core/src/api/rows.js @@ -66,12 +66,15 @@ export const buildRowEndpoints = API => ({ * @param tableId the table ID to export the rows from * @param rows the array of rows to export */ - exportRows: async ({ tableId, rows }) => { + exportRows: async ({ tableId, rows, format }) => { return await API.post({ - url: `/api/${tableId}/rows/exportRows`, + url: `/api/${tableId}/rows/exportRows?format=${format}`, body: { rows, }, + parseResponse: async response => { + return await response.text() + }, }) }, }) diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index aebcfce724..2f816e11a9 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -10,6 +10,8 @@ const { } = require("../../../integrations/utils") const ExternalRequest = require("./ExternalRequest") const { getAppDB } = require("@budibase/backend-core/context") +const exporters = require("../view/exporters") +const { apiFileReturn } = require("../../../utilities/fileSystem") async function handleRequest(operation, tableId, opts = {}) { // make sure the filters are cleaned up, no empty strings for equals, fuzzy or string @@ -155,6 +157,7 @@ exports.validate = async () => { exports.exportRows = async ctx => { const { datasourceId, tableName } = breakExternalTableId(ctx.params.tableId) const db = getAppDB() + let format = ctx.query.format const datasource = await db.get(datasourceId) if (!datasource || !datasource.entities) { ctx.throw(400, "Datasource has not been configured for plus API.") @@ -164,13 +167,22 @@ exports.exportRows = async ctx => { ctx.request.body = { query: { oneOf: { - [table.primaryDisplay]: ctx.request.body.map( + [table.primaryDisplay]: ctx.request.body.rows.map( id => breakRowIdField(id)[0] ), }, }, } - return exports.search(ctx) + + let result = await exports.search(ctx) + + let headers = Object.keys(result.rows[0]) + const exporter = exporters[format] + const filename = `export.${format}` + + // send down the file + ctx.attachment(filename) + return apiFileReturn(exporter(headers, result.rows)) } exports.fetchEnrichedRow = async ctx => { diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index 068a485a8a..4b57e09029 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -27,6 +27,8 @@ const { const { cloneDeep } = require("lodash/fp") const { getAppDB } = require("@budibase/backend-core/context") const { finaliseRow, updateRelatedFormula } = require("./staticFormula") +const exporters = require("../view/exporters") +const { apiFileReturn } = require("../../../utilities/fileSystem") const CALCULATION_TYPES = { SUM: "sum", @@ -366,6 +368,7 @@ exports.exportRows = async ctx => { const db = getAppDB() const table = await db.get(ctx.params.tableId) const rowIds = ctx.request.body.rows + let format = ctx.query.format let response = ( await db.allDocs({ include_docs: true, @@ -374,8 +377,14 @@ exports.exportRows = async ctx => { ).rows.map(row => row.doc) let rows = await outputProcessing(table, response) - - return rows + + let headers = Object.keys(rows[0]) + const exporter = exporters[format] + const filename = `export.${format}` + + // send down the file + ctx.attachment(filename) + return apiFileReturn(exporter(headers, rows)) } exports.fetchEnrichedRow = async ctx => { From 43f7d1607d64483b576846b22ed43090a5805b9c Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 16 Mar 2022 10:33:38 +0000 Subject: [PATCH 09/10] linting --- packages/client/src/utils/buttonActions.js | 1 - packages/server/src/api/controllers/row/external.js | 2 +- packages/server/src/api/controllers/row/internal.js | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 594bee6953..f44e7d7453 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -241,7 +241,6 @@ const s3UploadHandler = async action => { } } - const exportDataHandler = async action => { let selection = rowSelectionStore.actions.getSelection( action.parameters.tableComponentId diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 2f816e11a9..a8c8c0a627 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -179,7 +179,7 @@ exports.exportRows = async ctx => { let headers = Object.keys(result.rows[0]) const exporter = exporters[format] const filename = `export.${format}` - + // send down the file ctx.attachment(filename) return apiFileReturn(exporter(headers, result.rows)) diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index 4b57e09029..8801827649 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -377,11 +377,11 @@ exports.exportRows = async ctx => { ).rows.map(row => row.doc) let rows = await outputProcessing(table, response) - + let headers = Object.keys(rows[0]) const exporter = exporters[format] const filename = `export.${format}` - + // send down the file ctx.attachment(filename) return apiFileReturn(exporter(headers, rows)) From b5c5488e8ac7c0390f5f066813eae13d08cccbf0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 16 Mar 2022 11:37:15 +0000 Subject: [PATCH 10/10] v1.0.90 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 840c53d6c4..6fe35bbe12 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.89", + "version": "1.0.90", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index de40e8425f..6c766c9375 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.89", + "version": "1.0.90", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index cce39cd6fb..40cf945bc1 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": "1.0.89", + "version": "1.0.90", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.89", + "@budibase/string-templates": "^1.0.90", "@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 b20be60880..854f6d5791 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.89", + "version": "1.0.90", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.89", - "@budibase/client": "^1.0.89", - "@budibase/frontend-core": "^1.0.89", - "@budibase/string-templates": "^1.0.89", + "@budibase/bbui": "^1.0.90", + "@budibase/client": "^1.0.90", + "@budibase/frontend-core": "^1.0.90", + "@budibase/string-templates": "^1.0.90", "@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 c6d5e213a4..8e65e5e821 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.89", + "version": "1.0.90", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index bf6ec29aeb..e7b6592737 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.89", + "version": "1.0.90", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.89", - "@budibase/frontend-core": "^1.0.89", - "@budibase/string-templates": "^1.0.89", + "@budibase/bbui": "^1.0.90", + "@budibase/frontend-core": "^1.0.90", + "@budibase/string-templates": "^1.0.90", "@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 85e0ba174f..2d18fe7a89 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.89", + "version": "1.0.90", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.89", + "@budibase/bbui": "^1.0.90", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index f2cdb4684a..fe06fcd5df 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.89", + "version": "1.0.90", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.89", - "@budibase/client": "^1.0.89", - "@budibase/string-templates": "^1.0.89", + "@budibase/backend-core": "^1.0.90", + "@budibase/client": "^1.0.90", + "@budibase/string-templates": "^1.0.90", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 9cf6eac6ab..d5697c8557 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.89", + "version": "1.0.90", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index bb290ac9a8..72518afe12 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.89", + "version": "1.0.90", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.89", - "@budibase/string-templates": "^1.0.89", + "@budibase/backend-core": "^1.0.90", + "@budibase/string-templates": "^1.0.90", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",