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

aws-collection-stream

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-collection-stream - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

29

index.js

@@ -5,3 +5,11 @@ const H = require ( 'highland' );

const serviceSpecificEdgeCaseTransform = serviceHostName => {
return {
'cloudfront.amazonaws.com': R.prop ( 'DistributionList' )
}[serviceHostName] || R.identity;
};
const caughtWrap = ( { serviceObject, serviceMethod } ) => {
const ecTransform = serviceSpecificEdgeCaseTransform ( serviceObject.endpoint.hostname );
return parms => {

@@ -17,5 +25,6 @@ return H.wrapCallback ( ( parms, callback ) => {

push ( null, 'ThrottlingException' ) :
push ( error ) )
push ( error )
)
.flatMap ( e => {
if ( R.type ( e ) === 'String' && e === 'ThrottlingException' ) {
if ( e === 'ThrottlingException' ) {
return H ( ( push, next ) => setTimeout ( () => next (

@@ -26,3 +35,3 @@ caughtWrap ( { serviceObject, serviceMethod } )( parms )

return H ( [ e ] );
return H ( [ ecTransform ( e ) ] );
} );

@@ -32,2 +41,12 @@ };

const nextTokenKey = {
isValid: key => key.toLowerCase () === 'nexttoken' || key === 'NextMarker' || key === 'Marker' || key === 'LastEvaluatedTableName',
transformForNextRequest: key => {
return {
NextMarker: 'Marker',
LastEvaluatedTableName: 'ExclusiveStartTableName'
}[key] || key;
}
};
const awsCollectionStream = ( {

@@ -42,3 +61,3 @@ serviceObject,

...parms,
[nextTokenKeyName === 'NextMarker' ? 'Marker' : nextTokenKeyName]: nextToken
[nextTokenKey.transformForNextRequest ( nextTokenKeyName )]: nextToken
} )

@@ -78,3 +97,3 @@ .flatMap ( ( { [collectionName]: collection, [nextTokenKeyName]: nextToken } ) => nextToken ? H ( collection )

const collectionName = R.find ( key => R.type ( result[key] ) === 'Array', R.keys ( result ) );
const nextTokenKeyName = R.find ( key => key.toLowerCase () === 'nexttoken' || key === 'NextMarker' || key === 'Marker', R.keys ( result ) );
const nextTokenKeyName = R.find ( nextTokenKey.isValid, R.keys ( result ) );

@@ -81,0 +100,0 @@ if ( nextTokenKeyName ) {

2

package.json
{
"name": "aws-collection-stream",
"version": "0.0.7",
"version": "0.0.8",
"description": "Takes care of any paginated AWS SDK call, and return the output as a highland.js stream of objects.",

@@ -5,0 +5,0 @@ "main": "index.js",

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