New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mechanicalrock/awssociate

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mechanicalrock/awssociate - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

8

.dist/factory.d.ts
import { STS } from "aws-sdk";
export declare type Ctor<T, U> = new (options: U) => T;
export declare class Factory implements IForService {
private options;
constructor(options: STS.ClientConfiguration);
private options?;
constructor(options?: STS.ClientConfiguration | undefined);
ForService<T, U>(service: Ctor<T, U>): ServiceFactory<T, U>;

@@ -12,6 +12,6 @@ }

export declare class ServiceFactory<T, U> implements IWithOptions<T, U>, IWithRoleChain<T, U> {
private stsOptions;
private service;
private stsOptions?;
private options?;
constructor(stsOptions: STS.ClientConfiguration, service: Ctor<T, U>);
constructor(service: Ctor<T, U>, stsOptions?: STS.ClientConfiguration | undefined);
WithOptions(options: U): OmitWithOptions<T, U>;

@@ -18,0 +18,0 @@ WithRoleChain(...roleRequests: STS.AssumeRoleRequest[]): Promise<T>;

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var awsSdk=require("aws-sdk"),__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var Factory=function(){function e(e){this.options=e}return e.prototype.ForService=function(e){return new ServiceFactory(this.options,e)},e}(),ServiceFactory=function(){function e(e,t){this.stsOptions=e,this.service=t,this.options=void 0}return e.prototype.WithOptions=function(e){if(void 0!==this.options)throw new Error("WithOptions has already been called");return this.options=e,this},e.prototype.WithRoleChain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return __awaiter(this,void 0,void 0,function(){var t,n,r,o=this;return __generator(this,function(i){switch(i.label){case 0:return t=__assign({},this.stsOptions),[4,e.reduce(function(e,n){return e.then(function(e){return t.credentials=e,o.Assumer(t,n)})},Promise.resolve(this.stsOptions.credentials))];case 1:return n=i.sent(),r=Object.assign({},this.options||{},__assign({},n)),[2,new this.service(r)]}})})},e.prototype.Assumer=function(e,t){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(r){switch(r.label){case 0:return[4,new awsSdk.STS(e).assumeRole(t).promise()];case 1:if(void 0===(n=r.sent().Credentials))throw new Error("Retrieved credentials were returned undefined");return[2,{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken}]}})})},e}();function roleArn(e,t){return"arn:aws:iam::"+e+":role/"+(t.startsWith("/")?t.substring(1):t)}exports.Awssociate=Factory,exports.roleArn=roleArn;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var awsSdk=require("aws-sdk"),__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var Factory=function(){function e(e){this.options=e}return e.prototype.ForService=function(e){return new ServiceFactory(e,this.options)},e}(),ServiceFactory=function(){function e(e,t){this.service=e,this.stsOptions=t,this.options=void 0}return e.prototype.WithOptions=function(e){if(void 0!==this.options)throw new Error("WithOptions has already been called");return this.options=e,this},e.prototype.WithRoleChain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return __awaiter(this,void 0,void 0,function(){var t,n,r,o=this;return __generator(this,function(i){switch(i.label){case 0:return t=this.stsOptions||{},[4,e.reduce(function(e,n){return e.then(function(e){return t.credentials=e,o.Assumer(t,n)})},Promise.resolve(t.credentials||new awsSdk.EnvironmentCredentials("AWS")))];case 1:return n=i.sent(),r=Object.assign({},this.options||{},__assign({},n)),[2,new this.service(r)]}})})},e.prototype.Assumer=function(e,t){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(r){switch(r.label){case 0:return[4,new awsSdk.STS(e).assumeRole(t).promise()];case 1:if(void 0===(n=r.sent().Credentials))throw new Error("Retrieved credentials were returned undefined");return[2,{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken}]}})})},e}();function roleArn(e,t){return"arn:aws:iam::"+e+":role/"+(t.startsWith("/")?t.substring(1):t)}exports.Awssociate=Factory,exports.roleArn=roleArn;
//# sourceMappingURL=index.cjs.js.map

@@ -1,2 +0,2 @@

import{STS}from"aws-sdk";var __assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function __awaiter(t,e,n,r){return new(n||(n=Promise))(function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(s,a)}c((r=r.apply(t,e||[])).next())})}function __generator(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var Factory=function(){function t(t){this.options=t}return t.prototype.ForService=function(t){return new ServiceFactory(this.options,t)},t}(),ServiceFactory=function(){function t(t,e){this.stsOptions=t,this.service=e,this.options=void 0}return t.prototype.WithOptions=function(t){if(void 0!==this.options)throw new Error("WithOptions has already been called");return this.options=t,this},t.prototype.WithRoleChain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return __awaiter(this,void 0,void 0,function(){var e,n,r,o=this;return __generator(this,function(i){switch(i.label){case 0:return e=__assign({},this.stsOptions),[4,t.reduce(function(t,n){return t.then(function(t){return e.credentials=t,o.Assumer(e,n)})},Promise.resolve(this.stsOptions.credentials))];case 1:return n=i.sent(),r=Object.assign({},this.options||{},__assign({},n)),[2,new this.service(r)]}})})},t.prototype.Assumer=function(t,e){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(r){switch(r.label){case 0:return[4,new STS(t).assumeRole(e).promise()];case 1:if(void 0===(n=r.sent().Credentials))throw new Error("Retrieved credentials were returned undefined");return[2,{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken}]}})})},t}();function roleArn(t,e){return"arn:aws:iam::"+t+":role/"+(e.startsWith("/")?e.substring(1):e)}export{Factory as Awssociate,roleArn};
import{STS,EnvironmentCredentials}from"aws-sdk";var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var Factory=function(){function e(e){this.options=e}return e.prototype.ForService=function(e){return new ServiceFactory(e,this.options)},e}(),ServiceFactory=function(){function e(e,t){this.service=e,this.stsOptions=t,this.options=void 0}return e.prototype.WithOptions=function(e){if(void 0!==this.options)throw new Error("WithOptions has already been called");return this.options=e,this},e.prototype.WithRoleChain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return __awaiter(this,void 0,void 0,function(){var t,n,r,o=this;return __generator(this,function(i){switch(i.label){case 0:return t=this.stsOptions||{},[4,e.reduce(function(e,n){return e.then(function(e){return t.credentials=e,o.Assumer(t,n)})},Promise.resolve(t.credentials||new EnvironmentCredentials("AWS")))];case 1:return n=i.sent(),r=Object.assign({},this.options||{},__assign({},n)),[2,new this.service(r)]}})})},e.prototype.Assumer=function(e,t){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(r){switch(r.label){case 0:return[4,new STS(e).assumeRole(t).promise()];case 1:if(void 0===(n=r.sent().Credentials))throw new Error("Retrieved credentials were returned undefined");return[2,{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken}]}})})},e}();function roleArn(e,t){return"arn:aws:iam::"+e+":role/"+(t.startsWith("/")?t.substring(1):t)}export{Factory as Awssociate,roleArn};
//# sourceMappingURL=index.esm.js.map
{
"name": "@mechanicalrock/awssociate",
"version": "0.2.0",
"version": "0.2.1",
"description": "> Some helpers for AWS",

@@ -5,0 +5,0 @@ "author": "Matt Tyler <matt.tyler@mechanicalrock.io>",

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