Merge branch 'master' of github.com:Budibase/budibase into feature/opinionated-sql
This commit is contained in:
commit
2af97ca494
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/auth",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"description": "Authentication middlewares for budibase builder and apps",
|
||||
"main": "src/index.js",
|
||||
"author": "Budibase",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"license": "AGPL-3.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
|
|
@ -402,13 +402,13 @@ braces@~3.0.2:
|
|||
fill-range "^7.0.1"
|
||||
|
||||
browserslist@^4.0.0:
|
||||
version "4.16.4"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.4.tgz#7ebf913487f40caf4637b892b268069951c35d58"
|
||||
integrity sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==
|
||||
version "4.16.6"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2"
|
||||
integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001208"
|
||||
caniuse-lite "^1.0.30001219"
|
||||
colorette "^1.2.2"
|
||||
electron-to-chromium "^1.3.712"
|
||||
electron-to-chromium "^1.3.723"
|
||||
escalade "^3.1.1"
|
||||
node-releases "^1.1.71"
|
||||
|
||||
|
@ -469,10 +469,10 @@ caniuse-api@^3.0.0:
|
|||
lodash.memoize "^4.1.2"
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001208:
|
||||
version "1.0.30001209"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001209.tgz#1bb4be0bd118e98e21cfb7ef617b1ef2164622f4"
|
||||
integrity sha512-2Ktt4OeRM7EM/JaOZjuLzPYAIqmbwQMNnYbgooT+icoRGrKOyAxA1xhlnotBD1KArRSPsuJp3TdYcZYrL7qNxA==
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001219:
|
||||
version "1.0.30001235"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001235.tgz#ad5ca75bc5a1f7b12df79ad806d715a43a5ac4ed"
|
||||
integrity sha512-zWEwIVqnzPkSAXOUlQnPW2oKoYb2aLQ4Q5ejdjBcnH63rfypaW34CxaeBn1VMya2XaEU3P/R2qHpWyj+l0BT1A==
|
||||
|
||||
chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
|
||||
version "2.4.2"
|
||||
|
@ -856,10 +856,10 @@ ee-first@1.1.1:
|
|||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||
|
||||
electron-to-chromium@^1.3.712:
|
||||
version "1.3.717"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.717.tgz#78d4c857070755fb58ab64bcc173db1d51cbc25f"
|
||||
integrity sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==
|
||||
electron-to-chromium@^1.3.723:
|
||||
version "1.3.749"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.749.tgz#0ecebc529ceb49dd2a7c838ae425236644c3439a"
|
||||
integrity sha512-F+v2zxZgw/fMwPz/VUGIggG4ZndDsYy0vlpthi3tjmDZlcfbhN5mYW0evXUsBr2sUtuDANFtle410A9u/sd/4A==
|
||||
|
||||
emojis-list@^3.0.0:
|
||||
version "3.0.0"
|
||||
|
@ -1554,9 +1554,9 @@ negotiator@0.6.2:
|
|||
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
|
||||
|
||||
node-releases@^1.1.71:
|
||||
version "1.1.71"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb"
|
||||
integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==
|
||||
version "1.1.73"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20"
|
||||
integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==
|
||||
|
||||
nollup@^0.14.1:
|
||||
version "0.14.4"
|
||||
|
@ -2564,9 +2564,9 @@ wrappy@1:
|
|||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
|
||||
ws@^5.2.0:
|
||||
version "5.2.2"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"
|
||||
integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==
|
||||
version "5.2.3"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d"
|
||||
integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==
|
||||
dependencies:
|
||||
async-limiter "~1.0.0"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -65,10 +65,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.34",
|
||||
"@budibase/client": "^0.9.34",
|
||||
"@budibase/bbui": "^0.9.38",
|
||||
"@budibase/client": "^0.9.38",
|
||||
"@budibase/colorpicker": "1.1.2",
|
||||
"@budibase/string-templates": "^0.9.34",
|
||||
"@budibase/string-templates": "^0.9.38",
|
||||
"@sentry/browser": "5.19.1",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -18,18 +18,18 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/string-templates": "^0.9.34",
|
||||
"@budibase/string-templates": "^0.9.38",
|
||||
"regexparam": "^1.3.0",
|
||||
"shortid": "^2.2.15",
|
||||
"svelte-spa-router": "^3.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@budibase/standard-components": "^0.9.34",
|
||||
"@budibase/standard-components": "^0.9.38",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"fs-extra": "^8.1.0",
|
||||
"jsdom": "^16.0.1",
|
||||
"postcss": "^8.2.9",
|
||||
"postcss": "^8.2.10",
|
||||
"rollup": "^2.44.0",
|
||||
"rollup-plugin-json": "^4.0.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"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.34",
|
||||
"@budibase/client": "^0.9.34",
|
||||
"@budibase/string-templates": "^0.9.34",
|
||||
"@budibase/auth": "^0.9.38",
|
||||
"@budibase/client": "^0.9.38",
|
||||
"@budibase/string-templates": "^0.9.38",
|
||||
"@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.34",
|
||||
"@budibase/standard-components": "^0.9.38",
|
||||
"@jest/test-sequencer": "^24.8.0",
|
||||
"babel-jest": "^27.0.2",
|
||||
"docker-compose": "^0.23.6",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,11 +29,11 @@
|
|||
"keywords": [
|
||||
"svelte"
|
||||
],
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"license": "MIT",
|
||||
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.34",
|
||||
"@budibase/bbui": "^0.9.38",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
"apexcharts": "^3.22.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -19,8 +19,9 @@ const ADDED_HELPERS = {
|
|||
date: {
|
||||
args: ["datetime", "format"],
|
||||
numArgs: 2,
|
||||
example: '{{date now "DD-MM-YYYY"}} -> 21-01-2021',
|
||||
description: "Format a date using moment.js date formatting.",
|
||||
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.",
|
||||
},
|
||||
duration: {
|
||||
args: ["time", "durationType"],
|
||||
|
|
|
@ -3,6 +3,7 @@ dayjs.extend(require("dayjs/plugin/duration"))
|
|||
dayjs.extend(require("dayjs/plugin/advancedFormat"))
|
||||
dayjs.extend(require("dayjs/plugin/relativeTime"))
|
||||
dayjs.extend(require("dayjs/plugin/utc"))
|
||||
dayjs.extend(require("dayjs/plugin/timezone"))
|
||||
|
||||
/**
|
||||
* This file was largely taken from the helper-date package - we did this for two reasons:
|
||||
|
@ -72,7 +73,8 @@ function setLocale(str, pattern, options) {
|
|||
// if options is null then it'll get updated here
|
||||
const config = initialConfig(str, pattern, options)
|
||||
const defaults = { lang: "en", date: new Date(config.str) }
|
||||
const opts = getContext(this, defaults, config.options)
|
||||
// for now don't allow this to be configurable, don't pass in options
|
||||
const opts = getContext(this, defaults, {})
|
||||
|
||||
// set the language to use
|
||||
dayjs.locale(opts.lang || opts.language)
|
||||
|
@ -89,7 +91,15 @@ module.exports.date = (str, pattern, options) => {
|
|||
|
||||
setLocale(config.str, config.pattern, config.options)
|
||||
|
||||
const date = dayjs(new Date(config.str)).utc()
|
||||
let date = dayjs(new Date(config.str))
|
||||
if (typeof config.options === "string") {
|
||||
date =
|
||||
config.options.toLowerCase() === "utc"
|
||||
? date.utc()
|
||||
: date.tz(config.options)
|
||||
} else {
|
||||
date = date.tz(dayjs.tz.guess())
|
||||
}
|
||||
if (config.pattern === "") {
|
||||
return date.toISOString()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const { processString, processObject, isValid } = require("../src/index.cjs")
|
||||
const tableJson = require("./examples/table.json")
|
||||
const dayjs = require("dayjs")
|
||||
|
||||
describe("test the custom helpers we have applied", () => {
|
||||
it("should be able to use the object helper", async () => {
|
||||
|
@ -162,7 +163,7 @@ describe("test the date helpers", () => {
|
|||
it("should allow use of the date helper", async () => {
|
||||
const date = new Date(1611577535000)
|
||||
const output = await processString("{{ date time 'YYYY-MM-DD' }}", {
|
||||
time: date.toISOString(),
|
||||
time: date.toUTCString(),
|
||||
})
|
||||
expect(output).toBe("2021-01-25")
|
||||
})
|
||||
|
@ -172,6 +173,25 @@ describe("test the date helpers", () => {
|
|||
const output = await processString("{{ date now 'DD' }}", {})
|
||||
expect(parseInt(output)).toBe(date.getDate())
|
||||
})
|
||||
|
||||
it("should test the timezone capabilities", async () => {
|
||||
const date = new Date(1611577535000)
|
||||
const output = await processString("{{ date time 'HH-mm-ss Z' 'America/New_York' }}", {
|
||||
time: date.toUTCString(),
|
||||
})
|
||||
const formatted = new dayjs(date).tz("America/New_York").format("HH-mm-ss Z")
|
||||
expect(output).toBe(formatted)
|
||||
})
|
||||
|
||||
it("should guess the users timezone when not specified", async () => {
|
||||
const date = new Date()
|
||||
const output = await processString("{{ date time 'Z' }}", {
|
||||
time: date.toUTCString()
|
||||
})
|
||||
const timezone = dayjs.tz.guess()
|
||||
const offset = new dayjs(date).tz(timezone).format("Z")
|
||||
expect(output).toBe(offset)
|
||||
})
|
||||
})
|
||||
|
||||
describe("test the string helpers", () => {
|
||||
|
|
|
@ -2313,9 +2313,9 @@ hmac-drbg@^1.0.1:
|
|||
minimalistic-crypto-utils "^1.0.1"
|
||||
|
||||
hosted-git-info@^2.1.4:
|
||||
version "2.8.8"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
|
||||
integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==
|
||||
version "2.8.9"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
|
||||
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
|
||||
|
||||
html-encoding-sniffer@^2.0.1:
|
||||
version "2.0.1"
|
||||
|
@ -4968,9 +4968,9 @@ write-file-atomic@^3.0.0:
|
|||
typedarray-to-buffer "^3.1.5"
|
||||
|
||||
ws@^7.2.3:
|
||||
version "7.4.2"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.2.tgz#782100048e54eb36fe9843363ab1c68672b261dd"
|
||||
integrity sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==
|
||||
version "7.4.6"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
|
||||
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==
|
||||
|
||||
xml-name-validator@^3.0.0:
|
||||
version "3.0.0"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.34",
|
||||
"version": "0.9.38",
|
||||
"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.34",
|
||||
"@budibase/string-templates": "^0.9.34",
|
||||
"@budibase/auth": "^0.9.38",
|
||||
"@budibase/string-templates": "^0.9.38",
|
||||
"@koa/router": "^8.0.0",
|
||||
"aws-sdk": "^2.811.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2355,8 +2355,9 @@ has@^1.0.3:
|
|||
function-bind "^1.1.1"
|
||||
|
||||
hosted-git-info@^2.1.4, hosted-git-info@^2.7.1:
|
||||
version "2.8.5"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
|
||||
version "2.8.9"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
|
||||
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
|
||||
|
||||
http-cache-semantics@^3.8.1:
|
||||
version "3.8.1"
|
||||
|
|
Loading…
Reference in New Issue