Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cache: yarn
- run: yarn --frozen-lockfile
- name: Run audit-ci
run: yarn audit-ci --moderate
run: yarn audit-ci --high

build:
runs-on: ubuntu-24.04
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"kill-port": "1.6.1",
"lerna": "9.0.7",
"load-tsconfig": "0.2.5",
"madge": "6.0.0",
"prettier": "3.5.3",
"prettier-plugin-svelte": "3.4.0",
"proper-lockfile": "4.1.2",
Expand All @@ -43,14 +42,13 @@
"check:unused-deps": "knip --include dependencies,devDependencies",
"check:unused-deps:fix": "yarn check:unused-deps --fix",
"build:sdk": "lerna run --stream build:sdk",
"deps:circular": "madge packages/server/dist/index.js packages/worker/src/index.ts packages/backend-core/dist/src/index.js packages/cli/src/index.js --circular",
"release": "lerna publish from-package --yes --force-publish --no-git-tag-version --no-push --no-git-reset",
"pending-releases": "TAG=${TAG:-$(gh release view --json tagName -q '.tagName')} && gh pr list --state merged --base master --search \"merged:>$(git log -1 --format=%aI \"$TAG\")\" --limit 100",
"restore": "yarn run clean && yarn && yarn run build",
"nuke": "yarn run nuke:packages && yarn run nuke:docker",
"nuke:packages": "yarn run restore",
"nuke:docker": "lerna run --stream dev:stack:nuke",
"clean": "lerna clean -y && echo Cleaning top level node modules 🧹 && rm -rf ./node_modules && echo Done! 🚀",
"clean": "lerna clean -y && echo Cleaning top level node modules && rm -rf ./node_modules && echo Done! \ud83d\ude80",
"kill-builder": "kill-port 3000",
"kill-server": "kill-port 4001 4002",
"kill-all": "yarn run kill-builder && yarn run kill-server",
Expand Down Expand Up @@ -104,6 +102,7 @@
"xml2js": "0.6.2",
"passport": "0.6.0",
"nodemailer": "8.0.5",
"fast-xml-parser": "5.7.1",
"follow-redirects": "1.16.0",
"form-data": "4.0.4",
"@azure/identity": "4.2.1",
Expand All @@ -119,4 +118,4 @@
"engines": {
"node": ">=22.0.0 <23.0.0"
}
}
}
10 changes: 4 additions & 6 deletions packages/backend-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"test:watch": "jest --watchAll"
},
"dependencies": {
"@aws-sdk/client-s3": "3.1017.0",
"@aws-sdk/lib-storage": "3.1017.0",
"@aws-sdk/client-s3": "3.1041.0",
"@aws-sdk/lib-storage": "3.1041.0",
"@smithy/node-http-handler": "4.1.1",
"nano": "11.0.3",
"@budibase/pouchdb-replication-stream": "1.2.11",
Expand All @@ -43,7 +43,7 @@
"aws-sdk": "2.1692.0",
"bcrypt": "6.0.0",
"bull": "4.10.1",
"correlation-id": "4.0.0",
"correlation-id": "5.2.0",
"csvtojson": "2.0.13",
"dotenv": "16.0.1",
"google-auth-library": "8.0.1",
Expand All @@ -69,8 +69,7 @@
"sanitize-s3-objectkey": "0.0.1",
"semver": "7.5.4",
"tar-fs": "2.1.4",
"undici": "7.24.0",
"uuid": "8.3.2"
"undici": "7.24.0"
},
"devDependencies": {
"@shopify/jest-koa-mocks": "5.1.1",
Expand All @@ -84,7 +83,6 @@
"@types/redlock": "4.0.7",
"@types/semver": "7.3.7",
"@types/tar-fs": "2.0.4",
"@types/uuid": "8.3.4",
"chance": "1.1.8",
"ioredis-mock": "8.9.0",
"nock": "^13.5.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-core/src/docIds/newid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 } from "uuid"
import { randomUUID as v4 } from "node:crypto"

export function newid() {
return v4().replace(/-/g, "")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuid } from "uuid"
import { randomUUID as uuid } from "node:crypto"
import { Header } from "../../constants"

const correlator = require("correlation-id")
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-core/src/objectStore/objectStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const sanitize = require("sanitize-s3-objectkey")

import { randomUUID as v4 } from "node:crypto"
import fs, { type PathLike, type ReadStream } from "node:fs"
import fsp from "node:fs/promises"
import https from "node:https"
Expand All @@ -23,7 +24,6 @@ import { NodeHttpHandler } from "@smithy/node-http-handler"
import type { NodeJsClient } from "@smithy/types"
import { utils } from "@supertoolmake/shared-core"
import tar from "tar-fs"
import { v4 } from "uuid"
import { WORKSPACE_DEV_PREFIX, WORKSPACE_PREFIX } from "../db"
import env from "../environment"
import { fetchWithBlacklist } from "../utils/outboundFetch"
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-core/src/security/sessions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { randomUUID as uuidv4 } from "node:crypto"
import { MAX_SESSIONS_PER_USER } from "@supertoolmake/shared-core"
import type { CreateSession, ScannedSession, Session, SessionKey } from "@supertoolmake/types"
import { v4 as uuidv4 } from "uuid"
import env from "../environment"
import { logWarn } from "../logging"
import * as redis from "../redis/init"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from "uuid"
import { randomUUID as v4 } from "node:crypto"

export { v4 as uuid } from "uuid"
export const uuid = v4

export const email = () => {
return `${uuid()}@example.com`
Expand Down
2 changes: 0 additions & 2 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"lodash": "4.18.1",
"marked": "15.0.8",
"remixicon": "2.5.0",
"sanitize-html": "2.13.0",
"shortid": "2.2.17",
"svelte-dnd-action": "0.9.64",
"svelte-loading-spinners": "^0.3.6",
Expand All @@ -88,7 +87,6 @@
"@sveltejs/vite-plugin-svelte": "6.1.3",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/svelte": "5.2.8",
"@types/sanitize-html": "2.13.0",
"@types/shortid": "2.2.0",
"babel-jest": "29.6.2",
"identity-obj-proxy": "3.0.0",
Expand Down
12 changes: 7 additions & 5 deletions packages/builder/src/components/common/CodeEditor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import type { EditorView } from "@codemirror/view"
import { getManifest } from "@supertoolmake/string-templates"
import type { EditorModesMap, EnrichedBinding, Helper, Snippet } from "@supertoolmake/types"
import { groupBy } from "lodash"
import sanitizeHtml from "sanitize-html"
import type { BindingCompletion, BindingCompletionOption } from "@/types"

const escapeHtml = (str: string) => {
const div = document.createElement("div")
div.textContent = str
return div.innerHTML
}

export const EditorModes: EditorModesMap = {
JS: {
name: "javascript",
Expand Down Expand Up @@ -35,10 +40,7 @@ const buildHelperInfoNode = (helper: Helper) => {
const exampleNodeHtml = helper.example
? `<div class="binding__example helper">${helper.example}</div>`
: ""
const descriptionMarkup = sanitizeHtml(helper.description, {
allowedTags: [],
allowedAttributes: {},
})
const descriptionMarkup = escapeHtml(helper.description)
const descriptionNodeHtml = `<div class="binding__description helper">${descriptionMarkup}</div>`

ele.innerHTML = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as v4 } from "node:crypto"
import manifest from "@supertoolmake/client/manifest.json"
import {
type ComponentDefinition,
Expand All @@ -8,7 +9,6 @@ import {
} from "@supertoolmake/types"
import type { Writable } from "svelte/store"
import { get } from "svelte/store"
import { v4 } from "uuid"
import { DB_TYPE_EXTERNAL } from "@/constants/backend"
import { Component } from "@/templates/Component"
import { Screen } from "@/templates/screenTemplating/Screen"
Expand Down
1 change: 0 additions & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"dayjs": "1.10.8",
"downloadjs": "1.4.7",
"exifreader": "4.37.0",
"sanitize-html": "2.13.0",
"shortid": "2.2.17",
"svelte-legacy": "npm:svelte@4.2.20",
"svelte-spa-router": "4.0.1"
Expand Down
6 changes: 2 additions & 4 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "12.1.0",
"@aws-sdk/client-s3": "3.1017.0",
"@aws-sdk/s3-request-presigner": "3.1017.0",
"@aws-sdk/client-s3": "3.1041.0",
"@aws-sdk/s3-request-presigner": "3.1041.0",
"@azure/msal-node": "3.8.10",
"@supertoolmake/backend-core": "*",
"@supertoolmake/client": "*",
Expand Down Expand Up @@ -108,7 +108,6 @@
"tar": "7.5.11",
"tmp": "0.2.3",
"to-json-schema": "0.2.5",
"uuid": "8.3.2",
"worker-farm": "1.7.0",
"xml2js": "0.6.2",
"zod-validation-error": "5.0.0"
Expand Down Expand Up @@ -136,7 +135,6 @@
"@types/swagger-jsdoc": "^6.0.4",
"@types/tar": "6.1.5",
"@types/tmp": "0.2.6",
"@types/uuid": "8.3.4",
"chance": "^1.1.12",
"copyfiles": "2.4.1",
"docker-compose": "1.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/api/controllers/static/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as uuid } from "node:crypto"
import fs from "node:fs"
import path from "node:path"
import { PutObjectCommand, S3 } from "@aws-sdk/client-s3"
Expand All @@ -22,7 +23,6 @@ import {
import send from "koa-send"
import sharp from "sharp"
import { render } from "svelte/server"
import * as uuid from "uuid"
import { ObjectStoreBuckets } from "../../../constants"
import { getThemeVariables } from "../../../constants/themes"
import env from "../../../environment"
Expand Down Expand Up @@ -95,7 +95,7 @@ export const uploadFile = async (ctx: Ctx<void, ProcessAttachmentResponse>) => {
}

// filenames converted to UUIDs so they are unique
const processedFileName = `${uuid.v4()}.${extension}`
const processedFileName = `${uuid()}.${extension}`

const s3Key = `${context.getProdWorkspaceId()}/attachments/${processedFileName}`

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/integrations/postgres.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as uuidv4 } from "node:crypto"
import { sql } from "@supertoolmake/backend-core"
import {
type ConnectionInfo,
Expand All @@ -19,7 +20,6 @@ import {
TableSourceType,
} from "@supertoolmake/types"
import { Client, type ClientConfig, types } from "pg"
import { v4 as uuidv4 } from "uuid"
import { escapeDangerousCharacters } from "../utilities"
import { getReadableErrorMessage } from "./base/errorMapping"
import type { PostgresColumn } from "./base/types"
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/integrations/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as v4 } from "node:crypto"
import fs from "node:fs"
import { pipeline } from "node:stream/promises"
import { context, objectStore, sql } from "@supertoolmake/backend-core"
Expand All @@ -12,7 +13,6 @@ import {
} from "@supertoolmake/types"
import { cloneDeep, merge } from "lodash"
import tmp from "tmp"
import { v4 } from "uuid"
import { parseStringPromise as xmlParser } from "xml2js"
import { InvalidColumns } from "../../constants"
import env from "../../environment"
Expand Down
5 changes: 4 additions & 1 deletion packages/server/src/jsRunner/tests/jsRunner.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { encodeJSBinding, processStringSync } from "@supertoolmake/string-templates"
import { runJsHelpersTests } from "@supertoolmake/string-templates/test/utils"
import tk from "timekeeper"
import { validate as isValidUUID } from "uuid"

const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
const isValidUUID = (str: string) => UUID_REGEX.test(str)

import TestConfiguration from "../../tests/utilities/TestConfiguration"
import { init } from ".."

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/sdk/workspace/backups/exports.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { randomUUID as uuid } from "node:crypto"
import fs from "node:fs"
import fsp from "node:fs/promises"
import { join } from "node:path"
import { db as dbCore, encryption, objectStore } from "@supertoolmake/backend-core"
import * as tar from "tar"
import { v4 as uuid } from "uuid"
import { ObjectStoreBuckets } from "../../../constants"
import {
AUTOMATION_LOG_PREFIX,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/sdk/workspace/backups/imports.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { randomUUID as uuid } from "node:crypto"
import fs from "node:fs"
import fsp from "node:fs/promises"
import { join } from "node:path"
import { db as dbCore, encryption, objectStore } from "@supertoolmake/backend-core"
import { utils } from "@supertoolmake/shared-core"
import type { Database } from "@supertoolmake/types"
import * as tar from "tar"
import { v4 as uuid } from "uuid"
import { ObjectStoreBuckets } from "../../../constants"
import { budibaseTempDir } from "../../../utilities/budibaseDir"
import { downloadTemplate } from "../../../utilities/fileSystem"
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/utilities/fileSystem/filesystem.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { randomUUID as uuid } from "node:crypto"
import fs, { type PathLike } from "node:fs"
import { join } from "node:path"
import * as tar from "tar"
import { v4 as uuid } from "uuid"
import env from "../../environment"
import { budibaseTempDir } from "../budibaseDir"

Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/utilities/fileUtils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { randomUUID as uuid } from "node:crypto"
import fs from "node:fs"
import path from "node:path"
import { pipeline } from "node:stream"
import { promisify } from "node:util"
import { context, objectStore } from "@supertoolmake/backend-core"
import type { Upload } from "@supertoolmake/types"
import fetch from "node-fetch"
import * as uuid from "uuid"
import { ObjectStoreBuckets } from "../constants"

function getTmpPath() {
Expand All @@ -23,7 +23,7 @@ export async function uploadUrl(url: string): Promise<Upload | undefined> {

const extension = [...res.url.split(".")].pop()!.split("?")[0]

const destination = path.resolve(getTmpPath(), `${uuid.v4()}${extension}`)
const destination = path.resolve(getTmpPath(), `${uuid()}${extension}`)
const fileStream = fs.createWriteStream(destination, { flags: "wx" })

await promisify(pipeline)(res.body, fileStream)
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/websockets/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as uuid } from "node:crypto"
import type http from "node:http"
import { createAdapter } from "@socket.io/redis-adapter"
import { auth, Header, redis } from "@supertoolmake/backend-core"
Expand All @@ -6,7 +7,6 @@ import type { Ctx, SocketSession } from "@supertoolmake/types"
import type Koa from "koa"
import { userAgent } from "koa-useragent"
import { Server, type Socket } from "socket.io"
import { v4 as uuid } from "uuid"
import { getSocketPubSubClients } from "../utilities/redis"
import { createContext, runMiddlewares } from "./middleware"

Expand Down
4 changes: 1 addition & 3 deletions packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"koa-compress": "4.0.1",
"koa-passport": "4.1.4",
"koa-send": "5.0.1",
"koa-session": "5.13.1",
"koa-session": "7.0.2",
"koa-static": "5.0.0",
"koa-useragent": "4.1.0",
"lodash": "4.18.1",
Expand All @@ -63,7 +63,6 @@
"passport-local": "1.0.0",
"pouchdb": "7.3.0",
"undici": "7.24.0",
"uuid": "8.3.2",
"yaml": "2.8.3"
},
"devDependencies": {
Expand All @@ -75,7 +74,6 @@
"@types/node-fetch": "2.6.4",
"@types/nodemailer": "^6.4.17",
"@types/supertest": "2.0.14",
"@types/uuid": "8.3.4",
"cheerio": "^1.0.0",
"maildev": "^2.2.1",
"nock": "^13.5.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/api/controllers/global/templates.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomUUID as v4 } from "node:crypto"
import fs from "node:fs"
import { join } from "node:path"
import { db as dbCore, objectStore, tenancy } from "@supertoolmake/backend-core"
Expand All @@ -16,7 +17,6 @@ import {
type SaveGlobalTemplateResponse,
type UserCtx,
} from "@supertoolmake/types"
import { v4 } from "uuid"
import yaml from "yaml"
import { GLOBAL_OWNER, TemplateBindings, TemplateMetadata } from "../../../constants"
import { addBaseTemplates, getTemplateByID, getTemplates } from "../../../constants/templates"
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import env from "./environment"

db.init()

const koaSession = require("koa-session")
const koaSession = require("koa-session").default

import { userAgent } from "koa-useragent"

Expand Down
Loading
Loading