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

@4c/graphql-subscription-server

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@4c/graphql-subscription-server - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [0.10.0](https://github.com/4Catalyzer/graphql-subscription-server/compare/v0.9.0...v0.10.0) (2020-05-03)
### Features
* Expose subscriber to subscription ([#337](https://github.com/4Catalyzer/graphql-subscription-server/issues/337)) ([5d164d9](https://github.com/4Catalyzer/graphql-subscription-server/commit/5d164d9))
# [0.9.0](https://github.com/4Catalyzer/graphql-subscription-server/compare/v0.8.2...v0.9.0) (2019-04-02)

@@ -2,0 +9,0 @@

5

es/AuthorizedSocketConnection.js

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

import { createSourceEventStream, execute, GraphQLError, parse, specifiedRules, validate } from 'graphql';
import { GraphQLError, createSourceEventStream, execute, parse, specifiedRules, validate } from 'graphql';
import * as AsyncUtils from './AsyncUtils';

@@ -90,3 +90,4 @@ import SubscriptionContext from './SubscriptionContext';

return AsyncUtils.filter((await subscriptionContext.subscribe(topic, options)), data => this.isAuthorized(data, hasPermission));
}
},
subscriber: this.config.subscriber
}, variables);

@@ -93,0 +94,0 @@ this.subscriptionContexts.set(id, subscriptionContext);

11

es/RedisSubscriber.js

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

import { promisify } from 'util';
import redis from 'redis';
import { promisify } from 'util';
import { AsyncQueue, map } from './AsyncUtils';

@@ -36,5 +36,3 @@ export default class RedisSubscriber {

subscribe(channel, options = {}) {
const parseMessage = options.parseMessage || this._parseMessage;
subscribe(channel, options) {
let channelQueues = this._queues.get(channel);

@@ -67,7 +65,6 @@

let iteratorPromise = queue.iterator;
const parseMessage = (options == null ? void 0 : options.parseMessage) || this._parseMessage;
if (parseMessage) {
// Workaround for Flow.
const parseMessageFn = parseMessage;
iteratorPromise = iteratorPromise.then(iterator => map(iterator, parseMessageFn));
iteratorPromise = iteratorPromise.then(iterator => map(iterator, parseMessage));
}

@@ -74,0 +71,0 @@

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

import { promisify } from 'util';
import express from 'express';
import IoServer from 'socket.io';
import { promisify } from 'util';
import AuthorizedSocketConnection from './AuthorizedSocketConnection';

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

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const acknowledge = cb => {

@@ -102,3 +104,4 @@ if (cb) cb();

return AsyncUtils.filter((await subscriptionContext.subscribe(topic, options)), data => this.isAuthorized(data, hasPermission));
}
},
subscriber: this.config.subscriber
}, variables);

@@ -105,0 +108,0 @@ this.subscriptionContexts.set(id, subscriptionContext);

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

var _util = require("util");
var _redis = _interopRequireDefault(require("redis"));
var _util = require("util");
var _AsyncUtils = require("./AsyncUtils");

@@ -47,5 +47,3 @@

subscribe(channel, options = {}) {
const parseMessage = options.parseMessage || this._parseMessage;
subscribe(channel, options) {
let channelQueues = this._queues.get(channel);

@@ -78,7 +76,6 @@

let iteratorPromise = queue.iterator;
const parseMessage = (options == null ? void 0 : options.parseMessage) || this._parseMessage;
if (parseMessage) {
// Workaround for Flow.
const parseMessageFn = parseMessage;
iteratorPromise = iteratorPromise.then(iterator => (0, _AsyncUtils.map)(iterator, parseMessageFn));
iteratorPromise = iteratorPromise.then(iterator => (0, _AsyncUtils.map)(iterator, parseMessage));
}

@@ -85,0 +82,0 @@

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

var _util = require("util");
var _express = _interopRequireDefault(require("express"));

@@ -11,4 +13,2 @@

var _util = require("util");
var _AuthorizedSocketConnection = _interopRequireDefault(require("./AuthorizedSocketConnection"));

@@ -15,0 +15,0 @@

{
"name": "@4c/graphql-subscription-server",
"version": "0.9.0",
"version": "0.10.0",
"files": [

@@ -19,3 +19,2 @@ "lib",

"lint": "npm run check && eslint . && prettier --list-different --ignore-path .eslintignore '**/*.{json,css,md}'",
"precommit": "lint-staged",
"prepublish": "npm run build",

@@ -31,10 +30,4 @@ "tdd": "jest --watch",

"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
],
"*.{json,css,md}": [
"prettier --write --ignore-path .eslintignore",
"git add"
]
"*.js": "eslint --fix",
"*.{json,css,md}": "prettier --write --ignore-path .eslintignore"
},

@@ -64,5 +57,5 @@ "prettier": {

"dependencies": {
"express": "^4.16.4",
"redis": "^2.8.0",
"socket.io": "^2.2.0"
"express": "^4.17.1",
"redis": "^3.0.0",
"socket.io": "^2.3.0"
},

@@ -73,33 +66,33 @@ "peerDependencies": {

"devDependencies": {
"@4c/babel-preset": "^5.1.0",
"@4c/semantic-release-config": "^1.0.5",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.4.0",
"@babel/preset-flow": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.6.0",
"codecov": "^3.2.0",
"eslint": "^5.16.0",
"eslint-config-4catalyzer-flow": "^0.8.2",
"eslint-config-4catalyzer-flow-react": "^0.7.8",
"eslint-config-4catalyzer-jest": "^1.2.1",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-flowtype": "^3.4.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jest": "^22.4.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"flow-bin": "^0.96.0",
"graphql": "^14.2.1",
"husky": "^1.3.1",
"jest": "^24.6.0",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"redis-mock": "^0.43.0",
"semantic-release": "^15.13.3"
"@4c/babel-preset": "^7.3.4",
"@4c/semantic-release-config": "^2.0.7",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/preset-flow": "^7.9.0",
"babel-jest": "^25.4.0",
"codecov": "^3.6.5",
"eslint": "^6.8.0",
"eslint-config-4catalyzer-flow": "^1.0.5",
"eslint-config-4catalyzer-flow-react": "^1.0.8",
"eslint-config-4catalyzer-jest": "^2.0.6",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-flowtype": "^4.7.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.0.0",
"flow-bin": "^0.120.1",
"graphql": "^15.0.0",
"husky": "^4.2.5",
"jest": "^25.4.0",
"lint-staged": "^10.1.7",
"prettier": "^1.19.1",
"redis-mock": "^0.49.0",
"semantic-release": "^17.0.7"
},
"engines": {
"node": ">=10.0.0"
"node": ">=v10.19.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

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