Merge branch 'master' of github.com:Budibase/budibase into develop
This commit is contained in:
commit
e9143908ab
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"description": "Budibase backend core libraries used in server and worker",
|
"description": "Budibase backend core libraries used in server and worker",
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/src/index.js",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/src/index.d.ts",
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"test:watch": "jest --watchAll"
|
"test:watch": "jest --watchAll"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/types": "^1.1.29-alpha.2",
|
"@budibase/types": "^1.1.31",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
"aws-sdk": "2.1030.0",
|
"aws-sdk": "2.1030.0",
|
||||||
"bcrypt": "5.0.1",
|
"bcrypt": "5.0.1",
|
||||||
|
|
|
@ -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": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"svelte": "src/index.js",
|
"svelte": "src/index.js",
|
||||||
"module": "dist/bbui.es.js",
|
"module": "dist/bbui.es.js",
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
||||||
"@budibase/string-templates": "^1.1.29-alpha.2",
|
"@budibase/string-templates": "^1.1.31",
|
||||||
"@spectrum-css/actionbutton": "^1.0.1",
|
"@spectrum-css/actionbutton": "^1.0.1",
|
||||||
"@spectrum-css/actiongroup": "^1.0.1",
|
"@spectrum-css/actiongroup": "^1.0.1",
|
||||||
"@spectrum-css/avatar": "^3.0.2",
|
"@spectrum-css/avatar": "^3.0.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -69,10 +69,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.1.29-alpha.2",
|
"@budibase/bbui": "^1.1.31",
|
||||||
"@budibase/client": "^1.1.29-alpha.2",
|
"@budibase/client": "^1.1.31",
|
||||||
"@budibase/frontend-core": "^1.1.29-alpha.2",
|
"@budibase/frontend-core": "^1.1.31",
|
||||||
"@budibase/string-templates": "^1.1.29-alpha.2",
|
"@budibase/string-templates": "^1.1.31",
|
||||||
"@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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"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": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"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",
|
||||||
|
@ -19,9 +19,9 @@
|
||||||
"dev:builder": "rollup -cw"
|
"dev:builder": "rollup -cw"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.1.29-alpha.2",
|
"@budibase/bbui": "^1.1.31",
|
||||||
"@budibase/frontend-core": "^1.1.29-alpha.2",
|
"@budibase/frontend-core": "^1.1.31",
|
||||||
"@budibase/string-templates": "^1.1.29-alpha.2",
|
"@budibase/string-templates": "^1.1.31",
|
||||||
"@spectrum-css/button": "^3.0.3",
|
"@spectrum-css/button": "^3.0.3",
|
||||||
"@spectrum-css/card": "^3.0.3",
|
"@spectrum-css/card": "^3.0.3",
|
||||||
"@spectrum-css/divider": "^1.0.3",
|
"@spectrum-css/divider": "^1.0.3",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"description": "Budibase frontend core libraries used in builder and client",
|
"description": "Budibase frontend core libraries used in builder and client",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"svelte": "src/index.js",
|
"svelte": "src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.1.29-alpha.2",
|
"@budibase/bbui": "^1.1.31",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { Helpers } from "@budibase/bbui"
|
import { Helpers } from "@budibase/bbui"
|
||||||
import { OperatorOptions, SqlNumberTypeRangeMap } from "../constants"
|
import { OperatorOptions, SqlNumberTypeRangeMap } from "../constants"
|
||||||
|
|
||||||
|
const HBS_REGEX = /{{([^{].*?)}}/g
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the valid operator options for a certain data type
|
* Returns the valid operator options for a certain data type
|
||||||
* @param type the data type
|
* @param type the data type
|
||||||
|
@ -98,6 +100,8 @@ export const buildLuceneQuery = filter => {
|
||||||
if (Array.isArray(filter)) {
|
if (Array.isArray(filter)) {
|
||||||
filter.forEach(expression => {
|
filter.forEach(expression => {
|
||||||
let { operator, field, type, value, externalType } = expression
|
let { operator, field, type, value, externalType } = expression
|
||||||
|
const isHbs =
|
||||||
|
typeof value === "string" && value.match(HBS_REGEX)?.length > 0
|
||||||
// Parse all values into correct types
|
// Parse all values into correct types
|
||||||
if (type === "datetime") {
|
if (type === "datetime") {
|
||||||
// Ensure date value is a valid date and parse into correct format
|
// Ensure date value is a valid date and parse into correct format
|
||||||
|
@ -113,7 +117,7 @@ export const buildLuceneQuery = filter => {
|
||||||
if (type === "number" && !Array.isArray(value)) {
|
if (type === "number" && !Array.isArray(value)) {
|
||||||
if (operator === "oneOf") {
|
if (operator === "oneOf") {
|
||||||
value = value.split(",").map(item => parseFloat(item))
|
value = value.split(",").map(item => parseFloat(item))
|
||||||
} else {
|
} else if (!isHbs) {
|
||||||
value = parseFloat(value)
|
value = parseFloat(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"description": "Budibase Web Server",
|
"description": "Budibase Web Server",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -77,11 +77,11 @@
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/swagger-parser": "10.0.3",
|
"@apidevtools/swagger-parser": "10.0.3",
|
||||||
"@budibase/backend-core": "^1.1.29-alpha.2",
|
"@budibase/backend-core": "^1.1.31",
|
||||||
"@budibase/client": "^1.1.29-alpha.2",
|
"@budibase/client": "^1.1.31",
|
||||||
"@budibase/pro": "1.1.29-alpha.2",
|
"@budibase/pro": "1.1.31",
|
||||||
"@budibase/string-templates": "^1.1.29-alpha.2",
|
"@budibase/string-templates": "^1.1.31",
|
||||||
"@budibase/types": "^1.1.29-alpha.2",
|
"@budibase/types": "^1.1.31",
|
||||||
"@bull-board/api": "3.7.0",
|
"@bull-board/api": "3.7.0",
|
||||||
"@bull-board/koa": "3.9.4",
|
"@bull-board/koa": "3.9.4",
|
||||||
"@elastic/elasticsearch": "7.10.0",
|
"@elastic/elasticsearch": "7.10.0",
|
||||||
|
|
|
@ -82,6 +82,27 @@ async function getTable(appId, tableId) {
|
||||||
return ctx.body
|
return ctx.body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function typeCoercion(filters, table) {
|
||||||
|
if (!filters || !table) {
|
||||||
|
return filters
|
||||||
|
}
|
||||||
|
for (let key of Object.keys(filters)) {
|
||||||
|
if (typeof filters[key] === "object") {
|
||||||
|
for (let [property, value] of Object.entries(filters[key])) {
|
||||||
|
const column = table.schema[property]
|
||||||
|
// convert string inputs
|
||||||
|
if (!column || typeof value !== "string") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (column.type === FieldTypes.NUMBER) {
|
||||||
|
filters[key][property] = parseFloat(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return filters
|
||||||
|
}
|
||||||
|
|
||||||
exports.run = async function ({ inputs, appId }) {
|
exports.run = async function ({ inputs, appId }) {
|
||||||
const { tableId, filters, sortColumn, sortOrder, limit } = inputs
|
const { tableId, filters, sortColumn, sortOrder, limit } = inputs
|
||||||
const table = await getTable(appId, tableId)
|
const table = await getTable(appId, tableId)
|
||||||
|
@ -99,7 +120,7 @@ exports.run = async function ({ inputs, appId }) {
|
||||||
sortType,
|
sortType,
|
||||||
limit,
|
limit,
|
||||||
sort: sortColumn,
|
sort: sortColumn,
|
||||||
query: filters || {},
|
query: typeCoercion(filters || {}, table),
|
||||||
// default to ascending, like data tab
|
// default to ascending, like data tab
|
||||||
sortOrder: sortOrder || SortOrders.ASCENDING,
|
sortOrder: sortOrder || SortOrders.ASCENDING,
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,15 +31,21 @@ exports.definition = {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
|
message: {
|
||||||
|
type: "string",
|
||||||
|
description: "What was output",
|
||||||
},
|
},
|
||||||
required: ["success"],
|
},
|
||||||
|
required: ["success", "message"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.run = async function ({ inputs, appId }) {
|
exports.run = async function ({ inputs, appId }) {
|
||||||
console.log(`App ${appId} - ${inputs.text}`)
|
const message = `App ${appId} - ${inputs.text}`
|
||||||
|
console.log(message)
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
message,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/types",
|
"name": "@budibase/types",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"description": "Budibase types",
|
"description": "Budibase types",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.1.29-alpha.2",
|
"version": "1.1.31",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -35,10 +35,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "^1.1.29-alpha.2",
|
"@budibase/backend-core": "^1.1.31",
|
||||||
"@budibase/pro": "1.1.29-alpha.2",
|
"@budibase/pro": "1.1.31",
|
||||||
"@budibase/string-templates": "^1.1.29-alpha.2",
|
"@budibase/string-templates": "^1.1.31",
|
||||||
"@budibase/types": "^1.1.29-alpha.2",
|
"@budibase/types": "^1.1.31",
|
||||||
"@koa/router": "8.0.8",
|
"@koa/router": "8.0.8",
|
||||||
"@sentry/node": "6.17.7",
|
"@sentry/node": "6.17.7",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
|
|
Loading…
Reference in New Issue