diff --git a/lerna.json b/lerna.json index 605266be51..2dcb285c16 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.42", + "version": "0.9.45", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 888390cb00..734ce46328 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.42", + "version": "0.9.45", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4769e55fa9..006de5ae05 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.42", + "version": "0.9.45", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 85e2884a8b..e9a2028856 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.42", + "version": "0.9.45", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.42", - "@budibase/client": "^0.9.42", + "@budibase/bbui": "^0.9.45", + "@budibase/client": "^0.9.45", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.42", + "@budibase/string-templates": "^0.9.45", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index 400f0dca4f..ea538f8212 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -98,6 +98,16 @@ + + + + + Host +
+ +
-
- - -
-
- - -
+ + {#if requireAuth} +
+ + +
+
+ + +
+ {/if}
diff --git a/packages/cli/package.json b/packages/cli/package.json index 0b3bb30160..fd3bac7b19 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.42", + "version": "0.9.45", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index d4c1e68683..ce59081266 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.42", + "version": "0.9.45", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,13 +18,13 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/string-templates": "^0.9.42", + "@budibase/string-templates": "^0.9.45", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" }, "devDependencies": { - "@budibase/standard-components": "^0.9.42", + "@budibase/standard-components": "^0.9.45", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "fs-extra": "^8.1.0", diff --git a/packages/server/package.json b/packages/server/package.json index 8a64da4811..2189d0ed34 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.42", + "version": "0.9.45", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.42", - "@budibase/client": "^0.9.42", - "@budibase/string-templates": "^0.9.42", + "@budibase/auth": "^0.9.45", + "@budibase/client": "^0.9.45", + "@budibase/string-templates": "^0.9.45", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.42", + "@budibase/standard-components": "^0.9.45", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index a60df2b9c2..7db8bacd0b 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -245,9 +245,10 @@ exports.update = async function (ctx) { exports.delete = async function (ctx) { const db = new CouchDB(ctx.params.appId) + const result = await db.destroy() /* istanbul ignore next */ - if (!env.isTest()) { + if (!env.isTest() && !ctx.query.unpublish) { await deleteApp(ctx.params.appId) } // make sure the app/role doesn't stick around after the app has been deleted diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 0ea1ebce03..ffa399d075 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.42", + "version": "0.9.45", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.42", + "@budibase/bbui": "^0.9.45", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", "apexcharts": "^3.22.1", diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index 5a96885383..02bd7f8a64 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -245,7 +245,7 @@ "options" ], "numArgs": 3, - "example": "{{equalsLength [1, 2, 3] 3}} -> true", + "example": "{{equalsLength '[1,2,3]' 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n" }, "last": { @@ -262,7 +262,7 @@ "value" ], "numArgs": 1, - "example": "{{length [1, 2, 3]}} -> 3", + "example": "{{length '[1, 2, 3]'}} -> 3", "description": "

Returns the length of the given string or array.

\n" }, "lengthEqual": { @@ -272,7 +272,7 @@ "options" ], "numArgs": 3, - "example": "{{equalsLength [1, 2, 3] 3}} -> true", + "example": "{{equalsLength '[1,2,3]' 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n" }, "map": { @@ -1097,8 +1097,8 @@ "format" ], "numArgs": 2, - "example": "{{date now \"DD-MM-YYYY\"}} -> 21-01-2021", - "description": "

Format a date using moment.js date formatting.

\n" + "example": "{{date now \"DD-MM-YYYY\" \"America/New_York\" }} -> 21-01-2021", + "description": "

Format a date using moment.js date formatting - the timezone is optional and uses the tz database.

\n" }, "duration": { "args": [ diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b1dc7e9a25..dda3bdaddc 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.42", + "version": "0.9.45", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", @@ -20,7 +20,7 @@ "manifest": "node ./scripts/gen-collection-info.js" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.11.3", + "@budibase/handlebars-helpers": "^0.11.4", "dayjs": "^1.10.4", "handlebars": "^4.7.6", "handlebars-utils": "^1.0.6", diff --git a/packages/string-templates/test/helpers.spec.js b/packages/string-templates/test/helpers.spec.js index d460708798..e43bb5fbe1 100644 --- a/packages/string-templates/test/helpers.spec.js +++ b/packages/string-templates/test/helpers.spec.js @@ -305,6 +305,17 @@ describe("Test the object/array helper", () => { const output = await processString("{{ literal ( sum ( pluck items 'price' ) ) }}", context) expect(output).toBe(50) }) + + it("should allow use of the length helper", async () => { + const array = [1, 2, 3] + const output = await processString("{{ length array }}", { array }) + expect(output).toBe("3") + }) + + it("should allow use of the length helper inline", async () => { + const output = await processString(`{{ length '[1, 2, 3]' }}`, {}) + expect(output).toBe("3") + }) }) describe("Test the literal helper", () => { diff --git a/packages/string-templates/yarn.lock b/packages/string-templates/yarn.lock index 64534884b0..0188a9ec1d 100644 --- a/packages/string-templates/yarn.lock +++ b/packages/string-templates/yarn.lock @@ -270,10 +270,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/handlebars-helpers@^0.11.3": - version "0.11.3" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.3.tgz#b6e5c91b83e8906e7d7ff10ddde277a3d561016e" - integrity sha512-MS1ptZEYq8o9J3tNLM7cZ2RGSSJIer4GiMIUHtbBI3sC9UKqZebao1JYNfmZKpNjntuqhZKgjqc5GfnVIEjsYQ== +"@budibase/handlebars-helpers@^0.11.4": + version "0.11.4" + resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.4.tgz#8acfa2ee84134f7be4b2906e710fce6d25c5d000" + integrity sha512-AJNJYlJnxZmn9QJ8tBl8nrm4YxbwHP4AR0pbiVGK+EoOylkNBlUnZ/QDL1VyqM5fTkAE/Z2IZVLKrrG3kxuWLA== dependencies: arr-flatten "^1.1.0" array-sort "^0.1.4" diff --git a/packages/worker/package.json b/packages/worker/package.json index db15ad4f6b..c7ec372824 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.42", + "version": "0.9.45", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.42", - "@budibase/string-templates": "^0.9.42", + "@budibase/auth": "^0.9.45", + "@budibase/string-templates": "^0.9.45", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", diff --git a/packages/worker/src/utilities/email.js b/packages/worker/src/utilities/email.js index 4e48844843..534456fe15 100644 --- a/packages/worker/src/utilities/email.js +++ b/packages/worker/src/utilities/email.js @@ -20,11 +20,16 @@ const FULL_EMAIL_PURPOSES = [ function createSMTPTransport(config) { let options + let secure = config.secure + // default it if not specified + if (secure == null) { + secure = config.port === 465 + } if (!TEST_MODE) { options = { port: config.port, host: config.host, - secure: config.secure || false, + secure: secure, auth: config.auth, } options.tls = {