From 84b41f407e2cee242579529f5d51603e44492db5 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 01:20:13 +0200 Subject: [PATCH 01/17] Fix multiple query in one graphql request --- .../strapi-plugin-graphql/services/Query.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/strapi-plugin-graphql/services/Query.js b/packages/strapi-plugin-graphql/services/Query.js index 1283c4aa35..80f1101a58 100644 --- a/packages/strapi-plugin-graphql/services/Query.js +++ b/packages/strapi-plugin-graphql/services/Query.js @@ -261,12 +261,22 @@ module.exports = { // cause a lost of the Object prototype. const opts = this.amountLimiting(_options); - ctx.query = { - ...this.convertToParams(_.omit(opts, 'where')), - ...this.convertToQuery(opts.where), - }; + Object.defineProperty(ctx, 'query', { + enumerable: true, + configurable: true, + writable: true, + value: { + ...this.convertToParams(_.omit(opts, 'where')), + ...this.convertToQuery(opts.where), + }, + }); - ctx.params = this.convertToParams(opts); + Object.defineProperty(ctx, 'params', { + enumerable: true, + configurable: true, + writable: true, + value: this.convertToParams(opts), + }); // Execute policies stack. const policy = await compose(policiesFn)(ctx); From 7fd4e2fd4542cb4863b245a4c5d43a2f7e55e0cb Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 23 Oct 2019 10:11:53 +0200 Subject: [PATCH 02/17] Fix dead link and link path --- docs/3.0.0-beta.x/content-api/parameters.md | 4 ++-- .../getting-started/install-requirements.md | 2 +- .../getting-started/introduction.md | 12 ++++------ .../getting-started/quick-start-tutorial.md | 17 ++++--------- .../getting-started/quick-start.md | 6 ++--- docs/3.0.0-beta.x/guides/databases.md | 12 +++++----- docs/3.0.0-beta.x/guides/deployment.md | 24 +++++++++---------- .../migration-guide-alpha.26-to-beta.md | 4 ++-- .../migration-guide-beta.15-to-beta.16.md | 8 +++---- .../plugin-development/backend-development.md | 8 +++---- .../frontend-development.md | 4 ++-- 11 files changed, 46 insertions(+), 55 deletions(-) diff --git a/docs/3.0.0-beta.x/content-api/parameters.md b/docs/3.0.0-beta.x/content-api/parameters.md index 7c5a6c6ab4..a3855983e4 100644 --- a/docs/3.0.0-beta.x/content-api/parameters.md +++ b/docs/3.0.0-beta.x/content-api/parameters.md @@ -1,9 +1,9 @@ # Parameters -See the [parameters' concepts](../concepts/concepts.md#parameters) for details. +See the [parameters' concepts](../concepts/parameters.md) for details. ::: warning -By default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filters system somewhere else, read the [programmatic usage](../guides/parameters.md) section. +By default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filters system somewhere else, read the [programmatic usage](../concepts/parameters.md) section. ::: ## Available operators diff --git a/docs/3.0.0-beta.x/getting-started/install-requirements.md b/docs/3.0.0-beta.x/getting-started/install-requirements.md index 73c044d48e..816ca6bfd3 100644 --- a/docs/3.0.0-beta.x/getting-started/install-requirements.md +++ b/docs/3.0.0-beta.x/getting-started/install-requirements.md @@ -130,5 +130,5 @@ npm -v You can also use yarn if you want [here](https://yarnpkg.com/en/docs/getting-started) are the instructions to get started with it. ::: tip NEXT STEPS -πŸ‘ Congrats, you are all set! Now that Node.js is installed you can continue with the [Quick start guide](/3.0.0-beta.x/getting-started/quick-start.html). +πŸ‘ Congrats, you are all set! Now that Node.js is installed you can continue with the [Quick start guide](quick-start.md). ::: diff --git a/docs/3.0.0-beta.x/getting-started/introduction.md b/docs/3.0.0-beta.x/getting-started/introduction.md index 3e61ef9861..2b71aaade0 100644 --- a/docs/3.0.0-beta.x/getting-started/introduction.md +++ b/docs/3.0.0-beta.x/getting-started/introduction.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction Welcome to the open source [headless CMS](https://strapi.io) developers love. @@ -6,15 +6,13 @@ Welcome to the open source [headless CMS](https://strapi.io) developers love. ### πŸ‘‹ Welcome onboard! -Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database of choice from your hosting and server of choice. +Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database of choice from your hosting and server of choice. ### Get Started You are invited to get started using Strapi. You may explore Strapi by: -1. A [Quick Start Guide](../getting-started/quick-start.html) for more intermediate to advanced developers. -2. A [Tutorial](../getting-started/quick-start-tutorial.html) for those who prefer a step-by-step introduction. - -When you're done getting started, we invite you to join our [community](https://strapi.io/community). - +1. A [Quick Start Guide](quick-start.md) for more intermediate to advanced developers. +2. A [Tutorial](quick-start-tutorial.md) for those who prefer a step-by-step introduction. +When you're done getting started, we invite you to join our [community](https://strapi.io/community). diff --git a/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md b/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md index e142c61172..6897e85ad6 100644 --- a/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md +++ b/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md @@ -1,6 +1,6 @@ # Tutorial -This **tutorial** is written for developers to **teach and explain** a step-by-step introduction to Strapi. (The [Quick Start Guide](/3.0.0-beta.x/getting-started/quick-start.html) is a more concise **How-to** version.) This tutorial takes you through the beginning steps of how you start a project like **"FoodAdvisor"** ([Github](https://github.com/strapi/foodadvisor/))([Demo](https://foodadvisor.strapi.io/)). +This **tutorial** is written for developers to **teach and explain** a step-by-step introduction to Strapi. (The [Quick Start Guide](quick-start.md) is a more concise **How-to** version.) This tutorial takes you through the beginning steps of how you start a project like **"FoodAdvisor"** ([Github](https://github.com/strapi/foodadvisor/))([Demo](https://foodadvisor.strapi.io/)). You get a good overview of the features developers love found in Strapi. @@ -10,20 +10,13 @@ By following this tutorial, you install and create your first Strapi project. ::: tip NOTE -You need to have **_Node.js and npm_** installed on your system before following these steps. If you do not have Node.js and npm installed (or are not sure), please visit our [Installation Requirements](/3.0.0-beta.x/getting-started/install-requirements.html). +You need to have **_Node.js and npm_** installed on your system before following these steps. If you do not have Node.js and npm installed (or are not sure), please visit our [Installation Requirements](install-requirements.md). ::: **Table of Contents** -1. [Install Strapi and create project](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_1-install-strapi-and-create-a-project) -2. [Create an Administrator and front-end User](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_2-create-an-adminstrator-and-front-end-user) -3. [Create a new Content Type called, "Restaurant"](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_3-create-a-new-content-type-called-restaurant) -4. [Create a new Content Type called, "Category"](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_4-create-a-new-content-type-called-category) -5. [Create a new Group and Repeatable Field called, "Hours of Operations"](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_5-create-a-new-group-and-repeatable-field-called-hours-of-operation) -6. [Manage and add content to the "Restaurant" Content Type](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_6-manage-and-add-content-to-a-restaurant-content-type) -7. [Set Roles and Permissions](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_7-set-roles-and-permissions) -8. [Consume the Content Type API](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_8-consume-the-content-type-api) +[[toc]] ## 1. Install Strapi and create a project @@ -140,7 +133,7 @@ Using the `--quickstart` flag installs Strapi using an [SQLite](https://www.sqli **Note:** An **SQLite** database is an excellent database to use for prototyping and _developing_ Strapi projects. **SQLite** is a light database that ports effortlessly to the other relational databases (**MySQL**, **PostgreSQL**, and **MariaDB**). It is recommended to **develop** with SQLite and to use another relational database (MySQL, PostgreSQL or MariaDB) in production. -**Note:** If you would like to use **MongoDB** in production, you need to [install, run, and use MongoDB to develop your Strapi project (in development)](/3.0.0-beta.x/guides/databases.html#mongodb-installation). +**Note:** If you would like to use **MongoDB** in production, you need to [install, run, and use MongoDB to develop your Strapi project (in development)](../guides/databases.md#mongodb-installation). ::: You are now ready to create a new **Administrator** and new front-end **User**. @@ -626,7 +619,7 @@ If you would like to see the route of any specific **Content Type**, you need to πŸ‘ Congratulations, you have now completed the **Strapi Getting Started Tutorial**. Where to go next? - Learn how to use Strapi with React ([Gatsby](https://blog.strapi.io/building-a-static-website-using-gatsby-and-strapi) or [Next.js](https://blog.strapi.io/strapi-next-setup/)) or Vue.js ([Nuxt.js](https://blog.strapi.io/cooking-a-deliveroo-clone-with-nuxt-vue-js-graphql-strapi-and-stripe-setup-part-1-7/)). -- Read the [concepts](../concepts/concepts.html) to deep dive into Strapi +- Read the **concepts** to deep dive into Strapi - Get help on [StackOverflow](https://stackoverflow.com/questions/tagged/strapi) - Read the [source code](https://github.com/strapi/strapi), [contribute](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md) or [give a star](https://github.com/strapi/strapi) on GitHub - Follow us on [Twitter](https://twitter.com/strapijs) to get the latest news diff --git a/docs/3.0.0-beta.x/getting-started/quick-start.md b/docs/3.0.0-beta.x/getting-started/quick-start.md index 6e17d172db..cabc153edc 100644 --- a/docs/3.0.0-beta.x/getting-started/quick-start.md +++ b/docs/3.0.0-beta.x/getting-started/quick-start.md @@ -6,9 +6,9 @@ Get ready to get Strapi up and running in **less than 5 minutes** πŸš€. -_For a step-by-step guide, please take a look at the [detailed tutorial](quick-start-tutorial.html)._ +_For a step-by-step guide, please take a look at the [detailed tutorial](quick-start-tutorial.md)._ -(Before continuing, please make sure [Node.js and npm are properly installed](install-requirements.html) on your machine. You can [install the Yarn v1.2.0+ package here](https://yarnpkg.com/en/).) +(Before continuing, please make sure [Node.js and npm are properly installed](install-requirements.md) on your machine. You can [install the Yarn v1.2.0+ package here](https://yarnpkg.com/en/).) ## 1. Install Strapi and Create a new project @@ -111,7 +111,7 @@ Here we are! The list of **restaurants** is accessible at [`http://localhost:133 πŸ‘ Congratulations, you have now completed the **Strapi Quick Start**. Where to go next? - Learn how to use Strapi with React ([Gatsby](https://blog.strapi.io/building-a-static-website-using-gatsby-and-strapi) or [Next.js](https://blog.strapi.io/strapi-next-setup/)) or Vue.js ([Nuxt.js](https://blog.strapi.io/cooking-a-deliveroo-clone-with-nuxt-vue-js-graphql-strapi-and-stripe-setup-part-1-7/)). -- Read the [concepts](../concepts/concepts.html) and do the [Tutorial](/3.0.0-beta.x/getting-started/quick-start-tutorial.html) to deep dive into Strapi. +- Read the **concepts** and do the [Tutorial](quick-start-tutorial.md) to deep dive into Strapi. - Get help on [StackOverflow](https://stackoverflow.com/questions/tagged/strapi). - Read the [source code](https://github.com/strapi/strapi), [contribute](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md) or [give a star](https://github.com/strapi/strapi) on GitHub. - Follow us on [Twitter](https://twitter.com/strapijs) to get the latest news. diff --git a/docs/3.0.0-beta.x/guides/databases.md b/docs/3.0.0-beta.x/guides/databases.md index 11259bc574..8d820427bd 100644 --- a/docs/3.0.0-beta.x/guides/databases.md +++ b/docs/3.0.0-beta.x/guides/databases.md @@ -4,12 +4,12 @@ Strapi gives you the option to choose the most appropriate database for your pro **MariaDB**. The following documentation covers how to install these databases locally (for development purposes) and on various hosted or cloud server solutions (for staging or production purposes). :::note -Deploying **Strapi** itself is covered in the [Deployment Guide](/3.0.0-beta.x/guides/deployment.html). +Deploying **Strapi** itself is covered in the [Deployment Guide](deployment.md). ::: ## SQLite Installation -SQLite is the default ([Quick Start](/3.0.0-beta.x/getting-started/quick-start.html)) and recommended database to quickly create an app locally. +SQLite is the default ([Quick Start](../getting-started/quick-start.md)) and recommended database to quickly create an app locally. ### Install SQLite locally @@ -38,7 +38,7 @@ npx create-strapi-app my-project --quickstart This will create a new project and launch it in the browser. ::: note -The [Quick Start Guide](/3.0.0-beta.x/getting-started/quick-start.html) is a complete step-by-step tutorial +The [Quick Start Guide](../getting-started/quick-start.md) is a complete step-by-step tutorial ::: ## MongoDB Installation @@ -240,7 +240,7 @@ $ strapi develop ``` -You have successfully installed Strapi with MongoDB on your local development environment. You are now ready to [create your first user](/3.0.0-beta.x/getting-started/quick-start.html#_3-create-an-admin-user). +You have successfully installed Strapi with MongoDB on your local development environment. You are now ready to [create your first user](../getting-started/quick-start.md#_3-create-an-admin-user). --- @@ -248,7 +248,7 @@ You have successfully installed Strapi with MongoDB on your local development en Follow these steps to configure a local Strapi project to use a [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) free 512 MB account in production. (Please see [MongoDB Atlas Documentation](https://docs.atlas.mongodb.com/getting-started/) if you have any questions.) -- You must have already [created your Strapi project using MongoDB](/3.0.0-beta.x/guides/databases.html#install-strapi-locally-with-mongodb). +- You must have already [created your Strapi project using MongoDB](databases.md#install-strapi-locally-with-mongodb). - You must have already created a [free MongoDB Atlas account](https://www.mongodb.com/cloud/atlas). #### 1. Log in to your account to create a **Project** and a **Cluster** @@ -342,7 +342,7 @@ The above configuration will create a database called `strapi`, the _default dat ::: ::: danger WARNING -We recommend replacing sensitive (eg. "URI string" above) information in your database.json files before uploading your project to a public repository such as GitHub. For more information about using environment variables, please read [dynamic configurations](/3.0.0-beta.x/configurations/configurations.html#dynamic-configurations). +We recommend replacing sensitive (eg. "URI string" above) information in your database.json files before uploading your project to a public repository such as GitHub. For more information about using environment variables, please read [dynamic configurations](../concepts/configurations.md#dynamic-configurations). ::: diff --git a/docs/3.0.0-beta.x/guides/deployment.md b/docs/3.0.0-beta.x/guides/deployment.md index 96519b228c..5bc1fc9d51 100644 --- a/docs/3.0.0-beta.x/guides/deployment.md +++ b/docs/3.0.0-beta.x/guides/deployment.md @@ -3,7 +3,7 @@ Strapi gives you many possible deployment options for your project or application. Strapi can be deployed on traditional hosting servers or services such as Heroku, AWS, Azure and others. The following documentation covers how to develop locally with Strapi and deploy Strapi with various hosting options. ::: note -Deploying **databases** along with Strapi is covered in the [Databases Guide](/3.0.0-beta.x/guides/databases.html). +Deploying **databases** along with Strapi is covered in the [Databases Guide](../guides/databases.md). ::: ## Configuration @@ -24,7 +24,7 @@ Update the `production` settings with the IP and domain name where the project w In case your database is not running on the same server, make sure that the environment of your production database (`./config/environments/production/database.json`) is set properly. -If you are passing a number of configuration item values via environment variables which is always encouraged for production environment, read the section for [Dynamic Configuration](../configurations/configurations.md#dynamic-configurations). Here is an example: +If you are passing a number of configuration item values via environment variables which is always encouraged for production environment, read the section for [Dynamic Configuration](../concepts/configurations.md#dynamic-configurations). Here is an example: **Path β€”** `./config/environments/production/server.json`. @@ -95,11 +95,11 @@ strapi(/* {...} */).start(); ### Advanced configurations -If you want to host the administration on another server than the API, [please take a look at this dedicated section](../advanced/customize-admin.md#deployment). +If you want to host the administration on another server than the API, [please take a look at this dedicated section](../admin-panel/deploy.md). ## Amazon AWS -This is a step-by-step guide for deploying a Strapi project to [Amazon AWS EC2](https://aws.amazon.com/ec2/). This guide will connect to an [Amazon AWS RDS](https://aws.amazon.com/rds/) for managing and hosting the database. Optionally, this guide will show you how to connect host and serve images on [Amazon AWS S3](https://aws.amazon.com/s3/). Prior to starting this guide, you should have created a [Strapi project](/3.0.0-beta.x/getting-started/quick-start.html), to use for deploying on AWS. +This is a step-by-step guide for deploying a Strapi project to [Amazon AWS EC2](https://aws.amazon.com/ec2/). This guide will connect to an [Amazon AWS RDS](https://aws.amazon.com/rds/) for managing and hosting the database. Optionally, this guide will show you how to connect host and serve images on [Amazon AWS S3](https://aws.amazon.com/s3/). Prior to starting this guide, you should have created a [Strapi project](../getting-started/quick-start.md), to use for deploying on AWS. ### Amazon AWS Install Requirement and creating an IAM non-root user @@ -748,7 +748,7 @@ Your `Strapi` project has been installed on an **AWS EC2 instance** using **Ubun ## Digital Ocean -This is a step-by-step guide for deploying a Strapi project to [Digital Ocean](https://www.digitalocean.com/). Databases can be on a [Digital Ocean Droplet](https://www.digitalocean.com/docs/droplets/) or hosted externally as a service. Prior to starting this guide, you should have created a [Strapi project](/3.0.0-beta.x/getting-started/quick-start.html). +This is a step-by-step guide for deploying a Strapi project to [Digital Ocean](https://www.digitalocean.com/). Databases can be on a [Digital Ocean Droplet](https://www.digitalocean.com/docs/droplets/) or hosted externally as a service. Prior to starting this guide, you should have created a [Strapi project](../getting-started/quick-start.md). ### Digital Ocean Install Requirements @@ -979,7 +979,7 @@ Command may disrupt existing ssh connections. Proceed with operation (y|n)? y Firewall is active and enabled on system startup ``` -Your Strapi project is now installed on your **Droplet**. You have a few more steps prior to being able to access Strapi and [create your first user](https://strapi.io/documentation/3.0.0-beta.x/getting-started/quick-start.html#_3-create-an-admin-user). +Your Strapi project is now installed on your **Droplet**. You have a few more steps prior to being able to access Strapi and [create your first user](../getting-started/quick-start.md#_3-create-an-admin-user). You will next need to [install and configure PM2 Runtime](#install-and-configure-pm2-runtime). @@ -1037,7 +1037,7 @@ pm2 start ecosystem.config.js `pm2` is now set-up to use an `ecosystem.config.js` to manage restarting your application upon changes. This is a recommended best practice. -**OPTIONAL:** You may see your project and set-up your first administrator user, by [creating an admin user](https://strapi.io/documentation/3.0.0-beta.x/getting-started/quick-start.html#_3-create-an-admin-user). +**OPTIONAL:** You may see your project and set-up your first administrator user, by [creating an admin user](../getting-started/quick-start.md#_3-create-an-admin-user). ::: note Earlier, `Port 1337` was allowed access for **testing and setup** purposes. After setting up **NGINX**, the **Port 1337** needs to have access **denied**. @@ -1298,11 +1298,11 @@ Follow the instructions and return to your command line. #### 3. Create a new project (or use an existing one) -Create a [new Strapi project](/3.0.0-beta.x/getting-started/quick-start.html) (if you want to deploy an existing project go to step 4). +Create a [new Strapi project](../getting-started/quick-start.md) (if you want to deploy an existing project go to step 4). ::: warning NOTE -If you plan to use **MongoDB** with your project, [refer to the create a Strapi project with MongoDB section of the documentation](/3.0.0-beta.x/guides/databases.html#install-mongodb-locally) then, jump to step 4. +If you plan to use **MongoDB** with your project, [refer to the create a Strapi project with MongoDB section of the documentation](../guides/databases.md#install-mongodb-locally) then, jump to step 4. ::: @@ -1463,11 +1463,11 @@ npm install pg --save Please follow these steps the **deploy a Strapi app with MongoDB on Heroku**. -You must have completed the [steps to use Strapi with MongoDB Atlas](/3.0.0-beta.x/guides/databases.html#install-on-atlas-mongodb-atlas) - through **4. Retrieve database credentials**. +You must have completed the [steps to use Strapi with MongoDB Atlas](../guides/databases.md#install-on-atlas-mongodb-atlas) - through **4. Retrieve database credentials**. #### 1. Set environment variables -When you [set-up your MongoDB Atlas database](/3.0.0-beta.x/guides/databases.html#install-on-atlas-mongodb-atlas) you noted a connection string. Similar to this: +When you [set-up your MongoDB Atlas database](../guides/databases.md#install-on-atlas-mongodb-atlas) you noted a connection string. Similar to this: ```bash mongodb://paulbocuse:@strapidatabase-shard-00-00-fxxx6c.mongodb.net:27017,strapidatabase-shard-00-01-fxxxc.mongodb.net:27017,strapidatabase-shard-00-02-fxxxc.mongodb.net:27017/test?ssl=true&replicaSet=strapidatabase-shard-0&authSource=admin&retryWrites=true&w=majority @@ -1538,7 +1538,7 @@ heroku open If you see the Strapi Welcome page, you have correctly set-up, configured and deployed your Strapi project on Heroku. You will now need to set-up your `admin user` as the production database is brand-new (and empty). -You can now continue with the [Tutorial - Creating an Admin User](/3.0.0-beta.x/getting-started/quick-start-tutorial.html#_3-create-an-admin-user), if you have any questions on how to proceed. +You can now continue with the [Tutorial - Creating an Admin User](../getting-started/quick-start-tutorial.md#_3-create-an-admin-user), if you have any questions on how to proceed. ::: warning For security reasons, the Content Type Builder plugin is disabled in production. To update content structure, please make your changes locally and deploy again. diff --git a/docs/3.0.0-beta.x/migration-guide/migration-guide-alpha.26-to-beta.md b/docs/3.0.0-beta.x/migration-guide/migration-guide-alpha.26-to-beta.md index ec1e145b47..e03535b450 100644 --- a/docs/3.0.0-beta.x/migration-guide/migration-guide-alpha.26-to-beta.md +++ b/docs/3.0.0-beta.x/migration-guide/migration-guide-alpha.26-to-beta.md @@ -196,7 +196,7 @@ You can leave all your files in `./config` unchanged but remove the `server.auto One of our main objectives for the `beta` is to make it easier and quicker to upgrade to more recent versions of Strapi. This is why moving forward, plugins will be located in the `node_modules` folder. -[Read more](https://strapi.io/documentation/3.0.0-beta.x/concepts/concepts.html#files-structure) +[Read more](../concepts/file-structure.md) Let's start by creating a new folder called `./extensions`. This folder needs to exist even if it's empty. You may use a `.gitkeep` file to ensure the folder isn't deleted from the repository (if it's empty) when cloning. [More details](https://davidwalsh.name/git-empty-directory). @@ -495,7 +495,7 @@ The only difference is that the admin of a local plugin is ignored for the momen In the `beta`, we are introducing the `Core API`, which is replacing the templates that were generated before. Now when you create a new model your `controller` and `service` will be empty modules and will be used to override the default behaviors. -Read more about [controllers](https://strapi.io/documentation/3.0.0-beta.x/guides/controllers.html) or [services](https://strapi.io/documentation/3.0.0-beta.x/guides/services.html) +Read more about [controllers](../concepts/controllers.md) or [services](../concepts/services.md) To migrate, you will only have to delete the methods you haven't modified or created from your `controllers` and `services` diff --git a/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.15-to-beta.16.md b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.15-to-beta.16.md index bc34092dee..4d164b7512 100644 --- a/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.15-to-beta.16.md +++ b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.15-to-beta.16.md @@ -90,7 +90,7 @@ To make sure a Wysiwyg field stays the same when deploying, we introduced the `r ### Custom controllers and services -If you are using [core services](../guides/services.md), you previously needed to call `result.toJSON()` or `result.toObject()` to get a plain javascript object. This is not the case anymore, you will now receive a simple object directly. +If you are using [core services](../concepts/services.md), you previously needed to call `result.toJSON()` or `result.toObject()` to get a plain javascript object. This is not the case anymore, you will now receive a simple object directly. **Before**: @@ -113,9 +113,9 @@ module.exports = { }; ``` -The same modification was made to `strapi.query()`. Read more about **Queries** [here](../guides/queries.md). +The same modification was made to `strapi.query()`. Read more about **Queries** [here](../concepts/queries.md). -Keep in mind that if you are running custom ORM queries with Bookshelf or Mongoose you will still have to call `toJSON` or `toObject`. Check out this section about [custom queries](../guides/queries.html#api-reference). +Keep in mind that if you are running custom ORM queries with Bookshelf or Mongoose you will still have to call `toJSON` or `toObject`. Check out this section about [custom queries](../concepts/queries.md#api-reference). ### Bootstrap function @@ -167,7 +167,7 @@ module.exports = () => {}; ### Custom hooks -If you have custom [hooks](../advanced/hooks.md) in your project, the `initialize` function will not receive a callback anymore. You can either use an async function, return a promise or simply run a synchronous function. +If you have custom [hooks](../concepts/hooks.md) in your project, the `initialize` function will not receive a callback anymore. You can either use an async function, return a promise or simply run a synchronous function. **Before** diff --git a/docs/3.0.0-beta.x/plugin-development/backend-development.md b/docs/3.0.0-beta.x/plugin-development/backend-development.md index 8a27a4662c..58162a2f9e 100644 --- a/docs/3.0.0-beta.x/plugin-development/backend-development.md +++ b/docs/3.0.0-beta.x/plugin-development/backend-development.md @@ -7,7 +7,7 @@ This section explains how the 'back-end part' of your plugin works. The plugin API routes are defined in the `./plugins/**/config/routes.json` file. ::: note -Please refer to [router documentation](../guides/routing.md) for information. +Please refer to [router documentation](../concepts/routing.md) for information. ::: **Route prefix** @@ -38,7 +38,7 @@ Please refer to the [CLI documentation](../cli/CLI.md) for more information. Controllers contain functions executed according to the requested route. -Please refer to the [Controllers documentation](../guides/controllers.md) for more information. +Please refer to the [Controllers documentation](../concepts/controllers.md) for more information. ## Models @@ -61,7 +61,7 @@ module.exports = { Also, the table/collection name won't be `users` because you already have a `User` model. That's why, the framework will automatically prefix the table/collection name for this model with the name of the plugin. Which means in our example, the table/collection name of the `User` model of our plugin `Users & Permissions` will be `users-permissions_users`. If you want to force the table/collection name of the plugin's model, you can add the `collectionName` attribute in your model. -Please refer to the [Models documentation](../guides/models.md) for more information. +Please refer to the [Models documentation](../concepts/models.md) for more information. ## Policies @@ -103,7 +103,7 @@ A plugin can have its own policies, such as adding security rules. For instance, } ``` -Please refer to the [Policies documentation](../guides/policies.md) for more information. +Please refer to the [Policies documentation](../concepts/policies.md) for more information. ## ORM queries diff --git a/docs/3.0.0-beta.x/plugin-development/frontend-development.md b/docs/3.0.0-beta.x/plugin-development/frontend-development.md index 076c7b9245..fcaa9daace 100644 --- a/docs/3.0.0-beta.x/plugin-development/frontend-development.md +++ b/docs/3.0.0-beta.x/plugin-development/frontend-development.md @@ -4,7 +4,7 @@ This feature is currently not available (coming soon). ::: - From db8fa6fd5d062618d41046ff510b977494b98972 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 23 Oct 2019 10:51:51 +0200 Subject: [PATCH 03/17] Create custom local providers --- docs/3.0.0-beta.x/plugins/email.md | 23 +++++++++++++++++++++++ docs/3.0.0-beta.x/plugins/upload.md | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/3.0.0-beta.x/plugins/email.md b/docs/3.0.0-beta.x/plugins/email.md index 97fc777238..cc7d83ce96 100644 --- a/docs/3.0.0-beta.x/plugins/email.md +++ b/docs/3.0.0-beta.x/plugins/email.md @@ -88,3 +88,26 @@ In the `send` function you will have access to: - `config` that contain configuration you setup in your admin panel - `options` that contain option your send when you called the `send` function from the email plugin service + +To use it you will have to publish it on **npm**. + +### Create a local provider + +If you want create your own provider without publishing it on **npm** you can follow these following steps: + +- You create a `providers` folder in your application. +- Create your provider as explain in the documentation eg. `./providers/strapi-provider-email-[...]/...` +- Then update your `package.json` to link your `strapi-provider-email-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider. + +```json +{ + ... + "dependencies": { + ... + "strapi-provider-email-[...]": "file:providers/strapi-provider-email-[...]", + ... + } +} +``` + +- Finally, run `yarn install` or `npm install` to install your new custom provider. diff --git a/docs/3.0.0-beta.x/plugins/upload.md b/docs/3.0.0-beta.x/plugins/upload.md index 4bcbc54741..caddb40764 100644 --- a/docs/3.0.0-beta.x/plugins/upload.md +++ b/docs/3.0.0-beta.x/plugins/upload.md @@ -293,3 +293,26 @@ Then, visit [http://localhost:1337/admin/plugins/upload/configurations/developme ## Create providers If you want to create your own, make sure the name starts with `strapi-provider-upload-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `upload` and `delete` functions. + +To use it you will have to publish it on **npm**. + +### Create a local provider + +If you want create your own provider without publishing it on **npm** you can follow these following steps: + +- You create a `providers` folder in your application. +- Create your provider as explain in the documentation eg. `./providers/strapi-provider-upload-[...]/...` +- Then update your `package.json` to link your `strapi-provider-upload-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider. + +```json +{ + ... + "dependencies": { + ... + "strapi-provider-upload-[...]": "file:providers/strapi-provider-upload-[...]", + ... + } +} +``` + +- Finally, run `yarn install` or `npm install` to install your new custom provider. From 87a2c35434631a8ec882498ed148689b07b8d123 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 23 Oct 2019 11:19:38 +0200 Subject: [PATCH 04/17] Update service call from controller --- docs/3.0.0-beta.x/concepts/controllers.md | 35 ++++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/docs/3.0.0-beta.x/concepts/controllers.md b/docs/3.0.0-beta.x/concepts/controllers.md index 25f72f0acb..b31a37552e 100644 --- a/docs/3.0.0-beta.x/concepts/controllers.md +++ b/docs/3.0.0-beta.x/concepts/controllers.md @@ -50,6 +50,8 @@ const { parseMultipartData, sanitizeEntity } = require('strapi-utils'); #### `find` ```js +const { sanitizeEntity } = require('strapi-utils'); + module.exports = { /** * Retrieve records. @@ -60,9 +62,9 @@ module.exports = { async find(ctx) { let entities; if (ctx.query._q) { - entities = await service.search(ctx.query); + entities = await strapi.services.restaurant.search(ctx.query); } else { - entities = await service.find(ctx.query); + entities = await strapi.services.restaurant.find(ctx.query); } return entities.map(entity => sanitizeEntity(entity, { model })); @@ -77,6 +79,8 @@ module.exports = { #### `findOne` ```js +const { sanitizeEntity } = require('strapi-utils'); + module.exports = { /** * Retrieve a record. @@ -85,7 +89,7 @@ module.exports = { */ async findOne(ctx) { - const entity = await service.findOne(ctx.params); + const entity = await strapi.services.restaurant.findOne(ctx.params); return sanitizeEntity(entity, { model }); }, }; @@ -107,9 +111,9 @@ module.exports = { count(ctx) { if (ctx.query._q) { - return service.countSearch(ctx.query); + return strapi.services.restaurant.countSearch(ctx.query); } - return service.count(ctx.query); + return strapi.services.restaurant.count(ctx.query); }, }; ``` @@ -121,6 +125,8 @@ module.exports = { #### `create` ```js +const { parseMultipartData, sanitizeEntity } = require('strapi-utils'); + module.exports = { /** * Create a record. @@ -132,9 +138,9 @@ module.exports = { let entity; if (ctx.is('multipart')) { const { data, files } = parseMultipartData(ctx); - entity = await service.create(data, { files }); + entity = await strapi.services.restaurant.create(data, { files }); } else { - entity = await service.create(ctx.request.body); + entity = await strapi.services.restaurant.create(ctx.request.body); } return sanitizeEntity(entity, { model }); }, @@ -148,6 +154,8 @@ module.exports = { #### `update` ```js +const { parseMultipartData, sanitizeEntity } = require('strapi-utils'); + module.exports = { /** * Update a record. @@ -159,9 +167,14 @@ module.exports = { let entity; if (ctx.is('multipart')) { const { data, files } = parseMultipartData(ctx); - entity = await service.update(ctx.params, data, { files }); + entity = await strapi.services.restaurant.update(ctx.params, data, { + files, + }); } else { - entity = await service.update(ctx.params, ctx.request.body); + entity = await strapi.services.restaurant.update( + ctx.params, + ctx.request.body + ); } return sanitizeEntity(entity, { model }); @@ -176,6 +189,8 @@ module.exports = { #### `delete` ```js +const { sanitizeEntity } = require('strapi-utils'); + module.exports = { /** * delete a record. @@ -184,7 +199,7 @@ module.exports = { */ async delete(ctx) { - const entity = await service.delete(ctx.params); + const entity = await strapi.services.restaurant.delete(ctx.params); return sanitizeEntity(entity, { model }); }, }; From ccfff990ff27a0d159fe00f1a088199bc3cc515e Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 23 Oct 2019 14:36:51 +0200 Subject: [PATCH 05/17] Add error handling guide --- docs/.vuepress/config.js | 1 + docs/3.0.0-beta.x/guides/error-handling.md | 89 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 docs/3.0.0-beta.x/guides/error-handling.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 03fb10ae3d..319a2ec0fb 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -126,6 +126,7 @@ module.exports = { children: [ '/3.0.0-beta.x/guides/databases', '/3.0.0-beta.x/guides/deployment', + '/3.0.0-beta.x/guides/error-handling', '/3.0.0-beta.x/guides/webhooks', ], }, diff --git a/docs/3.0.0-beta.x/guides/error-handling.md b/docs/3.0.0-beta.x/guides/error-handling.md new file mode 100644 index 0000000000..6c9b899fc5 --- /dev/null +++ b/docs/3.0.0-beta.x/guides/error-handling.md @@ -0,0 +1,89 @@ +# Error handling + +In this guide we will see how you can handle errors to send it on the Application Monitoring / Error Tracking Software you want. + +::: note +In this example we will use [Sentry](https://sentry.io). +::: + +## Create a middleware + +To handle errors, we will have to use a [middleware](../concepts/middlewares.md) that will catch errors and send them to Sentry. + +- Create a `./middlewares/sentry/index.js` file. + +**Path β€”** `./middlewares/sentry/index.js` + +```js +module.exports = strapi => { + return { + initialize() { + strapi.app.use(async (ctx, next) => { + await next(); + }); + }, + }; +}; +``` + +## Handle errors + +Here is the [Node.js client documentation](https://docs.sentry.io/clients/node/) + +- Now add the logic that will catch errors. + +**Path β€”** `./middlewares/sentry/index.js` + +```js +var Raven = require('raven'); +Raven.config('https://@sentry.io/').install(); + +module.exports = strapi => { + return { + initialize() { + strapi.app.use(async (ctx, next) => { + try { + await next(); + } catch (error) { + Raven.captureException(error); + throw error; + } + }); + }, + }; +}; +``` + +::: warning +It's important to `throw(error);` to not stop the middleware stack. If you don't do that, **Boom** will not structure errors messages. +::: + +## Configure the middleware + +You will have to order this middleware at the end of the middleware stack. + +**Path β€”** `./config/middleware.json` + +```json +{ + ... + "after": [ + "parser", + "router", + "sentry" + ] + } +} +``` + +And fianlly you have to enable the middleware. + +**Path β€”** `./config/environments/**/middleware.json` + +```json +{ + "sentry": { + "enabled": true + } +} +``` From 0e7712e9346795919529c7913e97eb5f85117a83 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 14:49:07 +0200 Subject: [PATCH 06/17] Lock mongoose version to be 5.7.4 --- packages/strapi-hook-mongoose/package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index daa39e3cb3..420f15f90b 100644 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -16,7 +16,7 @@ "main": "./lib", "dependencies": { "lodash": "^4.17.11", - "mongoose": "^5.5.9", + "mongoose": "5.7.4", "mongoose-float": "^1.0.4", "mongoose-long": "^0.2.1", "pluralize": "^7.0.0", diff --git a/yarn.lock b/yarn.lock index fe9cf13822..1f2161fb93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12155,7 +12155,7 @@ mongoose-long@^0.2.1: resolved "https://registry.yarnpkg.com/mongoose-long/-/mongoose-long-0.2.1.tgz#2d4f560430338bfbe7129e31a543c497a2d6a4db" integrity sha512-cbzEW5rShz8MxoTMFUidf13KObGkauA4ILeR3XcIdI7VLzMXwwXy///gLAbN2fD6vYy2ZAMDnCopQrCkNH9VNQ== -mongoose@^5.5.13, mongoose@^5.5.9: +mongoose@5.7.4, mongoose@^5.5.13: version "5.7.4" resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.7.4.tgz#b6a77a9217dace917ab028fa5dc72f400f2faf4b" integrity sha512-IgqQS5HIaZ8tG2cib6QllfIw2Wc/A0QVOsdKLsSqRolqJFWOjI0se3vsKXLNkbEcuJ1xziW3e/jPhBs65678Hg== From 7a61db72851d3ddf3fef172b47100737eb075ceb Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 15:11:30 +0200 Subject: [PATCH 07/17] v3.0.0-beta.17.4 --- examples/getstarted/package.json | 34 +++++++++---------- lerna.json | 2 +- packages/create-strapi-app/package.json | 4 +-- packages/strapi-admin/package.json | 9 +++-- packages/strapi-generate-api/package.json | 2 +- .../strapi-generate-controller/package.json | 2 +- packages/strapi-generate-model/package.json | 2 +- packages/strapi-generate-new/package.json | 2 +- packages/strapi-generate-plugin/package.json | 2 +- packages/strapi-generate-policy/package.json | 2 +- packages/strapi-generate-service/package.json | 2 +- packages/strapi-generate/package.json | 4 +-- packages/strapi-helper-plugin/package.json | 2 +- packages/strapi-hook-bookshelf/package.json | 6 ++-- packages/strapi-hook-ejs/package.json | 2 +- packages/strapi-hook-knex/package.json | 2 +- packages/strapi-hook-mongoose/package.json | 4 +-- packages/strapi-hook-redis/package.json | 4 +-- packages/strapi-middleware-views/package.json | 2 +- .../package.json | 6 ++-- .../package.json | 8 ++--- .../strapi-plugin-documentation/package.json | 4 +-- packages/strapi-plugin-email/package.json | 8 ++--- packages/strapi-plugin-graphql/package.json | 4 +-- .../package.json | 4 +-- packages/strapi-plugin-upload/package.json | 8 ++--- .../package.json | 6 ++-- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../strapi-provider-upload-local/package.json | 2 +- .../package.json | 2 +- packages/strapi-utils/package.json | 2 +- packages/strapi/package.json | 20 +++++------ 37 files changed, 87 insertions(+), 88 deletions(-) diff --git a/examples/getstarted/package.json b/examples/getstarted/package.json index 81ddae6344..ccfb31cfff 100644 --- a/examples/getstarted/package.json +++ b/examples/getstarted/package.json @@ -1,7 +1,7 @@ { "name": "getstarted", "private": true, - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "A Strapi application.", "scripts": { "develop": "strapi develop", @@ -15,22 +15,22 @@ "mysql": "^2.17.1", "pg": "^7.10.0", "sqlite3": "^4.0.6", - "strapi": "3.0.0-beta.17.3", - "strapi-admin": "3.0.0-beta.17.3", - "strapi-hook-bookshelf": "3.0.0-beta.17.3", - "strapi-hook-knex": "3.0.0-beta.17.3", - "strapi-hook-mongoose": "3.0.0-beta.17.3", - "strapi-middleware-views": "3.0.0-beta.17.3", - "strapi-plugin-content-manager": "3.0.0-beta.17.3", - "strapi-plugin-content-type-builder": "3.0.0-beta.17.3", - "strapi-plugin-documentation": "3.0.0-beta.17.3", - "strapi-plugin-email": "3.0.0-beta.17.3", - "strapi-plugin-graphql": "3.0.0-beta.17.3", - "strapi-plugin-upload": "3.0.0-beta.17.3", - "strapi-plugin-users-permissions": "3.0.0-beta.17.3", - "strapi-provider-email-mailgun": "3.0.0-beta.17.3", - "strapi-provider-upload-aws-s3": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3" + "strapi": "3.0.0-beta.17.4", + "strapi-admin": "3.0.0-beta.17.4", + "strapi-hook-bookshelf": "3.0.0-beta.17.4", + "strapi-hook-knex": "3.0.0-beta.17.4", + "strapi-hook-mongoose": "3.0.0-beta.17.4", + "strapi-middleware-views": "3.0.0-beta.17.4", + "strapi-plugin-content-manager": "3.0.0-beta.17.4", + "strapi-plugin-content-type-builder": "3.0.0-beta.17.4", + "strapi-plugin-documentation": "3.0.0-beta.17.4", + "strapi-plugin-email": "3.0.0-beta.17.4", + "strapi-plugin-graphql": "3.0.0-beta.17.4", + "strapi-plugin-upload": "3.0.0-beta.17.4", + "strapi-plugin-users-permissions": "3.0.0-beta.17.4", + "strapi-provider-email-mailgun": "3.0.0-beta.17.4", + "strapi-provider-upload-aws-s3": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4" }, "strapi": { "uuid": "getstarted" diff --git a/lerna.json b/lerna.json index ff93f66ea8..eba191e9d5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "packages": [ "packages/*", "examples/*" diff --git a/packages/create-strapi-app/package.json b/packages/create-strapi-app/package.json index 42ff8bc855..5e1018a859 100644 --- a/packages/create-strapi-app/package.json +++ b/packages/create-strapi-app/package.json @@ -1,6 +1,6 @@ { "name": "create-strapi-app", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a new Strapi application.", "license": "MIT", "homepage": "http://strapi.io", @@ -21,7 +21,7 @@ ], "dependencies": { "commander": "^2.20.0", - "strapi-generate-new": "3.0.0-beta.17.3" + "strapi-generate-new": "3.0.0-beta.17.4" }, "scripts": { "test": "echo \"no tests yet\"" diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index c6ebeed19f..b6ec5e008e 100644 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-admin", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Strapi Admin", "repository": { "type": "git", @@ -70,8 +70,8 @@ "reselect": "^3.0.1", "sanitize.css": "^4.1.0", "shelljs": "^0.7.8", - "strapi-helper-plugin": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3", + "strapi-helper-plugin": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4", "style-loader": "^0.23.1", "styled-components": "^4.2.0", "terser-webpack-plugin": "^1.2.3", @@ -100,6 +100,5 @@ "npm": ">=6.0.0" }, "license": "MIT", - "gitHead": "c85658a19b8fef0f3164c19693a45db305dc07a9", - "devDependencies": {} + "gitHead": "c85658a19b8fef0f3164c19693a45db305dc07a9" } diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index ee4d9d3a24..11a0d58587 100644 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-api", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate an API for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index ebf839a2ea..89f04ef2bd 100644 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-controller", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a controller for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index d7131d95ea..a40e801ce4 100644 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-model", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a model for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index 8ed65a5441..219fc2778a 100644 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-new", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a new Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index b2879fd038..ec4c101714 100644 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-plugin", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate an plugin for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index 273b62b5fc..f2393bb17b 100644 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-policy", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a policy for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index 0204c46972..e2f3d1a7fb 100644 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-service", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Generate a service for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index 9e8e444fb5..b7de5712eb 100644 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Master of ceremonies for the Strapi generators.", "homepage": "http://strapi.io", "keywords": [ @@ -20,7 +20,7 @@ "fs-extra": "^8.0.1", "lodash": "^4.17.11", "reportback": "^2.0.2", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-utils": "3.0.0-beta.17.4" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index e564ecfb14..6c08ddf678 100644 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-helper-plugin", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Helper for Strapi plugins development", "files": [ "dist" diff --git a/packages/strapi-hook-bookshelf/package.json b/packages/strapi-hook-bookshelf/package.json index 04eed10e26..c7e061d388 100644 --- a/packages/strapi-hook-bookshelf/package.json +++ b/packages/strapi-hook-bookshelf/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-bookshelf", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Bookshelf hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -22,8 +22,8 @@ "lodash": "^4.17.11", "pluralize": "^7.0.0", "rimraf": "^2.6.3", - "strapi-hook-knex": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-hook-knex": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4" }, "strapi": { "dependencies": [ diff --git a/packages/strapi-hook-ejs/package.json b/packages/strapi-hook-ejs/package.json index c6af262de6..618e161226 100644 --- a/packages/strapi-hook-ejs/package.json +++ b/packages/strapi-hook-ejs/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-ejs", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "EJS hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index 3c96e82c22..f0db5dc184 100644 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-knex", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Knex hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index 420f15f90b..01d057e3dc 100644 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-mongoose", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Mongoose hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -20,7 +20,7 @@ "mongoose-float": "^1.0.4", "mongoose-long": "^0.2.1", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-utils": "3.0.0-beta.17.4" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index 64ff4d7d04..c10c306c6b 100644 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-redis", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Redis hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "lodash": "^4.17.11", "rimraf": "^2.6.3", "stack-trace": "0.0.10", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-utils": "3.0.0-beta.17.4" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index 1d3a4fb8c3..f79472a529 100644 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -1,6 +1,6 @@ { "name": "strapi-middleware-views", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Views middleware to enable server-side rendering for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index eed31bc77d..e32238b870 100644 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-manager", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "A powerful UI to easily manage your data.", "strapi": { "name": "Content Manager", @@ -32,8 +32,8 @@ "redux-immutable": "^4.0.0", "reselect": "^3.0.1", "showdown": "^1.9.0", - "strapi-helper-plugin": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3", + "strapi-helper-plugin": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4", "styled-components": "^4.2.0", "yup": "^0.27.0" }, diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index e8a45e34c6..41c4b02399 100644 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-type-builder", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Strapi plugin to create content type (API).", "strapi": { "name": "Content Type Builder", @@ -29,9 +29,9 @@ "redux": "^4.0.1", "redux-immutable": "^4.0.0", "reselect": "^3.0.1", - "strapi-generate": "3.0.0-beta.17.3", - "strapi-generate-api": "3.0.0-beta.17.3", - "strapi-helper-plugin": "3.0.0-beta.17.3", + "strapi-generate": "3.0.0-beta.17.4", + "strapi-generate-api": "3.0.0-beta.17.4", + "strapi-helper-plugin": "3.0.0-beta.17.4", "yup": "^0.27.0" }, "author": { diff --git a/packages/strapi-plugin-documentation/package.json b/packages/strapi-plugin-documentation/package.json index fc2639ef8b..580917a78e 100755 --- a/packages/strapi-plugin-documentation/package.json +++ b/packages/strapi-plugin-documentation/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-documentation", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "This is the description of the plugin.", "strapi": { "name": "Documentation", @@ -32,7 +32,7 @@ "redux": "^4.0.1", "redux-immutable": "^4.0.0", "reselect": "^4.0.0", - "strapi-helper-plugin": "3.0.0-beta.17.3", + "strapi-helper-plugin": "3.0.0-beta.17.4", "swagger-ui-dist": "3.22.1" }, "author": { diff --git a/packages/strapi-plugin-email/package.json b/packages/strapi-plugin-email/package.json index dd3b404739..cdbb95bd78 100644 --- a/packages/strapi-plugin-email/package.json +++ b/packages/strapi-plugin-email/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-email", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "This is the description of the plugin.", "strapi": { "name": "Email", @@ -12,13 +12,13 @@ "test": "echo \"no tests yet\"" }, "dependencies": { - "strapi-provider-email-sendmail": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-provider-email-sendmail": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4" }, "devDependencies": { "react-copy-to-clipboard": "5.0.1", "rimraf": "^2.6.3", - "strapi-helper-plugin": "3.0.0-beta.17.3" + "strapi-helper-plugin": "3.0.0-beta.17.4" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 42fc121623..5e1d5e4b43 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-graphql", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "This is the description of the plugin.", "strapi": { "name": "graphql", @@ -23,7 +23,7 @@ "graphql-type-long": "^0.1.1", "koa-compose": "^4.1.0", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-utils": "3.0.0-beta.17.4" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index 3b42a7122c..b9005c6284 100644 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-settings-manager", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Strapi plugin to manage settings.", "strapi": { "name": "Settings Manager", @@ -27,7 +27,7 @@ "redux": "^4.0.1", "reselect": "^3.0.1", "shelljs": "^0.7.8", - "strapi-helper-plugin": "3.0.0-beta.17.3" + "strapi-helper-plugin": "3.0.0-beta.17.4" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 9b4973fcad..eda85df460 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-upload", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "This is the description of the plugin.", "strapi": { "name": "Files Upload", @@ -23,9 +23,9 @@ "react-router-dom": "^5.0.0", "react-transition-group": "^2.5.0", "reactstrap": "^5.0.0", - "strapi-helper-plugin": "3.0.0-beta.17.3", - "strapi-provider-upload-local": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3", + "strapi-helper-plugin": "3.0.0-beta.17.4", + "strapi-provider-upload-local": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4", "stream-to-array": "^2.3.0", "uuid": "^3.2.1" }, diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index 09a6ae5a27..424bc28dd8 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-users-permissions", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Protect your API with a full-authentication process based on JWT", "strapi": { "name": "Roles & Permissions", @@ -31,8 +31,8 @@ "reactstrap": "^5.0.0", "redux-saga": "^0.16.0", "request": "^2.83.0", - "strapi-helper-plugin": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3", + "strapi-helper-plugin": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4", "uuid": "^3.1.0" }, "devDependencies": { diff --git a/packages/strapi-provider-email-amazon-ses/package.json b/packages/strapi-provider-email-amazon-ses/package.json index f013916c2f..d8fe629b16 100644 --- a/packages/strapi-provider-email-amazon-ses/package.json +++ b/packages/strapi-provider-email-amazon-ses/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-amazon-ses", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Amazon SES provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-mailgun/package.json b/packages/strapi-provider-email-mailgun/package.json index 9be5f233a7..0fd3766d19 100644 --- a/packages/strapi-provider-email-mailgun/package.json +++ b/packages/strapi-provider-email-mailgun/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-mailgun", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Mailgun provider for strapi email plugin", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendgrid/package.json b/packages/strapi-provider-email-sendgrid/package.json index 63e07104e0..a0c529b3f6 100644 --- a/packages/strapi-provider-email-sendgrid/package.json +++ b/packages/strapi-provider-email-sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendgrid", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Sendgrid provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendmail/package.json b/packages/strapi-provider-email-sendmail/package.json index 0b65757dc5..b94ce9721e 100644 --- a/packages/strapi-provider-email-sendmail/package.json +++ b/packages/strapi-provider-email-sendmail/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendmail", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Sendmail provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-aws-s3/package.json b/packages/strapi-provider-upload-aws-s3/package.json index 7427fa29c5..db383ad410 100644 --- a/packages/strapi-provider-upload-aws-s3/package.json +++ b/packages/strapi-provider-upload-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-aws-s3", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "AWS S3 provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-cloudinary/package.json b/packages/strapi-provider-upload-cloudinary/package.json index 1095a9168d..34ccd5d909 100644 --- a/packages/strapi-provider-upload-cloudinary/package.json +++ b/packages/strapi-provider-upload-cloudinary/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-cloudinary", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Cloudinary provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-local/package.json b/packages/strapi-provider-upload-local/package.json index 11c0b73422..5b8819c289 100644 --- a/packages/strapi-provider-upload-local/package.json +++ b/packages/strapi-provider-upload-local/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-local", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Local provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-rackspace/package.json b/packages/strapi-provider-upload-rackspace/package.json index a05f7c1dbf..65c9af2b9f 100644 --- a/packages/strapi-provider-upload-rackspace/package.json +++ b/packages/strapi-provider-upload-rackspace/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-rackspace", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Rackspace provider for strapi upload", "main": "./lib", "keywords": [], diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index c0b6899e0a..d9d0e7a7ac 100644 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -1,6 +1,6 @@ { "name": "strapi-utils", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "Shared utilities for the Strapi packages", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi/package.json b/packages/strapi/package.json index 1ceb7b49b3..67ffe4fabf 100644 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -1,6 +1,6 @@ { "name": "strapi", - "version": "3.0.0-beta.17.3", + "version": "3.0.0-beta.17.4", "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite", "homepage": "http://strapi.io", "directories": { @@ -48,15 +48,15 @@ "resolve-cwd": "^3.0.0", "rimraf": "^2.6.2", "shelljs": "^0.8.3", - "strapi-generate": "3.0.0-beta.17.3", - "strapi-generate-api": "3.0.0-beta.17.3", - "strapi-generate-controller": "3.0.0-beta.17.3", - "strapi-generate-model": "3.0.0-beta.17.3", - "strapi-generate-new": "3.0.0-beta.17.3", - "strapi-generate-plugin": "3.0.0-beta.17.3", - "strapi-generate-policy": "3.0.0-beta.17.3", - "strapi-generate-service": "3.0.0-beta.17.3", - "strapi-utils": "3.0.0-beta.17.3" + "strapi-generate": "3.0.0-beta.17.4", + "strapi-generate-api": "3.0.0-beta.17.4", + "strapi-generate-controller": "3.0.0-beta.17.4", + "strapi-generate-model": "3.0.0-beta.17.4", + "strapi-generate-new": "3.0.0-beta.17.4", + "strapi-generate-plugin": "3.0.0-beta.17.4", + "strapi-generate-policy": "3.0.0-beta.17.4", + "strapi-generate-service": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4" }, "scripts": { "test": "jest --verbose", From 8932bc9bd47eced644a05d84cbc2ecc9be4c870c Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 16:07:22 +0200 Subject: [PATCH 08/17] Remove settings-maanger pacakage from the repo --- .../strapi-plugin-settings-manager/.gitignore | 10 -- .../strapi-plugin-settings-manager/.npmignore | 103 ------------------ packages/strapi-plugin-settings-manager/.snyk | 9 -- .../strapi-plugin-settings-manager/LICENSE.md | 7 -- .../strapi-plugin-settings-manager/README.md | 7 -- .../package.json | 54 --------- 6 files changed, 190 deletions(-) delete mode 100644 packages/strapi-plugin-settings-manager/.gitignore delete mode 100644 packages/strapi-plugin-settings-manager/.npmignore delete mode 100644 packages/strapi-plugin-settings-manager/.snyk delete mode 100644 packages/strapi-plugin-settings-manager/LICENSE.md delete mode 100644 packages/strapi-plugin-settings-manager/README.md delete mode 100644 packages/strapi-plugin-settings-manager/package.json diff --git a/packages/strapi-plugin-settings-manager/.gitignore b/packages/strapi-plugin-settings-manager/.gitignore deleted file mode 100644 index 6a37080b59..0000000000 --- a/packages/strapi-plugin-settings-manager/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Don’t check auto-generated stuff into git -coverage -build -node_modules -stats.json - -# Cruft -.DS_Store -npm-debug.log -.idea diff --git a/packages/strapi-plugin-settings-manager/.npmignore b/packages/strapi-plugin-settings-manager/.npmignore deleted file mode 100644 index a788251bc6..0000000000 --- a/packages/strapi-plugin-settings-manager/.npmignore +++ /dev/null @@ -1,103 +0,0 @@ -############################ -# OS X -############################ - -.DS_Store -.AppleDouble -.LSOverride -Icon -.Spotlight-V100 -.Trashes -._* - - -############################ -# Linux -############################ - -*~ - - -############################ -# Windows -############################ - -Thumbs.db -ehthumbs.db -Desktop.ini -$RECYCLE.BIN/ -*.cab -*.msi -*.msm -*.msp - - -############################ -# Packages -############################ - -*.7z -*.csv -*.dat -*.dmg -*.gz -*.iso -*.jar -*.rar -*.tar -*.zip -*.com -*.class -*.dll -*.exe -*.o -*.seed -*.so -*.swo -*.swp -*.swn -*.swm -*.out -*.pid - - -############################ -# Logs and databases -############################ - -*.log -*.sql - - -############################ -# Misc. -############################ - -*# -ssl -.editorconfig -.gitattributes -.idea -nbproject - - -############################ -# Node.js -############################ - -lib-cov -lcov.info -pids -logs -results -node_modules -.node_history - - -############################ -# Tests -############################ - -test -testApp -coverage diff --git a/packages/strapi-plugin-settings-manager/.snyk b/packages/strapi-plugin-settings-manager/.snyk deleted file mode 100644 index 95befbce52..0000000000 --- a/packages/strapi-plugin-settings-manager/.snyk +++ /dev/null @@ -1,9 +0,0 @@ -# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. -version: v1.12.0 -# ignores vulnerabilities until expiry date; change duration by modifying expiry date -ignore: - shelljs: - - '*': - reason: testing - expires: 2019-01-04T14:37:42.177Z -patch: {} diff --git a/packages/strapi-plugin-settings-manager/LICENSE.md b/packages/strapi-plugin-settings-manager/LICENSE.md deleted file mode 100644 index de086c6dba..0000000000 --- a/packages/strapi-plugin-settings-manager/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2015-2019 Strapi Solutions. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/strapi-plugin-settings-manager/README.md b/packages/strapi-plugin-settings-manager/README.md deleted file mode 100644 index 6c61d8dd06..0000000000 --- a/packages/strapi-plugin-settings-manager/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Strapi plugin Settings Manager - -⚠️ This package is deprecated ⚠️ - -We have decided to deprecate this package because we believe that this plugin should be integrated in the `strapi-admin` package. -As we are building a plugin ecosystem we know that many plugins will have configurations and those configurations should be served by the core package. -This plugin was originally thought to allow developers to set databases, their server configurations using the UI. However this configurations since these settings are for advanced developers we think that they are at ease with using the appropriate files to do so. diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json deleted file mode 100644 index b9005c6284..0000000000 --- a/packages/strapi-plugin-settings-manager/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "strapi-plugin-settings-manager", - "version": "3.0.0-beta.17.4", - "description": "Strapi plugin to manage settings.", - "strapi": { - "name": "Settings Manager", - "icon": "wrench", - "description": "settings-manager.plugin.description" - }, - "scripts": { - "test": "echo \"no tests yet\"" - }, - "dependencies": { - "classnames": "^2.2.6", - "immutable": "^3.8.2", - "invariant": "^2.2.1", - "lodash": "^4.17.11", - "react": "^16.9.0", - "react-dom": "^16.9.0", - "react-helmet": "^5.2.0", - "react-intl": "^2.8.0", - "react-redux": "^7.0.2", - "react-router": "^5.0.0", - "react-router-dom": "^5.0.0", - "react-transition-group": "^2.5.0", - "reactstrap": "^5.0.0", - "redux": "^4.0.1", - "reselect": "^3.0.1", - "shelljs": "^0.7.8", - "strapi-helper-plugin": "3.0.0-beta.17.4" - }, - "author": { - "name": "Strapi team", - "email": "hi@strapi.io", - "url": "http://strapi.io" - }, - "maintainers": [ - { - "name": "Strapi team", - "email": "hi@strapi.io", - "url": "http://strapi.io" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/strapi/strapi.git" - }, - "engines": { - "node": ">=10.0.0", - "npm": ">=6.0.0" - }, - "license": "MIT", - "gitHead": "c85658a19b8fef0f3164c19693a45db305dc07a9" -} From 017c976729d11e0e9019da4234cc2d798a7e9d1a Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 16:20:57 +0200 Subject: [PATCH 09/17] Add migration guide --- ...gration-guide-beta.16-17.3-to-beta.17.4.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md diff --git a/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md new file mode 100644 index 0000000000..5e804a1127 --- /dev/null +++ b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md @@ -0,0 +1,38 @@ +# Migration guide from beta.16.8 through beta.17.3 to beta.17.4 + +Upgrading your Strapi application to `v3.0.0-beta.17.4`. + +## Upgrading your dependencies + +Start by upgrading your dependencies. Make sur to use exact versions. + +::: danger +`strapi-plugin-settings-manager` has been deprecated. you need to remove it from your `package.json`. +::: + +Your package.json would look like this: + +```json +{ + //... + "dependencies": { + "strapi": "3.0.0-beta.17.4", + "strapi-admin": "3.0.0-beta.17.4", + "strapi-hook-bookshelf": "3.0.0-beta.17.4", + "strapi-hook-knex": "3.0.0-beta.17.4", + "strapi-plugin-content-manager": "3.0.0-beta.17.4", + "strapi-plugin-content-type-builder": "3.0.0-beta.17.4", + "strapi-plugin-email": "3.0.0-beta.17.4", + "strapi-plugin-graphql": "3.0.0-beta.17.4", + "strapi-plugin-upload": "3.0.0-beta.17.4", + "strapi-plugin-users-permissions": "3.0.0-beta.17.4", + "strapi-utils": "3.0.0-beta.17.4" + } +} +``` + +Then run either `yarn install` or `npm install`. + +## Rebuilding your administration panel + +Now delete the `.cache` and `build` folders. Then run `yarn develop`. From 7b17358ebca6456ee6d624caf5bb85d0e3d485d9 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 23 Oct 2019 16:25:35 +0200 Subject: [PATCH 10/17] Fixes --- docs/3.0.0-beta.x/migration-guide/README.md | 1 + ...-to-beta.17.4.md => migration-guide-beta.16-to-beta.17.4.md} | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename docs/3.0.0-beta.x/migration-guide/{migration-guide-beta.16-17.3-to-beta.17.4.md => migration-guide-beta.16-to-beta.17.4.md} (96%) diff --git a/docs/3.0.0-beta.x/migration-guide/README.md b/docs/3.0.0-beta.x/migration-guide/README.md index 3ea0772b50..cf503412cf 100644 --- a/docs/3.0.0-beta.x/migration-guide/README.md +++ b/docs/3.0.0-beta.x/migration-guide/README.md @@ -7,6 +7,7 @@ Read the [Migration guide from alpha.26 to beta](migration-guide-alpha.26-to-bet ## Beta guides - [Migration guide from beta.15 to beta.16](migration-guide-beta.15-to-beta.16.md) +- [Migration guide from beta.16+ to beta.17.4](migration-guide-beta.16-to-beta.17.4.md) ## Alpha guides diff --git a/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-to-beta.17.4.md similarity index 96% rename from docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md rename to docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-to-beta.17.4.md index 5e804a1127..0777c424f4 100644 --- a/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-17.3-to-beta.17.4.md +++ b/docs/3.0.0-beta.x/migration-guide/migration-guide-beta.16-to-beta.17.4.md @@ -10,7 +10,7 @@ Start by upgrading your dependencies. Make sur to use exact versions. `strapi-plugin-settings-manager` has been deprecated. you need to remove it from your `package.json`. ::: -Your package.json would look like this: +Your package.json should look like this: ```json { From 7e09cc066180f2b05b82b0a2f6f6323450a1ddc4 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 23 Oct 2019 17:56:17 +0200 Subject: [PATCH 11/17] Add jwt validation guide --- docs/.vuepress/config.js | 1 + docs/3.0.0-beta.x/guides/jwt-validation.md | 103 +++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 docs/3.0.0-beta.x/guides/jwt-validation.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 319a2ec0fb..94034e9886 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -126,6 +126,7 @@ module.exports = { children: [ '/3.0.0-beta.x/guides/databases', '/3.0.0-beta.x/guides/deployment', + '/3.0.0-beta.x/guides/jwt-validation', '/3.0.0-beta.x/guides/error-handling', '/3.0.0-beta.x/guides/webhooks', ], diff --git a/docs/3.0.0-beta.x/guides/jwt-validation.md b/docs/3.0.0-beta.x/guides/jwt-validation.md new file mode 100644 index 0000000000..73ec509333 --- /dev/null +++ b/docs/3.0.0-beta.x/guides/jwt-validation.md @@ -0,0 +1,103 @@ +# JWT validation + +In this guide we will see how validate a JWT via another service. + +When you signin with the authentication route `POST /auth/local`, Strapi generate a `JWT` that let your users request your API as an authenticated user. + +```json +{ + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTcxODIyMDAzLCJleHAiOjE1NzQ0MTQwMDN9.T5XQGSDZ6TjgM5NYaVDbYJt84qHZTrtBqWu1Q3ShINw", + "user": { + "email": "admin@strapi.io", + "id": 1, + "username": "admin" + } +} +``` + +These users are managed in the application database and can be managed via the admin dashboard. + +We can now imagine you have a `JWT` that come from [Auth0](https://auth0.com) and you want to make sure the `JWT` is correct and allow this user to use the Strapi API endpoints. + +## Customise the JWT validation function + +We have to use the [customization concept](../concepts/customization.md) to update the function that validate the `JWT`. This feature is powered by the **Users & Permissions** plugin. + +Here is the file we will have to customize: [permission.js](https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-users-permissions/config/policies/permissions.js) + +- We have now to create a file that follow this path `./extensions/users-permissions/config/policies/permissions.js`. +- You will have to add in this new file, the same content of the original one. + +Now we are ready to create our custom validation code. + +## Write our own logic + +First we have to define where write our code. + +```js +const _ = require('lodash'); + +module.exports = async (ctx, next) => { + let role; + + if (ctx.request && ctx.request.header && ctx.request.header.authorization) { + try { + const { id, isAdmin = false } = await strapi.plugins[ + 'users-permissions' + ].services.jwt.getToken(ctx); + + ... + + } catch (err) { + // It will be there! + + return handleErrors(ctx, err, 'unauthorized'); + } +``` + +The `jwt.getToken` will throw and error it the token don't come from Strapi. So if it's not a Strapi `JWT` token, lets test if it's an Auth0 token. + +We will have to write our validation code before throwing an error. + +By using the [Auth0 get user profile](https://auth0.com/docs/api/authentication?http#get-user-info) documentation, I will verify a valid user match with the current `JWT` + +```js +const _ = require('lodash'); +const axios = require('axios'); + +module.exports = async (ctx, next) => { + let role; + + if (ctx.request && ctx.request.header && ctx.request.header.authorization) { + try { + const { id, isAdmin = false } = await strapi.plugins[ + 'users-permissions' + ].services.jwt.getToken(ctx); + + ... + + } catch (err) { + try { + const data = await axios({ + method: 'post', + url: 'http://YOUR_DOMAIN/userinfo', + headers: { + Authorization: ctx.request.header.authorization + } + }); + + // if you want do more validation test + // feel free to add your code here. + + return await next(); + } catch (error) { + return handleErrors(ctx, new Error('Invalid token: Token did not match with Strapi and Auth0'), 'unauthorized'); + } + + return handleErrors(ctx, err, 'unauthorized'); + } +``` + +::: warning +In the code example we use `axios` you will have to install the dependence to make it works or use and other library to request Auth0 API. +::: From 8cfc6e43c6b153709cd4f1e95c109486aa518762 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Thu, 24 Oct 2019 00:12:20 +0200 Subject: [PATCH 12/17] Fix graphql nested groups returning null --- packages/strapi-hook-bookshelf/lib/mount-models.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/strapi-hook-bookshelf/lib/mount-models.js b/packages/strapi-hook-bookshelf/lib/mount-models.js index c966ef2736..57c96a6b09 100644 --- a/packages/strapi-hook-bookshelf/lib/mount-models.js +++ b/packages/strapi-hook-bookshelf/lib/mount-models.js @@ -740,6 +740,8 @@ module.exports = ({ models, target, plugin = false }, ctx) => { options.withRelated = [] .concat(createGroupsPopulate()) .concat(createAssociationPopulate()); + } else if (_.isEmpty(options.withRelated)) { + options.withRelated = createGroupsPopulate(); } else { options.withRelated = formatPopulateOptions(options.withRelated); } From 66fb305745d8e72c36d1c77ae4b8e3c36a17e18a Mon Sep 17 00:00:00 2001 From: Imron <42175898+imronras@users.noreply.github.com> Date: Thu, 24 Oct 2019 13:57:18 +0700 Subject: [PATCH 13/17] [Typo] Adminstrato, Fixed typo Adminstrator => Administrator --- docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md b/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md index e142c61172..ddf9ee0fa3 100644 --- a/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md +++ b/docs/3.0.0-beta.x/getting-started/quick-start-tutorial.md @@ -145,7 +145,7 @@ Using the `--quickstart` flag installs Strapi using an [SQLite](https://www.sqli You are now ready to create a new **Administrator** and new front-end **User**. -## 2. Create an Adminstrator and front-end User +## 2. Create an Administrator and front-end User The first step is to create an **Administrator** (or "root user") for your project. An **Administrator** has all administrator privileges and access rights. (You can read more about why **Administrators** and front-end **Users** are separate [here](https://blog.strapi.io/why-we-split-the-management-of-the-admin-users-and-end-users/).) From ae813243183fdc1bb84ab4b9223c9ab4bc8c29a9 Mon Sep 17 00:00:00 2001 From: Derrick Mehaffy Date: Thu, 24 Oct 2019 05:44:58 -0700 Subject: [PATCH 14/17] Add note about uploads for Heroku to deployment docs --- docs/3.0.0-beta.x/guides/deployment.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/3.0.0-beta.x/guides/deployment.md b/docs/3.0.0-beta.x/guides/deployment.md index 5bc1fc9d51..d74cdc201a 100644 --- a/docs/3.0.0-beta.x/guides/deployment.md +++ b/docs/3.0.0-beta.x/guides/deployment.md @@ -1562,3 +1562,11 @@ git commit -am "Changes to my-project noted" git push heroku master heroku open ``` + +--- + +### File Uploads + +Like with project updates on Heroku, the file system doesn't support local uploading of files as they will be wiped when Heroku "Cycles" the dyno. This type of file system is called [ephemeral](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem), which means the file system only lasts until the dyno is restarted (with Heroku this happens any time you redeploy or during their regular restart which can happen every few hours or every day). + +Due to Heroku's filesystem you will need to use an upload provider such as AWS S3, Cloudinary, or Rackspace. You can view the documentation for installing providers [here](../plugins/upload.md#install-providers) and you can see a list of providers from both Strapi and the community on [npmjs.com](https://www.npmjs.com/search?q=strapi-provider-upload-&page=0&perPage=20). From 3b0c77b5cc066592d9eb33df744f8db25c7d69fa Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Thu, 24 Oct 2019 15:08:42 +0200 Subject: [PATCH 15/17] Fix typo PR feedback --- docs/.vuepress/config.js | 2 +- docs/3.0.0-beta.x/content-api/parameters.md | 2 +- .../getting-started/introduction.md | 2 +- .../{error-handling.md => error-catching.md} | 20 +++++++++---------- docs/3.0.0-beta.x/guides/jwt-validation.md | 20 +++++++++---------- docs/3.0.0-beta.x/plugins/email.md | 6 +++--- docs/3.0.0-beta.x/plugins/upload.md | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) rename docs/3.0.0-beta.x/guides/{error-handling.md => error-catching.md} (58%) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 94034e9886..4c97873780 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -127,7 +127,7 @@ module.exports = { '/3.0.0-beta.x/guides/databases', '/3.0.0-beta.x/guides/deployment', '/3.0.0-beta.x/guides/jwt-validation', - '/3.0.0-beta.x/guides/error-handling', + '/3.0.0-beta.x/guides/error-catching', '/3.0.0-beta.x/guides/webhooks', ], }, diff --git a/docs/3.0.0-beta.x/content-api/parameters.md b/docs/3.0.0-beta.x/content-api/parameters.md index a3855983e4..4862006e71 100644 --- a/docs/3.0.0-beta.x/content-api/parameters.md +++ b/docs/3.0.0-beta.x/content-api/parameters.md @@ -3,7 +3,7 @@ See the [parameters' concepts](../concepts/parameters.md) for details. ::: warning -By default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filters system somewhere else, read the [programmatic usage](../concepts/parameters.md) section. +By default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filter system somewhere else, read the [programmatic usage](../concepts/parameters.md) section. ::: ## Available operators diff --git a/docs/3.0.0-beta.x/getting-started/introduction.md b/docs/3.0.0-beta.x/getting-started/introduction.md index 2b71aaade0..d66f990c1e 100644 --- a/docs/3.0.0-beta.x/getting-started/introduction.md +++ b/docs/3.0.0-beta.x/getting-started/introduction.md @@ -6,7 +6,7 @@ Welcome to the open source [headless CMS](https://strapi.io) developers love. ### πŸ‘‹ Welcome onboard! -Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database of choice from your hosting and server of choice. +Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database from your hosting and server of choice. ### Get Started diff --git a/docs/3.0.0-beta.x/guides/error-handling.md b/docs/3.0.0-beta.x/guides/error-catching.md similarity index 58% rename from docs/3.0.0-beta.x/guides/error-handling.md rename to docs/3.0.0-beta.x/guides/error-catching.md index 6c9b899fc5..077c9a953a 100644 --- a/docs/3.0.0-beta.x/guides/error-handling.md +++ b/docs/3.0.0-beta.x/guides/error-catching.md @@ -1,6 +1,6 @@ -# Error handling +# Error catching -In this guide we will see how you can handle errors to send it on the Application Monitoring / Error Tracking Software you want. +In this guide we will see how you can catch errors and send them to the Application Monitoring / Error Tracking Software you want. ::: note In this example we will use [Sentry](https://sentry.io). @@ -8,7 +8,7 @@ In this example we will use [Sentry](https://sentry.io). ## Create a middleware -To handle errors, we will have to use a [middleware](../concepts/middlewares.md) that will catch errors and send them to Sentry. +A [middleware](../concepts/middlewares.md) will be used in order to catch the errors which will then be sent to Sentry. - Create a `./middlewares/sentry/index.js` file. @@ -28,15 +28,15 @@ module.exports = strapi => { ## Handle errors -Here is the [Node.js client documentation](https://docs.sentry.io/clients/node/) +Here is the [Node.js client documentation](https://docs.sentry.io/platforms/node/) - Now add the logic that will catch errors. **Path β€”** `./middlewares/sentry/index.js` ```js -var Raven = require('raven'); -Raven.config('https://@sentry.io/').install(); +const Sentry = require('@sentry/node'); +Sentry.init({ dsn: 'https://@sentry.io/' }); module.exports = strapi => { return { @@ -45,7 +45,7 @@ module.exports = strapi => { try { await next(); } catch (error) { - Raven.captureException(error); + Sentry.captureException(error); throw error; } }); @@ -55,12 +55,12 @@ module.exports = strapi => { ``` ::: warning -It's important to `throw(error);` to not stop the middleware stack. If you don't do that, **Boom** will not structure errors messages. +It's important to call `throw(error);` to avoid stopping the middleware stack. If you don't re-throw the error, it won't be handled by the Strapi's error formatter and the api will never respond to the client. ::: ## Configure the middleware -You will have to order this middleware at the end of the middleware stack. +Make sure your middleware is added at the end of the middleware stack. **Path β€”** `./config/middleware.json` @@ -76,7 +76,7 @@ You will have to order this middleware at the end of the middleware stack. } ``` -And fianlly you have to enable the middleware. +And finally you have to enable the middleware. **Path β€”** `./config/environments/**/middleware.json` diff --git a/docs/3.0.0-beta.x/guides/jwt-validation.md b/docs/3.0.0-beta.x/guides/jwt-validation.md index 73ec509333..9952c9c32b 100644 --- a/docs/3.0.0-beta.x/guides/jwt-validation.md +++ b/docs/3.0.0-beta.x/guides/jwt-validation.md @@ -1,8 +1,8 @@ # JWT validation -In this guide we will see how validate a JWT via another service. +In this guide we will see how to validate a `JWT` (JSON Web Token) with a third party service. -When you signin with the authentication route `POST /auth/local`, Strapi generate a `JWT` that let your users request your API as an authenticated user. +When you sign in with the authentication route `POST /auth/local`, Strapi generates a `JWT` which lets your users request your API as an authenticated one. ```json { @@ -15,17 +15,17 @@ When you signin with the authentication route `POST /auth/local`, Strapi generat } ``` -These users are managed in the application database and can be managed via the admin dashboard. +These users are managed in the application's database and can be managed via the admin dashboard. -We can now imagine you have a `JWT` that come from [Auth0](https://auth0.com) and you want to make sure the `JWT` is correct and allow this user to use the Strapi API endpoints. +We can now imagine you have a `JWT` that comes from [Auth0](https://auth0.com) and you want to make sure the `JWT` is correct before allowing the user to use the Strapi API endpoints. -## Customise the JWT validation function +## Customize the JWT validation function -We have to use the [customization concept](../concepts/customization.md) to update the function that validate the `JWT`. This feature is powered by the **Users & Permissions** plugin. +We have to use the [customization concept](../concepts/customization.md) to update the function that validates the `JWT`. This feature is powered by the **Users & Permissions** plugin. Here is the file we will have to customize: [permission.js](https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-users-permissions/config/policies/permissions.js) -- We have now to create a file that follow this path `./extensions/users-permissions/config/policies/permissions.js`. +- We have to create a file that follows this path `./extensions/users-permissions/config/policies/permissions.js`. - You will have to add in this new file, the same content of the original one. Now we are ready to create our custom validation code. @@ -55,11 +55,11 @@ module.exports = async (ctx, next) => { } ``` -The `jwt.getToken` will throw and error it the token don't come from Strapi. So if it's not a Strapi `JWT` token, lets test if it's an Auth0 token. +The `jwt.getToken` will throw an error if the token doesn't come from Strapi. So if it's not a Strapi `JWT` token, let's test if it's an Auth0 one. We will have to write our validation code before throwing an error. -By using the [Auth0 get user profile](https://auth0.com/docs/api/authentication?http#get-user-info) documentation, I will verify a valid user match with the current `JWT` +By using the [Auth0 get user profile](https://auth0.com/docs/api/authentication?http#get-user-info) documentation, you will verify a valid user matches with the current `JWT` ```js const _ = require('lodash'); @@ -99,5 +99,5 @@ module.exports = async (ctx, next) => { ``` ::: warning -In the code example we use `axios` you will have to install the dependence to make it works or use and other library to request Auth0 API. +In the code example we use `axios` you will have to install the dependency to make it work. You can choose another library if you prefer. ::: diff --git a/docs/3.0.0-beta.x/plugins/email.md b/docs/3.0.0-beta.x/plugins/email.md index cc7d83ce96..ccfa6cdf3d 100644 --- a/docs/3.0.0-beta.x/plugins/email.md +++ b/docs/3.0.0-beta.x/plugins/email.md @@ -93,10 +93,10 @@ To use it you will have to publish it on **npm**. ### Create a local provider -If you want create your own provider without publishing it on **npm** you can follow these following steps: +If you want to create your own provider without publishing it on **npm** you can follow these steps: -- You create a `providers` folder in your application. -- Create your provider as explain in the documentation eg. `./providers/strapi-provider-email-[...]/...` +- Create a `providers` folder in your application. +- Create your provider as explained in the documentation eg. `./providers/strapi-provider-email-[...]/...` - Then update your `package.json` to link your `strapi-provider-email-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider. ```json diff --git a/docs/3.0.0-beta.x/plugins/upload.md b/docs/3.0.0-beta.x/plugins/upload.md index caddb40764..10128091d5 100644 --- a/docs/3.0.0-beta.x/plugins/upload.md +++ b/docs/3.0.0-beta.x/plugins/upload.md @@ -298,10 +298,10 @@ To use it you will have to publish it on **npm**. ### Create a local provider -If you want create your own provider without publishing it on **npm** you can follow these following steps: +If you want create your own provider without publishing it on **npm** you can follow these steps: -- You create a `providers` folder in your application. -- Create your provider as explain in the documentation eg. `./providers/strapi-provider-upload-[...]/...` +- Create a `providers` folder in your application. +- Create your provider as explained in the documentation eg. `./providers/strapi-provider-upload-[...]/...` - Then update your `package.json` to link your `strapi-provider-upload-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider. ```json From 3b4c00d1128700edef3326f0fe487822894242d9 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Thu, 24 Oct 2019 15:14:05 +0200 Subject: [PATCH 16/17] Missing one typo --- docs/3.0.0-beta.x/plugins/upload.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/3.0.0-beta.x/plugins/upload.md b/docs/3.0.0-beta.x/plugins/upload.md index 10128091d5..491b573c2c 100644 --- a/docs/3.0.0-beta.x/plugins/upload.md +++ b/docs/3.0.0-beta.x/plugins/upload.md @@ -298,7 +298,7 @@ To use it you will have to publish it on **npm**. ### Create a local provider -If you want create your own provider without publishing it on **npm** you can follow these steps: +If you want to create your own provider without publishing it on **npm** you can follow these steps: - Create a `providers` folder in your application. - Create your provider as explained in the documentation eg. `./providers/strapi-provider-upload-[...]/...` From a4414502d7bf270f825c600b2ace7472293a9c2f Mon Sep 17 00:00:00 2001 From: DMehaffy Date: Thu, 24 Oct 2019 06:29:26 -0700 Subject: [PATCH 17/17] PR feedback --- docs/3.0.0-beta.x/guides/deployment.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/3.0.0-beta.x/guides/deployment.md b/docs/3.0.0-beta.x/guides/deployment.md index d74cdc201a..aebcfe1596 100644 --- a/docs/3.0.0-beta.x/guides/deployment.md +++ b/docs/3.0.0-beta.x/guides/deployment.md @@ -1544,8 +1544,6 @@ You can now continue with the [Tutorial - Creating an Admin User](../getting-sta For security reasons, the Content Type Builder plugin is disabled in production. To update content structure, please make your changes locally and deploy again. ::: ---- - ### Project updates When Strapi is deployed to Heroku, Heroku sets the environment variable to `NODE_ENV=production`. In `production mode` Strapi disables the content-type builder (for security reasons). Additionally, if you wanted to change the default production mode in Heroku, it wouldn't work as the file system is temporary. Strapi writes files to the server when you update the content-types and these updates would disappear when Heroku restarts the server. @@ -1563,8 +1561,6 @@ git push heroku master heroku open ``` ---- - ### File Uploads Like with project updates on Heroku, the file system doesn't support local uploading of files as they will be wiped when Heroku "Cycles" the dyno. This type of file system is called [ephemeral](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem), which means the file system only lasts until the dyno is restarted (with Heroku this happens any time you redeploy or during their regular restart which can happen every few hours or every day).