strapi-provider-upload-double-azure
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -29,10 +29,18 @@ const { | ||
}, | ||
containerName: { | ||
label: 'Container name', | ||
containerNamePublic: { | ||
label: 'Container name of the public content', | ||
type: 'text', | ||
}, | ||
defaultPath: { | ||
label: 'The path to use when there is none being specified', | ||
containerNamePrivate: { | ||
label: 'Container name of the private content', | ||
type: 'text', | ||
}, | ||
defaultPathPublic: { | ||
label: 'The path to use inside the public container', | ||
type: 'text', | ||
}, | ||
defaultPathPrivate: { | ||
label: 'The path to use inside the private container', | ||
type: 'text', | ||
}, | ||
maxConcurent: { | ||
@@ -51,7 +59,7 @@ label: 'The maximum concurrent uploads to Azure', | ||
const serviceURL = new ServiceURL(serviceBaseURL, pipeline); | ||
const containerURL = ContainerURL.fromServiceURL(serviceURL, config.containerName); | ||
const containerURLPublic = ContainerURL.fromServiceURL(serviceURL, config.containerNamePublic); | ||
const containerURLPrivate = ContainerURL.fromServiceURL(serviceURL, config.containerNamePrivate); | ||
return { | ||
upload: async file => { | ||
console.log({ file, defaultPath: config.defaultPath }) | ||
const private = file.private | ||
@@ -61,4 +69,5 @@ const azureRes = new Promise((resolve, reject) => { | ||
const folder = private ? "usersprivate" : "games" | ||
const containerWithPath = Object.assign({}, containerURL); | ||
containerWithPath.url += file.path ? `/${file.path}/${folder}` : `/${config.defaultPath}/${folder}`; | ||
const containerWithPath = Object.assign({}, private ? containerURLPrivate : containerURLPublic); | ||
const defaultPath = private ? config.defaultPathPrivate : config.defaultPathPublic | ||
containerWithPath.url += file.path ? `/${file.path}/${folder}` : `/${defaultPath}/${folder}`; | ||
@@ -65,0 +74,0 @@ const blobURL = BlobURL.fromContainerURL(containerWithPath, fileName); |
{ | ||
"name": "strapi-provider-upload-double-azure", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12281
133