From 09cf9c9743d6e4b3898f0db85d6d4807718a55fb Mon Sep 17 00:00:00 2001 From: "Dale R. Hille" Date: Fri, 15 May 2020 06:49:30 -0400 Subject: [PATCH] enable grapql. remove socket.io code --- app/index.js | 2 - app/subs/index.js | 29 --- app/subs/index.tests.js | 135 ---------- app/subs/subscriptions.js | 111 -------- app/subs/subscriptions.tests.js | 188 -------------- kubernetes/razeedash-api/resource.yaml | 2 + package-lock.json | 346 ------------------------- package.json | 2 - 8 files changed, 2 insertions(+), 813 deletions(-) delete mode 100644 app/subs/index.js delete mode 100644 app/subs/index.tests.js delete mode 100644 app/subs/subscriptions.js delete mode 100644 app/subs/subscriptions.tests.js diff --git a/app/index.js b/app/index.js index 1f1e351cf..4799ab36e 100644 --- a/app/index.js +++ b/app/index.js @@ -78,8 +78,6 @@ server.on('error', onError); server.on('listening', onListening); server.on('connection', onConnection); -require('./subs/index')(server); - initialize().then((db) => { app.set('db', db); server.emit('ready'); diff --git a/app/subs/index.js b/app/subs/index.js deleted file mode 100644 index 4fb90a7d9..000000000 --- a/app/subs/index.js +++ /dev/null @@ -1,29 +0,0 @@ -const log = require('../log').log; -const SocketIo = require('socket.io'); - -var Subscriptions = require('./subscriptions'); - -var io; - -module.exports = (server)=>{ - io = SocketIo(server); - io.on('connection', async function(socket) { - log.info(`client ${socket.id} connected to socket.io`); - - const orgKey = socket.handshake.query['razee-org-key']; - var action = socket.handshake.query.action; - if (!orgKey) { - log.error(`client ${socket.id} no org key. disconnected`); - socket.disconnect(true); - return false; - } - if(action == 'subscriptions'){ - await Subscriptions(orgKey, socket); - } - else{ - log.error(`client ${socket.id} unknown action: ${action}`); - throw `unknown socket.handshake.query['action'] "${action}"`; - } - - }); -}; diff --git a/app/subs/index.tests.js b/app/subs/index.tests.js deleted file mode 100644 index 2fd8a7284..000000000 --- a/app/subs/index.tests.js +++ /dev/null @@ -1,135 +0,0 @@ -/* eslint-env node, mocha */ -/* eslint no-async-promise-executor: off */ -/** - * Copyright 2019 IBM Corp. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var rewire = require('rewire'); -var events = require('events'); - -const { assert } = require('chai'); -const chai = require('chai'); -chai.use(require('chai-spies')); - -var _ = require('lodash'); - -const sinon = require('sinon'); - -var SocketMock = rewire('socket.io-mock'); - -var socket; - -var mockSubscriptions = ()=>{ -}; -var mockSocketIo = (server)=>{ - return server; -}; - -var index = rewire('./index'); -index.__set__({ - Subscriptions: mockSubscriptions, - SocketIo: mockSocketIo, -}); - -describe('subs', () => { - describe('subscriptions', () =>{ - beforeEach(async() => { - socket = new SocketMock(); - socket.disconnect = ()=>{ - _.each(socket.listeners('disconnect'), (func)=>{ - func(); - }); - }; - - }); - - afterEach((done)=>{ - socket.disconnect(); - sinon.restore(); - - done(); - }); - - it('test connection with action="subscriptions"', async () => { - var testOrgKey = 'testOrgKey'; - _.set(socket, 'handshake.query.razee-org-key', testOrgKey); - _.set(socket, 'handshake.query.action', 'subscriptions'); - - await (new Promise(async(resolve)=>{ - - index.__set__({ - Subscriptions: (orgKey, _socket)=>{ - assert(orgKey == testOrgKey); - assert(socket == _socket); - resolve(); - }, - }); - - var mockServer = new events.EventEmitter(); - index(mockServer); - mockServer.emit('connection', socket); - })); - }); - - it('should disconnect if no org key specified', async()=>{ - _.set(socket, 'handshake.query.razee-org-key', ''); - _.set(socket, 'handshake.query.action', 'subscriptions'); - - await (new Promise(async(resolve)=>{ - var mockServer = new events.EventEmitter(); - index(mockServer); - - var listener = mockServer.listeners('connection')[0]; - mockServer.removeListener('connection', listener); - mockServer.on('connection', async(...args)=>{ - var result = await listener(...args); - - assert(result == false); - resolve(); - }); - - mockServer.emit('connection', socket); - })); - }); - - it('test connection with action=null', async () => { - var testOrgKey = 'testOrgKey'; - var action = ''; - _.set(socket, 'handshake.query.razee-org-key', testOrgKey); - _.set(socket, 'handshake.query.action', action); - - await (new Promise(async(resolve, reject)=>{ - var mockServer = new events.EventEmitter(); - index(mockServer); - - var listener = mockServer.listeners('connection')[0]; - mockServer.removeListener('connection', listener); - mockServer.on('connection', async(...args)=>{ - try{ - await listener(...args); - reject('listener should have thrown an error'); - }catch(e){ - // should throw - assert(e, `unknown socket.handshake.query['action'] "${action}"`); - resolve(); - } - }); - - mockServer.emit('connection', socket); - })); - }); - }); -}); - diff --git a/app/subs/subscriptions.js b/app/subs/subscriptions.js deleted file mode 100644 index 154d375a3..000000000 --- a/app/subs/subscriptions.js +++ /dev/null @@ -1,111 +0,0 @@ -var _ = require('lodash'); -var objectHash = require('object-hash'); - -const log = require('../log').log; - -const mongoConf = require('../conf.js').conf; -const MongoClientClass = require('../mongo/mongoClient.js'); -const MongoClient = new MongoClientClass(mongoConf); - -const tagsStrToArr = require('../utils/subscriptions.js').tagsStrToArr; -const getSubscriptionUrls = require('../utils/subscriptions.js').getSubscriptionUrls; - -var { sub } = require('../utils/pubsub.js'); - -/* -* Waits for socketio connections -* On connect (with valid auth), sends an event containing the Subscription urls which match the `tags` specified on connect -* Also builds a redis pubsub that listens on the following events: ['updateSubscription', 'addSubscription', 'removeSubscription'] -* On event, rechecked which urls should be displayed. if theres changes from what was last sent to the client, sends a new event with the urls -*/ - -module.exports = async(orgKey, socket)=>{ - const tagsString = socket.handshake.query['tags']; - if (!tagsString || tagsString === 'undefined') { - log.info(`client ${socket.id} no tags were supplied`); - return false; - } - const tags = tagsStrToArr(tagsString); - const db = await MongoClient.getClient(); - const Orgs = db.collection('orgs'); - const org = await Orgs.findOne({ orgKeys: orgKey }); - if (!org) { - log.error(`client ${socket.id} bad org key. disconnected`); - socket.disconnect(true); - return false; - } - - // get tags. query subscriptions that match all tags - // emit the resource urls back to the client (using ryan's code in the subscriptions/deployabes route) - const orgId = org._id; - - var prevSubs = []; - - const Subscriptions = db.collection('subscriptions'); - - var onMsg = async(data)=>{ - // filter - if(data.orgId != orgId){ - return false; - } - - // otherwise maybe we need to update - var curSubs = await Subscriptions.aggregate([ - { $match: { 'org_id': orgId } }, - { $project: { name: 1, uuid: 1, tags: 1, version: 1, channel: 1, isSubSet: { $setIsSubset: ['$tags', tags ] } } }, - { $match: { 'isSubSet': true } } - ]).toArray(); - curSubs = _.sortBy(curSubs, '_id'); - - var prevSubIds = _.map(prevSubs, '_id'); - var curSubIds = _.map(curSubs, '_id'); - - var addedSubIds = _.without(curSubIds, ...prevSubIds); - var removedSubIds = _.without(prevSubIds, ...curSubIds); - var objsHaveUpdates = objectHash(curSubs) != objectHash(prevSubs); - - //console.log(`updates: ${objsHaveUpdates}, added: ${addedSubIds.length}, removed: ${removedSubIds.length}`); - - if(!objsHaveUpdates && addedSubIds.length < 1 && removedSubIds.length < 1){ - // no changes, so doesnt do anything - return false; - } - - var urls = await getSubscriptionUrls(orgId, tags, curSubs); - - log.info(`client ${socket.id} sending urls `, { urls }); - - // exposes the name and uuid fields to the user - var publicSubs = _.map(curSubs, (sub)=>{ - return _.pick(sub, ['name', 'uuid']); - }); - - socket.emit('subscriptions', { - subscriptions: publicSubs, - urls, - }); - - prevSubs = curSubs; - - return true; - }; - var handles = [ - sub('updateSubscription', onMsg), - sub('addSubscription', onMsg), - sub('removeSubscription', onMsg), - ]; - - socket.on('disconnect', ()=>{ - log.info(`client ${socket.id} disconnecting subscription`); - _.each(handles, (handle)=>{ - handle.unsubscribe(); - }); - }); - - // trigger once so they get the original - onMsg({ - orgId, - }); - - return true; -}; diff --git a/app/subs/subscriptions.tests.js b/app/subs/subscriptions.tests.js deleted file mode 100644 index f3a485b11..000000000 --- a/app/subs/subscriptions.tests.js +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-env node, mocha */ -/* eslint no-async-promise-executor: off */ -/** - * Copyright 2019 IBM Corp. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var rewire = require('rewire'); -const { v4: uuid } = require('uuid'); - -const { assert } = require('chai'); -const chai = require('chai'); -chai.use(require('chai-spies')); - -var _ = require('lodash'); - -const sinon = require('sinon'); - -var mongodb = require('mongo-mock'); -var SocketMock = rewire('socket.io-mock'); - -var db; -var socket; -var fakeUrls = [ 'api/v1/channels/someChan/someId' ]; - -var orgId = 'testOrgId'; -var orgKey = 'testOrgKey'; - -var subMock = ()=>{ - return { - unsubscribe(){ } - }; -}; - -var mockMongoClient = { - getClient(){ - return db; - } -}; - -var mockGetSubscriptionUrls = async()=>{ - return fakeUrls; -}; - -var subscriptions = rewire('./subscriptions'); - -describe('subs', () => { - describe('subscriptions', () =>{ - beforeEach(async() => { - subscriptions.__set__({ - sub: subMock, - MongoClient: mockMongoClient, - getSubscriptionUrls: mockGetSubscriptionUrls, - }); - - socket = new SocketMock(); - socket.disconnect = ()=>{ - _.each(socket.listeners('disconnect'), (func)=>{ - func(); - }); - }; - - mongodb.max_delay = 0; - var MongoClient = mongodb.MongoClient; - db = await MongoClient.connect(`someconnectstring-${uuid()}`, {}); - - var Orgs = db.collection('orgs'); - var docs = [ - { - _id: orgId, - orgKeys: [ orgKey ], - } - ]; - await Orgs.insertMany(docs); - - var Subscriptions = db.collection('subscriptions'); - - Subscriptions.aggregate = ()=>{ - return { - toArray:()=>{ - return [ - { - '_id' : 'testAggrOutputId', - 'tags' : [ - 'aaaaa' - ], - 'channel' : 'bbbbb', - 'version' : 'asdf.yml', - 'isSubSet' : true - } - ]; - } - }; - }; - }); - - afterEach((done)=>{ - socket.disconnect(); - db.close(); - sinon.restore(); - - done(); - }); - - it('should trigger initial onMsg() and another after with no updates', async () => { - var lastOnMsg = ()=>{ - throw 'lastOnMsg() should have been overwritten'; - }; - subscriptions.__set__({ - sub: (chanName, onMsg)=>{ - lastOnMsg = onMsg; - return { - unsubscribe(){}, - }; - }, - }); - - _.set(socket, 'handshake.query.tags', 'aaaa,bbbb'); - - var result = await (new Promise(async(resolve)=>{ - sinon.replace(socket, 'emit', (type, data)=>{ - resolve([ type, data ]); - }); - var result = await subscriptions(orgKey, socket); - assert(result, true); - })); - - assert(result[0] == 'subscriptions'); - assert.deepEqual(result[1].urls, fakeUrls); - - result = await lastOnMsg({ orgId }); - assert(result == false); - }); - - it('should error return false when no tagsString sent', async () => { - _.set(socket, 'handshake.query.tags', ''); - - var result = subscriptions(orgKey, socket); - assert(result, false); - }); - - it('should error return false when invalid org key sent', async () => { - _.set(socket, 'handshake.query.tags', 'aaaa'); - - var result = subscriptions('badOrgKey', socket); - assert(result, false); - }); - - it('should not trigger if different org sent in msg', async () => { - _.set(socket, 'handshake.query.tags', 'aaaa,bbbb'); - - var lastOnMsg = ()=>{ - throw 'lastOnMsg() should have been overwritten'; - }; - subscriptions.__set__({ - sub: (chanName, onMsg)=>{ - lastOnMsg = onMsg; - return { - unsubscribe(){}, - }; - }, - }); - - await (new Promise(async(resolve)=>{ - sinon.replace(socket, 'emit', (type, urls)=>{ - resolve([ type, urls ]); - }); - var result = await subscriptions(orgKey, socket); - assert(result, true); - })); - - var result = await lastOnMsg({ orgId: 'aDifferentOrgKey' }); - assert(result == false); - }); - }); -}); - diff --git a/kubernetes/razeedash-api/resource.yaml b/kubernetes/razeedash-api/resource.yaml index 31c41c876..f436ce565 100644 --- a/kubernetes/razeedash-api/resource.yaml +++ b/kubernetes/razeedash-api/resource.yaml @@ -104,6 +104,8 @@ items: optional: true - name: REDIS_CONN_JSON value: '{"host":"redis-service", "port": 6379}' + - name: ENABLE_GRAPHQL + value: true image: "quay.io/razee/razeedash-api:{{TRAVIS_TAG}}" imagePullPolicy: Always name: razeedash-api diff --git a/package-lock.json b/package-lock.json index 7ba4c694f..cfb2896bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -778,11 +778,6 @@ "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" - }, "agent-base": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", @@ -1238,11 +1233,6 @@ "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", "dev": true }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -1344,21 +1334,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" - }, "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" - }, "bcrypt": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-4.0.1.tgz", @@ -1376,14 +1356,6 @@ "tweetnacl": "^0.14.3" } }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "requires": { - "callsite": "1.0.0" - } - }, "binary-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", @@ -1404,11 +1376,6 @@ "safe-buffer": "^5.1.1" } }, - "blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" - }, "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", @@ -1610,11 +1577,6 @@ } } }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1839,21 +1801,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" - }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -2276,92 +2223,6 @@ "once": "^1.4.0" } }, - "engine.io": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.0.tgz", - "integrity": "sha512-XCyYVWzcHnK5cMz7G4VTu2W7zJS7SM1QkcelghyIk/FmobWBtXE7fwhBusEKvCSqc3bMh8fNFMlUkCKTFRxH2w==", - "requires": { - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "0.3.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "^7.1.2" - }, - "dependencies": { - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "engine.io-client": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.0.tgz", - "integrity": "sha512-a4J5QO2k99CM2a0b12IznnyQndoEvtA4UAldhGzKqnHf42I3Qs2W5SPnDvatZRcMaNZs4IevVicBPayxYt6FwA==", - "requires": { - "component-emitter": "1.2.1", - "component-inherit": "0.0.3", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "~6.1.0", - "xmlhttprequest-ssl": "~1.5.4", - "yeast": "0.1.2" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, - "engine.io-parser": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", - "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.5", - "blob": "0.0.5", - "has-binary2": "~1.0.2" - } - }, "entities": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", @@ -3485,26 +3346,6 @@ "ansi-regex": "^2.0.0" } }, - "has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "requires": { - "isarray": "2.0.1" - }, - "dependencies": { - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" - } - } - }, - "has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3675,11 +3516,6 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -5813,11 +5649,6 @@ "integrity": "sha512-54Uvn3s+4A/cMWx9tlRez1qtc7pN7pbQ+Yi7mjLjcBpWLlP+XbSHiHbQW6CElDiV4OvuzqnMrBdkgxI1mT8V/Q==", "dev": true }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" - }, "object-hash": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.0.3.tgz", @@ -6015,22 +5846,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "requires": { - "better-assert": "~1.0.0" - } - }, - "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "requires": { - "better-assert": "~1.0.0" - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -6798,152 +6613,6 @@ "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" }, - "socket.io": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", - "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", - "requires": { - "debug": "~4.1.0", - "engine.io": "~3.4.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.3.0", - "socket.io-parser": "~3.4.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==" - }, - "socket.io-client": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", - "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", - "requires": { - "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "engine.io-client": "~3.4.0", - "has-binary2": "~1.0.2", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "socket.io-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", - "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", - "requires": { - "component-emitter": "1.2.1", - "debug": "~3.1.0", - "isarray": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - } - } - }, - "socket.io-mock": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/socket.io-mock/-/socket.io-mock-1.2.4.tgz", - "integrity": "sha512-pOoqM7CiOq3ybfokiPUA2afTfLTh/M1MjeTvTh+j+gGEgZzA+XfzdfiLJXKIo7pdkI+ASjRXNBAdvKuagrQQzw==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0" - }, - "dependencies": { - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - } - } - }, - "socket.io-parser": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.0.tgz", - "integrity": "sha512-/G/VOI+3DBp0+DJKW4KesGnQkQPFmUCbA/oO2QGT6CWxU7hLGWqU3tyuzeSK/dqcyeHsQg1vTe9jiZI8GU9SCQ==", - "requires": { - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "isarray": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -7392,11 +7061,6 @@ "os-tmpdir": "~1.0.2" } }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -7918,11 +7582,6 @@ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" }, - "xmlhttprequest-ssl": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", - "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", @@ -8037,11 +7696,6 @@ "fd-slicer": "~1.1.0" } }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" - }, "zen-observable": { "version": "0.8.15", "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", diff --git a/package.json b/package.json index 582d04e36..55a88d677 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "prom-client": "^12.0.0", "request": "^2.88.2", "request-promise-native": "^1.0.8", - "socket.io": "^2.3.0", "subscriptions-transport-ws": "^0.9.16", "swagger-ui-express": "^4.1.4", "uuid": "^7.0.3", @@ -97,7 +96,6 @@ "nyc": "^15.0.1", "rewire": "^5.0.0", "sinon": "^9.0.2", - "socket.io-mock": "^1.2.4", "why-is-node-running": "^2.1.2", "yaml-lint": "^1.2.4" }