From 40cb22a7d5c303cd0320ce9b1d846009b1ee8d72 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Tue, 12 Mar 2024 13:45:09 +0100 Subject: [PATCH 01/46] Adds OnboardingProcessCorrelationKey --- packages/account-portal | 2 +- packages/frontend-core/src/constants.js | 2 ++ packages/shared-core/src/constants/index.ts | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/account-portal b/packages/account-portal index 0c050591c2..3ce7c629b5 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 0c050591c21d3b67dc0c9225d60cc9e2324c8dac +Subproject commit 3ce7c629b523f2481a4d6c9ad906fb345cc9039d diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index edfdb1c5ef..68da439195 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -3,6 +3,7 @@ */ export { OperatorOptions, SqlNumberTypeRangeMap } from "@budibase/shared-core" export { Feature as Features } from "@budibase/types" +import { BpmCorrelationKey } from "@budibase/shared-core" // Cookie names export const Cookies = { @@ -10,6 +11,7 @@ export const Cookies = { CurrentApp: "budibase:currentapp", ReturnUrl: "budibase:returnurl", AccountReturnUrl: "budibase:account:returnurl", + OnboardingProcessCorrelationKey: BpmCorrelationKey.ONBOARDING, } // Table names diff --git a/packages/shared-core/src/constants/index.ts b/packages/shared-core/src/constants/index.ts index 99fb5c2a73..963ea9742a 100644 --- a/packages/shared-core/src/constants/index.ts +++ b/packages/shared-core/src/constants/index.ts @@ -158,3 +158,22 @@ export const InvalidFileExtensions = [ "wsh", "zip", ] + +export enum BpmCorrelationKey { + ONBOARDING = "budibase:onboarding:correlationkey" +} + +export enum BpmInstanceKey { + ONBOARDING = "budibase:onboarding:instancekey" +} + +export enum BpmStatusKey { + ONBOARDING = "budibase:onboarding:status" +} + +export enum BpmStatusValue { + STARTED = "started", + COMPLETING_ACCOUNT_INFO = "completing_account_info", + VALIDATING_EMAIL = "validating_email", + COMPLETED = "completed", +} From b1be076ed01e46b758446f5d4119108dd2521461 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Tue, 12 Mar 2024 13:48:11 +0100 Subject: [PATCH 02/46] Update account portal submodule --- packages/account-portal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/account-portal b/packages/account-portal index 3ce7c629b5..4ccb03f951 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 3ce7c629b523f2481a4d6c9ad906fb345cc9039d +Subproject commit 4ccb03f95110735332ce42b1817efbbd2e54864b From 8ae579b1d79899f0fc74cf9e2d1479ea24606875 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Thu, 14 Mar 2024 13:15:35 +0100 Subject: [PATCH 03/46] Lint --- packages/shared-core/src/constants/index.ts | 6 +++--- packages/worker/src/utilities/email.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/shared-core/src/constants/index.ts b/packages/shared-core/src/constants/index.ts index 963ea9742a..924618efb8 100644 --- a/packages/shared-core/src/constants/index.ts +++ b/packages/shared-core/src/constants/index.ts @@ -160,15 +160,15 @@ export const InvalidFileExtensions = [ ] export enum BpmCorrelationKey { - ONBOARDING = "budibase:onboarding:correlationkey" + ONBOARDING = "budibase:onboarding:correlationkey", } export enum BpmInstanceKey { - ONBOARDING = "budibase:onboarding:instancekey" + ONBOARDING = "budibase:onboarding:instancekey", } export enum BpmStatusKey { - ONBOARDING = "budibase:onboarding:status" + ONBOARDING = "budibase:onboarding:status", } export enum BpmStatusValue { diff --git a/packages/worker/src/utilities/email.ts b/packages/worker/src/utilities/email.ts index 27f2876eda..e963234791 100644 --- a/packages/worker/src/utilities/email.ts +++ b/packages/worker/src/utilities/email.ts @@ -45,8 +45,8 @@ function createSMTPTransport(config?: SMTPInnerConfig) { host: "smtp.ethereal.email", secure: false, auth: { - user: "seamus99@ethereal.email", - pass: "5ghVteZAqj6jkKJF9R", + user: "jeremy22@ethereal.email", + pass: "EkeTST7Zr2TEsWtkRh", }, } } From 6728fdad1dd0adfa3ac206370f915df8dbb505d6 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Thu, 14 Mar 2024 15:35:45 +0100 Subject: [PATCH 04/46] VERIFYING_EMAIL --- packages/shared-core/src/constants/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared-core/src/constants/index.ts b/packages/shared-core/src/constants/index.ts index 924618efb8..7acaa2cba1 100644 --- a/packages/shared-core/src/constants/index.ts +++ b/packages/shared-core/src/constants/index.ts @@ -174,6 +174,6 @@ export enum BpmStatusKey { export enum BpmStatusValue { STARTED = "started", COMPLETING_ACCOUNT_INFO = "completing_account_info", - VALIDATING_EMAIL = "validating_email", + VERIFYING_EMAIL = "verifying_email", COMPLETED = "completed", } From ff231b0095ccefda0f15c6bac48b74fd2b47343a Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 19 Mar 2024 13:30:42 +0000 Subject: [PATCH 05/46] Make password optional --- packages/backend-core/src/users/db.ts | 4 ++-- packages/types/src/api/web/user.ts | 2 +- packages/worker/src/api/routes/global/users.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index 136cb4b8ad..04d3264e6f 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -500,13 +500,13 @@ export class UserDB { static async createAdminUser( email: string, - password: string, tenantId: string, + password?: string, opts?: CreateAdminUserOpts ) { const user: User = { email: email, - password: password, + password, createdAt: Date.now(), roles: {}, builder: { diff --git a/packages/types/src/api/web/user.ts b/packages/types/src/api/web/user.ts index 0de42622e6..d68d687dcb 100644 --- a/packages/types/src/api/web/user.ts +++ b/packages/types/src/api/web/user.ts @@ -63,7 +63,7 @@ export interface SearchUsersRequest { export interface CreateAdminUserRequest { email: string - password: string + password?: string tenantId: string ssoId?: string } diff --git a/packages/worker/src/api/routes/global/users.ts b/packages/worker/src/api/routes/global/users.ts index 3c9cfd2f41..6b9291b88b 100644 --- a/packages/worker/src/api/routes/global/users.ts +++ b/packages/worker/src/api/routes/global/users.ts @@ -7,12 +7,13 @@ import { users } from "../validation" import * as selfController from "../../controllers/global/self" const router: Router = new Router() +const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("") function buildAdminInitValidation() { return auth.joiValidator.body( Joi.object({ email: Joi.string().required(), - password: Joi.string(), + password: OPTIONAL_STRING, tenantId: Joi.string().required(), ssoId: Joi.string(), }) From 7fe4fe9b15183f29f8bf966163d3e917f79f5ccf Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 19 Mar 2024 17:29:52 +0000 Subject: [PATCH 06/46] Exclude .nx folder --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3eb705dbbf..21a6c4dfaa 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,5 @@ budibase-component budibase-datasource *.iml + +.nx \ No newline at end of file From 7df5e7a8a78d4d8b88eaaafccf6a963b780d6ced Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 21 Mar 2024 15:19:50 +0000 Subject: [PATCH 07/46] fix order of createAdminUser args --- packages/account-portal | 2 +- packages/worker/src/api/controllers/global/users.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/account-portal b/packages/account-portal index 4ccb03f951..80173fdf42 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 4ccb03f95110735332ce42b1817efbbd2e54864b +Subproject commit 80173fdf426e124221adaff15b37418814ea2ad2 diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index 28ba97b4e2..6b9e533f78 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -127,8 +127,8 @@ export const adminUser = async ( try { const finalUser = await userSdk.db.createAdminUser( email, - password, tenantId, + password, { ssoId, hashPassword, From c32163a9be9dae2b2f050dae88cccf8a3e479446 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 21 Mar 2024 18:26:35 +0000 Subject: [PATCH 08/46] Initial fix for defaulting parameters, switch to null rather than strings, this is important for prepared statements/SQL queries. --- .../server/src/api/controllers/query/index.ts | 55 +++++++++++-------- packages/server/src/threads/definitions.ts | 13 ++--- packages/types/src/documents/app/query.ts | 2 + 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 0dba20dacd..b05b4b1222 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -6,7 +6,7 @@ import { invalidateDynamicVariables } from "../../../threads/utils" import env from "../../../environment" import { events, context, utils, constants } from "@budibase/backend-core" import sdk from "../../../sdk" -import { QueryEvent } from "../../../threads/definitions" +import { QueryEvent, QueryEventParameters } from "../../../threads/definitions" import { ConfigType, Query, @@ -18,7 +18,6 @@ import { FieldType, ExecuteQueryRequest, ExecuteQueryResponse, - QueryParameter, PreviewQueryRequest, PreviewQueryResponse, } from "@budibase/types" @@ -29,7 +28,7 @@ const Runner = new Thread(ThreadType.QUERY, { timeoutMs: env.QUERY_THREAD_TIMEOUT, }) -function validateQueryInputs(parameters: Record) { +function validateQueryInputs(parameters: QueryEventParameters) { for (let entry of Object.entries(parameters)) { const [key, value] = entry if (typeof value !== "string") { @@ -100,8 +99,10 @@ export async function save(ctx: UserCtx) { const datasource = await sdk.datasources.get(query.datasourceId) let eventFn - if (!query._id) { + if (!query._id && !query._rev) { query._id = generateQueryID(query.datasourceId) + // flag to state whether the default bindings are empty strings (old behaviour) or null + query.nullDefaultSupport = true eventFn = () => events.query.created(datasource, query) } else { eventFn = () => events.query.updated(datasource, query) @@ -135,16 +136,22 @@ function getAuthConfig(ctx: UserCtx) { } function enrichParameters( - queryParameters: QueryParameter[], - requestParameters: Record = {} -): Record { + query: Query, + requestParameters: QueryEventParameters = {} +): QueryEventParameters { + const paramNotSet = (val: unknown) => val === "" || val == undefined // first check parameters are all valid validateQueryInputs(requestParameters) // make sure parameters are fully enriched with defaults - for (let parameter of queryParameters) { - if (!requestParameters[parameter.name]) { - requestParameters[parameter.name] = parameter.default + for (let parameter of query.parameters) { + let value: string | null = requestParameters[parameter.name] + if (!value) { + value = parameter.default } + if (query.nullDefaultSupport && paramNotSet(value)) { + value = null + } + requestParameters[parameter.name] = value } return requestParameters } @@ -157,10 +164,15 @@ export async function preview( ) // preview may not have a queryId as it hasn't been saved, but if it does // this stops dynamic variables from calling the same query - const { fields, parameters, queryVerb, transformer, queryId, schema } = - ctx.request.body + const queryId = ctx.request.body.queryId + // the body contains the makings of a query, which has not been saved yet + const query: Query = ctx.request.body + // hasn't been saved, new query + if (!queryId && !query._id) { + query.nullDefaultSupport = true + } - let existingSchema = schema + let existingSchema = query.schema if (queryId && !existingSchema) { try { const db = context.getAppDB() @@ -268,13 +280,13 @@ export async function preview( try { const inputs: QueryEvent = { appId: ctx.appId, - datasource, - queryVerb, - fields, - parameters: enrichParameters(parameters), - transformer, + queryVerb: query.queryVerb, + fields: query.fields, + parameters: enrichParameters(query), + transformer: query.transformer, + schema: query.schema, queryId, - schema, + datasource, // have to pass down to the thread runner - can't put into context now environmentVariables: envVars, ctx: { @@ -336,10 +348,7 @@ async function execute( queryVerb: query.queryVerb, fields: query.fields, pagination: ctx.request.body.pagination, - parameters: enrichParameters( - query.parameters, - ctx.request.body.parameters - ), + parameters: enrichParameters(query, ctx.request.body.parameters), transformer: query.transformer, queryId: ctx.params.queryId, // have to pass down to the thread runner - can't put into context now diff --git a/packages/server/src/threads/definitions.ts b/packages/server/src/threads/definitions.ts index 14b97c57b1..85e546280d 100644 --- a/packages/server/src/threads/definitions.ts +++ b/packages/server/src/threads/definitions.ts @@ -1,21 +1,20 @@ -import { Datasource, QuerySchema, Row } from "@budibase/types" +import { Datasource, Row, Query } from "@budibase/types" export type WorkerCallback = (error: any, response?: any) => void -export interface QueryEvent { +export interface QueryEvent + extends Omit { appId?: string datasource: Datasource - queryVerb: string - fields: { [key: string]: any } - parameters: { [key: string]: unknown } pagination?: any - transformer: any queryId?: string environmentVariables?: Record + parameters: QueryEventParameters ctx?: any - schema?: Record } +export type QueryEventParameters = Record + export interface QueryResponse { rows: Row[] keys: string[] diff --git a/packages/types/src/documents/app/query.ts b/packages/types/src/documents/app/query.ts index 535c5dab3b..baba4def95 100644 --- a/packages/types/src/documents/app/query.ts +++ b/packages/types/src/documents/app/query.ts @@ -15,6 +15,8 @@ export interface Query extends Document { schema: Record readable: boolean queryVerb: string + // flag to state whether the default bindings are empty strings (old behaviour) or null + nullDefaultSupport?: boolean } export interface QueryPreview extends Omit { From 50c0fb1f973c14f283327db9f3272db270edcf44 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Fri, 22 Mar 2024 10:41:04 +0100 Subject: [PATCH 09/46] Override identity for events sent from dispatcher --- packages/backend-core/src/events/events.ts | 15 +++++++++++---- .../backend-core/src/events/publishers/account.ts | 10 ++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/backend-core/src/events/events.ts b/packages/backend-core/src/events/events.ts index f02b9fdf32..92b81553b0 100644 --- a/packages/backend-core/src/events/events.ts +++ b/packages/backend-core/src/events/events.ts @@ -1,4 +1,4 @@ -import { Event } from "@budibase/types" +import { Event, Identity } from "@budibase/types" import { processors } from "./processors" import identification from "./identification" import * as backfill from "./backfill" @@ -7,12 +7,19 @@ import { publishAsyncEvent } from "./asyncEvents" export const publishEvent = async ( event: Event, properties: any, - timestamp?: string | number + timestamp?: string | number, + identityOverride?: Identity ) => { // in future this should use async events via a distributed queue. - const identity = await identification.getCurrentIdentity() + const identity = + identityOverride || (await identification.getCurrentIdentity()) + + // Backfilling is get from the user cache, but when we override the identity cache is not available. Overrides are + // normally performed in automatic actions or operations in async flows (BPM) where the user session is not available. + const backfilling = identityOverride + ? false + : await backfill.isBackfillingEvent(event) - const backfilling = await backfill.isBackfillingEvent(event) // no backfill - send the event and exit if (!backfilling) { // send off async events if required diff --git a/packages/backend-core/src/events/publishers/account.ts b/packages/backend-core/src/events/publishers/account.ts index d337e404ef..99767962dd 100644 --- a/packages/backend-core/src/events/publishers/account.ts +++ b/packages/backend-core/src/events/publishers/account.ts @@ -5,13 +5,19 @@ import { AccountCreatedEvent, AccountDeletedEvent, AccountVerifiedEvent, + Identity, } from "@budibase/types" -async function created(account: Account) { +async function created(account: Account, identityOverride?: Identity) { const properties: AccountCreatedEvent = { tenantId: account.tenantId, } - await publishEvent(Event.ACCOUNT_CREATED, properties) + await publishEvent( + Event.ACCOUNT_CREATED, + properties, + undefined, + identityOverride + ) } async function deleted(account: Account) { From f4f7ac42ec164af87044e745229c79134a5c4f6a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 11:40:44 +0000 Subject: [PATCH 10/46] Adding test cases for interpolation of SQL, confirming that the context correctly gets cleaned up before passing into bindings. --- .../server/src/api/controllers/query/index.ts | 8 ++ .../routes/tests/queries/generic-sql.spec.ts | 85 +++++++++++++++++-- .../api/routes/tests/queries/mongodb.spec.ts | 2 +- .../server/src/integrations/queries/sql.ts | 15 +++- .../server/src/sdk/app/queries/queries.ts | 18 +++- .../server/src/tests/utilities/api/query.ts | 2 +- packages/server/src/threads/query.ts | 29 +++++-- 7 files changed, 137 insertions(+), 22 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index b05b4b1222..03fcdb714a 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -105,6 +105,12 @@ export async function save(ctx: UserCtx) { query.nullDefaultSupport = true eventFn = () => events.query.created(datasource, query) } else { + // check if flag has previously been set, don't let it change + // allow it to be explicitly set to false via API incase this is ever needed + const existingQuery = await db.get(query._id) + if (existingQuery.nullDefaultSupport && query.nullDefaultSupport == null) { + query.nullDefaultSupport = true + } eventFn = () => events.query.updated(datasource, query) } const response = await db.put(query) @@ -285,6 +291,7 @@ export async function preview( parameters: enrichParameters(query), transformer: query.transformer, schema: query.schema, + nullDefaultSupport: query.nullDefaultSupport, queryId, datasource, // have to pass down to the thread runner - can't put into context now @@ -353,6 +360,7 @@ async function execute( queryId: ctx.params.queryId, // have to pass down to the thread runner - can't put into context now environmentVariables: envVars, + nullDefaultSupport: query.nullDefaultSupport, ctx: { user: ctx.user, auth: { ...authConfigCtx }, diff --git a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts index 1fc0ecb382..ac90efa71c 100644 --- a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts +++ b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts @@ -12,31 +12,51 @@ const createTableSQL: Record = { CREATE TABLE test_table ( id serial PRIMARY KEY, name VARCHAR ( 50 ) NOT NULL, - birthday TIMESTAMP + birthday TIMESTAMP, + number INT );`, [SourceName.MYSQL]: ` CREATE TABLE test_table ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) NOT NULL, - birthday TIMESTAMP + birthday TIMESTAMP, + number INT );`, [SourceName.SQL_SERVER]: ` CREATE TABLE test_table ( id INT IDENTITY(1,1) PRIMARY KEY, name NVARCHAR(50) NOT NULL, - birthday DATETIME + birthday DATETIME, + number INT );`, } const insertSQL = `INSERT INTO test_table (name) VALUES ('one'), ('two'), ('three'), ('four'), ('five')` const dropTableSQL = `DROP TABLE test_table;` +const POSTGRES_SPECIFICS = { + nullError: 'invalid input syntax for type integer: ""', +} + +const MYSQL_SPECIFICS = { + nullError: "Incorrect integer value: '' for column 'number' at row 1", +} + +const MSSQL_SPECIFICS = { + nullError: "Cannot convert undefined or null to object", +} + +const MARIADB_SPECIFICS = { + nullError: + "Incorrect integer value: '' for column `mysql`.`test_table`.`number` at row 1", +} + describe.each([ - ["postgres", databaseTestProviders.postgres], - ["mysql", databaseTestProviders.mysql], - ["mssql", databaseTestProviders.mssql], - ["mariadb", databaseTestProviders.mariadb], -])("queries (%s)", (__, dsProvider) => { + ["postgres", databaseTestProviders.postgres, POSTGRES_SPECIFICS], + ["mysql", databaseTestProviders.mysql, MYSQL_SPECIFICS], + ["mssql", databaseTestProviders.mssql, MSSQL_SPECIFICS], + ["mariadb", databaseTestProviders.mariadb, MARIADB_SPECIFICS], +])("queries (%s)", (__, dsProvider, testSpecificInformation) => { const config = setup.getConfig() let datasource: Datasource @@ -51,7 +71,7 @@ describe.each([ transformer: "return data", readable: true, } - return await config.api.query.create({ ...defaultQuery, ...query }) + return await config.api.query.save({ ...defaultQuery, ...query }) } async function rawQuery(sql: string): Promise { @@ -398,4 +418,51 @@ describe.each([ expect(rows).toHaveLength(0) }) }) + + // this parameter really only impacts SQL queries + describe("confirm nullDefaultSupport", () => { + const queryParams = { + fields: { + sql: "INSERT INTO test_table (name, number) VALUES ({{ bindingName }}, {{ bindingNumber }})", + }, + parameters: [ + { + name: "bindingName", + default: "", + }, + { + name: "bindingNumber", + default: "", + }, + ], + queryVerb: "create", + } + + it("should error for old queries", async () => { + const query = await createQuery(queryParams) + await config.api.query.save({ ...query, nullDefaultSupport: false }) + let error: string | undefined + try { + await config.api.query.execute(query._id!, { + parameters: { + bindingName: "testing", + }, + }) + } catch (err: any) { + error = err.message + } + expect(error).toBeDefined() + expect(error).toContain(testSpecificInformation.nullError) + }) + + it("should not error for new queries", async () => { + const query = await createQuery(queryParams) + const results = await config.api.query.execute(query._id!, { + parameters: { + bindingName: "testing", + }, + }) + expect(results).toEqual({ data: [{ created: true }] }) + }) + }) }) diff --git a/packages/server/src/api/routes/tests/queries/mongodb.spec.ts b/packages/server/src/api/routes/tests/queries/mongodb.spec.ts index b61f905bef..3280c37e78 100644 --- a/packages/server/src/api/routes/tests/queries/mongodb.spec.ts +++ b/packages/server/src/api/routes/tests/queries/mongodb.spec.ts @@ -33,7 +33,7 @@ describe("/queries", () => { ) { combinedQuery.fields.extra.collection = collection } - return await config.api.query.create(combinedQuery) + return await config.api.query.save(combinedQuery) } async function withClient( diff --git a/packages/server/src/integrations/queries/sql.ts b/packages/server/src/integrations/queries/sql.ts index 6d42117d7d..fd1363c39a 100644 --- a/packages/server/src/integrations/queries/sql.ts +++ b/packages/server/src/integrations/queries/sql.ts @@ -1,13 +1,15 @@ import { findHBSBlocks } from "@budibase/string-templates" import { DatasourcePlus } from "@budibase/types" import sdk from "../../sdk" +import { enrichArrayContext } from "../../sdk/app/queries/queries" const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") export async function interpolateSQL( - fields: { [key: string]: any }, + fields: { sql: string; bindings: any[] }, parameters: { [key: string]: any }, - integration: DatasourcePlus + integration: DatasourcePlus, + opts: { nullDefaultSupport: boolean } ) { let sql = fields.sql if (!sql || typeof sql !== "string") { @@ -64,7 +66,14 @@ export async function interpolateSQL( } // replicate the knex structure fields.sql = sql - fields.bindings = await sdk.queries.enrichContext(variables, parameters) + fields.bindings = await sdk.queries.enrichArrayContext(variables, parameters) + if (opts.nullDefaultSupport) { + for (let index in fields.bindings) { + if (fields.bindings[index] === "") { + fields.bindings[index] = null + } + } + } // check for arrays in the data let updated: string[] = [] for (let i = 0; i < variables.length; i++) { diff --git a/packages/server/src/sdk/app/queries/queries.ts b/packages/server/src/sdk/app/queries/queries.ts index 3f967b7198..cf0ed4ec95 100644 --- a/packages/server/src/sdk/app/queries/queries.ts +++ b/packages/server/src/sdk/app/queries/queries.ts @@ -65,11 +65,27 @@ export async function fetch(opts: { enrich: boolean } = { enrich: true }) { return updateSchemas(queries) } +export async function enrichArrayContext( + fields: any[], + inputs = {} +): Promise { + const map: Record = {} + for (let [key, value] of Object.entries(fields)) { + map[key] = value + } + const output = await enrichContext(map, inputs) + const outputArray: any[] = [] + for (let [key, value] of Object.entries(output)) { + outputArray[parseInt(key)] = value + } + return outputArray +} + export async function enrichContext( fields: Record, inputs = {} ): Promise> { - const enrichedQuery: Record = Array.isArray(fields) ? [] : {} + const enrichedQuery: Record = {} if (!fields || !inputs) { return enrichedQuery } diff --git a/packages/server/src/tests/utilities/api/query.ts b/packages/server/src/tests/utilities/api/query.ts index 32866314ff..0dad6d2ad9 100644 --- a/packages/server/src/tests/utilities/api/query.ts +++ b/packages/server/src/tests/utilities/api/query.ts @@ -8,7 +8,7 @@ import { import { TestAPI } from "./base" export class QueryAPI extends TestAPI { - create = async (body: Query): Promise => { + save = async (body: Query): Promise => { return await this._post(`/api/queries`, { body }) } diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index 9f5e02bf69..dbac76c09a 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -26,10 +26,11 @@ class QueryRunner { fields: any parameters: any pagination: any - transformer: string + transformer: string | null cachedVariables: any[] ctx: any queryResponse: any + nullDefaultSupport: boolean noRecursiveQuery: boolean hasRerun: boolean hasRefreshedOAuth: boolean @@ -45,6 +46,7 @@ class QueryRunner { this.transformer = input.transformer this.queryId = input.queryId! this.schema = input.schema + this.nullDefaultSupport = !!input.nullDefaultSupport this.noRecursiveQuery = flags.noRecursiveQuery this.cachedVariables = [] // Additional context items for enrichment @@ -59,7 +61,14 @@ class QueryRunner { } async execute(): Promise { - let { datasource, fields, queryVerb, transformer, schema } = this + let { + datasource, + fields, + queryVerb, + transformer, + schema, + nullDefaultSupport, + } = this let datasourceClone = cloneDeep(datasource) let fieldsClone = cloneDeep(fields) @@ -103,7 +112,9 @@ class QueryRunner { let query // handle SQL injections by interpolating the variables if (isSQL(datasourceClone)) { - query = await interpolateSQL(fieldsClone, enrichedContext, integration) + query = await interpolateSQL(fieldsClone, enrichedContext, integration, { + nullDefaultSupport, + }) } else { query = await sdk.queries.enrichContext(fieldsClone, enrichedContext) } @@ -137,7 +148,9 @@ class QueryRunner { data: rows, params: enrichedParameters, } - rows = vm.withContext(ctx, () => vm.execute(transformer)) + if (transformer != null) { + rows = vm.withContext(ctx, () => vm.execute(transformer!)) + } } // if the request fails we retry once, invalidating the cached value @@ -191,13 +204,15 @@ class QueryRunner { }) return new QueryRunner( { - datasource, + schema: query.schema, queryVerb: query.queryVerb, fields: query.fields, - parameters, transformer: query.transformer, - queryId, + nullDefaultSupport: query.nullDefaultSupport, ctx: this.ctx, + parameters, + datasource, + queryId, }, { noRecursiveQuery: true } ).execute() From 3f225c94e745d60669bd22a5c31209d23a3af2fc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 11:50:07 +0000 Subject: [PATCH 11/46] Linting. --- packages/server/src/integrations/queries/sql.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/integrations/queries/sql.ts b/packages/server/src/integrations/queries/sql.ts index fd1363c39a..f6b0d68e7f 100644 --- a/packages/server/src/integrations/queries/sql.ts +++ b/packages/server/src/integrations/queries/sql.ts @@ -1,7 +1,6 @@ import { findHBSBlocks } from "@budibase/string-templates" import { DatasourcePlus } from "@budibase/types" import sdk from "../../sdk" -import { enrichArrayContext } from "../../sdk/app/queries/queries" const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") From 5b1db961291efe91eb233fae2fbe2a434ca8ee86 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 12:05:55 +0000 Subject: [PATCH 12/46] Fixing typing issue. --- packages/server/src/threads/query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index dbac76c09a..97e7a05cf7 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -109,7 +109,7 @@ class QueryRunner { ) } - let query + let query: Record // handle SQL injections by interpolating the variables if (isSQL(datasourceClone)) { query = await interpolateSQL(fieldsClone, enrichedContext, integration, { From 2464020a225e70d8d64e4bd99f613f33162422f2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 12:36:00 +0000 Subject: [PATCH 13/46] Test fixes after running in CI. --- .../routes/tests/queries/generic-sql.spec.ts | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts index ac90efa71c..97e513af01 100644 --- a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts +++ b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts @@ -43,7 +43,8 @@ const MYSQL_SPECIFICS = { } const MSSQL_SPECIFICS = { - nullError: "Cannot convert undefined or null to object", + // MS-SQL doesn't throw an error here, it casts empty string to nothing + nullError: undefined, } const MARIADB_SPECIFICS = { @@ -241,26 +242,31 @@ describe.each([ id: 1, name: "one", birthday: null, + number: null, }, { id: 2, name: "two", birthday: null, + number: null, }, { id: 3, name: "three", birthday: null, + number: null, }, { id: 4, name: "four", birthday: null, + number: null, }, { id: 5, name: "five", birthday: null, + number: null, }, ]) }) @@ -283,6 +289,7 @@ describe.each([ id: 2, name: "one", birthday: null, + number: null, }, ]) }) @@ -311,6 +318,7 @@ describe.each([ id: 1, name: "one", birthday: null, + number: null, }, ]) }) @@ -349,7 +357,9 @@ describe.each([ ]) const rows = await rawQuery("SELECT * FROM test_table WHERE id = 1") - expect(rows).toEqual([{ id: 1, name: "foo", birthday: null }]) + expect(rows).toEqual([ + { id: 1, name: "foo", birthday: null, number: null }, + ]) }) it("should be able to execute an update that updates no rows", async () => { @@ -451,8 +461,13 @@ describe.each([ } catch (err: any) { error = err.message } - expect(error).toBeDefined() - expect(error).toContain(testSpecificInformation.nullError) + const testExpectation = testSpecificInformation.nullError + if (testExpectation) { + expect(error).toBeDefined() + expect(error).toContain(testExpectation) + } else { + expect(error).toBeUndefined() + } }) it("should not error for new queries", async () => { From 185e9c3425fe758a0d815a87b58adc2e1e22fd71 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 13:01:51 +0000 Subject: [PATCH 14/46] Fixing test case. --- .../server/src/api/routes/tests/environmentVariables.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/environmentVariables.spec.ts b/packages/server/src/api/routes/tests/environmentVariables.spec.ts index 9104dedf4f..beb6012c9c 100644 --- a/packages/server/src/api/routes/tests/environmentVariables.spec.ts +++ b/packages/server/src/api/routes/tests/environmentVariables.spec.ts @@ -143,7 +143,10 @@ describe("/api/env/variables", () => { delete response.body.datasource.config expect(events.query.previewed).toHaveBeenCalledWith( response.body.datasource, - queryPreview + { + ...queryPreview, + nullDefaultSupport: true, + } ) expect(pg.Client).toHaveBeenCalledWith({ password: "test", ssl: undefined }) }) From defb925d16d1e182fba48e618ce170d7230ae8e0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 13:38:52 +0000 Subject: [PATCH 15/46] Query seq fix. --- .../src/api/routes/tests/queries/query.seq.spec.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/tests/queries/query.seq.spec.ts b/packages/server/src/api/routes/tests/queries/query.seq.spec.ts index 10b90eafb1..4c25a762b8 100644 --- a/packages/server/src/api/routes/tests/queries/query.seq.spec.ts +++ b/packages/server/src/api/routes/tests/queries/query.seq.spec.ts @@ -78,6 +78,7 @@ describe("/queries", () => { _rev: res.body._rev, _id: res.body._id, ...query, + nullDefaultSupport: true, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }) @@ -103,6 +104,7 @@ describe("/queries", () => { _rev: res.body._rev, _id: res.body._id, ...query, + nullDefaultSupport: true, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }) @@ -130,6 +132,7 @@ describe("/queries", () => { _id: query._id, createdAt: new Date().toISOString(), ...basicQuery(datasource._id), + nullDefaultSupport: true, updatedAt: new Date().toISOString(), readable: true, }, @@ -245,10 +248,10 @@ describe("/queries", () => { expect(responseBody.rows.length).toEqual(1) expect(events.query.previewed).toHaveBeenCalledTimes(1) delete datasource.config - expect(events.query.previewed).toHaveBeenCalledWith( - datasource, - queryPreview - ) + expect(events.query.previewed).toHaveBeenCalledWith(datasource, { + ...queryPreview, + nullDefaultSupport: true, + }) }) it("should apply authorization to endpoint", async () => { From cc8a0274a4e1801f008e740f694cf3c96e1e8888 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Mar 2024 15:26:02 +0000 Subject: [PATCH 16/46] Updating based on PR comments. --- .../server/src/api/controllers/query/index.ts | 8 ++-- .../routes/tests/queries/generic-sql.spec.ts | 37 +++++-------------- .../server/src/sdk/app/queries/queries.ts | 4 +- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 03fcdb714a..055f3bd888 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -149,11 +149,9 @@ function enrichParameters( // first check parameters are all valid validateQueryInputs(requestParameters) // make sure parameters are fully enriched with defaults - for (let parameter of query.parameters) { - let value: string | null = requestParameters[parameter.name] - if (!value) { - value = parameter.default - } + for (const parameter of query.parameters) { + let value: string | null = + requestParameters[parameter.name] || parameter.default if (query.nullDefaultSupport && paramNotSet(value)) { value = null } diff --git a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts index 97e513af01..f9a3ac6e03 100644 --- a/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts +++ b/packages/server/src/api/routes/tests/queries/generic-sql.spec.ts @@ -34,30 +34,12 @@ const createTableSQL: Record = { const insertSQL = `INSERT INTO test_table (name) VALUES ('one'), ('two'), ('three'), ('four'), ('five')` const dropTableSQL = `DROP TABLE test_table;` -const POSTGRES_SPECIFICS = { - nullError: 'invalid input syntax for type integer: ""', -} - -const MYSQL_SPECIFICS = { - nullError: "Incorrect integer value: '' for column 'number' at row 1", -} - -const MSSQL_SPECIFICS = { - // MS-SQL doesn't throw an error here, it casts empty string to nothing - nullError: undefined, -} - -const MARIADB_SPECIFICS = { - nullError: - "Incorrect integer value: '' for column `mysql`.`test_table`.`number` at row 1", -} - describe.each([ - ["postgres", databaseTestProviders.postgres, POSTGRES_SPECIFICS], - ["mysql", databaseTestProviders.mysql, MYSQL_SPECIFICS], - ["mssql", databaseTestProviders.mssql, MSSQL_SPECIFICS], - ["mariadb", databaseTestProviders.mariadb, MARIADB_SPECIFICS], -])("queries (%s)", (__, dsProvider, testSpecificInformation) => { + ["postgres", databaseTestProviders.postgres], + ["mysql", databaseTestProviders.mysql], + ["mssql", databaseTestProviders.mssql], + ["mariadb", databaseTestProviders.mariadb], +])("queries (%s)", (dbName, dsProvider) => { const config = setup.getConfig() let datasource: Datasource @@ -461,12 +443,11 @@ describe.each([ } catch (err: any) { error = err.message } - const testExpectation = testSpecificInformation.nullError - if (testExpectation) { - expect(error).toBeDefined() - expect(error).toContain(testExpectation) - } else { + if (dbName === "mssql") { expect(error).toBeUndefined() + } else { + expect(error).toBeDefined() + expect(error).toContain("integer") } }) diff --git a/packages/server/src/sdk/app/queries/queries.ts b/packages/server/src/sdk/app/queries/queries.ts index cf0ed4ec95..511d2233c2 100644 --- a/packages/server/src/sdk/app/queries/queries.ts +++ b/packages/server/src/sdk/app/queries/queries.ts @@ -70,8 +70,8 @@ export async function enrichArrayContext( inputs = {} ): Promise { const map: Record = {} - for (let [key, value] of Object.entries(fields)) { - map[key] = value + for (let index in fields) { + map[index] = fields[index] } const output = await enrichContext(map, inputs) const outputArray: any[] = [] From 79d1b22caeb6bf47974fb588f1bdf2d5de9d101a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:00:13 +0000 Subject: [PATCH 17/46] Pull images separately from tests, enable testcontainers debug logs. --- .github/workflows/budibase_ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 5c474aa826..c2a4fcb176 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -138,6 +138,8 @@ jobs: test-server: runs-on: ubuntu-latest + env: + DEBUG: testcontainers,testcontainers:exec,testcontainers:build,testcontainers:pull steps: - name: Checkout repo uses: actions/checkout@v4 @@ -151,7 +153,17 @@ jobs: with: node-version: 20.x cache: yarn + + - name: Pull testcontainers images + run: | + docker pull mcr.microsoft.com/mssql/server:2022-latest + docker pull mysql:8.3 + docker pull postgres:16.1-bullseye + docker pull mongo:7.0-jammy + docker pull mariadb:lts + - run: yarn --frozen-lockfile + - name: Test server run: | if ${{ env.USE_NX_AFFECTED }}; then From 077ca2d12089a56efe5ff6963705c23de3a1b7cc Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:16:37 +0000 Subject: [PATCH 18/46] Make a change in packages/server to trigger the tests. --- packages/server/src/integrations/tests/utils/mssql.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/integrations/tests/utils/mssql.ts b/packages/server/src/integrations/tests/utils/mssql.ts index 6bd4290a90..cff6809c0a 100644 --- a/packages/server/src/integrations/tests/utils/mssql.ts +++ b/packages/server/src/integrations/tests/utils/mssql.ts @@ -1,6 +1,8 @@ import { Datasource, SourceName } from "@budibase/types" import { GenericContainer, Wait, StartedTestContainer } from "testcontainers" +// TODO: remove this comment + let container: StartedTestContainer | undefined export async function start(): Promise { From 6824d8626af2619af6737a83cc2df2046238056b Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Mon, 25 Mar 2024 11:19:31 +0000 Subject: [PATCH 19/46] Fixing failing test. --- packages/server/src/api/routes/tests/queries/mongodb.spec.ts | 2 +- packages/server/src/sdk/app/queries/queries.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/queries/mongodb.spec.ts b/packages/server/src/api/routes/tests/queries/mongodb.spec.ts index bbbb9362fd..492f24abf9 100644 --- a/packages/server/src/api/routes/tests/queries/mongodb.spec.ts +++ b/packages/server/src/api/routes/tests/queries/mongodb.spec.ts @@ -464,7 +464,7 @@ describe("/queries", () => { }) }) - it("should ignore be able to save deeply nested data", async () => { + it("should be able to save deeply nested data", async () => { const data = { foo: "bar", data: [ diff --git a/packages/server/src/sdk/app/queries/queries.ts b/packages/server/src/sdk/app/queries/queries.ts index 511d2233c2..d37e53bec1 100644 --- a/packages/server/src/sdk/app/queries/queries.ts +++ b/packages/server/src/sdk/app/queries/queries.ts @@ -89,6 +89,9 @@ export async function enrichContext( if (!fields || !inputs) { return enrichedQuery } + if (Array.isArray(fields)) { + return enrichArrayContext(fields, inputs) + } const env = await getEnvironmentVariables() const parameters = { ...inputs, env } // enrich the fields with dynamic parameters From 4314489e26f2898fd715bf496338098004f0b67d Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Mon, 25 Mar 2024 12:31:48 +0100 Subject: [PATCH 20/46] Restore ethereal user --- packages/worker/src/utilities/email.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/worker/src/utilities/email.ts b/packages/worker/src/utilities/email.ts index e963234791..27f2876eda 100644 --- a/packages/worker/src/utilities/email.ts +++ b/packages/worker/src/utilities/email.ts @@ -45,8 +45,8 @@ function createSMTPTransport(config?: SMTPInnerConfig) { host: "smtp.ethereal.email", secure: false, auth: { - user: "jeremy22@ethereal.email", - pass: "EkeTST7Zr2TEsWtkRh", + user: "seamus99@ethereal.email", + pass: "5ghVteZAqj6jkKJF9R", }, } } From 44b448f3e13412953c11ddd8edc65948dcb47fa8 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:52:01 +0000 Subject: [PATCH 21/46] Also pull couchdb --- .github/workflows/budibase_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index c2a4fcb176..94a001ba96 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -161,6 +161,8 @@ jobs: docker pull postgres:16.1-bullseye docker pull mongo:7.0-jammy docker pull mariadb:lts + docker pull testcontainers/ryuk:0.3.0 + docker pull budibase/couchdb - run: yarn --frozen-lockfile From fc41d16d1d67a2e25c1dfbeb3246d559155c5808 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:52:18 +0000 Subject: [PATCH 22/46] Remove comment added to trigger tests. --- packages/server/src/integrations/tests/utils/mssql.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/server/src/integrations/tests/utils/mssql.ts b/packages/server/src/integrations/tests/utils/mssql.ts index cff6809c0a..6bd4290a90 100644 --- a/packages/server/src/integrations/tests/utils/mssql.ts +++ b/packages/server/src/integrations/tests/utils/mssql.ts @@ -1,8 +1,6 @@ import { Datasource, SourceName } from "@budibase/types" import { GenericContainer, Wait, StartedTestContainer } from "testcontainers" -// TODO: remove this comment - let container: StartedTestContainer | undefined export async function start(): Promise { From 538f3b9dbe595bb246b51aca80bd83850e972e57 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 13:51:27 +0000 Subject: [PATCH 23/46] Align our use of images across the codebase. --- packages/server/src/sdk/app/rows/search/tests/external.spec.ts | 2 +- .../src/integrations/external-schema/mysql.integration.spec.ts | 2 +- .../integrations/external-schema/postgres.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mongo.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mssql.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mysql.integration.spec.ts | 2 +- .../src/integrations/validators/postgres.integration.spec.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/tests/external.spec.ts b/packages/server/src/sdk/app/rows/search/tests/external.spec.ts index 8ecec784dd..bae58d6a2c 100644 --- a/packages/server/src/sdk/app/rows/search/tests/external.spec.ts +++ b/packages/server/src/sdk/app/rows/search/tests/external.spec.ts @@ -26,7 +26,7 @@ describe("external search", () => { const rows: Row[] = [] beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnvironment({ MYSQL_ROOT_PASSWORD: "admin", diff --git a/qa-core/src/integrations/external-schema/mysql.integration.spec.ts b/qa-core/src/integrations/external-schema/mysql.integration.spec.ts index 5a7e1989d2..c8d285a021 100644 --- a/qa-core/src/integrations/external-schema/mysql.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/mysql.integration.spec.ts @@ -6,7 +6,7 @@ describe("datasource validators", () => { let config: any beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnv("MYSQL_ROOT_PASSWORD", "admin") .withEnv("MYSQL_DATABASE", "db") diff --git a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts index a0812c9677..7581d7f88a 100644 --- a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts @@ -17,7 +17,7 @@ describe("getExternalSchema", () => { } beforeAll(async () => { - const container = await new GenericContainer("postgres:13.12") + const container = await new GenericContainer("postgres:16.1-bullseye") .withExposedPorts(5432) .withEnv("POSTGRES_PASSWORD", "password") .start() diff --git a/qa-core/src/integrations/validators/mongo.integration.spec.ts b/qa-core/src/integrations/validators/mongo.integration.spec.ts index 9132d79f74..b1bab3bd1f 100644 --- a/qa-core/src/integrations/validators/mongo.integration.spec.ts +++ b/qa-core/src/integrations/validators/mongo.integration.spec.ts @@ -26,7 +26,7 @@ describe("datasource validators", () => { beforeAll(async () => { const user = generator.name() const password = generator.hash() - const container = await new GenericContainer("mongo") + const container = await new GenericContainer("mongo:7.0-jammy") .withExposedPorts(27017) .withEnv("MONGO_INITDB_ROOT_USERNAME", user) .withEnv("MONGO_INITDB_ROOT_PASSWORD", password) diff --git a/qa-core/src/integrations/validators/mssql.integration.spec.ts b/qa-core/src/integrations/validators/mssql.integration.spec.ts index d8f36e8bd0..c07f1d1129 100644 --- a/qa-core/src/integrations/validators/mssql.integration.spec.ts +++ b/qa-core/src/integrations/validators/mssql.integration.spec.ts @@ -13,7 +13,7 @@ describe("datasource validators", () => { beforeAll(async () => { const container = await new GenericContainer( - "mcr.microsoft.com/mssql/server" + "mcr.microsoft.com/mssql/server:2022-latest" ) .withExposedPorts(1433) .withEnv("ACCEPT_EULA", "Y") diff --git a/qa-core/src/integrations/validators/mysql.integration.spec.ts b/qa-core/src/integrations/validators/mysql.integration.spec.ts index e828d192af..95f7d4abbd 100644 --- a/qa-core/src/integrations/validators/mysql.integration.spec.ts +++ b/qa-core/src/integrations/validators/mysql.integration.spec.ts @@ -7,7 +7,7 @@ describe("datasource validators", () => { let port: number beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnv("MYSQL_ROOT_PASSWORD", "admin") .withEnv("MYSQL_DATABASE", "db") diff --git a/qa-core/src/integrations/validators/postgres.integration.spec.ts b/qa-core/src/integrations/validators/postgres.integration.spec.ts index 5101cf1d2d..9e3e1ab30f 100644 --- a/qa-core/src/integrations/validators/postgres.integration.spec.ts +++ b/qa-core/src/integrations/validators/postgres.integration.spec.ts @@ -9,7 +9,7 @@ describe("datasource validators", () => { let port: number beforeAll(async () => { - const container = await new GenericContainer("postgres") + const container = await new GenericContainer("postgres:16.1-bullseye") .withExposedPorts(5432) .withEnv("POSTGRES_PASSWORD", "password") .start() From 66cfb8eeddbc713e50372b2e8553fabed766035c Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 22 Mar 2024 17:04:45 +0000 Subject: [PATCH 24/46] Remove jest-testcontainers. --- jestTestcontainersConfigGenerator.js | 4 +-- packages/backend-core/src/db/Replication.ts | 2 +- packages/server/jest-testcontainers-config.js | 8 ------ packages/server/jest.config.ts | 2 ++ packages/server/scripts/test.sh | 2 ++ packages/server/src/tests/globalSetup.ts | 27 +++++++++++++++++++ packages/server/src/tests/globalTeardown.ts | 12 +++++++++ packages/server/src/tests/jestEnv.ts | 3 +++ packages/server/src/tests/test-couchdb.ini | 2 ++ .../server/src/tests/utilities/api/base.ts | 16 +++++++++++ 10 files changed, 67 insertions(+), 11 deletions(-) delete mode 100644 packages/server/jest-testcontainers-config.js create mode 100644 packages/server/src/tests/globalSetup.ts create mode 100644 packages/server/src/tests/globalTeardown.ts create mode 100644 packages/server/src/tests/test-couchdb.ini diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js index 1e39ed771f..82d50145e6 100644 --- a/jestTestcontainersConfigGenerator.js +++ b/jestTestcontainersConfigGenerator.js @@ -10,7 +10,7 @@ module.exports = () => { wait: { type: "ports", timeout: 20000, - } - } + }, + }, } } diff --git a/packages/backend-core/src/db/Replication.ts b/packages/backend-core/src/db/Replication.ts index 9c960d76dd..735c2fa86e 100644 --- a/packages/backend-core/src/db/Replication.ts +++ b/packages/backend-core/src/db/Replication.ts @@ -27,7 +27,7 @@ class Replication { return resolve(info) }) .on("error", function (err) { - throw new Error(`Replication Error: ${err}`) + throw err }) }) } diff --git a/packages/server/jest-testcontainers-config.js b/packages/server/jest-testcontainers-config.js deleted file mode 100644 index 8ac0f0cd9d..0000000000 --- a/packages/server/jest-testcontainers-config.js +++ /dev/null @@ -1,8 +0,0 @@ -const { join } = require("path") -require("dotenv").config({ - path: join(__dirname, "..", "..", "hosting", ".env"), -}) - -const jestTestcontainersConfigGenerator = require("../../jestTestcontainersConfigGenerator") - -module.exports = jestTestcontainersConfigGenerator() diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index 6c6d6a20d3..20979d7999 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -18,6 +18,8 @@ const baseConfig: Config.InitialProjectOptions = { "svelte", ], setupFilesAfterEnv: ["./src/tests/jestSetup.ts"], + globalSetup: "./src/tests/globalSetup.ts", + globalTeardown: "./src/tests/globalTeardown.ts", transform: { "^.+\\.ts?$": "@swc/jest", "^.+\\.js?$": "@swc/jest", diff --git a/packages/server/scripts/test.sh b/packages/server/scripts/test.sh index 3ecf8bb794..58e68c9749 100644 --- a/packages/server/scripts/test.sh +++ b/packages/server/scripts/test.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +export DEBUG="testcontainers*" + if [[ -n $CI ]] then export NODE_OPTIONS="--max-old-space-size=4096 --no-node-snapshot $NODE_OPTIONS" diff --git a/packages/server/src/tests/globalSetup.ts b/packages/server/src/tests/globalSetup.ts new file mode 100644 index 0000000000..1bb61a79d9 --- /dev/null +++ b/packages/server/src/tests/globalSetup.ts @@ -0,0 +1,27 @@ +import { GenericContainer, Wait } from "testcontainers" + +export default async function setup() { + const container = await new GenericContainer("budibase/couchdb") + .withName("couchdb-service") + .withExposedPorts(5984) + .withEnvironment({ + COUCHDB_PASSWORD: "budibase", + COUCHDB_USER: "budibase", + }) + .withCopyFilesToContainer([ + { + source: "./src/tests/test-couchdb.ini", + target: "/opt/couchdb/etc/local.d/test-couchdb.ini", + }, + ]) + .withWaitStrategy( + Wait.forSuccessfulCommand( + "curl http://budibase:budibase@localhost:5984/_up" + ).withStartupTimeout(20000) + ) + .start() + + // @ts-expect-error + // eslint-disable-next-line no-undef + globalThis.__COUCHDB_CONTAINER_ID__ = container.getId() +} diff --git a/packages/server/src/tests/globalTeardown.ts b/packages/server/src/tests/globalTeardown.ts new file mode 100644 index 0000000000..4be959c1f9 --- /dev/null +++ b/packages/server/src/tests/globalTeardown.ts @@ -0,0 +1,12 @@ +import { getContainerRuntimeClient } from "testcontainers" + +export default async function teardown() { + const client = await getContainerRuntimeClient() + + // @ts-expect-error + // eslint-disable-next-line no-undef + const containerId = globalThis.__COUCHDB_CONTAINER_ID__ + const container = client.container.getById(containerId) + await client.container.stop(container) + await client.container.remove(container) +} diff --git a/packages/server/src/tests/jestEnv.ts b/packages/server/src/tests/jestEnv.ts index 7c58470e9b..3b0c2a88d9 100644 --- a/packages/server/src/tests/jestEnv.ts +++ b/packages/server/src/tests/jestEnv.ts @@ -11,3 +11,6 @@ process.env.PLATFORM_URL = "http://localhost:10000" process.env.REDIS_PASSWORD = "budibase" process.env.BUDIBASE_VERSION = "0.0.0+jest" process.env.WORKER_URL = "http://localhost:10000" +process.env.COUCH_DB_PASSWORD = "budibase" +process.env.COUCH_DB_USER = "budibase" +process.env.JWT_SECRET = "jwtsecret" diff --git a/packages/server/src/tests/test-couchdb.ini b/packages/server/src/tests/test-couchdb.ini new file mode 100644 index 0000000000..8924e6ec3f --- /dev/null +++ b/packages/server/src/tests/test-couchdb.ini @@ -0,0 +1,2 @@ +[log] +level = warn \ No newline at end of file diff --git a/packages/server/src/tests/utilities/api/base.ts b/packages/server/src/tests/utilities/api/base.ts index 4df58ff425..486514cfbe 100644 --- a/packages/server/src/tests/utilities/api/base.ts +++ b/packages/server/src/tests/utilities/api/base.ts @@ -187,6 +187,22 @@ export abstract class TestAPI { expect(response.body).toMatchObject(expectations.body) } + if (response.text && response.text.length > 0) { + // @ts-expect-error - we know this exists, it's just not in the types + const request = response.request as Test + const contentLength = response.headers["content-length"] + if (!contentLength) { + throw new Error( + `Failed request "${request.method} ${request.url}": Content-Length header not present, but response has a body (body length ${response.text.length})` + ) + } + if (parseInt(contentLength) !== response.text.length) { + throw new Error( + `Failed request "${request.method} ${request.url}": Content-Length header does not match response body length (header: ${contentLength}, body: ${response.text.length})` + ) + } + } + return response } From db21542d386ef5e2725209eca6e70e8dda52716f Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 22 Mar 2024 17:34:50 +0000 Subject: [PATCH 25/46] Cherry-pick 6b8422df016bd1c2d1a75133a00cb1bd4153c150 --- .../jest-testcontainers-config.js | 8 - packages/backend-core/jest.config.ts | 3 +- packages/backend-core/package.json | 1 - .../backend-core/src/tests/globalSetup.ts | 27 +++ .../backend-core/src/tests/globalTeardown.ts | 12 ++ packages/backend-core/tests/jestEnv.ts | 2 + packages/server/jest.config.ts | 1 - packages/server/package.json | 1 - packages/worker/jest-testcontainers-config.js | 8 - packages/worker/jest.config.ts | 3 +- packages/worker/package.json | 1 - packages/worker/src/tests/globalSetup.ts | 27 +++ packages/worker/src/tests/globalTeardown.ts | 12 ++ packages/worker/src/tests/jestEnv.ts | 2 + yarn.lock | 167 +++--------------- 15 files changed, 112 insertions(+), 163 deletions(-) delete mode 100644 packages/backend-core/jest-testcontainers-config.js create mode 100644 packages/backend-core/src/tests/globalSetup.ts create mode 100644 packages/backend-core/src/tests/globalTeardown.ts delete mode 100644 packages/worker/jest-testcontainers-config.js create mode 100644 packages/worker/src/tests/globalSetup.ts create mode 100644 packages/worker/src/tests/globalTeardown.ts diff --git a/packages/backend-core/jest-testcontainers-config.js b/packages/backend-core/jest-testcontainers-config.js deleted file mode 100644 index 8ac0f0cd9d..0000000000 --- a/packages/backend-core/jest-testcontainers-config.js +++ /dev/null @@ -1,8 +0,0 @@ -const { join } = require("path") -require("dotenv").config({ - path: join(__dirname, "..", "..", "hosting", ".env"), -}) - -const jestTestcontainersConfigGenerator = require("../../jestTestcontainersConfigGenerator") - -module.exports = jestTestcontainersConfigGenerator() diff --git a/packages/backend-core/jest.config.ts b/packages/backend-core/jest.config.ts index 3f1065ead2..83e87a6f7a 100644 --- a/packages/backend-core/jest.config.ts +++ b/packages/backend-core/jest.config.ts @@ -1,8 +1,9 @@ import { Config } from "@jest/types" const baseConfig: Config.InitialProjectOptions = { - preset: "@trendyol/jest-testcontainers", setupFiles: ["./tests/jestEnv.ts"], + globalSetup: "./src/tests/globalSetup.ts", + globalTeardown: "./src/tests/globalTeardown.ts", setupFilesAfterEnv: ["./tests/jestSetup.ts"], transform: { "^.+\\.ts?$": "@swc/jest", diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index fe56780982..030fec8728 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -60,7 +60,6 @@ "@shopify/jest-koa-mocks": "5.1.1", "@swc/core": "1.3.71", "@swc/jest": "0.2.27", - "@trendyol/jest-testcontainers": "^2.1.1", "@types/chance": "1.1.3", "@types/cookies": "0.7.8", "@types/jest": "29.5.5", diff --git a/packages/backend-core/src/tests/globalSetup.ts b/packages/backend-core/src/tests/globalSetup.ts new file mode 100644 index 0000000000..1bb61a79d9 --- /dev/null +++ b/packages/backend-core/src/tests/globalSetup.ts @@ -0,0 +1,27 @@ +import { GenericContainer, Wait } from "testcontainers" + +export default async function setup() { + const container = await new GenericContainer("budibase/couchdb") + .withName("couchdb-service") + .withExposedPorts(5984) + .withEnvironment({ + COUCHDB_PASSWORD: "budibase", + COUCHDB_USER: "budibase", + }) + .withCopyFilesToContainer([ + { + source: "./src/tests/test-couchdb.ini", + target: "/opt/couchdb/etc/local.d/test-couchdb.ini", + }, + ]) + .withWaitStrategy( + Wait.forSuccessfulCommand( + "curl http://budibase:budibase@localhost:5984/_up" + ).withStartupTimeout(20000) + ) + .start() + + // @ts-expect-error + // eslint-disable-next-line no-undef + globalThis.__COUCHDB_CONTAINER_ID__ = container.getId() +} diff --git a/packages/backend-core/src/tests/globalTeardown.ts b/packages/backend-core/src/tests/globalTeardown.ts new file mode 100644 index 0000000000..4be959c1f9 --- /dev/null +++ b/packages/backend-core/src/tests/globalTeardown.ts @@ -0,0 +1,12 @@ +import { getContainerRuntimeClient } from "testcontainers" + +export default async function teardown() { + const client = await getContainerRuntimeClient() + + // @ts-expect-error + // eslint-disable-next-line no-undef + const containerId = globalThis.__COUCHDB_CONTAINER_ID__ + const container = client.container.getById(containerId) + await client.container.stop(container) + await client.container.remove(container) +} diff --git a/packages/backend-core/tests/jestEnv.ts b/packages/backend-core/tests/jestEnv.ts index c2047118ec..bfeb3eca72 100644 --- a/packages/backend-core/tests/jestEnv.ts +++ b/packages/backend-core/tests/jestEnv.ts @@ -4,3 +4,5 @@ process.env.NODE_ENV = "jest" process.env.MOCK_REDIS = "1" process.env.LOG_LEVEL = process.env.LOG_LEVEL || "error" process.env.REDIS_PASSWORD = "budibase" +process.env.COUCH_DB_PASSWORD = "budibase" +process.env.COUCH_DB_USER = "budibase" diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index 20979d7999..5795bedca5 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -4,7 +4,6 @@ import * as fs from "fs" import { join } from "path" const baseConfig: Config.InitialProjectOptions = { - preset: "@trendyol/jest-testcontainers", setupFiles: ["./src/tests/jestEnv.ts"], moduleFileExtensions: [ "js", diff --git a/packages/server/package.json b/packages/server/package.json index 8e66f3d7e0..424a0559b7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -121,7 +121,6 @@ "@babel/preset-env": "7.16.11", "@swc/core": "1.3.71", "@swc/jest": "0.2.27", - "@trendyol/jest-testcontainers": "2.1.1", "@types/global-agent": "2.1.1", "@types/google-spreadsheet": "3.1.5", "@types/jest": "29.5.5", diff --git a/packages/worker/jest-testcontainers-config.js b/packages/worker/jest-testcontainers-config.js deleted file mode 100644 index 8ac0f0cd9d..0000000000 --- a/packages/worker/jest-testcontainers-config.js +++ /dev/null @@ -1,8 +0,0 @@ -const { join } = require("path") -require("dotenv").config({ - path: join(__dirname, "..", "..", "hosting", ".env"), -}) - -const jestTestcontainersConfigGenerator = require("../../jestTestcontainersConfigGenerator") - -module.exports = jestTestcontainersConfigGenerator() diff --git a/packages/worker/jest.config.ts b/packages/worker/jest.config.ts index 1eb17f100f..b227ee1309 100644 --- a/packages/worker/jest.config.ts +++ b/packages/worker/jest.config.ts @@ -2,7 +2,8 @@ import { Config } from "@jest/types" import * as fs from "fs" const config: Config.InitialOptions = { - preset: "@trendyol/jest-testcontainers", + globalSetup: "./src/tests/globalSetup.ts", + globalTeardown: "./src/tests/globalTeardown.ts", setupFiles: ["./src/tests/jestEnv.ts"], setupFilesAfterEnv: ["./src/tests/jestSetup.ts"], collectCoverageFrom: ["src/**/*.{js,ts}", "../backend-core/src/**/*.{js,ts}"], diff --git a/packages/worker/package.json b/packages/worker/package.json index efdbe6aa12..0c2a9f3b72 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -75,7 +75,6 @@ "devDependencies": { "@swc/core": "1.3.71", "@swc/jest": "0.2.27", - "@trendyol/jest-testcontainers": "2.1.1", "@types/jest": "29.5.5", "@types/jsonwebtoken": "9.0.3", "@types/koa": "2.13.4", diff --git a/packages/worker/src/tests/globalSetup.ts b/packages/worker/src/tests/globalSetup.ts new file mode 100644 index 0000000000..1bb61a79d9 --- /dev/null +++ b/packages/worker/src/tests/globalSetup.ts @@ -0,0 +1,27 @@ +import { GenericContainer, Wait } from "testcontainers" + +export default async function setup() { + const container = await new GenericContainer("budibase/couchdb") + .withName("couchdb-service") + .withExposedPorts(5984) + .withEnvironment({ + COUCHDB_PASSWORD: "budibase", + COUCHDB_USER: "budibase", + }) + .withCopyFilesToContainer([ + { + source: "./src/tests/test-couchdb.ini", + target: "/opt/couchdb/etc/local.d/test-couchdb.ini", + }, + ]) + .withWaitStrategy( + Wait.forSuccessfulCommand( + "curl http://budibase:budibase@localhost:5984/_up" + ).withStartupTimeout(20000) + ) + .start() + + // @ts-expect-error + // eslint-disable-next-line no-undef + globalThis.__COUCHDB_CONTAINER_ID__ = container.getId() +} diff --git a/packages/worker/src/tests/globalTeardown.ts b/packages/worker/src/tests/globalTeardown.ts new file mode 100644 index 0000000000..4be959c1f9 --- /dev/null +++ b/packages/worker/src/tests/globalTeardown.ts @@ -0,0 +1,12 @@ +import { getContainerRuntimeClient } from "testcontainers" + +export default async function teardown() { + const client = await getContainerRuntimeClient() + + // @ts-expect-error + // eslint-disable-next-line no-undef + const containerId = globalThis.__COUCHDB_CONTAINER_ID__ + const container = client.container.getById(containerId) + await client.container.stop(container) + await client.container.remove(container) +} diff --git a/packages/worker/src/tests/jestEnv.ts b/packages/worker/src/tests/jestEnv.ts index 9bd258c43c..c044e0817f 100644 --- a/packages/worker/src/tests/jestEnv.ts +++ b/packages/worker/src/tests/jestEnv.ts @@ -11,3 +11,5 @@ process.env.INTERNAL_API_KEY = "tet" process.env.DISABLE_ACCOUNT_PORTAL = "0" process.env.MOCK_REDIS = "1" process.env.BUDIBASE_VERSION = "0.0.0+jest" +process.env.COUCH_DB_PASSWORD = "budibase" +process.env.COUCH_DB_USER = "budibase" diff --git a/yarn.lock b/yarn.lock index 601bbf4641..585e043593 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5098,7 +5098,7 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@trendyol/jest-testcontainers@2.1.1", "@trendyol/jest-testcontainers@^2.1.1": +"@trendyol/jest-testcontainers@2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@trendyol/jest-testcontainers/-/jest-testcontainers-2.1.1.tgz#dced95cf9c37b75efe0a65db9b75ae8912f2f14a" integrity sha512-4iAc2pMsev4BTUzoA7jO1VvbTOU2N3juQUYa8TwiSPXPuQtxKwV9WB9ZEP+JQ+Pj15YqfGOXp5H0WNMPtapjiA== @@ -7265,37 +7265,7 @@ axios-retry@^3.1.9: "@babel/runtime" "^7.15.4" is-retry-allowed "^2.2.0" -axios@0.24.0: - version "0.24.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" - integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== - dependencies: - follow-redirects "^1.14.4" - -axios@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" - integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^0.21.1, axios@^0.21.4: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - -axios@^0.26.0: - version "0.26.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== - dependencies: - follow-redirects "^1.14.8" - -axios@^1.0.0, axios@^1.1.3, axios@^1.5.0: +axios@0.24.0, axios@1.1.3, axios@1.6.3, axios@^0.21.1, axios@^0.21.4, axios@^0.26.0, axios@^1.0.0, axios@^1.1.3, axios@^1.5.0: version "1.6.3" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4" integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww== @@ -11285,11 +11255,6 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.14.0, follow-redirects@^1.14.4, follow-redirects@^1.14.8: - version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== - follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -12431,12 +12396,7 @@ http-assert@^1.3.0: deep-equal "~1.0.1" http-errors "~1.8.0" -http-cache-semantics@3.8.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" - integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== - -http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: +http-cache-semantics@3.8.1, http-cache-semantics@4.1.1, http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== @@ -13386,6 +13346,11 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== +isobject@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" + integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== + isolated-vm@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/isolated-vm/-/isolated-vm-4.7.2.tgz#5670d5cce1d92004f9b825bec5b0b11fc7501b65" @@ -15980,7 +15945,7 @@ msgpackr-extract@^3.0.2: "@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.2" "@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.2" -msgpackr@^1.5.2: +msgpackr@1.10.1, msgpackr@^1.5.2: version "1.10.1" resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.10.1.tgz#51953bb4ce4f3494f0c4af3f484f01cfbb306555" integrity sha512-r5VRLv9qouXuLiIBrLpl2d5ZvPt8svdQTl5/vMvE4nzDMyEX4sgW5yWhuBBj5UmgwOTWj8CIdSXn5sAfsHAWIQ== @@ -16189,25 +16154,13 @@ node-duration@^1.0.4: resolved "https://registry.yarnpkg.com/node-duration/-/node-duration-1.0.4.tgz#3e94ecc0e473691c89c4560074503362071cecac" integrity sha512-eUXYNSY7DL53vqfTosggWkvyIW3bhAcqBDIlolgNYlZhianXTrCL50rlUJWD1eRqkIxMppXTfiFbp+9SjpPrgA== -node-fetch@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== - -node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@2.6.0, node-fetch@2.6.7, 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: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.9, node-fetch@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -17357,15 +17310,7 @@ passport-strategy@1.x.x, passport-strategy@^1.0.0: resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4" integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA== -passport@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/passport/-/passport-0.4.1.tgz#941446a21cb92fc688d97a0861c38ce9f738f270" - integrity sha512-IxXgZZs8d7uFSt3eqNjM9NQ3g3uQCW5avD8mRNoXV99Yig50vjuaez6dQK2qC0kVWPRTujxY0dWgGfT09adjYg== - dependencies: - passport-strategy "1.x.x" - pause "0.0.1" - -passport@^0.6.0: +passport@0.6.0, passport@^0.4.0, passport@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/passport/-/passport-0.6.0.tgz#e869579fab465b5c0b291e841e6cc95c005fac9d" integrity sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug== @@ -18665,7 +18610,7 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== -psl@^1.1.28, psl@^1.1.33: +psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== @@ -19690,11 +19635,6 @@ sax@1.2.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== -sax@>=0.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0" - integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA== - sax@>=0.6.0: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -19776,40 +19716,13 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@7.5.3, semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3: +"semver@2 || 3 || 4 || 5", semver@7.5.3, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1, semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semver@~2.3.1, semver@~7.0.0: version "7.5.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.5.4: - version "7.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - -semver@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52" - integrity sha512-abLdIKCosKfpnmhS52NCTjO4RiLspDfsn37prjzGrp9im5DPJOgh82Os92vtwGh6XdQryKI/7SREZnV+aqiXrA== - -semver@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - seq-queue@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e" @@ -21412,7 +21325,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2: +tough-cookie@4.1.3, "tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0", tough-cookie@^4.0.0, tough-cookie@^4.1.2, tough-cookie@~2.5.0: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== @@ -21422,14 +21335,6 @@ touch@^3.1.0: universalify "^0.2.0" url-parse "^1.5.3" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" @@ -21906,6 +21811,14 @@ unpipe@1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +unset-value@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-2.0.1.tgz#57bed0c22d26f28d69acde5df9a11b77c74d2df3" + integrity sha512-2hvrBfjUE00PkqN+q0XP6yRAOGrR06uSiUoIQGZkc7GxvQ9H7v8quUPNtZjMg4uux69i8HWpIjLPUKwCuRGyNg== + dependencies: + has-value "^2.0.2" + isobject "^4.0.0" + untildify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" @@ -22676,33 +22589,10 @@ xml-parse-from-string@^1.0.0: resolved "https://registry.yarnpkg.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" integrity sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g== -xml2js@0.1.x: - version "0.1.14" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.1.14.tgz#5274e67f5a64c5f92974cd85139e0332adc6b90c" - integrity sha512-pbdws4PPPNc1HPluSUKamY4GWMk592K7qwcj6BExbVOhhubub8+pMda/ql68b6L3luZs/OGjGSB5goV7SnmgnA== - dependencies: - sax ">=0.1.1" - -xml2js@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xml2js@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.5.0.tgz#d9440631fbb2ed800203fad106f2724f62c493b7" - integrity sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xml2js@^0.4.19, xml2js@^0.4.5: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== +xml2js@0.1.x, xml2js@0.4.19, xml2js@0.5.0, xml2js@0.6.2, xml2js@^0.4.19, xml2js@^0.4.5: + version "0.6.2" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" + integrity sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA== dependencies: sax ">=0.6.0" xmlbuilder "~11.0.0" @@ -22712,11 +22602,6 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ== - xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" From b303592f4c05dce3f8dc19e00a423b6b52d984bd Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 15:30:14 +0000 Subject: [PATCH 26/46] Remove content length checks. --- packages/server/src/tests/utilities/api/base.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/server/src/tests/utilities/api/base.ts b/packages/server/src/tests/utilities/api/base.ts index 486514cfbe..4df58ff425 100644 --- a/packages/server/src/tests/utilities/api/base.ts +++ b/packages/server/src/tests/utilities/api/base.ts @@ -187,22 +187,6 @@ export abstract class TestAPI { expect(response.body).toMatchObject(expectations.body) } - if (response.text && response.text.length > 0) { - // @ts-expect-error - we know this exists, it's just not in the types - const request = response.request as Test - const contentLength = response.headers["content-length"] - if (!contentLength) { - throw new Error( - `Failed request "${request.method} ${request.url}": Content-Length header not present, but response has a body (body length ${response.text.length})` - ) - } - if (parseInt(contentLength) !== response.text.length) { - throw new Error( - `Failed request "${request.method} ${request.url}": Content-Length header does not match response body length (header: ${contentLength}, body: ${response.text.length})` - ) - } - } - return response } From d77b6f82e08a8c8e505791da8240e6e56706cbee Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 15:42:45 +0000 Subject: [PATCH 27/46] remove jestTestcontainersConfigGenerator.js --- jestTestcontainersConfigGenerator.js | 16 ---- packages/pro | 2 +- yarn.lock | 126 +-------------------------- 3 files changed, 5 insertions(+), 139 deletions(-) delete mode 100644 jestTestcontainersConfigGenerator.js diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js deleted file mode 100644 index 82d50145e6..0000000000 --- a/jestTestcontainersConfigGenerator.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = () => { - return { - couchdb: { - image: "budibase/couchdb", - ports: [5984], - env: { - COUCHDB_PASSWORD: "budibase", - COUCHDB_USER: "budibase", - }, - wait: { - type: "ports", - timeout: 20000, - }, - }, - } -} diff --git a/packages/pro b/packages/pro index dd748e045f..dad97ea682 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit dd748e045ffdbc6662c5d2b76075f01d65a96a2f +Subproject commit dad97ea682195704eb65fefdc604f62606360ea7 diff --git a/yarn.lock b/yarn.lock index 585e043593..6acdcce3b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5098,15 +5098,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@trendyol/jest-testcontainers@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@trendyol/jest-testcontainers/-/jest-testcontainers-2.1.1.tgz#dced95cf9c37b75efe0a65db9b75ae8912f2f14a" - integrity sha512-4iAc2pMsev4BTUzoA7jO1VvbTOU2N3juQUYa8TwiSPXPuQtxKwV9WB9ZEP+JQ+Pj15YqfGOXp5H0WNMPtapjiA== - dependencies: - cwd "^0.10.0" - node-duration "^1.0.4" - testcontainers "4.7.0" - "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -5296,13 +5287,6 @@ "@types/node" "*" "@types/ssh2" "*" -"@types/dockerode@^2.5.34": - version "2.5.34" - resolved "https://registry.yarnpkg.com/@types/dockerode/-/dockerode-2.5.34.tgz#9adb884f7cc6c012a6eb4b2ad794cc5d01439959" - integrity sha512-LcbLGcvcBwBAvjH9UrUI+4qotY+A5WCer5r43DR5XHv2ZIEByNXFdPLo1XxR+v/BjkGjlggW8qUiXuVEhqfkpA== - dependencies: - "@types/node" "*" - "@types/dockerode@^3.3.24": version "3.3.24" resolved "https://registry.yarnpkg.com/@types/dockerode/-/dockerode-3.3.24.tgz#bea354a4fcd0824a80fd5ea5ede3e8cda71137a7" @@ -9140,14 +9124,6 @@ curlconverter@3.21.0: string.prototype.startswith "^1.0.0" yamljs "^0.3.0" -cwd@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/cwd/-/cwd-0.10.0.tgz#172400694057c22a13b0cf16162c7e4b7a7fe567" - integrity sha512-YGZxdTTL9lmLkCUTpg4j0zQ7IhRB5ZmqNBbGCl3Tg6MP/d5/6sY7L5mmTjzbc6JKgVZYiqTQTNhPFsbXNGlRaA== - dependencies: - find-pkg "^0.1.2" - fs-exists-sync "^0.1.0" - dargs@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" @@ -9769,7 +9745,7 @@ docker-compose@0.24.0: dependencies: yaml "^1.10.2" -docker-compose@^0.23.5, docker-compose@^0.23.6: +docker-compose@^0.23.6: version "0.23.19" resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.23.19.tgz#9947726e2fe67bdfa9e8efe1ff15aa0de2e10eb8" integrity sha512-v5vNLIdUqwj4my80wxFDkNH+4S85zsRuH29SO7dCWVWPCMt/ohZBsGN6g6KXWifT0pzQ7uOxqEKCYCDPJ8Vz4g== @@ -9793,15 +9769,6 @@ docker-modem@^3.0.0: split-ca "^1.0.1" ssh2 "^1.11.0" -dockerode@^3.2.1: - version "3.3.4" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.4.tgz#875de614a1be797279caa9fe27e5637cf0e40548" - integrity sha512-3EUwuXnCU+RUlQEheDjmBE0B7q66PV9Rw5NiH1sXwINq0M9c5ERP9fxgkw36ZHOtzf4AGEEYySnkx/sACC9EgQ== - dependencies: - "@balena/dockerignore" "^1.0.2" - docker-modem "^3.0.0" - tar-fs "~2.0.1" - dockerode@^3.3.5: version "3.3.5" resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" @@ -10827,13 +10794,6 @@ expand-template@^2.0.3: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expand-tilde@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" - integrity sha512-rtmc+cjLZqnu9dSYosX9EWmSJhTwpACgJQTfj4hgg2JjOD/6SIQalZrt4a3aQeh++oNxkazcaxrhPUj6+g5G/Q== - dependencies: - os-homedir "^1.0.1" - expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" @@ -11172,26 +11132,11 @@ filter-obj@^1.1.0: resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== -find-file-up@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/find-file-up/-/find-file-up-0.1.3.tgz#cf68091bcf9f300a40da411b37da5cce5a2fbea0" - integrity sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A== - dependencies: - fs-exists-sync "^0.1.0" - resolve-dir "^0.1.0" - find-free-port@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/find-free-port/-/find-free-port-2.0.0.tgz#4b22e5f6579eb1a38c41ac6bcb3efed1b6da9b1b" integrity sha512-J1j8gfEVf5FN4PR5w5wrZZ7NYs2IvqsHcd03cAeQx3Ec/mo+lKceaVNhpsRKoZpZKbId88o8qh+dwUwzBV6WCg== -find-pkg@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/find-pkg/-/find-pkg-0.1.2.tgz#1bdc22c06e36365532e2a248046854b9788da557" - integrity sha512-0rnQWcFwZr7eO0513HahrWafsc3CTFioEB7DRiEYCUM/70QXSY8f3mCST17HXLcPvEhzH/Ty/Bxd72ZZsr/yvw== - dependencies: - find-file-up "^0.1.2" - find-up@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -11359,11 +11304,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-exists-sync@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" - integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== - fs-extra@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" @@ -11860,24 +11800,6 @@ global-dirs@^3.0.0: dependencies: ini "2.0.0" -global-modules@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" - integrity sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA== - dependencies: - global-prefix "^0.1.4" - is-windows "^0.2.0" - -global-prefix@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" - integrity sha512-gOPiyxcD9dJGCEArAhF4Hd0BAqvAe/JzERP7tYumE4yIkmIedPUVXcJFWbV3/p/ovIIvKjkrTk+f1UVkq7vvbw== - dependencies: - homedir-polyfill "^1.0.0" - ini "^1.3.4" - is-windows "^0.2.0" - which "^1.2.12" - global@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" @@ -12308,7 +12230,7 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: +homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== @@ -13282,11 +13204,6 @@ is-whitespace@^0.3.0: resolved "https://registry.yarnpkg.com/is-whitespace/-/is-whitespace-0.3.0.tgz#1639ecb1be036aec69a54cbb401cfbed7114ab7f" integrity sha512-RydPhl4S6JwAyj0JJjshWJEFG6hNye3pZFBRZaTUfZFwGHxzppNaNOVgQuS/E/SlhrApuMXrpnK1EEIXfdo3Dg== -is-windows@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" - integrity sha512-n67eJYmXbniZB7RF4I/FTjK1s6RPOCTxhYrVYLRaCt3lF0mpWZPKr3T2LSZAqyjQsxR2qMmGYXXzK0YWwcPM1Q== - is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -16149,11 +16066,6 @@ node-addon-api@^6.1.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" integrity sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA== -node-duration@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/node-duration/-/node-duration-1.0.4.tgz#3e94ecc0e473691c89c4560074503362071cecac" - integrity sha512-eUXYNSY7DL53vqfTosggWkvyIW3bhAcqBDIlolgNYlZhianXTrCL50rlUJWD1eRqkIxMppXTfiFbp+9SjpPrgA== - node-fetch@2.6.0, node-fetch@2.6.7, 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: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -16900,11 +16812,6 @@ oracledb@5.3.0: resolved "https://registry.yarnpkg.com/oracledb/-/oracledb-5.3.0.tgz#a15e6cd16757d8711a2c006a28bd7ecd3b8466f7" integrity sha512-HMJzQ6lCf287ztvvehTEmjCWA21FQ3RMvM+mgoqd4i8pkREuqFWO+y3ovsGR9moJUg4T0xjcwS8rl4mggWPxmg== -os-homedir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== - os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -19223,14 +19130,6 @@ resolve-dependency-path@^2.0.0: resolved "https://registry.yarnpkg.com/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz#11700e340717b865d216c66cabeb4a2a3c696736" integrity sha512-DIgu+0Dv+6v2XwRaNWnumKu7GPufBBOr5I1gRPJHkvghrfCGOooJODFvgFimX/KRxk9j0whD2MnKHzM1jYvk9w== -resolve-dir@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" - integrity sha512-QxMPqI6le2u0dCLyiGzgy92kjkkL6zO0XyvHzjdTNH3zM6e5Hz3BwG6+aEyNgiQ5Xz6PwTwgQEj3U50dByPKIA== - dependencies: - expand-tilde "^1.2.2" - global-modules "^0.2.3" - resolve-from@5.0.0, resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" @@ -20920,7 +20819,7 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tar-fs@2.1.1, tar-fs@^2.0.0, tar-fs@^2.1.0: +tar-fs@2.1.1, tar-fs@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== @@ -21098,23 +20997,6 @@ testcontainers@10.7.2, testcontainers@^10.7.2: tar-fs "^3.0.5" tmp "^0.2.1" -testcontainers@4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/testcontainers/-/testcontainers-4.7.0.tgz#5a9a864b1b0cc86984086dcc737c2f5e73490cf3" - integrity sha512-5SrG9RMfDRRZig34fDZeMcGD5i3lHCOJzn0kjouyK4TiEWjZB3h7kCk8524lwNRHROFE1j6DGjceonv/5hl5ag== - dependencies: - "@types/dockerode" "^2.5.34" - byline "^5.0.0" - debug "^4.1.1" - docker-compose "^0.23.5" - dockerode "^3.2.1" - get-port "^5.1.1" - glob "^7.1.6" - node-duration "^1.0.4" - slash "^3.0.0" - stream-to-array "^2.3.0" - tar-fs "^2.1.0" - text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" @@ -22353,7 +22235,7 @@ which-typed-array@^1.1.11, which-typed-array@^1.1.13, which-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@^1.2.12, which@^1.2.9: +which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== From d9033b2636476e943a19f786532583f004586671 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 25 Mar 2024 16:39:42 +0000 Subject: [PATCH 28/46] Un-revert Skeleton Loader PR (#13180) * wip * wip * wip * client versions init * wip * wip * wip * wip * wip * linting * remove log * comment client version script * lint * skeleton loader type fix * fix types * lint * fix types again * fix manifest not being served locally * remove preinstalled old client version * add constant for dev client version * linting * Dean PR Feedback * linting * pr feedback * wip * wip * clientVersions empty array * delete from git * empty array again * fix tests * pr feedback --------- Co-authored-by: Andrew Kingston --- .eslintignore | 3 +- .gitignore | 3 + package.json | 1 + .../deploy/RevertModalVersionSelect.svelte | 33 +++ .../src/components/deploy/VersionModal.svelte | 18 +- .../src/components/deploy/clientVersions.json | 1 + .../[screenId]/_components/AppPreview.svelte | 43 ++- .../builder/portal/apps/[appId]/index.svelte | 63 +++- packages/client/manifest.json | 3 +- .../client/src/components/ClientApp.svelte | 276 ++++++++++-------- .../client/src/components/FreeFooter.svelte | 1 + packages/client/src/licensing/features.js | 5 - packages/client/src/licensing/index.js | 7 - packages/client/src/licensing/utils.js | 32 -- packages/client/src/stores/features.js | 42 +++ packages/client/src/stores/index.js | 1 + packages/frontend-core/src/api/app.js | 9 + .../src/components/ClientAppSkeleton.svelte | 244 ++++++++++++++++ .../frontend-core/src/components/index.js | 1 + .../frontend-core/src/themes/midnight.css | 1 - packages/server/package.json | 1 + .../server/src/api/controllers/application.ts | 30 +- .../src/api/controllers/static/index.ts | 34 ++- .../static/templates/BudibaseApp.svelte | 10 + .../api/controllers/static/templates/app.hbs | 8 +- packages/server/src/api/routes/application.ts | 5 + packages/server/src/api/routes/static.ts | 2 +- packages/server/src/constants/index.ts | 2 + packages/server/src/constants/themes.ts | 54 ++++ .../server/src/utilities/fileSystem/app.ts | 33 ++- .../src/utilities/fileSystem/clientLibrary.ts | 56 +++- packages/types/src/documents/app/app.ts | 1 + scripts/build.js | 28 +- scripts/getPastClientVersion.js | 45 +++ 34 files changed, 850 insertions(+), 246 deletions(-) create mode 100644 packages/builder/src/components/deploy/RevertModalVersionSelect.svelte create mode 100644 packages/builder/src/components/deploy/clientVersions.json delete mode 100644 packages/client/src/licensing/features.js delete mode 100644 packages/client/src/licensing/index.js delete mode 100644 packages/client/src/licensing/utils.js create mode 100644 packages/client/src/stores/features.js create mode 100644 packages/frontend-core/src/components/ClientAppSkeleton.svelte create mode 100644 packages/server/src/constants/themes.ts create mode 100644 scripts/getPastClientVersion.js diff --git a/.eslintignore b/.eslintignore index f2c53c2fdc..94984a446f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,4 +12,5 @@ packages/sdk/sdk packages/account-portal/packages/server/build packages/account-portal/packages/ui/.routify packages/account-portal/packages/ui/build -**/*.ivm.bundle.js \ No newline at end of file +**/*.ivm.bundle.js +packages/server/build/oldClientVersions/**/** diff --git a/.gitignore b/.gitignore index 8861a14d20..661c60e95e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ packages/server/runtime_apps/ bb-airgapped.tar.gz *.iml +packages/server/build/oldClientVersions/**/* +packages/builder/src/components/deploy/clientVersions.json + # Logs logs *.log diff --git a/package.json b/package.json index 7de22ab456..79a7b06eff 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "scripts": { "preinstall": "node scripts/syncProPackage.js", + "get-past-client-version": "node scripts/getPastClientVersion.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", "build": "NODE_OPTIONS=--max-old-space-size=1500 lerna run build --stream", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", diff --git a/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte b/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte new file mode 100644 index 0000000000..ed40a101d0 --- /dev/null +++ b/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte @@ -0,0 +1,33 @@ + + +
+