@aws-amplify/storage
Advanced tools
Comparing version 1.0.26 to 1.0.27-beta.0
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.0.27-beta.0"></a> | ||
## [1.0.27-beta.0](https://github.com/aws/aws-amplify/compare/@aws-amplify/storage@1.0.26...@aws-amplify/storage@1.0.27-beta.0) (2019-03-13) | ||
### Features | ||
* **core:** Hub refactor and tests ([7ac5bcf](https://github.com/aws/aws-amplify/commit/7ac5bcf)) | ||
<a name="1.0.26"></a> | ||
@@ -8,0 +19,0 @@ ## [1.0.26](https://github.com/aws/aws-amplify/compare/@aws-amplify/storage@1.0.26-unstable.4...@aws-amplify/storage@1.0.26) (2019-03-04) |
@@ -53,5 +53,8 @@ "use strict"; | ||
var logger = new core_1.ConsoleLogger('AWSS3Provider'); | ||
var dispatchStorageEvent = function (track, attrs, metrics) { | ||
var dispatchStorageEvent = function (track, event, attrs, metrics) { | ||
if (track) { | ||
core_1.Hub.dispatch('storage', { attrs: attrs, metrics: metrics }, 'Storage'); | ||
core_1.Hub.dispatch('storage', { | ||
event: event, | ||
data: { attrs: attrs, metrics: metrics } | ||
}, 'Storage', Symbol.for('amplify_default')); | ||
} | ||
@@ -131,7 +134,7 @@ }; | ||
if (err) { | ||
dispatchStorageEvent(track, { method: 'get', result: 'failed' }, null); | ||
dispatchStorageEvent(track, 'download', { method: 'get', result: 'failed' }, null); | ||
rej(err); | ||
} | ||
else { | ||
dispatchStorageEvent(track, { method: 'get', result: 'success' }, { fileSize: Number(data.Body['length']) }); | ||
dispatchStorageEvent(track, 'download', { method: 'get', result: 'success' }, { fileSize: Number(data.Body['length']) }); | ||
res(data); | ||
@@ -148,3 +151,3 @@ } | ||
var url = s3.getSignedUrl('getObject', params); | ||
dispatchStorageEvent(track, { method: 'get', result: 'success' }, null); | ||
dispatchStorageEvent(track, 'getSignedUrl', { method: 'get', result: 'success' }, null); | ||
res(url); | ||
@@ -154,3 +157,3 @@ } | ||
logger.warn('get signed url error', e); | ||
dispatchStorageEvent(track, { method: 'get', result: 'failed' }, null); | ||
dispatchStorageEvent(track, 'getSignedUrl', { method: 'get', result: 'failed' }, null); | ||
rej(e); | ||
@@ -246,3 +249,3 @@ } | ||
logger.debug('upload result', data); | ||
dispatchStorageEvent(track, { method: 'put', result: 'success' }, null); | ||
dispatchStorageEvent(track, 'upload', { method: 'put', result: 'success' }, null); | ||
return [2 /*return*/, { | ||
@@ -254,3 +257,3 @@ key: data.Key.substr(prefix.length) | ||
logger.warn("error uploading", e_1); | ||
dispatchStorageEvent(track, { method: 'put', result: 'failed' }, null); | ||
dispatchStorageEvent(track, 'upload', { method: 'put', result: 'failed' }, null); | ||
throw e_1; | ||
@@ -292,7 +295,7 @@ case 5: return [2 /*return*/]; | ||
if (err) { | ||
dispatchStorageEvent(track, { method: 'remove', result: 'failed' }, null); | ||
dispatchStorageEvent(track, 'delete', { method: 'remove', result: 'failed' }, null); | ||
rej(err); | ||
} | ||
else { | ||
dispatchStorageEvent(track, { method: 'remove', result: 'success' }, null); | ||
dispatchStorageEvent(track, 'delete', { method: 'remove', result: 'success' }, null); | ||
res(data); | ||
@@ -337,3 +340,3 @@ } | ||
logger.warn('list error', err); | ||
dispatchStorageEvent(track, { method: 'list', result: 'failed' }, null); | ||
dispatchStorageEvent(track, 'list', { method: 'list', result: 'failed' }, null); | ||
rej(err); | ||
@@ -350,3 +353,3 @@ } | ||
}); | ||
dispatchStorageEvent(track, { method: 'list', result: 'success' }, null); | ||
dispatchStorageEvent(track, 'list', { method: 'list', result: 'success' }, null); | ||
logger.debug('list', list); | ||
@@ -353,0 +356,0 @@ res(list); |
{ | ||
"name": "@aws-amplify/storage", | ||
"version": "1.0.26", | ||
"version": "1.0.27-beta.0", | ||
"description": "Storage category of aws-amplify", | ||
@@ -53,3 +53,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@aws-amplify/core": "^1.0.23" | ||
"@aws-amplify/core": "1.0.24-beta.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "jest": { |
@@ -24,5 +24,13 @@ /* | ||
const dispatchStorageEvent = (track, attrs, metrics) => { | ||
const dispatchStorageEvent = (track, event, attrs, metrics) => { | ||
if (track) { | ||
Hub.dispatch('storage', { attrs, metrics }, 'Storage'); | ||
Hub.dispatch( | ||
'storage', | ||
{ | ||
event, | ||
data: { attrs, metrics } | ||
}, | ||
'Storage', | ||
Symbol.for('amplify_default') | ||
); | ||
} | ||
@@ -110,2 +118,3 @@ }; | ||
track, | ||
'download', | ||
{ method: 'get', result: 'failed' }, | ||
@@ -117,2 +126,3 @@ null); | ||
track, | ||
'download', | ||
{ method: 'get', result: 'success' }, | ||
@@ -133,2 +143,3 @@ { fileSize: Number(data.Body['length']) }); | ||
track, | ||
'getSignedUrl', | ||
{ method: 'get', result: 'success' }, | ||
@@ -141,2 +152,3 @@ null); | ||
track, | ||
'getSignedUrl', | ||
{ method: 'get', result: 'failed' }, | ||
@@ -208,2 +220,3 @@ null); | ||
track, | ||
'upload', | ||
{ method: 'put', result: 'success' }, | ||
@@ -219,2 +232,3 @@ null); | ||
track, | ||
'upload', | ||
{ method: 'put', result: 'failed' }, | ||
@@ -255,2 +269,3 @@ null); | ||
track, | ||
'delete', | ||
{ method: 'remove', result: 'failed' }, | ||
@@ -262,2 +277,3 @@ null); | ||
track, | ||
'delete', | ||
{ method: 'remove', result: 'success' }, | ||
@@ -300,2 +316,3 @@ null); | ||
track, | ||
'list', | ||
{ method: 'list', result: 'failed' }, | ||
@@ -315,2 +332,3 @@ null); | ||
track, | ||
'list', | ||
{ method: 'list', result: 'success' }, | ||
@@ -317,0 +335,0 @@ null); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
4603847
23716
1
2
+ Added@aws-amplify/core@1.0.24-beta.0(transitive)
+ Addedaws-sdk@2.329.0(transitive)
+ Addeduuid@3.1.0(transitive)
- Removed@aws-amplify/core@1.3.3(transitive)
- Removedaws-sdk@2.518.0(transitive)
- Removeduuid@3.3.2(transitive)