mirror of
https://github.com/strapi/strapi.git
synced 2025-10-08 14:55:42 +00:00
Fix PR feedback
This commit is contained in:
parent
d512d503b1
commit
543f21cdb1
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ module.exports = scope => {
|
|||||||
'dependencies': {
|
'dependencies': {
|
||||||
'lodash': '4.x.x',
|
'lodash': '4.x.x',
|
||||||
'strapi': getDependencyVersion(cliPkg, 'strapi'),
|
'strapi': getDependencyVersion(cliPkg, 'strapi'),
|
||||||
'strapi-upload-local': getDependencyVersion(cliPkg, 'strapi'),
|
|
||||||
[scope.client.connector]: getDependencyVersion(cliPkg, 'strapi'),
|
[scope.client.connector]: getDependencyVersion(cliPkg, 'strapi'),
|
||||||
[scope.client.module]: scope.client.version
|
[scope.client.module]: scope.client.version
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "3.0.0-alpha.10.2",
|
"version": "3.0.0-alpha.10.2",
|
||||||
"description": "Helper for Strapi plugins development",
|
"description": "Helper for Strapi plugins development",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.0.0"
|
"npm": ">= 5.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
"url": "git://github.com/strapi/strapi.git"
|
"url": "git://github.com/strapi/strapi.git"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
"url": "git://github.com/strapi/strapi.git"
|
"url": "git://github.com/strapi/strapi.git"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"url": "git://github.com/strapi/strapi.git"
|
"url": "git://github.com/strapi/strapi.git"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -20,10 +20,10 @@ module.exports = async cb => {
|
|||||||
name: 'upload'
|
name: 'upload'
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.readdir(path.join(strapi.config.appPath, 'node_modules'), async (err, node_modules) => {
|
fs.readdir(path.join(strapi.config.appPath, 'plugins', 'upload', 'node_modules'), async (err, node_modules) => {
|
||||||
// get all upload provider
|
// get all upload provider
|
||||||
const uploads = _.filter(node_modules, (node_module) => {
|
const uploads = _.filter(node_modules, (node_module) => {
|
||||||
return _.startsWith(node_module, ('strapi-upload-'));
|
return _.startsWith(node_module, ('strapi-upload'));
|
||||||
});
|
});
|
||||||
|
|
||||||
strapi.plugins.upload.config.providers = [];
|
strapi.plugins.upload.config.providers = [];
|
||||||
@ -31,16 +31,16 @@ module.exports = async cb => {
|
|||||||
// mount all providers to get configs
|
// mount all providers to get configs
|
||||||
_.forEach(uploads, (node_module) => {
|
_.forEach(uploads, (node_module) => {
|
||||||
strapi.plugins.upload.config.providers.push(
|
strapi.plugins.upload.config.providers.push(
|
||||||
require(path.join(`${strapi.config.appPath}/node_modules/${node_module}`))
|
require(path.join(`${strapi.config.appPath}/plugins/upload/node_modules/${node_module}`))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// if profiver config not exit set one by default
|
// if provider config not exit set one by default
|
||||||
const config = await pluginStore.get({key: 'provider'});
|
const config = await pluginStore.get({key: 'provider'});
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
const provider = strapi.plugins.upload.config.providers[0];
|
const provider = _.find(strapi.plugins.upload.config.providers, {provider: 'local'});
|
||||||
|
|
||||||
const value = _.assign({}, provider, {
|
const value = _.assign({}, provider, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -51,8 +51,8 @@ module.exports = async cb => {
|
|||||||
await pluginStore.set({key: 'provider', value});
|
await pluginStore.set({key: 'provider', value});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
strapi.log.error(`Can't laod ${config.provider} upload provider`);
|
strapi.log.error(`Can't load ${config.provider} upload provider.`);
|
||||||
strapi.log.warn(`Please install strapi-upload-${config.provider} --save`);
|
strapi.log.warn(`Please install strapi-upload-${config.provider} --save in ${path.join(strapi.config.appPath, 'plugins', 'upload')} folder.`);
|
||||||
strapi.stop();
|
strapi.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
index: async (ctx) => {
|
index: async (ctx) => {
|
||||||
console.log(ctx.request.body.files);
|
|
||||||
const config = await strapi.store({
|
const config = await strapi.store({
|
||||||
environment: strapi.config.environment,
|
environment: strapi.config.environment,
|
||||||
type: 'plugin',
|
type: 'plugin',
|
||||||
@ -35,7 +34,7 @@ module.exports = {
|
|||||||
|
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
if (files[i].size > config.sizeLimit) {
|
if (files[i].size > config.sizeLimit) {
|
||||||
return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Upload.status.sizeLimit' }] }] : 'One of file is bigger than limit size!');
|
return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Upload.status.sizeLimit', values: {file: files[i].name} }] }] : `${files[i].name} file is bigger than limit size!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
},
|
},
|
||||||
"ext": {
|
"ext": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"configurable": false,
|
"configurable": false
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
"mime": {
|
"mime": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
"uuid": "^3.2.1"
|
"uuid": "^3.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"strapi-upload-local": "3.0.0-alpha.10.2",
|
||||||
"strapi-helper-plugin": "3.0.0-alpha.10.2"
|
"strapi-helper-plugin": "3.0.0-alpha.10.2"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -32,7 +32,7 @@ module.exports = {
|
|||||||
return {
|
return {
|
||||||
name: stream.name,
|
name: stream.name,
|
||||||
hash: uuid().replace(/-/g, ''),
|
hash: uuid().replace(/-/g, ''),
|
||||||
ext: _.last(stream.name.split('.')),
|
ext: stream.name.split('.').length > 1 ? `.${_.last(stream.name.split('.'))}` : '',
|
||||||
buffer: Buffer.concat(buffers),
|
buffer: Buffer.concat(buffers),
|
||||||
mime: stream.type,
|
mime: stream.type,
|
||||||
size: (stream.size / 1000).toFixed(2)
|
size: (stream.size / 1000).toFixed(2)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
@ -9,7 +9,7 @@ const _ = require('lodash');
|
|||||||
const AWS = require('aws-sdk');
|
const AWS = require('aws-sdk');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
provider: 's3',
|
provider: 'aws-s3',
|
||||||
name: 'Amazon Web Service S3',
|
name: 'Amazon Web Service S3',
|
||||||
auth: {
|
auth: {
|
||||||
public: {
|
public: {
|
||||||
@ -69,12 +69,11 @@ module.exports = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// upload file on S3 bucket
|
// upload file on S3 bucket
|
||||||
S3.upload({
|
S3.upload({
|
||||||
Key: `${file.hash}.${file.ext}`,
|
Key: `${file.hash}${file.ext}`,
|
||||||
Body: new Buffer(file.buffer, 'binary'),
|
Body: new Buffer(file.buffer, 'binary'),
|
||||||
ACL: 'public-read'
|
ACL: 'public-read'
|
||||||
}, (err, data) => {
|
}, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
|
||||||
return reject(err);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,12 +90,11 @@ module.exports = {
|
|||||||
S3.deleteObjects({
|
S3.deleteObjects({
|
||||||
Delete: {
|
Delete: {
|
||||||
Objects: [{
|
Objects: [{
|
||||||
Key: `${file.hash}.${file.ext}`
|
Key: `${file.hash}${file.ext}`
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}, (err, data) => {
|
}, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
|
||||||
return reject(err);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "strapi-upload-s3",
|
"name": "strapi-upload-aws-s3",
|
||||||
"version": "3.0.0-alpha.10.2",
|
"version": "3.0.0-alpha.10.2",
|
||||||
"description": "AWS S3 provider for strapi upload",
|
"description": "AWS S3 provider for strapi upload",
|
||||||
"homepage": "http://strapi.io",
|
"homepage": "http://strapi.io",
|
||||||
@ -17,7 +17,7 @@
|
|||||||
"aws-sdk": "^2.199.0"
|
"aws-sdk": "^2.199.0"
|
||||||
},
|
},
|
||||||
"strapi": {
|
"strapi": {
|
||||||
"isHook": false
|
"isProvider": true
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"email": "hi@strapi.io",
|
"email": "hi@strapi.io",
|
||||||
@ -39,7 +39,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -16,12 +16,12 @@ module.exports = {
|
|||||||
upload: (file) => {
|
upload: (file) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// write file in public/assets folder
|
// write file in public/assets folder
|
||||||
fs.writeFile(path.join(strapi.config.appPath, 'public', `uploads/${file.hash}.${file.ext}`), file.buffer, (err) => {
|
fs.writeFile(path.join(strapi.config.appPath, 'public', `uploads/${file.hash}${file.ext}`), file.buffer, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
file.url = `/uploads/${file.hash}.${file.ext}`;
|
file.url = `/uploads/${file.hash}${file.ext}`;
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
@ -29,8 +29,14 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
delete: (file) => {
|
delete: (file) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
const filePath = path.join(strapi.config.appPath, 'public', `uploads/${file.hash}${file.ext}`);
|
||||||
|
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
return resolve('File doesn\'t exist');
|
||||||
|
}
|
||||||
|
|
||||||
// remove file from public/assets folder
|
// remove file from public/assets folder
|
||||||
fs.unlink(path.join(strapi.config.appPath, 'public', file.url), (err) => {
|
fs.unlink(filePath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"main": "./lib",
|
"main": "./lib",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"strapi": {
|
"strapi": {
|
||||||
"isHook": false
|
"isProvider": true
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"email": "hi@strapi.io",
|
"email": "hi@strapi.io",
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 Strapi Solutions.
|
||||||
Copyright (c) 2017, Vandium Software Inc.
|
Copyright (c) 2017, Vandium Software Inc.
|
||||||
|
|
||||||
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:
|
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:
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2015-2017 Strapi Solutions.
|
Copyright (c) 2015-2018 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:
|
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:
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
"url": "https://github.com/strapi/strapi/issues"
|
"url": "https://github.com/strapi/strapi/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.0.0",
|
"node": ">= 9.0.0",
|
||||||
"npm": ">= 5.3.0"
|
"npm": ">= 5.3.0"
|
||||||
},
|
},
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
|
@ -107,7 +107,7 @@ watcher('🏗 Building...', 'npm run build');
|
|||||||
|
|
||||||
shell.cd('../strapi-upload-local');
|
shell.cd('../strapi-upload-local');
|
||||||
watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false);
|
watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false);
|
||||||
shell.cd('../strapi-upload-s3');
|
shell.cd('../strapi-upload-aws-s3');
|
||||||
watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false);
|
watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false);
|
||||||
|
|
||||||
shell.cd('../strapi-plugin-content-type-builder');
|
shell.cd('../strapi-plugin-content-type-builder');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user