Merge branch 'master' into labday/monorepo-setup

This commit is contained in:
Adria Navarro 2024-12-09 11:32:13 +01:00
commit fb71568767
64 changed files with 546 additions and 389 deletions

View File

@ -22,6 +22,6 @@
"@types/react": "17.0.39",
"eslint": "8.10.0",
"eslint-config-next": "12.1.0",
"typescript": "5.5.2"
"typescript": "5.7.2"
}
}

View File

@ -47,6 +47,8 @@ async function killContainers(containers: ContainerInfo[]) {
}
export default async function setup() {
process.env.TESTCONTAINERS_RYUK_DISABLED = "true"
// For whatever reason, testcontainers doesn't always use the correct current
// docker context. This bit of code forces the issue by finding the current
// context and setting it as the DOCKER_HOST environment
@ -75,6 +77,7 @@ export default async function setup() {
try {
const couchdb = new GenericContainer("budibase/couchdb:v3.3.3-sqs-v2.1.1")
.withName("couchdb_testcontainer")
.withExposedPorts(5984, 4984)
.withEnvironment({
COUCHDB_PASSWORD: "budibase",
@ -99,6 +102,7 @@ export default async function setup() {
)
const minio = new GenericContainer("minio/minio")
.withName("minio_testcontainer")
.withExposedPorts(9000)
.withCommand(["server", "/data"])
.withTmpFs({ "/data": "rw" })

View File

@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.2.24",
"version": "3.2.25",
"npmClient": "yarn",
"concurrency": 20,
"command": {

View File

@ -29,7 +29,7 @@
"proper-lockfile": "^4.1.2",
"svelte": "4.2.19",
"svelte-eslint-parser": "^0.33.1",
"typescript": "5.5.2",
"typescript": "5.7.2",
"typescript-eslint": "^7.3.1",
"yargs": "^17.7.2"
},

View File

@ -92,9 +92,9 @@
"nock": "^13.5.6",
"pino-pretty": "10.0.0",
"pouchdb-adapter-memory": "7.2.2",
"testcontainers": "^10.7.2",
"testcontainers": "10.16.0",
"timekeeper": "2.2.0",
"typescript": "5.5.2"
"typescript": "5.7.2"
},
"nx": {
"targets": {

View File

@ -3,18 +3,10 @@ import { Duration } from "../utils"
import env from "../environment"
import { getTenantId } from "../context"
import * as redis from "../redis/init"
import { Invite, InviteWithCode } from "@budibase/types"
const TTL_SECONDS = Duration.fromDays(7).toSeconds()
interface Invite {
email: string
info: any
}
interface InviteWithCode extends Invite {
code: string
}
/**
* Given an invite code and invite body, allow the update an existing/valid invite in redis
* @param code The invite code for an invite in redis

View File

@ -11,7 +11,7 @@ describe("redis", () => {
let container: StartedTestContainer
beforeAll(async () => {
const container = await new GenericContainer("redis")
container = await new GenericContainer("redis")
.withExposedPorts(6379)
.start()

View File

@ -37,10 +37,6 @@ function getTestcontainers(): ContainerInfo[] {
)
}
function removeContainer(container: ContainerInfo) {
execSync(`docker rm ${container.ID}`)
}
export function getContainerByImage(image: string) {
const containers = getTestcontainers().filter(x => x.Image.startsWith(image))
if (containers.length > 1) {
@ -53,10 +49,6 @@ export function getContainerByImage(image: string) {
return containers[0]
}
function getContainerByName(name: string) {
return getTestcontainers().find(x => x.Names === name)
}
export function getContainerById(id: string) {
return getTestcontainers().find(x => x.ID === id)
}
@ -98,6 +90,8 @@ function getCurrentDockerContext(): DockerContext {
}
export function setupEnv(...envs: any[]) {
process.env.TESTCONTAINERS_RYUK_DISABLED = "true"
// For whatever reason, testcontainers doesn't always use the correct current
// docker context. This bit of code forces the issue by finding the current
// context and setting it as the DOCKER_HOST environment
@ -153,19 +147,10 @@ export async function startContainer(container: GenericContainer) {
key = key.replace(/\//g, "-").replace(/:/g, "-")
const name = `${key}_testcontainer`
// If a container has died it hangs around and future attempts to start a
// container with the same name will fail. What we do here is if we find a
// matching container and it has exited, we remove it before carrying on. This
// removes the need to do this removal manually.
const existingContainer = getContainerByName(name)
if (existingContainer?.State === "exited") {
removeContainer(existingContainer)
}
container = container
.withReuse()
.withLabels({ "com.budibase": "true" })
.withName(`${key}_testcontainer`)
.withName(name)
let startedContainer: StartedTestContainer | undefined = undefined
let lastError = undefined

View File

@ -40,6 +40,6 @@
"@types/node-fetch": "2.6.4",
"@types/pouchdb": "^6.4.0",
"ts-node": "10.8.1",
"typescript": "5.5.2"
"typescript": "5.7.2"
}
}

View File

@ -170,11 +170,11 @@
"rimraf": "3.0.2",
"supertest": "6.3.3",
"swagger-jsdoc": "6.1.0",
"testcontainers": "10.7.2",
"testcontainers": "10.16.0",
"timekeeper": "2.2.0",
"ts-node": "10.8.1",
"tsconfig-paths": "4.0.0",
"typescript": "5.5.2",
"typescript": "5.7.2",
"update-dotenv": "1.1.1",
"yargs": "^13.2.4",
"zod": "^3.23.8"

View File

@ -3,7 +3,7 @@ import { downloadTemplate as dlTemplate } from "../../utilities/fileSystem"
import env from "../../environment"
import {
DownloadTemplateResponse,
FetchTemplateResponse,
FetchGlobalTemplateResponse,
UserCtx,
} from "@budibase/types"
@ -11,7 +11,7 @@ import {
const DEFAULT_TEMPLATES_BUCKET =
"prod-budi-templates.s3-eu-west-1.amazonaws.com"
export async function fetch(ctx: UserCtx<void, FetchTemplateResponse>) {
export async function fetch(ctx: UserCtx<void, FetchGlobalTemplateResponse>) {
let type = env.TEMPLATE_REPOSITORY
let response,
error = false

View File

@ -20,7 +20,7 @@
},
"devDependencies": {
"rimraf": "3.0.2",
"typescript": "5.5.2"
"typescript": "5.7.2"
},
"nx": {
"targets": {

View File

@ -42,6 +42,6 @@
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "29.1.1",
"typescript": "5.5.2"
"typescript": "5.7.2"
}
}

View File

@ -18,7 +18,7 @@
"@types/koa": "2.13.4",
"@types/redlock": "4.0.7",
"rimraf": "3.0.2",
"typescript": "5.5.2",
"typescript": "5.7.2",
"koa-useragent": "^4.1.0",
"zod": "^3.23.8"
},

View File

@ -3,14 +3,28 @@ export interface LoginRequest {
password: string
}
export interface LogoutResponse {
message: string
}
export interface SetInitInfoRequest extends Record<string, any> {}
export interface GetInitInfoResponse extends Record<string, any> {}
export interface PasswordResetRequest {
email: string
}
export interface PasswordResetResponse {
message: string
}
export interface PasswordResetUpdateRequest {
resetCode: string
password: string
}
export interface PasswordResetUpdateResponse {
message: string
}
export interface UpdateSelfRequest {
firstName?: string

View File

@ -1,4 +1,10 @@
import { SettingsConfig, SettingsInnerConfig } from "../../../documents"
import {
Config,
ConfigType,
SettingsBrandingConfig,
SettingsConfig,
SettingsInnerConfig,
} from "../../../documents"
/**
* Settings that aren't stored in the database - enriched at runtime.
@ -22,3 +28,34 @@ export interface PublicOIDCConfig {
}
export type GetPublicOIDCConfigResponse = PublicOIDCConfig[]
export interface SaveConfigRequest extends Config {}
export interface SaveConfigResponse {
type: ConfigType
_id: string
_rev: string
}
export interface DeleteConfigResponse {
message: string
}
interface ChecklistItem {
checked: boolean
label: string
link: string
}
export interface ConfigChecklistResponse {
apps: ChecklistItem
smtp: ChecklistItem
adminUser: ChecklistItem
sso: ChecklistItem
branding: SettingsBrandingConfig
}
export type FindConfigResponse = Config | {}
export interface UploadConfigFileResponse {
message: string
url: string
}

View File

@ -0,0 +1,28 @@
import { EmailAttachment, EmailInvite } from "../../../documents"
export enum EmailTemplatePurpose {
CORE = "core",
BASE = "base",
PASSWORD_RECOVERY = "password_recovery",
INVITATION = "invitation",
WELCOME = "welcome",
CUSTOM = "custom",
}
export interface SendEmailRequest {
workspaceId?: string
email: string
userId: string
purpose: EmailTemplatePurpose
contents?: string
from?: string
subject: string
cc?: boolean
bcc?: boolean
automation?: boolean
invite?: EmailInvite
attachments?: EmailAttachment[]
}
export interface SendEmailResponse extends Record<string, any> {
message: string
}

View File

@ -5,3 +5,7 @@ export * from "./configs"
export * from "./scim"
export * from "./license"
export * from "./oldMigration"
export * from "./email"
export * from "./role"
export * from "./self"
export * from "./template"

View File

@ -1,5 +1,7 @@
// LICENSE KEY
import { QuotaUsage } from "../../../documents"
export interface ActivateLicenseKeyRequest {
licenseKey: string
}
@ -23,3 +25,5 @@ export interface GetOfflineLicenseTokenResponse {
export interface GetOfflineIdentifierResponse {
identifierBase64: string
}
export interface GetQuotaUsageResponse extends QuotaUsage {}

View File

@ -0,0 +1,17 @@
import { Role } from "../../../documents"
interface GlobalRoleResponse {
roles: Role[]
name: string
version: string
url?: string
}
export interface FetchGlobalRolesResponse
extends Record<string, GlobalRoleResponse> {}
export interface FindGlobalRoleResponse extends GlobalRoleResponse {}
export interface RemoveAppRoleResponse {
message: string
}

View File

@ -0,0 +1,12 @@
import { DevInfo, User } from "../../../documents"
export interface GenerateAPIKeyRequest {
userId: string
}
export interface GenerateAPIKeyResponse extends DevInfo {}
export interface FetchAPIKeyResponse extends DevInfo {}
export interface GetGlobalSelfResponse extends User {
flags?: Record<string, string>
}

View File

@ -0,0 +1,30 @@
import { Template } from "../../../documents"
export interface GlobalTemplateDefinition {
name: string
description: string
category: string
}
export interface GlobalTemplateBinding {
name: string
description: string
}
export interface FetchGlobalTemplateDefinitionResponse {
info: Record<string, GlobalTemplateDefinition>
bindings: Record<string, GlobalTemplateBinding[]>
}
export interface SaveGlobalTemplateRequest extends Template {}
export interface SaveGlobalTemplateResponse extends Template {}
export type FetchGlobalTemplateResponse = Template[]
export type FetchGlobalTemplateByTypeResponse = Template[]
export type FetchGlobalTemplateByOwnerIDResponse = Template[]
export interface FindGlobalTemplateResponse extends Template {}
export interface DeleteGlobalTemplateResponse {
message: string
}

View File

@ -0,0 +1,4 @@
import { Account, AccountMetadata } from "../../../documents"
export interface SaveAccountRequest extends Account {}
export interface SaveAccountResponse extends AccountMetadata {}

View File

@ -1,8 +1,11 @@
export interface GetEnvironmentResponse {
multiTenancy: boolean
offlineMode: boolean
cloud: boolean
accountPortalUrl: string
baseUrl: string
accountPortalUrl?: string
disableAccountPortal: boolean
baseUrl?: string
isDev: boolean
maintenance: { type: string }[]
passwordMinLength?: string
}

View File

@ -1,3 +1,8 @@
export * from "./environment"
export * from "./status"
export * from "./ops"
export * from "./account"
export * from "./log"
export * from "./migration"
export * from "./restore"
export * from "./tenant"

View File

@ -0,0 +1 @@
export type GetLogResponse = Buffer

View File

@ -0,0 +1,5 @@
import { MigrationDefinition, MigrationOptions } from "../../../sdk"
export interface RunGlobalMigrationRequest extends MigrationOptions {}
export type FetchMigrationDefinitionsResponse = MigrationDefinition[]

View File

@ -0,0 +1,3 @@
export interface SystemRestoreResponse {
message: string
}

View File

@ -0,0 +1,3 @@
export interface GetTenantInfoResponse {
exists: boolean
}

View File

@ -1,6 +1,15 @@
import { User } from "../../documents"
import { AccountMetadata, PlatformUser, User } from "../../documents"
import { SearchFilters } from "../../sdk"
export interface Invite {
email: string
info: any
}
export interface InviteWithCode extends Invite {
code: string
}
export interface SaveUserResponse {
_id: string
_rev: string
@ -47,6 +56,11 @@ export interface InviteUserRequest {
email: string
userInfo: any
}
export interface InviteUserResponse {
message: string
successful: { email: string }[]
unsuccessful: { email: string; reason: string }[]
}
export interface DeleteInviteUserRequest {
code: string
@ -54,6 +68,9 @@ export interface DeleteInviteUserRequest {
export type InviteUsersRequest = InviteUserRequest[]
export type DeleteInviteUsersRequest = DeleteInviteUserRequest[]
export interface DeleteInviteUsersResponse {
message: string
}
export interface InviteUsersResponse {
successful: { email: string }[]
@ -68,6 +85,17 @@ export interface SearchUsersRequest {
limit?: number
paginate?: boolean
}
export interface SearchUsersResponse {
data: User[]
hasNextPage?: boolean
nextPage?: string
}
export type FetchUsersResponse = User[]
export interface FindUserResponse extends User {}
export type LookupTenantUserResponse = PlatformUser
export interface CreateAdminUserRequest {
email: string
@ -106,3 +134,28 @@ export interface AcceptUserInviteResponse {
export interface SyncUserRequest {
previousUser?: User
}
export interface DeleteUserResponse {
message: string
}
export interface CountUserResponse {
userCount: number
}
export interface CheckInviteResponse {
email: string
}
export type GetUserInvitesResponse = InviteWithCode[]
export interface UpdateInviteRequest extends Omit<Invite, "email"> {
email?: string
builder?: {
apps: string[]
}
apps: string[]
}
export interface UpdateInviteResponse extends Invite {}
export type LookupAccountHolderResponse = AccountMetadata | null

View File

@ -0,0 +1,6 @@
import { Document } from "../document"
export interface DevInfo extends Document {
userId: string
apiKey?: string
}

View File

@ -8,3 +8,4 @@ export * from "./templates"
export * from "./environmentVariables"
export * from "./auditLogs"
export * from "./apikeys"
export * from "./devInfo"

View File

@ -97,7 +97,7 @@
"superagent": "^10.1.1",
"supertest": "6.3.3",
"timekeeper": "2.2.0",
"typescript": "5.5.2",
"typescript": "5.7.2",
"update-dotenv": "1.1.1"
},
"nx": {

View File

@ -16,8 +16,15 @@ import {
PasswordResetUpdateRequest,
GoogleInnerConfig,
DatasourceAuthCookie,
LogoutResponse,
UserCtx,
SetInitInfoRequest,
GetInitInfoResponse,
PasswordResetResponse,
PasswordResetUpdateResponse,
} from "@budibase/types"
import env from "../../../environment"
import { Next } from "koa"
import * as authSdk from "../../../sdk/auth"
import * as userSdk from "../../../sdk/users"
@ -52,7 +59,7 @@ async function passportCallback(
ctx.set(Header.TOKEN, token)
}
export const login = async (ctx: Ctx<LoginRequest>, next: any) => {
export const login = async (ctx: Ctx<LoginRequest, void>, next: Next) => {
const email = ctx.request.body.username
const user = await userSdk.db.getUserByEmail(email)
@ -72,7 +79,7 @@ export const login = async (ctx: Ctx<LoginRequest>, next: any) => {
)(ctx, next)
}
export const logout = async (ctx: any) => {
export const logout = async (ctx: UserCtx<void, LogoutResponse>) => {
if (ctx.user && ctx.user._id) {
await authSdk.logout({ ctx, userId: ctx.user._id })
}
@ -81,13 +88,13 @@ export const logout = async (ctx: any) => {
// INIT
export const setInitInfo = (ctx: any) => {
export const setInitInfo = (ctx: UserCtx<SetInitInfoRequest, void>) => {
const initInfo = ctx.request.body
setCookie(ctx, initInfo, Cookie.Init)
ctx.status = 200
}
export const getInitInfo = (ctx: any) => {
export const getInitInfo = (ctx: UserCtx<void, GetInitInfoResponse>) => {
try {
ctx.body = getCookie(ctx, Cookie.Init) || {}
} catch (err) {
@ -101,7 +108,9 @@ export const getInitInfo = (ctx: any) => {
/**
* Reset the user password, used as part of a forgotten password flow.
*/
export const reset = async (ctx: Ctx<PasswordResetRequest>) => {
export const reset = async (
ctx: Ctx<PasswordResetRequest, PasswordResetResponse>
) => {
const { email } = ctx.request.body
await authSdk.reset(email)
@ -114,7 +123,9 @@ export const reset = async (ctx: Ctx<PasswordResetRequest>) => {
/**
* Perform the user password update if the provided reset code is valid.
*/
export const resetUpdate = async (ctx: Ctx<PasswordResetUpdateRequest>) => {
export const resetUpdate = async (
ctx: Ctx<PasswordResetUpdateRequest, PasswordResetUpdateResponse>
) => {
const { resetCode, password } = ctx.request.body
try {
await authSdk.resetUpdate(resetCode, password)
@ -130,7 +141,10 @@ export const resetUpdate = async (ctx: Ctx<PasswordResetUpdateRequest>) => {
// DATASOURCE
export const datasourcePreAuth = async (ctx: any, next: any) => {
export const datasourcePreAuth = async (
ctx: UserCtx<void, void>,
next: Next
) => {
const provider = ctx.params.provider
const { middleware } = require(`@budibase/backend-core`)
const handler = middleware.datasource[provider]
@ -147,7 +161,7 @@ export const datasourcePreAuth = async (ctx: any, next: any) => {
return handler.preAuth(passport, ctx, next)
}
export const datasourceAuth = async (ctx: any, next: any) => {
export const datasourceAuth = async (ctx: UserCtx<void, void>, next: Next) => {
const authStateCookie = getCookie<DatasourceAuthCookie>(
ctx,
Cookie.DatasourceAuth
@ -171,7 +185,7 @@ export async function googleCallbackUrl(config?: GoogleInnerConfig) {
* The initial call that google authentication makes to take you to the google login screen.
* On a successful login, you will be redirected to the googleAuth callback route.
*/
export const googlePreAuth = async (ctx: any, next: any) => {
export const googlePreAuth = async (ctx: Ctx<void, void>, next: Next) => {
const config = await configs.getGoogleConfig()
if (!config) {
return ctx.throw(400, "Google config not found")
@ -190,7 +204,7 @@ export const googlePreAuth = async (ctx: any, next: any) => {
})(ctx, next)
}
export const googleCallback = async (ctx: any, next: any) => {
export const googleCallback = async (ctx: Ctx<void, void>, next: Next) => {
const config = await configs.getGoogleConfig()
if (!config) {
return ctx.throw(400, "Google config not found")
@ -241,7 +255,7 @@ export const oidcStrategyFactory = async (ctx: any) => {
* The initial call that OIDC authentication makes to take you to the configured OIDC login screen.
* On a successful login, you will be redirected to the oidcAuth callback route.
*/
export const oidcPreAuth = async (ctx: Ctx, next: any) => {
export const oidcPreAuth = async (ctx: Ctx<void, void>, next: Next) => {
const { configId } = ctx.params
if (!configId) {
ctx.throw(400, "OIDC config id is required")
@ -266,7 +280,7 @@ export const oidcPreAuth = async (ctx: Ctx, next: any) => {
})(ctx, next)
}
export const oidcCallback = async (ctx: any, next: any) => {
export const oidcCallback = async (ctx: Ctx<void, void>, next: Next) => {
const strategy = await oidcStrategyFactory(ctx)
return passport.authenticate(

View File

@ -15,8 +15,11 @@ import {
AIConfig,
AIInnerConfig,
Config,
ConfigChecklistResponse,
ConfigType,
Ctx,
DeleteConfigResponse,
FindConfigResponse,
GetPublicOIDCConfigResponse,
GetPublicSettingsResponse,
GoogleInnerConfig,
@ -29,11 +32,14 @@ import {
OIDCLogosConfig,
PASSWORD_REPLACEMENT,
QuotaUsageType,
SaveConfigRequest,
SaveConfigResponse,
SettingsBrandingConfig,
SettingsInnerConfig,
SSOConfig,
SSOConfigType,
StaticQuotaName,
UploadConfigFileResponse,
UserCtx,
} from "@budibase/types"
import * as pro from "@budibase/pro"
@ -225,7 +231,9 @@ export async function verifyAIConfig(
}
}
export async function save(ctx: UserCtx<Config>) {
export async function save(
ctx: UserCtx<SaveConfigRequest, SaveConfigResponse>
) {
const body = ctx.request.body
const type = body.type
const config = body.config
@ -337,7 +345,7 @@ function enrichOIDCLogos(oidcLogos: OIDCLogosConfig) {
)
}
export async function find(ctx: UserCtx) {
export async function find(ctx: UserCtx<void, FindConfigResponse>) {
try {
// Find the config with the most granular scope based on context
const type = ctx.params.type
@ -473,7 +481,7 @@ export async function publicSettings(
}
}
export async function upload(ctx: UserCtx) {
export async function upload(ctx: UserCtx<void, UploadConfigFileResponse>) {
if (ctx.request.files == null || Array.isArray(ctx.request.files.file)) {
ctx.throw(400, "One file must be uploaded.")
}
@ -518,7 +526,7 @@ export async function upload(ctx: UserCtx) {
}
}
export async function destroy(ctx: UserCtx) {
export async function destroy(ctx: UserCtx<void, DeleteConfigResponse>) {
const db = tenancy.getGlobalDB()
const { id, rev } = ctx.params
try {
@ -537,14 +545,14 @@ export async function destroy(ctx: UserCtx) {
}
}
export async function configChecklist(ctx: Ctx) {
export async function configChecklist(ctx: Ctx<void, ConfigChecklistResponse>) {
const tenantId = tenancy.getTenantId()
try {
ctx.body = await cache.withCache(
cache.CacheKey.CHECKLIST,
env.CHECKLIST_CACHE_TTL,
async () => {
async (): Promise<ConfigChecklistResponse> => {
let apps = []
if (!env.MULTI_TENANCY || tenantId) {
// Apps exist

View File

@ -1,8 +1,15 @@
import { sendEmail as sendEmailFn } from "../../../utilities/email"
import { tenancy } from "@budibase/backend-core"
import { BBContext, User } from "@budibase/types"
import {
UserCtx,
User,
SendEmailRequest,
SendEmailResponse,
} from "@budibase/types"
export async function sendEmail(ctx: BBContext) {
export async function sendEmail(
ctx: UserCtx<SendEmailRequest, SendEmailResponse>
) {
let {
workspaceId,
email,

View File

@ -5,6 +5,7 @@ import {
GetLicenseKeyResponse,
GetOfflineIdentifierResponse,
GetOfflineLicenseTokenResponse,
GetQuotaUsageResponse,
UserCtx,
} from "@budibase/types"
@ -36,7 +37,7 @@ export async function deleteLicenseKey(ctx: UserCtx<void, void>) {
// OFFLINE LICENSE
export async function activateOfflineLicenseToken(
ctx: UserCtx<ActivateOfflineLicenseTokenRequest>
ctx: UserCtx<ActivateOfflineLicenseTokenRequest, void>
) {
const { offlineLicenseToken } = ctx.request.body
await licensing.offline.activateOfflineLicenseToken(offlineLicenseToken)
@ -70,14 +71,16 @@ export async function getOfflineLicenseIdentifier(
// LICENSES
export const refresh = async (ctx: any) => {
export const refresh = async (ctx: UserCtx<void, void>) => {
await licensing.cache.refresh()
ctx.status = 200
}
// USAGE
export const getQuotaUsage = async (ctx: any) => {
export const getQuotaUsage = async (
ctx: UserCtx<void, GetQuotaUsageResponse>
) => {
ctx.body = await quotas.getQuotaUsage()
ctx.status = 200
}

View File

@ -6,9 +6,15 @@ import {
tenancy,
} from "@budibase/backend-core"
import sdk from "../../../sdk"
import { Ctx, App } from "@budibase/types"
import {
Ctx,
App,
FetchGlobalRolesResponse,
FindGlobalRoleResponse,
RemoveAppRoleResponse,
} from "@budibase/types"
export async function fetch(ctx: Ctx) {
export async function fetch(ctx: Ctx<void, FetchGlobalRolesResponse>) {
const tenantId = ctx.user!.tenantId
// always use the dev apps as they'll be most up to date (true)
const apps = (await dbCore.getAllApps({ tenantId, all: true })) as App[]
@ -31,7 +37,7 @@ export async function fetch(ctx: Ctx) {
ctx.body = response
}
export async function find(ctx: Ctx) {
export async function find(ctx: Ctx<void, FindGlobalRoleResponse>) {
const appId = ctx.params.appId
await context.doInAppContext(dbCore.getDevAppID(appId), async () => {
const db = context.getAppDB()
@ -45,7 +51,7 @@ export async function find(ctx: Ctx) {
})
}
export async function removeAppRole(ctx: Ctx) {
export async function removeAppRole(ctx: Ctx<void, RemoveAppRoleResponse>) {
const { appId } = ctx.params
const db = tenancy.getGlobalDB()
const users = await sdk.users.db.allUsers()

View File

@ -10,6 +10,11 @@ import {
import env from "../../../environment"
import { groups } from "@budibase/pro"
import {
DevInfo,
FetchAPIKeyResponse,
GenerateAPIKeyRequest,
GenerateAPIKeyResponse,
GetGlobalSelfResponse,
UpdateSelfRequest,
UpdateSelfResponse,
User,
@ -35,22 +40,24 @@ function cleanupDevInfo(info: any) {
return info
}
export async function generateAPIKey(ctx: any) {
export async function generateAPIKey(
ctx: UserCtx<GenerateAPIKeyRequest, GenerateAPIKeyResponse>
) {
let userId
let apiKey
if (env.isTest() && ctx.request.body.userId) {
userId = ctx.request.body.userId
apiKey = newTestApiKey()
} else {
userId = ctx.user._id
userId = ctx.user._id!
apiKey = newApiKey()
}
const db = tenancy.getGlobalDB()
const id = dbCore.generateDevInfoID(userId)
let devInfo
let devInfo: DevInfo
try {
devInfo = await db.get<any>(id)
devInfo = await db.get<DevInfo>(id)
} catch (err) {
devInfo = { _id: id, userId }
}
@ -59,9 +66,9 @@ export async function generateAPIKey(ctx: any) {
ctx.body = cleanupDevInfo(devInfo)
}
export async function fetchAPIKey(ctx: any) {
export async function fetchAPIKey(ctx: UserCtx<void, FetchAPIKeyResponse>) {
const db = tenancy.getGlobalDB()
const id = dbCore.generateDevInfoID(ctx.user._id)
const id = dbCore.generateDevInfoID(ctx.user._id!)
let devInfo
try {
devInfo = await db.get(id)
@ -87,11 +94,11 @@ const addSessionAttributesToUser = (ctx: any) => {
ctx.body.csrfToken = ctx.user.csrfToken
}
export async function getSelf(ctx: any) {
export async function getSelf(ctx: UserCtx<void, GetGlobalSelfResponse>) {
if (!ctx.user) {
ctx.throw(403, "User not logged in")
}
const userId = ctx.user._id
const userId = ctx.user._id!
ctx.params = {
id: userId,
}

View File

@ -3,10 +3,25 @@ import {
TemplateBindings,
GLOBAL_OWNER,
} from "../../../constants"
import { getTemplates } from "../../../constants/templates"
import { getTemplateByID, getTemplates } from "../../../constants/templates"
import { tenancy, db as dbCore } from "@budibase/backend-core"
import {
DeleteGlobalTemplateResponse,
FetchGlobalTemplateByOwnerIDResponse,
FetchGlobalTemplateByTypeResponse,
FetchGlobalTemplateDefinitionResponse,
FetchGlobalTemplateResponse,
FindGlobalTemplateResponse,
SaveGlobalTemplateRequest,
SaveGlobalTemplateResponse,
GlobalTemplateBinding,
GlobalTemplateDefinition,
UserCtx,
} from "@budibase/types"
export async function save(ctx: any) {
export async function save(
ctx: UserCtx<SaveGlobalTemplateRequest, SaveGlobalTemplateResponse>
) {
const db = tenancy.getGlobalDB()
let template = ctx.request.body
if (!template.ownerId) {
@ -23,9 +38,11 @@ export async function save(ctx: any) {
}
}
export async function definitions(ctx: any) {
const bindings: any = {}
const info: any = {}
export async function definitions(
ctx: UserCtx<void, FetchGlobalTemplateDefinitionResponse>
) {
const bindings: Record<string, GlobalTemplateBinding[]> = {}
const info: Record<string, GlobalTemplateDefinition> = {}
for (let template of TemplateMetadata.email) {
bindings[template.purpose] = template.bindings
info[template.purpose] = {
@ -44,34 +61,35 @@ export async function definitions(ctx: any) {
}
}
export async function fetch(ctx: any) {
export async function fetch(ctx: UserCtx<void, FetchGlobalTemplateResponse>) {
ctx.body = await getTemplates()
}
export async function fetchByType(ctx: any) {
// @ts-ignore
export async function fetchByType(
ctx: UserCtx<void, FetchGlobalTemplateByTypeResponse>
) {
ctx.body = await getTemplates({
type: ctx.params.type,
})
}
export async function fetchByOwner(ctx: any) {
export async function fetchByOwner(
ctx: UserCtx<void, FetchGlobalTemplateByOwnerIDResponse>
) {
// @ts-ignore
ctx.body = await getTemplates({
ownerId: ctx.params.ownerId,
})
}
export async function find(ctx: any) {
// @ts-ignore
ctx.body = await getTemplates({
id: ctx.params.id,
})
export async function find(ctx: UserCtx<void, FindGlobalTemplateResponse>) {
ctx.body = await getTemplateByID(ctx.params.id)
}
export async function destroy(ctx: any) {
export async function destroy(
ctx: UserCtx<void, DeleteGlobalTemplateResponse>
) {
const db = tenancy.getGlobalDB()
await db.remove(ctx.params.id, ctx.params.rev)
ctx.message = `Template ${ctx.params.id} deleted.`
ctx.status = 200
ctx.body = { message: `Template ${ctx.params.id} deleted.` }
}

View File

@ -6,21 +6,34 @@ import {
AddSSoUserRequest,
BulkUserRequest,
BulkUserResponse,
CheckInviteResponse,
CountUserResponse,
CreateAdminUserRequest,
CreateAdminUserResponse,
Ctx,
DeleteInviteUserRequest,
DeleteInviteUsersRequest,
DeleteInviteUsersResponse,
DeleteUserResponse,
FetchUsersResponse,
FindUserResponse,
GetUserInvitesResponse,
Hosting,
InviteUserRequest,
InviteUserResponse,
InviteUsersRequest,
InviteUsersResponse,
LockName,
LockType,
LookupAccountHolderResponse,
LookupTenantUserResponse,
MigrationType,
PlatformUserByEmail,
SaveUserResponse,
SearchUsersRequest,
SearchUsersResponse,
UpdateInviteRequest,
UpdateInviteResponse,
User,
UserCtx,
UserIdentifier,
@ -80,7 +93,7 @@ export const save = async (ctx: UserCtx<User, SaveUserResponse>) => {
}
}
export const addSsoSupport = async (ctx: Ctx<AddSSoUserRequest>) => {
export const addSsoSupport = async (ctx: Ctx<AddSSoUserRequest, void>) => {
const { email, ssoId } = ctx.request.body
try {
// Status is changed to 404 from getUserDoc if user is not found
@ -207,7 +220,7 @@ export const adminUser = async (
})
}
export const countByApp = async (ctx: any) => {
export const countByApp = async (ctx: UserCtx<void, CountUserResponse>) => {
const appId = ctx.params.appId
try {
ctx.body = await userSdk.db.countUsersByApp(appId)
@ -216,7 +229,7 @@ export const countByApp = async (ctx: any) => {
}
}
export const destroy = async (ctx: any) => {
export const destroy = async (ctx: UserCtx<void, DeleteUserResponse>) => {
const id = ctx.params.id
if (id === ctx.user._id) {
ctx.throw(400, "Unable to delete self.")
@ -239,7 +252,9 @@ export const getAppUsers = async (ctx: Ctx<SearchUsersRequest>) => {
ctx.body = { data: users }
}
export const search = async (ctx: Ctx<SearchUsersRequest>) => {
export const search = async (
ctx: Ctx<SearchUsersRequest, SearchUsersResponse>
) => {
const body = ctx.request.body
// TODO: for now only two supported search keys; string.email and equal._id
@ -280,7 +295,7 @@ export const search = async (ctx: Ctx<SearchUsersRequest>) => {
}
// called internally by app server user fetch
export const fetch = async (ctx: any) => {
export const fetch = async (ctx: UserCtx<void, FetchUsersResponse>) => {
const all = await userSdk.db.allUsers()
// user hashed password shouldn't ever be returned
for (let user of all) {
@ -292,11 +307,13 @@ export const fetch = async (ctx: any) => {
}
// called internally by app server user find
export const find = async (ctx: any) => {
export const find = async (ctx: UserCtx<void, FindUserResponse>) => {
ctx.body = await userSdk.db.getUser(ctx.params.id)
}
export const tenantUserLookup = async (ctx: any) => {
export const tenantUserLookup = async (
ctx: UserCtx<void, LookupTenantUserResponse>
) => {
const id = ctx.params.id
// is email, check its valid
if (id.includes("@") && !emailValidator.validate(id)) {
@ -314,7 +331,9 @@ export const tenantUserLookup = async (ctx: any) => {
* This will be paginated to a default of the first 50 users,
* So the account holder may not be found until further pagination has occurred
*/
export const accountHolderLookup = async (ctx: Ctx) => {
export const accountHolderLookup = async (
ctx: Ctx<void, LookupAccountHolderResponse>
) => {
try {
const users = await userSdk.core.getAllUsers()
const response = await userSdk.core.getExistingAccounts(
@ -366,7 +385,9 @@ export const onboardUsers = async (
ctx.body = { ...resp, created: true }
}
export const invite = async (ctx: Ctx<InviteUserRequest>) => {
export const invite = async (
ctx: Ctx<InviteUserRequest, InviteUserResponse>
) => {
const request = ctx.request.body
let multiRequest = [request]
@ -389,12 +410,14 @@ export const invite = async (ctx: Ctx<InviteUserRequest>) => {
}
}
export const inviteMultiple = async (ctx: Ctx<InviteUsersRequest>) => {
export const inviteMultiple = async (
ctx: Ctx<InviteUsersRequest, InviteUsersResponse>
) => {
ctx.body = await userSdk.invite(ctx.request.body)
}
export const removeMultipleInvites = async (
ctx: Ctx<DeleteInviteUsersRequest>
ctx: Ctx<DeleteInviteUsersRequest, DeleteInviteUsersResponse>
) => {
const inviteCodesToRemove = ctx.request.body.map(
(invite: DeleteInviteUserRequest) => invite.code
@ -407,7 +430,7 @@ export const removeMultipleInvites = async (
}
}
export const checkInvite = async (ctx: any) => {
export const checkInvite = async (ctx: UserCtx<void, CheckInviteResponse>) => {
const { code } = ctx.params
let invite
try {
@ -422,7 +445,9 @@ export const checkInvite = async (ctx: any) => {
}
}
export const getUserInvites = async (ctx: any) => {
export const getUserInvites = async (
ctx: UserCtx<void, GetUserInvitesResponse>
) => {
try {
// Restricted to the currently authenticated tenant
ctx.body = await cache.invite.getInviteCodes()
@ -431,7 +456,9 @@ export const getUserInvites = async (ctx: any) => {
}
}
export const updateInvite = async (ctx: any) => {
export const updateInvite = async (
ctx: UserCtx<UpdateInviteRequest, UpdateInviteResponse>
) => {
const { code } = ctx.params
let updateBody = { ...ctx.request.body }

View File

@ -1,53 +0,0 @@
import { tenancy, db as dbCore } from "@budibase/backend-core"
import { BBContext } from "@budibase/types"
export async function save(ctx: BBContext) {
const db = tenancy.getGlobalDB()
const workspaceDoc = ctx.request.body
// workspace does not exist yet
if (!workspaceDoc._id) {
workspaceDoc._id = dbCore.generateWorkspaceID()
}
try {
const response = await db.put(workspaceDoc)
ctx.body = {
_id: response.id,
_rev: response.rev,
}
} catch (err: any) {
ctx.throw(err.status, err)
}
}
export async function fetch(ctx: BBContext) {
const db = tenancy.getGlobalDB()
const response = await db.allDocs(
dbCore.getWorkspaceParams(undefined, {
include_docs: true,
})
)
ctx.body = response.rows.map(row => row.doc)
}
export async function find(ctx: BBContext) {
const db = tenancy.getGlobalDB()
try {
ctx.body = await db.get(ctx.params.id)
} catch (err: any) {
ctx.throw(err.status, err)
}
}
export async function destroy(ctx: BBContext) {
const db = tenancy.getGlobalDB()
const { id, rev } = ctx.params
try {
await db.remove(id, rev)
ctx.body = { message: "Workspace deleted successfully" }
} catch (err: any) {
ctx.throw(err.status, err)
}
}

View File

@ -1,7 +1,15 @@
import { Account, AccountMetadata, Ctx } from "@budibase/types"
import {
Account,
AccountMetadata,
Ctx,
SaveAccountRequest,
SaveAccountResponse,
} from "@budibase/types"
import * as accounts from "../../../sdk/accounts"
export const save = async (ctx: Ctx<Account, AccountMetadata>) => {
export const save = async (
ctx: Ctx<SaveAccountRequest, SaveAccountResponse>
) => {
const account = ctx.request.body as Account
let metadata: AccountMetadata = {
_id: accounts.metadata.formatAccountMetadataId(account.accountId),
@ -14,7 +22,7 @@ export const save = async (ctx: Ctx<Account, AccountMetadata>) => {
ctx.status = 200
}
export const destroy = async (ctx: any) => {
export const destroy = async (ctx: Ctx<void, void>) => {
const accountId = accounts.metadata.formatAccountMetadataId(
ctx.params.accountId
)

View File

@ -1,4 +1,4 @@
import { Ctx, MaintenanceType } from "@budibase/types"
import { Ctx, GetEnvironmentResponse, MaintenanceType } from "@budibase/types"
import env from "../../../environment"
import { env as coreEnv, db as dbCore } from "@budibase/backend-core"
import nodeFetch from "node-fetch"
@ -38,13 +38,13 @@ async function isSqsMissing() {
return !(await isSqsAvailable())
}
export const fetch = async (ctx: Ctx) => {
export const fetch = async (ctx: Ctx<void, GetEnvironmentResponse>) => {
ctx.body = {
multiTenancy: !!env.MULTI_TENANCY,
offlineMode: !!coreEnv.OFFLINE_MODE,
cloud: !env.SELF_HOSTED,
accountPortalUrl: env.ACCOUNT_PORTAL_URL,
disableAccountPortal: env.DISABLE_ACCOUNT_PORTAL,
disableAccountPortal: !!env.DISABLE_ACCOUNT_PORTAL,
baseUrl: env.PLATFORM_URL,
isDev: env.isDev() && !env.isTest(),
maintenance: [],

View File

@ -1,7 +1,7 @@
import { UserCtx } from "@budibase/types"
import { GetLogResponse, UserCtx } from "@budibase/types"
import { installation, logging } from "@budibase/backend-core"
export async function getLogs(ctx: UserCtx) {
export async function getLogs(ctx: UserCtx<void, GetLogResponse>) {
const logReadStream = logging.system.getLogReadStream()
const { installId } = await installation.getInstall()

View File

@ -1,13 +1,23 @@
import {
FetchMigrationDefinitionsResponse,
RunGlobalMigrationRequest,
UserCtx,
} from "@budibase/types"
const { migrate, MIGRATIONS } = require("../../../migrations")
export const runMigrations = async (ctx: any) => {
export const runMigrations = async (
ctx: UserCtx<RunGlobalMigrationRequest, void>
) => {
const options = ctx.request.body
// don't await as can take a while, just return
migrate(options)
ctx.status = 200
}
export const fetchDefinitions = async (ctx: any) => {
export const fetchDefinitions = async (
ctx: UserCtx<void, FetchMigrationDefinitionsResponse>
) => {
ctx.body = MIGRATIONS
ctx.status = 200
}

View File

@ -1,8 +1,10 @@
import env from "../../../environment"
import { BBContext } from "@budibase/types"
import { SystemRestoreResponse, UserCtx } from "@budibase/types"
import { cache } from "@budibase/backend-core"
export async function systemRestored(ctx: BBContext) {
export async function systemRestored(
ctx: UserCtx<void, SystemRestoreResponse>
) {
if (!env.SELF_HOSTED) {
ctx.throw(405, "This operation is not allowed in cloud.")
}

View File

@ -1,7 +1,7 @@
import { UserCtx } from "@budibase/types"
import { GetTenantInfoResponse, UserCtx } from "@budibase/types"
import * as tenantSdk from "../../../sdk/tenants"
export async function destroy(ctx: UserCtx) {
export async function destroy(ctx: UserCtx<void, void>) {
const user = ctx.user!
const tenantId = ctx.params.tenantId
@ -18,6 +18,6 @@ export async function destroy(ctx: UserCtx) {
}
}
export async function info(ctx: UserCtx) {
export async function info(ctx: UserCtx<void, GetTenantInfoResponse>) {
ctx.body = await tenantSdk.tenantInfo(ctx.params.tenantId)
}

View File

@ -1,7 +1,7 @@
import Router from "@koa/router"
import * as controller from "../../controllers/global/email"
import { EmailTemplatePurpose } from "../../../constants"
import { auth } from "@budibase/backend-core"
import { EmailTemplatePurpose } from "@budibase/types"
import Joi from "joi"
const router: Router = new Router()

View File

@ -1,8 +1,8 @@
jest.mock("nodemailer")
import { EmailTemplatePurpose } from "@budibase/types"
import { TestConfiguration, mocks } from "../../../../tests"
const sendMailMock = mocks.email.mock()
import { EmailTemplatePurpose } from "../../../../constants"
describe("/api/global/email", () => {
const config = new TestConfiguration()

View File

@ -1,11 +1,10 @@
jest.unmock("node-fetch")
import { TestConfiguration } from "../../../../tests"
import { EmailTemplatePurpose } from "../../../../constants"
import { objectStore } from "@budibase/backend-core"
import { helpers } from "@budibase/shared-core"
import tk from "timekeeper"
import { EmailAttachment } from "@budibase/types"
import { EmailAttachment, EmailTemplatePurpose } from "@budibase/types"
const fetch = require("node-fetch")

View File

@ -1,9 +1,6 @@
import {
EmailTemplatePurpose,
TemplateMetadata,
TemplateType,
} from "../../../../constants"
import { TemplateMetadata, TemplateType } from "../../../../constants"
import { TestConfiguration } from "../../../../tests"
import { EmailTemplatePurpose } from "@budibase/types"
// TODO

View File

@ -1,37 +0,0 @@
import Router from "@koa/router"
import * as controller from "../../controllers/global/workspaces"
import { auth } from "@budibase/backend-core"
import Joi from "joi"
const router: Router = new Router()
function buildWorkspaceSaveValidation() {
// prettier-ignore
return auth.joiValidator.body(Joi.object({
_id: Joi.string().optional(),
_rev: Joi.string().optional(),
name: Joi.string().required(),
users: Joi.array().required(),
managers: Joi.array().required(),
roles: Joi.object({
default: Joi.string().optional(),
app: Joi.object()
.pattern(/.*/, Joi.string())
.required()
.unknown(true),
}).unknown(true).optional(),
}).required().unknown(true))
}
router
.post(
"/api/global/workspaces",
auth.adminOnly,
buildWorkspaceSaveValidation(),
controller.save
)
.delete("/api/global/workspaces/:id", auth.adminOnly, controller.destroy)
.get("/api/global/workspaces", controller.fetch)
.get("/api/global/workspaces/:id", controller.find)
export default router

View File

@ -2,7 +2,6 @@ import Router from "@koa/router"
import { api as pro } from "@budibase/pro"
import userRoutes from "./global/users"
import configRoutes from "./global/configs"
import workspaceRoutes from "./global/workspaces"
import templateRoutes from "./global/templates"
import emailRoutes from "./global/email"
import authRoutes from "./global/auth"
@ -24,7 +23,6 @@ export const routes: Router[] = [
configRoutes,
userRoutes,
pro.users,
workspaceRoutes,
authRoutes,
templateRoutes,
tenantsRoutes,

View File

@ -22,7 +22,7 @@ describe("/api/system/environment", () => {
const env = await config.api.environment.getEnvironment()
expect(env.body).toEqual({
cloud: true,
disableAccountPortal: 0,
disableAccountPortal: false,
isDev: false,
multiTenancy: true,
baseUrl: "http://localhost:10000",
@ -36,7 +36,7 @@ describe("/api/system/environment", () => {
const env = await config.api.environment.getEnvironment()
expect(env.body).toEqual({
cloud: false,
disableAccountPortal: 0,
disableAccountPortal: false,
isDev: false,
multiTenancy: true,
baseUrl: "http://localhost:10000",

View File

@ -1,4 +1,5 @@
import { constants } from "@budibase/backend-core"
import { EmailTemplatePurpose } from "@budibase/types"
export const LOGO_URL =
"https://d33wubrfki0l68.cloudfront.net/aac32159d7207b5085e74a7ef67afbb7027786c5/2b1fd/img/logo/bb-emblem.svg"
@ -19,15 +20,6 @@ export enum TemplateType {
EMAIL = "email",
}
export enum EmailTemplatePurpose {
CORE = "core",
BASE = "base",
PASSWORD_RECOVERY = "password_recovery",
INVITATION = "invitation",
WELCOME = "welcome",
CUSTOM = "custom",
}
export enum TemplateMetadataNames {
BASE = "Base format",
PASSWORD_RECOVERY = "Password recovery",

View File

@ -1,13 +1,8 @@
import { readStaticFile } from "../../utilities/fileSystem"
import {
EmailTemplatePurpose,
TemplateType,
TemplatePurpose,
GLOBAL_OWNER,
} from "../index"
import { TemplateType, TemplatePurpose, GLOBAL_OWNER } from "../index"
import { join } from "path"
import { db as dbCore, tenancy } from "@budibase/backend-core"
import { Template } from "@budibase/types"
import { Template, EmailTemplatePurpose } from "@budibase/types"
export const EmailTemplates = {
[EmailTemplatePurpose.PASSWORD_RECOVERY]: readStaticFile(
@ -53,8 +48,21 @@ export function addBaseTemplates(templates: Template[], type?: string) {
export async function getTemplates({
ownerId,
type,
id,
}: { ownerId?: string; type?: string; id?: string } = {}) {
}: { ownerId?: string; type?: string } = {}) {
const db = tenancy.getGlobalDB()
const response = await db.allDocs<Template>(
dbCore.getTemplateParams(ownerId || GLOBAL_OWNER, undefined, {
include_docs: true,
})
)
let templates = response.rows.map(row => row.doc!)
if (type) {
templates = templates.filter(template => template.type === type)
}
return addBaseTemplates(templates, type)
}
export async function getTemplateByID(id: string, ownerId?: string) {
const db = tenancy.getGlobalDB()
const response = await db.allDocs<Template>(
dbCore.getTemplateParams(ownerId || GLOBAL_OWNER, id, {
@ -63,16 +71,10 @@ export async function getTemplates({
)
let templates = response.rows.map(row => row.doc!)
// should only be one template with ID
if (id) {
return templates[0]
}
if (type) {
templates = templates.filter(template => template.type === type)
}
return addBaseTemplates(templates, type)
return templates[0]
}
export async function getTemplateByPurpose(type: string, purpose: string) {
const templates = (await getTemplates({ type })) as Template[]
const templates = await getTemplates({ type })
return templates.find((template: Template) => template.purpose === purpose)
}

View File

@ -1,12 +1,12 @@
import env from "../environment"
import { constants, utils } from "@budibase/backend-core"
import { BBContext } from "@budibase/types"
import { UserCtx } from "@budibase/types"
/**
* This is a restricted endpoint in the cloud.
* Ensure that the correct API key has been supplied.
*/
export default async (ctx: BBContext, next: any) => {
export default async (ctx: UserCtx, next: any) => {
if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) {
const apiKey = ctx.request.headers[constants.Header.API_KEY]
if (!apiKey) {

View File

@ -8,11 +8,10 @@ import {
utils as coreUtils,
cache,
} from "@budibase/backend-core"
import { PlatformLogoutOpts, User } from "@budibase/types"
import { PlatformLogoutOpts, User, EmailTemplatePurpose } from "@budibase/types"
import jwt from "jsonwebtoken"
import * as userSdk from "../users"
import * as emails from "../../utilities/email"
import { EmailTemplatePurpose } from "../../constants"
// LOGIN / LOGOUT

View File

@ -3,9 +3,9 @@ import {
InviteUserRequest,
InviteUsersRequest,
InviteUsersResponse,
EmailTemplatePurpose,
} from "@budibase/types"
import { sendEmail } from "../../utilities/email"
import { EmailTemplatePurpose } from "../../constants"
export async function invite(
users: InviteUsersRequest

View File

@ -1,5 +1,4 @@
export * as email from "../api/controllers/global/email"
export * as workspaces from "../api/controllers/global/workspaces"
export * as config from "../api/controllers/global/configs"
export * as templates from "../api/controllers/global/templates"
export * as users from "../api/controllers/global/users"

View File

@ -1,9 +1,14 @@
import env from "../environment"
import { EmailTemplatePurpose, TemplateType } from "../constants"
import { TemplateType } from "../constants"
import { getTemplateByPurpose, EmailTemplates } from "../constants/templates"
import { getSettingsTemplateContext } from "./templates"
import { processString } from "@budibase/string-templates"
import { User, SendEmailOpts, SMTPInnerConfig } from "@budibase/types"
import {
User,
SendEmailOpts,
SMTPInnerConfig,
EmailTemplatePurpose,
} from "@budibase/types"
import { configs, cache, objectStore } from "@budibase/backend-core"
import ical from "ical-generator"
import _ from "lodash"

View File

@ -1,9 +1,6 @@
import { tenancy, configs } from "@budibase/backend-core"
import {
InternalTemplateBinding,
LOGO_URL,
EmailTemplatePurpose,
} from "../constants"
import { EmailTemplatePurpose } from "@budibase/types"
import { InternalTemplateBinding, LOGO_URL } from "../constants"
import { checkSlashesInUrl } from "./index"
const BASE_COMPANY = "Budibase"

178
yarn.lock
View File

@ -2690,6 +2690,11 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f"
integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==
"@fastify/busboy@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d"
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==
"@fontsource/source-sans-pro@^5.0.3":
version "5.0.3"
resolved "https://registry.yarnpkg.com/@fontsource/source-sans-pro/-/source-sans-pro-5.0.3.tgz#7d6e84a8169ba12fa5e6ce70757aa2ca7e74d855"
@ -5488,13 +5493,14 @@
"@types/node" "*"
"@types/ssh2" "*"
"@types/dockerode@^3.3.24":
version "3.3.24"
resolved "https://registry.yarnpkg.com/@types/dockerode/-/dockerode-3.3.24.tgz#bea354a4fcd0824a80fd5ea5ede3e8cda71137a7"
integrity sha512-679y69OYusf7Fr2HtdjXPUF6hnHxSA9K4EsuagsMuPno/XpJHjXxCOy2I5YL8POnWbzjsQAi0pyKIYM9HSpQog==
"@types/dockerode@^3.3.29":
version "3.3.32"
resolved "https://registry.yarnpkg.com/@types/dockerode/-/dockerode-3.3.32.tgz#289dab161e59a0d62956194b394d7dc8145bae18"
integrity sha512-xxcG0g5AWKtNyh7I7wswLdFvym4Mlqks5ZlKzxEUrGHS0r0PUOfxm2T0mspwu10mHQqu3Ck3MI3V2HqvLWE1fg==
dependencies:
"@types/docker-modem" "*"
"@types/node" "*"
"@types/ssh2" "*"
"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0", "@types/estree@^1.0.1":
version "1.0.5"
@ -6889,38 +6895,6 @@ archive-type@^4.0.0:
dependencies:
file-type "^4.2.0"
archiver-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-2.1.0.tgz#e8a460e94b693c3e3da182a098ca6285ba9249e2"
integrity sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==
dependencies:
glob "^7.1.4"
graceful-fs "^4.2.0"
lazystream "^1.0.0"
lodash.defaults "^4.2.0"
lodash.difference "^4.5.0"
lodash.flatten "^4.4.0"
lodash.isplainobject "^4.0.6"
lodash.union "^4.6.0"
normalize-path "^3.0.0"
readable-stream "^2.0.0"
archiver-utils@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-3.0.4.tgz#a0d201f1cf8fce7af3b5a05aea0a337329e96ec7"
integrity sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==
dependencies:
glob "^7.2.3"
graceful-fs "^4.2.0"
lazystream "^1.0.0"
lodash.defaults "^4.2.0"
lodash.difference "^4.5.0"
lodash.flatten "^4.4.0"
lodash.isplainobject "^4.0.6"
lodash.union "^4.6.0"
normalize-path "^3.0.0"
readable-stream "^3.6.0"
archiver-utils@^5.0.0, archiver-utils@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-5.0.2.tgz#63bc719d951803efc72cf961a56ef810760dd14d"
@ -6934,7 +6908,7 @@ archiver-utils@^5.0.0, archiver-utils@^5.0.2:
normalize-path "^3.0.0"
readable-stream "^4.0.0"
archiver@7.0.1:
archiver@7.0.1, archiver@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/archiver/-/archiver-7.0.1.tgz#c9d91c350362040b8927379c7aa69c0655122f61"
integrity sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==
@ -6947,19 +6921,6 @@ archiver@7.0.1:
tar-stream "^3.0.0"
zip-stream "^6.0.1"
archiver@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/archiver/-/archiver-5.3.2.tgz#99991d5957e53bd0303a392979276ac4ddccf3b0"
integrity sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==
dependencies:
archiver-utils "^2.1.0"
async "^3.2.4"
buffer-crc32 "^0.2.1"
readable-stream "^3.6.0"
readdir-glob "^1.1.2"
tar-stream "^2.2.0"
zip-stream "^4.1.0"
are-we-there-yet@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c"
@ -7735,16 +7696,16 @@ buffer-alloc@^1.2.0:
buffer-alloc-unsafe "^1.1.0"
buffer-fill "^1.0.0"
buffer-crc32@^0.2.1, buffer-crc32@^0.2.13, buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==
buffer-crc32@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-1.0.0.tgz#a10993b9055081d55304bd9feb4a072de179f405"
integrity sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==
buffer-equal-constant-time@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819"
@ -8455,16 +8416,6 @@ component-emitter@^1.3.0:
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==
compress-commons@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.1.2.tgz#6542e59cb63e1f46a8b21b0e06f9a32e4c8b06df"
integrity sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==
dependencies:
buffer-crc32 "^0.2.13"
crc32-stream "^4.0.2"
normalize-path "^3.0.0"
readable-stream "^3.6.0"
compress-commons@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-6.0.2.tgz#26d31251a66b9d6ba23a84064ecd3a6a71d2609e"
@ -8763,14 +8714,6 @@ crc-32@^1.2.0:
resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff"
integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==
crc32-stream@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-4.0.3.tgz#85dd677eb78fa7cad1ba17cc506a597d41fc6f33"
integrity sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==
dependencies:
crc-32 "^1.2.0"
readable-stream "^3.4.0"
crc32-stream@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-6.0.0.tgz#8529a3868f8b27abb915f6c3617c0fadedbf9430"
@ -9161,6 +9104,13 @@ debug@^3.1.0, debug@^3.2.7:
dependencies:
ms "^2.1.1"
debug@^4.3.5:
version "4.3.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52"
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
dependencies:
ms "^2.1.3"
debuglog@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
@ -9706,10 +9656,10 @@ docker-compose@0.24.0:
dependencies:
yaml "^1.10.2"
docker-compose@^0.24.6:
version "0.24.6"
resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.24.6.tgz#d1f490a641bdb7ccc07c4d446b264f026f9a1f15"
integrity sha512-VidlUyNzXMaVsuM79sjSvwC4nfojkP2VneL+Zfs538M2XFnffZDhx6veqnz/evCNIYGyz5O+1fgL6+g0NLWTBA==
docker-compose@^0.24.8:
version "0.24.8"
resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.24.8.tgz#6c125e6b9e04cf68ced47e2596ef2bb93ee9694e"
integrity sha512-plizRs/Vf15H+GCVxq2EUvyPK7ei9b/cVesHvjnX4xaXjM9spHe2Ytq0BitndFgvTJ3E3NljPNUEl7BAN43iZw==
dependencies:
yaml "^2.2.2"
@ -11644,7 +11594,7 @@ glob@^5.0.15:
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.0.5, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.3:
glob@^7.0.5, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
@ -14694,11 +14644,6 @@ lodash.defaults@^4.2.0:
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==
lodash.difference@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c"
integrity sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==
lodash.flatten@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
@ -14789,11 +14734,6 @@ lodash.sortby@^4.7.0:
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==
lodash.union@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"
integrity sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==
lodash.without@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac"
@ -15508,7 +15448,7 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
ms@^2.0.0, ms@^2.1.1:
ms@^2.0.0, ms@^2.1.1, ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
@ -15730,7 +15670,7 @@ node-domexception@1.0.0:
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
node-fetch@2.6.7, node-fetch@2.6.9, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9, node-fetch@^2.7.0:
node-fetch@2.6.7, node-fetch@2.6.9, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
@ -19990,10 +19930,10 @@ tar-fs@2.1.1, tar-fs@^2.0.0:
pump "^3.0.0"
tar-stream "^2.1.4"
tar-fs@^3.0.5:
version "3.0.5"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.5.tgz#f954d77767e4e6edf973384e1eb95f8f81d64ed9"
integrity sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==
tar-fs@^3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.6.tgz#eaccd3a67d5672f09ca8e8f9c3d2b89fa173f217"
integrity sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==
dependencies:
pump "^3.0.0"
tar-stream "^3.1.5"
@ -20024,7 +19964,7 @@ tar-stream@^1.5.2:
to-buffer "^1.1.1"
xtend "^4.0.0"
tar-stream@^2.0.0, tar-stream@^2.1.4, tar-stream@^2.2.0, tar-stream@~2.2.0:
tar-stream@^2.0.0, tar-stream@^2.1.4, tar-stream@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
@ -20124,26 +20064,26 @@ test-exclude@^6.0.0:
glob "^7.1.4"
minimatch "^3.0.4"
testcontainers@10.7.2, testcontainers@^10.7.2:
version "10.7.2"
resolved "https://registry.yarnpkg.com/testcontainers/-/testcontainers-10.7.2.tgz#619e93200dd47f174b307b40fa830cf023b74c25"
integrity sha512-7d+LVd/4YKp/cutiVMLL5cnj/8p8oYELAVRRyNUM4FyUDz1OLQuwW868nDl7Vd1ZAQxzGeCR+F86FlR9Yw9fMA==
testcontainers@10.16.0:
version "10.16.0"
resolved "https://registry.yarnpkg.com/testcontainers/-/testcontainers-10.16.0.tgz#8a7e69ada5cd2c6cce1c6db72b3a3e8e412fcaf6"
integrity sha512-oxPLuOtrRWS11A+Yn0+zXB7GkmNarflWqmy6CQJk8KJ75LZs2/zlUXDpizTbPpCGtk4kE2EQYwFZjrE967F8Wg==
dependencies:
"@balena/dockerignore" "^1.0.2"
"@types/dockerode" "^3.3.24"
archiver "^5.3.2"
"@types/dockerode" "^3.3.29"
archiver "^7.0.1"
async-lock "^1.4.1"
byline "^5.0.0"
debug "^4.3.4"
docker-compose "^0.24.6"
debug "^4.3.5"
docker-compose "^0.24.8"
dockerode "^3.3.5"
get-port "^5.1.1"
node-fetch "^2.7.0"
proper-lockfile "^4.1.2"
properties-reader "^2.3.0"
ssh-remote-port-forward "^1.0.4"
tar-fs "^3.0.5"
tmp "^0.2.1"
tar-fs "^3.0.6"
tmp "^0.2.3"
undici "^5.28.4"
text-extensions@^1.0.0:
version "1.9.0"
@ -20267,7 +20207,7 @@ tlhunter-sorted-set@^0.1.0:
resolved "https://registry.yarnpkg.com/tlhunter-sorted-set/-/tlhunter-sorted-set-0.1.0.tgz#1c3eae28c0fa4dff97e9501d2e3c204b86406f4b"
integrity sha512-eGYW4bjf1DtrHzUYxYfAcSytpOkA44zsr7G2n3PV7yOUR23vmkGe3LL4R+1jL9OsXtbsFOwe8XtbCrabeaEFnw==
tmp@0.2.3, tmp@^0.2.1, tmp@~0.2.1:
tmp@0.2.3, tmp@^0.2.3, tmp@~0.2.1:
version "0.2.3"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==
@ -20672,10 +20612,10 @@ typescript-eslint@^7.3.1:
"@typescript-eslint/parser" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
typescript@5.5.2:
version "5.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507"
integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==
typescript@5.7.2:
version "5.7.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==
"typescript@>=3 < 6":
version "5.5.4"
@ -20755,6 +20695,13 @@ undici@^4.14.1:
resolved "https://registry.yarnpkg.com/undici/-/undici-4.16.0.tgz#469bb87b3b918818d3d7843d91a1d08da357d5ff"
integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==
undici@^5.28.4:
version "5.28.4"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068"
integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==
dependencies:
"@fastify/busboy" "^2.0.0"
unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
@ -21801,15 +21748,6 @@ z-schema@^5.0.1:
optionalDependencies:
commander "^9.4.1"
zip-stream@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-4.1.1.tgz#1337fe974dbaffd2fa9a1ba09662a66932bd7135"
integrity sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==
dependencies:
archiver-utils "^3.0.4"
compress-commons "^4.1.2"
readable-stream "^3.6.0"
zip-stream@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-6.0.1.tgz#e141b930ed60ccaf5d7fa9c8260e0d1748a2bbfb"