Merge branch 'develop' of github.com:strapi/strapi into features/media-lib

This commit is contained in:
soupette 2020-03-06 11:44:20 +01:00
commit bdc2758613
40 changed files with 122 additions and 117 deletions

View File

@ -17,7 +17,7 @@ $ yarn develop --watch-admin
### Strapi global variable
The administration exposes a global variable thqt is accessible for all the plugins.
The administration exposes a global variable that is accessible for all the plugins.
#### `strapi.backendURL`
@ -56,7 +56,7 @@ The administration url (e.g. `http://localhost:4000/admin`).
### Main plugin object
Each plugin exports all its configurations in a object. This object is located in `my-plugin/admin/src/index.js`
Each plugin exports all its configurations in an object. This object is located in `my-plugin/admin/src/index.js`
Here are its properties:
@ -169,7 +169,7 @@ Each route defined in a plugin must be prefixed by the plugin's id.
Let's say that you want to create a route `/user` with params `/:id` associated with the container UserPage.
The declaration would be as followed :
The declaration would be as follows :
**Path —** `plugins/my-plugin/admin/src/containers/App/index.js`.

View File

@ -308,6 +308,10 @@ To enable the provider, create or edit the file at `./extensions/upload/config/s
Make sure to read the provider's `README` to know what are the possible parameters.
::: tip
Some providers may have additional settings such as the AWS S3 needs an API endpoint URL. You can find a list of these for AWS [here](https://docs.aws.amazon.com/general/latest/gr/ses.html)
:::
## Create providers
You can create a Node.js module to implement a custom provider. Read the official documentation [here](https://docs.npmjs.com/creating-node-js-modules).

View File

@ -1,7 +1,7 @@
{
"name": "getstarted",
"private": true,
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "A Strapi application.",
"scripts": {
"develop": "strapi develop",
@ -15,21 +15,21 @@
"mysql": "^2.17.1",
"pg": "^7.10.0",
"sqlite3": "^4.0.6",
"strapi": "3.0.0-beta.19.2",
"strapi-admin": "3.0.0-beta.19.2",
"strapi-connector-bookshelf": "3.0.0-beta.19.2",
"strapi-connector-mongoose": "3.0.0-beta.19.2",
"strapi-middleware-views": "3.0.0-beta.19.2",
"strapi-plugin-content-manager": "3.0.0-beta.19.2",
"strapi-plugin-content-type-builder": "3.0.0-beta.19.2",
"strapi-plugin-documentation": "3.0.0-beta.19.2",
"strapi-plugin-email": "3.0.0-beta.19.2",
"strapi-plugin-graphql": "3.0.0-beta.19.2",
"strapi-plugin-upload": "3.0.0-beta.19.2",
"strapi-plugin-users-permissions": "3.0.0-beta.19.2",
"strapi-provider-email-mailgun": "3.0.0-beta.19.2",
"strapi-provider-upload-aws-s3": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2"
"strapi": "3.0.0-beta.19.3",
"strapi-admin": "3.0.0-beta.19.3",
"strapi-connector-bookshelf": "3.0.0-beta.19.3",
"strapi-connector-mongoose": "3.0.0-beta.19.3",
"strapi-middleware-views": "3.0.0-beta.19.3",
"strapi-plugin-content-manager": "3.0.0-beta.19.3",
"strapi-plugin-content-type-builder": "3.0.0-beta.19.3",
"strapi-plugin-documentation": "3.0.0-beta.19.3",
"strapi-plugin-email": "3.0.0-beta.19.3",
"strapi-plugin-graphql": "3.0.0-beta.19.3",
"strapi-plugin-upload": "3.0.0-beta.19.3",
"strapi-plugin-users-permissions": "3.0.0-beta.19.3",
"strapi-provider-email-mailgun": "3.0.0-beta.19.3",
"strapi-provider-upload-aws-s3": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3"
},
"strapi": {
"uuid": "getstarted"

View File

@ -1,5 +1,5 @@
{
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"packages": [
"packages/*",
"examples/*"

View File

@ -1,6 +1,6 @@
{
"name": "create-strapi-app",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"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.19.2"
"strapi-generate-new": "3.0.0-beta.19.3"
},
"scripts": {
"test": "echo \"no tests yet\""

View File

@ -1,6 +1,6 @@
{
"name": "strapi-admin",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Strapi Admin",
"repository": {
"type": "git",
@ -85,8 +85,8 @@
"reselect": "^3.0.1",
"sanitize.css": "^4.1.0",
"shelljs": "^0.7.8",
"strapi-helper-plugin": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3",
"style-loader": "^0.23.1",
"styled-components": "^5.0.0",
"terser-webpack-plugin": "^1.2.3",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-connector-bookshelf",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Bookshelf hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -22,7 +22,7 @@
"lodash": "^4.17.11",
"pluralize": "^7.0.0",
"rimraf": "3.0.0",
"strapi-utils": "3.0.0-beta.19.2"
"strapi-utils": "3.0.0-beta.19.3"
},
"peerDependencies": {
"knex": "^0.20.0"

View File

@ -1,6 +1,6 @@
{
"name": "strapi-connector-mongoose",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"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.19.2"
"strapi-utils": "3.0.0-beta.19.3"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-database",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Strapi's database layer",
"homepage": "http://strapi.io",
"main": "./lib/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-api",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate an API for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-controller",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate a controller for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-model",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate a model for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-new",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate a new Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,4 +1,3 @@
import React from 'react';
import pluginPkg from '../../package.json';
import pluginId from './pluginId';
import App from './containers/App';
@ -6,30 +5,28 @@ import Initializer from './containers/Initializer';
import lifecycles from './lifecycles';
import trads from './translations';
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
export default strapi => {
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
function Comp(props) {
return <App {...props} />;
}
const plugin = {
blockerComponent: null,
blockerComponentProps: {},
description: pluginDescription,
icon: pluginPkg.strapi.icon,
id: pluginId,
initializer: Initializer,
injectedComponents: [],
isReady: false,
isRequired: pluginPkg.strapi.required || false,
layout: null,
lifecycles,
leftMenuLinks: [],
leftMenuSections: [],
mainComponent: App,
name: pluginPkg.strapi.name,
preventComponentRendering: false,
trads,
};
const plugin = {
blockerComponent: null,
blockerComponentProps: {},
description: pluginDescription,
icon: pluginPkg.strapi.icon,
id: pluginId,
initializer: Initializer,
injectedComponents: [],
isReady: false,
isRequired: pluginPkg.strapi.required || false,
layout: null,
lifecycles,
leftMenuLinks: [],
leftMenuSections: [],
mainComponent: Comp,
name: pluginPkg.strapi.name,
preventComponentRendering: false,
trads,
return strapi.registerPlugin(plugin);
};
export default plugin;

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-plugin",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate an plugin for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-policy",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate a policy for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-service",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Generate a service for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"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.19.2"
"strapi-utils": "3.0.0-beta.19.3"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-helper-plugin",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Helper for Strapi plugins development",
"files": [
"dist"

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-ejs",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "EJS hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-redis",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Redis hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -19,7 +19,7 @@
"lodash": "^4.17.11",
"rimraf": "3.0.0",
"stack-trace": "0.0.10",
"strapi-utils": "3.0.0-beta.19.2"
"strapi-utils": "3.0.0-beta.19.3"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-middleware-views",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Views middleware to enable server-side rendering for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-manager",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "A powerful UI to easily manage your data.",
"strapi": {
"name": "Content Manager",
@ -30,8 +30,8 @@
"redux-immutable": "^4.0.0",
"reselect": "^3.0.1",
"showdown": "^1.9.0",
"strapi-helper-plugin": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3",
"yup": "^0.27.0"
},
"author": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-type-builder",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Strapi plugin to create content type (API).",
"strapi": {
"name": "Content Type Builder",
@ -26,10 +26,10 @@
"redux": "^4.0.1",
"redux-immutable": "^4.0.0",
"reselect": "^3.0.1",
"strapi-generate": "3.0.0-beta.19.2",
"strapi-generate-api": "3.0.0-beta.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2",
"strapi-generate": "3.0.0-beta.19.3",
"strapi-generate-api": "3.0.0-beta.19.3",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3",
"yup": "^0.27.0"
},
"author": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-documentation",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"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.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"swagger-ui-dist": "3.24.3"
},
"author": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-email",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Email",
@ -13,13 +13,13 @@
},
"dependencies": {
"lodash": "^4.17.11",
"strapi-provider-email-sendmail": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2"
"strapi-provider-email-sendmail": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3"
},
"devDependencies": {
"react-copy-to-clipboard": "5.0.1",
"rimraf": "3.0.0",
"strapi-helper-plugin": "3.0.0-beta.19.2"
"strapi-helper-plugin": "3.0.0-beta.19.3"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-graphql",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "This is the description of the plugin.",
"strapi": {
"name": "graphql",
@ -24,7 +24,7 @@
"koa-compose": "^4.1.0",
"lodash": "4.17.11",
"pluralize": "^7.0.0",
"strapi-utils": "3.0.0-beta.19.2"
"strapi-utils": "3.0.0-beta.19.3"
},
"devDependencies": {
"cross-env": "^5.2.0",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-upload",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Media Library",
@ -25,9 +25,9 @@
"react-router-dom": "^5.0.0",
"react-transition-group": "^2.5.0",
"reactstrap": "^5.0.0",
"strapi-helper-plugin": "3.0.0-beta.19.2",
"strapi-provider-upload-local": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"strapi-provider-upload-local": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3",
"stream-to-array": "^2.3.0",
"uuid": "^3.2.1"
},

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-users-permissions",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Protect your API with a full-authentication process based on JWT",
"strapi": {
"name": "Roles & Permissions",
@ -32,8 +32,8 @@
"reactstrap": "^5.0.0",
"redux-saga": "^0.16.0",
"request": "^2.83.0",
"strapi-helper-plugin": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2",
"strapi-helper-plugin": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3",
"uuid": "^3.1.0"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-amazon-ses",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Amazon SES provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-mailgun",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Mailgun provider for strapi email plugin",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendgrid",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Sendgrid provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendmail",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Sendmail provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-aws-s3",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "AWS S3 provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-cloudinary",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Cloudinary provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-local",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Local provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-rackspace",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Rackspace provider for strapi upload",
"main": "./lib",
"keywords": [],

View File

@ -1,6 +1,6 @@
{
"name": "strapi-utils",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"description": "Shared utilities for the Strapi packages",
"homepage": "http://strapi.io",
"keywords": [
@ -19,7 +19,7 @@
"pino": "^4.7.1",
"pluralize": "^7.0.0",
"shelljs": "^0.8.3",
"yup": "^0.28.0"
"yup": "0.28.1"
},
"author": {
"email": "hi@strapi.io",

View File

@ -80,9 +80,13 @@ module.exports = strapi => {
}
// Log error.
strapi.log.error(error);
const { status, body } = formatBoomPayload(error);
if (status >= 500) {
strapi.log.error(error);
}
ctx.body = body;
ctx.status = status;
}
@ -101,13 +105,13 @@ module.exports = strapi => {
// Custom function to avoid ctx.body repeat
createResponses() {
boomMethods.forEach(method => {
strapi.app.response[method] = function(...rest) {
const boomError = Boom[method](...rest) || {};
strapi.app.response[method] = function(msg, ...rest) {
const boomError = Boom[method](msg, ...rest) || {};
const { status, body } = formatBoomPayload(boomError);
// keep retro-compatibility for old error formats
body.message = body.data;
body.message = msg || body.data || body.message;
this.body = body;
this.status = status;

View File

@ -1,6 +1,6 @@
{
"name": "strapi",
"version": "3.0.0-beta.19.2",
"version": "3.0.0-beta.19.3",
"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": {
@ -50,16 +50,16 @@
"resolve-cwd": "^3.0.0",
"rimraf": "^2.6.2",
"shelljs": "^0.8.3",
"strapi-database": "3.0.0-beta.19.2",
"strapi-generate": "3.0.0-beta.19.2",
"strapi-generate-api": "3.0.0-beta.19.2",
"strapi-generate-controller": "3.0.0-beta.19.2",
"strapi-generate-model": "3.0.0-beta.19.2",
"strapi-generate-new": "3.0.0-beta.19.2",
"strapi-generate-plugin": "3.0.0-beta.19.2",
"strapi-generate-policy": "3.0.0-beta.19.2",
"strapi-generate-service": "3.0.0-beta.19.2",
"strapi-utils": "3.0.0-beta.19.2"
"strapi-database": "3.0.0-beta.19.3",
"strapi-generate": "3.0.0-beta.19.3",
"strapi-generate-api": "3.0.0-beta.19.3",
"strapi-generate-controller": "3.0.0-beta.19.3",
"strapi-generate-model": "3.0.0-beta.19.3",
"strapi-generate-new": "3.0.0-beta.19.3",
"strapi-generate-plugin": "3.0.0-beta.19.3",
"strapi-generate-policy": "3.0.0-beta.19.3",
"strapi-generate-service": "3.0.0-beta.19.3",
"strapi-utils": "3.0.0-beta.19.3"
},
"scripts": {
"postinstall": "node lib/utils/success.js"