Merge branch 'master' into bug/sev3/edit-column-modal-state
This commit is contained in:
commit
91ec23faf2
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "^2.0.22",
|
"@budibase/types": "^2.0.29",
|
||||||
"@shopify/jest-koa-mocks": "5.0.1",
|
"@shopify/jest-koa-mocks": "5.0.1",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
"aws-sdk": "2.1030.0",
|
"aws-sdk": "2.1030.0",
|
||||||
|
|
|
@ -214,6 +214,34 @@ export = class RedisWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async bulkGet(keys: string[]) {
|
||||||
|
const db = this._db
|
||||||
|
if (keys.length === 0) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
const prefixedKeys = keys.map(key => addDbPrefix(db, key))
|
||||||
|
let response = await this.getClient().mget(prefixedKeys)
|
||||||
|
if (Array.isArray(response)) {
|
||||||
|
let final: any = {}
|
||||||
|
let count = 0
|
||||||
|
for (let result of response) {
|
||||||
|
if (result) {
|
||||||
|
let parsed
|
||||||
|
try {
|
||||||
|
parsed = JSON.parse(result)
|
||||||
|
} catch (err) {
|
||||||
|
parsed = result
|
||||||
|
}
|
||||||
|
final[keys[count]] = parsed
|
||||||
|
}
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
return final
|
||||||
|
} else {
|
||||||
|
throw new Error(`Invalid response: ${response}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async store(key: string, value: any, expirySeconds: number | null = null) {
|
async store(key: string, value: any, expirySeconds: number | null = null) {
|
||||||
const db = this._db
|
const db = this._db
|
||||||
if (typeof value === "object") {
|
if (typeof value === "object") {
|
||||||
|
|
|
@ -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": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@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": "2.0.22",
|
"version": "2.0.29",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -71,10 +71,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^2.0.22",
|
"@budibase/bbui": "^2.0.29",
|
||||||
"@budibase/client": "^2.0.22",
|
"@budibase/client": "^2.0.29",
|
||||||
"@budibase/frontend-core": "^2.0.22",
|
"@budibase/frontend-core": "^2.0.29",
|
||||||
"@budibase/string-templates": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@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",
|
||||||
|
|
|
@ -17,12 +17,21 @@
|
||||||
$: selectedRoleId = selectedRole._id
|
$: selectedRoleId = selectedRole._id
|
||||||
$: otherRoles = editableRoles.filter(role => role._id !== selectedRoleId)
|
$: otherRoles = editableRoles.filter(role => role._id !== selectedRoleId)
|
||||||
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
||||||
|
|
||||||
|
$: hasUniqueRoleName = !otherRoles
|
||||||
|
?.map(role => role.name)
|
||||||
|
?.includes(selectedRole.name)
|
||||||
|
|
||||||
$: valid =
|
$: valid =
|
||||||
selectedRole.name &&
|
selectedRole.name &&
|
||||||
selectedRole.inherits &&
|
selectedRole.inherits &&
|
||||||
selectedRole.permissionId &&
|
selectedRole.permissionId &&
|
||||||
!builtInRoles.includes(selectedRole.name)
|
!builtInRoles.includes(selectedRole.name)
|
||||||
|
|
||||||
|
$: shouldDisableRoleInput =
|
||||||
|
builtInRoles.includes(selectedRole.name) &&
|
||||||
|
selectedRole.name?.toLowerCase() === selectedRoleId?.toLowerCase()
|
||||||
|
|
||||||
const fetchBasePermissions = async () => {
|
const fetchBasePermissions = async () => {
|
||||||
try {
|
try {
|
||||||
basePermissions = await API.getBasePermissions()
|
basePermissions = await API.getBasePermissions()
|
||||||
|
@ -99,7 +108,7 @@
|
||||||
title="Edit Roles"
|
title="Edit Roles"
|
||||||
confirmText={isCreating ? "Create" : "Save"}
|
confirmText={isCreating ? "Create" : "Save"}
|
||||||
onConfirm={saveRole}
|
onConfirm={saveRole}
|
||||||
disabled={!valid}
|
disabled={!valid || !hasUniqueRoleName}
|
||||||
>
|
>
|
||||||
{#if errors.length}
|
{#if errors.length}
|
||||||
<ErrorsBox {errors} />
|
<ErrorsBox {errors} />
|
||||||
|
@ -119,15 +128,16 @@
|
||||||
<Input
|
<Input
|
||||||
label="Name"
|
label="Name"
|
||||||
bind:value={selectedRole.name}
|
bind:value={selectedRole.name}
|
||||||
disabled={builtInRoles.includes(selectedRole.name)}
|
disabled={shouldDisableRoleInput}
|
||||||
|
error={!hasUniqueRoleName ? "Select a unique role name." : null}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
label="Inherits Role"
|
label="Inherits Role"
|
||||||
bind:value={selectedRole.inherits}
|
bind:value={selectedRole.inherits}
|
||||||
options={otherRoles}
|
options={selectedRole._id === "BASIC" ? $roles : otherRoles}
|
||||||
getOptionValue={role => role._id}
|
getOptionValue={role => role._id}
|
||||||
getOptionLabel={role => role.name}
|
getOptionLabel={role => role.name}
|
||||||
disabled={builtInRoles.includes(selectedRole.name)}
|
disabled={shouldDisableRoleInput}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
label="Base Permissions"
|
label="Base Permissions"
|
||||||
|
@ -135,11 +145,11 @@
|
||||||
options={basePermissions}
|
options={basePermissions}
|
||||||
getOptionValue={x => x._id}
|
getOptionValue={x => x._id}
|
||||||
getOptionLabel={x => x.name}
|
getOptionLabel={x => x.name}
|
||||||
disabled={builtInRoles.includes(selectedRole.name)}
|
disabled={shouldDisableRoleInput}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
{#if !isCreating}
|
{#if !isCreating && !builtInRoles.includes(selectedRole.name)}
|
||||||
<Button warning on:click={deleteRole}>Delete</Button>
|
<Button warning on:click={deleteRole}>Delete</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -209,27 +209,29 @@
|
||||||
{:else}
|
{:else}
|
||||||
<Body size="S"><i>No tables found.</i></Body>
|
<Body size="S"><i>No tables found.</i></Body>
|
||||||
{/if}
|
{/if}
|
||||||
<Divider />
|
{#if integration.relationships !== false}
|
||||||
<div class="query-header">
|
<Divider />
|
||||||
<Heading size="S">Relationships</Heading>
|
<div class="query-header">
|
||||||
<Button primary on:click={() => openRelationshipModal()}>
|
<Heading size="S">Relationships</Heading>
|
||||||
Define relationship
|
<Button primary on:click={() => openRelationshipModal()}>
|
||||||
</Button>
|
Define relationship
|
||||||
</div>
|
</Button>
|
||||||
<Body>
|
</div>
|
||||||
Tell budibase how your tables are related to get even more smart features.
|
<Body>
|
||||||
</Body>
|
Tell budibase how your tables are related to get even more smart features.
|
||||||
{#if relationshipInfo && relationshipInfo.length > 0}
|
</Body>
|
||||||
<Table
|
{#if relationshipInfo && relationshipInfo.length > 0}
|
||||||
on:click={({ detail }) => openRelationshipModal(detail.from, detail.to)}
|
<Table
|
||||||
schema={relationshipSchema}
|
on:click={({ detail }) => openRelationshipModal(detail.from, detail.to)}
|
||||||
data={relationshipInfo}
|
schema={relationshipSchema}
|
||||||
allowEditColumns={false}
|
data={relationshipInfo}
|
||||||
allowEditRows={false}
|
allowEditColumns={false}
|
||||||
allowSelectRows={false}
|
allowEditRows={false}
|
||||||
/>
|
allowSelectRows={false}
|
||||||
{:else}
|
/>
|
||||||
<Body size="S"><i>No relationships configured.</i></Body>
|
{:else}
|
||||||
|
<Body size="S"><i>No relationships configured.</i></Body>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -156,8 +156,8 @@
|
||||||
page={$usersFetch.pageNumber + 1}
|
page={$usersFetch.pageNumber + 1}
|
||||||
hasPrevPage={$usersFetch.hasPrevPage}
|
hasPrevPage={$usersFetch.hasPrevPage}
|
||||||
hasNextPage={$usersFetch.hasNextPage}
|
hasNextPage={$usersFetch.hasNextPage}
|
||||||
goToPrevPage={$usersFetch.loading ? null : fetch.prevPage}
|
goToPrevPage={$usersFetch.loading ? null : usersFetch.prevPage}
|
||||||
goToNextPage={$usersFetch.loading ? null : fetch.nextPage}
|
goToNextPage={$usersFetch.loading ? null : usersFetch.nextPage}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": {
|
||||||
|
@ -26,9 +26,9 @@
|
||||||
"outputPath": "build"
|
"outputPath": "build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "^2.0.22",
|
"@budibase/backend-core": "^2.0.29",
|
||||||
"@budibase/string-templates": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@budibase/types": "^2.0.22",
|
"@budibase/types": "^2.0.29",
|
||||||
"axios": "0.21.2",
|
"axios": "0.21.2",
|
||||||
"chalk": "4.1.0",
|
"chalk": "4.1.0",
|
||||||
"cli-progress": "3.11.2",
|
"cli-progress": "3.11.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "^2.0.22",
|
"@budibase/bbui": "^2.0.29",
|
||||||
"@budibase/frontend-core": "^2.0.22",
|
"@budibase/frontend-core": "^2.0.29",
|
||||||
"@budibase/string-templates": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@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",
|
||||||
|
|
|
@ -47,6 +47,9 @@ const createBuilderStore = () => {
|
||||||
duplicateComponent: id => {
|
duplicateComponent: id => {
|
||||||
dispatchEvent("duplicate-component", { id })
|
dispatchEvent("duplicate-component", { id })
|
||||||
},
|
},
|
||||||
|
deleteComponent: id => {
|
||||||
|
dispatchEvent("delete-component", { id })
|
||||||
|
},
|
||||||
notifyLoaded: () => {
|
notifyLoaded: () => {
|
||||||
dispatchEvent("preview-loaded")
|
dispatchEvent("preview-loaded")
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "^2.0.22",
|
"@budibase/bbui": "^2.0.29",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/sdk",
|
"name": "@budibase/sdk",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"description": "Budibase Public API SDK",
|
"description": "Budibase Public API SDK",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "^2.0.22",
|
"@budibase/backend-core": "^2.0.29",
|
||||||
"@budibase/client": "^2.0.22",
|
"@budibase/client": "^2.0.29",
|
||||||
"@budibase/pro": "2.0.22",
|
"@budibase/pro": "2.0.29",
|
||||||
"@budibase/string-templates": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@budibase/types": "^2.0.22",
|
"@budibase/types": "^2.0.29",
|
||||||
"@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",
|
||||||
|
|
|
@ -32,7 +32,7 @@ const {
|
||||||
import { USERS_TABLE_SCHEMA } from "../../constants"
|
import { USERS_TABLE_SCHEMA } from "../../constants"
|
||||||
import { removeAppFromUserRoles } from "../../utilities/workerRequests"
|
import { removeAppFromUserRoles } from "../../utilities/workerRequests"
|
||||||
import { clientLibraryPath, stringToReadStream } from "../../utilities"
|
import { clientLibraryPath, stringToReadStream } from "../../utilities"
|
||||||
import { getAllLocks } from "../../utilities/redis"
|
import { getLocksById } from "../../utilities/redis"
|
||||||
import {
|
import {
|
||||||
updateClientLibrary,
|
updateClientLibrary,
|
||||||
backupClientLibrary,
|
backupClientLibrary,
|
||||||
|
@ -45,11 +45,10 @@ import { cleanupAutomations } from "../../automations/utils"
|
||||||
import { context } from "@budibase/backend-core"
|
import { context } from "@budibase/backend-core"
|
||||||
import { checkAppMetadata } from "../../automations/logging"
|
import { checkAppMetadata } from "../../automations/logging"
|
||||||
import { getUniqueRows } from "../../utilities/usageQuota/rows"
|
import { getUniqueRows } from "../../utilities/usageQuota/rows"
|
||||||
import { quotas } from "@budibase/pro"
|
import { quotas, groups } from "@budibase/pro"
|
||||||
import { errors, events, migrations } from "@budibase/backend-core"
|
import { errors, events, migrations } from "@budibase/backend-core"
|
||||||
import { App, Layout, Screen, MigrationType } from "@budibase/types"
|
import { App, Layout, Screen, MigrationType } from "@budibase/types"
|
||||||
import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
|
import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
|
||||||
import { groups } from "@budibase/pro"
|
|
||||||
import { enrichPluginURLs } from "../../utilities/plugins"
|
import { enrichPluginURLs } from "../../utilities/plugins"
|
||||||
|
|
||||||
const URL_REGEX_SLASH = /\/|\\/g
|
const URL_REGEX_SLASH = /\/|\\/g
|
||||||
|
@ -172,16 +171,16 @@ export const fetch = async (ctx: any) => {
|
||||||
const all = ctx.query && ctx.query.status === AppStatus.ALL
|
const all = ctx.query && ctx.query.status === AppStatus.ALL
|
||||||
const apps = await getAllApps({ dev, all })
|
const apps = await getAllApps({ dev, all })
|
||||||
|
|
||||||
|
const appIds = apps
|
||||||
|
.filter((app: any) => app.status === "development")
|
||||||
|
.map((app: any) => app.appId)
|
||||||
// get the locks for all the dev apps
|
// get the locks for all the dev apps
|
||||||
if (dev || all) {
|
if (dev || all) {
|
||||||
const locks = await getAllLocks()
|
const locks = await getLocksById(appIds)
|
||||||
for (let app of apps) {
|
for (let app of apps) {
|
||||||
if (app.status !== "development") {
|
const lock = locks[app.appId]
|
||||||
continue
|
|
||||||
}
|
|
||||||
const lock = locks.find((lock: any) => lock.appId === app.appId)
|
|
||||||
if (lock) {
|
if (lock) {
|
||||||
app.lockedBy = lock.user
|
app.lockedBy = lock
|
||||||
} else {
|
} else {
|
||||||
// make sure its definitely not present
|
// make sure its definitely not present
|
||||||
delete app.lockedBy
|
delete app.lockedBy
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
const { getDefinitions } = require("../../integrations")
|
const { getDefinitions } = require("../../integrations")
|
||||||
const { SourceName } = require("@budibase/types")
|
|
||||||
const googlesheets = require("../../integrations/googlesheets")
|
|
||||||
const { featureFlags } = require("@budibase/backend-core")
|
|
||||||
|
|
||||||
exports.fetch = async function (ctx) {
|
exports.fetch = async function (ctx) {
|
||||||
ctx.status = 200
|
ctx.status = 200
|
||||||
const defs = await getDefinitions()
|
const defs = await getDefinitions()
|
||||||
|
|
||||||
// for google sheets integration google verification
|
|
||||||
if (featureFlags.isEnabled(featureFlags.TenantFeatureFlag.GOOGLE_SHEETS)) {
|
|
||||||
defs[SourceName.GOOGLE_SHEETS] = googlesheets.schema
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.body = defs
|
ctx.body = defs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
jest.mock("../../../utilities/redis", () => ({
|
jest.mock("../../../utilities/redis", () => ({
|
||||||
init: jest.fn(),
|
init: jest.fn(),
|
||||||
getAllLocks: () => {
|
getLocksById: () => {
|
||||||
return []
|
return {}
|
||||||
},
|
},
|
||||||
doesUserHaveLock: () => {
|
doesUserHaveLock: () => {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -33,6 +33,7 @@ const DEFINITIONS: { [key: string]: Integration } = {
|
||||||
[SourceName.ARANGODB]: arangodb.schema,
|
[SourceName.ARANGODB]: arangodb.schema,
|
||||||
[SourceName.REST]: rest.schema,
|
[SourceName.REST]: rest.schema,
|
||||||
[SourceName.FIRESTORE]: firebase.schema,
|
[SourceName.FIRESTORE]: firebase.schema,
|
||||||
|
[SourceName.GOOGLE_SHEETS]: googlesheets.schema,
|
||||||
[SourceName.REDIS]: redis.schema,
|
[SourceName.REDIS]: redis.schema,
|
||||||
[SourceName.SNOWFLAKE]: snowflake.schema,
|
[SourceName.SNOWFLAKE]: snowflake.schema,
|
||||||
}
|
}
|
||||||
|
@ -66,10 +67,6 @@ if (
|
||||||
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
|
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment.SELF_HOSTED) {
|
|
||||||
DEFINITIONS[SourceName.GOOGLE_SHEETS] = googlesheets.schema
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
getDefinitions: async () => {
|
getDefinitions: async () => {
|
||||||
const pluginSchemas: { [key: string]: Integration } = {}
|
const pluginSchemas: { [key: string]: Integration } = {}
|
||||||
|
|
|
@ -34,12 +34,8 @@ exports.doesUserHaveLock = async (devAppId, user) => {
|
||||||
return expected === userId
|
return expected === userId
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getAllLocks = async () => {
|
exports.getLocksById = async appIds => {
|
||||||
const locks = await devAppClient.scan()
|
return await devAppClient.bulkGet(appIds)
|
||||||
return locks.map(lock => ({
|
|
||||||
appId: lock.key,
|
|
||||||
user: lock.value,
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.updateLock = async (devAppId, user) => {
|
exports.updateLock = async (devAppId, user) => {
|
||||||
|
|
|
@ -7,14 +7,17 @@ const { BUILTIN_ROLE_IDS } = require("@budibase/backend-core/roles")
|
||||||
exports.getFullUser = async (ctx, userId) => {
|
exports.getFullUser = async (ctx, userId) => {
|
||||||
const global = await getGlobalUser(userId)
|
const global = await getGlobalUser(userId)
|
||||||
let metadata = {}
|
let metadata = {}
|
||||||
|
|
||||||
|
// always prefer the user metadata _id and _rev
|
||||||
|
delete global._id
|
||||||
|
delete global._rev
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// this will throw an error if the db doesn't exist, or there is no appId
|
// this will throw an error if the db doesn't exist, or there is no appId
|
||||||
const db = getAppDB()
|
const db = getAppDB()
|
||||||
metadata = await db.get(userId)
|
metadata = await db.get(userId)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// it is fine if there is no user metadata, just remove global db info
|
// it is fine if there is no user metadata yet
|
||||||
delete global._id
|
|
||||||
delete global._rev
|
|
||||||
}
|
}
|
||||||
delete metadata.csrfToken
|
delete metadata.csrfToken
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1094,12 +1094,12 @@
|
||||||
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/backend-core@2.0.22":
|
"@budibase/backend-core@2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.22.tgz#857c6928c08e1a0307afac4e605e360f3ce91c97"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.29.tgz#d5856d49d8cc64790961631dfe0fface7f7be4e4"
|
||||||
integrity sha512-X6n/UdOR+AnBVfmLy7YUT1uDGy8VPEz5em0jjVRPflxnJcZ5x59YXLBTROkK6PqWsgqheCkrP1Jev7rxCVCTow==
|
integrity sha512-05mnl6YcucWrO1X6bVBYG6r7Yig/fIHbokLRfEvFFrZNe/EcRB3iLeOG1+2190dv5TbO/jhabS3kcrbDs54HHw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "^2.0.22"
|
"@budibase/types" "^2.0.29"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -1180,13 +1180,13 @@
|
||||||
svelte-flatpickr "^3.2.3"
|
svelte-flatpickr "^3.2.3"
|
||||||
svelte-portal "^1.0.0"
|
svelte-portal "^1.0.0"
|
||||||
|
|
||||||
"@budibase/pro@2.0.22":
|
"@budibase/pro@2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.22.tgz#950c541a4eb858ca41e31e691bcbd388cc2523d6"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.29.tgz#169055bc39894f90341226fbff4a1601418d0b42"
|
||||||
integrity sha512-4GepvO+fjuAyKH/e6m751x/UMCOPBIx+OXZ63AS8NfHvXYhxPxODsYC+rK0zuDvYEmtVNJnTYSLLmiYKXfSShw==
|
integrity sha512-ELBoQ7/MXlgatCJNvTNXgF7DK02pfYx5Yy1s/2BJr4iGe26+5Q65ztiC7Jp+d/owese+f5kqKJRNuU1KINUfjQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.0.22"
|
"@budibase/backend-core" "2.0.29"
|
||||||
"@budibase/types" "2.0.22"
|
"@budibase/types" "2.0.29"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
@ -1209,10 +1209,10 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
"@budibase/types@2.0.22", "@budibase/types@^2.0.22":
|
"@budibase/types@2.0.29", "@budibase/types@^2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.22.tgz#c17d518294f1d53ad3251e659b5bd689f50914b0"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.29.tgz#8b27f695aded7ad7523c4943deb556eadfb66c3c"
|
||||||
integrity sha512-qtNFWYbbdGQzmelkBO/22Xc1nug7m8C5D+ugwItV6J+qYJqcFAUPxjfTILYfICDDGiF3g9waA6+Y/JnFn9ujZg==
|
integrity sha512-wwpHgDwKff2UhNmKAdrzIxmDQ/crY77AZdFyWNpPvrHYIetyh2Kp5ikEKyZlYHTEpS2IPDE8EKn4coDeu+mGlQ==
|
||||||
|
|
||||||
"@bull-board/api@3.7.0":
|
"@bull-board/api@3.7.0":
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "2.0.22",
|
"version": "2.0.29",
|
||||||
"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": "2.0.22",
|
"version": "2.0.29",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "^2.0.22",
|
"@budibase/backend-core": "^2.0.29",
|
||||||
"@budibase/pro": "2.0.22",
|
"@budibase/pro": "2.0.29",
|
||||||
"@budibase/string-templates": "^2.0.22",
|
"@budibase/string-templates": "^2.0.29",
|
||||||
"@budibase/types": "^2.0.22",
|
"@budibase/types": "^2.0.29",
|
||||||
"@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",
|
||||||
|
|
|
@ -291,12 +291,12 @@
|
||||||
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/backend-core@2.0.22":
|
"@budibase/backend-core@2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.22.tgz#857c6928c08e1a0307afac4e605e360f3ce91c97"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.29.tgz#d5856d49d8cc64790961631dfe0fface7f7be4e4"
|
||||||
integrity sha512-X6n/UdOR+AnBVfmLy7YUT1uDGy8VPEz5em0jjVRPflxnJcZ5x59YXLBTROkK6PqWsgqheCkrP1Jev7rxCVCTow==
|
integrity sha512-05mnl6YcucWrO1X6bVBYG6r7Yig/fIHbokLRfEvFFrZNe/EcRB3iLeOG1+2190dv5TbO/jhabS3kcrbDs54HHw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "^2.0.22"
|
"@budibase/types" "^2.0.29"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -327,21 +327,21 @@
|
||||||
uuid "8.3.2"
|
uuid "8.3.2"
|
||||||
zlib "1.0.5"
|
zlib "1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@2.0.22":
|
"@budibase/pro@2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.22.tgz#950c541a4eb858ca41e31e691bcbd388cc2523d6"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.29.tgz#169055bc39894f90341226fbff4a1601418d0b42"
|
||||||
integrity sha512-4GepvO+fjuAyKH/e6m751x/UMCOPBIx+OXZ63AS8NfHvXYhxPxODsYC+rK0zuDvYEmtVNJnTYSLLmiYKXfSShw==
|
integrity sha512-ELBoQ7/MXlgatCJNvTNXgF7DK02pfYx5Yy1s/2BJr4iGe26+5Q65ztiC7Jp+d/owese+f5kqKJRNuU1KINUfjQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.0.22"
|
"@budibase/backend-core" "2.0.29"
|
||||||
"@budibase/types" "2.0.22"
|
"@budibase/types" "2.0.29"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/types@2.0.22", "@budibase/types@^2.0.22":
|
"@budibase/types@2.0.29", "@budibase/types@^2.0.29":
|
||||||
version "2.0.22"
|
version "2.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.22.tgz#c17d518294f1d53ad3251e659b5bd689f50914b0"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.29.tgz#8b27f695aded7ad7523c4943deb556eadfb66c3c"
|
||||||
integrity sha512-qtNFWYbbdGQzmelkBO/22Xc1nug7m8C5D+ugwItV6J+qYJqcFAUPxjfTILYfICDDGiF3g9waA6+Y/JnFn9ujZg==
|
integrity sha512-wwpHgDwKff2UhNmKAdrzIxmDQ/crY77AZdFyWNpPvrHYIetyh2Kp5ikEKyZlYHTEpS2IPDE8EKn4coDeu+mGlQ==
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
|
|
Loading…
Reference in New Issue