Replace ts-jest with swc/jest (#9289)

- Add swc dependencies
- Add transform change to jest.config.ts
- Replace `export =` with `export default` in src code to enable code coverage to work with swc transformer
- Restructure backend-core errors package to allow for exporting error classes with ESM syntax
- Update backend-core to no longer use `export =`, export individual packages instead of replacing with `export default` for backwards compatibility
- Update event publishers to use `export default` - this was required for the `jest.spyOn` usage inside backend-core common mocks
- Restructure some jest.mock usages where declaring the jest.fn as a variable outside of the package mock threw an error
This commit is contained in:
Rory Powell 2023-01-11 09:37:37 +00:00 committed by GitHub
parent 908d8d9066
commit fba7ef26ad
158 changed files with 981 additions and 3347 deletions

View File

@ -6,6 +6,9 @@ const config: Config.InitialOptions = {
setupFiles: ["./tests/jestSetup.ts"],
collectCoverageFrom: ["src/**/*.{js,ts}"],
coverageReporters: ["lcov", "json", "clover"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
}
if (!process.env.CI) {

View File

@ -56,6 +56,8 @@
"zlib": "1.0.5"
},
"devDependencies": {
"@swc/core": "^1.3.25",
"@swc/jest": "^0.2.24",
"@types/chance": "1.1.3",
"@types/ioredis": "4.28.0",
"@types/jest": "27.5.1",

View File

@ -7,7 +7,7 @@ function generateTenantKey(key: string) {
return `${key}:${tenantId}`
}
export = class BaseCache {
export default class BaseCache {
client: Client | undefined
constructor(client: Client | undefined = undefined) {

View File

@ -1,6 +1,6 @@
const BaseCache = require("./base")
const GENERIC = new BaseCache()
const GENERIC = new BaseCache.default()
export enum CacheKey {
CHECKLIST = "checklist",

View File

@ -1,6 +1,6 @@
import fetch from "node-fetch"
export = class API {
export default class API {
host: string
constructor(host: string) {

View File

@ -1,7 +1,7 @@
require("../../../tests")
const context = require("../")
const { DEFAULT_TENANT_ID } = require("../../constants")
const env = require("../../environment")
import env from "../../environment"
describe("context", () => {
describe("doInTenant", () => {
@ -26,7 +26,7 @@ describe("context", () => {
it("fails when no tenant id is set", () => {
const test = () => {
let error
let error: any
try {
context.getTenantId()
} catch (e) {
@ -45,7 +45,7 @@ describe("context", () => {
it("fails when no tenant db is set", () => {
const test = () => {
let error
let error: any
try {
context.getGlobalDB()
} catch (e) {

View File

@ -5,18 +5,13 @@ const {
isDevAppID,
isProdAppID,
} = require("../conversions")
const {
generateAppID,
getPlatformUrl,
getScopedConfig
} = require("../utils")
const { generateAppID, getPlatformUrl, getScopedConfig } = require("../utils")
const tenancy = require("../../tenancy")
const { Config, DEFAULT_TENANT_ID } = require("../../constants")
const env = require("../../environment")
import env from "../../environment"
describe("utils", () => {
describe("app ID manipulation", () => {
function getID() {
const appId = generateAppID()
const split = appId.split("_")
@ -28,42 +23,42 @@ describe("utils", () => {
it("should be able to generate a new app ID", () => {
expect(generateAppID().startsWith("app_")).toEqual(true)
})
it("should be able to convert a production app ID to development", () => {
const { appId, uuid } = getID()
expect(getDevelopmentAppID(appId)).toEqual(`app_dev_${uuid}`)
})
it("should be able to convert a development app ID to development", () => {
const { devAppId, uuid } = getID()
expect(getDevelopmentAppID(devAppId)).toEqual(`app_dev_${uuid}`)
})
it("should be able to convert a development ID to a production", () => {
const { devAppId, uuid } = getID()
expect(getProdAppID(devAppId)).toEqual(`app_${uuid}`)
})
it("should be able to convert a production ID to production", () => {
const { appId, uuid } = getID()
expect(getProdAppID(appId)).toEqual(`app_${uuid}`)
})
it("should be able to confirm dev app ID is development", () => {
const { devAppId } = getID()
expect(isDevAppID(devAppId)).toEqual(true)
})
it("should be able to confirm prod app ID is not development", () => {
const { appId } = getID()
expect(isDevAppID(appId)).toEqual(false)
})
it("should be able to confirm prod app ID is prod", () => {
const { appId } = getID()
expect(isProdAppID(appId)).toEqual(true)
})
it("should be able to confirm dev app ID is not prod", () => {
const { devAppId } = getID()
expect(isProdAppID(devAppId)).toEqual(false)
@ -81,8 +76,8 @@ const setDbPlatformUrl = async () => {
_id: "config_settings",
type: Config.SETTINGS,
config: {
platformUrl: DB_URL
}
platformUrl: DB_URL,
},
})
}
@ -92,17 +87,16 @@ const clearSettingsConfig = async () => {
try {
const config = await db.get("config_settings")
await db.remove("config_settings", config._rev)
} catch (e) {
} catch (e: any) {
if (e.status !== 404) {
throw e
}
}
})
}
describe("getPlatformUrl", () => {
describe("self host", () => {
beforeEach(async () => {
env._set("SELF_HOST", 1)
await clearSettingsConfig()
@ -129,10 +123,9 @@ describe("getPlatformUrl", () => {
const url = await getPlatformUrl()
expect(url).toBe(DB_URL)
})
})
})
})
describe("cloud", () => {
const TENANT_AWARE_URL = "http://default.env.com"
@ -163,13 +156,12 @@ describe("getPlatformUrl", () => {
const url = await getPlatformUrl()
expect(url).toBe(TENANT_AWARE_URL)
})
})
})
})
})
describe("getScopedConfig", () => {
describe("settings config", () => {
beforeEach(async () => {
env._set("SELF_HOSTED", 1)
env._set("PLATFORM_URL", "")

View File

@ -102,4 +102,4 @@ for (let [key, value] of Object.entries(environment)) {
}
}
export = environment
export default environment

View File

@ -0,0 +1,37 @@
import * as licensing from "./licensing"
// combine all error codes into single object
export const codes = {
...licensing.codes,
}
// combine all error types
export const types = [licensing.type]
// combine all error contexts
const context = {
...licensing.context,
}
// derive a public error message using codes, types and any custom contexts
export const getPublicError = (err: any) => {
let error
if (err.code || err.type) {
// add generic error information
error = {
code: err.code,
type: err.type,
}
if (err.code && context[err.code]) {
error = {
...error,
// get any additional context from this error
...context[err.code](err),
}
}
}
return error
}

View File

@ -1,47 +1,3 @@
import { HTTPError } from "./http"
import { UsageLimitError, FeatureDisabledError } from "./licensing"
import * as licensing from "./licensing"
const codes = {
...licensing.codes,
}
const types = [licensing.type]
const context = {
...licensing.context,
}
const getPublicError = (err: any) => {
let error
if (err.code || err.type) {
// add generic error information
error = {
code: err.code,
type: err.type,
}
if (err.code && context[err.code]) {
error = {
...error,
// get any additional context from this error
...context[err.code](err),
}
}
}
return error
}
const pkg = {
codes,
types,
errors: {
UsageLimitError,
FeatureDisabledError,
HTTPError,
},
getPublicError,
}
export = pkg
export * from "./errors"
export { UsageLimitError, FeatureDisabledError } from "./licensing"
export { HTTPError } from "./http"

View File

@ -1,6 +1,6 @@
import { Event } from "@budibase/types"
import { processors } from "./processors"
import * as identification from "./identification"
import identification from "./identification"
import * as backfill from "./backfill"
export const publishEvent = async (

View File

@ -33,7 +33,7 @@ const pkg = require("../../package.json")
* - tenant
* - installation
*/
export const getCurrentIdentity = async (): Promise<Identity> => {
const getCurrentIdentity = async (): Promise<Identity> => {
let identityContext = identityCtx.getIdentity()
const environment = getDeploymentEnvironment()
@ -94,7 +94,7 @@ export const getCurrentIdentity = async (): Promise<Identity> => {
}
}
export const identifyInstallationGroup = async (
const identifyInstallationGroup = async (
installId: string,
timestamp?: string | number
): Promise<void> => {
@ -118,7 +118,7 @@ export const identifyInstallationGroup = async (
await identify({ ...group, id: `$${type}_${id}` }, timestamp)
}
export const identifyTenantGroup = async (
const identifyTenantGroup = async (
tenantId: string,
account: Account | undefined,
timestamp?: string | number
@ -156,7 +156,7 @@ export const identifyTenantGroup = async (
await identify({ ...group, id: `$${type}_${id}` }, timestamp)
}
export const identifyUser = async (
const identifyUser = async (
user: User,
account: CloudAccount | undefined,
timestamp?: string | number
@ -191,7 +191,7 @@ export const identifyUser = async (
await identify(identity, timestamp)
}
export const identifyAccount = async (account: Account) => {
const identifyAccount = async (account: Account) => {
let id = account.accountId
const tenantId = account.tenantId
let type = IdentityType.USER
@ -224,17 +224,11 @@ export const identifyAccount = async (account: Account) => {
await identify(identity)
}
export const identify = async (
identity: Identity,
timestamp?: string | number
) => {
const identify = async (identity: Identity, timestamp?: string | number) => {
await processors.identify(identity, timestamp)
}
export const identifyGroup = async (
group: Group,
timestamp?: string | number
) => {
const identifyGroup = async (group: Group, timestamp?: string | number) => {
await processors.identifyGroup(group, timestamp)
}
@ -250,7 +244,7 @@ const getHostingFromEnv = () => {
return env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD
}
export const getInstallationId = async () => {
const getInstallationId = async () => {
if (isAccountPortal()) {
return "account-portal"
}
@ -300,3 +294,14 @@ const formatDistinctId = (id: string, type: IdentityType) => {
return id
}
}
export default {
getCurrentIdentity,
identifyInstallationGroup,
identifyTenantGroup,
identifyUser,
identifyAccount,
identify,
identifyGroup,
getInstallationId,
}

View File

@ -1,7 +1,7 @@
export * from "./publishers"
export * as processors from "./processors"
export * as analytics from "./analytics"
export * as identification from "./identification"
export { default as identification } from "./identification"
export * as backfillCache from "./backfill"
import { processors } from "./processors"

View File

@ -7,23 +7,29 @@ import {
AccountVerifiedEvent,
} from "@budibase/types"
export async function created(account: Account) {
async function created(account: Account) {
const properties: AccountCreatedEvent = {
tenantId: account.tenantId,
}
await publishEvent(Event.ACCOUNT_CREATED, properties)
}
export async function deleted(account: Account) {
async function deleted(account: Account) {
const properties: AccountDeletedEvent = {
tenantId: account.tenantId,
}
await publishEvent(Event.ACCOUNT_DELETED, properties)
}
export async function verified(account: Account) {
async function verified(account: Account) {
const properties: AccountVerifiedEvent = {
tenantId: account.tenantId,
}
await publishEvent(Event.ACCOUNT_VERIFIED, properties)
}
export default {
created,
deleted,
verified,
}

View File

@ -15,7 +15,7 @@ import {
AppExportedEvent,
} from "@budibase/types"
export const created = async (app: App, timestamp?: string | number) => {
const created = async (app: App, timestamp?: string | number) => {
const properties: AppCreatedEvent = {
appId: app.appId,
version: app.version,
@ -23,7 +23,7 @@ export const created = async (app: App, timestamp?: string | number) => {
await publishEvent(Event.APP_CREATED, properties, timestamp)
}
export async function updated(app: App) {
async function updated(app: App) {
const properties: AppUpdatedEvent = {
appId: app.appId,
version: app.version,
@ -31,35 +31,35 @@ export async function updated(app: App) {
await publishEvent(Event.APP_UPDATED, properties)
}
export async function deleted(app: App) {
async function deleted(app: App) {
const properties: AppDeletedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_DELETED, properties)
}
export async function published(app: App, timestamp?: string | number) {
async function published(app: App, timestamp?: string | number) {
const properties: AppPublishedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_PUBLISHED, properties, timestamp)
}
export async function unpublished(app: App) {
async function unpublished(app: App) {
const properties: AppUnpublishedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_UNPUBLISHED, properties)
}
export async function fileImported(app: App) {
async function fileImported(app: App) {
const properties: AppFileImportedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_FILE_IMPORTED, properties)
}
export async function templateImported(app: App, templateKey: string) {
async function templateImported(app: App, templateKey: string) {
const properties: AppTemplateImportedEvent = {
appId: app.appId,
templateKey,
@ -67,7 +67,7 @@ export async function templateImported(app: App, templateKey: string) {
await publishEvent(Event.APP_TEMPLATE_IMPORTED, properties)
}
export async function versionUpdated(
async function versionUpdated(
app: App,
currentVersion: string,
updatedToVersion: string
@ -80,7 +80,7 @@ export async function versionUpdated(
await publishEvent(Event.APP_VERSION_UPDATED, properties)
}
export async function versionReverted(
async function versionReverted(
app: App,
currentVersion: string,
revertedToVersion: string
@ -93,16 +93,30 @@ export async function versionReverted(
await publishEvent(Event.APP_VERSION_REVERTED, properties)
}
export async function reverted(app: App) {
async function reverted(app: App) {
const properties: AppRevertedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_REVERTED, properties)
}
export async function exported(app: App) {
async function exported(app: App) {
const properties: AppExportedEvent = {
appId: app.appId,
}
await publishEvent(Event.APP_EXPORTED, properties)
}
export default {
created,
updated,
deleted,
published,
unpublished,
fileImported,
templateImported,
versionUpdated,
versionReverted,
reverted,
exported,
}

View File

@ -12,7 +12,7 @@ import {
} from "@budibase/types"
import { identification } from ".."
export async function login(source: LoginSource) {
async function login(source: LoginSource) {
const identity = await identification.getCurrentIdentity()
const properties: LoginEvent = {
userId: identity.id,
@ -21,7 +21,7 @@ export async function login(source: LoginSource) {
await publishEvent(Event.AUTH_LOGIN, properties)
}
export async function logout() {
async function logout() {
const identity = await identification.getCurrentIdentity()
const properties: LogoutEvent = {
userId: identity.id,
@ -29,30 +29,39 @@ export async function logout() {
await publishEvent(Event.AUTH_LOGOUT, properties)
}
export async function SSOCreated(type: SSOType, timestamp?: string | number) {
async function SSOCreated(type: SSOType, timestamp?: string | number) {
const properties: SSOCreatedEvent = {
type,
}
await publishEvent(Event.AUTH_SSO_CREATED, properties, timestamp)
}
export async function SSOUpdated(type: SSOType) {
async function SSOUpdated(type: SSOType) {
const properties: SSOUpdatedEvent = {
type,
}
await publishEvent(Event.AUTH_SSO_UPDATED, properties)
}
export async function SSOActivated(type: SSOType, timestamp?: string | number) {
async function SSOActivated(type: SSOType, timestamp?: string | number) {
const properties: SSOActivatedEvent = {
type,
}
await publishEvent(Event.AUTH_SSO_ACTIVATED, properties, timestamp)
}
export async function SSODeactivated(type: SSOType) {
async function SSODeactivated(type: SSOType) {
const properties: SSODeactivatedEvent = {
type,
}
await publishEvent(Event.AUTH_SSO_DEACTIVATED, properties)
}
export default {
login,
logout,
SSOCreated,
SSOUpdated,
SSOActivated,
SSODeactivated,
}

View File

@ -12,10 +12,7 @@ import {
AutomationsRunEvent,
} from "@budibase/types"
export async function created(
automation: Automation,
timestamp?: string | number
) {
async function created(automation: Automation, timestamp?: string | number) {
const properties: AutomationCreatedEvent = {
appId: automation.appId,
automationId: automation._id as string,
@ -25,7 +22,7 @@ export async function created(
await publishEvent(Event.AUTOMATION_CREATED, properties, timestamp)
}
export async function triggerUpdated(automation: Automation) {
async function triggerUpdated(automation: Automation) {
const properties: AutomationTriggerUpdatedEvent = {
appId: automation.appId,
automationId: automation._id as string,
@ -35,7 +32,7 @@ export async function triggerUpdated(automation: Automation) {
await publishEvent(Event.AUTOMATION_TRIGGER_UPDATED, properties)
}
export async function deleted(automation: Automation) {
async function deleted(automation: Automation) {
const properties: AutomationDeletedEvent = {
appId: automation.appId,
automationId: automation._id as string,
@ -45,7 +42,7 @@ export async function deleted(automation: Automation) {
await publishEvent(Event.AUTOMATION_DELETED, properties)
}
export async function tested(automation: Automation) {
async function tested(automation: Automation) {
const properties: AutomationTestedEvent = {
appId: automation.appId,
automationId: automation._id as string,
@ -55,14 +52,14 @@ export async function tested(automation: Automation) {
await publishEvent(Event.AUTOMATION_TESTED, properties)
}
export const run = async (count: number, timestamp?: string | number) => {
const run = async (count: number, timestamp?: string | number) => {
const properties: AutomationsRunEvent = {
count,
}
await publishEvent(Event.AUTOMATIONS_RUN, properties, timestamp)
}
export async function stepCreated(
async function stepCreated(
automation: Automation,
step: AutomationStep,
timestamp?: string | number
@ -78,10 +75,7 @@ export async function stepCreated(
await publishEvent(Event.AUTOMATION_STEP_CREATED, properties, timestamp)
}
export async function stepDeleted(
automation: Automation,
step: AutomationStep
) {
async function stepDeleted(automation: Automation, step: AutomationStep) {
const properties: AutomationStepDeletedEvent = {
appId: automation.appId,
automationId: automation._id as string,
@ -92,3 +86,13 @@ export async function stepDeleted(
}
await publishEvent(Event.AUTOMATION_STEP_DELETED, properties)
}
export default {
created,
triggerUpdated,
deleted,
tested,
run,
stepCreated,
stepDeleted,
}

View File

@ -8,18 +8,18 @@ import {
InstallationBackfillSucceededEvent,
InstallationBackfillFailedEvent,
} from "@budibase/types"
const env = require("../../environment")
import env from "../../environment"
const shouldSkip = !env.SELF_HOSTED && !env.isDev()
export async function appSucceeded(properties: AppBackfillSucceededEvent) {
async function appSucceeded(properties: AppBackfillSucceededEvent) {
if (shouldSkip) {
return
}
await publishEvent(Event.APP_BACKFILL_SUCCEEDED, properties)
}
export async function appFailed(error: any) {
async function appFailed(error: any) {
if (shouldSkip) {
return
}
@ -29,16 +29,14 @@ export async function appFailed(error: any) {
await publishEvent(Event.APP_BACKFILL_FAILED, properties)
}
export async function tenantSucceeded(
properties: TenantBackfillSucceededEvent
) {
async function tenantSucceeded(properties: TenantBackfillSucceededEvent) {
if (shouldSkip) {
return
}
await publishEvent(Event.TENANT_BACKFILL_SUCCEEDED, properties)
}
export async function tenantFailed(error: any) {
async function tenantFailed(error: any) {
if (shouldSkip) {
return
}
@ -48,7 +46,7 @@ export async function tenantFailed(error: any) {
await publishEvent(Event.TENANT_BACKFILL_FAILED, properties)
}
export async function installationSucceeded() {
async function installationSucceeded() {
if (shouldSkip) {
return
}
@ -56,7 +54,7 @@ export async function installationSucceeded() {
await publishEvent(Event.INSTALLATION_BACKFILL_SUCCEEDED, properties)
}
export async function installationFailed(error: any) {
async function installationFailed(error: any) {
if (shouldSkip) {
return
}
@ -65,3 +63,12 @@ export async function installationFailed(error: any) {
}
await publishEvent(Event.INSTALLATION_BACKFILL_FAILED, properties)
}
export default {
appSucceeded,
appFailed,
tenantSucceeded,
tenantFailed,
installationSucceeded,
installationFailed,
}

View File

@ -8,7 +8,7 @@ import {
} from "@budibase/types"
import { publishEvent } from "../events"
export async function appBackupRestored(backup: AppBackup) {
async function appBackupRestored(backup: AppBackup) {
const properties: AppBackupRestoreEvent = {
appId: backup.appId,
restoreId: backup._id!,
@ -18,7 +18,7 @@ export async function appBackupRestored(backup: AppBackup) {
await publishEvent(Event.APP_BACKUP_RESTORED, properties)
}
export async function appBackupTriggered(
async function appBackupTriggered(
appId: string,
backupId: string,
type: AppBackupType,
@ -32,3 +32,8 @@ export async function appBackupTriggered(
}
await publishEvent(Event.APP_BACKUP_TRIGGERED, properties)
}
export default {
appBackupRestored,
appBackupTriggered,
}

View File

@ -14,10 +14,7 @@ function isCustom(datasource: Datasource) {
return !sources.includes(datasource.source)
}
export async function created(
datasource: Datasource,
timestamp?: string | number
) {
async function created(datasource: Datasource, timestamp?: string | number) {
const properties: DatasourceCreatedEvent = {
datasourceId: datasource._id as string,
source: datasource.source,
@ -26,7 +23,7 @@ export async function created(
await publishEvent(Event.DATASOURCE_CREATED, properties, timestamp)
}
export async function updated(datasource: Datasource) {
async function updated(datasource: Datasource) {
const properties: DatasourceUpdatedEvent = {
datasourceId: datasource._id as string,
source: datasource.source,
@ -35,7 +32,7 @@ export async function updated(datasource: Datasource) {
await publishEvent(Event.DATASOURCE_UPDATED, properties)
}
export async function deleted(datasource: Datasource) {
async function deleted(datasource: Datasource) {
const properties: DatasourceDeletedEvent = {
datasourceId: datasource._id as string,
source: datasource.source,
@ -43,3 +40,9 @@ export async function deleted(datasource: Datasource) {
}
await publishEvent(Event.DATASOURCE_DELETED, properties)
}
export default {
created,
updated,
deleted,
}

View File

@ -1,12 +1,17 @@
import { publishEvent } from "../events"
import { Event, SMTPCreatedEvent, SMTPUpdatedEvent } from "@budibase/types"
export async function SMTPCreated(timestamp?: string | number) {
async function SMTPCreated(timestamp?: string | number) {
const properties: SMTPCreatedEvent = {}
await publishEvent(Event.EMAIL_SMTP_CREATED, properties, timestamp)
}
export async function SMTPUpdated() {
async function SMTPUpdated() {
const properties: SMTPUpdatedEvent = {}
await publishEvent(Event.EMAIL_SMTP_UPDATED, properties)
}
export default {
SMTPCreated,
SMTPUpdated,
}

View File

@ -11,28 +11,28 @@ import {
UserGroupRoles,
} from "@budibase/types"
export async function created(group: UserGroup, timestamp?: number) {
async function created(group: UserGroup, timestamp?: number) {
const properties: GroupCreatedEvent = {
groupId: group._id as string,
}
await publishEvent(Event.USER_GROUP_CREATED, properties, timestamp)
}
export async function updated(group: UserGroup) {
async function updated(group: UserGroup) {
const properties: GroupUpdatedEvent = {
groupId: group._id as string,
}
await publishEvent(Event.USER_GROUP_UPDATED, properties)
}
export async function deleted(group: UserGroup) {
async function deleted(group: UserGroup) {
const properties: GroupDeletedEvent = {
groupId: group._id as string,
}
await publishEvent(Event.USER_GROUP_DELETED, properties)
}
export async function usersAdded(count: number, group: UserGroup) {
async function usersAdded(count: number, group: UserGroup) {
const properties: GroupUsersAddedEvent = {
count,
groupId: group._id as string,
@ -40,7 +40,7 @@ export async function usersAdded(count: number, group: UserGroup) {
await publishEvent(Event.USER_GROUP_USERS_ADDED, properties)
}
export async function usersDeleted(count: number, group: UserGroup) {
async function usersDeleted(count: number, group: UserGroup) {
const properties: GroupUsersDeletedEvent = {
count,
groupId: group._id as string,
@ -48,7 +48,7 @@ export async function usersDeleted(count: number, group: UserGroup) {
await publishEvent(Event.USER_GROUP_USERS_REMOVED, properties)
}
export async function createdOnboarding(groupId: string) {
async function createdOnboarding(groupId: string) {
const properties: GroupAddedOnboardingEvent = {
groupId: groupId,
onboarding: true,
@ -56,9 +56,19 @@ export async function createdOnboarding(groupId: string) {
await publishEvent(Event.USER_GROUP_ONBOARDING, properties)
}
export async function permissionsEdited(roles: UserGroupRoles) {
async function permissionsEdited(roles: UserGroupRoles) {
const properties: UserGroupRoles = {
...roles,
}
await publishEvent(Event.USER_GROUP_PERMISSIONS_EDITED, properties)
}
export default {
created,
updated,
deleted,
usersAdded,
usersDeleted,
createdOnboarding,
permissionsEdited,
}

View File

@ -1,22 +1,22 @@
export * as account from "./account"
export * as app from "./app"
export * as auth from "./auth"
export * as automation from "./automation"
export * as datasource from "./datasource"
export * as email from "./email"
export * as license from "./license"
export * as layout from "./layout"
export * as org from "./org"
export * as query from "./query"
export * as role from "./role"
export * as screen from "./screen"
export * as rows from "./rows"
export * as table from "./table"
export * as serve from "./serve"
export * as user from "./user"
export * as view from "./view"
export * as installation from "./installation"
export * as backfill from "./backfill"
export * as group from "./group"
export * as plugin from "./plugin"
export * as backup from "./backup"
export { default as account } from "./account"
export { default as app } from "./app"
export { default as auth } from "./auth"
export { default as automation } from "./automation"
export { default as datasource } from "./datasource"
export { default as email } from "./email"
export { default as license } from "./license"
export { default as layout } from "./layout"
export { default as org } from "./org"
export { default as query } from "./query"
export { default as role } from "./role"
export { default as screen } from "./screen"
export { default as rows } from "./rows"
export { default as table } from "./table"
export { default as serve } from "./serve"
export { default as user } from "./user"
export { default as view } from "./view"
export { default as installation } from "./installation"
export { default as backfill } from "./backfill"
export { default as group } from "./group"
export { default as plugin } from "./plugin"
export { default as backup } from "./backup"

View File

@ -1,14 +1,14 @@
import { publishEvent } from "../events"
import { Event, VersionCheckedEvent, VersionChangeEvent } from "@budibase/types"
export async function versionChecked(version: string) {
async function versionChecked(version: string) {
const properties: VersionCheckedEvent = {
currentVersion: version,
}
await publishEvent(Event.INSTALLATION_VERSION_CHECKED, properties)
}
export async function upgraded(from: string, to: string) {
async function upgraded(from: string, to: string) {
const properties: VersionChangeEvent = {
from,
to,
@ -17,7 +17,7 @@ export async function upgraded(from: string, to: string) {
await publishEvent(Event.INSTALLATION_VERSION_UPGRADED, properties)
}
export async function downgraded(from: string, to: string) {
async function downgraded(from: string, to: string) {
const properties: VersionChangeEvent = {
from,
to,
@ -25,7 +25,14 @@ export async function downgraded(from: string, to: string) {
await publishEvent(Event.INSTALLATION_VERSION_DOWNGRADED, properties)
}
export async function firstStartup() {
async function firstStartup() {
const properties = {}
await publishEvent(Event.INSTALLATION_FIRST_STARTUP, properties)
}
export default {
versionChecked,
upgraded,
downgraded,
firstStartup,
}

View File

@ -6,16 +6,21 @@ import {
LayoutDeletedEvent,
} from "@budibase/types"
export async function created(layout: Layout, timestamp?: string | number) {
async function created(layout: Layout, timestamp?: string | number) {
const properties: LayoutCreatedEvent = {
layoutId: layout._id as string,
}
await publishEvent(Event.LAYOUT_CREATED, properties, timestamp)
}
export async function deleted(layoutId: string) {
async function deleted(layoutId: string) {
const properties: LayoutDeletedEvent = {
layoutId,
}
await publishEvent(Event.LAYOUT_DELETED, properties)
}
export default {
created,
deleted,
}

View File

@ -13,7 +13,7 @@ import {
LicensePaymentRecoveredEvent,
} from "@budibase/types"
export async function tierChanged(account: Account, from: number, to: number) {
async function tierChanged(account: Account, from: number, to: number) {
const properties: LicenseTierChangedEvent = {
accountId: account.accountId,
to,
@ -22,11 +22,7 @@ export async function tierChanged(account: Account, from: number, to: number) {
await publishEvent(Event.LICENSE_TIER_CHANGED, properties)
}
export async function planChanged(
account: Account,
from: PlanType,
to: PlanType
) {
async function planChanged(account: Account, from: PlanType, to: PlanType) {
const properties: LicensePlanChangedEvent = {
accountId: account.accountId,
to,
@ -35,44 +31,55 @@ export async function planChanged(
await publishEvent(Event.LICENSE_PLAN_CHANGED, properties)
}
export async function activated(account: Account) {
async function activated(account: Account) {
const properties: LicenseActivatedEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_ACTIVATED, properties)
}
export async function checkoutOpened(account: Account) {
async function checkoutOpened(account: Account) {
const properties: LicenseCheckoutOpenedEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_CHECKOUT_OPENED, properties)
}
export async function checkoutSuccess(account: Account) {
async function checkoutSuccess(account: Account) {
const properties: LicenseCheckoutSuccessEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_CHECKOUT_SUCCESS, properties)
}
export async function portalOpened(account: Account) {
async function portalOpened(account: Account) {
const properties: LicensePortalOpenedEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_PORTAL_OPENED, properties)
}
export async function paymentFailed(account: Account) {
async function paymentFailed(account: Account) {
const properties: LicensePaymentFailedEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_PAYMENT_FAILED, properties)
}
export async function paymentRecovered(account: Account) {
async function paymentRecovered(account: Account) {
const properties: LicensePaymentRecoveredEvent = {
accountId: account.accountId,
}
await publishEvent(Event.LICENSE_PAYMENT_RECOVERED, properties)
}
export default {
tierChanged,
planChanged,
activated,
checkoutOpened,
checkoutSuccess,
portalOpened,
paymentFailed,
paymentRecovered,
}

View File

@ -1,29 +1,37 @@
import { publishEvent } from "../events"
import { Event } from "@budibase/types"
export async function nameUpdated(timestamp?: string | number) {
async function nameUpdated(timestamp?: string | number) {
const properties = {}
await publishEvent(Event.ORG_NAME_UPDATED, properties, timestamp)
}
export async function logoUpdated(timestamp?: string | number) {
async function logoUpdated(timestamp?: string | number) {
const properties = {}
await publishEvent(Event.ORG_LOGO_UPDATED, properties, timestamp)
}
export async function platformURLUpdated(timestamp?: string | number) {
async function platformURLUpdated(timestamp?: string | number) {
const properties = {}
await publishEvent(Event.ORG_PLATFORM_URL_UPDATED, properties, timestamp)
}
// TODO
export async function analyticsOptOut() {
async function analyticsOptOut() {
const properties = {}
await publishEvent(Event.ANALYTICS_OPT_OUT, properties)
}
export async function analyticsOptIn() {
async function analyticsOptIn() {
const properties = {}
await publishEvent(Event.ANALYTICS_OPT_OUT, properties)
}
export default {
nameUpdated,
logoUpdated,
platformURLUpdated,
analyticsOptOut,
analyticsOptIn,
}

View File

@ -7,7 +7,7 @@ import {
PluginInitEvent,
} from "@budibase/types"
export async function init(plugin: Plugin) {
async function init(plugin: Plugin) {
const properties: PluginInitEvent = {
type: plugin.schema.type,
name: plugin.name,
@ -17,7 +17,7 @@ export async function init(plugin: Plugin) {
await publishEvent(Event.PLUGIN_INIT, properties)
}
export async function imported(plugin: Plugin) {
async function imported(plugin: Plugin) {
const properties: PluginImportedEvent = {
pluginId: plugin._id as string,
type: plugin.schema.type,
@ -29,7 +29,7 @@ export async function imported(plugin: Plugin) {
await publishEvent(Event.PLUGIN_IMPORTED, properties)
}
export async function deleted(plugin: Plugin) {
async function deleted(plugin: Plugin) {
const properties: PluginDeletedEvent = {
pluginId: plugin._id as string,
type: plugin.schema.type,
@ -39,3 +39,9 @@ export async function deleted(plugin: Plugin) {
}
await publishEvent(Event.PLUGIN_DELETED, properties)
}
export default {
init,
imported,
deleted,
}

View File

@ -13,7 +13,7 @@ import {
/* eslint-disable */
export const created = async (
const created = async (
datasource: Datasource,
query: Query,
timestamp?: string | number
@ -27,7 +27,7 @@ export const created = async (
await publishEvent(Event.QUERY_CREATED, properties, timestamp)
}
export const updated = async (datasource: Datasource, query: Query) => {
const updated = async (datasource: Datasource, query: Query) => {
const properties: QueryUpdatedEvent = {
queryId: query._id as string,
datasourceId: datasource._id as string,
@ -37,7 +37,7 @@ export const updated = async (datasource: Datasource, query: Query) => {
await publishEvent(Event.QUERY_UPDATED, properties)
}
export const deleted = async (datasource: Datasource, query: Query) => {
const deleted = async (datasource: Datasource, query: Query) => {
const properties: QueryDeletedEvent = {
queryId: query._id as string,
datasourceId: datasource._id as string,
@ -47,7 +47,7 @@ export const deleted = async (datasource: Datasource, query: Query) => {
await publishEvent(Event.QUERY_DELETED, properties)
}
export const imported = async (
const imported = async (
datasource: Datasource,
importSource: any,
count: any
@ -61,14 +61,14 @@ export const imported = async (
await publishEvent(Event.QUERY_IMPORT, properties)
}
export const run = async (count: number, timestamp?: string | number) => {
const run = async (count: number, timestamp?: string | number) => {
const properties: QueriesRunEvent = {
count,
}
await publishEvent(Event.QUERIES_RUN, properties, timestamp)
}
export const previewed = async (datasource: Datasource, query: Query) => {
const previewed = async (datasource: Datasource, query: Query) => {
const properties: QueryPreviewedEvent = {
queryId: query._id,
datasourceId: datasource._id as string,
@ -77,3 +77,12 @@ export const previewed = async (datasource: Datasource, query: Query) => {
}
await publishEvent(Event.QUERY_PREVIEWED, properties)
}
export default {
created,
updated,
deleted,
imported,
run,
previewed,
}

View File

@ -10,7 +10,7 @@ import {
User,
} from "@budibase/types"
export async function created(role: Role, timestamp?: string | number) {
async function created(role: Role, timestamp?: string | number) {
const properties: RoleCreatedEvent = {
roleId: role._id as string,
permissionId: role.permissionId,
@ -19,7 +19,7 @@ export async function created(role: Role, timestamp?: string | number) {
await publishEvent(Event.ROLE_CREATED, properties, timestamp)
}
export async function updated(role: Role) {
async function updated(role: Role) {
const properties: RoleUpdatedEvent = {
roleId: role._id as string,
permissionId: role.permissionId,
@ -28,7 +28,7 @@ export async function updated(role: Role) {
await publishEvent(Event.ROLE_UPDATED, properties)
}
export async function deleted(role: Role) {
async function deleted(role: Role) {
const properties: RoleDeletedEvent = {
roleId: role._id as string,
permissionId: role.permissionId,
@ -37,7 +37,7 @@ export async function deleted(role: Role) {
await publishEvent(Event.ROLE_DELETED, properties)
}
export async function assigned(user: User, roleId: string, timestamp?: number) {
async function assigned(user: User, roleId: string, timestamp?: number) {
const properties: RoleAssignedEvent = {
userId: user._id as string,
roleId,
@ -45,10 +45,18 @@ export async function assigned(user: User, roleId: string, timestamp?: number) {
await publishEvent(Event.ROLE_ASSIGNED, properties, timestamp)
}
export async function unassigned(user: User, roleId: string) {
async function unassigned(user: User, roleId: string) {
const properties: RoleUnassignedEvent = {
userId: user._id as string,
roleId,
}
await publishEvent(Event.ROLE_UNASSIGNED, properties)
}
export default {
created,
updated,
deleted,
assigned,
unassigned,
}

View File

@ -9,14 +9,14 @@ import {
/* eslint-disable */
export const created = async (count: number, timestamp?: string | number) => {
const created = async (count: number, timestamp?: string | number) => {
const properties: RowsCreatedEvent = {
count,
}
await publishEvent(Event.ROWS_CREATED, properties, timestamp)
}
export const imported = async (
const imported = async (
table: Table,
format: RowImportFormat,
count: number
@ -28,3 +28,8 @@ export const imported = async (
}
await publishEvent(Event.ROWS_IMPORTED, properties)
}
export default {
created,
imported,
}

View File

@ -6,7 +6,7 @@ import {
ScreenDeletedEvent,
} from "@budibase/types"
export async function created(screen: Screen, timestamp?: string | number) {
async function created(screen: Screen, timestamp?: string | number) {
const properties: ScreenCreatedEvent = {
layoutId: screen.layoutId,
screenId: screen._id as string,
@ -15,7 +15,7 @@ export async function created(screen: Screen, timestamp?: string | number) {
await publishEvent(Event.SCREEN_CREATED, properties, timestamp)
}
export async function deleted(screen: Screen) {
async function deleted(screen: Screen) {
const properties: ScreenDeletedEvent = {
layoutId: screen.layoutId,
screenId: screen._id as string,
@ -23,3 +23,8 @@ export async function deleted(screen: Screen) {
}
await publishEvent(Event.SCREEN_DELETED, properties)
}
export default {
created,
deleted,
}

View File

@ -7,14 +7,14 @@ import {
AppServedEvent,
} from "@budibase/types"
export async function servedBuilder(timezone: string) {
async function servedBuilder(timezone: string) {
const properties: BuilderServedEvent = {
timezone,
}
await publishEvent(Event.SERVED_BUILDER, properties)
}
export async function servedApp(app: App, timezone: string) {
async function servedApp(app: App, timezone: string) {
const properties: AppServedEvent = {
appVersion: app.version,
timezone,
@ -22,7 +22,7 @@ export async function servedApp(app: App, timezone: string) {
await publishEvent(Event.SERVED_APP, properties)
}
export async function servedAppPreview(app: App, timezone: string) {
async function servedAppPreview(app: App, timezone: string) {
const properties: AppPreviewServedEvent = {
appId: app.appId,
appVersion: app.version,
@ -30,3 +30,9 @@ export async function servedAppPreview(app: App, timezone: string) {
}
await publishEvent(Event.SERVED_APP_PREVIEW, properties)
}
export default {
servedBuilder,
servedApp,
servedAppPreview,
}

View File

@ -11,28 +11,28 @@ import {
TableImportedEvent,
} from "@budibase/types"
export async function created(table: Table, timestamp?: string | number) {
async function created(table: Table, timestamp?: string | number) {
const properties: TableCreatedEvent = {
tableId: table._id as string,
}
await publishEvent(Event.TABLE_CREATED, properties, timestamp)
}
export async function updated(table: Table) {
async function updated(table: Table) {
const properties: TableUpdatedEvent = {
tableId: table._id as string,
}
await publishEvent(Event.TABLE_UPDATED, properties)
}
export async function deleted(table: Table) {
async function deleted(table: Table) {
const properties: TableDeletedEvent = {
tableId: table._id as string,
}
await publishEvent(Event.TABLE_DELETED, properties)
}
export async function exported(table: Table, format: TableExportFormat) {
async function exported(table: Table, format: TableExportFormat) {
const properties: TableExportedEvent = {
tableId: table._id as string,
format,
@ -40,10 +40,18 @@ export async function exported(table: Table, format: TableExportFormat) {
await publishEvent(Event.TABLE_EXPORTED, properties)
}
export async function imported(table: Table, format: TableImportFormat) {
async function imported(table: Table, format: TableImportFormat) {
const properties: TableImportedEvent = {
tableId: table._id as string,
format,
}
await publishEvent(Event.TABLE_IMPORTED, properties)
}
export default {
created,
updated,
deleted,
exported,
imported,
}

View File

@ -15,21 +15,21 @@ import {
UserUpdatedEvent,
} from "@budibase/types"
export async function created(user: User, timestamp?: number) {
async function created(user: User, timestamp?: number) {
const properties: UserCreatedEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_CREATED, properties, timestamp)
}
export async function updated(user: User) {
async function updated(user: User) {
const properties: UserUpdatedEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_UPDATED, properties)
}
export async function deleted(user: User) {
async function deleted(user: User) {
const properties: UserDeletedEvent = {
userId: user._id as string,
}
@ -38,7 +38,7 @@ export async function deleted(user: User) {
// PERMISSIONS
export async function permissionAdminAssigned(user: User, timestamp?: number) {
async function permissionAdminAssigned(user: User, timestamp?: number) {
const properties: UserPermissionAssignedEvent = {
userId: user._id as string,
}
@ -49,17 +49,14 @@ export async function permissionAdminAssigned(user: User, timestamp?: number) {
)
}
export async function permissionAdminRemoved(user: User) {
async function permissionAdminRemoved(user: User) {
const properties: UserPermissionRemovedEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_PERMISSION_ADMIN_REMOVED, properties)
}
export async function permissionBuilderAssigned(
user: User,
timestamp?: number
) {
async function permissionBuilderAssigned(user: User, timestamp?: number) {
const properties: UserPermissionAssignedEvent = {
userId: user._id as string,
}
@ -70,7 +67,7 @@ export async function permissionBuilderAssigned(
)
}
export async function permissionBuilderRemoved(user: User) {
async function permissionBuilderRemoved(user: User) {
const properties: UserPermissionRemovedEvent = {
userId: user._id as string,
}
@ -79,12 +76,12 @@ export async function permissionBuilderRemoved(user: User) {
// INVITE
export async function invited() {
async function invited() {
const properties: UserInvitedEvent = {}
await publishEvent(Event.USER_INVITED, properties)
}
export async function inviteAccepted(user: User) {
async function inviteAccepted(user: User) {
const properties: UserInviteAcceptedEvent = {
userId: user._id as string,
}
@ -93,30 +90,46 @@ export async function inviteAccepted(user: User) {
// PASSWORD
export async function passwordForceReset(user: User) {
async function passwordForceReset(user: User) {
const properties: UserPasswordForceResetEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_PASSWORD_FORCE_RESET, properties)
}
export async function passwordUpdated(user: User) {
async function passwordUpdated(user: User) {
const properties: UserPasswordUpdatedEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_PASSWORD_UPDATED, properties)
}
export async function passwordResetRequested(user: User) {
async function passwordResetRequested(user: User) {
const properties: UserPasswordResetRequestedEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_PASSWORD_RESET_REQUESTED, properties)
}
export async function passwordReset(user: User) {
async function passwordReset(user: User) {
const properties: UserPasswordResetEvent = {
userId: user._id as string,
}
await publishEvent(Event.USER_PASSWORD_RESET, properties)
}
export default {
created,
updated,
deleted,
permissionAdminAssigned,
permissionAdminRemoved,
permissionBuilderAssigned,
permissionBuilderRemoved,
invited,
inviteAccepted,
passwordForceReset,
passwordUpdated,
passwordResetRequested,
passwordReset,
}

View File

@ -19,28 +19,28 @@ import {
/* eslint-disable */
export async function created(view: View, timestamp?: string | number) {
async function created(view: View, timestamp?: string | number) {
const properties: ViewCreatedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_CREATED, properties, timestamp)
}
export async function updated(view: View) {
async function updated(view: View) {
const properties: ViewUpdatedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_UPDATED, properties)
}
export async function deleted(view: View) {
async function deleted(view: View) {
const properties: ViewDeletedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_DELETED, properties)
}
export async function exported(table: Table, format: TableExportFormat) {
async function exported(table: Table, format: TableExportFormat) {
const properties: ViewExportedEvent = {
tableId: table._id as string,
format,
@ -48,31 +48,28 @@ export async function exported(table: Table, format: TableExportFormat) {
await publishEvent(Event.VIEW_EXPORTED, properties)
}
export async function filterCreated(view: View, timestamp?: string | number) {
async function filterCreated(view: View, timestamp?: string | number) {
const properties: ViewFilterCreatedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_FILTER_CREATED, properties, timestamp)
}
export async function filterUpdated(view: View) {
async function filterUpdated(view: View) {
const properties: ViewFilterUpdatedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_FILTER_UPDATED, properties)
}
export async function filterDeleted(view: View) {
async function filterDeleted(view: View) {
const properties: ViewFilterDeletedEvent = {
tableId: view.tableId,
}
await publishEvent(Event.VIEW_FILTER_DELETED, properties)
}
export async function calculationCreated(
view: View,
timestamp?: string | number
) {
async function calculationCreated(view: View, timestamp?: string | number) {
const properties: ViewCalculationCreatedEvent = {
tableId: view.tableId,
calculation: view.calculation as ViewCalculation,
@ -80,7 +77,7 @@ export async function calculationCreated(
await publishEvent(Event.VIEW_CALCULATION_CREATED, properties, timestamp)
}
export async function calculationUpdated(view: View) {
async function calculationUpdated(view: View) {
const properties: ViewCalculationUpdatedEvent = {
tableId: view.tableId,
calculation: view.calculation as ViewCalculation,
@ -88,10 +85,23 @@ export async function calculationUpdated(view: View) {
await publishEvent(Event.VIEW_CALCULATION_UPDATED, properties)
}
export async function calculationDeleted(existingView: View) {
async function calculationDeleted(existingView: View) {
const properties: ViewCalculationDeletedEvent = {
tableId: existingView.tableId,
calculation: existingView.calculation as ViewCalculation,
}
await publishEvent(Event.VIEW_CALCULATION_DELETED, properties)
}
export default {
created,
updated,
deleted,
exported,
filterCreated,
filterUpdated,
filterDeleted,
calculationCreated,
calculationUpdated,
calculationDeleted,
}

View File

@ -1,68 +1,42 @@
import errors from "./errors"
const errorClasses = errors.errors
import * as events from "./events"
import * as migrations from "./migrations"
import * as users from "./users"
import * as roles from "./security/roles"
import * as permissions from "./security/permissions"
import * as accounts from "./cloud/accounts"
import * as installation from "./installation"
import env from "./environment"
import * as tenancy from "./tenancy"
import * as featureFlags from "./featureFlags"
import * as sessions from "./security/sessions"
import * as deprovisioning from "./context/deprovision"
import * as auth from "./auth"
import * as constants from "./constants"
import * as logging from "./logging"
import * as pino from "./pino"
import * as middleware from "./middleware"
import * as plugins from "./plugin"
import * as encryption from "./security/encryption"
import * as queue from "./queue"
import * as db from "./db"
import * as context from "./context"
import * as cache from "./cache"
import * as objectStore from "./objectStore"
import * as redis from "./redis"
import * as utils from "./utils"
export * as events from "./events"
export * as migrations from "./migrations"
export * as users from "./users"
export * as roles from "./security/roles"
export * as permissions from "./security/permissions"
export * as accounts from "./cloud/accounts"
export * as installation from "./installation"
export * as tenancy from "./tenancy"
export * as featureFlags from "./featureFlags"
export * as sessions from "./security/sessions"
export * as deprovisioning from "./context/deprovision"
export * as auth from "./auth"
export * as constants from "./constants"
export * as logging from "./logging"
export * as middleware from "./middleware"
export * as plugins from "./plugin"
export * as encryption from "./security/encryption"
export * as queue from "./queue"
export * as db from "./db"
export * as context from "./context"
export * as cache from "./cache"
export * as objectStore from "./objectStore"
export * as redis from "./redis"
export * as utils from "./utils"
export * as errors from "./errors"
export { default as env } from "./environment"
const init = (opts: any = {}) => {
// expose error classes directly
export * from "./errors"
// expose constants directly
export * from "./constants"
// expose inner locks from redis directly
import * as redis from "./redis"
export const locks = redis.redlock
// expose package init function
import * as db from "./db"
export const init = (opts: any = {}) => {
db.init(opts.db)
}
const core = {
init,
db,
...constants,
redis,
locks: redis.redlock,
objectStore,
utils,
users,
cache,
auth,
constants,
migrations,
env,
accounts,
tenancy,
context,
featureFlags,
events,
sessions,
deprovisioning,
installation,
errors,
logging,
roles,
plugins,
...pino,
...errorClasses,
middleware,
encryption,
queue,
permissions,
}
export = core

View File

@ -1,3 +1,5 @@
import env from "./environment"
const NonErrors = ["AccountError"]
function isSuppressed(e?: any) {
@ -29,8 +31,14 @@ export function logWarn(message: string) {
console.warn(`bb-warn: ${message}`)
}
export default {
logAlert,
logAlertWithInfo,
logWarn,
export function pinoSettings() {
return {
prettyPrint: {
levelFirst: true,
},
level: env.LOG_LEVEL || "error",
autoLogging: {
ignore: (req: { url: string }) => req.url.includes("/health"),
},
}
}

View File

@ -1,6 +1,6 @@
import { BBContext } from "@budibase/types"
export = async (ctx: BBContext, next: any) => {
export default async (ctx: BBContext, next: any) => {
if (
!ctx.internal &&
(!ctx.user || !ctx.user.admin || !ctx.user.admin.global)

View File

@ -1,6 +1,6 @@
import { BBContext } from "@budibase/types"
export = async (ctx: BBContext | any, next: any) => {
export default async (ctx: BBContext | any, next: any) => {
// Placeholder for audit log middleware
return next()
}

View File

@ -66,7 +66,7 @@ async function checkApiKey(apiKey: string, populateUser?: Function) {
* The tenancy modules should not be used here and it should be assumed that the tenancy context
* has not yet been populated.
*/
export = function (
export default function (
noAuthPatterns: EndpointMatcher[] = [],
opts: { publicAllowed?: boolean; populateUser?: Function } = {
publicAllowed: false,

View File

@ -1,6 +1,6 @@
import { BBContext } from "@budibase/types"
export = async (ctx: BBContext, next: any) => {
export default async (ctx: BBContext, next: any) => {
if (
!ctx.internal &&
(!ctx.user || !ctx.user.builder || !ctx.user.builder.global)

View File

@ -1,6 +1,6 @@
import { BBContext } from "@budibase/types"
export = async (ctx: BBContext, next: any) => {
export default async (ctx: BBContext, next: any) => {
if (
!ctx.internal &&
(!ctx.user || !ctx.user.builder || !ctx.user.builder.global) &&

View File

@ -32,7 +32,7 @@ const INCLUDED_CONTENT_TYPES = [
* https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#synchronizer-token-pattern
*
*/
export = function (
export default function (
opts: { noCsrfPatterns: EndpointMatcher[] } = { noCsrfPatterns: [] }
) {
const noCsrfOptions = buildMatcherRegex(opts.noCsrfPatterns)

View File

@ -1,38 +1,18 @@
import * as jwt from "./passport/jwt"
import * as local from "./passport/local"
import * as google from "./passport/google"
import * as oidc from "./passport/oidc"
import { authError, ssoCallbackUrl } from "./passport/utils"
import authenticated from "./authenticated"
import auditLog from "./auditLog"
import tenancy from "./tenancy"
import internalApi from "./internalApi"
export * as jwt from "./passport/jwt"
export * as local from "./passport/local"
export * as google from "./passport/google"
export * as oidc from "./passport/oidc"
import * as datasourceGoogle from "./passport/datasource/google"
import csrf from "./csrf"
import adminOnly from "./adminOnly"
import builderOrAdmin from "./builderOrAdmin"
import builderOnly from "./builderOnly"
import * as joiValidator from "./joi-validator"
const pkg = {
google,
oidc,
jwt,
local,
authenticated,
auditLog,
tenancy,
authError,
internalApi,
ssoCallbackUrl,
datasource: {
google: datasourceGoogle,
},
csrf,
adminOnly,
builderOnly,
builderOrAdmin,
joiValidator,
export const datasource = {
google: datasourceGoogle,
}
export = pkg
export { authError, ssoCallbackUrl } from "./passport/utils"
export { default as authenticated } from "./authenticated"
export { default as auditLog } from "./auditLog"
export { default as tenancy } from "./tenancy"
export { default as internalApi } from "./internalApi"
export { default as csrf } from "./csrf"
export { default as adminOnly } from "./adminOnly"
export { default as builderOrAdmin } from "./builderOrAdmin"
export { default as builderOnly } from "./builderOnly"
export * as joiValidator from "./joi-validator"

View File

@ -5,7 +5,7 @@ import { BBContext } from "@budibase/types"
/**
* API Key only endpoint.
*/
export = async (ctx: BBContext, next: any) => {
export default async (ctx: BBContext, next: any) => {
const apiKey = ctx.request.headers[Header.API_KEY]
if (apiKey !== env.INTERNAL_API_KEY) {
ctx.throw(403, "Unauthorized")

View File

@ -2,7 +2,6 @@ import fetch from "node-fetch"
import { authenticateThirdParty, SaveUserFunction } from "./third-party-common"
import { ssoCallbackUrl } from "./utils"
import {
Config,
ConfigType,
OIDCInnerCfg,
Database,

View File

@ -8,7 +8,7 @@ import {
TenantResolutionStrategy,
} from "@budibase/types"
export = function (
export default function (
allowQueryStringPatterns: EndpointMatcher[],
noTenancyPatterns: EndpointMatcher[],
opts: { noTenancyRequired?: boolean } = { noTenancyRequired: false }

View File

@ -88,7 +88,7 @@ export const runMigration = async (
await doWithDB(dbName, async (db: any) => {
try {
const doc = await exports.getMigrationsDoc(db)
const doc = await getMigrationsDoc(db)
// the migration has already been run
if (doc[migrationName]) {

View File

@ -1,13 +0,0 @@
import env from "./environment"
export function pinoSettings() {
return {
prettyPrint: {
levelFirst: true,
},
level: env.LOG_LEVEL || "error",
autoLogging: {
ignore: (req: { url: string }) => req.url.includes("/health"),
},
}
}

View File

@ -137,4 +137,4 @@ class InMemoryQueue {
}
}
export = InMemoryQueue
export default InMemoryQueue

View File

@ -276,4 +276,4 @@ class RedisWrapper {
}
}
export = RedisWrapper
export default RedisWrapper

View File

@ -1,7 +1,7 @@
const redis = require("../redis/init")
const { v4: uuidv4 } = require("uuid")
const { logWarn } = require("../logging")
const env = require("../environment")
import env from "../environment"
import {
Session,
ScannedSession,

View File

@ -1,9 +1,13 @@
export const getAccount = jest.fn()
export const getAccountByTenantId = jest.fn()
export const getStatus = jest.fn()
const mockGetAccount = jest.fn()
const mockGetAccountByTenantId = jest.fn()
const mockGetStatus = jest.fn()
jest.mock("../../../src/cloud/accounts", () => ({
getAccount,
getAccountByTenantId,
getStatus,
getAccount: mockGetAccount,
getAccountByTenantId: mockGetAccountByTenantId,
getStatus: mockGetStatus,
}))
export const getAccount = mockGetAccount
export const getAccountByTenantId = mockGetAccountByTenantId
export const getStatus = mockGetStatus

View File

@ -1,9 +1,8 @@
const processors = require("../../../src/events/processors")
import * as processors from "../../../src/events/processors"
import * as events from "../../../src/events"
jest.spyOn(processors.analyticsProcessor, "processEvent")
const events = require("../../../src/events")
jest.spyOn(events.identification, "identifyTenantGroup")
jest.spyOn(events.identification, "identifyUser")

View File

@ -22,6 +22,7 @@
"node_modules",
"dist",
"**/*.spec.ts",
"**/*.spec.js"
"**/*.spec.js",
"__mocks__"
]
}

View File

@ -12,6 +12,6 @@
],
"exclude": [
"node_modules",
"dist"
"dist",
]
}

View File

@ -482,11 +482,6 @@
qs "^6.11.0"
tough-cookie "^4.1.2"
"@budibase/types@2.2.12-alpha.2":
version "2.2.12-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.2.tgz#390959555517f11dc95147518e89f400c59dd520"
integrity sha512-Dz/3kdSkBRyf+AQyaPbAwq6hxD1kQuHht+4C3pyebbHUL440ZhZhJ1o2AAFc8SF1/9SqAk/NFaktAY2vCyRlOQ==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
@ -569,6 +564,13 @@
slash "^3.0.0"
strip-ansi "^6.0.0"
"@jest/create-cache-key-function@^27.4.2":
version "27.5.1"
resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.5.1.tgz#7448fae15602ea95c828f5eceed35c202a820b31"
integrity sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ==
dependencies:
"@jest/types" "^27.5.1"
"@jest/environment@^28.1.3":
version "28.1.3"
resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e"
@ -703,6 +705,17 @@
slash "^3.0.0"
write-file-atomic "^4.0.1"
"@jest/types@^27.5.1":
version "27.5.1"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80"
integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==
dependencies:
"@types/istanbul-lib-coverage" "^2.0.0"
"@types/istanbul-reports" "^3.0.0"
"@types/node" "*"
"@types/yargs" "^16.0.0"
chalk "^4.0.0"
"@jest/types@^28.1.1", "@jest/types@^28.1.3":
version "28.1.3"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b"
@ -889,6 +902,80 @@
dependencies:
"@sinonjs/commons" "^1.7.0"
"@swc/core-darwin-arm64@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.25.tgz#01ce7b8a88b545a4fc5283ed6f96b22c5733d6c4"
integrity sha512-8PWAVcjTJyj2VrqPBFOIi2w2P0Z8kOCbzHW3+pe+bSXxfGMG0MKPl5U2IXhsEL0ovm4xSFlqW0yygpoP3MmRPw==
"@swc/core-darwin-x64@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.25.tgz#9fad102c507011f42c5a5d1f84919b81ab96d7f8"
integrity sha512-5DHGiMYFEj5aa208tCjo7Sn5tiG4xPz+4gUiWVlglxqXFptkNim5xu/1G6VYm5Zk7dI5jJkjTU76GQG7IRvPug==
"@swc/core-linux-arm-gnueabihf@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.25.tgz#ecf3a34899fdbdc742523524caab29c0db97a6ad"
integrity sha512-YNfLxv9PhZk+jrJbpR1mMrYBUkufo0hiFv3S1OrX3l8edsIP4wPND5w9ZH0Oi898f6Jg9DBrY2zXJMQ+gWkbvA==
"@swc/core-linux-arm64-gnu@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.25.tgz#50524c9db2dbf874570e45f0a66e0283f02bc2d9"
integrity sha512-kS+spM5/xQ6QvWF1ms3byfjnhUlpjTfFwgCyHnIKgjvsYkDa+vkAIhKq6HuEdaTPaCRCjts0Zarhub1nClUU0g==
"@swc/core-linux-arm64-musl@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.25.tgz#f04a3d3784cff14f96ad9901861485ec0fa14ebf"
integrity sha512-vM3D7LWmjotUAJ2D4F+L+dspFeWrcPNVh0o8TCoTOYCt8DPD5YsUKTpIgOsZ+gReeWUAnNTh0Btx5pGGVfajGA==
"@swc/core-linux-x64-gnu@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.25.tgz#761fb020b8a0130e4dccc9c8dce355fa06df63f4"
integrity sha512-xUCLLMDlYa/zB8BftVa4SrxuVpcDxkltCfmBg5r2pZPVskhC5ZJsQZ/AvWNChoAB11shRhjTaWDlmxJEsa7TIg==
"@swc/core-linux-x64-musl@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.25.tgz#f944ee48c972ebdcb3e6d6fd62d67eb98dbb1268"
integrity sha512-QzHU3BIaUVRSFNsUn3Qxx1vgtF/f5NqsFMAAPSq9Y8Yq5nrlc2t7cNuOROxHLbUqE+NPUp6+RglleJMoeWz5mA==
"@swc/core-win32-arm64-msvc@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.25.tgz#af63ae850ef6e7322e8a5a0959529e96096239d2"
integrity sha512-77VSVtneVOAUL4zkRyQZ6pWVpTsVVdqwly/DKnRnloglGKxYuk5DG5MUBsL72Nnfv4OCHjZ27eI3NUrpLsUb2Q==
"@swc/core-win32-ia32-msvc@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.25.tgz#96a869aa4b4c41c44c9c9893ac4aad68d1233022"
integrity sha512-kz0v3K3H6OPEZR3ry72Ad/6C5GrZBRRUk69K58LORQ8tZXQD3UGl85pUbQqyHl8fR5NU76Muxgovj9CI9iTHGA==
"@swc/core-win32-x64-msvc@1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.25.tgz#9035c11626653322a404f3f44af11a02d989094c"
integrity sha512-nmQOAzIpNRRnupWzkenJmW4i+h1M76cVNUqEU2MjmtesEkRZEGqv//jefXiyCP2zcbeLNLKiB2ptVJhpd1BvRA==
"@swc/core@^1.3.25":
version "1.3.25"
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.25.tgz#53786ea51fac319684d6822de1738eb55b73a4b7"
integrity sha512-wqzvM/wu6OsTVYPMStOpm7kIQcPX3GoZ0sC85qzDdsCxmJ1rmItLAD91sXPUmmdk0XqPYjLgT9MRDEIP5woz4g==
optionalDependencies:
"@swc/core-darwin-arm64" "1.3.25"
"@swc/core-darwin-x64" "1.3.25"
"@swc/core-linux-arm-gnueabihf" "1.3.25"
"@swc/core-linux-arm64-gnu" "1.3.25"
"@swc/core-linux-arm64-musl" "1.3.25"
"@swc/core-linux-x64-gnu" "1.3.25"
"@swc/core-linux-x64-musl" "1.3.25"
"@swc/core-win32-arm64-msvc" "1.3.25"
"@swc/core-win32-ia32-msvc" "1.3.25"
"@swc/core-win32-x64-msvc" "1.3.25"
"@swc/jest@^0.2.24":
version "0.2.24"
resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.24.tgz#35d9377ede049613cd5fdd6c24af2b8dcf622875"
integrity sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q==
dependencies:
"@jest/create-cache-key-function" "^27.4.2"
jsonc-parser "^3.2.0"
"@szmarczak/http-timer@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
@ -1367,6 +1454,13 @@
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b"
integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==
"@types/yargs@^16.0.0":
version "16.0.5"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.5.tgz#12cc86393985735a283e387936398c2f9e5f88e3"
integrity sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==
dependencies:
"@types/yargs-parser" "*"
"@types/yargs@^17.0.8":
version "17.0.13"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76"
@ -3555,6 +3649,11 @@ json5@^2.2.1:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
jsonc-parser@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76"
integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==
jsonwebtoken@9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d"
@ -3889,9 +3988,9 @@ ltgt@2.2.1, ltgt@^2.1.2, ltgt@~2.2.0:
integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==
luxon@^3.0.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.2.1.tgz#14f1af209188ad61212578ea7e3d518d18cee45f"
integrity sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==
version "3.0.4"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.0.4.tgz#d179e4e9f05e092241e7044f64aaa54796b03929"
integrity sha512-aV48rGUwP/Vydn8HT+5cdr26YYQiUZ42NM6ToMoaGKwYfWbfLeRkEu1wXWMHBZT6+KyLfcbbtVcoQFCbbPjKlw==
make-dir@^3.0.0, make-dir@^3.1.0:
version "3.1.0"

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,6 @@
# yarn lockfile v1
"@adobe/spectrum-css-workflow-icons@1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@adobe/spectrum-css-workflow-icons/-/spectrum-css-workflow-icons-1.2.1.tgz#7e2cb3fcfb5c8b12d7275afafbb6ec44913551b4"
integrity sha512-uVgekyBXnOVkxp+CUssjN/gefARtudZC8duEn1vm0lBQFwGRZFlDEzU1QC+aIRWCrD1Z8OgRpmBYlSZ7QS003w==
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431"
@ -920,136 +915,6 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/bbui@2.2.10-alpha.13":
version "2.2.10-alpha.13"
resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-2.2.10-alpha.13.tgz#42bf24c5df4cea74a69fba571423fcf4527f16fa"
integrity sha512-l6TYaqizIxjIonqgyYewsEvWK+H+xwKTrJrQTHSsw5MWxKY+MZoh+i+pUM5tQKwpG0Z6kg3iZSYvm0GUk3HGFw==
dependencies:
"@adobe/spectrum-css-workflow-icons" "1.2.1"
"@budibase/string-templates" "2.2.10-alpha.13"
"@spectrum-css/actionbutton" "1.0.1"
"@spectrum-css/actiongroup" "1.0.1"
"@spectrum-css/avatar" "3.0.2"
"@spectrum-css/button" "3.0.1"
"@spectrum-css/buttongroup" "3.0.2"
"@spectrum-css/checkbox" "3.0.2"
"@spectrum-css/dialog" "3.0.1"
"@spectrum-css/divider" "1.0.3"
"@spectrum-css/dropzone" "3.0.2"
"@spectrum-css/fieldgroup" "3.0.2"
"@spectrum-css/fieldlabel" "3.0.1"
"@spectrum-css/icon" "3.0.1"
"@spectrum-css/illustratedmessage" "3.0.2"
"@spectrum-css/inlinealert" "2.0.1"
"@spectrum-css/inputgroup" "3.0.2"
"@spectrum-css/label" "2.0.10"
"@spectrum-css/link" "3.1.1"
"@spectrum-css/menu" "3.0.1"
"@spectrum-css/modal" "3.0.1"
"@spectrum-css/pagination" "3.0.3"
"@spectrum-css/picker" "1.0.1"
"@spectrum-css/popover" "3.0.1"
"@spectrum-css/progressbar" "1.0.2"
"@spectrum-css/progresscircle" "1.0.2"
"@spectrum-css/radio" "3.0.2"
"@spectrum-css/search" "3.0.2"
"@spectrum-css/sidenav" "3.0.2"
"@spectrum-css/slider" "3.0.1"
"@spectrum-css/statuslight" "3.0.2"
"@spectrum-css/stepper" "3.0.3"
"@spectrum-css/switch" "1.0.2"
"@spectrum-css/table" "3.0.1"
"@spectrum-css/tabs" "3.2.12"
"@spectrum-css/tags" "3.0.2"
"@spectrum-css/textfield" "3.0.1"
"@spectrum-css/toast" "3.0.1"
"@spectrum-css/tooltip" "3.0.3"
"@spectrum-css/treeview" "3.0.2"
"@spectrum-css/typography" "3.0.1"
"@spectrum-css/underlay" "2.0.9"
"@spectrum-css/vars" "3.0.1"
dayjs "^1.10.4"
easymde "^2.16.1"
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/client@2.2.10-alpha.13":
version "2.2.10-alpha.13"
resolved "https://registry.yarnpkg.com/@budibase/client/-/client-2.2.10-alpha.13.tgz#85983fa69b4079e56002e05428bcc832796ddd79"
integrity sha512-TsvIuy0RpjQ+SH7JYpqpdlPjinsv0fownpTlAIXxV/ig9GpS9wGtPIo9+ai45axtUcnAuvwFzNYLBF8j0NirvA==
dependencies:
"@budibase/bbui" "2.2.10-alpha.13"
"@budibase/frontend-core" "2.2.10-alpha.13"
"@budibase/string-templates" "2.2.10-alpha.13"
"@spectrum-css/button" "^3.0.3"
"@spectrum-css/card" "^3.0.3"
"@spectrum-css/divider" "^1.0.3"
"@spectrum-css/link" "^3.1.3"
"@spectrum-css/page" "^3.0.1"
"@spectrum-css/tag" "^3.1.4"
"@spectrum-css/typography" "^3.0.2"
"@spectrum-css/vars" "^3.0.1"
apexcharts "^3.22.1"
dayjs "^1.10.5"
downloadjs "1.4.7"
html5-qrcode "^2.2.1"
leaflet "^1.7.1"
regexparam "^1.3.0"
sanitize-html "^2.7.0"
screenfull "^6.0.1"
shortid "^2.2.15"
socket.io-client "^4.5.1"
svelte "^3.49.0"
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
svelte-spa-router "^3.0.5"
"@budibase/frontend-core@2.2.10-alpha.13":
version "2.2.10-alpha.13"
resolved "https://registry.yarnpkg.com/@budibase/frontend-core/-/frontend-core-2.2.10-alpha.13.tgz#b6f49e65532eee31a19a6991740c9f55220271a9"
integrity sha512-iXDtSec2VHbDFwLkXOm7L8oah1CDBd3rrNbEnkL/8FyAIeguLp5iSwojtTWZ+wn+ZRa7yLwQDdqXIGVkj1XahA==
dependencies:
"@budibase/bbui" "2.2.10-alpha.13"
lodash "^4.17.21"
svelte "^3.46.2"
"@budibase/handlebars-helpers@^0.11.8":
version "0.11.8"
resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841"
integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ==
dependencies:
array-sort "^1.0.0"
define-property "^2.0.2"
extend-shallow "^3.0.2"
for-in "^1.0.2"
get-object "^0.2.0"
get-value "^3.0.1"
handlebars "^4.7.7"
handlebars-utils "^1.0.6"
has-value "^2.0.2"
helper-md "^0.2.2"
html-tag "^2.0.0"
is-even "^1.0.0"
is-glob "^4.0.1"
kind-of "^6.0.3"
micromatch "^3.1.5"
relative "^3.0.2"
striptags "^3.1.1"
to-gfm-code-block "^0.1.1"
year "^0.2.1"
"@budibase/string-templates@2.2.10-alpha.13":
version "2.2.10-alpha.13"
resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-2.2.10-alpha.13.tgz#5b8c21542c0f9e7ec23ae266dbf7de30b45e82e2"
integrity sha512-RbFz9ARAqx/LrR74QTy/DuDRFkOsUkQh5sHpiecpmTSvGAXcS7NGDGSKQUaDrDP0pCtYrBD5mfEeFdD00YdYrQ==
dependencies:
"@budibase/handlebars-helpers" "^0.11.8"
dayjs "^1.10.4"
handlebars "^4.7.6"
handlebars-utils "^1.0.6"
lodash "^4.17.20"
vm2 "^3.9.4"
"@cnakazawa/watch@^1.0.3":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a"
@ -1491,130 +1356,6 @@
dependencies:
"@sinonjs/commons" "^1.7.0"
"@socket.io/component-emitter@~3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==
"@spectrum-css/actionbutton@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/actionbutton/-/actionbutton-1.0.1.tgz#9c75da37ea6915919fb574c74bd60dacc03b6577"
integrity sha512-AUqtyNabHF451Aj9i3xz82TxS5Z6k1dttA68/1hMeU9kbPCSS4P6Viw3vaRGs9CSspuR8xnnhDgrq+F+zMy2Hw==
"@spectrum-css/actiongroup@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/actiongroup/-/actiongroup-1.0.1.tgz#b95b86e7af229e90fe1e70399d8d4b547b4bd31c"
integrity sha512-5Q6uMjzv5BFA2TwGASr/jAtJpTWl26fhWvgGY8kOA0RCSij35l+YJg/FPXf6Nnj2qCOl8DkNycjT9YXJ+bhyVA==
"@spectrum-css/avatar@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/avatar/-/avatar-3.0.2.tgz#4f1826223eae330e64b6d3cc899e9bc2e98dac95"
integrity sha512-wEczvSqxttTWSiL3cOvXV/RmGRwSkw2w6+slcHhnf0kb7ovymMM+9oz8vvEpEsSeo5u598bc+7ktrKFpAd6soQ==
"@spectrum-css/button@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/button/-/button-3.0.1.tgz#6db8c3e851baecd0f1c2d88fef37d49d01c6e643"
integrity sha512-YXrBtjIYisk4Vaxnp0RiE4gdElQX04P2mc4Pi2GlQ27dJKlHmufYcF+kAqGdtiyK5yjdN/vKRcC8y13aA4rusA==
"@spectrum-css/button@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/button/-/button-3.0.3.tgz#2df1efaab6c7e0b3b06cb4b59e1eae59c7f1fc84"
integrity sha512-6CnLPqqtaU/PcSSIGeGRi0iFIIxIUByYLKFO6zn5NEUc12KQ28dJ4PLwB6WBa0L8vRoAGlnWWH2ZZweTijbXgg==
"@spectrum-css/buttongroup@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/buttongroup/-/buttongroup-3.0.2.tgz#fd3387973ca3131609e32112de42a1c0400a48d8"
integrity sha512-Wu7B4GJ/SAeVHz9SUGAkeIH8pLaZh4t+w2ykSKOPQIRuK2jCBoudkEClVxviNVwqekccf5XLFXg9GpYF1a3Uaw==
"@spectrum-css/card@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/card/-/card-3.0.3.tgz#56b2e2da6b80c1583228baa279de7407383bfb6b"
integrity sha512-+oKLUI2a0QmQP9EzySeq/G4FpUkkdaDNbuEbqCj2IkPMc/2v/nwzsPhh1fj2UIghGAiiUwXfPpzax1e8fyhQUg==
"@spectrum-css/checkbox@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/checkbox/-/checkbox-3.0.2.tgz#53ca2fba0d9faa1fead10e7206eb1f6cdcfd6ddd"
integrity sha512-hPbGcnm7kJvJS4jp/P/bdaZvbyR1eIE9mteuZqcBgdmyp9m/k6+mW5jmsbtqb3Y4mMPWvOJFfz/sIvWJP0F0Zg==
"@spectrum-css/dialog@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/dialog/-/dialog-3.0.1.tgz#33aae036282159f6aa998848b8c0828640a9620a"
integrity sha512-hUFbRR6RGT63MNuP7wP+k9KU+uRuICsduMihskh700e+jiQ+Gsv53fBFDlB843FoZYlIXzFQXgtjMUC5a4Qibw==
"@spectrum-css/divider@1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/divider/-/divider-1.0.3.tgz#639e2ebaa0834efa40f42397668bbd5c153ea385"
integrity sha512-Zy4Rn40w8UtzMh3wx/U9+CepSCpm1aOCGftHgWDub0XZuVTzh0c1WwyzTuLCx2Hf21z5VRGNiDh8bGEEzSbtNA==
dependencies:
"@spectrum-css/vars" "^3.0.2"
"@spectrum-css/divider@^1.0.3":
version "1.0.27"
resolved "https://registry.yarnpkg.com/@spectrum-css/divider/-/divider-1.0.27.tgz#435bf738a65b4eb15c899edf5c536bea22f2d679"
integrity sha512-hWKPHOEo9lkOGN5zecpVVwVxE3x0SJHQJKDNx1g0xs/P/AthAboK+L1c9Rq29czNfcQ2kUjumi4igzQzcqABMQ==
dependencies:
"@spectrum-css/vars" "^8.0.0"
"@spectrum-css/dropzone@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/dropzone/-/dropzone-3.0.2.tgz#34f137851054442b219fed7f32006b93fc5e0bcf"
integrity sha512-BuBBzm5re6lM0AWgd6V+mI5eEGnnmFEtcFiJBEn9jYNEQYgflFhvnERUt89jMX5WmspiecwI2JBWJFrtFsOzug==
"@spectrum-css/fieldgroup@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/fieldgroup/-/fieldgroup-3.0.2.tgz#1c1afd3c444d8650fefac275dc66a7a913933846"
integrity sha512-Vyw0kQJdLW18J6w4H+YAsoLntvkw5rXmW3CH5H3SDTXkBztxtHSSe3e106Nw5MoZxTfHlom6CxbYXYCTjQfqGw==
"@spectrum-css/fieldlabel@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/fieldlabel/-/fieldlabel-3.0.1.tgz#39f7c0f25cc2ff402afeff005341b0832f7c588c"
integrity sha512-LMfwrwIq8wEEvxFLobdLvXRwKrp8o9Fty4iJ9aYl2Rj1uXkfRd8qLz9HGZjLEE1OuJgoTBgamYABl7EvoA5PLw==
"@spectrum-css/icon@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/icon/-/icon-3.0.1.tgz#e300a6fc353c85c6b5d6e7a364408a940c31b177"
integrity sha512-cGFtIrcQ/7tthdkHK1npuEFiCdYVHLqwmLxghUYQw8Tb8KgJaw3OBO1tpjgsUizexNgu26BjVRIbGxNWuBXIHQ==
"@spectrum-css/illustratedmessage@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/illustratedmessage/-/illustratedmessage-3.0.2.tgz#6a480be98b027e050b086e7899e40d87adb0a8c0"
integrity sha512-dqnE8X27bGcO0HN8+dYx8O4o0dNNIAqeivOzDHhe2El+V4dTzMrNIerF6G0NLm3GjVf6XliwmitsZK+K6FmbtA==
"@spectrum-css/inlinealert@2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/inlinealert/-/inlinealert-2.0.1.tgz#7521f88f6c845806403cc7d925773c7414e204a2"
integrity sha512-Xy5RCOwgurqUXuGQCsEDUduDd5408bmEpmFg+feynG7VFUgLFZWBeylSENB/OqjlFtO76PHXNVdHkhDscPIHTA==
"@spectrum-css/inputgroup@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/inputgroup/-/inputgroup-3.0.2.tgz#f1b13603832cbd22394f3d898af13203961f8691"
integrity sha512-O0G3Lw9gxsh8gTLQWIAKkN1O8cWhjpEUl+oR1PguIKFni72uNr2ikU9piOwy/r0gJG2Q/TVs6hAshoAAkmsSzw==
"@spectrum-css/label@2.0.10":
version "2.0.10"
resolved "https://registry.yarnpkg.com/@spectrum-css/label/-/label-2.0.10.tgz#2368651d7636a19385b5d300cdf6272db1916001"
integrity sha512-xCbtEiQkZIlLdWFikuw7ifDCC21DOC/KMgVrrVJHXFc4KRQe9LTZSqmGF3tovm+CSq1adE59mYoTbojVQ9YuEQ==
"@spectrum-css/link@3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/link/-/link-3.1.1.tgz#cb526a2e10b50ef5a7ae29cca7272e2610d597eb"
integrity sha512-Bi88lRhTY7g6nM/ryW1yY4Cji211ZYNtRxkxbV7n2lPvwMAAQtyx0qVD3ru4kTGj/FFVvmPR3XiOE10K13HSNA==
"@spectrum-css/link@^3.1.3":
version "3.1.23"
resolved "https://registry.yarnpkg.com/@spectrum-css/link/-/link-3.1.23.tgz#9d9ff64c41366edbfdb19d04a5deec88bf2ea8fd"
integrity sha512-CAJQGnGTrTtR4tF1L94ou9Y+c4vnx9d5rWhb3AMzKb2Focqz02xSkTyaCCH7OM/3CwD8TCLOMANon8LcRpGAjA==
"@spectrum-css/menu@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/menu/-/menu-3.0.1.tgz#2a376f991acc24e12ec892bb6b9db2650fc41fbe"
integrity sha512-Qjg0+1O0eC89sb/bRFq2AGnQ8XqhVy23TUXHyffNM8qdcMssnlny3QmhzjURCZKvx/Y5UytCpzhedPQqSpQwZg==
"@spectrum-css/modal@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/modal/-/modal-3.0.1.tgz#613a6b83d0330a4d38db41a98090800751c56d8d"
integrity sha512-F7D99F3cjDGT9DM9sogx/p49jrNYT7a1J6TUoqV73wUf+0gP+dTsskBOo9jB8VbUE+POQPjiDLB+SWLp6iBB+w==
"@spectrum-css/page@^3.0.1":
version "3.0.8"
resolved "https://registry.yarnpkg.com/@spectrum-css/page/-/page-3.0.8.tgz#001efa9e4c10095df9b2b37cf7d7d6eb60140190"
@ -1622,127 +1363,7 @@
dependencies:
"@spectrum-css/vars" "^4.3.0"
"@spectrum-css/pagination@3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/pagination/-/pagination-3.0.3.tgz#b204c3ada384c4af751a354bc428346d82eeea65"
integrity sha512-OJ/v9GeNXJOZ9Yr9LDBYPrR2NCiLOWP9wANT/a5sqFuugRnQbn/HYMnRp9TBxwpDY6ihaPo0T/wi7kLiAJFdDw==
"@spectrum-css/picker@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/picker/-/picker-1.0.1.tgz#98991198576d26bd14160824e7b6f3c278ff930b"
integrity sha512-Rv4/UBOdNW1gs7WVBCJnPD5VFly8MqP++psDX6kcugUIcfJy0GC3acvElotmKRlCDk8Qxks2W2A0jKeSgphTmA==
"@spectrum-css/popover@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/popover/-/popover-3.0.1.tgz#5863c1efc53f98f9aba2de9186666780041303fc"
integrity sha512-LmOSj/yCwQQ9iGmCYnHiJsJR/HfPiGqI1Jl7pkKxBOCxYBMS/5+ans9vfCN2Qnd0eK7WSbfPg72S6mjye7db2Q==
"@spectrum-css/progressbar@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/progressbar/-/progressbar-1.0.2.tgz#b5a59432517f9ae6dad49d9504691bc5ac42b424"
integrity sha512-+jExeBLtVCqo3BqtFq5WCtZ028Dzk+oUnX6y4z6ZamKPqOyOELOtFnhYnyhyRndQOqYwKUTXx9zsaWA/lpJOHw==
"@spectrum-css/progresscircle@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/progresscircle/-/progresscircle-1.0.2.tgz#258ea9170fb70f795edda03e38a61d93bef4487c"
integrity sha512-JLULpyzjIY95lzlWR1yE1gv4l1K6p+scQ+edmuZZUHBzwM3pUtkvHJmUlA9TYdResUYW6Uka60VRdY6lZ8gnFQ==
"@spectrum-css/radio@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/radio/-/radio-3.0.2.tgz#9c1386894920bbed604e4e174fbbd45d9d762152"
integrity sha512-0TDdzC9omNXnpKHEXNuuGeXdNh4x8jvTKVUqMRLb7vY4hY94hAdt6X01NBqka+jzK35HxGzpDdPADAz62yZLPQ==
"@spectrum-css/search@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/search/-/search-3.0.2.tgz#70e93e321032d40b399498b2324e3b70e050551e"
integrity sha512-3UbT8yZmNOwrZxq+CUmumE+26ZySZ8OoKNM6U20SLMPLgdx6MrRugVE88r3Bl0sJ0RZX/5bU8nausdiHeX+Jlw==
"@spectrum-css/sidenav@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/sidenav/-/sidenav-3.0.2.tgz#9d70f408d588ee79c69857751010333671f32713"
integrity sha512-YpIdH/F0jEICYmoduGrnkTmxwJq1kfKxEp0wOs+ZkQOsvKMv1an7nyhsfOKCQqcGNfYzJ9mJAk7/u5+vsxHa8g==
"@spectrum-css/slider@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/slider/-/slider-3.0.1.tgz#5281e6f47eb5a4fd3d1816c138bf66d01d7f2e49"
integrity sha512-DI2dtMRnQuDM1miVzl3SGyR1khUEKnwdXfO5EHDFwkC3yav43F5QogkfjmjFmWWobMVovdJlAuiaaJ/IHejD0Q==
"@spectrum-css/statuslight@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/statuslight/-/statuslight-3.0.2.tgz#dc54b6cd113413dcdb909c486b5d7bae60db65c5"
integrity sha512-xodB8g8vGJH20XmUj9ZsPlM1jHrGeRbvmVXkz0q7YvQrYAhim8pP3W+XKKZAletPFAuu8cmUOc6SWn6i4X4z6w==
"@spectrum-css/stepper@3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/stepper/-/stepper-3.0.3.tgz#ae89846886431e3edeee060207b8f81540f73a34"
integrity sha512-prAD61ImlOTs9b6PfB3cB08x4lAfxtvnW+RZiTYky0E8GgZdrc/MfCkL5/oqQaIQUtyQv/3Lb7ELAf/0K8QTXw==
"@spectrum-css/switch@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/switch/-/switch-1.0.2.tgz#f0b4c69271964573e02b08e90998096e49e1de44"
integrity sha512-zqmHpgWPNg1gEwdUNFYV3CBX5JaeALfIqcJIxE0FLZqr9d1C4+oLE0ItIFzt1bwr4bFAOmkEpvtiY+amluzGxQ==
"@spectrum-css/table@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/table/-/table-3.0.1.tgz#753e0e2498082c0c36b9600828516aff3ac338cd"
integrity sha512-XQ+srMTv9hK1H0nctWUtqyzitmvyb5TNR+7mjAmKRdkBRSTQQSipDhenxZp72ekzMtMoSYZVZ77kgo0Iw3Fpug==
"@spectrum-css/tabs@3.2.12":
version "3.2.12"
resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.12.tgz#9b08f23d5aa881b3441af7757800c7173e5685ff"
integrity sha512-rPFUW9SSW4+3/UJ3UrtY2/l3sQvlqB1fqxHLPDjgykvbfrnMejcCTNV4ZrFNHXpE/6+kGnk+yVViSPtWGwJzkA==
"@spectrum-css/tag@^3.1.4":
version "3.3.15"
resolved "https://registry.yarnpkg.com/@spectrum-css/tag/-/tag-3.3.15.tgz#971184fd8cb977b85a529f808313851863123278"
integrity sha512-pF6Wh61Z7hmAy20twIlpjdDuivYj6UPtWIzK7giyJKr/qcn20BjVN2ChIeFB1N+vBamJdLsuQOewv4AJ3+LZ2Q==
"@spectrum-css/tags@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/tags/-/tags-3.0.2.tgz#5bf35fb79c97cd9344de485bd4626ad5b9f07757"
integrity sha512-HbvMk+QHvCDD1/ScvSErpKROcpAbXuMD4Hl/Gz/1A1lQ0fJ/CJeCq/MMsL7zjK1nlItU/ySu8r8KIuRF+6F8SQ==
"@spectrum-css/textfield@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/textfield/-/textfield-3.0.1.tgz#e875b8e37817378ad08fc4af7d53026df38911e5"
integrity sha512-MUV5q87CVxbkNdSNoxGrFbgyKc51ft/WWf3aVEoPdPw5yBnXqFe1w1YmAit5zYDOOhhs58sCLAlUcCMlOpkgrA==
"@spectrum-css/toast@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/toast/-/toast-3.0.1.tgz#36f62ea05302761e59b9d53e05f6c04423861796"
integrity sha512-jov++S358BrN2tmMfaoYk1N6u9HojgeuQk61keXrK2m3VE5/n94x7Lg3kIPeSWO0odyDfBlMqT9jacbRey3QTg==
"@spectrum-css/tooltip@3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@spectrum-css/tooltip/-/tooltip-3.0.3.tgz#26b8ca3b3d30e29630244d85eb4fc11d0c841281"
integrity sha512-ztRF7WW1FzyNavXBRc+80z67UoOrY9wl3cMYsVD3MpDnyxdzP8cjza1pCcolKBaFqRTcQKkxKw3GWtGICRKR5A==
"@spectrum-css/treeview@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/treeview/-/treeview-3.0.2.tgz#d54d8f17290babb1c885f5d9355e225421beb0d2"
integrity sha512-foO7UBJv1JMFaKgDPVt8jBghZSVbqhXR8TaGaxHSnMubv7ygmKkc1AITrWC2STILCn84ju2vchOohMZfW6sYwg==
"@spectrum-css/typography@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/typography/-/typography-3.0.1.tgz#957dafd9b18c314fa37a88b549042ba2175f5b3f"
integrity sha512-XyR68K2rIZX3u4j7HhMLOqLVHDJZcapp3XUqgYMzMWccBFleA0qPxKpfRWqVIA5DzTMSIw0wEcZPYKWFZ2e6dA==
"@spectrum-css/typography@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/typography/-/typography-3.0.2.tgz#ea3ca0a60e18064527819d48c8c4364cab4fcd38"
integrity sha512-5ZOLmQe0edzsDMyhghUd4hBb5uxGsFrxzf+WasfcUw9klSfTsRZ09n1BsaaWbgrLjlMQ+EEHS46v5VNo0Ms2CA==
"@spectrum-css/underlay@2.0.9":
version "2.0.9"
resolved "https://registry.yarnpkg.com/@spectrum-css/underlay/-/underlay-2.0.9.tgz#fc10f971d1325cc844b727e6260f7217844060e8"
integrity sha512-X86xd0PG4QobmUyXA90BFGnyygaI8kW64dA4ysf4z0cOvUWjNbAAl3a/DB/WRyrnp63Zqv83T/cgNbetagTbWg==
"@spectrum-css/vars@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-3.0.1.tgz#561fd69098f896a647242dd8d6108af603bfa31e"
integrity sha512-l4oRcCOqInChYXZN6OQhpe3isk6l4OE6Ys8cgdlsiKp53suNoQxyyd9p/eGRbCjZgH3xQ8nK0t4DHa7QYC0S6w==
"@spectrum-css/vars@^3.0.1", "@spectrum-css/vars@^3.0.2":
"@spectrum-css/vars@^3.0.1":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-3.0.2.tgz#ea9062c3c98dfc6ba59e5df14a03025ad8969999"
integrity sha512-vzS9KqYXot4J3AEER/u618MXWAS+IoMvYMNrOoscKiLLKYQWenaueakUWulFonToPd/9vIpqtdbwxznqrK5qDw==
@ -1863,18 +1484,6 @@
dependencies:
"@babel/types" "^7.3.0"
"@types/codemirror@^5.60.4":
version "5.60.6"
resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.6.tgz#0511ed51d087ad2a2eedb6111fc74e739c4549f6"
integrity sha512-JIDPSvkYRlcv/2F0erqD+de2ni/Mz6FJMEGb0vwF6ByQOcHIKfiEfwrO4d6dSRwYeHyNUMpGjev0PyjX2M0XWw==
dependencies:
"@types/tern" "*"
"@types/estree@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
@ -1929,11 +1538,6 @@
jest-diff "^27.0.0"
pretty-format "^27.0.0"
"@types/marked@^4.0.7":
version "4.0.8"
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.8.tgz#b316887ab3499d0a8f4c70b7bd8508f92d477955"
integrity sha512-HVNzMT5QlWCOdeuBsgXP8EZzKUf0+AXzN+sLmjvaB3ZlLqO+e4u0uXrdw9ub69wBKFs+c6/pA4r9sy6cCDvImw==
"@types/minimatch@*":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
@ -2619,11 +2223,6 @@ codemirror@^5.59.0:
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.63.3.tgz#97042a242027fe0c87c09b36bc01931d37b76527"
integrity sha512-1C+LELr+5grgJYqwZKqxrcbPsHFHapVaVAloBsFBASbpLnQqLw1U8yXJ3gT5D+rhxIiSpo+kTqN+hQ+9ialIXw==
codemirror@^5.63.1:
version "5.65.11"
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.11.tgz#c818edc3274788c008f636520c5490a1f7009b4f"
integrity sha512-Gp62g2eKSCHYt10axmGhKq3WoJSvVpvhXmowNq7pZdRVowwtvBR/hi2LSP5srtctKkRT33T6/n8Kv1UGp7JW4A==
collect-v8-coverage@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59"
@ -2891,11 +2490,6 @@ dayjs@^1.10.4:
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==
dayjs@^1.10.5:
version "1.11.7"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
dayjs@^1.11.2:
version "1.11.2"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.2.tgz#fa0f5223ef0d6724b3d8327134890cfe3d72fbe5"
@ -3025,20 +2619,6 @@ dom-accessibility-api@^0.5.6:
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz#caa6d08f60388d0bb4539dd75fe458a9a1d0014c"
integrity sha512-Xu9mD0UjrJisTmv7lmVSDMagQcU9R5hwAbxsaAE/35XPnPLJobbuREfV/rraiSaEj/UOvgrzQs66zyTWTlyd+g==
dom-serializer@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53"
integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==
dependencies:
domelementtype "^2.3.0"
domhandler "^5.0.2"
entities "^4.2.0"
domelementtype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d"
integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==
domexception@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304"
@ -3046,22 +2626,6 @@ domexception@^2.0.1:
dependencies:
webidl-conversions "^5.0.0"
domhandler@^5.0.1, domhandler@^5.0.2:
version "5.0.3"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31"
integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==
dependencies:
domelementtype "^2.3.0"
domutils@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c"
integrity sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==
dependencies:
dom-serializer "^2.0.0"
domelementtype "^2.3.0"
domhandler "^5.0.1"
dotenv@^8.2.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
@ -3114,16 +2678,6 @@ enquirer@^2.3.6:
dependencies:
ansi-colors "^4.1.1"
ent@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==
entities@^4.2.0, entities@^4.3.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174"
integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==
error-ex@^1.3.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
@ -3878,29 +3432,6 @@ html-escaper@^2.0.0:
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
html-tag@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/html-tag/-/html-tag-2.0.0.tgz#36c3bc8d816fd30b570d5764a497a641640c2fed"
integrity sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g==
dependencies:
is-self-closing "^1.0.1"
kind-of "^6.0.0"
html5-qrcode@^2.2.1:
version "2.3.4"
resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.3.4.tgz#7e2b4575a23b10ff5e26d2bf147c8027c1ece389"
integrity sha512-VPZrOTG8XR9HmIAhSSiGtJVPErZxKy/DuGc9cPQLburCWZEbvxQGJP9y4K4P+8vdalLtYB/vM5YP1BdWQKZ8jQ==
htmlparser2@^8.0.0:
version "8.0.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.1.tgz#abaa985474fcefe269bc761a779b544d7196d010"
integrity sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==
dependencies:
domelementtype "^2.3.0"
domhandler "^5.0.2"
domutils "^3.0.1"
entities "^4.3.0"
http-proxy-agent@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a"
@ -4991,11 +4522,6 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
marked@^4.1.0:
version "4.2.5"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d"
integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ==
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@ -5476,15 +5002,6 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
postcss@^8.3.11:
version "8.4.20"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56"
integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==
dependencies:
nanoid "^3.3.4"
picocolors "^1.0.0"
source-map-js "^1.0.2"
postcss@^8.4.16:
version "8.4.16"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c"
@ -5889,18 +5406,6 @@ sane@^4.0.3:
minimist "^1.1.1"
walker "~1.0.5"
sanitize-html@^2.7.0:
version "2.8.1"
resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.8.1.tgz#319c4fdba67e1edf35b1fd6d9362210044826d47"
integrity sha512-qK5neD0SaMxGwVv5txOYv05huC3o6ZAA4h5+7nJJgWMNFUNRjcjLO6FpwAtKzfKCZ0jrG6xTk6eVFskbvOGblg==
dependencies:
deepmerge "^4.2.2"
escape-string-regexp "^4.0.0"
htmlparser2 "^8.0.0"
is-plain-object "^5.0.0"
parse-srcset "^1.0.2"
postcss "^8.3.11"
saxes@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d"
@ -6306,23 +5811,6 @@ svelte-portal@0.1.0:
resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-0.1.0.tgz#cc2821cc84b05ed5814e0218dcdfcbebc53c1742"
integrity sha512-kef+ksXVKun224mRxat+DdO4C+cGHla+fEcZfnBAvoZocwiaceOfhf5azHYOPXSSB1igWVFTEOF3CDENPnuWxg==
svelte-portal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3"
integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q==
svelte-spa-router@^3.0.5:
version "3.3.0"
resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-3.3.0.tgz#2fc0967a49dc361dfe4d38dddad6e662eed5b42c"
integrity sha512-cwRNe7cxD43sCvSfEeaKiNZg3FCizGxeMcf7CPiWRP3jKXjEma3vxyyuDtPOam6nWbVxl9TNM3hlE/i87ZlqcQ==
dependencies:
regexparam "2.0.1"
svelte@^3.46.2, svelte@^3.49.0:
version "3.55.0"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.55.0.tgz#29cb958750a23e751309a6535ccd811fcabc9038"
integrity sha512-uGu2FVMlOuey4JoKHKrpZFkoYyj0VLjJdz47zX5+gVK5odxHM40RVhar9/iK2YFRVxvfg9FkhfVlR0sjeIrOiA==
svelte@^3.48.0:
version "3.49.0"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.49.0.tgz#5baee3c672306de1070c3b7888fc2204e36a4029"
@ -6690,14 +6178,6 @@ vite@^3.0.8:
optionalDependencies:
fsevents "~2.3.2"
vm2@^3.9.4:
version "3.9.13"
resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.13.tgz#774a1a3d73b9b90b1aa45bcc5f25e349f2eef649"
integrity sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==
dependencies:
acorn "^8.7.0"
acorn-walk "^8.2.0"
w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,18 @@ import { Config } from "@jest/types"
import * as fs from "fs"
const config: Config.InitialOptions = {
preset: "ts-jest",
testEnvironment: "node",
setupFiles: ["./src/tests/jestSetup.ts"],
setupFiles: ["./src/tests/jestEnv.ts"],
setupFilesAfterEnv: ["./src/tests/jestSetup.ts"],
collectCoverageFrom: [
"src/**/*.{js,ts}",
// The use of coverage with couchdb view functions breaks tests
"!src/db/views/staticViews.*",
],
coverageReporters: ["lcov", "json", "clover"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
}
if (!process.env.CI) {

View File

@ -123,6 +123,8 @@
"@babel/preset-env": "7.16.11",
"@budibase/standard-components": "^0.9.139",
"@jest/test-sequencer": "24.9.0",
"@swc/core": "^1.3.25",
"@swc/jest": "^0.2.24",
"@types/apidoc": "0.50.0",
"@types/bson": "4.2.0",
"@types/global-agent": "2.1.1",

View File

@ -4,12 +4,12 @@ import { Thread, ThreadType } from "../../../threads"
import { save as saveDatasource } from "../datasource"
import { RestImporter } from "./import"
import { invalidateDynamicVariables } from "../../../threads/utils"
import { QUERY_THREAD_TIMEOUT } from "../../../environment"
import env from "../../../environment"
import { quotas } from "@budibase/pro"
import { events, context, utils, constants } from "@budibase/backend-core"
const Runner = new Thread(ThreadType.QUERY, {
timeoutMs: QUERY_THREAD_TIMEOUT || 10000,
timeoutMs: env.QUERY_THREAD_TIMEOUT || 10000,
})
// simple function to append "readable" to all read queries

View File

@ -10,7 +10,7 @@ const {
NODE_MODULES_PATH,
TOP_LEVEL_PATH,
} = require("../../../utilities/fileSystem")
const env = require("../../../environment")
import env from "../../../environment"
const { DocumentType } = require("../../../db/utils")
const { context, objectStore, utils } = require("@budibase/backend-core")
const AWS = require("aws-sdk")

View File

@ -3,7 +3,7 @@ import { getRowParams, generateTableID } from "../../../db/utils"
import { FieldTypes } from "../../../constants"
import { TableSaveFunctions, hasTypeChanged, handleDataImport } from "./utils"
import { context } from "@budibase/backend-core"
import { isTest } from "../../../environment"
import env from "../../../environment"
import {
cleanupAttachments,
fixAutoColumnSubType,
@ -13,7 +13,6 @@ import { Table } from "@budibase/types"
import { quotas } from "@budibase/pro"
import { isEqual } from "lodash"
import { cloneDeep } from "lodash/fp"
import env from "../../../environment"
import sdk from "../../../sdk"
function checkAutoColumns(table: Table, oldTable: Table) {
@ -164,7 +163,7 @@ export async function destroy(ctx: any) {
await db.remove(tableToDelete._id, tableToDelete._rev)
// remove table search index
if (!isTest() || env.COUCH_DB_URL) {
if (!env.isTest() || env.COUCH_DB_URL) {
const currentIndexes = await db.getIndexes()
const existingIndex = currentIndexes.indexes.find(
(existing: any) => existing.name === `search:${ctx.params.tableId}`

View File

@ -1,4 +1,4 @@
const viewTemplate = require("../viewBuilder");
const viewTemplate = require("../viewBuilder").default;
describe("viewBuilder", () => {

View File

@ -136,7 +136,7 @@ function parseEmitExpression(field: string, groupBy: string) {
* filters: Array of filter objects containing predicates that are parsed into a JS expression
* calculation: an optional calculation to be performed over the view data.
*/
export = function ({
export default function ({
field,
tableId,
groupBy,

View File

@ -6,4 +6,4 @@ const router: Router = new Router()
router.get("/api/bbtel", controller.isEnabled)
router.post("/api/bbtel/ping", controller.ping)
export = router
export default router

View File

@ -9,4 +9,4 @@ router
.get("/api/keys", authorized(permissions.BUILDER), controller.fetch)
.put("/api/keys/:key", authorized(permissions.BUILDER), controller.update)
export = router
export default router

View File

@ -54,4 +54,4 @@ router
controller.destroy
)
export = router
export default router

View File

@ -5,4 +5,4 @@ const router: Router = new Router()
router.get("/api/self", controller.fetchSelf)
export = router
export default router

View File

@ -84,4 +84,4 @@ router
controller.test
)
export = router
export default router

View File

@ -11,4 +11,4 @@ router.get(
controller.exportAppDump
)
export = router
export default router

View File

@ -15,4 +15,4 @@ router
.post("/api/cloud/import", controller.importApps)
.get("/api/cloud/import/complete", controller.hasBeenImported)
export = router
export default router

View File

@ -11,4 +11,4 @@ router.get(
controller.fetchAppComponentDefinitions
)
export = router
export default router

View File

@ -57,4 +57,4 @@ router
datasourceController.destroy
)
export = router
export default router

View File

@ -17,4 +17,4 @@ router
controller.deploymentProgress
)
export = router
export default router

View File

@ -35,4 +35,4 @@ router
controller.revert
)
export = router
export default router

View File

@ -13,4 +13,4 @@ router
controller.find
)
export = router
export default router

View File

@ -13,4 +13,4 @@ router
controller.destroy
)
export = router
export default router

View File

@ -35,4 +35,4 @@ router
controller.getMetadata
)
export = router
export default router

View File

@ -11,4 +11,4 @@ router
auth.internalApi,
migrationsController.fetchDefinitions
)
export = router
export default router

View File

@ -38,4 +38,4 @@ router
controller.removePermission
)
export = router
export default router

View File

@ -58,4 +58,4 @@ router
queryController.executeV2 as any
)
export = router
export default router

View File

@ -21,4 +21,4 @@ router
controller.destroy
)
export = router
export default router

View File

@ -11,4 +11,4 @@ router
// gets the full structure, not just the correct screen ID for user role
.get("/api/routing", authorized(permissions.BUILDER), controller.fetch)
export = router
export default router

View File

@ -20,4 +20,4 @@ router
controller.destroy
)
export = router
export default router

View File

@ -7,4 +7,4 @@ const router: Router = new Router()
router.post("/api/script", authorized(permissions.BUILDER), controller.save)
export = router
export default router

View File

@ -3,7 +3,7 @@ import * as controller from "../controllers/static"
import { budibaseTempDir } from "../../utilities/budibaseDir"
import authorized from "../../middleware/authorized"
import { permissions } from "@budibase/backend-core"
import * as env from "../../environment"
import env from "../../environment"
import { paramResource } from "../../middleware/resourceId"
const { BUILDER, PermissionType, PermissionLevel } = permissions
@ -62,4 +62,4 @@ router
controller.getSignedUploadURL
)
export = router
export default router

View File

@ -190,4 +190,4 @@ router
tableController.bulkImport
)
export = router
export default router

View File

@ -13,4 +13,4 @@ router
controller.downloadTemplate
)
export = router
export default router

View File

@ -1,8 +1,3 @@
let mockObjectStore = jest.fn().mockImplementation(() => {
return [{ name: "test.js" }]
})
let deleteFolder = jest.fn().mockImplementation()
jest.mock("@budibase/backend-core", () => {
const core = jest.requireActual("@budibase/backend-core")
return {
@ -10,15 +5,20 @@ jest.mock("@budibase/backend-core", () => {
objectStore: {
...core.objectStore,
upload: jest.fn(),
uploadDirectory: mockObjectStore,
deleteFolder: deleteFolder,
uploadDirectory: jest.fn().mockImplementation(() => {
return [{ name: "test.js" }]
}),
deleteFolder: jest.fn().mockImplementation(),
},
}
})
import { events } from "@budibase/backend-core"
import { events, objectStore } from "@budibase/backend-core"
import * as setup from "./utilities"
const mockUploadDirectory = objectStore.uploadDirectory as jest.Mock
const mockDeleteFolder = objectStore.deleteFolder as jest.Mock
describe("/plugins", () => {
let request = setup.getRequest()
let config = setup.getConfig()
@ -57,7 +57,7 @@ describe("/plugins", () => {
})
it("should not be able to create a plugin if there is an error", async () => {
mockObjectStore.mockImplementationOnce(() => {
mockUploadDirectory.mockImplementationOnce(() => {
throw new Error()
})
let res = await createPlugin(400)
@ -92,7 +92,7 @@ describe("/plugins", () => {
expect(events.plugin.deleted).toHaveBeenCalledTimes(1)
})
it("should handle an error deleting a plugin", async () => {
deleteFolder.mockImplementationOnce(() => {
mockDeleteFolder.mockImplementationOnce(() => {
throw new Error()
})

View File

@ -3,7 +3,7 @@ import * as appController from "../../../controllers/application"
import { AppStatus } from "../../../../db/utils"
import { roles, tenancy, context } from "@budibase/backend-core"
import { TENANT_ID } from "../../../../tests/utilities/structures"
import * as env from "../../../../environment"
import env from "../../../../environment"
class Request {
appId: any

View File

@ -48,4 +48,4 @@ router
controller.getFlags
)
export = router
export default router

View File

@ -31,4 +31,4 @@ router
)
.post("/api/views", authorized(permissions.BUILDER), viewController.save)
export = router
export default router

View File

@ -24,4 +24,4 @@ router
// this shouldn't have authorisation, right now its always public
.post("/api/webhooks/trigger/:instance/:id", controller.trigger)
export = router
export default router

View File

@ -1,5 +1,5 @@
// need to load environment first
import * as env from "./environment"
import env from "./environment"
// enable APM if configured
if (process.env.ELASTIC_APM_ENABLED) {
@ -77,7 +77,7 @@ server.on("close", async () => {
}
})
export = server.listen(env.PORT || 0, async () => {
export default server.listen(env.PORT || 0, async () => {
await startup(app, server)
})

View File

@ -1,4 +1,4 @@
import * as env from "../../environment"
import env from "../../environment"
import { AutomationResults, Automation, App } from "@budibase/types"
import { automations } from "@budibase/pro"
import { db as dbUtils } from "@budibase/backend-core"

View File

@ -1,5 +1,5 @@
import { init as coreInit } from "@budibase/backend-core"
import env = require("../environment")
import env from "../environment"
export function init() {
const dbConfig: any = {

Some files were not shown because too many files have changed in this diff Show More