From 10d741234aa6d96147fc4c0d4a3e8c9eafe5a083 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 10:38:54 +0100 Subject: [PATCH 01/33] added a note to clean cookies when swapping modes --- docs/CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 531ed05749..7637bbcd44 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -162,7 +162,10 @@ When you are running locally, budibase stores data on disk using docker volumes. ### Development Modes -A combination of environment variables controls the mode budibase runs in. +A combination of environment variables controls the mode budibase runs in. + +| **NOTE**: You need to clean your browser cookies when you change between different modes. + Yarn commands can be used to mimic the different modes as described in the sections below: #### Self Hosted From dcf63699588ab6b71b71974a7278e25b81c3f703 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 10:43:14 +0100 Subject: [PATCH 02/33] fixed broken link --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 7637bbcd44..2439e01781 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -192,7 +192,7 @@ To enable this mode, use: yarn mode:account ``` ### CI - An overview of the CI pipelines can be found [here](./workflows/README.md) + An overview of the CI pipelines can be found [here](../.github/workflows/README.md) ### Pro From 893f360306ce25e43f530f596cec7c33b0d31543 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 11:13:03 +0100 Subject: [PATCH 03/33] cleaning dependencies before bootstrap to linking pro version --- .github/workflows/README.md | 2 +- docs/CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index c33665c964..c5c5e9cea3 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -132,7 +132,7 @@ This is done to prevent pro needing to be published prior to CI runs in budiabse - backend-core lives in the monorepo, so it can't be released independently to be used in pro - therefore the only option is to pull pro from source and release it as a part of the monorepo release, as if it were a mono package -The install is performed using the same steps as local development, via the `yarn bootstrap` command, see the [Contributing Guide#Pro](../CONTRIBUTING.md#pro) +The install is performed using the same steps as local development, via the `yarn clean && yarn bootstrap` command, see the [Contributing Guide#Pro](../CONTRIBUTING.md#pro) The branch to install pro from can vary depending on ref of the commit that triggered the budibase CI job. This is done to enable branches which have changes in both the monorepo and the pro repo to have their CI pass successfully. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2439e01781..910e789e6b 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -206,7 +206,7 @@ yarn mode:account Note that only budibase maintainers will be able to access the pro repo. -The `yarn bootstrap` command can be used to replace the NPM supplied dependency with the local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. +The `yarn clean && yarn bootstrap` command can be used to replace the NPM supplied dependency with the local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. ### Troubleshooting From 0c787577f8a1235c67cf4cb7f76fb870e8dacaba Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 11:21:06 +0100 Subject: [PATCH 04/33] linking to doc instead of symlink to make it readable on Github --- .github/workflows/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index c5c5e9cea3..e70b3ce39d 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -132,7 +132,7 @@ This is done to prevent pro needing to be published prior to CI runs in budiabse - backend-core lives in the monorepo, so it can't be released independently to be used in pro - therefore the only option is to pull pro from source and release it as a part of the monorepo release, as if it were a mono package -The install is performed using the same steps as local development, via the `yarn clean && yarn bootstrap` command, see the [Contributing Guide#Pro](../CONTRIBUTING.md#pro) +The install is performed using the same steps as local development, via the `yarn clean && yarn bootstrap` command, see the [Contributing Guide#Pro](../../docs/CONTRIBUTING.md#pro) The branch to install pro from can vary depending on ref of the commit that triggered the budibase CI job. This is done to enable branches which have changes in both the monorepo and the pro repo to have their CI pass successfully. From 1adbc3a74ea06629238fc42b055ea45357b6e5c3 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 11:32:24 +0100 Subject: [PATCH 05/33] updated table of contents --- docs/CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 910e789e6b..8d38ed73ee 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -4,10 +4,10 @@ From opening a bug report to creating a pull request: every contribution is appr ## Table of contents -- [Quick start](#quick-start) -- [Status](#status) -- [What's included](#whats-included) -- [Bugs and feature requests](#bugs-and-feature-requests) +- [Where to start](#not-sure-where-to-start) +- [Contributor Licence Agreement](#contributor-license-agreement-cla) +- [Glossary of Terms](#glossary-of-terms) +- [Contributing to Budibase](#contributing-to-budibase) ## Not Sure Where to Start? From fb4e10bcdb73c8a2aa2ae848fde0616e2f40d369 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 11:51:02 +0100 Subject: [PATCH 06/33] troubleshooting M1 processors --- docs/DEV-SETUP-MACOSX.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/DEV-SETUP-MACOSX.md b/docs/DEV-SETUP-MACOSX.md index 5606fd0d10..c5990e58da 100644 --- a/docs/DEV-SETUP-MACOSX.md +++ b/docs/DEV-SETUP-MACOSX.md @@ -4,6 +4,11 @@ Install instructions [here](https://brew.sh/) +| **NOTE**: If you are working on a M1 Apple Silicon which is running Z shell, you could need to add +`eval $(/opt/homebrew/bin/brew shellenv)` line to your `.zshrc`. This will make your zsh to find the apps you install +through brew. + + ### Install Node Budibase requires a recent version of node (14+): @@ -51,4 +56,7 @@ So this command will actually run the application in dev mode. It creates .env f The dev version will be available on port 10000 i.e. -http://127.0.0.1:10000/builder/admin \ No newline at end of file +http://127.0.0.1:10000/builder/admin + +| **NOTE**: If you are working on a M1 Apple Silicon, you will need to uncomment `# platform: linux/amd64` line in +[hosting/docker-compose-dev.yaml](../hosting/docker-compose.dev.yaml) \ No newline at end of file From ac58ed78827fd5d0cf46254493692a828b697724 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 16:56:50 +0100 Subject: [PATCH 07/33] making link accesible from github instead of symlink --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8c6475d90..b969a2128c 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ If you have a question or would like to talk with other Budibase users and join ## ❗ Code of conduct -Budibase is dedicated to providing a welcoming, diverse, and harrassment-free experience for everyone. We expect everyone in the Budibase community to abide by our [**Code of Conduct**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). Please read it. +Budibase is dedicated to providing a welcoming, diverse, and harrassment-free experience for everyone. We expect everyone in the Budibase community to abide by our [**Code of Conduct**](https://github.com/Budibase/budibase/blob/HEAD/docs/CODE_OF_CONDUCT.md). Please read it.
From ec9526f58983c85dc877be7da1fc466e0a7dbca9 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 18:27:28 +0100 Subject: [PATCH 08/33] agree CLA when PR is created by other contributor --- docs/CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8d38ed73ee..fdd054745e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -32,6 +32,9 @@ All contributors must sign an [Individual Contributor License Agreement](https:/ If contributing on behalf of your company, your company must sign a [Corporate Contributor License Agreement](https://github.com/budibase/budibase/blob/next/.github/cla/corporate-cla.md). If so, please contact us via community@budibase.com. +If for any reason, your first contribution is in a PR created by other contributor, please just add a comment to the PR +with the following text to agree our CLA: "I have read the CLA Document and I hereby sign the CLA". + ## Glossary of Terms To understand the budibase API, it can be helpful to understand the top level entities that make up Budibase. From 6228972c9e6f54508196bad40647647755b6e36d Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 28 Jul 2022 20:35:43 +0100 Subject: [PATCH 09/33] important note for pro modifications --- .github/workflows/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index e70b3ce39d..9367ce7073 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -119,6 +119,8 @@ This job is responsible for deploying to our production, cloud kubernetes enviro ## Pro +| **NOTE**: When developing for both pro / budibase repositories, your branch names need to match, or else the correct pro image doesn't get run within your CI job. + ### Installing Pro The pro package is always installed from source in our CI jobs. From 4a87fd134002770a5c5bea7cf844f9e0b9193e60 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Fri, 5 Aug 2022 10:45:41 +0100 Subject: [PATCH 10/33] spanish README --- i18n/README.es.md | 296 ++++++++++++++++++++++++++++++---------------- 1 file changed, 191 insertions(+), 105 deletions(-) diff --git a/i18n/README.es.md b/i18n/README.es.md index 7245dc8656..21eb8caef7 100644 --- a/i18n/README.es.md +++ b/i18n/README.es.md @@ -8,10 +8,11 @@

- Construye herramientas empresariales personalizadas en cuestión de minutos y en su propia infraestructura. + Construye herramientas empresariales personalizadas en cuestión de minutos y en tu propia infraestructura.

- Budibase es una plataforma de código bajo de código abierto, que ayuda a desarrolladores y profesionales de TI a crear, automatizar y enviar aplicaciones empresariales personalizadas en cuestión de minutos y en su propia infraestructura + Budibase es una plataforma low code de código abierto, que ayuda a desarrolladores y profesionales de TI a crear y +automatizar aplicaciones personalizadas en cuestión de minutos

@@ -20,7 +21,7 @@

- + Budibase design ui

@@ -30,9 +31,6 @@ GitHub release (latest by date) - - Discord - Follow @budibase @@ -43,130 +41,213 @@

- Sign-up + Comenzar con Budibase en la nube · - Docs + Comenzar con Docker, K8s, DO · - Feature request + Documentaciones · - Report a bug + Pedir una funcionalidad · - Support: Discussions - & - Discord + Reportar un error + · + Support: Comunidad

+

+## ✨ Caracteristicas -## ✨ Features -When other platforms chose the closed source route, we decided to go open source. When other platforms chose cloud builders, we decided a local builder offered the better developer experience. We like to do things differently at Budibase. +### Construir aplicaciones reales +Con Budibase podras construir aplicaciones de pagina unica de gran rendimiento. Ademas, puedes hacerlas con un diseño +adaptativo para darles a tus usuarios una gran experiencia. +

-- **Build and ship real software.** Unlike other platforms, with Budibase you build and ship single page applications. Budibase applications have performance baked in and can be designed responsively, providing your users with a great experience. +### Codigo abierto y ampliable +Budibase es de codigo abierto con licencia GPL v3. Puedes ampliarlo o modificarlo para adaptarlo a tus necesidades y preferencias. -- **Open source and extensable.** Budibase is open-source. The builder is licensed AGPL v3, the server is GPL v3, and the client is MPL. This should fill you with confidence that Budibase will always be around. You can also code against Budibase or fork it and make changes as you please, providing a developer-friendly experience. +De esta manera proveemos una buena experiencia para el desarrollador asi como establecemos la confianza de que Budibase siempre estara funcional. +

-- **Load data or start from scratch.** Budibase pulls in data from multiple sources, including MongoDB, CouchDB, PostgreSQL, mySQL, Airtable, Google Sheets, S3, DyanmoDB, or a REST API. And unlike other platforms, with Budibase you can start from scratch and create business apps with no data sources. [Request new data sources](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). +### Cargar informacion o empezar desde cero +Budibase permite importar datos desde multiples fuentes, entre las que estan incluidas: MondoDB, CouchDB, PostgreSQL, MySQL, +Airtable, S3, DynamoDB o API REST. -- **Design and build apps with powerful pre-made components.** Budibase comes out of the box with beautifully designed, powerful components which you can use like building blocks to build your UI. We also expose a lot of your favourite CSS styling options so you can go that extra creative mile. [Request new components](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). - -- **Automate processes, integrate with other tools, and connect to webhooks.** Save time by automating manual processes and workflows. From connecting to webhooks, to automating emails, simply tell Budibase what to do and let it work for you. You can easily [create new automations for Budibase here](https://github.com/Budibase/automations) or [request new integrations here](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). - -- **Cloud hosting and self-hosting.** Users can self-host (see below), or host their apps with Budibase. Currently, our cloud hosting offering is limited to the free tier but we aim to change this in the future. For heavy usage, we advise users to self-host. +O si lo prefieres, con Budibase puedes empezar desde cero y construir tus propias aplicaciones +sin necesidad de herramientas externas. +[Sugerir fuente de datos](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas).

- Budibase design ui + Budibase data

+

+### Diseña y construye aplicaciones con componentes profesionales prediseñados -## ⌛ Status -- [x] Alpha: We are demoing Budibase to users and receiving feedback -- [x] Private Beta: We are testing Budibase with a closed set of customers -- [x] Public Beta: Anyone can [sign-up and use Budibase](https://portal.budi.live/signup). -- [ ] Official Launch +Budibase incorpora componentes profesionales prediseñados que podras usar de manera facil e intuitiva +como bloques de construccion para la interfaz de tu aplicacion. -Watch "releases" of this repo to get notified of major updates, and give the star button a click whilst you're there. +Tambien mostramos gran parte del CSS para que puedas adaptar los componentes a tus diseños. +[Sugerir componente](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas).

- + Budibase design

+

-### Stargazers over time +### Procesos automatizados, integra tu aplicacion con otras herramientas y conectala a eventos webhook + +Ahorra tiempo automatizando flujos de trabajo y procesos manuales. Podras desde conectar eventos webhook hasta automatizar emails, +simplemente dile a Budibase que hacer y deja que el haga el trabajo por ti. +[Crear nuevos procesos automatizados](https://github.com/Budibase/automations) o [Sugerir proceso automatizado](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). + +

+ Budibase automations +

+

+ +### Tus herramientas favoritas + +Budibase integra un gran numero de herramientas que te permitiran construir tus aplicaciones ajustandose a tus preferencias. + +

+ Budibase integrations +

+

+ +### Un paraiso para administradores + +Puedes albergar Budibase en tu propia infraestructura y gestionar globalmente usuarios, incorporaciones, SMTP, aplicaciones, +grupos, diseños de temas, etc. + +Tambien puedes gestionar los usuarios y grupos, o delegar en personas asignadas para ello, desde nuestra aplicacion sin +mucho esfuerzo. + +Budibase is made to scale. With Budibase, you can self-host on your own infrastructure and globally manage users, onboarding, SMTP, apps, groups, theming and more. You can also provide users/groups with an app portal and disseminate user-management to the group manager. + +- Video Promocional: https://youtu.be/xoljVpty_Kw + +
+ +--- + +
+ + +## Budibase API Publica + +Como todo lo que construimos en Budibase, nuestra nueva API publica es facil de usar, flexible e introduce nueva ampliacion +del sistema. Budibase API ofrece: +- Uso de Budibase como backend +- Interoperabilidad + +#### Documentacion + +Puedes aprender mas acerca de Budibase API en los siguientes documentos: +- [Documentacion general](https://docs.budibase.com/docs/public-api) : Como optener tu clave para la API, usar Insomnia y Postman +- [API Interactiva](https://docs.budibase.com/reference/post_applications) : Aprende como trabajar con la API + +#### Guias + +- [Construye una aplicacion con Budibase y Next.js](https://budibase.com/blog/building-a-crud-app-with-budibase-and-next.js/) + +

+ Budibase data +

+

+ +


+ +## 🏁 Comenzar con Budibase + +Puedes alojar Budibase en tu propia infraestructura con Docker, Kubernetes o Digital Ocean; o usa Budibase en la nube si +quieres empezar a crear tus aplicaciones rapidamente y sin ningun tipo de preocupacion. + +### [Comenzar con Budibase self-hosting](https://docs.budibase.com/docs/hosting-methods) + +- [Docker - single ARM compatible image](https://docs.budibase.com/docs/docker) +- [Docker Compose](https://docs.budibase.com/docs/docker-compose) +- [Kubernetes](https://docs.budibase.com/docs/kubernetes-k8s) +- [Digital Ocean](https://docs.budibase.com/docs/digitalocean) +- [Portainer](https://docs.budibase.com/docs/portainer) + + +### [Comenzar con Budibase en la nube](https://budibase.com) + +

+ +## 🎓 Aprende a usar Budibase + +Aqui tienes la [documentacion de Budibase](https://docs.budibase.com/docs). +
+ + +

+ +## 💬 Comunidad + +Te invitamos a que te unas a nuestra comunidad de Budibase, alli podras hacer las preguntas que quieras, ayudar a otras +personas o tener una charla entretenida con otros usuarios de Budibase. +[Acceder a la comunidad de Budibase](https://github.com/Budibase/budibase/discussions) +


+ + +## ❗ Codigo de conducta + +Budibase presta especial atencion en acoger a personas de toda diversidad y ofrecer un entorno de respeto mutuo. Asi mismo +esperamos lo mismo de nuestra comunidad, por favor lee el +[**Codigo de conducta**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). +
+ +

+ + +## 🙌 Contribuir en Budibase + +Desde comunicar un bug a solventar un error en el codigo, toda contribucion es apreciada y bienvenida. Si estas planeando +implementar una nueva funcionalidad o un realizar un cambio en la API, por favor crea un [nuevo mensaje aqui](https://github.com/Budibase/budibase/issues), +de esta manera nos encargaremos que tu trabajo no sea en vano. + +Aqui tienes instrucciones de como configurar tu entorno Budibase para [Debian](https://github.com/Budibase/budibase/tree/HEAD/docs/DEV-SETUP-DEBIAN.md) +y [MacOSX](https://github.com/Budibase/budibase/tree/HEAD/docs/DEV-SETUP-MACOSX.md) + +### No estas seguro por donde empezar? +Un buen lugar para empezar a contribuir con nosotros es [aqui](https://github.com/Budibase/budibase/projects/22). + +### Organizacion del repositorio + +Budibase es un repositorio unico gestionado por Lerna. Lerna construye y publica los paquetes de Budibase sincronizandolos +cada ves que se realiza un cambio. A rasgos generales, estos son los paquetes que conforman Budibase: + +- [packages/builder](https://github.com/Budibase/budibase/tree/HEAD/packages/builder) - contiene el codigo del builder de la parte cliente, esta es una aplicacion svelte. + +- [packages/client](https://github.com/Budibase/budibase/tree/HEAD/packages/client) - Este modulo se ejecuta en el browser y es el responsable de leer definiciones JSON y crear aplicaciones web en el momento. + +- [packages/server](https://github.com/Budibase/budibase/tree/HEAD/packages/server) - La parte servidor de Budibase. Esta aplicacion Koa es responsable de suministrar lo necesario al builder para asi generar las aplicaciones Budibase. Tambien provee una API para interaccionar con la base de datos y el almacenamiento de ficheros. + +Para mas informacion, por favor lee el siguiente documento [CONTRIBUTING.md](https://github.com/Budibase/budibase/blob/HEAD/docs/CONTRIBUTING.md) + +

+ + +## 📝 Licencia + +Budibase es open-source, licenciado como [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html). El cliente y las librerias +de componentes estan licenciadas como [MPL](https://directory.fsf.org/wiki/License:MPL-2.0) - de esta manera, puedes licenciar +como tu quieras las aplicaciones que construyas. + +

+ +## ⭐ Historia de nuestros Stargazers [![Stargazers over time](https://starchart.cc/Budibase/budibase.svg)](https://starchart.cc/Budibase/budibase) -If you are having issues between updates of the builder, please use the guide [here](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md#troubleshooting) to clear down your environment. +Si estas teniendo problemas con el builder despues de actualizar, por favor [lee esta guia](https://github.com/Budibase/budibase/blob/HEAD/docs/CONTRIBUTING.md#troubleshooting) to clear down your environment. +

-## 🏁 Getting Started with Budibase +## Contribuidores ✨ -The Budibase builder runs in Electron, on Mac, PC and Linux. Follow the steps below to get started: -- [ ] [Sign-up to Budibase](https://portal.budi.live/signup) -- [ ] Create a username and password -- [ ] Copy your API key -- [ ] Download Budibase -- [ ] Open Budibase and enter your API key - -[Here is a guided tutorial](https://docs.budibase.com/tutorial/tutorial-signing-up) if you need extra help. - - -## 🤖 Self-hosting - -Budibase wants to make sure anyone can use the tools we develop and we know a lot of people need to be able to host the apps they make on their own systems - that is why we've decided to try and make self hosting as easy as possible! - -Currently, you can host your apps using Docker or Digital Ocean. The documentation for self-hosting can be found [here](https://docs.budibase.com/docs/hosting-methods). - -[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/droplets/new?onboarding_origin=marketplace&i=09038e&fleetUuid=bb04f9c8-1de8-4687-b2ae-1d5177a0535b&appId=77729671&type=applications&size=s-4vcpu-8gb®ion=nyc1&refcode=0caaa6085a82&image=budibase-20-04) - - -## 🎓 Learning Budibase - -The Budibase [documentation lives here](https://docs.budibase.com). - -You can also follow a quick tutorial on [how to build a CRM with Budibase](https://docs.budibase.com/tutorial/tutorial-introduction) - - -## Roadmap - -Checkout our [Public Roadmap](https://github.com/Budibase/budibase/projects/10). If you would like to discuss some of the items on the roadmap, please feel to reach out on [Discord](https://discord.gg/rCYayfe), or via [Github discussions](https://github.com/Budibase/budibase/discussions) - - -## ❗ Code of Conduct - -Budibase is dedicated to providing a welcoming, diverse, and harrassment-free experience for everyone. We expect everyone in the Budibase community to abide by our [**Code of Conduct**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). Please read it. - -## 🙌 Contributing to Budibase - -From opening a bug report to creating a pull request: every contribution is appreciated and welcomed. If you're planning to implement a new feature or change the API please create an issue first. This way we can ensure your work is not in vain. - -### Not Sure Where to Start? -A good place to start contributing, is the [First time issues project](https://github.com/Budibase/budibase/projects/22). - -### How the repository is organized -Budibase is a monorepo managed by lerna. Lerna manages the building and publishing of the budibase packages. At a high level, here are the packages that make up Budibase. - -- [packages/builder](https://github.com/Budibase/budibase/tree/HEAD/packages/builder) - contains code for the budibase builder client side svelte application. - -- [packages/client](https://github.com/Budibase/budibase/tree/HEAD/packages/client) - A module that runs in the browser responsible for reading JSON definition and creating living, breathing web apps from it. - -- [packages/server](https://github.com/Budibase/budibase/tree/HEAD/packages/server) - The budibase server. This Koa app is responsible for serving the JS for the builder and budibase apps, as well as providing the API for interaction with the database and file system. - -For more information, see [CONTRIBUTING.md](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md) - -## 📝 License - -Budibase is open-source. The builder is licensed [AGPL v3](https://www.gnu.org/licenses/agpl-3.0.en.html), the server is licensed [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html), and the client is licensed [MPL](https://directory.fsf.org/wiki/License:MPL-2.0). - -## 💬 Get in touch - -If you have a question or would like to talk with other Budibase users, please hop over to [Github discussions](https://github.com/Budibase/budibase/discussions) or join our Discord server: - -[Discord chatroom](https://discord.gg/rCYayfe) - -![Discord Shield](https://discordapp.com/api/guilds/733030666647765003/widget.png?style=shield) - - -## Contributors ✨ - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): +Queremos prestar un especial agradecimiento a nuestra maravillosa gente ([emoji key](https://allcontributors.org/docs/en/emoji-key)): @@ -179,14 +260,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Michael Shanks

📖 💻 ⚠️
Kevin Åberg Kultalahti

📖 💻 ⚠️
Joe

📖 💻 🖋 🎨 -
Conor_Mack

💻 ⚠️ +
Rory Powell

💻 📖 ⚠️ +
Peter Clement

💻 📖 ⚠️ +
Conor_Mack

💻 ⚠️
pngwn

💻 ⚠️
HugoLd

💻
victoriasloan

💻
yashank09

💻
SOVLOOKUP

💻 +
seoulaja

🌍 +
Maurits Lourens

⚠️ 💻 @@ -195,4 +280,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +Este proyecto sigue las especificaciones de [all-contributors](https://github.com/all-contributors/all-contributors). +Todo tipo de contribuciones son agradecidas! From f5797cc4cab9bdd821d3174a0b1bdd464a963f8e Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Fri, 5 Aug 2022 10:57:13 +0100 Subject: [PATCH 11/33] amendments for PR comments --- .github/workflows/README.md | 4 ++-- docs/CONTRIBUTING.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 9367ce7073..f77323d85a 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -119,7 +119,7 @@ This job is responsible for deploying to our production, cloud kubernetes enviro ## Pro -| **NOTE**: When developing for both pro / budibase repositories, your branch names need to match, or else the correct pro image doesn't get run within your CI job. +| **NOTE**: When developing for both pro / budibase repositories, your branch names need to match, or else the correct pro doesn't get run within your CI job. ### Installing Pro @@ -134,7 +134,7 @@ This is done to prevent pro needing to be published prior to CI runs in budiabse - backend-core lives in the monorepo, so it can't be released independently to be used in pro - therefore the only option is to pull pro from source and release it as a part of the monorepo release, as if it were a mono package -The install is performed using the same steps as local development, via the `yarn clean && yarn bootstrap` command, see the [Contributing Guide#Pro](../../docs/CONTRIBUTING.md#pro) +The install is performed using the same steps as local development, via the `yarn bootstrap` command, see the [Contributing Guide#Pro](../../docs/CONTRIBUTING.md#pro) The branch to install pro from can vary depending on ref of the commit that triggered the budibase CI job. This is done to enable branches which have changes in both the monorepo and the pro repo to have their CI pass successfully. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index fdd054745e..fb0848596c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -209,7 +209,7 @@ yarn mode:account Note that only budibase maintainers will be able to access the pro repo. -The `yarn clean && yarn bootstrap` command can be used to replace the NPM supplied dependency with the local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. +The `yarn bootstrap` command can be used to replace the NPM supplied dependency with the local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. ### Troubleshooting From 59ee85f46c7da8c33e981a065c25ebef3a1f3b7d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Aug 2022 11:39:28 +0100 Subject: [PATCH 12/33] Removing session API. --- .../src/api/controllers/global/sessions.js | 37 ------------------- .../worker/src/api/routes/global/sessions.js | 14 ------- packages/worker/src/api/routes/index.js | 2 - 3 files changed, 53 deletions(-) delete mode 100644 packages/worker/src/api/controllers/global/sessions.js delete mode 100644 packages/worker/src/api/routes/global/sessions.js diff --git a/packages/worker/src/api/controllers/global/sessions.js b/packages/worker/src/api/controllers/global/sessions.js deleted file mode 100644 index 4a334037d4..0000000000 --- a/packages/worker/src/api/controllers/global/sessions.js +++ /dev/null @@ -1,37 +0,0 @@ -const { - getAllSessions, - getUserSessions, - invalidateSessions, -} = require("@budibase/backend-core/sessions") - -exports.fetch = async ctx => { - ctx.body = await getAllSessions() -} - -exports.find = async ctx => { - const { userId } = ctx.params - const sessions = await getUserSessions(userId) - ctx.body = sessions.map(session => session.value) -} - -exports.invalidateUser = async ctx => { - const { userId } = ctx.params - await invalidateSessions(userId) - ctx.body = { - message: "User sessions invalidated", - } -} - -exports.selfSessions = async ctx => { - const userId = ctx.user._id - ctx.body = await getUserSessions(userId) -} - -exports.invalidateSession = async ctx => { - const userId = ctx.user._id - const { sessionId } = ctx.params - await invalidateSessions(userId, sessionId) - ctx.body = { - message: "Session invalidated successfully.", - } -} diff --git a/packages/worker/src/api/routes/global/sessions.js b/packages/worker/src/api/routes/global/sessions.js deleted file mode 100644 index 6ab4ad8e59..0000000000 --- a/packages/worker/src/api/routes/global/sessions.js +++ /dev/null @@ -1,14 +0,0 @@ -const Router = require("@koa/router") -const controller = require("../../controllers/global/sessions") -const { adminOnly } = require("@budibase/backend-core/auth") - -const router = Router() - -router - .get("/api/global/sessions", adminOnly, controller.fetch) - .get("/api/global/sessions/self", controller.selfSessions) - .get("/api/global/sessions/:userId", adminOnly, controller.find) - .delete("/api/global/sessions/:userId", adminOnly, controller.invalidateUser) - .delete("/api/global/sessions/self/:sessionId", controller.invalidateSession) - -module.exports = router diff --git a/packages/worker/src/api/routes/index.js b/packages/worker/src/api/routes/index.js index e112d4def3..550d14a9a3 100644 --- a/packages/worker/src/api/routes/index.js +++ b/packages/worker/src/api/routes/index.js @@ -6,7 +6,6 @@ const templateRoutes = require("./global/templates") const emailRoutes = require("./global/email") const authRoutes = require("./global/auth") const roleRoutes = require("./global/roles") -const sessionRoutes = require("./global/sessions") const environmentRoutes = require("./system/environment") const tenantsRoutes = require("./system/tenants") const statusRoutes = require("./system/status") @@ -23,7 +22,6 @@ exports.routes = [ templateRoutes, tenantsRoutes, emailRoutes, - sessionRoutes, roleRoutes, environmentRoutes, statusRoutes, From e621f6075692dbf38e824fe569616de51d7206cb Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 10:40:20 +0000 Subject: [PATCH 13/33] v1.2.13 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index b82f3faeed..2ff12b486b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.12", + "version": "1.2.13", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 486cd68812..fa96af9e42 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.12", + "version": "1.2.13", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.12", + "@budibase/types": "^1.2.13", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 417940aa58..4812e67883 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": "1.2.12", + "version": "1.2.13", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.12", + "@budibase/string-templates": "^1.2.13", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 3688514c28..98d09c9095 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.12", + "version": "1.2.13", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.12", - "@budibase/client": "^1.2.12", - "@budibase/frontend-core": "^1.2.12", - "@budibase/string-templates": "^1.2.12", + "@budibase/bbui": "^1.2.13", + "@budibase/client": "^1.2.13", + "@budibase/frontend-core": "^1.2.13", + "@budibase/string-templates": "^1.2.13", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index c24c32ad15..710fadefa2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.12", + "version": "1.2.13", "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 7cdc66413d..876164fdb0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.12", + "version": "1.2.13", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.12", - "@budibase/frontend-core": "^1.2.12", - "@budibase/string-templates": "^1.2.12", + "@budibase/bbui": "^1.2.13", + "@budibase/frontend-core": "^1.2.13", + "@budibase/string-templates": "^1.2.13", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 9561d43369..2ebf026a6c 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.12", + "version": "1.2.13", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.12", + "@budibase/bbui": "^1.2.13", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 53035aa8f4..5547eb6437 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.12", + "version": "1.2.13", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.12", - "@budibase/client": "^1.2.12", + "@budibase/backend-core": "^1.2.13", + "@budibase/client": "^1.2.13", "@budibase/pro": "1.2.12", - "@budibase/string-templates": "^1.2.12", - "@budibase/types": "^1.2.12", + "@budibase/string-templates": "^1.2.13", + "@budibase/types": "^1.2.13", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index d832e5a32f..738e25329d 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.12", + "version": "1.2.13", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 4ddb558c52..8da39585d1 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.12", + "version": "1.2.13", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 9878464237..062fb76565 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.12", + "version": "1.2.13", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.12", + "@budibase/backend-core": "^1.2.13", "@budibase/pro": "1.2.12", - "@budibase/string-templates": "^1.2.12", - "@budibase/types": "^1.2.12", + "@budibase/string-templates": "^1.2.13", + "@budibase/types": "^1.2.13", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 1c92cdfdbd6feaddd4463f9ea77ceed2ca174eaa Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 10:43:53 +0000 Subject: [PATCH 14/33] Update pro version to 1.2.13 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 5547eb6437..6693256062 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.13", "@budibase/client": "^1.2.13", - "@budibase/pro": "1.2.12", + "@budibase/pro": "1.2.13", "@budibase/string-templates": "^1.2.13", "@budibase/types": "^1.2.13", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 426e5f9b07..2e64257b27 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.12.tgz#a09ef7c4b7d1217b65e385199f2d044d1f30f450" - integrity sha512-o6tsX9bfpMLfAEfxBI4StC6Lvt1PkJ6b0JYlgp8QiXa0WxZX7np24cOxt2fWrP3ASIMDCrzLn2e3k3eOnzvh8w== +"@budibase/backend-core@1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.13.tgz#0539c03738d137c93e26679d7639d644bb2b77b0" + integrity sha512-Ic24IoTjZBB5QIfHLbYPgvWTkKwXCpqln5dImHdDVKVLMJvAmokzSrNX4k5CNRGX/MjROb9rZESWLEmX91hFjQ== dependencies: - "@budibase/types" "^1.2.12" + "@budibase/types" "^1.2.13" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.12.tgz#252f8f1c6730a3395d9d340f2e843052bf0293bb" - integrity sha512-1zhMMVBCX+VX/ILPlSbI7tdsQLcrxf1W29IQD4W55AbevlFnpQs4qNVveIdXFm+GWvCJbdN5I26CXBOftbVUhA== +"@budibase/pro@1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.13.tgz#73071eaa17cba176d99a6d4c22ec437fe39f2484" + integrity sha512-0MSEnx/3hTpgOCtJEcGCVt4gvo4QBwdyr1/wPJZPDPJUNIeOOxxj+FJtVJ7DLOOt6cd927Zqf6E4QwK5fp8/FA== dependencies: - "@budibase/backend-core" "1.2.12" - "@budibase/types" "1.2.12" + "@budibase/backend-core" "1.2.13" + "@budibase/types" "1.2.13" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.12", "@budibase/types@^1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.12.tgz#c460d1b39116538e47e00178116ad066aa6a6f1c" - integrity sha512-EeWadHUzeLx4X27Pv6XWlpSXbeLIMvg7r+Q52kYyOZFkmjtdCNFQW5PCu1bYUw9L1Xa64t7fvRLjKiNs2xGX7g== +"@budibase/types@1.2.13", "@budibase/types@^1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.13.tgz#d28ed3c22ec30a9a9f083cdd6255e6020ff35c0b" + integrity sha512-QLbdtpkPCU1Xlb8GopWhUbfqqWSqAjTVEau1sZJl9tq5T6KT1qlMn/7mUo0lbbQksbJwdINSO+aHSaBImzg8kA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 062fb76565..30660f622b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.13", - "@budibase/pro": "1.2.12", + "@budibase/pro": "1.2.13", "@budibase/string-templates": "^1.2.13", "@budibase/types": "^1.2.13", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 0241459cf4..f156541d2f 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.12.tgz#a09ef7c4b7d1217b65e385199f2d044d1f30f450" - integrity sha512-o6tsX9bfpMLfAEfxBI4StC6Lvt1PkJ6b0JYlgp8QiXa0WxZX7np24cOxt2fWrP3ASIMDCrzLn2e3k3eOnzvh8w== +"@budibase/backend-core@1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.13.tgz#0539c03738d137c93e26679d7639d644bb2b77b0" + integrity sha512-Ic24IoTjZBB5QIfHLbYPgvWTkKwXCpqln5dImHdDVKVLMJvAmokzSrNX4k5CNRGX/MjROb9rZESWLEmX91hFjQ== dependencies: - "@budibase/types" "^1.2.12" + "@budibase/types" "^1.2.13" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.12.tgz#252f8f1c6730a3395d9d340f2e843052bf0293bb" - integrity sha512-1zhMMVBCX+VX/ILPlSbI7tdsQLcrxf1W29IQD4W55AbevlFnpQs4qNVveIdXFm+GWvCJbdN5I26CXBOftbVUhA== +"@budibase/pro@1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.13.tgz#73071eaa17cba176d99a6d4c22ec437fe39f2484" + integrity sha512-0MSEnx/3hTpgOCtJEcGCVt4gvo4QBwdyr1/wPJZPDPJUNIeOOxxj+FJtVJ7DLOOt6cd927Zqf6E4QwK5fp8/FA== dependencies: - "@budibase/backend-core" "1.2.12" - "@budibase/types" "1.2.12" + "@budibase/backend-core" "1.2.13" + "@budibase/types" "1.2.13" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.12", "@budibase/types@^1.2.12": - version "1.2.12" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.12.tgz#c460d1b39116538e47e00178116ad066aa6a6f1c" - integrity sha512-EeWadHUzeLx4X27Pv6XWlpSXbeLIMvg7r+Q52kYyOZFkmjtdCNFQW5PCu1bYUw9L1Xa64t7fvRLjKiNs2xGX7g== +"@budibase/types@1.2.13", "@budibase/types@^1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.13.tgz#d28ed3c22ec30a9a9f083cdd6255e6020ff35c0b" + integrity sha512-QLbdtpkPCU1Xlb8GopWhUbfqqWSqAjTVEau1sZJl9tq5T6KT1qlMn/7mUo0lbbQksbJwdINSO+aHSaBImzg8kA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 24d1c27760855f14f6893c2f0d5cb696b2cbc2ca Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 12:00:58 +0000 Subject: [PATCH 15/33] v1.2.14 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 2ff12b486b..8ce0e0c314 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.13", + "version": "1.2.14", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index fa96af9e42..6081d5b8e6 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.13", + "version": "1.2.14", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.13", + "@budibase/types": "^1.2.14", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4812e67883..342e65583d 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": "1.2.13", + "version": "1.2.14", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.13", + "@budibase/string-templates": "^1.2.14", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 98d09c9095..a5f1e5ecd6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.13", + "version": "1.2.14", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.13", - "@budibase/client": "^1.2.13", - "@budibase/frontend-core": "^1.2.13", - "@budibase/string-templates": "^1.2.13", + "@budibase/bbui": "^1.2.14", + "@budibase/client": "^1.2.14", + "@budibase/frontend-core": "^1.2.14", + "@budibase/string-templates": "^1.2.14", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 710fadefa2..b94d8ef4fb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.13", + "version": "1.2.14", "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 876164fdb0..4e2daac226 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.13", + "version": "1.2.14", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.13", - "@budibase/frontend-core": "^1.2.13", - "@budibase/string-templates": "^1.2.13", + "@budibase/bbui": "^1.2.14", + "@budibase/frontend-core": "^1.2.14", + "@budibase/string-templates": "^1.2.14", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 2ebf026a6c..3d8e52cf74 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.13", + "version": "1.2.14", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.13", + "@budibase/bbui": "^1.2.14", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6693256062..ce41280450 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.13", + "version": "1.2.14", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.13", - "@budibase/client": "^1.2.13", + "@budibase/backend-core": "^1.2.14", + "@budibase/client": "^1.2.14", "@budibase/pro": "1.2.13", - "@budibase/string-templates": "^1.2.13", - "@budibase/types": "^1.2.13", + "@budibase/string-templates": "^1.2.14", + "@budibase/types": "^1.2.14", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 738e25329d..5d859902b5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.13", + "version": "1.2.14", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 8da39585d1..c62ed636d1 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.13", + "version": "1.2.14", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 30660f622b..3d22c5df76 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.13", + "version": "1.2.14", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.13", + "@budibase/backend-core": "^1.2.14", "@budibase/pro": "1.2.13", - "@budibase/string-templates": "^1.2.13", - "@budibase/types": "^1.2.13", + "@budibase/string-templates": "^1.2.14", + "@budibase/types": "^1.2.14", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 29c0e07b7ec78041a0be686ee0dfdca5776bf035 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 12:04:48 +0000 Subject: [PATCH 16/33] Update pro version to 1.2.14 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index ce41280450..9052ea132e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.14", "@budibase/client": "^1.2.14", - "@budibase/pro": "1.2.13", + "@budibase/pro": "1.2.14", "@budibase/string-templates": "^1.2.14", "@budibase/types": "^1.2.14", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 2e64257b27..2d7a376ab1 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.13.tgz#0539c03738d137c93e26679d7639d644bb2b77b0" - integrity sha512-Ic24IoTjZBB5QIfHLbYPgvWTkKwXCpqln5dImHdDVKVLMJvAmokzSrNX4k5CNRGX/MjROb9rZESWLEmX91hFjQ== +"@budibase/backend-core@1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.14.tgz#1aca6a82b8ac28f5c101721ba4596f674eb57197" + integrity sha512-870ZzNX13/f1U7qkUJUoKp/e8UQqDHEc0TZBBaWcpLXbEBs6ikxGp5YdYGEVXkr/ca4rusfHs6jAjUNkIPThow== dependencies: - "@budibase/types" "^1.2.13" + "@budibase/types" "^1.2.14" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.13.tgz#73071eaa17cba176d99a6d4c22ec437fe39f2484" - integrity sha512-0MSEnx/3hTpgOCtJEcGCVt4gvo4QBwdyr1/wPJZPDPJUNIeOOxxj+FJtVJ7DLOOt6cd927Zqf6E4QwK5fp8/FA== +"@budibase/pro@1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.14.tgz#bce72c8a0d48dbec8dc6aa4af47abb9dbfd3d029" + integrity sha512-nYyVHO1IaoDRFSrLp0ueKWG0/Z+PSRs3yF+OZ7vQaECCXXSgWnZyCOy9o6iIovUlbimbPxrQvkwcL8v4deWuvQ== dependencies: - "@budibase/backend-core" "1.2.13" - "@budibase/types" "1.2.13" + "@budibase/backend-core" "1.2.14" + "@budibase/types" "1.2.14" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.13", "@budibase/types@^1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.13.tgz#d28ed3c22ec30a9a9f083cdd6255e6020ff35c0b" - integrity sha512-QLbdtpkPCU1Xlb8GopWhUbfqqWSqAjTVEau1sZJl9tq5T6KT1qlMn/7mUo0lbbQksbJwdINSO+aHSaBImzg8kA== +"@budibase/types@1.2.14", "@budibase/types@^1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.14.tgz#8ef2d1b526661629dd9db2f10fea515fadfdcc53" + integrity sha512-E3k1kJz24W0l1aw1cL2Edf7WnO6Nt6iew4stDpuQjG2r1EcXPv6/hPsRA7Ms0331ZjGKEswaddSyF5NTn1O8VQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 3d22c5df76..70afd899e8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.14", - "@budibase/pro": "1.2.13", + "@budibase/pro": "1.2.14", "@budibase/string-templates": "^1.2.14", "@budibase/types": "^1.2.14", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index f156541d2f..e03cbaf580 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.13.tgz#0539c03738d137c93e26679d7639d644bb2b77b0" - integrity sha512-Ic24IoTjZBB5QIfHLbYPgvWTkKwXCpqln5dImHdDVKVLMJvAmokzSrNX4k5CNRGX/MjROb9rZESWLEmX91hFjQ== +"@budibase/backend-core@1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.14.tgz#1aca6a82b8ac28f5c101721ba4596f674eb57197" + integrity sha512-870ZzNX13/f1U7qkUJUoKp/e8UQqDHEc0TZBBaWcpLXbEBs6ikxGp5YdYGEVXkr/ca4rusfHs6jAjUNkIPThow== dependencies: - "@budibase/types" "^1.2.13" + "@budibase/types" "^1.2.14" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.13.tgz#73071eaa17cba176d99a6d4c22ec437fe39f2484" - integrity sha512-0MSEnx/3hTpgOCtJEcGCVt4gvo4QBwdyr1/wPJZPDPJUNIeOOxxj+FJtVJ7DLOOt6cd927Zqf6E4QwK5fp8/FA== +"@budibase/pro@1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.14.tgz#bce72c8a0d48dbec8dc6aa4af47abb9dbfd3d029" + integrity sha512-nYyVHO1IaoDRFSrLp0ueKWG0/Z+PSRs3yF+OZ7vQaECCXXSgWnZyCOy9o6iIovUlbimbPxrQvkwcL8v4deWuvQ== dependencies: - "@budibase/backend-core" "1.2.13" - "@budibase/types" "1.2.13" + "@budibase/backend-core" "1.2.14" + "@budibase/types" "1.2.14" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.13", "@budibase/types@^1.2.13": - version "1.2.13" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.13.tgz#d28ed3c22ec30a9a9f083cdd6255e6020ff35c0b" - integrity sha512-QLbdtpkPCU1Xlb8GopWhUbfqqWSqAjTVEau1sZJl9tq5T6KT1qlMn/7mUo0lbbQksbJwdINSO+aHSaBImzg8kA== +"@budibase/types@1.2.14", "@budibase/types@^1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.14.tgz#8ef2d1b526661629dd9db2f10fea515fadfdcc53" + integrity sha512-E3k1kJz24W0l1aw1cL2Edf7WnO6Nt6iew4stDpuQjG2r1EcXPv6/hPsRA7Ms0331ZjGKEswaddSyF5NTn1O8VQ== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 61d46062b77f52c35dd1129c80d7c9da14f0f2d5 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 5 Aug 2022 14:53:41 +0100 Subject: [PATCH 17/33] Handle non-array values --- .../client/src/components/app/forms/RelationshipField.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index 2c1136bea3..ce2f194786 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -55,6 +55,9 @@ if (!values) { return [] } + if (!Array.isArray(values)) { + values = [values] + } return values.map(value => (typeof value === "object" ? value._id : value)) } From ba0e423fb91bfb4a07ec5f0edfb08122dad3c69e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Aug 2022 15:21:12 +0100 Subject: [PATCH 18/33] Updating authenticated middleware to typescript and updating the TTL once per minute rather than every API request. --- .../{authenticated.js => authenticated.ts} | 63 +++++++++++-------- 1 file changed, 38 insertions(+), 25 deletions(-) rename packages/backend-core/src/middleware/{authenticated.js => authenticated.ts} (76%) diff --git a/packages/backend-core/src/middleware/authenticated.js b/packages/backend-core/src/middleware/authenticated.ts similarity index 76% rename from packages/backend-core/src/middleware/authenticated.js rename to packages/backend-core/src/middleware/authenticated.ts index 674c16aa55..e5b2232a42 100644 --- a/packages/backend-core/src/middleware/authenticated.js +++ b/packages/backend-core/src/middleware/authenticated.ts @@ -1,28 +1,39 @@ -const { Cookies, Headers } = require("../constants") -const { getCookie, clearCookie, openJwt } = require("../utils") -const { getUser } = require("../cache/user") -const { getSession, updateSessionTTL } = require("../security/sessions") -const { buildMatcherRegex, matches } = require("./matchers") -const env = require("../environment") -const { SEPARATOR } = require("../db/constants") -const { ViewNames } = require("../db/utils") -const { queryGlobalView } = require("../db/views") -const { getGlobalDB, doInTenant } = require("../tenancy") -const { decrypt } = require("../security/encryption") +import { Cookies, Headers } from "../constants" +import { getCookie, clearCookie, openJwt } from "../utils" +import { getUser } from "../cache/user" +import { getSession, updateSessionTTL } from "../security/sessions" +import { buildMatcherRegex, matches } from "./matchers" +import { SEPARATOR } from "../db/constants" +import { ViewNames } from "../db/utils" +import { queryGlobalView } from "../db/views" +import { getGlobalDB, doInTenant } from "../tenancy" +import { decrypt } from "../security/encryption" const identity = require("../context/identity") +const env = require("../environment") -function finalise( - ctx, - { authenticated, user, internal, version, publicEndpoint } = {} -) { - ctx.publicEndpoint = publicEndpoint || false - ctx.isAuthenticated = authenticated || false - ctx.user = user - ctx.internal = internal || false - ctx.version = version +const ONE_MINUTE = 60 * 1000 + +interface FinaliseOpts { + authenticated?: boolean + internal?: boolean + publicEndpoint?: boolean + version?: string + user?: any } -async function checkApiKey(apiKey, populateUser) { +function timeMinusOneMinute() { + return new Date(Date.now() - ONE_MINUTE).toISOString() +} + +function finalise(ctx: any, opts: FinaliseOpts = {}) { + ctx.publicEndpoint = opts.publicEndpoint || false + ctx.isAuthenticated = opts.authenticated || false + ctx.user = opts.user + ctx.internal = opts.internal || false + ctx.version = opts.version +} + +async function checkApiKey(apiKey: string, populateUser?: Function) { if (apiKey === env.INTERNAL_API_KEY) { return { valid: true } } @@ -56,10 +67,12 @@ async function checkApiKey(apiKey, populateUser) { */ module.exports = ( noAuthPatterns = [], - opts = { publicAllowed: false, populateUser: null } + opts: { publicAllowed: boolean; populateUser?: Function } = { + publicAllowed: false, + } ) => { const noAuthOptions = noAuthPatterns ? buildMatcherRegex(noAuthPatterns) : [] - return async (ctx, next) => { + return async (ctx: any, next: any) => { let publicEndpoint = false const version = ctx.request.headers[Headers.API_VER] // the path is not authenticated @@ -103,7 +116,7 @@ module.exports = ( console.error("Auth Error", error) // remove the cookie as the user does not exist anymore clearCookie(ctx, Cookies.Auth) - } else { + } else if (session?.lastAccessedAt < timeMinusOneMinute()) { // make sure we denote that the session is still in use await updateSessionTTL(session) } @@ -142,7 +155,7 @@ module.exports = ( } else { return next() } - } catch (err) { + } catch (err: any) { // invalid token, clear the cookie if (err && err.name === "JsonWebTokenError") { clearCookie(ctx, Cookies.Auth) From 1f3b1b675f3fbd5a24c5605f3543a595e241ab6b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 5 Aug 2022 16:06:16 +0100 Subject: [PATCH 19/33] Insert table ID back into query for follow-up pagination query --- packages/server/src/api/controllers/row/internalSearch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index 8a04fc2bd0..522d1c55c7 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -423,6 +423,7 @@ exports.paginatedSearch = async (query, params) => { // Try fetching 1 row in the next page to see if another page of results // exists or not const nextResults = await search + .setTable(params.tableId) .setBookmark(searchResults.bookmark) .setLimit(1) .run() From a2f18e2e4446a8dd80feb23d930652e054e5502a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Aug 2022 17:13:03 +0100 Subject: [PATCH 20/33] Updating sessions to TS, adding env var to set the session update length, adding reasons for invalidation, making sure errors are never considered authenticated. --- packages/backend-core/src/environment.ts | 1 + packages/backend-core/src/index.ts | 2 +- .../src/middleware/authenticated.ts | 8 +-- .../src/security/{sessions.js => sessions.ts} | 62 ++++++++++++------- packages/backend-core/src/utils.js | 13 ++-- packages/server/src/environment.js | 1 + packages/worker/src/environment.js | 1 + packages/worker/src/sdk/users/users.ts | 16 ++--- 8 files changed, 62 insertions(+), 42 deletions(-) rename packages/backend-core/src/security/{sessions.js => sessions.ts} (63%) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 51cc721ded..0348d921ab 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -56,6 +56,7 @@ const env = { SERVICE: process.env.SERVICE || "budibase", MEMORY_LEAK_CHECK: process.env.MEMORY_LEAK_CHECK || false, LOG_LEVEL: process.env.LOG_LEVEL, + SESSION_UPDATE_PERIOD: process.env.SESSION_UPDATE_PERIOD, DEPLOYMENT_ENVIRONMENT: process.env.DEPLOYMENT_ENVIRONMENT || "docker-compose", _set(key: any, value: any) { diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index ced4630fb7..e585d4b6c3 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -9,7 +9,7 @@ import * as installation from "./installation" import env from "./environment" import tenancy from "./tenancy" import featureFlags from "./featureFlags" -import sessions from "./security/sessions" +import * as sessions from "./security/sessions" import deprovisioning from "./context/deprovision" import auth from "./auth" import constants from "./constants" diff --git a/packages/backend-core/src/middleware/authenticated.ts b/packages/backend-core/src/middleware/authenticated.ts index e5b2232a42..7280eba294 100644 --- a/packages/backend-core/src/middleware/authenticated.ts +++ b/packages/backend-core/src/middleware/authenticated.ts @@ -11,7 +11,7 @@ import { decrypt } from "../security/encryption" const identity = require("../context/identity") const env = require("../environment") -const ONE_MINUTE = 60 * 1000 +const ONE_MINUTE = env.SESSION_UPDATE_PERIOD || 60 * 1000 interface FinaliseOpts { authenticated?: boolean @@ -86,9 +86,9 @@ module.exports = ( const authCookie = getCookie(ctx, Cookies.Auth) || openJwt(headerToken) let authenticated = false, user = null, - internal = false + internal = false, + error = null if (authCookie) { - let error = null const sessionId = authCookie.sessionId const userId = authCookie.userId @@ -144,7 +144,7 @@ module.exports = ( delete user.password } // be explicit - if (authenticated !== true) { + if (error || authenticated !== true) { authenticated = false } // isAuthenticated is a function, so use a variable to be able to check authed state diff --git a/packages/backend-core/src/security/sessions.js b/packages/backend-core/src/security/sessions.ts similarity index 63% rename from packages/backend-core/src/security/sessions.js rename to packages/backend-core/src/security/sessions.ts index a3be0a1a58..f8375f510b 100644 --- a/packages/backend-core/src/security/sessions.js +++ b/packages/backend-core/src/security/sessions.ts @@ -3,34 +3,51 @@ const { v4: uuidv4 } = require("uuid") const { logWarn } = require("../logging") const env = require("../environment") +interface Session { + key: string + userId: string + sessionId: string + lastAccessedAt: string + createdAt: string + csrfToken?: string + value: string +} + +type SessionKey = { key: string }[] + // a week in seconds const EXPIRY_SECONDS = 86400 * 7 -async function getSessionsForUser(userId) { - const client = await redis.getSessionClient() - const sessions = await client.scan(userId) - return sessions.map(session => session.value) -} - -function makeSessionID(userId, sessionId) { +function makeSessionID(userId: string, sessionId: string) { return `${userId}/${sessionId}` } -async function invalidateSessions(userId, sessionIds = null) { +export async function getSessionsForUser(userId: string) { + const client = await redis.getSessionClient() + const sessions = await client.scan(userId) + return sessions.map((session: Session) => session.value) +} + +export async function invalidateSessions( + userId: string, + opts: { sessionIds?: string[]; reason?: string } = {} +) { try { - let sessions = [] + const reason = opts?.reason || "unknown" + let sessionIds: string[] = opts.sessionIds || [] + let sessions: SessionKey // If no sessionIds, get all the sessions for the user if (!sessionIds) { sessions = await getSessionsForUser(userId) sessions.forEach( - session => + (session: any) => (session.key = makeSessionID(session.userId, session.sessionId)) ) } else { // use the passed array of sessionIds - sessions = Array.isArray(sessionIds) ? sessionIds : [sessionIds] - sessions = sessions.map(sessionId => ({ + sessionIds = Array.isArray(sessionIds) ? sessionIds : [sessionIds] + sessions = sessionIds.map((sessionId: string) => ({ key: makeSessionID(userId, sessionId), })) } @@ -43,7 +60,7 @@ async function invalidateSessions(userId, sessionIds = null) { } if (!env.isTest()) { logWarn( - `Invalidating sessions for ${userId} - ${sessions + `Invalidating sessions for ${userId} (reason: ${reason}) - ${sessions .map(session => session.key) .join(", ")}` ) @@ -55,9 +72,9 @@ async function invalidateSessions(userId, sessionIds = null) { } } -exports.createASession = async (userId, session) => { +export async function createASession(userId: string, session: Session) { // invalidate all other sessions - await invalidateSessions(userId) + await invalidateSessions(userId, { reason: "creation" }) const client = await redis.getSessionClient() const sessionId = session.sessionId @@ -65,27 +82,27 @@ exports.createASession = async (userId, session) => { session.csrfToken = uuidv4() } session = { + ...session, createdAt: new Date().toISOString(), lastAccessedAt: new Date().toISOString(), - ...session, userId, } await client.store(makeSessionID(userId, sessionId), session, EXPIRY_SECONDS) } -exports.updateSessionTTL = async session => { +export async function updateSessionTTL(session: Session) { const client = await redis.getSessionClient() const key = makeSessionID(session.userId, session.sessionId) session.lastAccessedAt = new Date().toISOString() await client.store(key, session, EXPIRY_SECONDS) } -exports.endSession = async (userId, sessionId) => { +export async function endSession(userId: string, sessionId: string) { const client = await redis.getSessionClient() await client.delete(makeSessionID(userId, sessionId)) } -exports.getSession = async (userId, sessionId) => { +export async function getSession(userId: string, sessionId: string) { try { const client = await redis.getSessionClient() return client.get(makeSessionID(userId, sessionId)) @@ -96,11 +113,8 @@ exports.getSession = async (userId, sessionId) => { } } -exports.getAllSessions = async () => { +export async function getAllSessions() { const client = await redis.getSessionClient() const sessions = await client.scan() - return sessions.map(session => session.value) + return sessions.map((session: Session) => session.value) } - -exports.getUserSessions = getSessionsForUser -exports.invalidateSessions = invalidateSessions diff --git a/packages/backend-core/src/utils.js b/packages/backend-core/src/utils.js index cf32539c58..1e143968d9 100644 --- a/packages/backend-core/src/utils.js +++ b/packages/backend-core/src/utils.js @@ -10,7 +10,10 @@ const { queryGlobalView } = require("./db/views") const { Headers, Cookies, MAX_VALID_DATE } = require("./constants") const env = require("./environment") const userCache = require("./cache/user") -const { getUserSessions, invalidateSessions } = require("./security/sessions") +const { + getSessionsForUser, + invalidateSessions, +} = require("./security/sessions") const events = require("./events") const tenancy = require("./tenancy") @@ -178,7 +181,7 @@ exports.platformLogout = async ({ ctx, userId, keepActiveSession }) => { if (!ctx) throw new Error("Koa context must be supplied to logout.") const currentSession = exports.getCookie(ctx, Cookies.Auth) - let sessions = await getUserSessions(userId) + let sessions = await getSessionsForUser(userId) if (keepActiveSession) { sessions = sessions.filter( @@ -190,10 +193,8 @@ exports.platformLogout = async ({ ctx, userId, keepActiveSession }) => { exports.clearCookie(ctx, Cookies.CurrentApp) } - await invalidateSessions( - userId, - sessions.map(({ sessionId }) => sessionId) - ) + const sessionIds = sessions.map(({ sessionId }) => sessionId) + await invalidateSessions(userId, { sessionIds, reason: "logout" }) await events.auth.logout() await userCache.invalidateUser(userId) } diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 99d099f8d5..c2e2815e00 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -63,6 +63,7 @@ module.exports = { DISABLE_ACCOUNT_PORTAL: process.env.DISABLE_ACCOUNT_PORTAL, TEMPLATE_REPOSITORY: process.env.TEMPLATE_REPOSITORY || "app", DISABLE_AUTO_PROD_APP_SYNC: process.env.DISABLE_AUTO_PROD_APP_SYNC, + SESSION_UPDATE_PERIOD: process.env.SESSION_UPDATE_PERIOD, // minor SALT_ROUNDS: process.env.SALT_ROUNDS, LOGGER: process.env.LOGGER, diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 4c3cab1cab..bb45c1dd78 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -61,6 +61,7 @@ module.exports = { SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, // other CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 3600, + SESSION_UPDATE_PERIOD: process.env.SESSION_UPDATE_PERIOD, _set(key, value) { process.env[key] = value module.exports[key] = value diff --git a/packages/worker/src/sdk/users/users.ts b/packages/worker/src/sdk/users/users.ts index e6b3f0a21d..58c2decabf 100644 --- a/packages/worker/src/sdk/users/users.ts +++ b/packages/worker/src/sdk/users/users.ts @@ -370,6 +370,7 @@ export const bulkDelete = async (userIds: any) => { export const destroy = async (id: string, currentUser: any) => { const db = tenancy.getGlobalDB() const dbUser = await db.get(id) + const userId = dbUser._id as string let groups = dbUser.userGroups if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { @@ -387,7 +388,7 @@ export const destroy = async (id: string, currentUser: any) => { await deprovisioning.removeUserFromInfoDB(dbUser) - await db.remove(dbUser._id, dbUser._rev) + await db.remove(userId, dbUser._rev) if (groups) { await groupUtils.deleteGroupUsers(groups, dbUser) @@ -395,17 +396,18 @@ export const destroy = async (id: string, currentUser: any) => { await eventHelpers.handleDeleteEvents(dbUser) await quotas.removeUser(dbUser) - await cache.user.invalidateUser(dbUser._id) - await sessions.invalidateSessions(dbUser._id) + await cache.user.invalidateUser(userId) + await sessions.invalidateSessions(userId, { reason: "deletion" }) // let server know to sync user - await apps.syncUserInApps(dbUser._id) + await apps.syncUserInApps(userId) } const bulkDeleteProcessing = async (dbUser: User) => { + const userId = dbUser._id as string await deprovisioning.removeUserFromInfoDB(dbUser) await eventHelpers.handleDeleteEvents(dbUser) - await cache.user.invalidateUser(dbUser._id) - await sessions.invalidateSessions(dbUser._id) + await cache.user.invalidateUser(userId) + await sessions.invalidateSessions(userId, { reason: "bulk-deletion" }) // let server know to sync user - await apps.syncUserInApps(dbUser._id) + await apps.syncUserInApps(userId) } From eeaccdae1af2cd28b68f6fdd8ad8c871a836af1e Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 16:45:30 +0000 Subject: [PATCH 21/33] v1.2.15 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 8ce0e0c314..c785ec1257 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.14", + "version": "1.2.15", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 6081d5b8e6..be74358881 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.14", + "version": "1.2.15", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.14", + "@budibase/types": "^1.2.15", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 342e65583d..b0b280c3df 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": "1.2.14", + "version": "1.2.15", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.14", + "@budibase/string-templates": "^1.2.15", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index a5f1e5ecd6..30f691264d 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.14", + "version": "1.2.15", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.14", - "@budibase/client": "^1.2.14", - "@budibase/frontend-core": "^1.2.14", - "@budibase/string-templates": "^1.2.14", + "@budibase/bbui": "^1.2.15", + "@budibase/client": "^1.2.15", + "@budibase/frontend-core": "^1.2.15", + "@budibase/string-templates": "^1.2.15", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index b94d8ef4fb..b59e50039c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.14", + "version": "1.2.15", "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 4e2daac226..b749dfbc3b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.14", + "version": "1.2.15", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.14", - "@budibase/frontend-core": "^1.2.14", - "@budibase/string-templates": "^1.2.14", + "@budibase/bbui": "^1.2.15", + "@budibase/frontend-core": "^1.2.15", + "@budibase/string-templates": "^1.2.15", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 3d8e52cf74..7882d0edf9 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.14", + "version": "1.2.15", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.14", + "@budibase/bbui": "^1.2.15", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 9052ea132e..b481b472bb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.14", + "version": "1.2.15", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.14", - "@budibase/client": "^1.2.14", + "@budibase/backend-core": "^1.2.15", + "@budibase/client": "^1.2.15", "@budibase/pro": "1.2.14", - "@budibase/string-templates": "^1.2.14", - "@budibase/types": "^1.2.14", + "@budibase/string-templates": "^1.2.15", + "@budibase/types": "^1.2.15", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5d859902b5..081c731975 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.14", + "version": "1.2.15", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index c62ed636d1..8c7e14866a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.14", + "version": "1.2.15", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 70afd899e8..7d86bea820 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.14", + "version": "1.2.15", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.14", + "@budibase/backend-core": "^1.2.15", "@budibase/pro": "1.2.14", - "@budibase/string-templates": "^1.2.14", - "@budibase/types": "^1.2.14", + "@budibase/string-templates": "^1.2.15", + "@budibase/types": "^1.2.15", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 13e2a56f37a28c6411a345978aa5fd3c01f3253d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 16:48:53 +0000 Subject: [PATCH 22/33] Update pro version to 1.2.15 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index b481b472bb..2167fca297 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.15", "@budibase/client": "^1.2.15", - "@budibase/pro": "1.2.14", + "@budibase/pro": "1.2.15", "@budibase/string-templates": "^1.2.15", "@budibase/types": "^1.2.15", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 2d7a376ab1..9969370e24 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.14.tgz#1aca6a82b8ac28f5c101721ba4596f674eb57197" - integrity sha512-870ZzNX13/f1U7qkUJUoKp/e8UQqDHEc0TZBBaWcpLXbEBs6ikxGp5YdYGEVXkr/ca4rusfHs6jAjUNkIPThow== +"@budibase/backend-core@1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.15.tgz#d9884b5a4309bd2530323291e98ede5acae62de1" + integrity sha512-LoQhZIgptPwcB7DCbQiIRRBYaQiLYUqB4qGJj3C/SVyZV4ONOiJ8QTfHEtWMaxv5bXKJF+wALbKXOoNeWGF9Ow== dependencies: - "@budibase/types" "^1.2.14" + "@budibase/types" "^1.2.15" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.14.tgz#bce72c8a0d48dbec8dc6aa4af47abb9dbfd3d029" - integrity sha512-nYyVHO1IaoDRFSrLp0ueKWG0/Z+PSRs3yF+OZ7vQaECCXXSgWnZyCOy9o6iIovUlbimbPxrQvkwcL8v4deWuvQ== +"@budibase/pro@1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.15.tgz#88fd20dc502b9cbfef544cb66a05f57a7256ef92" + integrity sha512-mzaYKzQmLuyq1lzjfktvxKn0FOVmKx+AM62JaI6SxuPsvsFqJ9SdGpD2XUOZ+b8sdezHJxCEd9KyAryik8fSOA== dependencies: - "@budibase/backend-core" "1.2.14" - "@budibase/types" "1.2.14" + "@budibase/backend-core" "1.2.15" + "@budibase/types" "1.2.15" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.14", "@budibase/types@^1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.14.tgz#8ef2d1b526661629dd9db2f10fea515fadfdcc53" - integrity sha512-E3k1kJz24W0l1aw1cL2Edf7WnO6Nt6iew4stDpuQjG2r1EcXPv6/hPsRA7Ms0331ZjGKEswaddSyF5NTn1O8VQ== +"@budibase/types@1.2.15", "@budibase/types@^1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.15.tgz#99e66d14f1cab8e5403f98e0dd097d1030ed8d5d" + integrity sha512-8WbponGlP0E0/mQh27GnWhY5jdR36kQ/rUzK1km4/ZZju7E88lM20DQE4yuUnTf2xbBihTR2gpAQpiOTPCI+7Q== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 7d86bea820..1af5eabedf 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.15", - "@budibase/pro": "1.2.14", + "@budibase/pro": "1.2.15", "@budibase/string-templates": "^1.2.15", "@budibase/types": "^1.2.15", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e03cbaf580..45d16eebaa 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.14.tgz#1aca6a82b8ac28f5c101721ba4596f674eb57197" - integrity sha512-870ZzNX13/f1U7qkUJUoKp/e8UQqDHEc0TZBBaWcpLXbEBs6ikxGp5YdYGEVXkr/ca4rusfHs6jAjUNkIPThow== +"@budibase/backend-core@1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.15.tgz#d9884b5a4309bd2530323291e98ede5acae62de1" + integrity sha512-LoQhZIgptPwcB7DCbQiIRRBYaQiLYUqB4qGJj3C/SVyZV4ONOiJ8QTfHEtWMaxv5bXKJF+wALbKXOoNeWGF9Ow== dependencies: - "@budibase/types" "^1.2.14" + "@budibase/types" "^1.2.15" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.14.tgz#bce72c8a0d48dbec8dc6aa4af47abb9dbfd3d029" - integrity sha512-nYyVHO1IaoDRFSrLp0ueKWG0/Z+PSRs3yF+OZ7vQaECCXXSgWnZyCOy9o6iIovUlbimbPxrQvkwcL8v4deWuvQ== +"@budibase/pro@1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.15.tgz#88fd20dc502b9cbfef544cb66a05f57a7256ef92" + integrity sha512-mzaYKzQmLuyq1lzjfktvxKn0FOVmKx+AM62JaI6SxuPsvsFqJ9SdGpD2XUOZ+b8sdezHJxCEd9KyAryik8fSOA== dependencies: - "@budibase/backend-core" "1.2.14" - "@budibase/types" "1.2.14" + "@budibase/backend-core" "1.2.15" + "@budibase/types" "1.2.15" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.14", "@budibase/types@^1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.14.tgz#8ef2d1b526661629dd9db2f10fea515fadfdcc53" - integrity sha512-E3k1kJz24W0l1aw1cL2Edf7WnO6Nt6iew4stDpuQjG2r1EcXPv6/hPsRA7Ms0331ZjGKEswaddSyF5NTn1O8VQ== +"@budibase/types@1.2.15", "@budibase/types@^1.2.15": + version "1.2.15" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.15.tgz#99e66d14f1cab8e5403f98e0dd097d1030ed8d5d" + integrity sha512-8WbponGlP0E0/mQh27GnWhY5jdR36kQ/rUzK1km4/ZZju7E88lM20DQE4yuUnTf2xbBihTR2gpAQpiOTPCI+7Q== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From a24f2157a52f06b3c5c08bf18addcc6aa5be416b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Aug 2022 21:35:26 +0100 Subject: [PATCH 23/33] Some various session fixes based on current data. --- .../src/middleware/authenticated.ts | 71 +++++++++---------- .../backend-core/src/security/sessions.ts | 21 +++--- .../src/utilities/rowProcessor/index.js | 2 +- 3 files changed, 42 insertions(+), 52 deletions(-) diff --git a/packages/backend-core/src/middleware/authenticated.ts b/packages/backend-core/src/middleware/authenticated.ts index 7280eba294..3406b00812 100644 --- a/packages/backend-core/src/middleware/authenticated.ts +++ b/packages/backend-core/src/middleware/authenticated.ts @@ -84,45 +84,40 @@ module.exports = ( // check the actual user is authenticated first, try header or cookie const headerToken = ctx.request.headers[Headers.TOKEN] const authCookie = getCookie(ctx, Cookies.Auth) || openJwt(headerToken) - let authenticated = false, - user = null, - internal = false, - error = null - if (authCookie) { - const sessionId = authCookie.sessionId - const userId = authCookie.userId - - const session = await getSession(userId, sessionId) - if (!session) { - error = `Session not found - ${userId} - ${sessionId}` - } else { - try { - if (opts && opts.populateUser) { - user = await getUser( - userId, - session.tenantId, - opts.populateUser(ctx) - ) - } else { - user = await getUser(userId, session.tenantId) - } - user.csrfToken = session.csrfToken - authenticated = true - } catch (err) { - error = err - } - } - if (error) { - console.error("Auth Error", error) - // remove the cookie as the user does not exist anymore - clearCookie(ctx, Cookies.Auth) - } else if (session?.lastAccessedAt < timeMinusOneMinute()) { - // make sure we denote that the session is still in use - await updateSessionTTL(session) - } - } const apiKey = ctx.request.headers[Headers.API_KEY] const tenantId = ctx.request.headers[Headers.TENANT_ID] + let authenticated = false, + user = null, + internal = false + if (authCookie && !apiKey) { + const sessionId = authCookie.sessionId + const userId = authCookie.userId + let session + try { + // getting session handles error checking (if session exists etc) + session = await getSession(userId, sessionId) + if (opts && opts.populateUser) { + user = await getUser( + userId, + session.tenantId, + opts.populateUser(ctx) + ) + } else { + user = await getUser(userId, session.tenantId) + } + user.csrfToken = session.csrfToken + if (session?.lastAccessedAt < timeMinusOneMinute()) { + // make sure we denote that the session is still in use + await updateSessionTTL(session) + } + authenticated = true + } catch (err: any) { + authenticated = false + console.error("Auth Error", err?.message || err) + // remove the cookie as the user does not exist anymore + clearCookie(ctx, Cookies.Auth) + } + } // this is an internal request, no user made it if (!authenticated && apiKey) { const populateUser = opts.populateUser ? opts.populateUser(ctx) : null @@ -144,7 +139,7 @@ module.exports = ( delete user.password } // be explicit - if (error || authenticated !== true) { + if (authenticated !== true) { authenticated = false } // isAuthenticated is a function, so use a variable to be able to check authed state diff --git a/packages/backend-core/src/security/sessions.ts b/packages/backend-core/src/security/sessions.ts index f8375f510b..39d24ee16a 100644 --- a/packages/backend-core/src/security/sessions.ts +++ b/packages/backend-core/src/security/sessions.ts @@ -38,7 +38,7 @@ export async function invalidateSessions( let sessions: SessionKey // If no sessionIds, get all the sessions for the user - if (!sessionIds) { + if (sessionIds.length === 0) { sessions = await getSessionsForUser(userId) sessions.forEach( (session: any) => @@ -103,18 +103,13 @@ export async function endSession(userId: string, sessionId: string) { } export async function getSession(userId: string, sessionId: string) { - try { - const client = await redis.getSessionClient() - return client.get(makeSessionID(userId, sessionId)) - } catch (err) { - // if can't get session don't error, just don't return anything - console.error(err) - return null + if (!userId || !sessionId) { + throw new Error(`Invalid session details - ${userId} - ${sessionId}`) } -} - -export async function getAllSessions() { const client = await redis.getSessionClient() - const sessions = await client.scan() - return sessions.map((session: Session) => session.value) + const session = await client.get(makeSessionID(userId, sessionId)) + if (!session) { + throw new Error(`Session not found - ${userId} - ${sessionId}`) + } + return session } diff --git a/packages/server/src/utilities/rowProcessor/index.js b/packages/server/src/utilities/rowProcessor/index.js index 36a02eb9b1..e4c364eaf3 100644 --- a/packages/server/src/utilities/rowProcessor/index.js +++ b/packages/server/src/utilities/rowProcessor/index.js @@ -278,7 +278,7 @@ exports.outputProcessing = async (table, rows, opts = { squash: true }) => { for (let [property, column] of Object.entries(table.schema)) { if (column.type === FieldTypes.ATTACHMENT) { for (let row of enriched) { - if (row[property] == null || row[property].length === 0) { + if (row[property] == null || !Array.isArray(row[property])) { continue } row[property].forEach(attachment => { From 012a0d114ceb5687cf87e206dd29e01db708a7cf Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 21:22:22 +0000 Subject: [PATCH 24/33] v1.2.16 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index c785ec1257..9401e4ab71 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.15", + "version": "1.2.16", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index be74358881..64ae5619cc 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.15", + "version": "1.2.16", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.15", + "@budibase/types": "^1.2.16", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index b0b280c3df..1a62ff6893 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": "1.2.15", + "version": "1.2.16", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.15", + "@budibase/string-templates": "^1.2.16", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 30f691264d..81104013bb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.15", + "version": "1.2.16", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.15", - "@budibase/client": "^1.2.15", - "@budibase/frontend-core": "^1.2.15", - "@budibase/string-templates": "^1.2.15", + "@budibase/bbui": "^1.2.16", + "@budibase/client": "^1.2.16", + "@budibase/frontend-core": "^1.2.16", + "@budibase/string-templates": "^1.2.16", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index b59e50039c..a43242496c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.15", + "version": "1.2.16", "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 b749dfbc3b..4d47950162 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.15", + "version": "1.2.16", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.15", - "@budibase/frontend-core": "^1.2.15", - "@budibase/string-templates": "^1.2.15", + "@budibase/bbui": "^1.2.16", + "@budibase/frontend-core": "^1.2.16", + "@budibase/string-templates": "^1.2.16", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 7882d0edf9..54bde5eeb3 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.15", + "version": "1.2.16", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.15", + "@budibase/bbui": "^1.2.16", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 2167fca297..71d41e55f7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.15", + "version": "1.2.16", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.15", - "@budibase/client": "^1.2.15", + "@budibase/backend-core": "^1.2.16", + "@budibase/client": "^1.2.16", "@budibase/pro": "1.2.15", - "@budibase/string-templates": "^1.2.15", - "@budibase/types": "^1.2.15", + "@budibase/string-templates": "^1.2.16", + "@budibase/types": "^1.2.16", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 081c731975..b4c0f4bd3c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.15", + "version": "1.2.16", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 8c7e14866a..b50394c5a9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.15", + "version": "1.2.16", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 1af5eabedf..0e33eddf01 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.15", + "version": "1.2.16", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.15", + "@budibase/backend-core": "^1.2.16", "@budibase/pro": "1.2.15", - "@budibase/string-templates": "^1.2.15", - "@budibase/types": "^1.2.15", + "@budibase/string-templates": "^1.2.16", + "@budibase/types": "^1.2.16", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From d3d307ae7291afa6f0b45b59adba359aba13b854 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 5 Aug 2022 21:25:20 +0000 Subject: [PATCH 25/33] Update pro version to 1.2.16 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 71d41e55f7..a7da5fd458 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.16", "@budibase/client": "^1.2.16", - "@budibase/pro": "1.2.15", + "@budibase/pro": "1.2.16", "@budibase/string-templates": "^1.2.16", "@budibase/types": "^1.2.16", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 9969370e24..e51fbe7b46 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.15.tgz#d9884b5a4309bd2530323291e98ede5acae62de1" - integrity sha512-LoQhZIgptPwcB7DCbQiIRRBYaQiLYUqB4qGJj3C/SVyZV4ONOiJ8QTfHEtWMaxv5bXKJF+wALbKXOoNeWGF9Ow== +"@budibase/backend-core@1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.16.tgz#5edbc234b7636e3bb7f65339809c32dc5dbbe303" + integrity sha512-0tt5zy3Z+zTp1jSrGV2c6b1b3cqx5GAUyuQNVdJA5MIEMI1T3utHK78Dg689/OAzZtBWGpWXbOfZN1wrcfYu9w== dependencies: - "@budibase/types" "^1.2.15" + "@budibase/types" "^1.2.16" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.15.tgz#88fd20dc502b9cbfef544cb66a05f57a7256ef92" - integrity sha512-mzaYKzQmLuyq1lzjfktvxKn0FOVmKx+AM62JaI6SxuPsvsFqJ9SdGpD2XUOZ+b8sdezHJxCEd9KyAryik8fSOA== +"@budibase/pro@1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.16.tgz#2d57e51d5b6e167e076495dcfc01ee5a33d7588c" + integrity sha512-a7bTLfHrGYIRqIoDStNezdk28y/UwHZitRQRvaF1Hz4Vt9rIi8Fh3pQ+o52S7VAqqZJfAOZLkR+zbj64Ar+u4Q== dependencies: - "@budibase/backend-core" "1.2.15" - "@budibase/types" "1.2.15" + "@budibase/backend-core" "1.2.16" + "@budibase/types" "1.2.16" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.15", "@budibase/types@^1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.15.tgz#99e66d14f1cab8e5403f98e0dd097d1030ed8d5d" - integrity sha512-8WbponGlP0E0/mQh27GnWhY5jdR36kQ/rUzK1km4/ZZju7E88lM20DQE4yuUnTf2xbBihTR2gpAQpiOTPCI+7Q== +"@budibase/types@1.2.16", "@budibase/types@^1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.16.tgz#eaf367e786225572efb00091c804635e0aa8bc8b" + integrity sha512-9aswx9MfW0hCqNsMF6jBVqT199elOEAeFG+gyArsgyyjBrQzDK0iFMa4w6KrRLiA7Wta1wi2Jxq4dLW0HQK41A== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 0e33eddf01..8a02f104de 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.16", - "@budibase/pro": "1.2.15", + "@budibase/pro": "1.2.16", "@budibase/string-templates": "^1.2.16", "@budibase/types": "^1.2.16", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 45d16eebaa..c756d67883 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.15.tgz#d9884b5a4309bd2530323291e98ede5acae62de1" - integrity sha512-LoQhZIgptPwcB7DCbQiIRRBYaQiLYUqB4qGJj3C/SVyZV4ONOiJ8QTfHEtWMaxv5bXKJF+wALbKXOoNeWGF9Ow== +"@budibase/backend-core@1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.16.tgz#5edbc234b7636e3bb7f65339809c32dc5dbbe303" + integrity sha512-0tt5zy3Z+zTp1jSrGV2c6b1b3cqx5GAUyuQNVdJA5MIEMI1T3utHK78Dg689/OAzZtBWGpWXbOfZN1wrcfYu9w== dependencies: - "@budibase/types" "^1.2.15" + "@budibase/types" "^1.2.16" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.15.tgz#88fd20dc502b9cbfef544cb66a05f57a7256ef92" - integrity sha512-mzaYKzQmLuyq1lzjfktvxKn0FOVmKx+AM62JaI6SxuPsvsFqJ9SdGpD2XUOZ+b8sdezHJxCEd9KyAryik8fSOA== +"@budibase/pro@1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.16.tgz#2d57e51d5b6e167e076495dcfc01ee5a33d7588c" + integrity sha512-a7bTLfHrGYIRqIoDStNezdk28y/UwHZitRQRvaF1Hz4Vt9rIi8Fh3pQ+o52S7VAqqZJfAOZLkR+zbj64Ar+u4Q== dependencies: - "@budibase/backend-core" "1.2.15" - "@budibase/types" "1.2.15" + "@budibase/backend-core" "1.2.16" + "@budibase/types" "1.2.16" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.15", "@budibase/types@^1.2.15": - version "1.2.15" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.15.tgz#99e66d14f1cab8e5403f98e0dd097d1030ed8d5d" - integrity sha512-8WbponGlP0E0/mQh27GnWhY5jdR36kQ/rUzK1km4/ZZju7E88lM20DQE4yuUnTf2xbBihTR2gpAQpiOTPCI+7Q== +"@budibase/types@1.2.16", "@budibase/types@^1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.16.tgz#eaf367e786225572efb00091c804635e0aa8bc8b" + integrity sha512-9aswx9MfW0hCqNsMF6jBVqT199elOEAeFG+gyArsgyyjBrQzDK0iFMa4w6KrRLiA7Wta1wi2Jxq4dLW0HQK41A== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From c432cbd52957aaf9800fde424ee8cb543bded134 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Sat, 6 Aug 2022 19:29:21 +0000 Subject: [PATCH 26/33] v1.2.17 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 9401e4ab71..1d903be061 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.16", + "version": "1.2.17", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 64ae5619cc..8695363cac 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.16", + "version": "1.2.17", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.16", + "@budibase/types": "^1.2.17", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1a62ff6893..0b3d9e3d22 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": "1.2.16", + "version": "1.2.17", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.16", + "@budibase/string-templates": "^1.2.17", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 81104013bb..00cd837cdd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.16", + "version": "1.2.17", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.16", - "@budibase/client": "^1.2.16", - "@budibase/frontend-core": "^1.2.16", - "@budibase/string-templates": "^1.2.16", + "@budibase/bbui": "^1.2.17", + "@budibase/client": "^1.2.17", + "@budibase/frontend-core": "^1.2.17", + "@budibase/string-templates": "^1.2.17", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index a43242496c..5b530ab22c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.16", + "version": "1.2.17", "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 4d47950162..39c8d6e0be 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.16", + "version": "1.2.17", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.16", - "@budibase/frontend-core": "^1.2.16", - "@budibase/string-templates": "^1.2.16", + "@budibase/bbui": "^1.2.17", + "@budibase/frontend-core": "^1.2.17", + "@budibase/string-templates": "^1.2.17", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 54bde5eeb3..d3522b0da7 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.16", + "version": "1.2.17", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.16", + "@budibase/bbui": "^1.2.17", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index a7da5fd458..f2f8952936 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.16", + "version": "1.2.17", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.16", - "@budibase/client": "^1.2.16", + "@budibase/backend-core": "^1.2.17", + "@budibase/client": "^1.2.17", "@budibase/pro": "1.2.16", - "@budibase/string-templates": "^1.2.16", - "@budibase/types": "^1.2.16", + "@budibase/string-templates": "^1.2.17", + "@budibase/types": "^1.2.17", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b4c0f4bd3c..eeb9c2aab5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.16", + "version": "1.2.17", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index b50394c5a9..ea5ab8c897 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.16", + "version": "1.2.17", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 8a02f104de..3812fdf9c8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.16", + "version": "1.2.17", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.16", + "@budibase/backend-core": "^1.2.17", "@budibase/pro": "1.2.16", - "@budibase/string-templates": "^1.2.16", - "@budibase/types": "^1.2.16", + "@budibase/string-templates": "^1.2.17", + "@budibase/types": "^1.2.17", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 89bad2c5e5fd15af72061f31c2bce631febe8177 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Sat, 6 Aug 2022 19:32:22 +0000 Subject: [PATCH 27/33] Update pro version to 1.2.17 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index f2f8952936..c7d14254bb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.17", "@budibase/client": "^1.2.17", - "@budibase/pro": "1.2.16", + "@budibase/pro": "1.2.17", "@budibase/string-templates": "^1.2.17", "@budibase/types": "^1.2.17", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e51fbe7b46..cd67c70206 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.16.tgz#5edbc234b7636e3bb7f65339809c32dc5dbbe303" - integrity sha512-0tt5zy3Z+zTp1jSrGV2c6b1b3cqx5GAUyuQNVdJA5MIEMI1T3utHK78Dg689/OAzZtBWGpWXbOfZN1wrcfYu9w== +"@budibase/backend-core@1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.17.tgz#9025a5063b35a43ee35332bbf91474cbf3c296ed" + integrity sha512-PaUwBdI5PydAMkpfq7pgnWcPwaV01sDPLZooplr7fmOnOCHg5yDKkpo/n6n8FT2T0YeL1oPfStKtPkx+J4w8Jg== dependencies: - "@budibase/types" "^1.2.16" + "@budibase/types" "^1.2.17" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.16.tgz#2d57e51d5b6e167e076495dcfc01ee5a33d7588c" - integrity sha512-a7bTLfHrGYIRqIoDStNezdk28y/UwHZitRQRvaF1Hz4Vt9rIi8Fh3pQ+o52S7VAqqZJfAOZLkR+zbj64Ar+u4Q== +"@budibase/pro@1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.17.tgz#14fe3e7fe7af77094285d2183cda6a7fb55c3d21" + integrity sha512-Sa9f8QCL8sa8mJ8SCJkPAE2RNLQ7T6A3gun0aKe2eI6qZHtdvB0Av6e+vYfl/GruZh/JUoCh5rkn+Q08e9jPig== dependencies: - "@budibase/backend-core" "1.2.16" - "@budibase/types" "1.2.16" + "@budibase/backend-core" "1.2.17" + "@budibase/types" "1.2.17" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.16", "@budibase/types@^1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.16.tgz#eaf367e786225572efb00091c804635e0aa8bc8b" - integrity sha512-9aswx9MfW0hCqNsMF6jBVqT199elOEAeFG+gyArsgyyjBrQzDK0iFMa4w6KrRLiA7Wta1wi2Jxq4dLW0HQK41A== +"@budibase/types@1.2.17", "@budibase/types@^1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.17.tgz#b1c48827341f4a4088abb726f07c5a5aab21c0d7" + integrity sha512-qSeNn2eNDiuQP1hHXr6I97M7HKrXdzAsN2lmS6jED/PT7D5/G/vaecG+ZoWfuWoxiS9cm4DZTdyXg/ry+GqQUA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 3812fdf9c8..c0ca7e2f92 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.17", - "@budibase/pro": "1.2.16", + "@budibase/pro": "1.2.17", "@budibase/string-templates": "^1.2.17", "@budibase/types": "^1.2.17", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index c756d67883..0a73dfe88d 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.16.tgz#5edbc234b7636e3bb7f65339809c32dc5dbbe303" - integrity sha512-0tt5zy3Z+zTp1jSrGV2c6b1b3cqx5GAUyuQNVdJA5MIEMI1T3utHK78Dg689/OAzZtBWGpWXbOfZN1wrcfYu9w== +"@budibase/backend-core@1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.17.tgz#9025a5063b35a43ee35332bbf91474cbf3c296ed" + integrity sha512-PaUwBdI5PydAMkpfq7pgnWcPwaV01sDPLZooplr7fmOnOCHg5yDKkpo/n6n8FT2T0YeL1oPfStKtPkx+J4w8Jg== dependencies: - "@budibase/types" "^1.2.16" + "@budibase/types" "^1.2.17" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.16.tgz#2d57e51d5b6e167e076495dcfc01ee5a33d7588c" - integrity sha512-a7bTLfHrGYIRqIoDStNezdk28y/UwHZitRQRvaF1Hz4Vt9rIi8Fh3pQ+o52S7VAqqZJfAOZLkR+zbj64Ar+u4Q== +"@budibase/pro@1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.17.tgz#14fe3e7fe7af77094285d2183cda6a7fb55c3d21" + integrity sha512-Sa9f8QCL8sa8mJ8SCJkPAE2RNLQ7T6A3gun0aKe2eI6qZHtdvB0Av6e+vYfl/GruZh/JUoCh5rkn+Q08e9jPig== dependencies: - "@budibase/backend-core" "1.2.16" - "@budibase/types" "1.2.16" + "@budibase/backend-core" "1.2.17" + "@budibase/types" "1.2.17" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.16", "@budibase/types@^1.2.16": - version "1.2.16" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.16.tgz#eaf367e786225572efb00091c804635e0aa8bc8b" - integrity sha512-9aswx9MfW0hCqNsMF6jBVqT199elOEAeFG+gyArsgyyjBrQzDK0iFMa4w6KrRLiA7Wta1wi2Jxq4dLW0HQK41A== +"@budibase/types@1.2.17", "@budibase/types@^1.2.17": + version "1.2.17" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.17.tgz#b1c48827341f4a4088abb726f07c5a5aab21c0d7" + integrity sha512-qSeNn2eNDiuQP1hHXr6I97M7HKrXdzAsN2lmS6jED/PT7D5/G/vaecG+ZoWfuWoxiS9cm4DZTdyXg/ry+GqQUA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 87a7b8b701f430e42a2ed222079a9b7f653e0446 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 8 Aug 2022 09:34:45 +0100 Subject: [PATCH 28/33] Bulk session wipe fix + logging --- packages/backend-core/src/security/sessions.ts | 4 ++++ .../backend-core/src/security/tests/sessions.spec.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 packages/backend-core/src/security/tests/sessions.spec.ts diff --git a/packages/backend-core/src/security/sessions.ts b/packages/backend-core/src/security/sessions.ts index 39d24ee16a..284adbcd1f 100644 --- a/packages/backend-core/src/security/sessions.ts +++ b/packages/backend-core/src/security/sessions.ts @@ -23,6 +23,10 @@ function makeSessionID(userId: string, sessionId: string) { } export async function getSessionsForUser(userId: string) { + if (!userId) { + console.trace("Cannot get sessions for undefined userId") + return [] + } const client = await redis.getSessionClient() const sessions = await client.scan(userId) return sessions.map((session: Session) => session.value) diff --git a/packages/backend-core/src/security/tests/sessions.spec.ts b/packages/backend-core/src/security/tests/sessions.spec.ts new file mode 100644 index 0000000000..7f01bdcdb7 --- /dev/null +++ b/packages/backend-core/src/security/tests/sessions.spec.ts @@ -0,0 +1,12 @@ +import * as sessions from "../sessions" + +describe("sessions", () => { + describe("getSessionsForUser", () => { + it("returns empty when user is undefined", async () => { + // @ts-ignore - allow the undefined to be passed + const results = await sessions.getSessionsForUser(undefined) + + expect(results).toStrictEqual([]) + }) + }) +}) From 89e70edefb160a45ba1a1793a24a83172dcffdfe Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 Aug 2022 09:10:52 +0000 Subject: [PATCH 29/33] v1.2.18 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 1d903be061..ad9ad1a5f1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.17", + "version": "1.2.18", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 8695363cac..6896545333 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.17", + "version": "1.2.18", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.17", + "@budibase/types": "^1.2.18", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 0b3d9e3d22..1dee96bc46 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": "1.2.17", + "version": "1.2.18", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.17", + "@budibase/string-templates": "^1.2.18", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 00cd837cdd..a842647ac6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.17", + "version": "1.2.18", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.17", - "@budibase/client": "^1.2.17", - "@budibase/frontend-core": "^1.2.17", - "@budibase/string-templates": "^1.2.17", + "@budibase/bbui": "^1.2.18", + "@budibase/client": "^1.2.18", + "@budibase/frontend-core": "^1.2.18", + "@budibase/string-templates": "^1.2.18", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5b530ab22c..81a28b0c8a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.17", + "version": "1.2.18", "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 39c8d6e0be..cd73e0d59d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.17", + "version": "1.2.18", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.17", - "@budibase/frontend-core": "^1.2.17", - "@budibase/string-templates": "^1.2.17", + "@budibase/bbui": "^1.2.18", + "@budibase/frontend-core": "^1.2.18", + "@budibase/string-templates": "^1.2.18", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index d3522b0da7..47261b8558 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.17", + "version": "1.2.18", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.17", + "@budibase/bbui": "^1.2.18", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index c7d14254bb..3dbb0d883a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.17", + "version": "1.2.18", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.17", - "@budibase/client": "^1.2.17", + "@budibase/backend-core": "^1.2.18", + "@budibase/client": "^1.2.18", "@budibase/pro": "1.2.17", - "@budibase/string-templates": "^1.2.17", - "@budibase/types": "^1.2.17", + "@budibase/string-templates": "^1.2.18", + "@budibase/types": "^1.2.18", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index eeb9c2aab5..0116fbe224 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.17", + "version": "1.2.18", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index ea5ab8c897..3c2dce9d33 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.17", + "version": "1.2.18", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index c0ca7e2f92..8c6fe0f2ec 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.17", + "version": "1.2.18", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.17", + "@budibase/backend-core": "^1.2.18", "@budibase/pro": "1.2.17", - "@budibase/string-templates": "^1.2.17", - "@budibase/types": "^1.2.17", + "@budibase/string-templates": "^1.2.18", + "@budibase/types": "^1.2.18", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 0a7c2e8f08153982ffb7144261d42037e568ae6b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 Aug 2022 09:13:47 +0000 Subject: [PATCH 30/33] Update pro version to 1.2.18 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 3dbb0d883a..076e29669c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.18", "@budibase/client": "^1.2.18", - "@budibase/pro": "1.2.17", + "@budibase/pro": "1.2.18", "@budibase/string-templates": "^1.2.18", "@budibase/types": "^1.2.18", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index cd67c70206..ba52c2a353 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.17.tgz#9025a5063b35a43ee35332bbf91474cbf3c296ed" - integrity sha512-PaUwBdI5PydAMkpfq7pgnWcPwaV01sDPLZooplr7fmOnOCHg5yDKkpo/n6n8FT2T0YeL1oPfStKtPkx+J4w8Jg== +"@budibase/backend-core@1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.18.tgz#0cda91e4d156511177fb5be81580bf9cf42a2716" + integrity sha512-TQ3wz15zCUxGpmYvWo7QfAdWjpgYfxoDuxT7lGZB/OhjFGCgeCPOTRAuo0M5WrdnLZ0cGczwRssWVtUKWSwOGA== dependencies: - "@budibase/types" "^1.2.17" + "@budibase/types" "^1.2.18" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.17.tgz#14fe3e7fe7af77094285d2183cda6a7fb55c3d21" - integrity sha512-Sa9f8QCL8sa8mJ8SCJkPAE2RNLQ7T6A3gun0aKe2eI6qZHtdvB0Av6e+vYfl/GruZh/JUoCh5rkn+Q08e9jPig== +"@budibase/pro@1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.18.tgz#94fd973a5d206bf49faf27990b82c0e21f833b17" + integrity sha512-NwL73UonzxHzqVkD9Zp/w6NohI+kRhzTk3RFtwf1A10v7quypSaE824xke0TyTxxxeM2+jfYPcmh6UFprOsdpw== dependencies: - "@budibase/backend-core" "1.2.17" - "@budibase/types" "1.2.17" + "@budibase/backend-core" "1.2.18" + "@budibase/types" "1.2.18" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.17", "@budibase/types@^1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.17.tgz#b1c48827341f4a4088abb726f07c5a5aab21c0d7" - integrity sha512-qSeNn2eNDiuQP1hHXr6I97M7HKrXdzAsN2lmS6jED/PT7D5/G/vaecG+ZoWfuWoxiS9cm4DZTdyXg/ry+GqQUA== +"@budibase/types@1.2.18", "@budibase/types@^1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.18.tgz#2ff46464ee99fb7ff506c23b970f7dcddf1affdd" + integrity sha512-cSF7zr0k74rCbeif5+2o4UOG+CIvuvSxwnbP8DCuLsBWuQdi8KUFgqAXxilC0xEfiJl91xWMaop61YhBFTniTw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 8c6fe0f2ec..5593c8fff5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.18", - "@budibase/pro": "1.2.17", + "@budibase/pro": "1.2.18", "@budibase/string-templates": "^1.2.18", "@budibase/types": "^1.2.18", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 0a73dfe88d..e64a7f03d8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.17.tgz#9025a5063b35a43ee35332bbf91474cbf3c296ed" - integrity sha512-PaUwBdI5PydAMkpfq7pgnWcPwaV01sDPLZooplr7fmOnOCHg5yDKkpo/n6n8FT2T0YeL1oPfStKtPkx+J4w8Jg== +"@budibase/backend-core@1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.18.tgz#0cda91e4d156511177fb5be81580bf9cf42a2716" + integrity sha512-TQ3wz15zCUxGpmYvWo7QfAdWjpgYfxoDuxT7lGZB/OhjFGCgeCPOTRAuo0M5WrdnLZ0cGczwRssWVtUKWSwOGA== dependencies: - "@budibase/types" "^1.2.17" + "@budibase/types" "^1.2.18" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.17.tgz#14fe3e7fe7af77094285d2183cda6a7fb55c3d21" - integrity sha512-Sa9f8QCL8sa8mJ8SCJkPAE2RNLQ7T6A3gun0aKe2eI6qZHtdvB0Av6e+vYfl/GruZh/JUoCh5rkn+Q08e9jPig== +"@budibase/pro@1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.18.tgz#94fd973a5d206bf49faf27990b82c0e21f833b17" + integrity sha512-NwL73UonzxHzqVkD9Zp/w6NohI+kRhzTk3RFtwf1A10v7quypSaE824xke0TyTxxxeM2+jfYPcmh6UFprOsdpw== dependencies: - "@budibase/backend-core" "1.2.17" - "@budibase/types" "1.2.17" + "@budibase/backend-core" "1.2.18" + "@budibase/types" "1.2.18" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.17", "@budibase/types@^1.2.17": - version "1.2.17" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.17.tgz#b1c48827341f4a4088abb726f07c5a5aab21c0d7" - integrity sha512-qSeNn2eNDiuQP1hHXr6I97M7HKrXdzAsN2lmS6jED/PT7D5/G/vaecG+ZoWfuWoxiS9cm4DZTdyXg/ry+GqQUA== +"@budibase/types@1.2.18", "@budibase/types@^1.2.18": + version "1.2.18" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.18.tgz#2ff46464ee99fb7ff506c23b970f7dcddf1affdd" + integrity sha512-cSF7zr0k74rCbeif5+2o4UOG+CIvuvSxwnbP8DCuLsBWuQdi8KUFgqAXxilC0xEfiJl91xWMaop61YhBFTniTw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From d123a4de25ec6f63bf66234710946cbf358b60ef Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 2 Aug 2022 10:52:09 +0100 Subject: [PATCH 31/33] Reduce event frequency --- .../src/events/processors/PosthogProcessor.ts | 21 ++++++++++ .../processors/tests/PosthogProcessor.spec.ts | 40 +++++++++++++++++++ .../src/events/publishers/license.ts | 6 --- .../tests/utilities/mocks/index.js | 2 + .../tests/utilities/mocks/posthog.ts | 7 ++++ .../builder/src/analytics/PosthogClient.js | 10 ++++- packages/builder/src/stores/portal/auth.js | 5 +++ packages/types/src/sdk/events/event.ts | 1 - 8 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 packages/backend-core/src/events/processors/tests/PosthogProcessor.spec.ts create mode 100644 packages/backend-core/tests/utilities/mocks/posthog.ts diff --git a/packages/backend-core/src/events/processors/PosthogProcessor.ts b/packages/backend-core/src/events/processors/PosthogProcessor.ts index eb12db1dc4..9d68d3919a 100644 --- a/packages/backend-core/src/events/processors/PosthogProcessor.ts +++ b/packages/backend-core/src/events/processors/PosthogProcessor.ts @@ -5,6 +5,22 @@ import env from "../../environment" import * as context from "../../context" const pkg = require("../../../package.json") +const EXCLUDED_EVENTS: Event[] = [ + Event.USER_UPDATED, + Event.EMAIL_SMTP_UPDATED, + Event.AUTH_SSO_UPDATED, + Event.APP_UPDATED, + Event.ROLE_UPDATED, + Event.DATASOURCE_UPDATED, + Event.QUERY_UPDATED, + Event.TABLE_UPDATED, + Event.VIEW_UPDATED, + Event.VIEW_FILTER_UPDATED, + Event.VIEW_CALCULATION_UPDATED, + Event.AUTOMATION_TRIGGER_UPDATED, + Event.USER_GROUP_UPDATED, +] + export default class PosthogProcessor implements EventProcessor { posthog: PostHog @@ -21,6 +37,11 @@ export default class PosthogProcessor implements EventProcessor { properties: BaseEvent, timestamp?: string | number ): Promise { + // don't send excluded events + if (EXCLUDED_EVENTS.includes(event)) { + return + } + properties.version = pkg.version properties.service = env.SERVICE properties.environment = identity.environment diff --git a/packages/backend-core/src/events/processors/tests/PosthogProcessor.spec.ts b/packages/backend-core/src/events/processors/tests/PosthogProcessor.spec.ts new file mode 100644 index 0000000000..4a6d55b272 --- /dev/null +++ b/packages/backend-core/src/events/processors/tests/PosthogProcessor.spec.ts @@ -0,0 +1,40 @@ +import PosthogProcessor from "../PosthogProcessor" +import { Event, IdentityType, Hosting } from "@budibase/types" + +const newIdentity = () => { + return { + id: "test", + type: IdentityType.USER, + hosting: Hosting.SELF, + environment: "test", + } +} + +describe("PosthogProcessor", () => { + beforeEach(() => { + jest.clearAllMocks() + }) + + describe("processEvent", () => { + it("processes event", () => { + const processor = new PosthogProcessor("test") + + const identity = newIdentity() + const properties = {} + + processor.processEvent(Event.APP_CREATED, identity, properties) + + expect(processor.posthog.capture).toHaveBeenCalledTimes(1) + }) + + it("honours exclusions", () => { + const processor = new PosthogProcessor("test") + + const identity = newIdentity() + const properties = {} + + processor.processEvent(Event.AUTH_SSO_UPDATED, identity, properties) + expect(processor.posthog.capture).toHaveBeenCalledTimes(0) + }) + }) +}) diff --git a/packages/backend-core/src/events/publishers/license.ts b/packages/backend-core/src/events/publishers/license.ts index 44dafd84ce..1adc71652e 100644 --- a/packages/backend-core/src/events/publishers/license.ts +++ b/packages/backend-core/src/events/publishers/license.ts @@ -20,12 +20,6 @@ export async function downgraded(license: License) { await publishEvent(Event.LICENSE_DOWNGRADED, properties) } -// TODO -export async function updated(license: License) { - const properties: LicenseUpdatedEvent = {} - await publishEvent(Event.LICENSE_UPDATED, properties) -} - // TODO export async function activated(license: License) { const properties: LicenseActivatedEvent = {} diff --git a/packages/backend-core/tests/utilities/mocks/index.js b/packages/backend-core/tests/utilities/mocks/index.js index 3dd5c854c0..6aa1c4a54f 100644 --- a/packages/backend-core/tests/utilities/mocks/index.js +++ b/packages/backend-core/tests/utilities/mocks/index.js @@ -1,7 +1,9 @@ +const posthog = require("./posthog") const events = require("./events") const date = require("./date") module.exports = { + posthog, date, events, } diff --git a/packages/backend-core/tests/utilities/mocks/posthog.ts b/packages/backend-core/tests/utilities/mocks/posthog.ts new file mode 100644 index 0000000000..e9cc653ccc --- /dev/null +++ b/packages/backend-core/tests/utilities/mocks/posthog.ts @@ -0,0 +1,7 @@ +jest.mock("posthog-node", () => { + return jest.fn().mockImplementation(() => { + return { + capture: jest.fn(), + } + }) +}) diff --git a/packages/builder/src/analytics/PosthogClient.js b/packages/builder/src/analytics/PosthogClient.js index 0b9f052906..c1e596358f 100644 --- a/packages/builder/src/analytics/PosthogClient.js +++ b/packages/builder/src/analytics/PosthogClient.js @@ -1,5 +1,7 @@ import posthog from "posthog-js" import { Events } from "./constants" +import { get } from "svelte/store" +import { admin } from "../stores/portal" export default class PosthogClient { constructor(token) { @@ -9,9 +11,15 @@ export default class PosthogClient { init() { if (!this.token) return + // enable page views in cloud only + let capturePageViews = false + if (get(admin).cloud) { + capturePageViews = true + } + posthog.init(this.token, { autocapture: false, - capture_pageview: true, + capture_pageview: capturePageViews, }) posthog.set_config({ persistence: "cookie" }) diff --git a/packages/builder/src/stores/portal/auth.js b/packages/builder/src/stores/portal/auth.js index 8ac19ab785..9d2d9cf42e 100644 --- a/packages/builder/src/stores/portal/auth.js +++ b/packages/builder/src/stores/portal/auth.js @@ -139,6 +139,11 @@ export function createAuthStore() { await setOrganisation(tenantId) }, getSelf: async () => { + // for analytics, we need to make sure the environment has been loaded + // before setting the user + if (!get(admin).loaded) { + await admin.init() + } // We need to catch this locally as we never want this to fail, even // though normally we never want to swallow API errors at the store level. // We're either logged in or we aren't. diff --git a/packages/types/src/sdk/events/event.ts b/packages/types/src/sdk/events/event.ts index f0e023df51..d7086370ec 100644 --- a/packages/types/src/sdk/events/event.ts +++ b/packages/types/src/sdk/events/event.ts @@ -135,7 +135,6 @@ export enum Event { // LICENSE LICENSE_UPGRADED = "license:upgraded", LICENSE_DOWNGRADED = "license:downgraded", - LICENSE_UPDATED = "license:updated", LICENSE_ACTIVATED = "license:activated", // ACCOUNT From fb7ee6f5ff155d13604bd24247b3daba4deac9d3 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 Aug 2022 09:59:51 +0000 Subject: [PATCH 32/33] v1.2.19 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index ad9ad1a5f1..e079a0faee 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.18", + "version": "1.2.19", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 6896545333..b4ab38387e 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.18", + "version": "1.2.19", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.18", + "@budibase/types": "^1.2.19", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1dee96bc46..3ae887a4f8 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": "1.2.18", + "version": "1.2.19", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.18", + "@budibase/string-templates": "^1.2.19", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index a842647ac6..a0ab10f029 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.18", + "version": "1.2.19", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.18", - "@budibase/client": "^1.2.18", - "@budibase/frontend-core": "^1.2.18", - "@budibase/string-templates": "^1.2.18", + "@budibase/bbui": "^1.2.19", + "@budibase/client": "^1.2.19", + "@budibase/frontend-core": "^1.2.19", + "@budibase/string-templates": "^1.2.19", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 81a28b0c8a..6971439315 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.18", + "version": "1.2.19", "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 cd73e0d59d..8aad954c28 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.18", + "version": "1.2.19", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.18", - "@budibase/frontend-core": "^1.2.18", - "@budibase/string-templates": "^1.2.18", + "@budibase/bbui": "^1.2.19", + "@budibase/frontend-core": "^1.2.19", + "@budibase/string-templates": "^1.2.19", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 47261b8558..8b76bfae50 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.18", + "version": "1.2.19", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.18", + "@budibase/bbui": "^1.2.19", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 076e29669c..121ccebf64 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.18", + "version": "1.2.19", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.18", - "@budibase/client": "^1.2.18", + "@budibase/backend-core": "^1.2.19", + "@budibase/client": "^1.2.19", "@budibase/pro": "1.2.18", - "@budibase/string-templates": "^1.2.18", - "@budibase/types": "^1.2.18", + "@budibase/string-templates": "^1.2.19", + "@budibase/types": "^1.2.19", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 0116fbe224..674f922f02 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.18", + "version": "1.2.19", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 3c2dce9d33..145329204c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.18", + "version": "1.2.19", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 5593c8fff5..7080c3aff6 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.18", + "version": "1.2.19", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.18", + "@budibase/backend-core": "^1.2.19", "@budibase/pro": "1.2.18", - "@budibase/string-templates": "^1.2.18", - "@budibase/types": "^1.2.18", + "@budibase/string-templates": "^1.2.19", + "@budibase/types": "^1.2.19", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From b894405f8edba293f55ef990c539f9a5966329df Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 Aug 2022 10:02:59 +0000 Subject: [PATCH 33/33] Update pro version to 1.2.19 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 121ccebf64..964f6bf285 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.19", "@budibase/client": "^1.2.19", - "@budibase/pro": "1.2.18", + "@budibase/pro": "1.2.19", "@budibase/string-templates": "^1.2.19", "@budibase/types": "^1.2.19", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index ba52c2a353..f933f54373 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.18.tgz#0cda91e4d156511177fb5be81580bf9cf42a2716" - integrity sha512-TQ3wz15zCUxGpmYvWo7QfAdWjpgYfxoDuxT7lGZB/OhjFGCgeCPOTRAuo0M5WrdnLZ0cGczwRssWVtUKWSwOGA== +"@budibase/backend-core@1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.19.tgz#8606f41eb02530ff84cc1cd1e3580dd952879103" + integrity sha512-WN1y7NDWhUWzwl4ek+8XejEncZckmYheWqWod1l0JI93apiRfhMfxxPxW1/9Hi473Ofd5LG5qZbFuu8BfZGSVQ== dependencies: - "@budibase/types" "^1.2.18" + "@budibase/types" "^1.2.19" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.18.tgz#94fd973a5d206bf49faf27990b82c0e21f833b17" - integrity sha512-NwL73UonzxHzqVkD9Zp/w6NohI+kRhzTk3RFtwf1A10v7quypSaE824xke0TyTxxxeM2+jfYPcmh6UFprOsdpw== +"@budibase/pro@1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.19.tgz#bfe9305e7dabe3ed239ad494838ba1fa7b4da37b" + integrity sha512-bdD/Y+zpeFe06bBxg6c2fX0C5xm4vwn3BLUelovLBr9CTyrkGEr40NkoEAligWkHZ5awSTiVhHaFkzFceJkjVQ== dependencies: - "@budibase/backend-core" "1.2.18" - "@budibase/types" "1.2.18" + "@budibase/backend-core" "1.2.19" + "@budibase/types" "1.2.19" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.18", "@budibase/types@^1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.18.tgz#2ff46464ee99fb7ff506c23b970f7dcddf1affdd" - integrity sha512-cSF7zr0k74rCbeif5+2o4UOG+CIvuvSxwnbP8DCuLsBWuQdi8KUFgqAXxilC0xEfiJl91xWMaop61YhBFTniTw== +"@budibase/types@1.2.19", "@budibase/types@^1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.19.tgz#f2dade0f25f4fa55c3a7a99b3195f655db6c9cf5" + integrity sha512-+FKv29hJ3FXldmihdfn8omfEVp2WsB7nm7gbZPJs7mD+yP+AYGnuZinCYJ8PcX1CjoIgzcYE27OOQuxy+9cDmQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 7080c3aff6..6305ebcbbd 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.19", - "@budibase/pro": "1.2.18", + "@budibase/pro": "1.2.19", "@budibase/string-templates": "^1.2.19", "@budibase/types": "^1.2.19", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e64a7f03d8..53eed9581e 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.18.tgz#0cda91e4d156511177fb5be81580bf9cf42a2716" - integrity sha512-TQ3wz15zCUxGpmYvWo7QfAdWjpgYfxoDuxT7lGZB/OhjFGCgeCPOTRAuo0M5WrdnLZ0cGczwRssWVtUKWSwOGA== +"@budibase/backend-core@1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.19.tgz#8606f41eb02530ff84cc1cd1e3580dd952879103" + integrity sha512-WN1y7NDWhUWzwl4ek+8XejEncZckmYheWqWod1l0JI93apiRfhMfxxPxW1/9Hi473Ofd5LG5qZbFuu8BfZGSVQ== dependencies: - "@budibase/types" "^1.2.18" + "@budibase/types" "^1.2.19" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.18.tgz#94fd973a5d206bf49faf27990b82c0e21f833b17" - integrity sha512-NwL73UonzxHzqVkD9Zp/w6NohI+kRhzTk3RFtwf1A10v7quypSaE824xke0TyTxxxeM2+jfYPcmh6UFprOsdpw== +"@budibase/pro@1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.19.tgz#bfe9305e7dabe3ed239ad494838ba1fa7b4da37b" + integrity sha512-bdD/Y+zpeFe06bBxg6c2fX0C5xm4vwn3BLUelovLBr9CTyrkGEr40NkoEAligWkHZ5awSTiVhHaFkzFceJkjVQ== dependencies: - "@budibase/backend-core" "1.2.18" - "@budibase/types" "1.2.18" + "@budibase/backend-core" "1.2.19" + "@budibase/types" "1.2.19" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.18", "@budibase/types@^1.2.18": - version "1.2.18" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.18.tgz#2ff46464ee99fb7ff506c23b970f7dcddf1affdd" - integrity sha512-cSF7zr0k74rCbeif5+2o4UOG+CIvuvSxwnbP8DCuLsBWuQdi8KUFgqAXxilC0xEfiJl91xWMaop61YhBFTniTw== +"@budibase/types@1.2.19", "@budibase/types@^1.2.19": + version "1.2.19" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.19.tgz#f2dade0f25f4fa55c3a7a99b3195f655db6c9cf5" + integrity sha512-+FKv29hJ3FXldmihdfn8omfEVp2WsB7nm7gbZPJs7mD+yP+AYGnuZinCYJ8PcX1CjoIgzcYE27OOQuxy+9cDmQ== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0"