eslint import/newline-after-import

This commit is contained in:
Adria Navarro 2023-11-20 21:52:29 +01:00
parent 92f411bf77
commit db2c20e3ae
143 changed files with 159 additions and 2 deletions

View File

@ -59,7 +59,8 @@
],
"import/no-relative-packages": "error",
"import/export": "error",
"import/no-duplicates": "error"
"import/no-duplicates": "error",
"import/newline-after-import": "error"
},
"globals": {
"GeolocationPositionError": true

View File

@ -1,5 +1,6 @@
const _passport = require("koa-passport")
const LocalStrategy = require("passport-local").Strategy
import { getGlobalDB } from "../context"
import { Cookie } from "../constants"
import { getSessionsForUser, invalidateSessions } from "../security/sessions"
@ -26,6 +27,7 @@ import { clearCookie, getCookie } from "../utils"
import { ssoSaveUserNoOp } from "../middleware/passport/sso/sso"
const refresh = require("passport-oauth2-refresh")
export {
auditLog,
authError,

View File

@ -1,4 +1,5 @@
import { prefixed, DocumentType } from "@budibase/types"
export {
SEPARATOR,
UNICODE_MAX,

View File

@ -6,6 +6,7 @@ import { AppState, DeletedApp, getAppMetadata } from "../cache/appMetadata"
import { isDevApp, isDevAppID, getProdAppID } from "../docIds/conversions"
import { App, Database } from "@budibase/types"
import { getStartEndKeyURL } from "../docIds"
export * from "../docIds"
/**

View File

@ -1,5 +1,6 @@
import { APP_DEV_PREFIX, APP_PREFIX } from "../constants"
import { App } from "@budibase/types"
const NO_APP_ERROR = "No app provided"
export function isDevAppID(appId?: string) {

View File

@ -1,2 +1,3 @@
import PosthogProcessor from "./PosthogProcessor"
export default PosthogProcessor

View File

@ -1,7 +1,9 @@
import { testEnv } from "../../../../../tests/extra"
import PosthogProcessor from "../PosthogProcessor"
import { Event, IdentityType, Hosting } from "@budibase/types"
const tk = require("timekeeper")
import * as cache from "../../../../cache/generic"
import { CacheKey } from "../../../../cache/generic"
import * as context from "../../../../context"

View File

@ -1,5 +1,6 @@
import env from "../environment"
import * as context from "../context"
export * from "./installation"
/**

View File

@ -38,6 +38,7 @@ export * as docIds from "./docIds"
// circular dependencies
import * as context from "./context"
import * as _tenancy from "./tenancy"
export const tenancy = {
..._tenancy,
...context,

View File

@ -1,4 +1,5 @@
import { Header } from "../../constants"
const correlator = require("correlation-id")
export const setHeader = (headers: any) => {

View File

@ -1,5 +1,6 @@
import { Header } from "../../constants"
import { v4 as uuid } from "uuid"
const correlator = require("correlation-id")
const correlation = (ctx: any, next: any) => {

View File

@ -1,9 +1,12 @@
import env from "../../environment"
import { logger } from "./logger"
import { IncomingMessage } from "http"
const pino = require("koa-pino-logger")
import { Options } from "pino-http"
import { Ctx } from "@budibase/types"
const correlator = require("correlation-id")
export function pinoSettings(): Options {

View File

@ -2,6 +2,7 @@ export * as local from "./passport/local"
export * as google from "./passport/sso/google"
export * as oidc from "./passport/sso/oidc"
import * as datasourceGoogle from "./passport/datasource/google"
export const datasource = {
google: datasourceGoogle,
}

View File

@ -8,6 +8,7 @@ import {
SaveSSOUserFunction,
GoogleInnerConfig,
} from "@budibase/types"
const GoogleStrategy = require("passport-google-oauth").OAuth2Strategy
export function buildVerifyFn(saveUserFn: SaveSSOUserFunction) {

View File

@ -6,6 +6,7 @@ const mockStrategy = require("passport-google-oauth").OAuth2Strategy
jest.mock("../sso")
import * as _sso from "../sso"
const sso = jest.mocked(_sso)
const mockSaveUserFn = jest.fn()

View File

@ -11,6 +11,7 @@ const mockSaveUser = jest.fn()
jest.mock("../../../../users")
import * as _users from "../../../../users"
const users = jest.mocked(_users)
const getErrorMessage = () => {

View File

@ -5,6 +5,7 @@ import { structures } from "../../../tests"
import { ContextUser, ServiceType } from "@budibase/types"
import { doInAppContext } from "../../context"
import env from "../../environment"
env._set("SERVICE_TYPE", ServiceType.APPS)
const appId = "app_aaa"

View File

@ -1,4 +1,5 @@
const sanitize = require("sanitize-s3-objectkey")
import AWS from "aws-sdk"
import stream, { Readable } from "stream"
import fetch from "node-fetch"

View File

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

View File

@ -1,4 +1,5 @@
import env from "../environment"
export * from "../docIds/newid"
const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt")

View File

@ -11,6 +11,7 @@ import {
TenantResolutionStrategy,
} from "@budibase/types"
import type { SetOption } from "cookies"
const jwt = require("jsonwebtoken")
const APP_PREFIX = DocumentType.APP + SEPARATOR

View File

@ -1,3 +1,4 @@
jest.mock("../../../../src/logging/alerts")
import * as _alerts from "../../../../src/logging/alerts"
export const alerts = jest.mocked(_alerts)

View File

@ -1,5 +1,6 @@
jest.mock("../../../../src/accounts")
import * as _accounts from "../../../../src/accounts"
export const accounts = jest.mocked(_accounts)
export * as date from "./date"

View File

@ -1,2 +1,3 @@
import Chance from "./Chance"
export const generator = new Chance()

View File

@ -9,6 +9,7 @@ mocks.fetch.enable()
// mock all dates to 2020-01-01T00:00:00.000Z
// use tk.reset() to use real dates in individual tests
import tk from "timekeeper"
tk.freeze(mocks.date.MOCK_DATE)
if (!process.env.DEBUG) {

View File

@ -1,5 +1,6 @@
<script>
import "@spectrum-css/actiongroup/dist/index-vars.css"
export let vertical = false
export let justified = false
export let quiet = false

View File

@ -1,5 +1,6 @@
<script>
import "@spectrum-css/avatar/dist/index-vars.css"
let sizes = new Map([
["XXS", "--spectrum-alias-avatar-size-50"],
["XS", "--spectrum-alias-avatar-size-75"],

View File

@ -1,5 +1,6 @@
<script>
import "@spectrum-css/buttongroup/dist/index-vars.css"
export let vertical = false
export let gap = ""

View File

@ -1,5 +1,6 @@
<script>
import "@spectrum-css/divider/dist/index-vars.css"
export let size = "M"
export let vertical = false

View File

@ -1,5 +1,6 @@
<script>
import Input from "../Form/Input.svelte"
let value = ""
</script>

View File

@ -4,6 +4,7 @@
import Icon from "../Icon/Icon.svelte"
import Popover from "../Popover/Popover.svelte"
import { onMount } from "svelte"
const flipDurationMs = 150
export let constraints

View File

@ -1,7 +1,9 @@
<script>
import { getContext } from "svelte"
const multilevel = getContext("sidenav-type")
import Badge from "../Badge/Badge.svelte"
export let href = ""
export let external = false
export let heading = ""

View File

@ -1,6 +1,7 @@
<script>
import { setContext } from "svelte"
import "@spectrum-css/sidenav/dist/index-vars.css"
export let multilevel = false
setContext("sidenav-type", multilevel)
</script>

View File

@ -1,6 +1,7 @@
<script>
import "@spectrum-css/label/dist/index-vars.css"
import Badge from "../Badge/Badge.svelte"
export let value
const displayLimit = 5

View File

@ -1,6 +1,7 @@
<script>
import { getContext, onMount, createEventDispatcher } from "svelte"
import Portal from "svelte-portal"
export let title
export let icon = ""
export let id

View File

@ -1,4 +1,5 @@
import { helpers } from "@budibase/shared-core"
export const deepGet = helpers.deepGet
/**

View File

@ -2,6 +2,7 @@
import { Button, Select, Input, Label } from "@budibase/bbui"
import { onMount, createEventDispatcher } from "svelte"
import { flags } from "stores/backend"
const dispatch = createEventDispatcher()
export let value

View File

@ -1,5 +1,6 @@
<script>
import { Helpers } from "@budibase/bbui"
export let size
export let svgHtml

View File

@ -1,5 +1,6 @@
<script>
import { capitalise } from "helpers"
export let value
</script>

View File

@ -1,5 +1,6 @@
<script>
import dayjs from "dayjs"
export let value
</script>

View File

@ -2,6 +2,7 @@
import { Select, Body } from "@budibase/bbui"
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
export let parameters
export let bindings

View File

@ -1,2 +1,3 @@
import FlatButtonGroup from "./FlatButtonGroup.svelte"
export default FlatButtonGroup

View File

@ -1,6 +1,7 @@
<script>
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builderStore/dataBinding"
export let bindable = true
export let queryBindings = []
export let hideHeading = false

View File

@ -11,6 +11,7 @@
import { environment } from "stores/portal"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { getContext } from "svelte"
const modalContext = getContext(Context.Modal)
export let save

View File

@ -2,6 +2,7 @@
import { Body, ProgressBar, Heading, Icon, Link } from "@budibase/bbui"
import { admin, auth } from "../../stores/portal"
import { onMount } from "svelte"
export let usage
export let warnWhenFull = false

View File

@ -2,6 +2,7 @@
import { Body } from "@budibase/bbui"
import FontAwesomeIcon from "components/common/FontAwesomeIcon.svelte"
import { IntegrationTypes } from "constants/backend"
export let datasource
const getSubtitle = datasource => {
if (datasource.source === IntegrationTypes.REST) {

View File

@ -1,5 +1,6 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("../../")
</script>

View File

@ -1,5 +1,6 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("../")
</script>

View File

@ -1,6 +1,7 @@
<script>
import { DetailSummary } from "@budibase/bbui"
import InfoDisplay from "./InfoDisplay.svelte"
export let componentDefinition
</script>

View File

@ -1,5 +1,6 @@
<script>
import { Icon } from "@budibase/bbui"
export let datasource
export let selected = false

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("./data")
</script>

View File

@ -1,5 +1,6 @@
<script>
import { Badge } from "@budibase/bbui"
export let value
$: isError = !value || value.toLowerCase() === "error"

View File

@ -1,5 +1,6 @@
<script>
import { BackupTrigger } from "constants/backend/backups"
export let row
$: trigger = row?.trigger || "manual"

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("../portal")
</script>

View File

@ -1,6 +1,7 @@
<script>
import dayjs from "dayjs"
import relativeTime from "dayjs/plugin/relativeTime"
dayjs.extend(relativeTime)
export let row

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("./usage")
</script>

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("./apps")
</script>

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("./auth")
</script>

View File

@ -1,5 +1,6 @@
<script>
import { Icon } from "@budibase/bbui"
export let value
</script>

View File

@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("./users")
</script>

View File

@ -1,5 +1,6 @@
<script>
import TagsTableRenderer from "./TagsTableRenderer.svelte"
export let value
$: roles = value?.filter(role => role != null).map(role => role.name) ?? []

View File

@ -1,5 +1,6 @@
<script>
import { Tag, Tags } from "@budibase/bbui"
export let value
const displayLimit = 5

View File

@ -13,6 +13,7 @@ import {
getPouches,
} from "./utils"
import { exportObjects, importObjects } from "./objectStore"
const tar = require("tar")
type BackupOpts = { env?: string; import?: string; export?: string }

View File

@ -3,6 +3,7 @@ import fs from "fs"
import { join } from "path"
import { TEMP_DIR, MINIO_DIR } from "./utils"
import { progressBar } from "../utils"
const {
ObjectStoreBuckets,
ObjectStore,

View File

@ -1,5 +1,6 @@
import util from "util"
import childProcess from "child_process"
const runCommand = util.promisify(childProcess.exec)
export async function exec(command: string, dir = "./") {

View File

@ -2,6 +2,7 @@ const { success } = require("../utils")
const { updateDockerComposeService } = require("./utils")
const randomString = require("randomstring")
const { GENERATED_USER_EMAIL } = require("../constants")
import { DockerCompose } from "./types"
export async function generateUser(password: string | null, silent: boolean) {

View File

@ -4,6 +4,7 @@ import fs from "fs"
import path from "path"
import yaml from "yaml"
import { getAppService } from "./utils"
const randomString = require("randomstring")
const SINGLE_IMAGE = "budibase/budibase:latest"

View File

@ -16,6 +16,7 @@ import { success, error, info, moveDirectory } from "../utils"
import { captureEvent } from "../events"
import { init as hostingInit } from "../hosting/init"
import { start as hostingStart } from "../hosting/start"
const fp = require("find-free-port")
type PluginOpts = {

View File

@ -3,6 +3,7 @@ import fs from "fs"
import os from "os"
import { join } from "path"
import { processStringSync } from "@budibase/string-templates"
const download = require("download")
const tar = require("tar")

View File

@ -2,6 +2,7 @@ import chalk from "chalk"
import fs from "fs"
import path, { join } from "path"
import fetch from "node-fetch"
const progress = require("cli-progress")
export function downloadFile(url: string, filePath: string) {

View File

@ -2,6 +2,7 @@
import { CoreMultiselect, CoreCheckboxGroup } from "@budibase/bbui"
import Field from "./Field.svelte"
import { getOptions } from "./optionsParser"
export let field
export let label
export let placeholder

View File

@ -2,6 +2,7 @@
import { CoreSelect, CoreRadioGroup } from "@budibase/bbui"
import Field from "./Field.svelte"
import { getOptions } from "./optionsParser"
export let field
export let label
export let placeholder

View File

@ -15,6 +15,7 @@ import { initWebsocket } from "./websocket.js"
// Provide svelte and svelte/internal as globals for custom components
import * as svelte from "svelte"
import * as internal from "svelte/internal"
window.svelte_internal = internal
window.svelte = svelte

@ -1 +1 @@
Subproject commit 0fcc284eaad4020be4a1410452b31a2966cf1989
Subproject commit 9c58e23fee4c013dbf2df55ba82b5f717fda83ba

View File

@ -1,5 +1,6 @@
// @ts-ignore
import fs from "fs"
module FetchMock {
// @ts-ignore
const fetch = jest.requireActual("node-fetch")

View File

@ -3,6 +3,7 @@ import { writeFileSync } from "fs"
import { examples, schemas } from "./resources"
import * as parameters from "./parameters"
import * as security from "./security"
const swaggerJsdoc = require("swagger-jsdoc")
const VARIABLES = {}

View File

@ -1,6 +1,7 @@
import { ImportSource } from "."
import SwaggerParser from "@apidevtools/swagger-parser"
import { OpenAPI } from "openapi-types"
const yaml = require("js-yaml")
export abstract class OpenAPISource extends ImportSource {

View File

@ -1,6 +1,7 @@
import { ImportSource, ImportInfo } from "./base"
import { Query } from "../../../../../definitions/common"
import { URL } from "url"
const curlconverter = require("curlconverter")
const parseCurl = (data: string): any => {

View File

@ -27,6 +27,7 @@ import sdk from "../../../sdk"
import * as exporters from "../view/exporters"
import { apiFileReturn } from "../../../utilities/fileSystem"
import { Format } from "../view/exporters"
export * as views from "./views"
function pickApi(tableId: any) {

View File

@ -18,6 +18,7 @@ import {
import { builderSocket } from "../../../websockets"
const cloneDeep = require("lodash/cloneDeep")
import isEqual from "lodash/isEqual"
export async function fetch(ctx: Ctx) {

View File

@ -4,6 +4,7 @@ import currentApp from "../middleware/currentapp"
import zlib from "zlib"
import { mainRoutes, staticRoutes, publicRoutes } from "./routes"
import { middleware as pro } from "@budibase/pro"
export { shutdown } from "./routes/public"
const compress = require("koa-compress")

View File

@ -11,6 +11,7 @@ import {
generateQueryPreviewValidation,
generateQueryValidation,
} from "../controllers/query/validation"
const { BUILDER, PermissionType, PermissionLevel } = permissions
const router: Router = new Router()

View File

@ -6,6 +6,7 @@ import { permissions } from "@budibase/backend-core"
import env from "../../environment"
import { paramResource } from "../../middleware/resourceId"
import { devClientLibPath } from "../../utilities/fileSystem"
const { BUILDER, PermissionType, PermissionLevel } = permissions
const router: Router = new Router()

View File

@ -4,6 +4,7 @@ import authorized from "../../middleware/authorized"
import { paramResource, bodyResource } from "../../middleware/resourceId"
import { permissions } from "@budibase/backend-core"
import { tableValidator } from "./utils/validators"
const { BUILDER, PermissionLevel, PermissionType } = permissions
const router: Router = new Router()

View File

@ -7,6 +7,7 @@ import sdk from "../../../sdk"
import tk from "timekeeper"
import { mocks } from "@budibase/backend-core/tests"
tk.freeze(mocks.date.MOCK_DATE)
let { basicDatasource } = setup.structures

View File

@ -1,5 +1,6 @@
const { checkBuilderEndpoint } = require("./utilities/TestFunctions")
const setup = require("./utilities")
import os from "os"
jest.mock("process", () => ({

View File

@ -1,4 +1,5 @@
const pg = require("pg")
jest.mock("pg", () => {
return {
Client: jest.fn().mockImplementation(() => ({
@ -13,6 +14,7 @@ jest.mock("pg", () => {
import * as setup from "./utilities"
import { mocks } from "@budibase/backend-core/tests"
import { env, events } from "@budibase/backend-core"
const structures = setup.structures
env._set("ENCRYPTION_KEY", "budibase")

View File

@ -1,4 +1,5 @@
const nodeFetch = require("node-fetch")
nodeFetch.mockSearch()
import { SearchParams } from "@budibase/backend-core"
import * as search from "../../../sdk/app/rows/search/internalSearch"

View File

@ -1,6 +1,7 @@
import TestConfig from "../../../../tests/utilities/TestConfiguration"
import env from "../../../../environment"
import supertest from "supertest"
export * as structures from "../../../../tests/utilities/structures"
function user() {

View File

@ -2,6 +2,7 @@ import { Webhook } from "@budibase/types"
import * as setup from "./utilities"
import { checkBuilderEndpoint } from "./utilities/TestFunctions"
import { mocks } from "@budibase/backend-core/tests"
const { basicWebhook, basicAutomation, collectAutomation } = setup.structures
describe("/webhooks", () => {

View File

@ -2,6 +2,7 @@ import Router from "@koa/router"
import * as controller from "../controllers/user"
import authorized from "../../middleware/authorized"
import { permissions } from "@budibase/backend-core"
const { PermissionType, PermissionLevel } = permissions
const router: Router = new Router()

View File

@ -3,9 +3,11 @@ if (process.env.DD_APM_ENABLED) {
}
import * as db from "./db"
db.init()
import { ServiceType } from "@budibase/types"
import { env as coreEnv } from "@budibase/backend-core"
coreEnv._set("SERVICE_TYPE", ServiceType.APPS)
import { apiEnabled } from "./features"
import createKoaApp from "./koa"

View File

@ -1,4 +1,5 @@
const setup = require("./utilities")
import environment from "../../environment"
import openai from "openai"

View File

@ -4,6 +4,7 @@ import { Row, Document, DBView } from "@budibase/types"
// bypass the main application db config
// use in memory pouchdb directly
import { db as dbCore } from "@budibase/backend-core"
const Pouch = dbCore.getPouch({ inMemory: true })
export async function runView(

View File

@ -9,6 +9,7 @@ import {
DatabaseQueryOpts,
} from "@budibase/types"
import { FieldTypes } from "../constants"
export { DocumentType, VirtualDocumentType } from "@budibase/types"
type Optional = string | null

View File

@ -1,6 +1,7 @@
import { context } from "@budibase/backend-core"
import { DocumentType, SEPARATOR, ViewName } from "../utils"
import { LinkDocument, Row, SearchIndex } from "@budibase/types"
const SCREEN_PREFIX = DocumentType.SCREEN + SEPARATOR
/**************************************************

View File

@ -1,4 +1,5 @@
import { Document } from "@budibase/types"
export {
Query,
Datasource,

View File

@ -1,5 +1,6 @@
import { env as coreEnv } from "@budibase/backend-core"
import { ServiceType } from "@budibase/types"
coreEnv._set("SERVICE_TYPE", ServiceType.APPS)
import { join } from "path"

View File

@ -26,6 +26,7 @@ import Sql from "./base/sql"
import { MSSQLTablesResponse, MSSQLColumn } from "./base/types"
import { getReadableErrorMessage } from "./base/errorMapping"
import sqlServer from "mssql"
const DEFAULT_SCHEMA = "dbo"
import { ConfidentialClientApplication } from "@azure/msal-node"

View File

@ -30,6 +30,7 @@ import {
Result,
} from "oracledb"
import { OracleTable, OracleColumn, OracleColumnsResponse } from "./base/types"
let oracledb: any
try {
oracledb = require("oracledb")

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