This commit is contained in:
Martin McKeaveney 2021-06-10 14:15:03 +01:00
commit a44d59541d
18 changed files with 98 additions and 38 deletions

View File

@ -14,7 +14,6 @@ services:
environment: environment:
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_BROWSER: "off"
command: server /data command: server /data
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/auth", "name": "@budibase/auth",
"version": "0.9.39", "version": "0.9.42",
"description": "Authentication middlewares for budibase builder and apps", "description": "Authentication middlewares for budibase builder and apps",
"main": "src/index.js", "main": "src/index.js",
"author": "Budibase", "author": "Budibase",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "0.9.39", "version": "0.9.42",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "0.9.39", "version": "0.9.42",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/electron.js", "main": "src/electron.js",
"repository": { "repository": {
@ -55,9 +55,9 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.39", "@budibase/auth": "^0.9.42",
"@budibase/client": "^0.9.39", "@budibase/client": "^0.9.42",
"@budibase/string-templates": "^0.9.39", "@budibase/string-templates": "^0.9.42",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",
"@koa/router": "8.0.0", "@koa/router": "8.0.0",
"@sendgrid/mail": "7.1.1", "@sendgrid/mail": "7.1.1",
@ -110,7 +110,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.3", "@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.4", "@babel/preset-env": "^7.14.4",
"@budibase/standard-components": "^0.9.39", "@budibase/standard-components": "^0.9.42",
"@jest/test-sequencer": "^24.8.0", "@jest/test-sequencer": "^24.8.0",
"babel-jest": "^27.0.2", "babel-jest": "^27.0.2",
"docker-compose": "^0.23.6", "docker-compose": "^0.23.6",

View File

@ -82,7 +82,7 @@ exports.query = async function (ctx) {
exports.plus = async function (ctx) { exports.plus = async function (ctx) {
const db = new CouchDB(ctx.appId) const db = new CouchDB(ctx.appId)
const PlusConnector = plusIntegrations[ctx.request.body.source] const PlusConnector = plusIntegrations[ctx.request.body.source].integration
const connector = new PlusConnector(ctx.request.body) const connector = new PlusConnector(ctx.request.body)
await connector.init() await connector.init()

View File

@ -71,7 +71,7 @@ exports.uploadFile = async function (ctx) {
return prepareUpload({ return prepareUpload({
file, file,
s3Key: `assets/${ctx.appId}/attachments/${processedFileName}`, s3Key: `${ctx.appId}/attachments/${processedFileName}`,
bucket: ObjectStoreBuckets.APPS, bucket: ObjectStoreBuckets.APPS,
}) })
}) })

View File

@ -385,7 +385,7 @@ describe("/rows", () => {
name: "test", name: "test",
description: "test", description: "test",
attachment: [{ attachment: [{
key: `${config.getAppId()}/attachment/test/thing.csv`, key: `${config.getAppId()}/attachments/test/thing.csv`,
}], }],
tableId: table._id, tableId: table._id,
}) })
@ -393,7 +393,7 @@ describe("/rows", () => {
await setup.switchToSelfHosted(async () => { await setup.switchToSelfHosted(async () => {
const enriched = await outputProcessing(config.getAppId(), table, [row]) const enriched = await outputProcessing(config.getAppId(), table, [row])
expect(enriched[0].attachment[0].url).toBe( expect(enriched[0].attachment[0].url).toBe(
`/prod-budi-app-assets/${config.getAppId()}/attachment/test/thing.csv` `/prod-budi-app-assets/${config.getAppId()}/attachments/test/thing.csv`
) )
}) })
}) })

View File

@ -9,6 +9,8 @@ const airtable = require("./airtable")
const mysql = require("./mysql") const mysql = require("./mysql")
const arangodb = require("./arangodb") const arangodb = require("./arangodb")
const rest = require("./rest") const rest = require("./rest")
// Plus
const postgresPlus = require("../integrations/plus/postgres")
const DEFINITIONS = { const DEFINITIONS = {
POSTGRES: postgres.schema, POSTGRES: postgres.schema,
@ -22,6 +24,7 @@ const DEFINITIONS = {
MYSQL: mysql.schema, MYSQL: mysql.schema,
ARANGODB: arangodb.schema, ARANGODB: arangodb.schema,
REST: rest.schema, REST: rest.schema,
POSTGRES_PLUS: postgresPlus.schema,
} }
const INTEGRATIONS = { const INTEGRATIONS = {

View File

@ -1,5 +1,6 @@
const { Pool } = require("pg") const { Pool } = require("pg")
const { FieldTypes } = require("../../constants") const { FieldTypes } = require("../../constants")
const { FIELD_TYPES } = require("../Integration")
const TYPE_MAP = { const TYPE_MAP = {
text: FieldTypes.LONGFORM, text: FieldTypes.LONGFORM,
@ -13,6 +14,44 @@ const TYPE_MAP = {
boolean: FieldTypes.BOOLEAN, boolean: FieldTypes.BOOLEAN,
} }
const SCHEMA = {
friendlyName: "PostgreSQL",
description:
"PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
datasource: {
host: {
type: FIELD_TYPES.STRING,
default: "localhost",
required: true,
},
port: {
type: FIELD_TYPES.NUMBER,
required: true,
default: 5432,
},
database: {
type: FIELD_TYPES.STRING,
default: "postgres",
required: true,
},
user: {
type: FIELD_TYPES.STRING,
default: "root",
required: true,
},
password: {
type: FIELD_TYPES.PASSWORD,
default: "root",
required: true,
},
ssl: {
type: FIELD_TYPES.BOOLEAN,
default: false,
required: false,
},
},
}
class PostgresPlus { class PostgresPlus {
static pool static pool
COLUMNS_SQL = COLUMNS_SQL =
@ -52,4 +91,7 @@ class PostgresPlus {
} }
} }
module.exports = PostgresPlus module.exports = {
schema: SCHEMA,
integration: PostgresPlus,
}

View File

@ -29,11 +29,11 @@
"keywords": [ "keywords": [
"svelte" "svelte"
], ],
"version": "0.9.39", "version": "0.9.42",
"license": "MIT", "license": "MIT",
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc",
"dependencies": { "dependencies": {
"@budibase/bbui": "^0.9.39", "@budibase/bbui": "^0.9.42",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",
"apexcharts": "^3.22.1", "apexcharts": "^3.22.1",

View File

@ -13,7 +13,9 @@ export const buildLuceneQuery = filter => {
notEmpty: {}, notEmpty: {},
} }
if (Array.isArray(filter)) { if (Array.isArray(filter)) {
filter.forEach(({ operator, field, type, value }) => { // Build up proper range filters
filter.forEach(expression => {
const { operator, field, type, value } = expression
if (operator.startsWith("range")) { if (operator.startsWith("range")) {
if (!query.range[field]) { if (!query.range[field]) {
query.range[field] = { query.range[field] = {
@ -33,10 +35,24 @@ export const buildLuceneQuery = filter => {
query.range[field].high = value query.range[field].high = value
} }
} else if (query[operator]) { } else if (query[operator]) {
query[operator][field] = value if (type === "boolean") {
// Transform boolean filters to cope with null.
// "equals false" needs to be "not equals true"
// "not equals false" needs to be "equals true"
if (operator === "equal" && value === "false") {
query.notEqual[field] = "true"
} else if (operator === "notEqual" && value === "false") {
query.equal[field] = "true"
} else {
query[operator][field] = value
}
} else {
query[operator][field] = value
}
} }
}) })
} }
return query return query
} }

View File

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

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "0.9.39", "version": "0.9.42",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -21,8 +21,8 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.39", "@budibase/auth": "^0.9.42",
"@budibase/string-templates": "^0.9.39", "@budibase/string-templates": "^0.9.42",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"aws-sdk": "^2.811.0", "aws-sdk": "^2.811.0",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",

View File

@ -287,10 +287,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/auth@^0.9.36": "@budibase/auth@^0.9.38":
version "0.9.36" version "0.9.38"
resolved "https://registry.yarnpkg.com/@budibase/auth/-/auth-0.9.36.tgz#8111890390fb57a513ea1fc0b209db474460ea59" resolved "https://registry.yarnpkg.com/@budibase/auth/-/auth-0.9.38.tgz#196f2f20f8df09e07804877965ada6bd7a9e7e72"
integrity sha512-pGDd3d5/MwEDrSQI7NZNfekXlywuxjKNOfQHi5+5cbpje3DdWxRu2ILpvYj0TdmIk8K3vd4TsZLL0APVaB/mhg== integrity sha512-ww1gfjjmSvmzNFZY8Omy9tzuzFsStLzHR6t54hinOVcL3Bu8T/xBAqSyEvyCkZNbfTHis7V8QmTzugRxhuyHoQ==
dependencies: dependencies:
aws-sdk "^2.901.0" aws-sdk "^2.901.0"
bcryptjs "^2.4.3" bcryptjs "^2.4.3"
@ -340,10 +340,10 @@
to-gfm-code-block "^0.1.1" to-gfm-code-block "^0.1.1"
year "^0.2.1" year "^0.2.1"
"@budibase/string-templates@^0.9.36": "@budibase/string-templates@^0.9.38":
version "0.9.36" version "0.9.38"
resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-0.9.36.tgz#a8391d01fec9587b8b0873f6bdc402a6d8375e8a" resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-0.9.38.tgz#8fec7b18654b2e42e388a774a515c6f8617b56e9"
integrity sha512-OtuwJZkwgGD/pu0I0duCqiC4djGhc3olMvROq9JHIs6jm7qWLRxud53S1TdgHFFZPdEsuUGHGLRlZrIZaPujQw== integrity sha512-38n+zf8L1s24rbSnk9/18In7xxz/zLeI0Yn6OUn079Nqz7MCgdhnYg/TTYAORzm7WYFwnAF1pXStWqTrsZk+lg==
dependencies: dependencies:
"@budibase/handlebars-helpers" "^0.11.3" "@budibase/handlebars-helpers" "^0.11.3"
dayjs "^1.10.4" dayjs "^1.10.4"