1
0
Fork 0
mirror of synced 2024-07-02 21:10:43 +12:00

Merge remote-tracking branch 'origin/develop' into feature/whitelabelling

This commit is contained in:
Dean 2023-03-16 09:07:58 +00:00
commit ce33afdeae
32 changed files with 195 additions and 3180 deletions

View file

@ -232,6 +232,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
{{ if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}

View file

@ -50,5 +50,8 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
status: {}
{{- end }}

View file

@ -72,6 +72,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
{{ if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}

View file

@ -78,6 +78,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
{{ if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}

View file

@ -50,6 +50,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
{{ if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}

View file

@ -222,6 +222,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{ end }}
{{ if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -24,7 +24,7 @@
"dependencies": {
"@budibase/nano": "10.1.2",
"@budibase/pouchdb-replication-stream": "1.2.10",
"@budibase/types": "^2.4.26",
"@budibase/types": "2.4.27-alpha.3",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-cloudfront-sign": "2.2.0",

View file

@ -1,10 +0,0 @@
export class BudibaseError extends Error {
code: string
type: string
constructor(message: string, code: string, type: string) {
super(message)
this.code = code
this.type = type
}
}

View file

@ -1,37 +1,87 @@
import * as licensing from "./licensing"
// BASE
// combine all error codes into single object
export abstract class BudibaseError extends Error {
code: string
export const codes = {
...licensing.codes,
constructor(message: string, code: ErrorCode) {
super(message)
this.code = code
}
protected getPublicError?(): any
}
// combine all error types
export const types = [licensing.type]
// ERROR HANDLING
// combine all error contexts
const context = {
...licensing.context,
export enum ErrorCode {
USAGE_LIMIT_EXCEEDED = "usage_limit_exceeded",
FEATURE_DISABLED = "feature_disabled",
HTTP = "http",
}
// derive a public error message using codes, types and any custom contexts
/**
* For the given error, build the public representation that is safe
* to be exposed over an api.
*/
export const getPublicError = (err: any) => {
let error
if (err.code || err.type) {
if (err.code) {
// add generic error information
error = {
code: err.code,
type: err.type,
}
if (err.code && context[err.code]) {
if (err.getPublicError) {
error = {
...error,
// get any additional context from this error
...context[err.code](err),
...err.getPublicError(),
}
}
}
return error
}
// HTTP
export class HTTPError extends BudibaseError {
status: number
constructor(message: string, httpStatus: number, code = ErrorCode.HTTP) {
super(message, code)
this.status = httpStatus
}
}
// LICENSING
export class UsageLimitError extends HTTPError {
limitName: string
constructor(message: string, limitName: string) {
super(message, 400, ErrorCode.USAGE_LIMIT_EXCEEDED)
this.limitName = limitName
}
getPublicError() {
return {
limitName: this.limitName,
}
}
}
export class FeatureDisabledError extends HTTPError {
featureName: string
constructor(message: string, featureName: string) {
super(message, 400, ErrorCode.FEATURE_DISABLED)
this.featureName = featureName
}
getPublicError() {
return {
featureName: this.featureName,
}
}
}

View file

@ -1,7 +0,0 @@
import { BudibaseError } from "./base"
export class GenericError extends BudibaseError {
constructor(message: string, code: string, type: string) {
super(message, code, type ? type : "generic")
}
}

View file

@ -1,15 +0,0 @@
import { GenericError } from "./generic"
export class HTTPError extends GenericError {
status: number
constructor(
message: string,
httpStatus: number,
code = "http",
type = "generic"
) {
super(message, code, type)
this.status = httpStatus
}
}

View file

@ -1,3 +1 @@
export * from "./errors"
export { UsageLimitError, FeatureDisabledError } from "./licensing"
export { HTTPError } from "./http"

View file

@ -1,39 +0,0 @@
import { HTTPError } from "./http"
export const type = "license_error"
export const codes = {
USAGE_LIMIT_EXCEEDED: "usage_limit_exceeded",
FEATURE_DISABLED: "feature_disabled",
}
export const context = {
[codes.USAGE_LIMIT_EXCEEDED]: (err: any) => {
return {
limitName: err.limitName,
}
},
[codes.FEATURE_DISABLED]: (err: any) => {
return {
featureName: err.featureName,
}
},
}
export class UsageLimitError extends HTTPError {
limitName: string
constructor(message: string, limitName: string) {
super(message, 400, codes.USAGE_LIMIT_EXCEEDED, type)
this.limitName = limitName
}
}
export class FeatureDisabledError extends HTTPError {
featureName: string
constructor(message: string, featureName: string) {
super(message, 400, codes.FEATURE_DISABLED, type)
this.featureName = featureName
}
}

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,8 +38,8 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "1.2.1",
"@budibase/shared-core": "^2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/shared-core": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@spectrum-css/accordion": "3.0.24",
"@spectrum-css/actionbutton": "1.0.1",
"@spectrum-css/actiongroup": "1.0.1",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -58,11 +58,11 @@
}
},
"dependencies": {
"@budibase/bbui": "^2.4.26",
"@budibase/client": "^2.4.26",
"@budibase/frontend-core": "^2.4.26",
"@budibase/shared-core": "^2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/bbui": "2.4.27-alpha.3",
"@budibase/client": "2.4.27-alpha.3",
"@budibase/frontend-core": "2.4.27-alpha.3",
"@budibase/shared-core": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "dist/index.js",
"bin": {
@ -29,9 +29,9 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "^2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/types": "^2.4.26",
"@budibase/backend-core": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@budibase/types": "2.4.27-alpha.3",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,11 +19,11 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "^2.4.26",
"@budibase/frontend-core": "^2.4.26",
"@budibase/shared-core": "^2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/types": "^2.4.26",
"@budibase/bbui": "2.4.27-alpha.3",
"@budibase/frontend-core": "2.4.27-alpha.3",
"@budibase/shared-core": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@budibase/types": "2.4.27-alpha.3",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View file

@ -1,13 +1,13 @@
{
"name": "@budibase/frontend-core",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "^2.4.26",
"@budibase/shared-core": "^2.4.26",
"@budibase/bbui": "2.4.27-alpha.3",
"@budibase/shared-core": "2.4.27-alpha.3",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View file

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

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -43,12 +43,12 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "^2.4.26",
"@budibase/client": "^2.4.26",
"@budibase/pro": "2.4.26",
"@budibase/shared-core": "^2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/types": "^2.4.26",
"@budibase/backend-core": "2.4.27-alpha.3",
"@budibase/client": "2.4.27-alpha.3",
"@budibase/pro": "2.4.27-alpha.3",
"@budibase/shared-core": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@budibase/types": "2.4.27-alpha.3",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View file

@ -20,10 +20,10 @@ import {
cache,
tenancy,
context,
errors,
events,
migrations,
objectStore,
ErrorCode,
} from "@budibase/backend-core"
import { USERS_TABLE_SCHEMA } from "../../constants"
import { buildDefaultDocs } from "../../db/defaultData/datasource_bb_default"
@ -378,7 +378,7 @@ async function appPostCreate(ctx: BBContext, app: App) {
return quotas.addRows(rowCount)
})
} catch (err: any) {
if (err.code && err.code === errors.codes.USAGE_LIMIT_EXCEEDED) {
if (err.code && err.code === ErrorCode.USAGE_LIMIT_EXCEEDED) {
// this import resulted in row usage exceeding the quota
// delete the app
// skip pre and post-steps as no rows have been added to quotas yet

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/shared-core",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Shared data utils",
"main": "dist/cjs/src/index.js",
"types": "dist/mjs/src/index.d.ts",
@ -20,7 +20,7 @@
"dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\""
},
"dependencies": {
"@budibase/types": "^2.4.26"
"@budibase/types": "2.4.27-alpha.3"
},
"devDependencies": {
"concurrently": "^7.6.0",

View file

@ -2,11 +2,6 @@
# yarn lockfile v1
"@budibase/types@2.4.5-alpha.0":
version "2.4.5-alpha.0"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.5-alpha.0.tgz#70fea09b5e471fe8fa6a760a1a2dd0dd74caac3a"
integrity sha512-tVFM9XnKwcCOo7nw6v7C8ZsK9hQLQBv3kHDn7/MFWnDMFCj72pUdtP/iFrAKr2c3tE84lkkWJfNHIolMSktHZA==
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase types",
"main": "dist/cjs/index.js",
"types": "dist/mjs/index.d.ts",

View file

@ -81,10 +81,12 @@ export const isSSOAccount = (account: Account): account is SSOAccount =>
export enum AccountSSOProviderType {
GOOGLE = "google",
MICROSOFT = "microsoft",
}
export enum AccountSSOProvider {
GOOGLE = "google",
MICROSOFT = "microsoft",
}
export interface AccountSSO {

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "2.4.26",
"version": "2.4.27-alpha.3",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "^2.4.26",
"@budibase/pro": "2.4.26",
"@budibase/string-templates": "^2.4.26",
"@budibase/types": "^2.4.26",
"@budibase/backend-core": "2.4.27-alpha.3",
"@budibase/pro": "2.4.27-alpha.3",
"@budibase/string-templates": "2.4.27-alpha.3",
"@budibase/types": "2.4.27-alpha.3",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View file

@ -3,7 +3,6 @@ import {
getInviteCodes,
updateInviteCode,
} from "../../../utilities/redis"
// import sdk from "../../../sdk"
import * as userSdk from "../../../sdk/users"
import env from "../../../environment"
import {
@ -26,11 +25,11 @@ import {
import {
accounts,
cache,
errors,
events,
migrations,
tenancy,
platform,
ErrorCode,
} from "@budibase/backend-core"
import { checkAnyUserExists } from "../../../utilities/users"
import { isEmailConfigured } from "../../../utilities/email"
@ -421,7 +420,7 @@ export const inviteAccept = async (
email: user.email,
}
} catch (err: any) {
if (err.code === errors.codes.USAGE_LIMIT_EXCEEDED) {
if (err.code === ErrorCode.USAGE_LIMIT_EXCEEDED) {
// explicitly re-throw limit exceeded errors
ctx.throw(400, err)
}

View file

@ -475,14 +475,14 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.4.26":
version "2.4.26"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.26.tgz#ae9679f20e86ce1706d6d549aed78a342365a4b4"
integrity sha512-9QYJbAT9WPiOckBIR6a/CoqqbUiP9vlmc/Iy5TR5Yj2wy1JnWsf09ReTuL3CsHmh+8bCJlUHZZC4m6PUMg7+ow==
"@budibase/backend-core@2.4.27-alpha.3":
version "2.4.27-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.27-alpha.3.tgz#c067bf894f90e0f86c85bc4cc711c76974a32be3"
integrity sha512-m8m/lJAB2y36MCE72tRH6O4nAQaECg+9n1W4ozAqtfMWW6JqGLvd4Naxd+LEgO8OOw/vLvzWLbFtek3MasgXCg==
dependencies:
"@budibase/nano" "10.1.2"
"@budibase/pouchdb-replication-stream" "1.2.10"
"@budibase/types" "^2.4.26"
"@budibase/types" "2.4.27-alpha.3"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-cloudfront-sign "2.2.0"
@ -564,14 +564,14 @@
pouchdb-promise "^6.0.4"
through2 "^2.0.0"
"@budibase/pro@2.4.26":
version "2.4.26"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.26.tgz#37ca2b94f5dfc28ee4ff0ffa088e29112de5b66f"
integrity sha512-PXpsj5DFnUaSlp3AHZRZa/N4CD02HPpvVFv35/FUGkeGwGJ5AihhmzxlD54U9Q9X3Ln8miejYTFoWvEnV5Ei8w==
"@budibase/pro@2.4.27-alpha.3":
version "2.4.27-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.27-alpha.3.tgz#c2264116fc5cfbf379d0fb9fae74fb9d8b2a8345"
integrity sha512-/OtPXehLN9DerycSCcnCrtY4hxBp229RGx2sFuu/gy/1xrOcMqcZ2+ZLNFhVR/LFm95JQzpPU0TCsJF0bBj+jQ==
dependencies:
"@budibase/backend-core" "2.4.26"
"@budibase/backend-core" "2.4.27-alpha.3"
"@budibase/string-templates" "2.3.20"
"@budibase/types" "2.4.26"
"@budibase/types" "2.4.27-alpha.3"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
@ -592,10 +592,10 @@
lodash "^4.17.20"
vm2 "^3.9.4"
"@budibase/types@2.4.26", "@budibase/types@^2.4.26":
version "2.4.26"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.26.tgz#c4efd9286e736feee56d623c21a9f6fd7c922b94"
integrity sha512-q2QfDXJAopmHNq6Y25udmVJoEtnoskZEtaMy5d7/hX4jePJX3QnBd9sjgnAoOeSC3NOuXDjmvcRGtqXz6ao/Ag==
"@budibase/types@2.4.27-alpha.3":
version "2.4.27-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.27-alpha.3.tgz#1251f2d0a058022fa72bd971ca1017eb0a37253a"
integrity sha512-2xplbfF2RZMrzXnOoXTLJLMGRapYcu7QturO/S7OMz3WXJ8gsd0U0lh/pi7i1L7YEs34xmKLNjmeMGbwozTfPw==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"