mirror of
https://github.com/strapi/strapi.git
synced 2025-09-28 09:49:36 +00:00
Merge branch 'features/media-lib' of github.com:strapi/strapi into chore/identify-doc-frontend-file-to-update
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
commit
34bf5c43fa
@ -238,4 +238,74 @@ describe('Type validators', () => {
|
|||||||
expect(validator.isValidSync(attributes.slug)).toBe(false);
|
expect(validator.isValidSync(attributes.slug)).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('media type', () => {
|
||||||
|
test('Validates allowedTypes', () => {
|
||||||
|
const attributes = {
|
||||||
|
img: {
|
||||||
|
type: 'media',
|
||||||
|
allowedTypes: ['nonexistent'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const validator = getTypeValidator(attributes.img, {
|
||||||
|
types: ['media'],
|
||||||
|
modelType: 'collectionType',
|
||||||
|
attributes,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(validator.isValidSync(attributes.img)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Cannot set all with other allowedTypes', () => {
|
||||||
|
const attributes = {
|
||||||
|
img: {
|
||||||
|
type: 'media',
|
||||||
|
allowedTypes: ['all', 'videos'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const validator = getTypeValidator(attributes.img, {
|
||||||
|
types: ['media'],
|
||||||
|
modelType: 'collectionType',
|
||||||
|
attributes,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(validator.isValidSync(attributes.img)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can set multiple allowedTypes', () => {
|
||||||
|
const attributes = {
|
||||||
|
img: {
|
||||||
|
type: 'media',
|
||||||
|
allowedTypes: ['files', 'videos'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const validator = getTypeValidator(attributes.img, {
|
||||||
|
types: ['media'],
|
||||||
|
modelType: 'collectionType',
|
||||||
|
attributes,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(validator.isValidSync(attributes.img)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.each(['all', 'images', 'files', 'videos'])('%s is an allowed types', type => {
|
||||||
|
const attributes = {
|
||||||
|
img: {
|
||||||
|
type: 'media',
|
||||||
|
allowedTypes: [type],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const validator = getTypeValidator(attributes.img, {
|
||||||
|
types: ['media'],
|
||||||
|
modelType: 'collectionType',
|
||||||
|
attributes,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(validator.isValidSync(attributes.img)).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -49,6 +49,20 @@ const getTypeShape = (attribute, { modelType, attributes } = {}) => {
|
|||||||
multiple: yup.boolean(),
|
multiple: yup.boolean(),
|
||||||
required: validators.required,
|
required: validators.required,
|
||||||
unique: validators.unique,
|
unique: validators.unique,
|
||||||
|
allowedTypes: yup.lazy(value => {
|
||||||
|
if (Array.isArray(value) && value.includes('all')) {
|
||||||
|
return yup
|
||||||
|
.array()
|
||||||
|
.of(yup.string().oneOf(['all']))
|
||||||
|
.min(1)
|
||||||
|
.max(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return yup
|
||||||
|
.array()
|
||||||
|
.of(yup.string().oneOf(['images', 'videos', 'files']))
|
||||||
|
.min(1);
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,18 +60,12 @@ function createSchemaBuilder({ components, contentTypes }) {
|
|||||||
|
|
||||||
// init temporary ContentTypes
|
// init temporary ContentTypes
|
||||||
Object.keys(contentTypes).forEach(key => {
|
Object.keys(contentTypes).forEach(key => {
|
||||||
tmpContentTypes.set(
|
tmpContentTypes.set(contentTypes[key].uid, createSchemaHandler(contentTypes[key]));
|
||||||
contentTypes[key].uid,
|
|
||||||
createSchemaHandler(contentTypes[key])
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// init temporary components
|
// init temporary components
|
||||||
Object.keys(components).forEach(key => {
|
Object.keys(components).forEach(key => {
|
||||||
tmpComponents.set(
|
tmpComponents.set(components[key].uid, createSchemaHandler(components[key]));
|
||||||
components[key].uid,
|
|
||||||
createSchemaHandler(components[key])
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -97,6 +91,7 @@ function createSchemaBuilder({ components, contentTypes }) {
|
|||||||
acc[key] = {
|
acc[key] = {
|
||||||
[attribute.multiple ? 'collection' : 'model']: 'file',
|
[attribute.multiple ? 'collection' : 'model']: 'file',
|
||||||
via,
|
via,
|
||||||
|
allowedTypes: attribute.allowedTypes,
|
||||||
plugin: 'upload',
|
plugin: 'upload',
|
||||||
required: attribute.required ? true : false,
|
required: attribute.required ? true : false,
|
||||||
configurable: configurable === false ? false : undefined,
|
configurable: configurable === false ? false : undefined,
|
||||||
|
@ -95,7 +95,7 @@ const HomePage = () => {
|
|||||||
value,
|
value,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChangeListParams = ({ target: { name, value } }) => {
|
const handleChangeListParams = ({ target: { name, value } }) => {
|
||||||
if (name.includes('_page')) {
|
if (name.includes('_page')) {
|
||||||
handleChangeParams({
|
handleChangeParams({
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"provider": "local",
|
"provider": "local",
|
||||||
"providerOptions": {
|
"providerOptions": {
|
||||||
"sizeLimit": 1000
|
"sizeLimit": 1000000
|
||||||
},
|
}
|
||||||
"providers": []
|
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,7 @@ module.exports = async () => {
|
|||||||
key: 'settings',
|
key: 'settings',
|
||||||
});
|
});
|
||||||
|
|
||||||
strapi.plugins.upload.provider = createProvider(
|
strapi.plugins.upload.provider = createProvider(strapi.plugins.upload.config || {});
|
||||||
strapi.plugins.upload.config || {}
|
|
||||||
);
|
|
||||||
|
|
||||||
// if provider config does not exist set one by default
|
// if provider config does not exist set one by default
|
||||||
const config = await configurator.get();
|
const config = await configurator.get();
|
||||||
|
@ -1,18 +1,5 @@
|
|||||||
{
|
{
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
|
||||||
"method": "POST",
|
|
||||||
"path": "/",
|
|
||||||
"handler": "Upload.upload",
|
|
||||||
"config": {
|
|
||||||
"policies": [],
|
|
||||||
"description": "Upload a file",
|
|
||||||
"tag": {
|
|
||||||
"plugin": "upload",
|
|
||||||
"name": "File"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"path": "/settings",
|
"path": "/settings",
|
||||||
@ -29,6 +16,19 @@
|
|||||||
"policies": []
|
"policies": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"path": "/",
|
||||||
|
"handler": "Upload.upload",
|
||||||
|
"config": {
|
||||||
|
"policies": [],
|
||||||
|
"description": "Upload a file",
|
||||||
|
"tag": {
|
||||||
|
"plugin": "upload",
|
||||||
|
"name": "File"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"path": "/files/count",
|
"path": "/files/count",
|
||||||
@ -93,6 +93,14 @@
|
|||||||
"name": "File"
|
"name": "File"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "GET",
|
||||||
|
"path": "/media-types",
|
||||||
|
"handler": "media-types.getMediaTypes",
|
||||||
|
"config": {
|
||||||
|
"policies": []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,9 @@ module.exports = {
|
|||||||
resolver: async (obj, { file: upload, ...fields }) => {
|
resolver: async (obj, { file: upload, ...fields }) => {
|
||||||
const file = await formatFile(upload, fields);
|
const file = await formatFile(upload, fields);
|
||||||
|
|
||||||
const uploadedFiles = await strapi.plugins.upload.services.upload.upload([file]);
|
const uploadedFiles = await strapi.plugins.upload.services.upload.uploadFileAndPersist(
|
||||||
|
file
|
||||||
|
);
|
||||||
|
|
||||||
// Return response.
|
// Return response.
|
||||||
return uploadedFiles.length === 1 ? uploadedFiles[0] : uploadedFiles;
|
return uploadedFiles.length === 1 ? uploadedFiles[0] : uploadedFiles;
|
||||||
@ -35,10 +37,9 @@ module.exports = {
|
|||||||
resolver: async (obj, { files: uploads, ...fields }) => {
|
resolver: async (obj, { files: uploads, ...fields }) => {
|
||||||
const files = await Promise.all(uploads.map(upload => formatFile(upload, fields)));
|
const files = await Promise.all(uploads.map(upload => formatFile(upload, fields)));
|
||||||
|
|
||||||
const uploadedFiles = await strapi.plugins.upload.services.upload.upload(files);
|
const uploadService = strapi.plugins.upload.services.upload;
|
||||||
|
|
||||||
// Return response.
|
return Promise.all(files.map(file => uploadService.uploadFileAndPersist(file)));
|
||||||
return uploadedFiles;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -55,8 +56,8 @@ const formatFile = async (upload, metas) => {
|
|||||||
|
|
||||||
const buffer = Buffer.concat(buffers);
|
const buffer = Buffer.concat(buffers);
|
||||||
|
|
||||||
const { formatFileInfo } = strapi.plugins.upload.services.upload;
|
const uploadService = strapi.plugins.upload.services.upload;
|
||||||
const fileInfo = formatFileInfo(
|
const fileInfo = uploadService.formatFileInfo(
|
||||||
{
|
{
|
||||||
filename,
|
filename,
|
||||||
type: mimetype,
|
type: mimetype,
|
||||||
|
@ -29,53 +29,50 @@ const validateUploadBody = (schema, data = {}) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isUploadDisabled = () => _.get(strapi.plugins, 'upload.config.enabled', true) === false;
|
||||||
|
|
||||||
|
const disabledPluginError = () =>
|
||||||
|
strapi.errors.badRequest(null, {
|
||||||
|
errors: [{ id: 'Upload.status.disabled', message: 'File upload is disabled' }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const emptyFileError = () =>
|
||||||
|
strapi.errors.badRequest(null, {
|
||||||
|
errors: [{ id: 'Upload.status.empty', message: 'Files are empty' }],
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async upload(ctx) {
|
async upload(ctx) {
|
||||||
const uploadService = strapi.plugins.upload.services.upload;
|
if (isUploadDisabled()) {
|
||||||
|
throw disabledPluginError();
|
||||||
// Retrieve provider configuration.
|
|
||||||
const { enabled } = strapi.plugins.upload.config;
|
|
||||||
|
|
||||||
// Verify if the file upload is enable.
|
|
||||||
if (enabled === false) {
|
|
||||||
throw strapi.errors.badRequest(null, {
|
|
||||||
errors: [{ id: 'Upload.status.disabled', message: 'File upload is disabled' }],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const files = _.get(ctx.request.files, 'files');
|
const files = _.get(ctx.request.files, 'files');
|
||||||
|
|
||||||
if (_.isEmpty(files)) {
|
if (_.isEmpty(files)) {
|
||||||
throw strapi.errors.badRequest(null, {
|
throw emptyFileError();
|
||||||
errors: [{ id: 'Upload.status.empty', message: 'Files are empty' }],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let data;
|
const { id } = ctx.query;
|
||||||
if (Array.isArray(files)) {
|
|
||||||
data = await validateUploadBody(multiUploadSchema, ctx.request.body);
|
const uploadService = strapi.plugins.upload.services.upload;
|
||||||
|
|
||||||
|
const validationSchema = Array.isArray(files) ? multiUploadSchema : uploadSchema;
|
||||||
|
const data = await validateUploadBody(validationSchema, ctx.request.body);
|
||||||
|
|
||||||
|
if (id) {
|
||||||
|
// cannot replace with more than one file
|
||||||
|
if (Array.isArray(files)) {
|
||||||
|
throw strapi.errors.badRequest(null, {
|
||||||
|
errors: [
|
||||||
|
{ id: 'Upload.replace.single', message: 'Cannot replace a file with multiple ones' },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.body = await uploadService.replace(id, { data, file: files });
|
||||||
} else {
|
} else {
|
||||||
data = await validateUploadBody(uploadSchema, ctx.request.body);
|
ctx.body = await uploadService.upload({ data, files });
|
||||||
}
|
}
|
||||||
|
|
||||||
const { refId, ref, source, field, path, fileInfo } = data;
|
|
||||||
|
|
||||||
const fileArray = Array.isArray(files) ? files : [files];
|
|
||||||
const fileInfoArray = Array.isArray(fileInfo) ? fileInfo : [fileInfo];
|
|
||||||
|
|
||||||
// Transform stream files to buffer
|
|
||||||
const enhancedFiles = await Promise.all(
|
|
||||||
fileArray.map((file, idx) => {
|
|
||||||
const fileInfo = fileInfoArray[idx] || {};
|
|
||||||
|
|
||||||
return uploadService.enhanceFile(file, fileInfo, { refId, ref, source, field, path });
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const uploadedFiles = await uploadService.upload(enhancedFiles);
|
|
||||||
|
|
||||||
// Send 200 `ok`
|
|
||||||
ctx.send(uploadedFiles);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async getSettings(ctx) {
|
async getSettings(ctx) {
|
||||||
@ -106,6 +103,44 @@ module.exports = {
|
|||||||
ctx.body = { data };
|
ctx.body = { data };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async replaceFile(ctx) {
|
||||||
|
const { id } = ctx.params;
|
||||||
|
|
||||||
|
const uploadService = strapi.plugins.upload.services.upload;
|
||||||
|
|
||||||
|
// Retrieve provider configuration.
|
||||||
|
const { enabled } = strapi.plugins.upload.config;
|
||||||
|
|
||||||
|
// Verify if the file upload is enable.
|
||||||
|
if (enabled === false) {
|
||||||
|
throw strapi.errors.badRequest(null, {
|
||||||
|
errors: [{ id: 'Upload.status.disabled', message: 'File upload is disabled' }],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await strapi.plugins['upload'].services.upload.fetch({ id });
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return ctx.notFound('file.notFound');
|
||||||
|
}
|
||||||
|
|
||||||
|
const { fileInfo } = await validateUploadBody(uploadSchema, ctx.request.body);
|
||||||
|
|
||||||
|
const { file = {} } = ctx.request.files || {};
|
||||||
|
|
||||||
|
if (_.isUndefined(file)) {
|
||||||
|
throw strapi.errors.badRequest(null, {
|
||||||
|
errors: [{ id: 'Upload.status.empty', message: 'File is missing' }],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const enhancedFile = uploadService.enhanceFile(file, fileInfo);
|
||||||
|
|
||||||
|
const updatedFile = await uploadService.update(id, enhancedFile);
|
||||||
|
|
||||||
|
ctx.send(updatedFile);
|
||||||
|
},
|
||||||
|
|
||||||
async find(ctx) {
|
async find(ctx) {
|
||||||
const data = await strapi.plugins['upload'].services.upload.fetchAll(ctx.query);
|
const data = await strapi.plugins['upload'].services.upload.fetchAll(ctx.query);
|
||||||
|
|
||||||
|
18
packages/strapi-plugin-upload/controllers/media-types.js
Normal file
18
packages/strapi-plugin-upload/controllers/media-types.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const db = require('mime-db');
|
||||||
|
const mime = require('mime-type')(db);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
async getMediaTypes(ctx) {
|
||||||
|
const data = {
|
||||||
|
types: ['images', 'videos', 'files'],
|
||||||
|
mimeTypes: {
|
||||||
|
images: mime.glob('image/*'),
|
||||||
|
videos: mime.glob('video/*'),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
ctx.body = { data };
|
||||||
|
},
|
||||||
|
};
|
@ -16,6 +16,8 @@
|
|||||||
"immutable": "^3.8.2",
|
"immutable": "^3.8.2",
|
||||||
"invariant": "^2.2.1",
|
"invariant": "^2.2.1",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
|
"mime-db": "1.43.0",
|
||||||
|
"mime-type": "3.0.7",
|
||||||
"react": "^16.9.0",
|
"react": "^16.9.0",
|
||||||
"react-copy-to-clipboard": "^5.0.1",
|
"react-copy-to-clipboard": "^5.0.1",
|
||||||
"react-dom": "^16.9.0",
|
"react-dom": "^16.9.0",
|
||||||
|
@ -58,7 +58,7 @@ module.exports = {
|
|||||||
return entity;
|
return entity;
|
||||||
},
|
},
|
||||||
|
|
||||||
async enhanceFile(file, fileInfo, metas) {
|
async enhanceFile(file, fileInfo = {}, metas = {}) {
|
||||||
const parts = await toArray(fs.createReadStream(file.path));
|
const parts = await toArray(fs.createReadStream(file.path));
|
||||||
const buffers = parts.map(part => (_.isBuffer(part) ? part : Buffer.from(part)));
|
const buffers = parts.map(part => (_.isBuffer(part) ? part : Buffer.from(part)));
|
||||||
|
|
||||||
@ -79,24 +79,74 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async upload(files) {
|
async upload({ data, files }) {
|
||||||
const config = strapi.plugins.upload.config;
|
const { fileInfo, ...metas } = data;
|
||||||
|
|
||||||
// upload a single file
|
const fileArray = Array.isArray(files) ? files : [files];
|
||||||
const uploadFile = async file => {
|
const fileInfoArray = Array.isArray(fileInfo) ? fileInfo : [fileInfo];
|
||||||
await strapi.plugins.upload.provider.upload(file);
|
|
||||||
|
|
||||||
delete file.buffer;
|
const doUpload = async (file, fileInfo) => {
|
||||||
file.provider = config.provider;
|
const fileData = await this.enhanceFile(file, fileInfo, metas);
|
||||||
|
|
||||||
const res = await this.add(file);
|
return this.uploadFileAndPersist(fileData);
|
||||||
|
|
||||||
strapi.eventHub.emit('media.create', { media: res });
|
|
||||||
return res;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Execute upload function of the provider for all files.
|
return await Promise.all(
|
||||||
return Promise.all(files.map(file => uploadFile(file)));
|
fileArray.map((file, idx) => doUpload(file, fileInfoArray[idx] || {}))
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadFileAndPersist(fileData) {
|
||||||
|
const config = strapi.plugins.upload.config;
|
||||||
|
await strapi.plugins.upload.provider.upload(fileData);
|
||||||
|
|
||||||
|
delete fileData.buffer;
|
||||||
|
fileData.provider = config.provider;
|
||||||
|
|
||||||
|
const res = await this.add(fileData);
|
||||||
|
|
||||||
|
strapi.eventHub.emit('media.create', { media: res });
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
|
||||||
|
async replace(id, { data, file }) {
|
||||||
|
const config = strapi.plugins.upload.config;
|
||||||
|
|
||||||
|
const dbFile = await this.fetch({ id });
|
||||||
|
|
||||||
|
if (!dbFile) {
|
||||||
|
throw new Error('file not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
const { fileInfo } = data;
|
||||||
|
const fileData = await this.enhanceFile(file, fileInfo);
|
||||||
|
|
||||||
|
// TODO: maybe check if same extension ??
|
||||||
|
|
||||||
|
// keep a constant hash
|
||||||
|
_.assign(fileData, {
|
||||||
|
hash: dbFile.hash,
|
||||||
|
ext: dbFile.ext,
|
||||||
|
});
|
||||||
|
|
||||||
|
// execute delete function of the provider
|
||||||
|
if (dbFile.provider === config.provider) {
|
||||||
|
await strapi.plugins.upload.provider.delete(dbFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
await strapi.plugins.upload.provider.upload(fileData);
|
||||||
|
|
||||||
|
delete fileData.buffer;
|
||||||
|
fileData.provider = config.provider;
|
||||||
|
|
||||||
|
const res = await this.update({ id }, fileData);
|
||||||
|
strapi.eventHub.emit('media.update', { media: res });
|
||||||
|
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
|
||||||
|
update(params, values) {
|
||||||
|
return strapi.query('file', 'upload').update(params, values);
|
||||||
},
|
},
|
||||||
|
|
||||||
add(values) {
|
add(values) {
|
||||||
@ -104,9 +154,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fetch(params) {
|
fetch(params) {
|
||||||
return strapi.query('file', 'upload').findOne({
|
return strapi.query('file', 'upload').findOne(params);
|
||||||
id: params.id,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchAll(params) {
|
fetchAll(params) {
|
||||||
@ -151,7 +199,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
).then(files => this.upload(files));
|
).then(files => this.uploadFileAndPersist(files));
|
||||||
},
|
},
|
||||||
|
|
||||||
async getConfig() {
|
async getConfig() {
|
||||||
|
38
yarn.lock
38
yarn.lock
@ -6945,7 +6945,7 @@ escape-string-regexp@1.0.2:
|
|||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
||||||
integrity sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=
|
integrity sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=
|
||||||
|
|
||||||
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
|
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||||
@ -9218,6 +9218,13 @@ inflight@^1.0.4:
|
|||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
wrappy "1"
|
wrappy "1"
|
||||||
|
|
||||||
|
inherits-ex@^1.1.2:
|
||||||
|
version "1.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/inherits-ex/-/inherits-ex-1.2.3.tgz#ba0da6258e9b855f98429e82ea97c4cc0e4e459d"
|
||||||
|
integrity sha512-DCZqD7BpjXqaha8IKcoAE3ZZr6Hi12ropV1h+3pBnirE14mNRwLuYySvYxUSBemTQ40SjAxPL8BTk2Xw/3IF9w==
|
||||||
|
dependencies:
|
||||||
|
xtend "^4.0.0"
|
||||||
|
|
||||||
inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4:
|
inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4:
|
||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||||
@ -11618,7 +11625,7 @@ mdn-data@2.0.4:
|
|||||||
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
|
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
|
||||||
integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==
|
integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==
|
||||||
|
|
||||||
media-typer@0.3.0:
|
media-typer@0.3.0, media-typer@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
||||||
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
||||||
@ -11774,6 +11781,16 @@ mime-db@1.43.0, "mime-db@>= 1.43.0 < 2":
|
|||||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58"
|
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58"
|
||||||
integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==
|
integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==
|
||||||
|
|
||||||
|
mime-type@3.0.7:
|
||||||
|
version "3.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/mime-type/-/mime-type-3.0.7.tgz#15c21e4833edd1ac5ddf04fffb49164d17bef57b"
|
||||||
|
integrity sha512-NyWtbAKERuLQIv+1jjEdWGrWepVlubZEW0fTs4K9T6UWW45iMBpgrwpP5GIl8/5trHLviOcQfA6zEth3T8WhNA==
|
||||||
|
dependencies:
|
||||||
|
media-typer "^0.3.0"
|
||||||
|
minimatch "^3.0.4"
|
||||||
|
path.js "^1.0.7"
|
||||||
|
util-ex "^0.3.15"
|
||||||
|
|
||||||
mime-types@^2.0.8, mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24:
|
mime-types@^2.0.8, mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24:
|
||||||
version "2.1.26"
|
version "2.1.26"
|
||||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06"
|
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06"
|
||||||
@ -13293,6 +13310,15 @@ path-type@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
|
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
|
||||||
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
|
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
|
||||||
|
|
||||||
|
path.js@^1.0.7:
|
||||||
|
version "1.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/path.js/-/path.js-1.0.7.tgz#7d136b607de19bfd98ba068874926287e6534939"
|
||||||
|
integrity sha1-fRNrYH3hm/2YugaIdJJih+ZTSTk=
|
||||||
|
dependencies:
|
||||||
|
escape-string-regexp "^1.0.3"
|
||||||
|
inherits-ex "^1.1.2"
|
||||||
|
util-ex "^0.3.10"
|
||||||
|
|
||||||
pbkdf2@^3.0.3:
|
pbkdf2@^3.0.3:
|
||||||
version "3.0.17"
|
version "3.0.17"
|
||||||
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6"
|
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6"
|
||||||
@ -17729,6 +17755,14 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||||
|
|
||||||
|
util-ex@^0.3.10, util-ex@^0.3.15:
|
||||||
|
version "0.3.15"
|
||||||
|
resolved "https://registry.yarnpkg.com/util-ex/-/util-ex-0.3.15.tgz#f9261cda13c4327d0740cbe67be1227ded8b0058"
|
||||||
|
integrity sha1-+SYc2hPEMn0HQMvme+Eife2LAFg=
|
||||||
|
dependencies:
|
||||||
|
inherits-ex "^1.1.2"
|
||||||
|
xtend "^4.0.0"
|
||||||
|
|
||||||
util-promisify@^2.1.0:
|
util-promisify@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53"
|
resolved "https://registry.yarnpkg.com/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user