Merge branch 'develop' of github.com:Budibase/budibase into refactor/backend-core-import

This commit is contained in:
mike12345567 2022-11-23 10:30:57 +00:00
commit 4fd408defc
21 changed files with 84 additions and 70 deletions

View File

@ -60,8 +60,6 @@ spec:
secretKeyRef: secretKeyRef:
name: {{ template "budibase.fullname" . }} name: {{ template "budibase.fullname" . }}
key: jwtSecret key: jwtSecret
- name: LOG_LEVEL
value: {{ .Values.services.apps.logLevel | default "info" | quote }}
{{ if .Values.services.objectStore.region }} {{ if .Values.services.objectStore.region }}
- name: AWS_REGION - name: AWS_REGION
value: {{ .Values.services.objectStore.region }} value: {{ .Values.services.objectStore.region }}

View File

@ -1,5 +1,5 @@
{ {
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/types": "2.1.32-alpha.5",
"@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",

View File

@ -145,7 +145,9 @@ export const queryView = async <T>(
return docs.length <= 1 ? (docs[0] as T) : (docs as T[]) return docs.length <= 1 ? (docs[0] as T) : (docs as T[])
} }
} catch (err: any) { } catch (err: any) {
if (err != null && err.name === "not_found") { const pouchNotFound = err && err.name === "not_found"
const couchNotFound = err && err.status === 404
if (pouchNotFound || couchNotFound) {
await removeDeprecated(db, viewName) await removeDeprecated(db, viewName)
await createFunc() await createFunc()
return queryView(viewName, params, db, createFunc, opts) return queryView(viewName, params, db, createFunc, opts)

View File

@ -89,6 +89,7 @@ export async function createASession(
userId, userId,
} }
await client.store(key, session, EXPIRY_SECONDS) await client.store(key, session, EXPIRY_SECONDS)
return session
} }
export async function updateSessionTTL(session: Session) { export async function updateSessionTTL(session: Session) {

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": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@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",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -71,10 +71,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "2.1.32-alpha.3", "@budibase/bbui": "2.1.32-alpha.5",
"@budibase/client": "2.1.32-alpha.3", "@budibase/client": "2.1.32-alpha.5",
"@budibase/frontend-core": "2.1.32-alpha.3", "@budibase/frontend-core": "2.1.32-alpha.5",
"@budibase/string-templates": "2.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@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": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/backend-core": "2.1.32-alpha.5",
"@budibase/string-templates": "2.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@budibase/types": "2.1.32-alpha.3", "@budibase/types": "2.1.32-alpha.5",
"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",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/bbui": "2.1.32-alpha.5",
"@budibase/frontend-core": "2.1.32-alpha.3", "@budibase/frontend-core": "2.1.32-alpha.5",
"@budibase/string-templates": "2.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@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",

View File

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/bbui": "2.1.32-alpha.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/sdk", "name": "@budibase/sdk",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"description": "Budibase Public API SDK", "description": "Budibase Public API SDK",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -43,11 +43,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.1.32-alpha.3", "@budibase/backend-core": "2.1.32-alpha.5",
"@budibase/client": "2.1.32-alpha.3", "@budibase/client": "2.1.32-alpha.5",
"@budibase/pro": "2.1.32-alpha.3", "@budibase/pro": "2.1.32-alpha.5",
"@budibase/string-templates": "2.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@budibase/types": "2.1.32-alpha.3", "@budibase/types": "2.1.32-alpha.5",
"@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",

View File

@ -1273,12 +1273,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.1.32-alpha.3": "@budibase/backend-core@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.3.tgz#d65f97f6c147e75aa83cfb4c22a5b3bd568bf62d" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.5.tgz#85d94d85f44c6e9220ce8ce6d7d3e62d15d6bc25"
integrity sha512-CSRn29z64bLEW3GLo6cTwpGjvTgIsfDOBwAiStEOlezzMNlDslvcOBCW0pQUo/0rf5C4zsTy4U1oHDElz7JJ2w== integrity sha512-UV7ng+o7bo+GHAocd3rn6okFsCjf5RfGNs+CRgyB7rW0DZYCTwn1jj71HGYO6eI0FWgkaFYEeiOaNz0BeCssnw==
dependencies: dependencies:
"@budibase/types" "2.1.32-alpha.3" "@budibase/types" "2.1.32-alpha.5"
"@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"
@ -1361,13 +1361,13 @@
svelte-flatpickr "^3.2.3" svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0" svelte-portal "^1.0.0"
"@budibase/pro@2.1.32-alpha.3": "@budibase/pro@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.3.tgz#32d67f5fe3aa6a993022e685f55a298b4fc364b5" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.5.tgz#ca75dcf90d275e1d78a9ab837a763b703963908d"
integrity sha512-FwaWZLI8NVSH3Y4RcSvD1ySJXa5yWFgfGha5Zz5rvy3Tw3oSr/AfH91VW4ZLyzpuBQrMJHxLtDmaz3Ywd/jSkQ== integrity sha512-OwtCJugVYz+V2IaBLITCec6AtQr7HgABLw0dRrS481o/ibyJh+Syooafwx1ijrvfNl4i8YQVuJuzoPYsZHVwqw==
dependencies: dependencies:
"@budibase/backend-core" "2.1.32-alpha.3" "@budibase/backend-core" "2.1.32-alpha.5"
"@budibase/types" "2.1.32-alpha.3" "@budibase/types" "2.1.32-alpha.5"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
@ -1391,10 +1391,10 @@
svelte-apexcharts "^1.0.2" svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0" svelte-flatpickr "^3.1.0"
"@budibase/types@2.1.32-alpha.3": "@budibase/types@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.3.tgz#87d53d7b5730f0067c1526a62f85afb13db82a51" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.5.tgz#08389b921673c0e4cbbbaba41ba92356c186dd0f"
integrity sha512-4MGPfe63IKJMSS+4HdznyjEnExKGk1rMa2sfVOvRAZWzdVhgo5m0UarwoKf49lDF3NPiqTLdXQnB4p7AmwQbbg== integrity sha512-/vbEClKbiNdhDuDjYt5DF2e82u6kFe79BETU8ssaJ4lfI6y2YxMnrLSKB38QfCG/XjijAPMO0THTFoSVgqTQCA==
"@bull-board/api@3.7.0": "@bull-board/api@3.7.0":
version "3.7.0" version "3.7.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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,6 +1,6 @@
{ {
"name": "@budibase/types", "name": "@budibase/types",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"description": "Budibase types", "description": "Budibase types",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -1,4 +1,5 @@
import { BBContext } from "./koa" import { BBContext } from "./koa"
import { Hosting } from "./hosting"
export interface AuthToken { export interface AuthToken {
userId: string userId: string
@ -10,6 +11,7 @@ export interface CreateSession {
sessionId: string sessionId: string
tenantId: string tenantId: string
csrfToken?: string csrfToken?: string
hosting?: Hosting
} }
export interface Session extends CreateSession { export interface Session extends CreateSession {

View File

@ -0,0 +1,7 @@
export enum FeatureFlag {
LICENSING = "LICENSING",
}
export interface TenantFeatureFlags {
[key: string]: FeatureFlag[]
}

View File

@ -10,3 +10,4 @@ export * from "./auth"
export * from "./locks" export * from "./locks"
export * from "./db" export * from "./db"
export * from "./middleware" export * from "./middleware"
export * from "./featureFlag"

View File

@ -1,15 +1,18 @@
import { Context, Request } from "koa" import { Context, Request } from "koa"
import { User, Role, UserRoles } from "../documents" import { User, Role, UserRoles, Account } from "../documents"
import { License } from "../sdk" import { FeatureFlag, License } from "../sdk"
export interface ContextUser extends Omit<User, "roles"> { export interface ContextUser extends Omit<User, "roles"> {
globalId?: string globalId?: string
license: License license?: License
userId?: string userId?: string
roleId?: string | null roleId?: string | null
role?: Role role?: Role
roles?: UserRoles roles?: UserRoles
csrfToken?: string csrfToken?: string
featureFlags?: FeatureFlag[]
accountPortalAccess?: boolean
account?: Account
} }
export interface BBRequest extends Request { export interface BBRequest extends Request {

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.1.32-alpha.3", "version": "2.1.32-alpha.5",
"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.1.32-alpha.3", "@budibase/backend-core": "2.1.32-alpha.5",
"@budibase/pro": "2.1.32-alpha.3", "@budibase/pro": "2.1.32-alpha.5",
"@budibase/string-templates": "2.1.32-alpha.3", "@budibase/string-templates": "2.1.32-alpha.5",
"@budibase/types": "2.1.32-alpha.3", "@budibase/types": "2.1.32-alpha.5",
"@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",

View File

@ -470,12 +470,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.1.32-alpha.3": "@budibase/backend-core@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.3.tgz#d65f97f6c147e75aa83cfb4c22a5b3bd568bf62d" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.5.tgz#85d94d85f44c6e9220ce8ce6d7d3e62d15d6bc25"
integrity sha512-CSRn29z64bLEW3GLo6cTwpGjvTgIsfDOBwAiStEOlezzMNlDslvcOBCW0pQUo/0rf5C4zsTy4U1oHDElz7JJ2w== integrity sha512-UV7ng+o7bo+GHAocd3rn6okFsCjf5RfGNs+CRgyB7rW0DZYCTwn1jj71HGYO6eI0FWgkaFYEeiOaNz0BeCssnw==
dependencies: dependencies:
"@budibase/types" "2.1.32-alpha.3" "@budibase/types" "2.1.32-alpha.5"
"@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"
@ -508,22 +508,22 @@
uuid "8.3.2" uuid "8.3.2"
zlib "1.0.5" zlib "1.0.5"
"@budibase/pro@2.1.32-alpha.3": "@budibase/pro@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.3.tgz#32d67f5fe3aa6a993022e685f55a298b4fc364b5" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.5.tgz#ca75dcf90d275e1d78a9ab837a763b703963908d"
integrity sha512-FwaWZLI8NVSH3Y4RcSvD1ySJXa5yWFgfGha5Zz5rvy3Tw3oSr/AfH91VW4ZLyzpuBQrMJHxLtDmaz3Ywd/jSkQ== integrity sha512-OwtCJugVYz+V2IaBLITCec6AtQr7HgABLw0dRrS481o/ibyJh+Syooafwx1ijrvfNl4i8YQVuJuzoPYsZHVwqw==
dependencies: dependencies:
"@budibase/backend-core" "2.1.32-alpha.3" "@budibase/backend-core" "2.1.32-alpha.5"
"@budibase/types" "2.1.32-alpha.3" "@budibase/types" "2.1.32-alpha.5"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
node-fetch "^2.6.1" node-fetch "^2.6.1"
"@budibase/types@2.1.32-alpha.3": "@budibase/types@2.1.32-alpha.5":
version "2.1.32-alpha.3" version "2.1.32-alpha.5"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.3.tgz#87d53d7b5730f0067c1526a62f85afb13db82a51" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.5.tgz#08389b921673c0e4cbbbaba41ba92356c186dd0f"
integrity sha512-4MGPfe63IKJMSS+4HdznyjEnExKGk1rMa2sfVOvRAZWzdVhgo5m0UarwoKf49lDF3NPiqTLdXQnB4p7AmwQbbg== integrity sha512-/vbEClKbiNdhDuDjYt5DF2e82u6kFe79BETU8ssaJ4lfI6y2YxMnrLSKB38QfCG/XjijAPMO0THTFoSVgqTQCA==
"@cspotcode/source-map-support@^0.8.0": "@cspotcode/source-map-support@^0.8.0":
version "0.8.1" version "0.8.1"