mirror of
https://github.com/strapi/strapi.git
synced 2025-08-10 17:58:07 +00:00
Merge branch 'master' into step-any-fix
This commit is contained in:
commit
2f2ecb587c
@ -492,7 +492,7 @@ module.exports = {
|
||||
Query: {
|
||||
post: {
|
||||
description: 'Return a single post',
|
||||
policy: ['plugins.users-permissions.isAuthenticated', 'isOwner'], // Apply the 'isAuthenticated' policy of the `Users & Permissions` plugin, then the 'isOwner' policy before executing the resolver.
|
||||
policies: ['plugins.users-permissions.isAuthenticated', 'isOwner'], // Apply the 'isAuthenticated' policy of the `Users & Permissions` plugin, then the 'isOwner' policy before executing the resolver.
|
||||
},
|
||||
posts: {
|
||||
description: 'Return a list of posts', // Add a description to the query.
|
||||
@ -504,7 +504,7 @@ module.exports = {
|
||||
},
|
||||
postsByTags: {
|
||||
description: 'Return the posts published by the author',
|
||||
resolverOf: 'Post.findByTags', // Will apply the same policy on the custom resolver than the controller's action `findByTags`.
|
||||
resolverOf: 'Post.findByTags', // Will apply the same policy on the custom resolver as the controller's action `findByTags`.
|
||||
resolver: (obj, options, ctx) => {
|
||||
// ctx is the context of the Koa request.
|
||||
await strapi.controllers.posts.findByTags(ctx);
|
||||
@ -516,7 +516,7 @@ module.exports = {
|
||||
Mutation: {
|
||||
attachPostToAuthor: {
|
||||
description: 'Attach a post to an author',
|
||||
policy: ['plugins.users-permissions.isAuthenticated', 'isOwner'],
|
||||
policies: ['plugins.users-permissions.isAuthenticated', 'isOwner'],
|
||||
resolver: 'Post.attachToAuthor'
|
||||
}
|
||||
}
|
||||
@ -677,7 +677,7 @@ module.exports = {
|
||||
Query: {
|
||||
posts: {
|
||||
description: 'Return a list of posts',
|
||||
policy: [
|
||||
policies: [
|
||||
'plugins.users-permissions.isAuthenticated',
|
||||
'isOwner',
|
||||
'global.logging',
|
||||
@ -687,7 +687,10 @@ module.exports = {
|
||||
Mutation: {
|
||||
createPost: {
|
||||
description: 'Create a new post',
|
||||
policy: ['plugins.users-permissions.isAuthenticated', 'global.logging'],
|
||||
policies: [
|
||||
'plugins.users-permissions.isAuthenticated',
|
||||
'global.logging',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -782,7 +785,7 @@ module.exports = {
|
||||
Query: {
|
||||
posts: {
|
||||
description: 'Return a list of posts by author',
|
||||
resolverOf: 'Post.find', // Will apply the same policy on the custom resolver than the controller's action `find` located in `Post.js`.
|
||||
resolverOf: 'Post.find', // Will apply the same policy on the custom resolver as the controller's action `find` located in `Post.js`.
|
||||
resolver: (obj, options, context) => {
|
||||
// You can return a raw JSON object or a promise.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "getstarted",
|
||||
"private": true,
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "A Strapi application.",
|
||||
"scripts": {
|
||||
"develop": "strapi develop",
|
||||
@ -15,23 +15,23 @@
|
||||
"mysql": "^2.17.1",
|
||||
"pg": "^7.10.0",
|
||||
"sqlite3": "^4.0.6",
|
||||
"strapi": "3.0.0-beta.16.2",
|
||||
"strapi-admin": "3.0.0-beta.16.2",
|
||||
"strapi-hook-bookshelf": "3.0.0-beta.16.2",
|
||||
"strapi-hook-knex": "3.0.0-beta.16.2",
|
||||
"strapi-hook-mongoose": "3.0.0-beta.16.2",
|
||||
"strapi-middleware-views": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-content-manager": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-content-type-builder": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-documentation": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-email": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-graphql": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-settings-manager": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-upload": "3.0.0-beta.16.2",
|
||||
"strapi-plugin-users-permissions": "3.0.0-beta.16.2",
|
||||
"strapi-provider-email-mailgun": "3.0.0-beta.16.2",
|
||||
"strapi-provider-upload-aws-s3": "3.0.0-beta.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2"
|
||||
"strapi": "3.0.0-beta.16.3",
|
||||
"strapi-admin": "3.0.0-beta.16.3",
|
||||
"strapi-hook-bookshelf": "3.0.0-beta.16.3",
|
||||
"strapi-hook-knex": "3.0.0-beta.16.3",
|
||||
"strapi-hook-mongoose": "3.0.0-beta.16.3",
|
||||
"strapi-middleware-views": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-content-manager": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-content-type-builder": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-documentation": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-email": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-graphql": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-settings-manager": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-upload": "3.0.0-beta.16.3",
|
||||
"strapi-plugin-users-permissions": "3.0.0-beta.16.3",
|
||||
"strapi-provider-email-mailgun": "3.0.0-beta.16.3",
|
||||
"strapi-provider-upload-aws-s3": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"strapi": {
|
||||
"uuid": "getstarted"
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
"examples/*"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-strapi-app",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.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.16.2"
|
||||
"strapi-generate-new": "3.0.0-beta.16.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"no tests yet\""
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-admin",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Strapi Admin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -72,8 +72,8 @@
|
||||
"sanitize.css": "^4.1.0",
|
||||
"sass-loader": "^7.1.0",
|
||||
"shelljs": "^0.7.8",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"styled-components": "^4.2.0",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-api",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate an API for a Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-controller",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate a controller for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-model",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate a model for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-new",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate a new Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-plugin",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate an plugin for a Strapi application.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-policy",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate a policy for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate-service",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Generate a service for a Strapi API.",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-generate",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.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.16.2"
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
@ -60,6 +60,7 @@ function InputDate(props) {
|
||||
target: {
|
||||
name: props.name,
|
||||
value: moment,
|
||||
type: 'date',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class InputToggleWithErrors extends React.Component {
|
||||
InputToggleWithErrors.defaultProps = {
|
||||
autoFocus: false,
|
||||
className: '',
|
||||
customBootstrapClass: 'col-md-6',
|
||||
customBootstrapClass: 'col-md-4',
|
||||
deactivateErrorHighlight: false,
|
||||
didCheckErrors: false,
|
||||
disabled: false,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-helper-plugin",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Helper for Strapi plugins development",
|
||||
"files": [
|
||||
"dist"
|
||||
|
@ -887,17 +887,13 @@ module.exports = ({ models, target, plugin = false }, ctx) => {
|
||||
return Promise.all(updates);
|
||||
};
|
||||
|
||||
const castValueFromType = (type, value, definition) => {
|
||||
const castValueFromType = (type, value, /* definition */) => {
|
||||
// do not cast null values
|
||||
if (value === null) return null;
|
||||
|
||||
switch (type) {
|
||||
case 'json': {
|
||||
if (definition.client === 'mysql' || definition.client === 'sqlite3') {
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
case 'json':
|
||||
return JSON.stringify(value);
|
||||
// TODO: handle real date format 1970-01-01
|
||||
// TODO: handle real time format 12:00:00
|
||||
case 'time':
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-bookshelf",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2"
|
||||
"strapi-hook-knex": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"strapi": {
|
||||
"dependencies": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-ejs",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "EJS hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-knex",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Knex hook for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-mongoose",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.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.16.2"
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"author": {
|
||||
"email": "hi@strapi.io",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-hook-redis",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2"
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"author": {
|
||||
"email": "hi@strapi.io",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-middleware-views",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Views middleware to enable server-side rendering for the Strapi framework",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -212,6 +212,22 @@ function EditView({
|
||||
});
|
||||
};
|
||||
|
||||
const handleChange = ({ target: { name, value, type } }) => {
|
||||
let inputValue = value;
|
||||
|
||||
// Empty string is not a valid date,
|
||||
// Set the date to null when it's empty
|
||||
if (type === 'date' && value === '') {
|
||||
inputValue = null;
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: 'ON_CHANGE',
|
||||
keys: name.split('.'),
|
||||
value: inputValue,
|
||||
});
|
||||
};
|
||||
|
||||
const handleSubmit = async e => {
|
||||
e.preventDefault();
|
||||
const schema = createYupSchema(layout, { groups: groupLayoutsData });
|
||||
@ -278,7 +294,6 @@ function EditView({
|
||||
strapi.notification.error(error);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log({ formErrors: err });
|
||||
setIsSubmitting(false);
|
||||
const errors = get(err, 'inner', []).reduce((acc, curr) => {
|
||||
acc[
|
||||
@ -291,6 +306,7 @@ function EditView({
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
dispatch({
|
||||
type: 'SET_ERRORS',
|
||||
errors,
|
||||
@ -322,13 +338,7 @@ function EditView({
|
||||
keys: name.split('.'),
|
||||
});
|
||||
}}
|
||||
onChange={({ target: { name, value } }) => {
|
||||
dispatch({
|
||||
type: 'ON_CHANGE',
|
||||
keys: name.split('.'),
|
||||
value,
|
||||
});
|
||||
}}
|
||||
onChange={handleChange}
|
||||
onRemove={keys => {
|
||||
dispatch({
|
||||
type: 'REMOVE_RELATION',
|
||||
@ -448,13 +458,7 @@ function EditView({
|
||||
keys: name.split('.'),
|
||||
});
|
||||
}}
|
||||
onChange={({ target: { name, value } }) => {
|
||||
dispatch({
|
||||
type: 'ON_CHANGE',
|
||||
keys: name.split('.'),
|
||||
value,
|
||||
});
|
||||
}}
|
||||
onChange={handleChange}
|
||||
layout={get(groupLayoutsData, group.group, {})}
|
||||
pathname={pathname}
|
||||
removeField={(keys, shouldAddEmptyField) => {
|
||||
@ -481,13 +485,7 @@ function EditView({
|
||||
layout={layout}
|
||||
modifiedData={modifiedData}
|
||||
name={name}
|
||||
onChange={({ target: { name, value } }) => {
|
||||
dispatch({
|
||||
type: 'ON_CHANGE',
|
||||
keys: name.split('.'),
|
||||
value,
|
||||
});
|
||||
}}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -130,7 +130,7 @@ const createYupSchemaAttribute = (type, validations) => {
|
||||
.typeError();
|
||||
}
|
||||
if (['date', 'datetime'].includes(type)) {
|
||||
schema = yup.date().typeError();
|
||||
schema = yup.date();
|
||||
}
|
||||
|
||||
Object.keys(validations).forEach(validation => {
|
||||
|
@ -45,12 +45,12 @@ const createSettingsSchema = (model, schema) => {
|
||||
// should be reset when the type changes
|
||||
mainField: yup
|
||||
.string()
|
||||
.oneOf(validAttributes)
|
||||
.oneOf(validAttributes.concat('id'))
|
||||
.default('id'),
|
||||
// should be reset when the type changes
|
||||
defaultSortBy: yup
|
||||
.string()
|
||||
.oneOf(validAttributes)
|
||||
.oneOf(validAttributes.concat('id'))
|
||||
.default('id'),
|
||||
defaultSortOrder: yup
|
||||
.string()
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-content-manager",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3",
|
||||
"styled-components": "^4.2.0",
|
||||
"yup": "^0.27.0"
|
||||
},
|
||||
|
@ -35,6 +35,27 @@ describe('Test type json', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('Create entry with array value input JSON', async () => {
|
||||
const inputValue = [
|
||||
{
|
||||
key: 'value',
|
||||
},
|
||||
{
|
||||
key: 'value',
|
||||
},
|
||||
];
|
||||
const res = await rq.post('/content-manager/explorer/withjson', {
|
||||
body: {
|
||||
field: inputValue,
|
||||
},
|
||||
});
|
||||
|
||||
expect(res.statusCode).toBe(200);
|
||||
expect(res.body).toMatchObject({
|
||||
field: inputValue,
|
||||
});
|
||||
});
|
||||
|
||||
test('Create entry with value input Formdata', async () => {
|
||||
const inputValue = {
|
||||
number: '12',
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-content-type-builder",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-generate-api": "3.0.0-beta.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.2",
|
||||
"strapi-generate": "3.0.0-beta.16.3",
|
||||
"strapi-generate-api": "3.0.0-beta.16.3",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"yup": "^0.27.0"
|
||||
},
|
||||
"author": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-documentation",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.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.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"swagger-ui-dist": "3.22.1"
|
||||
},
|
||||
"author": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-email",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2"
|
||||
"strapi-provider-email-sendmail": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"react-copy-to-clipboard": "5.0.1",
|
||||
"rimraf": "^2.6.3",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.2"
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-graphql",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2"
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.2.0",
|
||||
|
@ -19,11 +19,15 @@ module.exports = {
|
||||
* @return Promise or Error.
|
||||
*/
|
||||
|
||||
composeMutationResolver: function(_schema, plugin, name, action) {
|
||||
composeMutationResolver: function({ _schema, plugin, name, action }) {
|
||||
// Extract custom resolver or type description.
|
||||
const { resolver: handler = {} } = _schema;
|
||||
|
||||
const queryName = `${action}${_.capitalize(name)}`;
|
||||
let queryName = `${action}${_.capitalize(name)}`;
|
||||
|
||||
if (_.has(handler, `Mutation.${action}`)) {
|
||||
queryName = action;
|
||||
}
|
||||
|
||||
// Retrieve policies.
|
||||
const policies = _.get(handler, `Mutation.${queryName}.policies`, []);
|
||||
@ -155,7 +159,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (strapi.plugins['users-permissions']) {
|
||||
policies.push('plugins.users-permissions.permissions');
|
||||
policies.unshift('plugins.users-permissions.permissions');
|
||||
}
|
||||
|
||||
// Populate policies.
|
||||
|
@ -69,7 +69,7 @@ module.exports = {
|
||||
* @return Promise or Error.
|
||||
*/
|
||||
|
||||
composeQueryResolver: function(_schema, plugin, name, isSingular) {
|
||||
composeQueryResolver: function({ _schema, plugin, name, isSingular }) {
|
||||
const params = {
|
||||
model: name,
|
||||
};
|
||||
@ -236,7 +236,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (strapi.plugins['users-permissions']) {
|
||||
policies.push('plugins.users-permissions.permissions');
|
||||
policies.unshift('plugins.users-permissions.permissions');
|
||||
}
|
||||
|
||||
// Populate policies.
|
||||
|
@ -326,11 +326,21 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
const queries = {
|
||||
singular:
|
||||
_.get(resolver, `Query.${singularName}`) !== false
|
||||
? Query.composeQueryResolver(_schema, plugin, name, true)
|
||||
? Query.composeQueryResolver({
|
||||
_schema,
|
||||
plugin,
|
||||
name,
|
||||
isSingular: true,
|
||||
})
|
||||
: null,
|
||||
plural:
|
||||
_.get(resolver, `Query.${pluralName}`) !== false
|
||||
? Query.composeQueryResolver(_schema, plugin, name, false)
|
||||
? Query.composeQueryResolver({
|
||||
_schema,
|
||||
plugin,
|
||||
name,
|
||||
isSingular: false,
|
||||
})
|
||||
: null,
|
||||
};
|
||||
|
||||
@ -376,15 +386,30 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
const mutations = {
|
||||
create:
|
||||
_.get(resolver, `Mutation.create${capitalizedName}`) !== false
|
||||
? Mutation.composeMutationResolver(_schema, plugin, name, 'create')
|
||||
? Mutation.composeMutationResolver({
|
||||
_schema,
|
||||
plugin,
|
||||
name,
|
||||
action: 'create',
|
||||
})
|
||||
: null,
|
||||
update:
|
||||
_.get(resolver, `Mutation.update${capitalizedName}`) !== false
|
||||
? Mutation.composeMutationResolver(_schema, plugin, name, 'update')
|
||||
? Mutation.composeMutationResolver({
|
||||
_schema,
|
||||
plugin,
|
||||
name,
|
||||
action: 'update',
|
||||
})
|
||||
: null,
|
||||
delete:
|
||||
_.get(resolver, `Mutation.delete${capitalizedName}`) !== false
|
||||
? Mutation.composeMutationResolver(_schema, plugin, name, 'delete')
|
||||
? Mutation.composeMutationResolver({
|
||||
_schema,
|
||||
plugin,
|
||||
name,
|
||||
action: 'delete',
|
||||
})
|
||||
: null,
|
||||
};
|
||||
|
||||
|
@ -228,22 +228,22 @@ const schemaBuilder = {
|
||||
const [name, action] = acc[type][resolver].split('.');
|
||||
const normalizedName = _.toLower(name);
|
||||
|
||||
acc[type][resolver] = Mutation.composeMutationResolver(
|
||||
strapi.plugins.graphql.config._schema.graphql,
|
||||
acc[type][resolver] = Mutation.composeMutationResolver({
|
||||
_schema: strapi.plugins.graphql.config._schema.graphql,
|
||||
plugin,
|
||||
normalizedName,
|
||||
action
|
||||
);
|
||||
name: normalizedName,
|
||||
action,
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'Query':
|
||||
default:
|
||||
acc[type][resolver] = Query.composeQueryResolver(
|
||||
strapi.plugins.graphql.config._schema.graphql,
|
||||
acc[type][resolver] = Query.composeQueryResolver({
|
||||
_schema: strapi.plugins.graphql.config._schema.graphql,
|
||||
plugin,
|
||||
resolver,
|
||||
'force' // Avoid singular/pluralize and force query name.
|
||||
);
|
||||
name: resolver,
|
||||
isSingular: 'force', // Avoid singular/pluralize and force query name.
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-settings-manager",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2"
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-upload",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-provider-upload-local": "3.0.0-beta.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"strapi-provider-upload-local": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3",
|
||||
"stream-to-array": "^2.3.0",
|
||||
"uuid": "^3.2.1"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-plugin-users-permissions",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"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.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2",
|
||||
"strapi-helper-plugin": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3",
|
||||
"uuid": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-amazon-ses",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Amazon SES provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-mailgun",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Mailgun provider for strapi email plugin",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-sendgrid",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Sendgrid provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-email-sendmail",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Sendmail provider for strapi email",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-aws-s3",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "AWS S3 provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-cloudinary",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Cloudinary provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-local",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Local provider for strapi upload",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-provider-upload-rackspace",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Rackspace provider for strapi upload",
|
||||
"main": "./lib",
|
||||
"keywords": [],
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi-utils",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.3",
|
||||
"description": "Shared utilities for the Strapi packages",
|
||||
"homepage": "http://strapi.io",
|
||||
"keywords": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "strapi",
|
||||
"version": "3.0.0-beta.16.2",
|
||||
"version": "3.0.0-beta.16.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": {
|
||||
@ -47,15 +47,15 @@
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"shelljs": "^0.8.3",
|
||||
"strapi-generate": "3.0.0-beta.16.2",
|
||||
"strapi-generate-api": "3.0.0-beta.16.2",
|
||||
"strapi-generate-controller": "3.0.0-beta.16.2",
|
||||
"strapi-generate-model": "3.0.0-beta.16.2",
|
||||
"strapi-generate-new": "3.0.0-beta.16.2",
|
||||
"strapi-generate-plugin": "3.0.0-beta.16.2",
|
||||
"strapi-generate-policy": "3.0.0-beta.16.2",
|
||||
"strapi-generate-service": "3.0.0-beta.16.2",
|
||||
"strapi-utils": "3.0.0-beta.16.2"
|
||||
"strapi-generate": "3.0.0-beta.16.3",
|
||||
"strapi-generate-api": "3.0.0-beta.16.3",
|
||||
"strapi-generate-controller": "3.0.0-beta.16.3",
|
||||
"strapi-generate-model": "3.0.0-beta.16.3",
|
||||
"strapi-generate-new": "3.0.0-beta.16.3",
|
||||
"strapi-generate-plugin": "3.0.0-beta.16.3",
|
||||
"strapi-generate-policy": "3.0.0-beta.16.3",
|
||||
"strapi-generate-service": "3.0.0-beta.16.3",
|
||||
"strapi-utils": "3.0.0-beta.16.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --verbose",
|
||||
|
Loading…
x
Reference in New Issue
Block a user