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

steveo

Package Overview
Dependencies
Maintainers
4
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steveo - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

2

lib/common.d.ts

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

import { HTTPOptions } from "aws-sdk";
export declare type Callback = (x: any) => any;

@@ -43,2 +44,3 @@ export declare type getPayload = (msg: any, topic: string) => {

endPoint?: string;
httpOptions?: HTTPOptions;
};

@@ -45,0 +47,0 @@ export declare type RedisConfiguration = {

@@ -32,2 +32,3 @@ "use strict";

parameters.endpoint = config.endpoint;
parameters.httpOptions = config.httpOptions;
}

@@ -34,0 +35,0 @@ else if (parameters.engine === 'redis') {

@@ -11,4 +11,5 @@ import * as AWS from 'aws-sdk';

}>;
listQueuesAsync: (...args: any[]) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.SQS.ListQueuesResult, AWS.AWSError>>;
};
};
export default _default;

14

lib/config/sqs.js

@@ -9,16 +9,8 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const AWS = __importStar(require("aws-sdk"));
const https_1 = __importDefault(require("https"));
const sqs = (config) => {
if (process.env.NODE_ENV === 'development') {
if (config.httpOptions) {
AWS.config.update({
httpOptions: {
agent: new https_1.default.Agent({
rejectUnauthorized: false,
}),
},
httpOptions: config.httpOptions
});

@@ -38,2 +30,3 @@ }

const deleteMessage = instance.deleteMessage.bind(instance);
const listQueues = instance.listQueues.bind(instance);
const dummy = {

@@ -45,2 +38,3 @@ createQueueAsync: (...args) => createQueue(...args).promise(),

deleteMessageAsync: (...args) => deleteMessage(...args).promise(),
listQueuesAsync: (...args) => listQueues(...args).promise()
};

@@ -47,0 +41,0 @@ return Object.assign(instance, dummy);

@@ -9,3 +9,3 @@ import { Configuration, Logger, IProducer, IRegistry, sqsUrls } from '../common';

constructor(config: Configuration, registry: IRegistry, logger?: Logger);
initialize(topic?: string): any;
initialize(topic?: string): Promise<any>;
getPayload(msg: any, topic: string): any;

@@ -12,0 +12,0 @@ send(topic: string, payload: any): Promise<void>;

@@ -17,3 +17,12 @@ "use strict";

}
initialize(topic) {
async initialize(topic) {
if (!topic) {
throw new Error("Topic cannot be empty");
}
const { QueueUrls } = await this.producer.listQueuesAsync();
const queue = ((QueueUrls !== null && QueueUrls !== void 0 ? QueueUrls : [])).find(queueUrl => queueUrl.includes(topic));
if (queue) {
this.sqsUrls[topic] = queue;
return queue;
}
const params = {

@@ -27,5 +36,5 @@ QueueName: topic,

};
return this.producer
.createQueueAsync(params)
.then(data => data && data.QueueUrl);
const { data: { QueueUrl } } = await this.producer.createQueueAsync(params);
this.sqsUrls[topic] = QueueUrl;
return QueueUrl;
}

@@ -58,5 +67,3 @@ getPayload(msg, topic) {

try {
if (!this.sqsUrls[topic]) {
this.sqsUrls[topic] = await this.initialize(topic);
}
await this.initialize(topic);
}

@@ -63,0 +70,0 @@ catch (ex) {

{
"name": "steveo",
"version": "2.0.3",
"version": "2.0.4",
"description": "A Task Pub/Sub Background processing library",

@@ -5,0 +5,0 @@ "main": "lib/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