Merge branch 'master' of github.com:Budibase/budibase into develop
This commit is contained in:
commit
69abe9c5db
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/backend-core",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase backend core libraries used in server and worker",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
|
@ -20,7 +20,7 @@
|
|||
"test:watch": "jest --watchAll"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/types": "2.0.10-alpha.1",
|
||||
"@budibase/types": "^2.0.13",
|
||||
"@shopify/jest-koa-mocks": "5.0.1",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
"aws-sdk": "2.1030.0",
|
||||
|
|
|
@ -182,6 +182,11 @@ export const streamUpload = async (
|
|||
...extra,
|
||||
ContentType: "application/javascript",
|
||||
}
|
||||
} else if (filename?.endsWith(".svg")) {
|
||||
extra = {
|
||||
...extra,
|
||||
ContentType: "image",
|
||||
}
|
||||
}
|
||||
|
||||
const params = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"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.0.10-alpha.1",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@spectrum-css/actionbutton": "^1.0.1",
|
||||
"@spectrum-css/actiongroup": "^1.0.1",
|
||||
"@spectrum-css/avatar": "^3.0.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"license": "GPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -71,10 +71,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.0.10-alpha.1",
|
||||
"@budibase/client": "2.0.10-alpha.1",
|
||||
"@budibase/frontend-core": "2.0.10-alpha.1",
|
||||
"@budibase/string-templates": "2.0.10-alpha.1",
|
||||
"@budibase/bbui": "^2.0.13",
|
||||
"@budibase/client": "^2.0.13",
|
||||
"@budibase/frontend-core": "^2.0.13",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@sentry/browser": "5.19.1",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
|
|
|
@ -143,7 +143,10 @@ export const getComponentSettings = componentType => {
|
|||
}
|
||||
|
||||
// Ensure whole component name is used
|
||||
if (!componentType.startsWith("@budibase")) {
|
||||
if (
|
||||
!componentType.startsWith("plugin/") &&
|
||||
!componentType.startsWith("@budibase")
|
||||
) {
|
||||
componentType = `@budibase/standard-components/${componentType}`
|
||||
}
|
||||
|
||||
|
|
|
@ -243,18 +243,18 @@ export const getDatasourceForProvider = (asset, component) => {
|
|||
return null
|
||||
}
|
||||
|
||||
// There are different types of setting which can be a datasource, for
|
||||
// example an actual datasource object, or a table ID string.
|
||||
// Convert the datasource setting into a proper datasource object so that
|
||||
// we can use it properly
|
||||
if (datasourceSetting.type === "table") {
|
||||
// For legacy compatibility, we need to be able to handle datasources that are
|
||||
// just strings. These are not generated any more, so could be removed in
|
||||
// future.
|
||||
// TODO: remove at some point
|
||||
const datasource = component[datasourceSetting?.key]
|
||||
if (typeof datasource === "string") {
|
||||
return {
|
||||
tableId: component[datasourceSetting?.key],
|
||||
tableId: datasource,
|
||||
type: "table",
|
||||
}
|
||||
} else {
|
||||
return component[datasourceSetting?.key]
|
||||
}
|
||||
return datasource
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,27 +88,12 @@ export const getFrontendStore = () => {
|
|||
initialise: async pkg => {
|
||||
const { layouts, screens, application, clientLibPath } = pkg
|
||||
|
||||
// Fetch component definitions.
|
||||
// Allow errors to propagate.
|
||||
const components = await API.fetchComponentLibDefinitions(
|
||||
application.appId
|
||||
)
|
||||
|
||||
// Filter out custom component keys so we can flag them
|
||||
const customComponents = Object.keys(components).filter(name =>
|
||||
name.startsWith("plugin/")
|
||||
)
|
||||
await store.actions.components.refreshDefinitions(application.appId)
|
||||
|
||||
// Reset store state
|
||||
store.update(state => ({
|
||||
...state,
|
||||
libraries: application.componentLibraries,
|
||||
components,
|
||||
customComponents,
|
||||
clientFeatures: {
|
||||
...INITIAL_FRONTEND_STATE.clientFeatures,
|
||||
...components.features,
|
||||
},
|
||||
name: application.name,
|
||||
description: application.description,
|
||||
appId: application.appId,
|
||||
|
@ -385,6 +370,29 @@ export const getFrontendStore = () => {
|
|||
},
|
||||
},
|
||||
components: {
|
||||
refreshDefinitions: async appId => {
|
||||
if (!appId) {
|
||||
appId = get(store).appId
|
||||
}
|
||||
|
||||
// Fetch definitions and filter out custom component definitions so we
|
||||
// can flag them
|
||||
const components = await API.fetchComponentLibDefinitions(appId)
|
||||
const customComponents = Object.keys(components).filter(name =>
|
||||
name.startsWith("plugin/")
|
||||
)
|
||||
|
||||
// Update store
|
||||
store.update(state => ({
|
||||
...state,
|
||||
components,
|
||||
customComponents,
|
||||
clientFeatures: {
|
||||
...INITIAL_FRONTEND_STATE.clientFeatures,
|
||||
...components.features,
|
||||
},
|
||||
}))
|
||||
},
|
||||
getDefinition: componentName => {
|
||||
if (!componentName) {
|
||||
return null
|
||||
|
@ -428,7 +436,7 @@ export const getFrontendStore = () => {
|
|||
_id: Helpers.uuid(),
|
||||
_component: definition.component,
|
||||
_styles: { normal: {}, hover: {}, active: {} },
|
||||
_instanceName: `New ${definition.name}`,
|
||||
_instanceName: `New ${definition.friendlyName || definition.name}`,
|
||||
...cloneDeep(props),
|
||||
...extras,
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
customQueryIconColor,
|
||||
customQueryText,
|
||||
} from "helpers/data/utils"
|
||||
import { getIcon } from "./icons"
|
||||
import IntegrationIcon from "./IntegrationIcon.svelte"
|
||||
import { notifications } from "@budibase/bbui"
|
||||
|
||||
let openDataSources = []
|
||||
|
@ -123,10 +123,10 @@
|
|||
on:iconClick={() => toggleNode(datasource)}
|
||||
>
|
||||
<div class="datasource-icon" slot="icon">
|
||||
<svelte:component
|
||||
this={getIcon(datasource.source, datasource.schema)}
|
||||
height="18"
|
||||
width="18"
|
||||
<IntegrationIcon
|
||||
integrationType={datasource.source}
|
||||
schema={datasource.schema}
|
||||
size="18"
|
||||
/>
|
||||
</div>
|
||||
{#if datasource._id !== BUDIBASE_INTERNAL_DB}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<script>
|
||||
import { getIcon } from "./icons"
|
||||
import CustomSVG from "components/common/CustomSVG.svelte"
|
||||
import { admin } from "stores/portal"
|
||||
|
||||
export let integrationType
|
||||
export let schema
|
||||
export let size = "18"
|
||||
|
||||
$: objectStoreUrl = $admin.cloud ? "https://cdn.budi.live" : ""
|
||||
$: pluginsUrl = `${objectStoreUrl}/plugins`
|
||||
$: iconInfo = getIcon(integrationType, schema)
|
||||
|
||||
async function getSvgFromUrl(info) {
|
||||
const url = `${pluginsUrl}/${info.url}`
|
||||
const resp = await fetch(url, {
|
||||
headers: {
|
||||
["pragma"]: "no-cache",
|
||||
["cache-control"]: "no-cache",
|
||||
},
|
||||
})
|
||||
return resp.text()
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if iconInfo.icon}
|
||||
<svelte:component this={iconInfo.icon} height={size} width={size} />
|
||||
{:else if iconInfo.url}
|
||||
{#await getSvgFromUrl(iconInfo) then retrievedSvg}
|
||||
<CustomSVG {size} svgHtml={retrievedSvg} />
|
||||
{/await}
|
||||
{/if}
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { Heading, Detail } from "@budibase/bbui"
|
||||
import { getIcon } from "../icons"
|
||||
import IntegrationIcon from "../IntegrationIcon.svelte"
|
||||
|
||||
export let integration
|
||||
export let integrationType
|
||||
|
@ -16,11 +16,7 @@
|
|||
class="item hoverable"
|
||||
>
|
||||
<div class="item-body" class:with-type={!!schema.type}>
|
||||
<svelte:component
|
||||
this={getIcon(integrationType, schema)}
|
||||
height="20"
|
||||
width="20"
|
||||
/>
|
||||
<IntegrationIcon {integrationType} {schema} size="25" />
|
||||
<div class="text">
|
||||
<Heading size="XXS">{schema.friendlyName}</Heading>
|
||||
{#if schema.type}
|
||||
|
|
|
@ -16,6 +16,8 @@ import Firebase from "./Firebase.svelte"
|
|||
import Redis from "./Redis.svelte"
|
||||
import Snowflake from "./Snowflake.svelte"
|
||||
import Custom from "./Custom.svelte"
|
||||
import { integrations } from "stores/backend"
|
||||
import { get } from "svelte/store"
|
||||
|
||||
const ICONS = {
|
||||
BUDIBASE: Budibase,
|
||||
|
@ -41,9 +43,12 @@ const ICONS = {
|
|||
export default ICONS
|
||||
|
||||
export function getIcon(integrationType, schema) {
|
||||
if (schema?.custom || !ICONS[integrationType]) {
|
||||
return ICONS.CUSTOM
|
||||
const integrationList = get(integrations)
|
||||
if (integrationList[integrationType]?.iconUrl) {
|
||||
return { url: integrationList[integrationType].iconUrl }
|
||||
} else if (schema?.custom || !ICONS[integrationType]) {
|
||||
return { icon: ICONS.CUSTOM }
|
||||
} else {
|
||||
return ICONS[integrationType]
|
||||
return { icon: ICONS[integrationType] }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<script>
|
||||
import { Helpers } from "@budibase/bbui"
|
||||
export let size
|
||||
export let svgHtml
|
||||
|
||||
function substituteSize(svg) {
|
||||
if (svg.includes("height=")) {
|
||||
svg = svg.replace(/height="[^"]+"/, `height="${size}"`)
|
||||
}
|
||||
if (svg.includes("width=")) {
|
||||
svg = svg.replace(/width="[^"]+"/, `width="${size}"`)
|
||||
}
|
||||
if (svg.includes("id=")) {
|
||||
const matches = svg.match(/id="([^"]+)"/g)
|
||||
for (let match of matches) {
|
||||
svg = svg.replace(new RegExp(match, "g"), Helpers.uuid())
|
||||
}
|
||||
}
|
||||
return svg
|
||||
}
|
||||
</script>
|
||||
|
||||
{@html substituteSize(svgHtml)}
|
|
@ -1,26 +1,28 @@
|
|||
<script>
|
||||
import { Select } from "@budibase/bbui"
|
||||
import { tables } from "stores/backend"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { tables as tablesStore } from "stores/backend"
|
||||
|
||||
export let value
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
$: tables = $tablesStore.list.map(m => ({
|
||||
label: m.name,
|
||||
tableId: m._id,
|
||||
type: "table",
|
||||
}))
|
||||
|
||||
const onChange = e => {
|
||||
const dataSource = tables?.find(x => x.tableId === e.detail)
|
||||
dispatch("change", dataSource)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<Select extraThin secondary wide on:change {value}>
|
||||
<option value="">Choose a table</option>
|
||||
{#each $tables.list as table}
|
||||
<option value={table._id}>{table.name}</option>
|
||||
{/each}
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
div {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
div :global(> *) {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
</style>
|
||||
<Select
|
||||
on:change={onChange}
|
||||
value={value?.tableId}
|
||||
options={tables}
|
||||
getOptionValue={x => x.tableId}
|
||||
getOptionLabel={x => x.label}
|
||||
/>
|
||||
|
|
|
@ -198,6 +198,8 @@
|
|||
block: "center",
|
||||
})
|
||||
}
|
||||
} else if (type === "reload-plugin") {
|
||||
await store.actions.components.refreshDefinitions()
|
||||
} else {
|
||||
console.warn(`Client sent unknown event type: ${type}`)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"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.0.10-alpha.1",
|
||||
"@budibase/string-templates": "2.0.10-alpha.1",
|
||||
"@budibase/types": "2.0.10-alpha.1",
|
||||
"@budibase/backend-core": "^2.0.13",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@budibase/types": "^2.0.13",
|
||||
"axios": "0.21.2",
|
||||
"chalk": "4.1.0",
|
||||
"cli-progress": "3.11.2",
|
||||
|
|
|
@ -21,3 +21,5 @@ exports.AnalyticsEvents = {
|
|||
}
|
||||
|
||||
exports.POSTHOG_TOKEN = "phc_yGOn4i7jWKaCTapdGR6lfA4AvmuEQ2ijn5zAVSFYPlS"
|
||||
|
||||
exports.GENERATED_USER_EMAIL = "admin@admin.com"
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
const { success } = require("../utils")
|
||||
const { updateDockerComposeService } = require("./utils")
|
||||
const randomString = require("randomstring")
|
||||
const { GENERATED_USER_EMAIL } = require("../constants")
|
||||
|
||||
exports.generateUser = async () => {
|
||||
const email = "admin@admin.com"
|
||||
const password = randomString.generate({ length: 6 })
|
||||
exports.generateUser = async (password, silent) => {
|
||||
const email = GENERATED_USER_EMAIL
|
||||
if (!password) {
|
||||
password = randomString.generate({ length: 6 })
|
||||
}
|
||||
updateDockerComposeService(service => {
|
||||
service.environment["BB_ADMIN_USER_EMAIL"] = email
|
||||
service.environment["BB_ADMIN_USER_PASSWORD"] = password
|
||||
})
|
||||
console.log(
|
||||
success(
|
||||
`User admin credentials configured, access with email: ${email} - password: ${password}`
|
||||
if (!silent) {
|
||||
console.log(
|
||||
success(
|
||||
`User admin credentials configured, access with email: ${email} - password: ${password}`
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ async function getInitConfig(type, isQuick, port) {
|
|||
}
|
||||
|
||||
exports.init = async opts => {
|
||||
let type, isSingle, watchDir, genUser, port
|
||||
let type, isSingle, watchDir, genUser, port, silent
|
||||
if (typeof opts === "string") {
|
||||
type = opts
|
||||
} else {
|
||||
|
@ -42,6 +42,7 @@ exports.init = async opts => {
|
|||
watchDir = opts["watchPluginDir"]
|
||||
genUser = opts["genUser"]
|
||||
port = opts["port"]
|
||||
silent = opts["silent"]
|
||||
}
|
||||
const isQuick = type === InitTypes.QUICK || type === InitTypes.DIGITAL_OCEAN
|
||||
await checkDockerConfigured()
|
||||
|
@ -60,14 +61,15 @@ exports.init = async opts => {
|
|||
const config = await getInitConfig(type, isQuick, port)
|
||||
if (!isSingle) {
|
||||
await downloadFiles()
|
||||
await makeFiles.makeEnv(config)
|
||||
await makeFiles.makeEnv(config, silent)
|
||||
} else {
|
||||
await makeFiles.makeSingleCompose(config)
|
||||
await makeFiles.makeSingleCompose(config, silent)
|
||||
}
|
||||
if (watchDir) {
|
||||
await watchPlugins(watchDir)
|
||||
await watchPlugins(watchDir, silent)
|
||||
}
|
||||
if (genUser) {
|
||||
await generateUser()
|
||||
const inputPassword = typeof genUser === "string" ? genUser : null
|
||||
await generateUser(inputPassword, silent)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ module.exports.QUICK_CONFIG = {
|
|||
port: 10000,
|
||||
}
|
||||
|
||||
async function make(path, contentsFn, inputs = {}) {
|
||||
async function make(path, contentsFn, inputs = {}, silent) {
|
||||
const port =
|
||||
inputs.port ||
|
||||
(await number(
|
||||
|
@ -98,19 +98,21 @@ async function make(path, contentsFn, inputs = {}) {
|
|||
))
|
||||
const fileContents = contentsFn(port)
|
||||
fs.writeFileSync(path, fileContents)
|
||||
console.log(
|
||||
success(
|
||||
`Configuration has been written successfully - please check ${path} for more details.`
|
||||
if (!silent) {
|
||||
console.log(
|
||||
success(
|
||||
`Configuration has been written successfully - please check ${path} for more details.`
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.makeEnv = async (inputs = {}) => {
|
||||
return make(ENV_PATH, getEnv, inputs)
|
||||
module.exports.makeEnv = async (inputs = {}, silent) => {
|
||||
return make(ENV_PATH, getEnv, inputs, silent)
|
||||
}
|
||||
|
||||
module.exports.makeSingleCompose = async (inputs = {}) => {
|
||||
return make(COMPOSE_PATH, getSingleCompose, inputs)
|
||||
module.exports.makeSingleCompose = async (inputs = {}, silent) => {
|
||||
return make(COMPOSE_PATH, getSingleCompose, inputs, silent)
|
||||
}
|
||||
|
||||
module.exports.getEnvProperty = property => {
|
||||
|
|
|
@ -3,7 +3,7 @@ const fs = require("fs")
|
|||
const { error, success } = require("../utils")
|
||||
const { updateDockerComposeService } = require("./utils")
|
||||
|
||||
exports.watchPlugins = async pluginPath => {
|
||||
exports.watchPlugins = async (pluginPath, silent) => {
|
||||
const PLUGIN_PATH = "/plugins"
|
||||
// get absolute path
|
||||
pluginPath = resolve(pluginPath)
|
||||
|
@ -28,7 +28,9 @@ exports.watchPlugins = async pluginPath => {
|
|||
}
|
||||
service.volumes.push(`${pluginPath}:${PLUGIN_PATH}`)
|
||||
})
|
||||
console.log(
|
||||
success(`Docker compose configured to watch directory: ${pluginPath}`)
|
||||
)
|
||||
if (!silent) {
|
||||
console.log(
|
||||
success(`Docker compose configured to watch directory: ${pluginPath}`)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ const { join } = require("path")
|
|||
const { success, error, info, moveDirectory } = require("../utils")
|
||||
const { captureEvent } = require("../events")
|
||||
const fp = require("find-free-port")
|
||||
const { GENERATED_USER_EMAIL } = require("../constants")
|
||||
const { init: hostingInit } = require("../hosting/init")
|
||||
const { start: hostingStart } = require("../hosting/start")
|
||||
|
||||
|
@ -147,14 +148,24 @@ async function watch() {
|
|||
async function dev() {
|
||||
const pluginDir = await questions.string("Directory to watch", "./")
|
||||
const [port] = await fp(10000)
|
||||
const password = "admin"
|
||||
await hostingInit({
|
||||
init: InitTypes.QUICK,
|
||||
single: true,
|
||||
watchPluginDir: pluginDir,
|
||||
genUser: true,
|
||||
genUser: password,
|
||||
port,
|
||||
silent: true,
|
||||
})
|
||||
await hostingStart()
|
||||
console.log(success(`Configuration has been written to docker-compose.yaml`))
|
||||
console.log(
|
||||
success("Development environment started successfully - connect at: ") +
|
||||
info(`http://localhost:${port}`)
|
||||
)
|
||||
console.log(success("Use the following credentials to login:"))
|
||||
console.log(success("Email: ") + info(GENERATED_USER_EMAIL))
|
||||
console.log(success("Password: ") + info(password))
|
||||
}
|
||||
|
||||
const command = new Command(`${CommandWords.PLUGIN}`)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"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.0.10-alpha.1",
|
||||
"@budibase/frontend-core": "2.0.10-alpha.1",
|
||||
"@budibase/string-templates": "2.0.10-alpha.1",
|
||||
"@budibase/bbui": "^2.0.13",
|
||||
"@budibase/frontend-core": "^2.0.13",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@spectrum-css/button": "^3.0.3",
|
||||
"@spectrum-css/card": "^3.0.3",
|
||||
"@spectrum-css/divider": "^1.0.3",
|
||||
|
|
|
@ -98,6 +98,9 @@ const createBuilderStore = () => {
|
|||
return state
|
||||
})
|
||||
}
|
||||
|
||||
// Notify the builder so we can reload component definitions
|
||||
dispatchEvent("reload-plugin")
|
||||
},
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
import { builderStore, environmentStore } from "./stores/index.js"
|
||||
import {
|
||||
builderStore,
|
||||
environmentStore,
|
||||
notificationStore,
|
||||
} from "./stores/index.js"
|
||||
import { get } from "svelte/store"
|
||||
import { io } from "socket.io-client"
|
||||
|
||||
let socket
|
||||
|
||||
export const initWebsocket = () => {
|
||||
const { inBuilder, location } = get(builderStore)
|
||||
const { cloud } = get(environmentStore)
|
||||
|
||||
// Only connect when we're inside the builder preview, for now
|
||||
if (!inBuilder || !location || cloud) {
|
||||
if (!inBuilder || !location || cloud || socket) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -16,20 +22,20 @@ export const initWebsocket = () => {
|
|||
const proto = tls ? "wss:" : "ws:"
|
||||
const host = location.hostname
|
||||
const port = location.port || (tls ? 443 : 80)
|
||||
const socket = io(`${proto}//${host}:${port}`, {
|
||||
socket = io(`${proto}//${host}:${port}`, {
|
||||
path: "/socket/client",
|
||||
// Cap reconnection attempts to 10 (total of 95 seconds before giving up)
|
||||
reconnectionAttempts: 10,
|
||||
// Delay initial reconnection attempt by 5 seconds
|
||||
// Cap reconnection attempts to 3 (total of 15 seconds before giving up)
|
||||
reconnectionAttempts: 3,
|
||||
// Delay reconnection attempt by 5 seconds
|
||||
reconnectionDelay: 5000,
|
||||
// Then decrease to 10 second intervals
|
||||
reconnectionDelayMax: 10000,
|
||||
// Timeout after 5 seconds so we never stack requests
|
||||
timeout: 5000,
|
||||
reconnectionDelayMax: 5000,
|
||||
// Timeout after 4 seconds so we never stack requests
|
||||
timeout: 4000,
|
||||
})
|
||||
|
||||
// Event handlers
|
||||
socket.on("plugin-update", data => {
|
||||
builderStore.actions.updateUsedPlugin(data.name, data.hash)
|
||||
notificationStore.actions.info(`"${data.name}" plugin reloaded`)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@budibase/frontend-core",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase frontend core libraries used in builder and client",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.0.10-alpha.1",
|
||||
"@budibase/bbui": "^2.0.13",
|
||||
"lodash": "^4.17.21",
|
||||
"svelte": "^3.46.2"
|
||||
}
|
||||
|
|
|
@ -8,10 +8,9 @@ export const buildRowEndpoints = API => ({
|
|||
if (!tableId || !rowId) {
|
||||
return null
|
||||
}
|
||||
const row = await API.get({
|
||||
return await API.get({
|
||||
url: `/api/${tableId}/rows/${rowId}`,
|
||||
})
|
||||
return (await API.enrichRows([row], tableId))[0]
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/sdk",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase Public API SDK",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -77,11 +77,11 @@
|
|||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "10.0.3",
|
||||
"@budibase/backend-core": "2.0.10-alpha.1",
|
||||
"@budibase/client": "2.0.10-alpha.1",
|
||||
"@budibase/pro": "2.0.10-alpha.0",
|
||||
"@budibase/string-templates": "2.0.10-alpha.1",
|
||||
"@budibase/types": "2.0.10-alpha.1",
|
||||
"@budibase/backend-core": "^2.0.13",
|
||||
"@budibase/client": "^2.0.13",
|
||||
"@budibase/pro": "2.0.13",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@budibase/types": "^2.0.13",
|
||||
"@bull-board/api": "3.7.0",
|
||||
"@bull-board/koa": "3.9.4",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
|
|
|
@ -57,7 +57,11 @@ const INTEGRATIONS: { [key: string]: any } = {
|
|||
}
|
||||
|
||||
// optionally add oracle integration if the oracle binary can be installed
|
||||
if (process.arch && !process.arch.startsWith("arm")) {
|
||||
if (
|
||||
process.arch &&
|
||||
!process.arch.startsWith("arm") &&
|
||||
oracle.integration.isInstalled()
|
||||
) {
|
||||
DEFINITIONS[SourceName.ORACLE] = oracle.schema
|
||||
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
|
||||
}
|
||||
|
@ -78,6 +82,9 @@ module.exports = {
|
|||
...plugin.schema["schema"],
|
||||
custom: true,
|
||||
}
|
||||
if (plugin.iconUrl) {
|
||||
pluginSchemas[sourceId].iconUrl = plugin.iconUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -15,17 +15,22 @@ import {
|
|||
getSqlQuery,
|
||||
SqlClient,
|
||||
} from "./utils"
|
||||
import oracledb, {
|
||||
import Sql from "./base/sql"
|
||||
import { FieldTypes } from "../constants"
|
||||
import {
|
||||
BindParameters,
|
||||
Connection,
|
||||
ConnectionAttributes,
|
||||
ExecuteOptions,
|
||||
Result,
|
||||
} from "oracledb"
|
||||
import Sql from "./base/sql"
|
||||
import { FieldTypes } from "../constants"
|
||||
|
||||
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
|
||||
let oracledb: any
|
||||
try {
|
||||
oracledb = require("oracledb")
|
||||
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
|
||||
} catch (err) {
|
||||
console.log("ORACLEDB is not installed")
|
||||
}
|
||||
|
||||
interface OracleConfig {
|
||||
host: string
|
||||
|
@ -183,6 +188,10 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|||
return parts.join(" || ")
|
||||
}
|
||||
|
||||
static isInstalled() {
|
||||
return oracledb != null
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the flat tabular columns and constraints data into a nested object
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/types",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase types",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
@ -21,6 +21,7 @@ export interface Plugin extends Document {
|
|||
name: string
|
||||
version: string
|
||||
jsUrl?: string
|
||||
iconUrl?: string
|
||||
source: PluginSource
|
||||
package: { [key: string]: any }
|
||||
hash: string
|
||||
|
|
|
@ -96,6 +96,7 @@ export interface Integration {
|
|||
description: string
|
||||
friendlyName: string
|
||||
type?: string
|
||||
iconUrl?: string
|
||||
datasource: {}
|
||||
query: {
|
||||
[key: string]: QueryDefinition
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.0.10-alpha.1",
|
||||
"version": "2.0.13",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -36,10 +36,10 @@
|
|||
"author": "Budibase",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "2.0.10-alpha.1",
|
||||
"@budibase/pro": "2.0.10-alpha.0",
|
||||
"@budibase/string-templates": "2.0.10-alpha.1",
|
||||
"@budibase/types": "2.0.10-alpha.1",
|
||||
"@budibase/backend-core": "^2.0.13",
|
||||
"@budibase/pro": "2.0.13",
|
||||
"@budibase/string-templates": "^2.0.13",
|
||||
"@budibase/types": "^2.0.13",
|
||||
"@koa/router": "8.0.8",
|
||||
"@sentry/node": "6.17.7",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
|
|
Loading…
Reference in New Issue