Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/storage

Package Overview
Dependencies
Maintainers
10
Versions
2069
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/storage - npm Package Compare versions

Comparing version 1.0.26 to 1.0.27-beta.0

11

CHANGELOG.md

@@ -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)

27

lib/Providers/AWSS3Provider.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc