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

sqns

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqns - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

5

package.json
{
"name": "sqns",
"version": "2.0.6",
"version": "2.0.7",
"description": "",

@@ -11,4 +11,3 @@ "main": "index.js",

"coverage:mongodb": "DEBUG=no TEST_DB=mongoDB nyc mocha src/setup.ts '**/*.spec.ts' && nyc report --reporter=text-lcov > coverage1.lcov",
"test": "npm run test:inmemory && npm run test:mongodb",
"test:inmemory": "mocha src/setup.ts '**/*.spec.ts' --exit",
"test": "npm run test:mongodb",
"test:mongodb": "TEST_DB=mongoDB mocha src/setup.ts '**/*.spec.ts'"

@@ -15,0 +14,0 @@ },

4

src/sqns/common/model/base-storage-engine.d.ts

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

import { KeyValue } from '../../../../typings/typings';
import { KeyValue } from '../../../../typings/common';
import { AdminSecretKeys, DatabaseConfig } from '../../../../typings/config';

@@ -10,3 +10,3 @@ import { Database } from '../database';

protected readonly _storageAdapter: StorageAdapter;
constructor(databaseConfig: DatabaseConfig, adminSecretKeys: Array<AdminSecretKeys>);
constructor(databaseConfig: DatabaseConfig);
initialize(adminSecretKeys: Array<AdminSecretKeys>): Promise<void>;

@@ -13,0 +13,0 @@ updateAccessKey(accessKey: AccessKey): Promise<AccessKey>;

@@ -7,6 +7,4 @@ "use strict";

const mongo_d_b_adapter_1 = require("../database/mongodb/mongo-d-b-adapter");
const logger_1 = require("../logger/logger");
const log = logger_1.logger.instance('BaseStorageEngine');
class BaseStorageEngine {
constructor(databaseConfig, adminSecretKeys) {
constructor(databaseConfig) {
switch (databaseConfig.database) {

@@ -24,4 +22,2 @@ case database_1.Database.MONGO_DB: {

}
this.initialize(adminSecretKeys.map((each) => each))
.catch((error) => log.error(error));
}

@@ -28,0 +24,0 @@ async initialize(adminSecretKeys) {

import { Express } from 'express';
import { ARN } from '../../typings/typings';
import { ARN } from '../../typings/common';
import { SQNSConfig } from '../../typings/config';

@@ -4,0 +4,0 @@ import { EventItem } from './common/model/event-item';

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

const logger_1 = require("./common/logger/logger");
const base_storage_engine_1 = require("./common/model/base-storage-engine");
const queue_1 = require("./common/model/queue");

@@ -31,8 +32,20 @@ const routes_1 = require("./common/routes");

log.info('Enable SQS');
this.sqsManager = new s_q_s_manager_1.SQSManager({ endpoint: config.endpoint, db: config.db, ...(config.sqs || {}) }, config.adminSecretKeys);
this.sqsManager = new s_q_s_manager_1.SQSManager({ endpoint: config.endpoint, db: config.db, ...(config.sqs || {}) });
}
if (!((_b = config.sns) === null || _b === void 0 ? void 0 : _b.disable)) {
log.info('Enable SNS');
this.snsManager = new s_n_s_manager_1.SNSManager({ endpoint: config.endpoint, db: config.db, ...(config.sns || {}) }, config.adminSecretKeys);
this.snsManager = new s_n_s_manager_1.SNSManager({
endpoint: config.endpoint,
db: config.db,
queueAccessKey: config.adminSecretKeys[0].accessKey,
queueSecretAccessKey: config.adminSecretKeys[0].secretAccessKey,
...(config.sns || {}),
});
}
new base_storage_engine_1.BaseStorageEngine(config.db)
.initialize(config.adminSecretKeys.map((each) => each))
.catch((error) => {
log.error(error);
process.exit(1);
});
}

@@ -39,0 +52,0 @@ queueComparator(queueARN, value) {

@@ -1,6 +0,6 @@

import { ARN, MessageAttributes, MessageStructure, SupportedProtocol } from '../../../../typings/typings';
import { TopicAttributes, TopicTag } from '../../../../typings/class-types';
import { AdminSecretKeys, SNSConfig } from '../../../../typings/config';
import { SNSConfig } from '../../../../typings/config';
import { DeliveryPolicy } from '../../../../typings/delivery-policy';
import { SubscriptionAttributes } from '../../../../typings/subscription';
import { ARN, MessageAttributes, MessageStructure, SupportedProtocol } from '../../../../typings/typings';
import { BaseManager } from '../../common/model/base-manager';

@@ -18,3 +18,3 @@ import { BaseStorageEngine } from '../../common/model/base-storage-engine';

private readonly workerEventScheduler;
constructor(snsConfig: SNSConfig, adminSecretKeys: Array<AdminSecretKeys>);
constructor(snsConfig: SNSConfig);
createTopic(name: string, displayName: string, region: string, deliveryPolicy: DeliveryPolicy, user: User, attributes?: TopicAttributes, tags?: TopicTag): Promise<Topic>;

@@ -21,0 +21,0 @@ findTopicByARN(topicARN: string): Promise<Topic>;

@@ -16,3 +16,3 @@ "use strict";

class SNSManager extends base_manager_1.BaseManager {
constructor(snsConfig, adminSecretKeys) {
constructor(snsConfig) {
super();

@@ -22,6 +22,6 @@ this.requestClient = new request_client_1.RequestClient();

endpoint: snsConfig.queueEndpoint || snsConfig.endpoint,
accessKeyId: snsConfig.queueAccessKey || adminSecretKeys[0].accessKey,
secretAccessKey: snsConfig.queueSecretAccessKey || adminSecretKeys[0].secretAccessKey,
accessKeyId: snsConfig.queueAccessKey,
secretAccessKey: snsConfig.queueSecretAccessKey,
};
this.sNSStorageEngine = new s_n_s_storage_engine_1.SNSStorageEngine(snsConfig.db, adminSecretKeys);
this.sNSStorageEngine = new s_n_s_storage_engine_1.SNSStorageEngine(snsConfig.db);
this.sqnsClient = new s_q_n_s_client_1.SQNSClient(sqnsClientConfig);

@@ -28,0 +28,0 @@ if (!snsConfig.disableWorker) {

@@ -1,5 +0,5 @@

import { ARN, MessageAttributes, MessageStructure, SupportedProtocol } from '../../../../typings/typings';
import { TopicAttributes, TopicTag } from '../../../../typings/class-types';
import { DeliveryPolicy } from '../../../../typings/delivery-policy';
import { SubscriptionAttributes } from '../../../../typings/subscription';
import { ARN, MessageAttributes, MessageStructure, SupportedProtocol } from '../../../../typings/typings';
import { BaseStorageEngine } from '../../common/model/base-storage-engine';

@@ -6,0 +6,0 @@ import { Publish } from '../../common/model/publish';

@@ -1,4 +0,3 @@

import { ARN, MessageAttributeMap } from '../../../../typings/typings';
import { KeyValueString } from '../../../../typings/common';
import { AdminSecretKeys, SQSConfig } from '../../../../typings/config';
import { ARN, KeyValueString, MessageAttributeMap } from '../../../../typings/common';
import { SQSConfig } from '../../../../typings/config';
import { BaseManager } from '../../common/model/base-manager';

@@ -23,3 +22,3 @@ import { BaseStorageEngine } from '../../common/model/base-storage-engine';

prometheus(time?: Date): string;
constructor(sqsConfig: SQSConfig, adminSecretKeys: Array<AdminSecretKeys>);
constructor(sqsConfig: SQSConfig);
comparatorFunction(queueARN: string, value: (event1: EventItem, event2: EventItem) => boolean): void;

@@ -26,0 +25,0 @@ poll(queue: Queue, visibilityTimeout: number): Promise<EventItem>;

@@ -14,3 +14,3 @@ "use strict";

class SQSManager extends base_manager_1.BaseManager {
constructor(sqsConfig, adminSecretKeys) {
constructor(sqsConfig) {
super();

@@ -23,3 +23,3 @@ this.requestClient = new request_client_1.RequestClient();

this._eventQueue.notifyNeedTaskURLS = sqsConfig.requestTasks || [];
this._sQSStorageEngine = new s_q_s_storage_engine_1.SQSStorageEngine(sqsConfig.db, adminSecretKeys);
this._sQSStorageEngine = new s_q_s_storage_engine_1.SQSStorageEngine(sqsConfig.db);
this.storageToQueueWorker = new storage_to_queue_worker_1.StorageToQueueWorker(this._sQSStorageEngine, this.addEventInQueueListener, sqsConfig.cronInterval);

@@ -26,0 +26,0 @@ }

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

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