merge with master

This commit is contained in:
Martin McKeaveney 2021-05-20 10:40:15 +01:00
commit 7ab24fed2b
12 changed files with 44 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{
"version": "0.8.16",
"version": "0.8.18",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "0.8.16",
"version": "0.8.18",
"license": "AGPL-3.0",
"private": true,
"scripts": {
@ -66,9 +66,9 @@
},
"dependencies": {
"@budibase/bbui": "^1.58.13",
"@budibase/client": "^0.8.16",
"@budibase/client": "^0.8.18",
"@budibase/colorpicker": "1.1.2",
"@budibase/string-templates": "^0.8.16",
"@budibase/string-templates": "^0.8.18",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "cli",
"version": "0.8.15",
"version": "0.8.18",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "0.8.16",
"version": "0.8.18",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -18,7 +18,7 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/string-templates": "^0.8.16",
"@budibase/string-templates": "^0.8.18",
"regexparam": "^1.3.0",
"shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5"
@ -26,7 +26,7 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@budibase/standard-components": "^0.8.16",
"@budibase/standard-components": "^0.8.18",
"fs-extra": "^8.1.0",
"jsdom": "^16.0.1",
"postcss": "^8.2.9",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "0.8.16",
"version": "0.8.18",
"description": "Budibase Web Server",
"main": "src/electron.js",
"repository": {
@ -80,8 +80,8 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@budibase/auth": "^0.18.6",
"@budibase/client": "^0.8.16",
"@budibase/string-templates": "^0.8.16",
"@budibase/client": "^0.8.18",
"@budibase/string-templates": "^0.8.18",
"@elastic/elasticsearch": "7.10.0",
"@koa/router": "8.0.0",
"@sendgrid/mail": "7.1.1",
@ -131,7 +131,7 @@
"zlib": "1.0.5"
},
"devDependencies": {
"@budibase/standard-components": "^0.8.16",
"@budibase/standard-components": "^0.8.18",
"@jest/test-sequencer": "^24.8.0",
"docker-compose": "^0.23.6",
"eslint": "^6.8.0",

View File

@ -119,9 +119,8 @@ exports.preview = async function (ctx) {
const enrichedQuery = await enrichQueryFields(fields, parameters)
const rows = formatResponse(
await new Integration(datasource.config)[queryVerb](enrichedQuery)
)
const integration = new Integration(datasource.config)
const rows = formatResponse(await integration[queryVerb](enrichedQuery))
// get all the potential fields in the schema
const keys = rows.flatMap(Object.keys)
@ -130,6 +129,10 @@ exports.preview = async function (ctx) {
rows,
schemaFields: [...new Set(keys)],
}
// cleanup
if (integration.end) {
integration.end()
}
}
exports.execute = async function (ctx) {
@ -149,10 +152,13 @@ exports.execute = async function (ctx) {
ctx.request.body.parameters
)
const integration = new Integration(datasource.config)
// call the relevant CRUD method on the integration class
ctx.body = formatResponse(
await new Integration(datasource.config)[query.queryVerb](enrichedQuery)
)
ctx.body = formatResponse(await integration[query.queryVerb](enrichedQuery))
// cleanup
if (integration.end) {
integration.end()
}
}
exports.destroy = async function (ctx) {

View File

@ -2,6 +2,7 @@ let { merge } = require("lodash")
let env = require("../environment")
const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1"
exports.AWS_REGION = AWS_REGION
const TableInfo = {
API_KEYS: {

View File

@ -1,5 +1,6 @@
const AWS = require("aws-sdk")
const { FIELD_TYPES, QUERY_TYPES } = require("./Integration")
const { AWS_REGION } = require("../db/dynamoClient")
const SCHEMA = {
docs: "https://github.com/dabit3/dynamodb-documentclient-cheat-sheet",
@ -16,7 +17,7 @@ const SCHEMA = {
type: FIELD_TYPES.PASSWORD,
required: true,
},
secretKey: {
secretAccessKey: {
type: FIELD_TYPES.PASSWORD,
required: true,
},
@ -114,10 +115,22 @@ class DynamoDBIntegration {
})
}
async connect() {
end() {
this.disconnect()
}
connect() {
AWS.config.update(this.config)
}
disconnect() {
AWS.config.update({
secretAccessKey: undefined,
accessKeyId: undefined,
region: AWS_REGION,
})
}
async create(query) {
const params = {
TableName: query.table,

View File

@ -306,11 +306,7 @@ class TestConfiguration {
return await this._req(config, null, controllers.layout.save)
}
async createUser(
email = EMAIL,
password = PASSWORD,
roleId = BUILTIN_ROLE_IDS.POWER
) {
async createUser(roleId = BUILTIN_ROLE_IDS.POWER) {
const globalId = `us_${Math.random()}`
const resp = await this.globalUser(
globalId,

View File

@ -29,7 +29,7 @@
"keywords": [
"svelte"
],
"version": "0.8.16",
"version": "0.8.18",
"license": "MIT",
"gitHead": "4b6efc42ed3273595c7a129411f4d883733d3321",
"dependencies": {

View File

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

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "0.8.16",
"version": "0.8.18",
"description": "Budibase background service",
"main": "src/index.js",
"repository": {