From 1aa671f2ba2c1c5ddca9d519bb0e911d6a41fd67 Mon Sep 17 00:00:00 2001 From: Battulga BatAmar Date: Mon, 17 Aug 2020 21:04:56 +0800 Subject: [PATCH] perf(dependencies): made rabbitmq, redis optional --- email-verifier/.env.sample | 3 - engages-email-sender/.env.sample | 10 +- engages-email-sender/package.json | 1 + engages-email-sender/src/index.ts | 9 +- engages-email-sender/src/messageBroker.ts | 36 ++ engages-email-sender/src/messageQueue.ts | 66 --- engages-email-sender/src/redisClient.ts | 84 ---- .../src/trackers/engageTracker.ts | 4 +- engages-email-sender/src/utils.ts | 17 +- engages-email-sender/yarn.lock | 427 +++++++++++++++- logger/.env.sample | 5 +- logger/package.json | 5 +- logger/src/index.ts | 8 +- logger/src/messageBroker.ts | 34 +- logger/yarn.lock | 460 +++++++++++++++++- package.json | 4 + src/__tests__/conversationMutations.test.ts | 8 +- src/__tests__/conversationQueries.test.ts | 1 - src/__tests__/engageMessageMutations.test.ts | 6 +- src/__tests__/importHistoryMutations.test.ts | 6 +- src/__tests__/integrationMutations.test.ts | 6 +- src/__tests__/integrationQueries.test.ts | 6 +- src/__tests__/setup.ts | 11 +- src/apolloClient.ts | 24 +- src/commands/createGooglePubsubTopics.ts | 84 ---- src/cronJobs/index.ts | 11 +- src/cronJobs/integrations.ts | 4 +- src/cronJobs/robot.ts | 4 +- src/data/logUtils.ts | 4 +- .../modules/integrations/receiveMessage.ts | 7 +- src/data/permissions/utils.ts | 10 +- src/data/resolvers/mutations/conversations.ts | 4 +- src/data/resolvers/mutations/customers.ts | 6 +- src/data/resolvers/mutations/engageUtils.ts | 4 +- src/data/resolvers/mutations/importHistory.ts | 6 +- src/data/resolvers/mutations/integrations.ts | 4 +- src/data/resolvers/mutations/internalNotes.ts | 6 +- src/data/resolvers/mutations/widgets.ts | 6 +- src/data/resolvers/queries/integrations.ts | 7 +- src/data/utils.ts | 8 +- src/index.ts | 24 +- src/inmemoryStorage.ts | 21 + src/messageBroker.ts | 163 +------ src/middlewares/fileMiddleware.ts | 4 +- src/pubsub.ts | 34 +- src/redisClient.ts | 165 ------- src/startup.ts | 11 - src/workers/bulkInsert.worker.ts | 19 - src/workers/importHistoryRemove.worker.ts | 21 +- src/workers/index.ts | 12 +- src/workers/messageBroker.ts | 99 ++-- src/workers/utils.ts | 6 +- yarn.lock | 409 +++++++++++++++- 53 files changed, 1525 insertions(+), 879 deletions(-) create mode 100644 engages-email-sender/src/messageBroker.ts delete mode 100644 engages-email-sender/src/messageQueue.ts delete mode 100644 engages-email-sender/src/redisClient.ts delete mode 100644 src/commands/createGooglePubsubTopics.ts create mode 100644 src/inmemoryStorage.ts delete mode 100644 src/redisClient.ts diff --git a/email-verifier/.env.sample b/email-verifier/.env.sample index 89897efed..8e713b499 100644 --- a/email-verifier/.env.sample +++ b/email-verifier/.env.sample @@ -5,9 +5,6 @@ PORT=4100 # MongoDB MONGO_URL=mongodb://localhost/erxes-email-verifier -# RabbitMQ -RABBITMQ_HOST=amqp://localhost - TRUE_MAIL_API_KEY= CLEAR_OUT_PHONE_API_KEY= diff --git a/engages-email-sender/.env.sample b/engages-email-sender/.env.sample index 5788c99b6..ca6c46d1a 100644 --- a/engages-email-sender/.env.sample +++ b/engages-email-sender/.env.sample @@ -7,12 +7,4 @@ MAIN_API_DOMAIN=http://localhost:3300 # MongoDB MONGO_URL=mongodb://localhost/erxes-engages -TEST_MONGO_URL=mongodb://localhost/erxes-engages-test - -# RabbitMQ -RABBITMQ_HOST=amqp://localhost - -# Redis -REDIS_HOST=localhost -REDIS_PORT=6379 -REDIS_PASSWORD= \ No newline at end of file +TEST_MONGO_URL=mongodb://localhost/erxes-engages-test \ No newline at end of file diff --git a/engages-email-sender/package.json b/engages-email-sender/package.json index b25ec1a48..8bc217420 100644 --- a/engages-email-sender/package.json +++ b/engages-email-sender/package.json @@ -13,6 +13,7 @@ "body-parser": "^1.17.1", "debug": "^4.1.1", "dotenv": "^4.0.0", + "erxes-message-broker": "^1.0.3", "express": "^4.16.4", "meteor-random": "^0.0.3", "mongoose": "5.7.5", diff --git a/engages-email-sender/src/index.ts b/engages-email-sender/src/index.ts index 34b96d474..bbcb4a46e 100644 --- a/engages-email-sender/src/index.ts +++ b/engages-email-sender/src/index.ts @@ -5,14 +5,13 @@ import { filterXSS } from 'xss'; import configs from './api/configs'; import deliveryReports from './api/deliveryReports'; import telnyx from './api/telnyx'; -import { initRedis } from './redisClient'; // load environment variables dotenv.config(); import { connect } from './connection'; import { debugBase, debugInit } from './debuggers'; -import { initConsumer } from './messageQueue'; +import { initBroker } from './messageBroker'; import { trackEngages } from './trackers/engageTracker'; const app = express(); @@ -51,11 +50,9 @@ const { PORT } = process.env; app.listen(PORT, () => { // connect to mongo database connect().then(async () => { - initConsumer().catch(e => { - debugBase(`Error ocurred during rabbitmq init ${e.message}`); + initBroker().catch(e => { + debugBase(`Error ocurred during message broker init ${e.message}`); }); - - initRedis(); }); debugInit(`Engages server is running on port ${PORT}`); diff --git a/engages-email-sender/src/messageBroker.ts b/engages-email-sender/src/messageBroker.ts new file mode 100644 index 000000000..b203061e9 --- /dev/null +++ b/engages-email-sender/src/messageBroker.ts @@ -0,0 +1,36 @@ +import * as dotenv from 'dotenv'; +import messageBroker from 'erxes-message-broker'; +import { debugBase } from './debuggers'; +import { Logs } from './models'; +import { sendSms, start } from './sender'; + +dotenv.config(); + +let client; + +export const initBroker = async () => { + client = await messageBroker({ name: 'logger', RABBITMQ_HOST: process.env.RABBITMQ_HOST }); + + const { consumeQueue } = client; + + // listen for rpc queue ========= + consumeQueue('erxes-api:engages-notification', async ({ action, data }) => { + debugBase(`Receiving queue data from erxes-api`, data); + + if (action === 'sendEngage') { + await start(data); + } + + if (action === 'writeLog') { + await Logs.createLog(data.engageMessageId, 'regular', data.msg); + } + + if (action === 'sendEngageSms') { + await sendSms(data); + } + }); +}; + +export default function() { + return client; +} diff --git a/engages-email-sender/src/messageQueue.ts b/engages-email-sender/src/messageQueue.ts deleted file mode 100644 index b9782eae4..000000000 --- a/engages-email-sender/src/messageQueue.ts +++ /dev/null @@ -1,66 +0,0 @@ -import * as amqplib from 'amqplib'; -import * as dotenv from 'dotenv'; -import { debugBase } from './debuggers'; -import { Logs } from './models'; -import { sendSms, start } from './sender'; - -dotenv.config(); - -const { NODE_ENV, RABBITMQ_HOST = 'amqp://localhost' } = process.env; - -let conn; -let channel; - -export const initConsumer = async () => { - try { - conn = await amqplib.connect(RABBITMQ_HOST); - channel = await conn.createChannel(); - - // listen for erxes api =========== - await channel.assertQueue('erxes-api:engages-notification'); - - channel.consume('erxes-api:engages-notification', async msg => { - if (msg !== null) { - const { action, data } = JSON.parse(msg.content.toString()); - - debugBase(`Receiving queue data from erxes-api`, data); - - if (action === 'sendEngage') { - await start(data); - } - - if (action === 'writeLog') { - await Logs.createLog(data.engageMessageId, 'regular', data.msg); - } - - if (action === 'sendEngageSms') { - await sendSms(data); - } - - channel.ack(msg); - } - }); - } catch (e) { - debugBase(e.message); - } -}; - -interface IQueueData { - action: string; - data: any; -} - -export const sendMessage = async (queueName: string, data: IQueueData) => { - if (NODE_ENV === 'test') { - return; - } - - debugBase(`Sending data to engagesApi queue`, data); - - try { - await channel.assertQueue(queueName); - await channel.sendToQueue(queueName, Buffer.from(JSON.stringify(data || {}))); - } catch (e) { - debugBase(e.message); - } -}; diff --git a/engages-email-sender/src/redisClient.ts b/engages-email-sender/src/redisClient.ts deleted file mode 100644 index 1d0a84527..000000000 --- a/engages-email-sender/src/redisClient.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as dotenv from 'dotenv'; -import * as redis from 'redis'; - -// load environment variables -dotenv.config(); - -const { - REDIS_HOST = 'localhost', - REDIS_PORT = 6379, - REDIS_PASSWORD, - NODE_ENV, -}: { - REDIS_HOST?: string; - REDIS_PORT?: number; - REDIS_PASSWORD?: string; - NODE_ENV?: string; -} = process.env; - -let client; - -export const initRedis = (callback?: (client) => void) => { - client = redis.createClient({ - host: REDIS_HOST, - port: REDIS_PORT, - password: REDIS_PASSWORD, - connect_timeout: 15000, - enable_offline_queue: true, - retry_unfulfilled_commands: true, - retry_strategy: options => { - // reconnect after - return Math.max(options.attempt * 100, 3000); - }, - }); - - if (callback) { - callback(client); - } -}; - -/* - * Get item - */ -export const get = (key: string, defaultValue?: any): Promise => { - return new Promise((resolve, reject) => { - if (NODE_ENV === 'test') { - return resolve(defaultValue || ''); - } - - client.get(key, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply && reply !== 'nil' ? reply : defaultValue); - }); - }); -}; - -/* - * Set item - */ -export const set = (key: string, value: any) => { - if (NODE_ENV === 'test') { - return; - } - - client.set(key, value); -}; - -/* - * Get array - */ -export const getArray = async (key: string): Promise => { - const value = await get(key, '[]'); - - return JSON.parse(value); -}; - -/* - * Set array - */ -export const setArray = (key: string, value: any[]) => { - client.set(key, JSON.stringify(value)); -}; diff --git a/engages-email-sender/src/trackers/engageTracker.ts b/engages-email-sender/src/trackers/engageTracker.ts index 79555445d..cb1e71dc2 100644 --- a/engages-email-sender/src/trackers/engageTracker.ts +++ b/engages-email-sender/src/trackers/engageTracker.ts @@ -1,6 +1,6 @@ import * as AWS from 'aws-sdk'; import { debugBase } from '../debuggers'; -import { sendMessage } from '../messageQueue'; +import messageBroker from '../messageBroker'; import { Configs, DeliveryReports, Stats } from '../models'; import { ISESConfig } from '../models/Configs'; @@ -55,7 +55,7 @@ const handleMessage = async message => { const rejected = await DeliveryReports.updateOrCreateReport(mailHeaders, type); if (rejected === 'reject') { - await sendMessage('engagesNotification', { + await messageBroker().sendMessage('engagesNotification', { action: 'setDoNotDisturb', data: { customerId: mail.customerId }, }); diff --git a/engages-email-sender/src/utils.ts b/engages-email-sender/src/utils.ts index 9828a9a90..844deaa0a 100644 --- a/engages-email-sender/src/utils.ts +++ b/engages-email-sender/src/utils.ts @@ -2,7 +2,6 @@ import * as AWS from 'aws-sdk'; import * as nodemailer from 'nodemailer'; import { debugBase } from './debuggers'; import Configs, { ISESConfig } from './models/Configs'; -import { get, set } from './redisClient'; import { getApi } from './trackers/engageTracker'; export const createTransporter = async () => { @@ -155,10 +154,6 @@ export const getValueAsString = async name => { return entry.value; }; -export const resetConfigsCache = () => { - set('configs_erxes_engages', ''); -}; - export const updateConfigs = async (configsMap): Promise => { const prevSESConfigs = await Configs.getSESConfigs(); @@ -166,20 +161,12 @@ export const updateConfigs = async (configsMap): Promise => { const updatedSESConfigs = await Configs.getSESConfigs(); - resetConfigsCache(); - if (JSON.stringify(prevSESConfigs) !== JSON.stringify(updatedSESConfigs)) { await subscribeEngage(); } }; -export const getConfigs = async () => { - const configsCache = await get('configs_erxes_engages'); - - if (configsCache && configsCache !== '{}') { - return JSON.parse(configsCache); - } - +export const getConfigs = async (): Promise => { const configsMap = {}; const configs = await Configs.find({}); @@ -187,8 +174,6 @@ export const getConfigs = async () => { configsMap[config.code] = config.value; } - set('configs_erxes_engages', JSON.stringify(configsMap)); - return configsMap; }; diff --git a/engages-email-sender/yarn.lock b/engages-email-sender/yarn.lock index a2761aa16..36e7ef2a9 100644 --- a/engages-email-sender/yarn.lock +++ b/engages-email-sender/yarn.lock @@ -98,6 +98,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/runtime@^7.11.2": + version "7.11.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" + integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.4.0", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -139,6 +146,25 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@dashersw/axon@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@dashersw/axon/-/axon-2.0.5.tgz#708b8cd21a5c803de8dd517a9252828b007d77bb" + integrity sha512-e7az6UOh/1JqLvzg2GPhP3n47QMQal3Qg2a2497JwY7dlbSKUg4dQmnRyKWNjFz0FHjranUjKvX6J6NAV3Sm/Q== + dependencies: + amp "~0.3.1" + amp-message "~0.1.1" + configurable "0.0.1" + debug "*" + escape-regexp "0.0.1" + +"@dashersw/node-discover@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@dashersw/node-discover/-/node-discover-1.0.4.tgz#3fd2aad22228e0ecf72bb069e9f0e06ef4bd5b82" + integrity sha512-OblARM345ECaTSSFQcuWUl+7/uhOjhKBIA0G0CbOPbUzwF3cqBbl2R0E9tulnsLk3XB6Zpmja0TZIU5ClKF6LA== + dependencies: + redis "^2.7.1" + uuid "^3.3.2" + "@jest/console@^24.7.1", "@jest/console@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" @@ -481,7 +507,7 @@ abab@^2.0.0: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== -accepts@~1.3.7: +accepts@~1.3.4, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -512,6 +538,11 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + ajv@^6.5.5: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" @@ -522,6 +553,18 @@ ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +amp-message@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/amp-message/-/amp-message-0.1.2.tgz#a78f1c98995087ad36192a41298e4db49e3dfc45" + integrity sha1-p48cmJlQh602GSpBKY5NtJ49/EU= + dependencies: + amp "0.3.1" + +amp@0.3.1, amp@~0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/amp/-/amp-0.3.1.tgz#6adf8d58a74f361e82c1fa8d389c079e139fc47d" + integrity sha1-at+NWKdPNh6CwfqNOJwHnhOfxH0= + amqplib@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.5.tgz#698f0cb577e0591954a90572fcb3b8998a76fd40" @@ -534,6 +577,18 @@ amqplib@^0.5.5: safe-buffer "~5.1.2" url-parse "~1.4.3" +amqplib@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.6.0.tgz#87857c7c95d56d22438ced4cf1f7e5f0dc43b309" + integrity sha512-zXCh4jQ77TBZe1YtvZ1n7sUxnTjnNagpy8MVi2yc1ive239pS3iLwm4e4d5o4XZGx1BdTKQ/U0ZmaDU3c8MxYQ== + dependencies: + bitsyntax "~0.1.0" + bluebird "^3.5.2" + buffer-more-ints "~1.0.0" + readable-stream "1.x >=1.1.9" + safe-buffer "~5.1.2" + url-parse "~1.4.3" + ansi-escapes@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -604,6 +659,11 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -631,6 +691,13 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -704,16 +771,31 @@ babel-preset-jest@^24.9.0: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" babel-plugin-jest-hoist "^24.9.0" +backo2@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + base64-js@^1.0.2: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== +base64id@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" + integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -734,6 +816,13 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" @@ -750,6 +839,11 @@ bitsyntax@~0.1.0: debug "~2.6.9" safe-buffer "~5.1.2" +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + bluebird@3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -870,6 +964,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -919,6 +1018,13 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +charm@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/charm/-/charm-1.0.2.tgz#8add367153a6d9a581331052c4090991da995e35" + integrity sha1-it02cVOm2aWBMxBSxAkJkdqZXjU= + dependencies: + inherits "^2.0.1" + ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -968,6 +1074,11 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +colors@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -980,16 +1091,36 @@ commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -component-emitter@^1.2.1: +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-emitter@^1.2.1, component-emitter@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +configurable@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/configurable/-/configurable-0.0.1.tgz#47d75b727b51b4eb84c1dadafe3f8240313833b1" + integrity sha1-R9dbcntRtOuEwdra/j+CQDE4M7E= + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -1014,6 +1145,11 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" @@ -1029,6 +1165,28 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +cote@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cote/-/cote-1.0.0.tgz#ca1cf6ffc3064504e8605e1a933e779e12e1328e" + integrity sha512-O9L5bCnA556UHbdGS0O+D7hhf6yxRon6igbl18ADgMnsCd8P9pVfvuvgO8X/Uch5Mj+xXRoVtkWYgddwNc74eg== + dependencies: + "@dashersw/axon" "2.0.5" + "@dashersw/node-discover" "^1.0.4" + charm "1.0.2" + colors "1.4.0" + eventemitter2 "6.0.0" + lodash "^4.17.15" + portfinder "1.0.25" + socket.io "^2.3.0" + uuid "^3.3.3" + +cross-env@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9" + integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1040,6 +1198,15 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/crypto/-/crypto-0.0.3.tgz#470a81b86be4c5ee17acc8207a1f5315ae20dbb0" @@ -1098,6 +1265,13 @@ debounce@^1.0.0: resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131" integrity sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg== +debug@*, debug@^4.1.0, debug@^4.1.1, debug@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@~2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1105,17 +1279,17 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@~2.6.9: dependencies: ms "2.0.0" -debug@3.1.0: +debug@3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== +debug@^3.1.1: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" @@ -1252,6 +1426,46 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +engine.io-client@~3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.4.3.tgz#192d09865403e3097e3575ebfeb3861c4d01a66c" + integrity sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw== + dependencies: + component-emitter "~1.3.0" + 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" + +engine.io-parser@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.2.0.tgz#312c4894f57d52a02b420868da7b5c1c84af80ed" + integrity sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.4.0: + version "3.4.2" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.4.2.tgz#8fc84ee00388e3e228645e0a7d3dfaeed5bd122c" + integrity sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg== + dependencies: + 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" + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1259,6 +1473,18 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +erxes-message-broker@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/erxes-message-broker/-/erxes-message-broker-1.0.3.tgz#ac6336de6ad9c5caf260b84c9afacc79b8771a42" + integrity sha512-UN5uEuSJHPKTOXYsGgtt0ZGYvabGTJPFw+WCHCCqUJ2fczvpVTOnSXiLaGvLGD6pfOhs5YpoAjoUqAfWWFsO1A== + dependencies: + "@babel/runtime" "^7.11.2" + amqplib "^0.6.0" + cote "^1.0.0" + cross-env "^7.0.2" + debug "^4.1.1" + uuid "^8.3.0" + es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: version "1.17.4" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" @@ -1290,6 +1516,11 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= +escape-regexp@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/escape-regexp/-/escape-regexp-0.0.1.tgz#f44bda12d45bbdf9cb7f862ee7e4827b3dd32254" + integrity sha1-9EvaEtRbvfnLf4Yu5+SCez3TIlQ= + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1327,6 +1558,11 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eventemitter2@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.0.0.tgz#218eb512c3603c5341724b6af7b686a1aa5ab8f5" + integrity sha512-ZuNWHD7S7IoikyEmx35vPU8H1W0L+oi644+4mSTg7nwXvBQpIwQL7DPjYUF0VMB0jPkNMo3MqD07E7MYrkFmjQ== + events@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" @@ -1665,6 +1901,18 @@ har-validator@~5.1.3: ajv "^6.5.5" har-schema "^2.0.0" +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1793,6 +2041,11 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1801,7 +2054,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@~2.0.1: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@~2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1986,6 +2239,11 @@ isarray@1.0.0, isarray@^1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2602,6 +2860,11 @@ lodash@^4.17.13, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +lodash@^4.17.14: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -2934,6 +3197,11 @@ object-assign@^4.0.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -3067,6 +3335,20 @@ parse5@4.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -3099,6 +3381,11 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -3176,6 +3463,15 @@ pn@^1.1.0: resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +portfinder@1.0.25: + version "1.0.25" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" + integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== + dependencies: + async "^2.6.2" + debug "^3.1.1" + mkdirp "^0.5.1" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -3354,7 +3650,7 @@ redis-parser@^2.6.0: resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs= -redis@^2.8.0: +redis@^2.7.1, redis@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A== @@ -3363,6 +3659,11 @@ redis@^2.8.0: redis-commands "^1.2.0" redis-parser "^2.6.0" +regenerator-runtime@^0.13.4: + version "0.13.7" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3641,11 +3942,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -3706,6 +4019,61 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +socket.io-adapter@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" + integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== + +socket.io-client@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.3.0.tgz#14d5ba2e00b9bcd145ae443ab96b3f86cbcc1bb4" + integrity sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA== + dependencies: + 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" + +socket.io-parser@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.0.tgz#2b52a96a509fdf31440ba40fed6094c7d4f1262f" + integrity sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io-parser@~3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.4.1.tgz#b06af838302975837eab2dc980037da24054d64a" + integrity sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A== + dependencies: + component-emitter "1.2.1" + debug "~4.1.0" + isarray "2.0.1" + +socket.io@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.3.0.tgz#cd762ed6a4faeca59bc1f3e243c0969311eb73fb" + integrity sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg== + dependencies: + 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" + source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -3942,6 +4310,11 @@ tmpl@1.0.x: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -4186,11 +4559,16 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@^3.3.2: +uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" + integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -4274,6 +4652,13 @@ which@^1.2.9, which@^1.3.0: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -4309,6 +4694,18 @@ ws@^5.2.0: dependencies: async-limiter "~1.0.0" +ws@^7.1.2: + version "7.3.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" + integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + +ws@~6.1.0: + version "6.1.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9" + integrity sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA== + dependencies: + async-limiter "~1.0.0" + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" @@ -4327,6 +4724,11 @@ xmlbuilder@~9.0.1: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + xss@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.6.tgz#eaf11e9fc476e3ae289944a1009efddd8a124b51" @@ -4376,6 +4778,11 @@ yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= + yn@3.1.1, yn@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" diff --git a/logger/.env.sample b/logger/.env.sample index 9c0dd7458..6c80f972b 100644 --- a/logger/.env.sample +++ b/logger/.env.sample @@ -1,5 +1,2 @@ PORT=3800 -MONGO_URL=mongodb://localhost/erxes_logs - -# RabbitMQ -RABBITMQ_HOST=amqp://localhost +MONGO_URL=mongodb://localhost/erxes_logs \ No newline at end of file diff --git a/logger/package.json b/logger/package.json index 0211378fe..d9603eda3 100644 --- a/logger/package.json +++ b/logger/package.json @@ -23,10 +23,13 @@ "dependencies": { "amqplib": "^0.5.5", "body-parser": "^1.17.1", + "cote": "^1.0.0", "debug": "^4.1.1", "dotenv": "^4.0.0", + "erxes-message-broker": "^1.0.3", "express": "^4.16.4", - "mongoose": "5.7.10" + "mongoose": "5.7.10", + "uuid": "^8.3.0" }, "devDependencies": { "@types/body-parser": "^1.17.0", diff --git a/logger/src/index.ts b/logger/src/index.ts index 5709ea940..477327c8f 100644 --- a/logger/src/index.ts +++ b/logger/src/index.ts @@ -6,8 +6,8 @@ import * as express from 'express'; dotenv.config(); import { connect } from './connection'; -import { debugInit } from './debuggers'; -import './messageBroker'; +import { debugBase, debugInit } from './debuggers'; +import { initBroker } from './messageBroker'; import Logs from './models/Logs'; connect(); @@ -101,5 +101,9 @@ app.use((error, _req, res, _next) => { const { PORT } = process.env; app.listen(PORT, () => { + initBroker().catch(e => { + debugBase(`Error ocurred during message broker init ${e.message}`); + }); + debugInit(`Logger server is running on port ${PORT}`); }); diff --git a/logger/src/messageBroker.ts b/logger/src/messageBroker.ts index 2fde0b5f1..aeffcf469 100644 --- a/logger/src/messageBroker.ts +++ b/logger/src/messageBroker.ts @@ -1,35 +1,19 @@ -import * as amqplib from 'amqplib'; import * as dotenv from 'dotenv'; -import { debugBase } from './debuggers'; +import messageBroker from 'erxes-message-broker'; import { receivePutLogCommand } from './utils'; dotenv.config(); -const { RABBITMQ_HOST = 'amqp://localhost' } = process.env; +let client; -let connection; -let channel; +export const initBroker = async () => { + client = await messageBroker({ name: 'logger', RABBITMQ_HOST: process.env.RABBITMQ_HOST }); -const init = async () => { - try { - connection = await amqplib.connect(RABBITMQ_HOST); - channel = await connection.createChannel(); + const { consumeQueue } = client; - // main api ========= - await channel.assertQueue('putLog'); - - channel.consume('putLog', async msg => { - if (msg !== null) { - const content = msg.content.toString(); - - await receivePutLogCommand(JSON.parse(content)); - - channel.ack(msg); - } - }); - } catch (e) { - debugBase(e.message); - } + consumeQueue('putLog', async data => { + await receivePutLogCommand(data); + }); }; -init(); +export default client; diff --git a/logger/yarn.lock b/logger/yarn.lock index 2e45fb865..c436199fc 100644 --- a/logger/yarn.lock +++ b/logger/yarn.lock @@ -2,6 +2,32 @@ # yarn lockfile v1 +"@babel/runtime@^7.11.2": + version "7.11.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" + integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== + dependencies: + regenerator-runtime "^0.13.4" + +"@dashersw/axon@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@dashersw/axon/-/axon-2.0.5.tgz#708b8cd21a5c803de8dd517a9252828b007d77bb" + integrity sha512-e7az6UOh/1JqLvzg2GPhP3n47QMQal3Qg2a2497JwY7dlbSKUg4dQmnRyKWNjFz0FHjranUjKvX6J6NAV3Sm/Q== + dependencies: + amp "~0.3.1" + amp-message "~0.1.1" + configurable "0.0.1" + debug "*" + escape-regexp "0.0.1" + +"@dashersw/node-discover@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@dashersw/node-discover/-/node-discover-1.0.4.tgz#3fd2aad22228e0ecf72bb069e9f0e06ef4bd5b82" + integrity sha512-OblARM345ECaTSSFQcuWUl+7/uhOjhKBIA0G0CbOPbUzwF3cqBbl2R0E9tulnsLk3XB6Zpmja0TZIU5ClKF6LA== + dependencies: + redis "^2.7.1" + uuid "^3.3.2" + "@types/body-parser@*", "@types/body-parser@^1.17.0": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.1.tgz#18fcf61768fb5c30ccc508c21d6fd2e8b3bf7897" @@ -114,7 +140,7 @@ resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" integrity sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ== -accepts@~1.3.7: +accepts@~1.3.4, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -122,6 +148,23 @@ accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + +amp-message@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/amp-message/-/amp-message-0.1.2.tgz#a78f1c98995087ad36192a41298e4db49e3dfc45" + integrity sha1-p48cmJlQh602GSpBKY5NtJ49/EU= + dependencies: + amp "0.3.1" + +amp@0.3.1, amp@~0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/amp/-/amp-0.3.1.tgz#6adf8d58a74f361e82c1fa8d389c079e139fc47d" + integrity sha1-at+NWKdPNh6CwfqNOJwHnhOfxH0= + amqplib@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.5.tgz#698f0cb577e0591954a90572fcb3b8998a76fd40" @@ -134,6 +177,18 @@ amqplib@^0.5.5: safe-buffer "~5.1.2" url-parse "~1.4.3" +amqplib@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.6.0.tgz#87857c7c95d56d22438ced4cf1f7e5f0dc43b309" + integrity sha512-zXCh4jQ77TBZe1YtvZ1n7sUxnTjnNagpy8MVi2yc1ive239pS3iLwm4e4d5o4XZGx1BdTKQ/U0ZmaDU3c8MxYQ== + dependencies: + bitsyntax "~0.1.0" + bluebird "^3.5.2" + buffer-more-ints "~1.0.0" + readable-stream "1.x >=1.1.9" + safe-buffer "~5.1.2" + url-parse "~1.4.3" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -159,16 +214,55 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + +async@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + +backo2@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + +base64id@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" + integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== + +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + bitsyntax@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.1.0.tgz#b0c59acef03505de5a2ed62a2f763c56ae1d6205" @@ -178,6 +272,11 @@ bitsyntax@~0.1.0: debug "~2.6.9" safe-buffer "~5.1.2" +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + bluebird@3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -232,6 +331,11 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -256,16 +360,53 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +charm@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/charm/-/charm-1.0.2.tgz#8add367153a6d9a581331052c4090991da995e35" + integrity sha1-it02cVOm2aWBMxBSxAkJkdqZXjU= + dependencies: + inherits "^2.0.1" + +colors@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + commander@^2.9.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-emitter@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +configurable@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/configurable/-/configurable-0.0.1.tgz#47d75b727b51b4eb84c1dadafe3f8240313833b1" + integrity sha1-R9dbcntRtOuEwdra/j+CQDE4M7E= + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -283,6 +424,11 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" @@ -293,6 +439,37 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +cote@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cote/-/cote-1.0.0.tgz#ca1cf6ffc3064504e8605e1a933e779e12e1328e" + integrity sha512-O9L5bCnA556UHbdGS0O+D7hhf6yxRon6igbl18ADgMnsCd8P9pVfvuvgO8X/Uch5Mj+xXRoVtkWYgddwNc74eg== + dependencies: + "@dashersw/axon" "2.0.5" + "@dashersw/node-discover" "^1.0.4" + charm "1.0.2" + colors "1.4.0" + eventemitter2 "6.0.0" + lodash "^4.17.15" + portfinder "1.0.25" + socket.io "^2.3.0" + uuid "^3.3.3" + +cross-env@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9" + integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw== + dependencies: + cross-spawn "^7.0.1" + +cross-spawn@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -318,6 +495,13 @@ debounce@^1.0.0: resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131" integrity sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg== +debug@*, debug@^4.1.1, debug@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debug@2.6.9, debug@~2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -325,17 +509,17 @@ debug@2.6.9, debug@~2.6.9: dependencies: ms "2.0.0" -debug@3.1.0: +debug@3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== +debug@^3.1.1: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" @@ -369,6 +553,11 @@ dotenv@^4.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d" integrity sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0= +double-ended-queue@^2.1.0-0: + version "2.1.0-0" + resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" + integrity sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw= + dynamic-dedupe@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz#06e44c223f5e4e94d78ef9db23a6515ce2f962a1" @@ -386,6 +575,46 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= +engine.io-client@~3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.4.3.tgz#192d09865403e3097e3575ebfeb3861c4d01a66c" + integrity sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw== + dependencies: + component-emitter "~1.3.0" + 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" + +engine.io-parser@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.2.0.tgz#312c4894f57d52a02b420868da7b5c1c84af80ed" + integrity sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.4.0: + version "3.4.2" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.4.2.tgz#8fc84ee00388e3e228645e0a7d3dfaeed5bd122c" + integrity sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg== + dependencies: + 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" + error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -393,11 +622,28 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" +erxes-message-broker@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/erxes-message-broker/-/erxes-message-broker-1.0.3.tgz#ac6336de6ad9c5caf260b84c9afacc79b8771a42" + integrity sha512-UN5uEuSJHPKTOXYsGgtt0ZGYvabGTJPFw+WCHCCqUJ2fczvpVTOnSXiLaGvLGD6pfOhs5YpoAjoUqAfWWFsO1A== + dependencies: + "@babel/runtime" "^7.11.2" + amqplib "^0.6.0" + cote "^1.0.0" + cross-env "^7.0.2" + debug "^4.1.1" + uuid "^8.3.0" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= +escape-regexp@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/escape-regexp/-/escape-regexp-0.0.1.tgz#f44bda12d45bbdf9cb7f862ee7e4827b3dd32254" + integrity sha1-9EvaEtRbvfnLf4Yu5+SCez3TIlQ= + escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -408,6 +654,11 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eventemitter2@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.0.0.tgz#218eb512c3603c5341724b6af7b686a1aa5ab8f5" + integrity sha512-ZuNWHD7S7IoikyEmx35vPU8H1W0L+oi644+4mSTg7nwXvBQpIwQL7DPjYUF0VMB0jPkNMo3MqD07E7MYrkFmjQ== + express@^4.16.4: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -521,6 +772,18 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + hosted-git-info@^2.1.4: version "2.8.5" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c" @@ -562,6 +825,11 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -570,7 +838,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.1: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -612,6 +880,11 @@ isarray@0.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -633,6 +906,11 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +lodash@^4.17.14, lodash@^4.17.15: + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== + loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" @@ -842,6 +1120,11 @@ object-assign@^4.0.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -863,6 +1146,20 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -880,6 +1177,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -916,6 +1218,15 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +portfinder@1.0.25: + version "1.0.25" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" + integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== + dependencies: + async "^2.6.2" + debug "^3.1.1" + mkdirp "^0.5.1" + proxy-addr@~2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" @@ -984,6 +1295,30 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" +redis-commands@^1.2.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.6.0.tgz#36d4ca42ae9ed29815cdb30ad9f97982eba1ce23" + integrity sha512-2jnZ0IkjZxvguITjFTrGiLyzQZcTvaw8DAaCXxZq/dsHXz7KfMQ3OUJy7Tz9vnRtZRVz6VRCPDvruvU8Ts44wQ== + +redis-parser@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" + integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs= + +redis@^2.7.1: + version "2.8.0" + resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" + integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A== + dependencies: + double-ended-queue "^2.1.0-0" + redis-commands "^1.2.0" + redis-parser "^2.6.0" + +regenerator-runtime@^0.13.4: + version "0.13.7" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + regexp-clone@1.0.0, regexp-clone@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63" @@ -1089,6 +1424,18 @@ setprototypeof@1.1.1: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -1116,6 +1463,61 @@ slug@^0.9.2: dependencies: unicode ">= 0.3.1" +socket.io-adapter@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" + integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== + +socket.io-client@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.3.0.tgz#14d5ba2e00b9bcd145ae443ab96b3f86cbcc1bb4" + integrity sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA== + dependencies: + 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" + +socket.io-parser@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.0.tgz#2b52a96a509fdf31440ba40fed6094c7d4f1262f" + integrity sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io-parser@~3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.4.1.tgz#b06af838302975837eab2dc980037da24054d64a" + integrity sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A== + dependencies: + component-emitter "1.2.1" + debug "~4.1.0" + isarray "2.0.1" + +socket.io@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.3.0.tgz#cd762ed6a4faeca59bc1f3e243c0969311eb73fb" + integrity sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg== + dependencies: + 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" + source-map-support@^0.5.12, source-map-support@^0.5.6: version "0.5.16" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" @@ -1208,6 +1610,11 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" @@ -1312,6 +1719,16 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid@^3.3.2, uuid@^3.3.3: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" + integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -1332,16 +1749,45 @@ which@^1.3.0: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +ws@^7.1.2: + version "7.3.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" + integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + +ws@~6.1.0: + version "6.1.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9" + integrity sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA== + dependencies: + async-limiter "~1.0.0" + +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= + yn@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/package.json b/package.json index 3744eb5af..2b58a4b0d 100644 --- a/package.json +++ b/package.json @@ -58,10 +58,13 @@ "cookie": "^0.4.1", "cookie-parser": "^1.4.3", "cors": "^2.8.1", + "cote": "^1.0.0", "csvtojson": "^2.0.10", "debug": "^4.1.1", "dotenv": "^4.0.0", "elasticsearch": "^16.6.0", + "erxes-inmemory-storage": "^1.0.16", + "erxes-message-broker": "^1.0.3", "erxes-telemetry": "^1.0.3", "express": "^4.17.1", "faker": "^4.1.0", @@ -72,6 +75,7 @@ "git-repo-info": "^2.1.0", "graphql": "^14.0.2", "graphql-redis-subscriptions": "^1.4.0", + "graphql-subscriptions": "^1.1.0", "graphql-tools": "^4.0.3", "handlebars": "^4.7.3", "helmet": "^3.23.3", diff --git a/src/__tests__/conversationMutations.test.ts b/src/__tests__/conversationMutations.test.ts index 093fc2ab8..fd8fe8670 100644 --- a/src/__tests__/conversationMutations.test.ts +++ b/src/__tests__/conversationMutations.test.ts @@ -2,7 +2,7 @@ import './setup.ts'; import * as faker from 'faker'; import * as sinon from 'sinon'; -import * as messageBroker from '../messageBroker'; +import messageBroker from '../messageBroker'; import { conversationFactory, customerFactory, integrationFactory, userFactory } from '../db/factories'; import { Conversations, Customers, Integrations, Users } from '../db/models'; @@ -182,7 +182,7 @@ describe('Conversation message mutations', () => { }); test('Add conversation message using third party integration', async () => { - const mock = sinon.stub(messageBroker, 'sendMessage').callsFake(() => { + const mock = sinon.stub(messageBroker(), 'sendMessage').callsFake(() => { return Promise.resolve('success'); }); @@ -284,7 +284,7 @@ describe('Conversation message mutations', () => { } `; - let mock = sinon.stub(messageBroker, 'sendMessage').callsFake(() => { + let mock = sinon.stub(messageBroker(), 'sendMessage').callsFake(() => { return Promise.resolve('success'); }); const comment = await integrationFactory({ kind: 'facebook-post' }); @@ -303,7 +303,7 @@ describe('Conversation message mutations', () => { mock.restore(); - mock = sinon.stub(messageBroker, 'sendMessage').callsFake(() => { + mock = sinon.stub(messageBroker(), 'sendMessage').callsFake(() => { throw new Error(); }); diff --git a/src/__tests__/conversationQueries.test.ts b/src/__tests__/conversationQueries.test.ts index e57cc763b..1630a2364 100644 --- a/src/__tests__/conversationQueries.test.ts +++ b/src/__tests__/conversationQueries.test.ts @@ -993,7 +993,6 @@ describe('conversationQueries', () => { test('Conversation detail product board', async () => { const messengerConversation = await conversationFactory(); - console.log('response = ', messengerConversation); await conversationMessageFactory({ conversationId: messengerConversation._id, contentType: MESSAGE_TYPES.VIDEO_CALL, diff --git a/src/__tests__/engageMessageMutations.test.ts b/src/__tests__/engageMessageMutations.test.ts index 1e812ec81..1c56a5cac 100644 --- a/src/__tests__/engageMessageMutations.test.ts +++ b/src/__tests__/engageMessageMutations.test.ts @@ -26,7 +26,7 @@ import { Tags, Users, } from '../db/models'; -import * as messageBroker from '../messageBroker'; +import messageBroker from '../messageBroker'; import { EngagesAPI } from '../data/dataSources'; import { handleUnsubscription } from '../data/utils'; @@ -352,7 +352,7 @@ describe('engage message mutation tests', () => { }); test('Engage utils send via email & sms', async () => { - const mock = sinon.stub(messageBroker, 'sendMessage').callsFake(() => { + const mock = sinon.stub(messageBroker(), 'sendMessage').callsFake(() => { return Promise.resolve('success'); }); @@ -453,7 +453,7 @@ describe('engage message mutation tests', () => { `; test('Add engage message', async () => { - const mock = sinon.stub(messageBroker, 'sendMessage').callsFake(() => { + const mock = sinon.stub(messageBroker(), 'sendMessage').callsFake(() => { return Promise.resolve('success'); }); diff --git a/src/__tests__/importHistoryMutations.test.ts b/src/__tests__/importHistoryMutations.test.ts index cb7930b36..538592dc8 100644 --- a/src/__tests__/importHistoryMutations.test.ts +++ b/src/__tests__/importHistoryMutations.test.ts @@ -1,7 +1,7 @@ import { graphqlRequest } from '../db/connection'; import { customerFactory, importHistoryFactory } from '../db/factories'; import { ImportHistory } from '../db/models'; -import * as messageBroker from '../messageBroker'; +import messageBroker from '../messageBroker'; import './setup.ts'; @@ -18,7 +18,7 @@ describe('Import history mutations', () => { } `; - const spy = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy.mockImplementation(() => Promise.resolve({ status: 'ok' })); const customer = await customerFactory({}); @@ -40,7 +40,7 @@ describe('Import history mutations', () => { } `; - const spy = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy.mockImplementation(() => Promise.resolve({ status: 'error', message: 'Workers are busy' })); const customer = await customerFactory({}); diff --git a/src/__tests__/integrationMutations.test.ts b/src/__tests__/integrationMutations.test.ts index ab7b5f01e..4bdaccb63 100644 --- a/src/__tests__/integrationMutations.test.ts +++ b/src/__tests__/integrationMutations.test.ts @@ -1,7 +1,7 @@ import './setup.ts'; import * as faker from 'faker'; -import * as messageBroker from '../messageBroker'; +import messageBroker from '../messageBroker'; import { brandFactory, @@ -395,7 +395,7 @@ describe('mutations', () => { const integration1 = await integrationFactory(); - const spy = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy.mockImplementation(() => Promise.resolve({ erxesApiIds: [integration1._id] })); const response = await graphqlRequest(mutation, 'integrationsRemoveAccount', { _id: 'accountId' }); @@ -410,7 +410,7 @@ describe('mutations', () => { spy.mockRestore(); - const spy1 = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy1 = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy1.mockImplementation(() => Promise.resolve({ erxesApiIds: [] })); diff --git a/src/__tests__/integrationQueries.test.ts b/src/__tests__/integrationQueries.test.ts index 0c81cf985..d2f11a706 100644 --- a/src/__tests__/integrationQueries.test.ts +++ b/src/__tests__/integrationQueries.test.ts @@ -1,7 +1,7 @@ import './setup.ts'; import * as faker from 'faker'; -import * as messageBroker from '../messageBroker'; +import messageBroker from '../messageBroker'; import { brandFactory, channelFactory, integrationFactory, tagsFactory } from '../db/factories'; import { Brands, Channels, Integrations, Tags } from '../db/models'; @@ -292,7 +292,7 @@ describe('integrationQueries', () => { } `; - const spy = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy.mockImplementation(() => Promise.resolve('https://webhookurl')); @@ -308,7 +308,7 @@ describe('integrationQueries', () => { spy.mockRestore(); - const spy1 = jest.spyOn(messageBroker, 'sendRPCMessage'); + const spy1 = jest.spyOn(messageBroker(), 'sendRPCMessage'); spy1.mockImplementation(() => Promise.resolve('https://webhookurl')); diff --git a/src/__tests__/setup.ts b/src/__tests__/setup.ts index 6afb49233..8ceb229ab 100644 --- a/src/__tests__/setup.ts +++ b/src/__tests__/setup.ts @@ -1,6 +1,8 @@ import { MongoMemoryServer } from 'mongodb-memory-server'; import * as mongoose from 'mongoose'; import { connectionOptions } from '../db/connection'; +import { initMemoryStorage } from '../inmemoryStorage'; +import { initBroker } from '../messageBroker'; // May require additional time for downloading MongoDB binaries jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000; @@ -10,12 +12,13 @@ let mongoServer; beforeAll(async () => { mongoServer = new MongoMemoryServer(); + await initBroker(); + + initMemoryStorage(); + const mongoUri = await mongoServer.getConnectionString(); - await mongoose.connect( - mongoUri, - { ...connectionOptions, useUnifiedTopology: true }, - ); + await mongoose.connect(mongoUri, { ...connectionOptions, useUnifiedTopology: true }); }); afterAll(async () => { diff --git a/src/apolloClient.ts b/src/apolloClient.ts index 688a03557..02d4aeca4 100644 --- a/src/apolloClient.ts +++ b/src/apolloClient.ts @@ -6,8 +6,8 @@ import { EngagesAPI, IntegrationsAPI } from './data/dataSources'; import resolvers from './data/resolvers'; import typeDefs from './data/schema'; import { Conversations, Customers, Users } from './db/models'; +import memoryStorage from './inmemoryStorage'; import { graphqlPubsub } from './pubsub'; -import { addToArray, get, inArray, removeFromArray, set } from './redisClient'; // load environment variables dotenv.config(); @@ -124,19 +124,19 @@ const apolloServer = new ApolloServer({ const customerId = webSocket.messengerData.customerId; - // get status from redis - const inConnectedClients = await inArray('connectedClients', customerId); - const inClients = await inArray('clients', customerId); + // get status from inmemory storage + const inConnectedClients = await memoryStorage().inArray('connectedClients', customerId); + const inClients = await memoryStorage().inArray('clients', customerId); if (!inConnectedClients) { - await addToArray('connectedClients', customerId); + await memoryStorage().addToArray('connectedClients', customerId); } // Waited for 1 minute to reconnect in disconnect hook and disconnect hook // removed this customer from connected clients list. So it means this customer // is back online if (!inClients) { - await addToArray('clients', customerId); + await memoryStorage().addToArray('clients', customerId); // mark as online await Customers.markCustomerAsActive(customerId); @@ -180,24 +180,24 @@ const apolloServer = new ApolloServer({ // If client refreshes his browser, It will trigger disconnect, connect hooks. // So to determine this issue. We are marking as disconnected here and waiting // for 1 minute to reconnect. - await removeFromArray('connectedClients', customerId); + await memoryStorage().removeFromArray('connectedClients', customerId); setTimeout(async () => { - // get status from redis - const inNewConnectedClients = await inArray('connectedClients', customerId); - const customerLastStatus = await get(`customer_last_status_${customerId}`); + // get status from inmemory storage + const inNewConnectedClients = await memoryStorage().inArray('connectedClients', customerId); + const customerLastStatus = await memoryStorage().get(`customer_last_status_${customerId}`); if (inNewConnectedClients) { return; } - await removeFromArray('clients', customerId); + await memoryStorage().removeFromArray('clients', customerId); // mark as offline await Customers.markCustomerAsNotActive(customerId); if (customerLastStatus !== 'left') { - set(`customer_last_status_${customerId}`, 'left'); + memoryStorage().set(`customer_last_status_${customerId}`, 'left'); // customer has left + time const conversationMessages = await Conversations.changeCustomerStatus('left', customerId, integrationId); diff --git a/src/commands/createGooglePubsubTopics.ts b/src/commands/createGooglePubsubTopics.ts deleted file mode 100644 index 8d9d53010..000000000 --- a/src/commands/createGooglePubsubTopics.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as PubSub from '@google-cloud/pubsub'; -import * as dotenv from 'dotenv'; -import * as fs from 'fs'; -import * as ora from 'ora'; -import * as path from 'path'; - -// load environment variables -dotenv.config(); - -const { - PUBSUB_TYPE = 'REDIS', - GOOGLE_APPLICATION_CREDENTIALS, -}: { - PUBSUB_TYPE?: string; - GOOGLE_APPLICATION_CREDENTIALS?: string; -} = process.env; - -const topics = [ - 'activityLogsChanged', - 'conversationAdminMessageInserted', - 'conversationChanged', - 'conversationClientMessageInserted', - 'conversationMessageInserted', - 'customerConnectionChanged', - 'widgetNotification', -]; - -const spinnerOptions = { - prefixText: 'Creating google pubsub topics \n', -}; - -const spinner = ora(spinnerOptions); - -// Create google pubsub's topics for subscriptions -const start = async () => { - spinner.start(); - - if (PUBSUB_TYPE !== 'GOOGLE') { - throw new Error('Pubsub type is not configured for Google'); - } - - const checkHasConfigFile = fs.existsSync(path.join(__dirname, '..', '../google_cred.json')); - - if (!checkHasConfigFile) { - throw new Error('Google credentials file not found!'); - } - - const serviceAccount = require('../../google_cred.json'); - - const googleClient = (PubSub as any)({ - projectId: serviceAccount.project_id, - keyFilename: GOOGLE_APPLICATION_CREDENTIALS, - }); - - /* - * Schema - * [[ Topic: { name, pubsub, parent, request } ]] - */ - const [pubsubTopics = []] = await googleClient.getTopics(); - const existingTopics: string[] = []; - - if (pubsubTopics.length > 0) { - for (const topic of pubsubTopics) { - const name = topic.name.split('/'); - const lastName = name.pop(); - - existingTopics.push(lastName); - } - } - - const filteredTopics = topics.filter(topic => !existingTopics.includes(topic)); - - if (filteredTopics.length === 0) { - return spinner.succeed('You already have topics'); - } - - for (const topic of filteredTopics) { - await googleClient.createTopic(topic); - } - - spinner.succeed('Successfully created google pubsub topics.'); -}; - -start(); diff --git a/src/cronJobs/index.ts b/src/cronJobs/index.ts index ea500049e..fc93278e0 100644 --- a/src/cronJobs/index.ts +++ b/src/cronJobs/index.ts @@ -3,8 +3,8 @@ import * as express from 'express'; import { connect } from '../db/connection'; import { debugCrons } from '../debuggers'; -import { initRabbitMQ } from '../messageBroker'; -import { initRedis } from '../redisClient'; +import { initMemoryStorage } from '../inmemoryStorage'; +import { initBroker } from '../messageBroker'; import './activityLogs'; import './conversations'; import './deals'; @@ -27,8 +27,11 @@ const { PORT_CRONS = 3600 } = process.env; app.listen(PORT_CRONS, () => { // connect to mongo database connect().then(async () => { - initRabbitMQ(); - initRedis(); + initMemoryStorage(); + + initBroker().catch(e => { + debugCrons(`Error ocurred during broker init ${e.message}`); + }); }); debugCrons(`Cron Server is now running on ${PORT_CRONS}`); diff --git a/src/cronJobs/integrations.ts b/src/cronJobs/integrations.ts index 50361ab2e..a4834951c 100644 --- a/src/cronJobs/integrations.ts +++ b/src/cronJobs/integrations.ts @@ -1,5 +1,5 @@ import * as schedule from 'node-schedule'; -import { sendMessage } from '../messageBroker'; +import messageBroker from '../messageBroker'; /** * * * * * * * @@ -13,5 +13,5 @@ import { sendMessage } from '../messageBroker'; * └───────────────────────── second (0 - 59, OPTIONAL) */ schedule.scheduleJob('0 0 * * *', () => { - return sendMessage('erxes-api:integrations-notification', { type: 'cronjob' }); + return messageBroker().sendMessage('erxes-api:integrations-notification', { type: 'cronjob' }); }); diff --git a/src/cronJobs/robot.ts b/src/cronJobs/robot.ts index af11d3803..c37aa6cd6 100644 --- a/src/cronJobs/robot.ts +++ b/src/cronJobs/robot.ts @@ -2,7 +2,7 @@ import * as schedule from 'node-schedule'; import { Users } from '../db/models'; import { OnboardingHistories } from '../db/models/Robot'; import { debugCrons } from '../debuggers'; -import { sendMessage } from '../messageBroker'; +import messageBroker from '../messageBroker'; const checkOnboarding = async () => { const users = await Users.find({}).lean(); @@ -14,7 +14,7 @@ const checkOnboarding = async () => { continue; } - sendMessage('callPublish', { + messageBroker().sendMessage('callPublish', { name: 'onboardingChanged', data: { onboardingChanged: { diff --git a/src/data/logUtils.ts b/src/data/logUtils.ts index f29b4ee36..7570b23fa 100644 --- a/src/data/logUtils.ts +++ b/src/data/logUtils.ts @@ -39,7 +39,7 @@ import { Users, UsersGroups, } from '../db/models/index'; -import { sendMessage } from '../messageBroker'; +import messageBroker from '../messageBroker'; import { MODULE_NAMES, RABBITMQ_QUEUES } from './constants'; import { getSubServiceDomain, registerOnboardHistory, sendRequest } from './utils'; @@ -1311,7 +1311,7 @@ export const putDeleteLog = async (params: ILogDataParams, user: IUserDocument) const putLog = async (params: IFinalLogParams, user: IUserDocument) => { try { - return sendMessage(RABBITMQ_QUEUES.PUT_LOG, { + return messageBroker().sendMessage(RABBITMQ_QUEUES.PUT_LOG, { ...params, createdBy: user._id, unicode: user.username || user.email || user._id, diff --git a/src/data/modules/integrations/receiveMessage.ts b/src/data/modules/integrations/receiveMessage.ts index 249109bd1..55ee7f469 100644 --- a/src/data/modules/integrations/receiveMessage.ts +++ b/src/data/modules/integrations/receiveMessage.ts @@ -118,6 +118,11 @@ export const receiveRpcMessage = async msg => { const configs = await getConfigs(); return sendSuccess({ configs }); } + + if (action === 'getUserIds') { + const users = await Users.find({}, { _id: 1 }); + return sendSuccess({ userIds: users.map(user => user._id) }); + } }; /* @@ -127,7 +132,7 @@ export const receiveIntegrationsNotification = async msg => { const { action } = msg; if (action === 'external-integration-entry-added') { - graphqlPubsub.publish('conversationExternalIntegrationMessageInserted'); + graphqlPubsub.publish('conversationExternalIntegrationMessageInserted', {}); return sendSuccess({ status: 'ok' }); } diff --git a/src/data/permissions/utils.ts b/src/data/permissions/utils.ts index 65c01086f..7b3c5958b 100644 --- a/src/data/permissions/utils.ts +++ b/src/data/permissions/utils.ts @@ -1,6 +1,6 @@ import { Permissions, Users } from '../../db/models'; import { IUserDocument } from '../../db/models/definitions/users'; -import { get, set } from '../../redisClient'; +import memoryStorage from '../../inmemoryStorage'; export interface IModuleMap { name: string; @@ -100,11 +100,11 @@ interface IActionMap { const getKey = (user: IUserDocument) => `user_permissions_${user._id}`; /* - * Get given users permission map from redis or database + * Get given users permission map from inmemory storage or database */ export const getUserActionsMap = async (user: IUserDocument): Promise => { const key = getKey(user); - const permissionCache = await get(key); + const permissionCache = await memoryStorage().get(key); let actionMap: IActionMap; @@ -113,7 +113,7 @@ export const getUserActionsMap = async (user: IUserDocument): Promise { for (const user of users) { const key = getKey(user); - set(key, ''); + memoryStorage().set(key, ''); } }; diff --git a/src/data/resolvers/mutations/conversations.ts b/src/data/resolvers/mutations/conversations.ts index 776fd63fa..0f59f7ad8 100644 --- a/src/data/resolvers/mutations/conversations.ts +++ b/src/data/resolvers/mutations/conversations.ts @@ -12,7 +12,7 @@ import { IMessageDocument } from '../../../db/models/definitions/conversationMes import { IConversationDocument } from '../../../db/models/definitions/conversations'; import { IUserDocument } from '../../../db/models/definitions/users'; import { debugExternalApi } from '../../../debuggers'; -import { sendMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { graphqlPubsub } from '../../../pubsub'; import { checkPermission, requireLogin } from '../../permissions/wrappers'; import { IContext } from '../../types'; @@ -56,7 +56,7 @@ const sendConversationToIntegrations = ( attachments.push({ type: 'image', url: img }); }); - return sendMessage('erxes-api:integrations-notification', { + return messageBroker().sendMessage('erxes-api:integrations-notification', { action, type, payload: JSON.stringify({ diff --git a/src/data/resolvers/mutations/customers.ts b/src/data/resolvers/mutations/customers.ts index 1ef4ba8fc..05cff970f 100644 --- a/src/data/resolvers/mutations/customers.ts +++ b/src/data/resolvers/mutations/customers.ts @@ -1,6 +1,6 @@ import { ActivityLogs, Customers } from '../../../db/models'; import { ICustomer } from '../../../db/models/definitions/customers'; -import { sendMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { MODULE_NAMES } from '../../constants'; import { putCreateLog, putDeleteLog, putUpdateLog } from '../../logUtils'; import { checkPermission } from '../../permissions/wrappers'; @@ -81,7 +81,7 @@ const customerMutations = { await Customers.removeCustomers(customerIds); - await sendMessage('erxes-api:integrations-notification', { + await messageBroker().sendMessage('erxes-api:integrations-notification', { type: 'removeCustomers', customerIds, }); @@ -92,7 +92,7 @@ const customerMutations = { await putDeleteLog({ type: MODULE_NAMES.CUSTOMER, object: customer }, user); if (customer.mergedIds) { - await sendMessage('erxes-api:integrations-notification', { + await messageBroker().sendMessage('erxes-api:integrations-notification', { type: 'removeCustomers', customerIds: customer.mergedIds, }); diff --git a/src/data/resolvers/mutations/engageUtils.ts b/src/data/resolvers/mutations/engageUtils.ts index 4fde6e9a5..e4a428b12 100644 --- a/src/data/resolvers/mutations/engageUtils.ts +++ b/src/data/resolvers/mutations/engageUtils.ts @@ -14,7 +14,7 @@ import { ICustomerDocument } from '../../../db/models/definitions/customers'; import { IEngageMessageDocument } from '../../../db/models/definitions/engages'; import { IUserDocument } from '../../../db/models/definitions/users'; import { debugBase } from '../../../debuggers'; -import { sendMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { MESSAGE_KINDS } from '../../constants'; import { fetchBySegments } from '../../modules/segments/queryBuilder'; import { chunkArray } from '../../utils'; @@ -77,7 +77,7 @@ export const generateCustomerSelector = async ({ }; const sendQueueMessage = (args: any) => { - return sendMessage('erxes-api:engages-notification', args); + return messageBroker().sendMessage('erxes-api:engages-notification', args); }; export const send = async (engageMessage: IEngageMessageDocument) => { diff --git a/src/data/resolvers/mutations/importHistory.ts b/src/data/resolvers/mutations/importHistory.ts index d95fe6f7e..b1a189ff3 100644 --- a/src/data/resolvers/mutations/importHistory.ts +++ b/src/data/resolvers/mutations/importHistory.ts @@ -1,5 +1,5 @@ import { ImportHistory } from '../../../db/models'; -import { sendMessage, sendRPCMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { MODULE_NAMES, RABBITMQ_QUEUES } from '../../constants'; import { putDeleteLog } from '../../logUtils'; import { checkPermission } from '../../permissions/wrappers'; @@ -15,7 +15,7 @@ const importHistoryMutations = { await ImportHistory.updateOne({ _id: importHistory._id }, { $set: { status: 'Removing' } }); - const response = await sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, { + const response = await messageBroker().sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, { action: 'removeImport', contentType: importHistory.contentType, importHistoryId: importHistory._id, @@ -34,7 +34,7 @@ const importHistoryMutations = { * Cancel uploading process */ async importHistoriesCancel(_root) { - await sendMessage(RABBITMQ_QUEUES.WORKERS, { + await messageBroker().sendMessage(RABBITMQ_QUEUES.WORKERS, { type: 'cancelImport', }); diff --git a/src/data/resolvers/mutations/integrations.ts b/src/data/resolvers/mutations/integrations.ts index ddf16434b..c9281d8c4 100644 --- a/src/data/resolvers/mutations/integrations.ts +++ b/src/data/resolvers/mutations/integrations.ts @@ -3,7 +3,7 @@ import { Channels, Customers, EmailDeliveries, Integrations } from '../../../db/ import { IIntegration, IMessengerData, IUiOptions } from '../../../db/models/definitions/integrations'; import { IExternalIntegrationParams } from '../../../db/models/Integrations'; import { debugExternalApi } from '../../../debuggers'; -import { sendRPCMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { MODULE_NAMES, RABBITMQ_QUEUES } from '../../constants'; import { putCreateLog, putDeleteLog, putUpdateLog } from '../../logUtils'; import { checkPermission } from '../../permissions/wrappers'; @@ -241,7 +241,7 @@ const integrationMutations = { */ async integrationsRemoveAccount(_root, { _id }: { _id: string }) { try { - const { erxesApiIds } = await sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_INTEGRATIONS, { + const { erxesApiIds } = await messageBroker().sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_INTEGRATIONS, { action: 'remove-account', data: { _id }, }); diff --git a/src/data/resolvers/mutations/internalNotes.ts b/src/data/resolvers/mutations/internalNotes.ts index 4b1b221fc..5351d2826 100644 --- a/src/data/resolvers/mutations/internalNotes.ts +++ b/src/data/resolvers/mutations/internalNotes.ts @@ -44,7 +44,7 @@ const sendNotificationOfItems = async ( utils.sendNotification(notifDocItems); - graphqlPubsub.publish('activityLogsChanged'); + graphqlPubsub.publish('activityLogsChanged', {}); }; const internalNoteMutations = { @@ -183,7 +183,7 @@ const internalNoteMutations = { ); if (BOARD_TYPES.ALL.includes(updated.contentType)) { - graphqlPubsub.publish('activityLogsChanged'); + graphqlPubsub.publish('activityLogsChanged', {}); } return updated; @@ -199,7 +199,7 @@ const internalNoteMutations = { await putDeleteLog({ type: MODULE_NAMES.INTERNAL_NOTE, object: internalNote }, user); if (BOARD_TYPES.ALL.includes(internalNote.contentType)) { - graphqlPubsub.publish('activityLogsChanged'); + graphqlPubsub.publish('activityLogsChanged', {}); } return removed; diff --git a/src/data/resolvers/mutations/widgets.ts b/src/data/resolvers/mutations/widgets.ts index 505ee6290..ef0686496 100644 --- a/src/data/resolvers/mutations/widgets.ts +++ b/src/data/resolvers/mutations/widgets.ts @@ -20,8 +20,8 @@ import { IIntegrationDocument, IMessengerDataMessagesItem } from '../../../db/mo import { IKnowledgebaseCredentials, ILeadCredentials } from '../../../db/models/definitions/messengerApps'; import { debugBase } from '../../../debuggers'; import { trackViewPageEvent } from '../../../events'; +import memoryStorage from '../../../inmemoryStorage'; import { graphqlPubsub } from '../../../pubsub'; -import { get, set } from '../../../redisClient'; import { registerOnboardHistory, sendEmail, sendMobileNotification } from '../../utils'; import { conversationNotifReceivers } from './conversations'; @@ -427,10 +427,10 @@ const widgetMutations = { conversationClientTypingStatusChanged: { conversationId, text: '' }, }); - const customerLastStatus = await get(`customer_last_status_${customerId}`, 'left'); + const customerLastStatus = await memoryStorage().get(`customer_last_status_${customerId}`, 'left'); if (customerLastStatus === 'left') { - set(`customer_last_status_${customerId}`, 'joined'); + memoryStorage().set(`customer_last_status_${customerId}`, 'joined'); // customer has joined + time const conversationMessages = await Conversations.changeCustomerStatus( diff --git a/src/data/resolvers/queries/integrations.ts b/src/data/resolvers/queries/integrations.ts index b24c0c36e..330f70da8 100644 --- a/src/data/resolvers/queries/integrations.ts +++ b/src/data/resolvers/queries/integrations.ts @@ -2,7 +2,7 @@ import { Brands, Channels, Integrations, Tags } from '../../../db/models'; import { INTEGRATION_NAMES_MAP, KIND_CHOICES, TAG_TYPES } from '../../../db/models/definitions/constants'; import { checkPermission, moduleRequireLogin } from '../../permissions/wrappers'; -import { sendRPCMessage } from '../../../messageBroker'; +import messageBroker from '../../../messageBroker'; import { RABBITMQ_QUEUES } from '../../constants'; import { IContext } from '../../types'; import { paginate } from '../../utils'; @@ -153,7 +153,10 @@ const integrationQueries = { }, async integrationGetLineWebhookUrl(_root, { _id }: { _id: string }) { - return sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_INTEGRATIONS, { action: 'line-webhook', data: { _id } }); + return messageBroker().sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_INTEGRATIONS, { + action: 'line-webhook', + data: { _id }, + }); }, }; diff --git a/src/data/utils.ts b/src/data/utils.ts index 0b5477a16..21783d76a 100644 --- a/src/data/utils.ts +++ b/src/data/utils.ts @@ -12,8 +12,8 @@ import { Configs, Customers, Notifications, Users } from '../db/models'; import { IUser, IUserDocument } from '../db/models/definitions/users'; import { OnboardingHistories } from '../db/models/Robot'; import { debugBase, debugEmail, debugExternalApi } from '../debuggers'; +import memoryStorage from '../inmemoryStorage'; import { graphqlPubsub } from '../pubsub'; -import { get, set } from '../redisClient'; export const uploadsFolderPath = path.join(__dirname, '../private/uploads'); @@ -917,7 +917,7 @@ export const handleUnsubscription = async (query: { cid: string; uid: string }) }; export const getConfigs = async () => { - const configsCache = await get('configs_erxes_api'); + const configsCache = await memoryStorage().get('configs_erxes_api'); if (configsCache && configsCache !== '{}') { return JSON.parse(configsCache); @@ -930,7 +930,7 @@ export const getConfigs = async () => { configsMap[config.code] = config.value; } - set('configs_erxes_api', JSON.stringify(configsMap)); + memoryStorage().set('configs_erxes_api', JSON.stringify(configsMap)); return configsMap; }; @@ -946,7 +946,7 @@ export const getConfig = async (code, defaultValue?) => { }; export const resetConfigsCache = () => { - set('configs_erxes_api', ''); + memoryStorage().set('configs_erxes_api', ''); }; export const frontendEnv = ({ name, req, requestInfo }: { name: string; req?: any; requestInfo?: any }): string => { diff --git a/src/index.ts b/src/index.ts index ccf1624c2..d357c3ecf 100755 --- a/src/index.ts +++ b/src/index.ts @@ -28,11 +28,11 @@ import { updateContactsValidationStatus, updateContactValidationStatus } from '. import { connect, mongoStatus } from './db/connection'; import { debugBase, debugExternalApi, debugInit } from './debuggers'; import { identifyCustomer, trackCustomEvent, trackViewPageEvent, updateCustomerProperty } from './events'; -import { initConsumer, rabbitMQStatus } from './messageBroker'; +import { initMemoryStorage } from './inmemoryStorage'; +import { initBroker } from './messageBroker'; import { importer, uploader } from './middlewares/fileMiddleware'; import userMiddleware from './middlewares/userMiddleware'; import widgetsMiddleware from './middlewares/widgetsMiddleware'; -import { initRedis, redisStatus } from './redisClient'; import init from './startup'; // load environment variables @@ -158,20 +158,6 @@ app.get('/status', async (_req, res, next) => { return next(e); } - try { - await redisStatus(); - } catch (e) { - debugBase('Redis is not running'); - return next(e); - } - - try { - await rabbitMQStatus(); - } catch (e) { - debugBase('RabbitMQ is not running'); - return next(e); - } - res.end('ok'); }); @@ -354,11 +340,11 @@ apolloServer.installSubscriptionHandlers(httpServer); httpServer.listen(PORT, () => { // connect to mongo database connect().then(async () => { - initConsumer().catch(e => { - debugBase(`Error ocurred during rabbitmq init ${e.message}`); + initBroker().catch(e => { + debugBase(`Error ocurred during message broker init ${e.message}`); }); - initRedis(); + initMemoryStorage(); init() .then(() => { diff --git a/src/inmemoryStorage.ts b/src/inmemoryStorage.ts new file mode 100644 index 000000000..077d03880 --- /dev/null +++ b/src/inmemoryStorage.ts @@ -0,0 +1,21 @@ +import * as dotenv from 'dotenv'; +import memoryStorage from 'erxes-inmemory-storage'; + +// load environment variables +dotenv.config(); + +const { REDIS_HOST, REDIS_PORT, REDIS_PASSWORD } = process.env; + +let client; + +export const initMemoryStorage = () => { + client = memoryStorage({ + host: REDIS_HOST, + port: REDIS_PORT, + password: REDIS_PASSWORD, + }); +}; + +export default function() { + return client; +} diff --git a/src/messageBroker.ts b/src/messageBroker.ts index e74de66a4..f7efad87f 100644 --- a/src/messageBroker.ts +++ b/src/messageBroker.ts @@ -1,6 +1,5 @@ -import * as amqplib from 'amqplib'; import * as dotenv from 'dotenv'; -import * as uuid from 'uuid'; +import messageBroker from 'erxes-message-broker'; import { receiveEngagesNotification, receiveIntegrationsNotification, @@ -12,159 +11,41 @@ import { graphqlPubsub } from './pubsub'; dotenv.config(); -const { NODE_ENV, RABBITMQ_HOST = 'amqp://localhost' } = process.env; +let client; -let connection; -let channel; - -export const sendRPCMessage = async (queueName: string, message: any): Promise => { - debugBase(`Sending rpc message ${JSON.stringify(message)} to queue ${queueName}`); - - const response = await new Promise((resolve, reject) => { - const correlationId = uuid(); - - return channel.assertQueue('', { exclusive: true }).then(q => { - channel.consume( - q.queue, - msg => { - if (!msg) { - return reject(new Error('consumer cancelled by rabbitmq')); - } - - if (msg.properties.correlationId === correlationId) { - const res = JSON.parse(msg.content.toString()); - - if (res.status === 'success') { - resolve(res.data); - } else { - reject(new Error(res.errorMessage)); - } - - channel.deleteQueue(q.queue); - } - }, - { noAck: true }, - ); - - channel.sendToQueue(queueName, Buffer.from(JSON.stringify(message)), { - correlationId, - replyTo: q.queue, - }); - }); +export const initBroker = async () => { + client = await messageBroker({ + name: 'api', + RABBITMQ_HOST: process.env.RABBITMQ_HOST, }); - return response; -}; - -export const sendMessage = async (queueName: string, data?: any) => { - if (NODE_ENV === 'test') { - return; - } - - debugBase(`Sending message to ${queueName}`); - - await channel.assertQueue(queueName); - await channel.sendToQueue(queueName, Buffer.from(JSON.stringify(data || {}))); -}; - -export const initRabbitMQ = async () => { - // Consumer - connection = await amqplib.connect(RABBITMQ_HOST); - channel = await connection.createChannel(); -}; - -export const initConsumer = async () => { - await initRabbitMQ(); + const { consumeQueue, consumeRPCQueue } = client; // listen for rpc queue ========= - await channel.assertQueue('rpc_queue:integrations_to_api'); - - channel.consume('rpc_queue:integrations_to_api', async msg => { - if (msg !== null) { - debugBase(`Received rpc queue message ${msg.content.toString()}`); - - const response = await receiveRpcMessage(JSON.parse(msg.content.toString())); - - channel.sendToQueue(msg.properties.replyTo, Buffer.from(JSON.stringify(response)), { - correlationId: msg.properties.correlationId, - }); - - channel.ack(msg); - } - }); + consumeRPCQueue('rpc_queue:integrations_to_api', async data => receiveRpcMessage(data)); // graphql subscriptions call ========= - await channel.assertQueue('callPublish'); - - channel.consume('callPublish', async msg => { - if (msg !== null) { - const params = JSON.parse(msg.content.toString()); - - graphqlPubsub.publish(params.name, params.data); - - channel.ack(msg); - } + consumeQueue('callPublish', params => { + graphqlPubsub.publish(params.name, params.data); }); - // listen for integrations api ========= - await channel.assertQueue('integrationsNotification'); - - channel.consume('integrationsNotification', async msg => { - if (msg !== null) { - await receiveIntegrationsNotification(JSON.parse(msg.content.toString())); - channel.ack(msg); - } + consumeQueue('integrationsNotification', async data => { + await receiveIntegrationsNotification(data); }); - // listen for engage notification =========== - await channel.assertQueue('engagesNotification'); - - channel.consume('engagesNotification', async msg => { - if (msg !== null) { - debugBase(`Received engages notification ${msg.content.toString()}`); - - await receiveEngagesNotification(JSON.parse(msg.content.toString())); - - channel.ack(msg); - } + consumeQueue('engagesNotification', async data => { + await receiveEngagesNotification(data); }); - // listen for spark notification ========= - await channel.assertQueue('sparkNotification'); - - channel.consume('sparkNotification', async msg => { - if (msg !== null) { - debugBase(`Received spark notification ${msg.content.toString()}`); - - const data = JSON.parse(msg.content.toString()); - - delete data.subdomain; + consumeQueue('sparkNotification', async data => { + delete data.subdomain; - RobotEntries.createEntry(data) - .then(() => debugBase('success')) - .catch(e => debugBase(e.message)); - - channel.ack(msg); - } + RobotEntries.createEntry(data) + .then(() => debugBase('success')) + .catch(e => debugBase(e.message)); }); }; -/** - * Health check rabbitMQ - */ -export const rabbitMQStatus = async () => { - return new Promise((resolve, reject) => { - // tslint:disable-next-line:no-submodule-imports - import('amqplib/callback_api') - .then(amqp => { - amqp.connect(RABBITMQ_HOST, error => { - if (error) { - return reject(error); - } - - return resolve('ok'); - }); - }) - .catch(e => reject(e)); - }); -}; +export default function() { + return client; +} diff --git a/src/middlewares/fileMiddleware.ts b/src/middlewares/fileMiddleware.ts index 6df99e9a4..04387dac0 100644 --- a/src/middlewares/fileMiddleware.ts +++ b/src/middlewares/fileMiddleware.ts @@ -14,7 +14,7 @@ import { uploadFileLocal, } from '../data/utils'; import { debugExternalApi } from '../debuggers'; -import { sendRPCMessage } from '../messageBroker'; +import messageBroker from '../messageBroker'; export const importer = async (req: any, res, next) => { if (!(await can('importXlsFile', req.user))) { @@ -52,7 +52,7 @@ export const importer = async (req: any, res, next) => { fileType = 'csv'; } - const result = await sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, { + const result = await messageBroker().sendRPCMessage(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, { action: 'createImport', type: fields.type, fileType, diff --git a/src/pubsub.ts b/src/pubsub.ts index b43a41be1..a2a9d2284 100644 --- a/src/pubsub.ts +++ b/src/pubsub.ts @@ -1,34 +1,28 @@ import * as dotenv from 'dotenv'; +import { redisOptions } from 'erxes-inmemory-storage'; import { RedisPubSub } from 'graphql-redis-subscriptions'; +import { PubSub } from 'graphql-subscriptions'; import * as Redis from 'ioredis'; -import { redisOptions } from './redisClient'; // load environment variables dotenv.config(); -const { NODE_ENV, PROCESS_NAME } = process.env; +const { REDIS_HOST }: { REDIS_HOST?: string } = process.env; const createPubsubInstance = () => { - let pubsub; - - if (NODE_ENV === 'test' || NODE_ENV === 'command' || PROCESS_NAME === 'crons') { - pubsub = { - asyncIterator: () => null, - publish: () => null, - }; - - return pubsub; + if (REDIS_HOST) { + return new RedisPubSub({ + connectionListener: error => { + if (error) { + console.error(error); + } + }, + publisher: new Redis(redisOptions), + subscriber: new Redis(redisOptions), + }); } - return new RedisPubSub({ - connectionListener: error => { - if (error) { - console.error(error); - } - }, - publisher: new Redis(redisOptions), - subscriber: new Redis(redisOptions), - }); + return new PubSub(); }; export const graphqlPubsub = createPubsubInstance(); diff --git a/src/redisClient.ts b/src/redisClient.ts deleted file mode 100644 index e5f4ae123..000000000 --- a/src/redisClient.ts +++ /dev/null @@ -1,165 +0,0 @@ -import * as dotenv from 'dotenv'; -import * as redis from 'redis'; - -// load environment variables -dotenv.config(); - -const { - REDIS_HOST = 'localhost', - REDIS_PORT = 6379, - REDIS_PASSWORD, - NODE_ENV, -}: { - REDIS_HOST?: string; - REDIS_PORT?: number; - REDIS_PASSWORD?: string; - NODE_ENV?: string; -} = process.env; - -/** - * Docs on the different redis options - * @see {@link https://github.com/NodeRedis/node_redis#options-object-properties} - */ -export const redisOptions = { - host: REDIS_HOST, - port: REDIS_PORT, - password: REDIS_PASSWORD, - connect_timeout: 15000, - enable_offline_queue: true, - retry_unfulfilled_commands: true, - retry_strategy: options => { - // reconnect after - return Math.max(options.attempt * 100, 3000); - }, -}; - -let client; - -export const initRedis = (callback?: (client) => void) => { - client = redis.createClient(redisOptions); - - if (callback) { - callback(client); - } -}; - -/* - * Get item - */ -export const get = (key: string, defaultValue?: any): Promise => { - return new Promise((resolve, reject) => { - if (NODE_ENV === 'test') { - return resolve(defaultValue || ''); - } - - client.get(key, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply && reply !== 'nil' ? reply : defaultValue); - }); - }); -}; - -/* - * Set item - */ -export const set = (key: string, value: any) => { - if (NODE_ENV === 'test') { - return; - } - - client.set(key, value); -}; - -export const getArray = async (key: string, defaultValue = []): Promise => { - try { - const response = await new Promise((resolve, reject) => { - client.smembers(key, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply && reply !== 'nil' ? reply : defaultValue); - }); - }); - - return response; - } catch (e) { - return false; - } -}; - -/* - * Check if value exists in set - */ -export const inArray = async (setKey: string, setMember: string): Promise => { - try { - const response = await new Promise((resolve, reject) => { - client.sismember(setKey, setMember, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply); - }); - }); - - return response; - - // handle already stored invalid type error - } catch (e) { - if (e.message.includes('WRONGTYPE')) { - client.del(setKey); - } - - return false; - } -}; - -/* - * Add a value to a set or do nothing if it already exists - */ -export const addToArray = (setKey: string, setMember: string) => { - return new Promise((resolve, reject) => { - client.sadd(setKey, setMember, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply); - }); - }); -}; - -/* - * Remove a value from a set or do nothing if it is not present - */ -export const removeFromArray = (setKey: string, setMember: string) => { - return new Promise((resolve, reject) => { - client.srem(setKey, setMember, (error, reply) => { - if (error) { - return reject(error); - } - - return resolve(reply); - }); - }); -}; - -/** - * Health check status - * retryStrategy - get response immediately - */ -export const redisStatus = () => { - return new Promise((resolve, reject) => { - client.ping((error, result) => { - if (error) { - return reject(error); - } - - return resolve(result); - }); - }); -}; diff --git a/src/startup.ts b/src/startup.ts index 7112e2f07..198c1b139 100644 --- a/src/startup.ts +++ b/src/startup.ts @@ -1,14 +1,4 @@ import * as fs from 'fs'; -import { Users } from './db/models'; -import { addToArray } from './redisClient'; - -export const cacheUsers = async () => { - const userIds = await Users.find({}).distinct('_id'); - - userIds.forEach(id => { - addToArray('userIds', id); - }); -}; export const makeDirs = () => { const dir = `${__dirname}/private/xlsTemplateOutputs`; @@ -19,7 +9,6 @@ export const makeDirs = () => { }; const init = async () => { - await cacheUsers(); makeDirs(); }; diff --git a/src/workers/bulkInsert.worker.ts b/src/workers/bulkInsert.worker.ts index ea80f91a9..031948406 100644 --- a/src/workers/bulkInsert.worker.ts +++ b/src/workers/bulkInsert.worker.ts @@ -14,8 +14,6 @@ import { Tickets, Users, } from '../db/models'; -import { initRabbitMQ } from '../messageBroker'; -import { graphqlPubsub } from '../pubsub'; import { clearEmptyValues, connect, updateDuplicatedValue } from './utils'; // tslint:disable-next-line @@ -35,11 +33,8 @@ connect().then(async () => { return; } - await initRabbitMQ(); - const { user, scopeBrandIds, result, contentType, properties, importHistoryId, percentagePerData } = workerData; - let percentage = '0'; let create: any = null; let model: any = null; @@ -310,20 +305,6 @@ connect().then(async () => { if (!importHistory) { throw new Error('Could not find import history'); } - - const fixedPercentage = (importHistory.percentage || 0).toFixed(0); - - if (fixedPercentage !== percentage) { - percentage = fixedPercentage; - - graphqlPubsub.publish('importHistoryChanged', { - importHistoryChanged: { - _id: importHistory._id, - status: importHistory.status, - percentage, - }, - }); - } } mongoose.connection.close(); diff --git a/src/workers/importHistoryRemove.worker.ts b/src/workers/importHistoryRemove.worker.ts index 651b2cc34..9e37f458d 100644 --- a/src/workers/importHistoryRemove.worker.ts +++ b/src/workers/importHistoryRemove.worker.ts @@ -1,6 +1,5 @@ import * as mongoose from 'mongoose'; import { Companies, Customers, Deals, ImportHistory, Products, Tasks, Tickets } from '../db/models'; -import { graphqlPubsub } from '../pubsub'; import { connect } from './utils'; // tslint:disable-next-line @@ -41,14 +40,6 @@ connect() const historyObj = await ImportHistory.findOne({ _id: importHistoryId }); if (historyObj && (historyObj.ids || []).length === 0) { - graphqlPubsub.publish('importHistoryChanged', { - importHistoryChanged: { - _id: historyObj._id, - status: 'Removed', - percentage: 100, - }, - }); - await ImportHistory.deleteOne({ _id: importHistoryId }); } @@ -57,17 +48,7 @@ connect() parentPort.postMessage('Successfully finished job'); }) .catch(e => { - const { importHistoryId } = workerData; - - graphqlPubsub.publish('importHistoryChanged', { - importHistoryChanged: { - _id: importHistoryId, - status: 'Error', - errorMsgs: [e.message], - }, - }); - mongoose.connection.close(); - parentPort.postMessage('Finished job with error'); + parentPort.postMessage(`Finished job with error ${e.message}`); }); diff --git a/src/workers/index.ts b/src/workers/index.ts index 2177e1b17..2c74a6b78 100644 --- a/src/workers/index.ts +++ b/src/workers/index.ts @@ -4,15 +4,13 @@ import * as express from 'express'; import { filterXSS } from 'xss'; import { connect } from '../db/connection'; import { debugWorkers } from '../debuggers'; +import { initMemoryStorage } from '../inmemoryStorage'; import userMiddleware from '../middlewares/userMiddleware'; -import { initRedis } from '../redisClient'; -import { initConsumer } from './messageBroker'; +import { initBroker } from './messageBroker'; // load environment variables dotenv.config(); -initRedis(); - // connect to mongo database connect(); @@ -39,8 +37,10 @@ app.use((error, _req, res, _next) => { const { PORT_WORKERS = 3700 } = process.env; app.listen(PORT_WORKERS, () => { - initConsumer().catch(e => { - debugWorkers(`Error ocurred during rabbitmq init ${e.message}`); + initMemoryStorage(); + + initBroker().catch(e => { + debugWorkers(`Error ocurred during message broker init ${e.message}`); }); debugWorkers(`Workers server is now running on ${PORT_WORKERS}`); diff --git a/src/workers/messageBroker.ts b/src/workers/messageBroker.ts index f3af942f0..8a31bd599 100644 --- a/src/workers/messageBroker.ts +++ b/src/workers/messageBroker.ts @@ -1,81 +1,42 @@ -import * as amqplib from 'amqplib'; import * as dotenv from 'dotenv'; +import messageBroker from 'erxes-message-broker'; import { RABBITMQ_QUEUES } from '../data/constants'; -import { debugWorkers } from '../debuggers'; -import { addToArray, getArray, removeFromArray } from '../redisClient'; -import { generateUid, receiveImportCancel, receiveImportCreate, receiveImportRemove } from './utils'; +import { receiveImportCancel, receiveImportCreate, receiveImportRemove } from './utils'; dotenv.config(); -const { RABBITMQ_HOST = 'amqp://localhost' } = process.env; +let client; -let connection; -let channel; +export const initBroker = async () => { + client = await messageBroker({ + name: 'workers', + RABBITMQ_HOST: process.env.RABBITMQ_HOST, + }); -export const initConsumer = async () => { - try { - connection = await amqplib.connect(RABBITMQ_HOST); - channel = await connection.createChannel(); + const { consumeQueue, consumeRPCQueue } = client; - await channel.assertQueue(RABBITMQ_QUEUES.WORKERS); + // listen for rpc queue ========= + consumeRPCQueue(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, async content => { + const response = { status: 'success', data: {}, errorMessage: '' }; - channel.consume(RABBITMQ_QUEUES.WORKERS, async msg => { - if (msg !== null) { - debugWorkers(`Received queue message ${msg.content.toString()}`); + try { + response.data = + content.action === 'removeImport' ? await receiveImportRemove(content) : await receiveImportCreate(content); + } catch (e) { + response.status = 'error'; + response.errorMessage = e.message; + } - const content = JSON.parse(msg.content.toString()); + return response; + }); - if (content.type === 'cancelImport') { - receiveImportCancel(); - } - - channel.ack(msg); - } - }); - - await channel.assertQueue(RABBITMQ_QUEUES.RPC_API_TO_WORKERS); - - channel.consume(RABBITMQ_QUEUES.RPC_API_TO_WORKERS, async msg => { - if (msg !== null) { - const response = { status: 'success', data: {}, errorMessage: '' }; - - const activeWorkers = await getArray('active_workers'); - - if (activeWorkers.length > 3) { - response.status = 'error'; - response.errorMessage = 'Please white for a while'; - - return channel.sendToQueue(msg.properties.replyTo, Buffer.from(JSON.stringify(response)), { - correlationId: msg.properties.correlationId, - }); - } - - const uid = generateUid(); - - await addToArray('active_workers', uid); - - debugWorkers(`Received rpc queue message ${msg.content.toString()}`); - - const content = JSON.parse(msg.content.toString()); - - try { - response.data = - content.action === 'removeImport' ? await receiveImportRemove(content) : await receiveImportCreate(content); - } catch (e) { - response.status = 'error'; - response.errorMessage = e.message; - } - - await removeFromArray('active_workers', uid); - - channel.sendToQueue(msg.properties.replyTo, Buffer.from(JSON.stringify(response)), { - correlationId: msg.properties.correlationId, - }); - - channel.ack(msg); - } - }); - } catch (e) { - console.log(e.message); - } + consumeQueue(RABBITMQ_QUEUES.WORKERS, async content => { + if (content.type === 'cancelImport') { + receiveImportCancel(); + } + }); }; + +export default function() { + return client; +} diff --git a/src/workers/utils.ts b/src/workers/utils.ts index 01166afbd..6898b0113 100644 --- a/src/workers/utils.ts +++ b/src/workers/utils.ts @@ -6,7 +6,7 @@ import * as os from 'os'; import * as path from 'path'; import * as XlsxStreamReader from 'xlsx-stream-reader'; import { checkFieldNames } from '../data/modules/fields/utils'; -import { deleteFileAWS, s3Stream, uploadsFolderPath } from '../data/utils'; +import { deleteFile, s3Stream, uploadsFolderPath } from '../data/utils'; import { ImportHistory } from '../db/models'; import ImportHistories from '../db/models/ImportHistory'; import { debugImport, debugWorkers } from '../debuggers'; @@ -348,9 +348,7 @@ export const receiveImportCreate = async (content: any) => { await createWorkers(workerPath, workerData, results); - if (uploadType === 'AWS') { - await deleteFileAWS(fileName); - } + await deleteFile(fileName); return { id: importHistory.id }; } catch (e) { diff --git a/yarn.lock b/yarn.lock index c3f766a70..d472782dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -157,6 +157,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.11.2": + version "7.11.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" + integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.4.0", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -198,6 +205,25 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@dashersw/axon@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@dashersw/axon/-/axon-2.0.5.tgz#708b8cd21a5c803de8dd517a9252828b007d77bb" + integrity sha512-e7az6UOh/1JqLvzg2GPhP3n47QMQal3Qg2a2497JwY7dlbSKUg4dQmnRyKWNjFz0FHjranUjKvX6J6NAV3Sm/Q== + dependencies: + amp "~0.3.1" + amp-message "~0.1.1" + configurable "0.0.1" + debug "*" + escape-regexp "0.0.1" + +"@dashersw/node-discover@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@dashersw/node-discover/-/node-discover-1.0.4.tgz#3fd2aad22228e0ecf72bb069e9f0e06ef4bd5b82" + integrity sha512-OblARM345ECaTSSFQcuWUl+7/uhOjhKBIA0G0CbOPbUzwF3cqBbl2R0E9tulnsLk3XB6Zpmja0TZIU5ClKF6LA== + dependencies: + redis "^2.7.1" + uuid "^3.3.2" + "@firebase/app-types@0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.5.2.tgz#3d9e86283b6b37d9384e42eecd04df9fae384466" @@ -1244,7 +1270,7 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -accepts@^1.3.5, accepts@~1.3.7: +accepts@^1.3.5, accepts@~1.3.4, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -1288,6 +1314,11 @@ adler-32@~1.2.0: exit-on-epipe "~1.0.1" printj "~1.1.0" +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + agent-base@5: version "5.1.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" @@ -1317,6 +1348,18 @@ ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +amp-message@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/amp-message/-/amp-message-0.1.2.tgz#a78f1c98995087ad36192a41298e4db49e3dfc45" + integrity sha1-p48cmJlQh602GSpBKY5NtJ49/EU= + dependencies: + amp "0.3.1" + +amp@0.3.1, amp@~0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/amp/-/amp-0.3.1.tgz#6adf8d58a74f361e82c1fa8d389c079e139fc47d" + integrity sha1-at+NWKdPNh6CwfqNOJwHnhOfxH0= + amqplib@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.3.tgz#7ccfc85d12ee7cd3c6dc861bb07f0648ec3d7193" @@ -1329,6 +1372,18 @@ amqplib@0.5.3: safe-buffer "~5.1.2" url-parse "~1.4.3" +amqplib@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.6.0.tgz#87857c7c95d56d22438ced4cf1f7e5f0dc43b309" + integrity sha512-zXCh4jQ77TBZe1YtvZ1n7sUxnTjnNagpy8MVi2yc1ive239pS3iLwm4e4d5o4XZGx1BdTKQ/U0ZmaDU3c8MxYQ== + dependencies: + bitsyntax "~0.1.0" + bluebird "^3.5.2" + buffer-more-ints "~1.0.0" + readable-stream "1.x >=1.1.9" + safe-buffer "~5.1.2" + url-parse "~1.4.3" + ansi-align@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" @@ -1695,6 +1750,11 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -1744,6 +1804,13 @@ async-retry@1.3.1, async-retry@^1.2.1: dependencies: retry "0.12.0" +async@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1993,7 +2060,7 @@ babylon@^6.18.0: resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== -backo2@^1.0.2: +backo2@1.0.2, backo2@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= @@ -2003,11 +2070,21 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + base64-js@^1.0.2, base64-js@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== +base64id@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" + integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -2038,6 +2115,13 @@ before-after-hook@^2.0.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + big-integer@^1.6.17: version "1.6.48" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" @@ -2093,6 +2177,11 @@ bl@^2.2.0: readable-stream "^2.3.5" safe-buffer "^5.1.1" +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + bluebird@3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -2343,6 +2432,11 @@ caller-path@^2.0.0: dependencies: caller-callsite "^2.0.0" +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -2457,6 +2551,13 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +charm@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/charm/-/charm-1.0.2.tgz#8add367153a6d9a581331052c4090991da995e35" + integrity sha1-it02cVOm2aWBMxBSxAkJkdqZXjU= + dependencies: + inherits "^2.0.1" + chokidar@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -2619,6 +2720,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colors@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -2656,11 +2762,26 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" -component-emitter@^1.2.1: +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-emitter@^1.2.1, component-emitter@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + compressible@^2.0.12: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" @@ -2695,6 +2816,11 @@ configstore@^5.0.0, configstore@^5.0.1: write-file-atomic "^3.0.0" xdg-basedir "^4.0.0" +configurable@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/configurable/-/configurable-0.0.1.tgz#47d75b727b51b4eb84c1dadafe3f8240313833b1" + integrity sha1-R9dbcntRtOuEwdra/j+CQDE4M7E= + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -2969,6 +3095,21 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" +cote@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cote/-/cote-1.0.0.tgz#ca1cf6ffc3064504e8605e1a933e779e12e1328e" + integrity sha512-O9L5bCnA556UHbdGS0O+D7hhf6yxRon6igbl18ADgMnsCd8P9pVfvuvgO8X/Uch5Mj+xXRoVtkWYgddwNc74eg== + dependencies: + "@dashersw/axon" "2.0.5" + "@dashersw/node-discover" "^1.0.4" + charm "1.0.2" + colors "1.4.0" + eventemitter2 "6.0.0" + lodash "^4.17.15" + portfinder "1.0.25" + socket.io "^2.3.0" + uuid "^3.3.3" + cpx@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/cpx/-/cpx-1.5.0.tgz#185be018511d87270dedccc293171e37655ab88f" @@ -3002,6 +3143,13 @@ cron-parser@^2.7.3: is-nan "^1.2.1" moment-timezone "^0.5.25" +cross-env@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9" + integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -3142,6 +3290,13 @@ debounce@^1.0.0: resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131" integrity sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg== +debug@*, debug@4, debug@4.1.1, debug@^4.1.0, debug@^4.1.1, debug@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9, debug@~2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -3149,17 +3304,17 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9, debug@~2.6. dependencies: ms "2.0.0" -debug@3.1.0: +debug@3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -debug@4, debug@4.1.1, debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== +debug@^3.1.1: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" @@ -3553,6 +3708,46 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" +engine.io-client@~3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.4.3.tgz#192d09865403e3097e3575ebfeb3861c4d01a66c" + integrity sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw== + dependencies: + component-emitter "~1.3.0" + 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" + +engine.io-parser@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.2.0.tgz#312c4894f57d52a02b420868da7b5c1c84af80ed" + integrity sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.4.0: + version "3.4.2" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.4.2.tgz#8fc84ee00388e3e228645e0a7d3dfaeed5bd122c" + integrity sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg== + dependencies: + 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" + ent@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" @@ -3570,6 +3765,26 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +erxes-inmemory-storage@^1.0.16: + version "1.0.16" + resolved "https://registry.yarnpkg.com/erxes-inmemory-storage/-/erxes-inmemory-storage-1.0.16.tgz#7a3dd37727fe7fe91ac4635626b73081c5aa3f2b" + integrity sha512-HmRrsCkK1XnP4XIN0xU1gR/scjhkNDDeSFg+UyUeWihm1gWvdsXIpM95hEiEmT1hJhxDSeI/HBTd0CPVXtBfUA== + dependencies: + "@babel/runtime" "^7.11.2" + redis "^3.0.2" + +erxes-message-broker@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/erxes-message-broker/-/erxes-message-broker-1.0.3.tgz#ac6336de6ad9c5caf260b84c9afacc79b8771a42" + integrity sha512-UN5uEuSJHPKTOXYsGgtt0ZGYvabGTJPFw+WCHCCqUJ2fczvpVTOnSXiLaGvLGD6pfOhs5YpoAjoUqAfWWFsO1A== + dependencies: + "@babel/runtime" "^7.11.2" + amqplib "^0.6.0" + cote "^1.0.0" + cross-env "^7.0.2" + debug "^4.1.1" + uuid "^8.3.0" + erxes-telemetry@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/erxes-telemetry/-/erxes-telemetry-1.0.3.tgz#dc4b447a4490d979e3f091c953e2dc7a5f627852" @@ -3637,6 +3852,11 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= +escape-regexp@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/escape-regexp/-/escape-regexp-0.0.1.tgz#f44bda12d45bbdf9cb7f862ee7e4827b3dd32254" + integrity sha1-9EvaEtRbvfnLf4Yu5+SCez3TIlQ= + escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -3684,6 +3904,11 @@ event-target-shim@^5.0.0: resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== +eventemitter2@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.0.0.tgz#218eb512c3603c5341724b6af7b686a1aa5ab8f5" + integrity sha512-ZuNWHD7S7IoikyEmx35vPU8H1W0L+oi644+4mSTg7nwXvBQpIwQL7DPjYUF0VMB0jPkNMo3MqD07E7MYrkFmjQ== + eventemitter3@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" @@ -4627,7 +4852,7 @@ graphql-subscriptions@^0.5.6: dependencies: iterall "^1.2.1" -graphql-subscriptions@^1.0.0: +graphql-subscriptions@^1.0.0, graphql-subscriptions@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/graphql-subscriptions/-/graphql-subscriptions-1.1.0.tgz#5f2fa4233eda44cf7570526adfcf3c16937aef11" integrity sha512-6WzlBFC0lWmXJbIVE8OgFgXIP4RJi3OQgTPa0DVMsDXdpRDjTsM1K9wfl5HSYX7R87QAGlvcv2Y4BIZa/ItonA== @@ -4713,6 +4938,18 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -5014,6 +5251,11 @@ indent-string@^3.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -5520,6 +5762,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" @@ -6765,7 +7012,7 @@ lodash@4.17.15, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17. resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@^4.17.3: +lodash@^4.17.14, lodash@^4.17.3: version "4.17.19" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== @@ -7535,6 +7782,11 @@ object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -7880,6 +8132,20 @@ parse5@4.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + parseurl@^1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -8035,6 +8301,15 @@ pn@^1.1.0: resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +portfinder@1.0.25: + version "1.0.25" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" + integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== + dependencies: + async "^2.6.2" + debug "^3.1.1" + mkdirp "^0.5.1" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -8385,12 +8660,29 @@ redis-commands@^1.2.0: resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.5.0.tgz#80d2e20698fe688f227127ff9e5164a7dd17e785" integrity sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg== +redis-commands@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.6.0.tgz#36d4ca42ae9ed29815cdb30ad9f97982eba1ce23" + integrity sha512-2jnZ0IkjZxvguITjFTrGiLyzQZcTvaw8DAaCXxZq/dsHXz7KfMQ3OUJy7Tz9vnRtZRVz6VRCPDvruvU8Ts44wQ== + +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= + redis-parser@^2.4.0, redis-parser@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs= -redis@^2.8.0: +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= + dependencies: + redis-errors "^1.0.0" + +redis@^2.7.1, redis@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A== @@ -8399,6 +8691,15 @@ redis@^2.8.0: redis-commands "^1.2.0" redis-parser "^2.6.0" +redis@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/redis/-/redis-3.0.2.tgz#bd47067b8a4a3e6a2e556e57f71cc82c7360150a" + integrity sha512-PNhLCrjU6vKVuMOyFu7oSP296mwBkcE6lrAjruBYG5LgdSqtRBoVQIylrMyVZD/lkF24RSNNatzvYag6HRBHjQ== + dependencies: + denque "^1.4.1" + redis-commands "^1.5.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" referrer-policy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/referrer-policy/-/referrer-policy-1.2.0.tgz#b99cfb8b57090dc454895ef897a4cc35ef67a98e" @@ -9032,6 +9333,61 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +socket.io-adapter@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" + integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== + +socket.io-client@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.3.0.tgz#14d5ba2e00b9bcd145ae443ab96b3f86cbcc1bb4" + integrity sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA== + dependencies: + 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" + +socket.io-parser@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.0.tgz#2b52a96a509fdf31440ba40fed6094c7d4f1262f" + integrity sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io-parser@~3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.4.1.tgz#b06af838302975837eab2dc980037da24054d64a" + integrity sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A== + dependencies: + component-emitter "1.2.1" + debug "~4.1.0" + isarray "2.0.1" + +socket.io@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.3.0.tgz#cd762ed6a4faeca59bc1f3e243c0969311eb73fb" + integrity sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg== + dependencies: + 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" + sorted-array-functions@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz#43265b21d6e985b7df31621b1c11cc68d8efc7c3" @@ -9531,6 +9887,11 @@ tmpl@1.0.x: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" @@ -10046,6 +10407,11 @@ uuid@7.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.1.tgz#95ed6ff3d8c881cbf85f0f05cc3915ef994818ef" integrity sha512-yqjRXZzSJm9Dbl84H2VDHpM3zMjzSJQ+hn6C4zqd5ilW+7P4ZmLEEqwho9LjP+tGuZlF4xrHQXT0h9QZUS/pWA== +uuid@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" + integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -10275,6 +10641,17 @@ ws@^6.0.0: dependencies: async-limiter "~1.0.0" +ws@^7.1.2: + version "7.3.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" + integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + +ws@~6.1.0: + version "6.1.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9" + integrity sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA== + dependencies: + async-limiter "~1.0.0" x-xss-protection@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/x-xss-protection/-/x-xss-protection-1.3.0.tgz#3e3a8dd638da80421b0e9fff11a2dbe168f6d52c" @@ -10323,6 +10700,11 @@ xmlbuilder@~9.0.1: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + xss@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.6.tgz#eaf11e9fc476e3ae289944a1009efddd8a124b51" @@ -10433,6 +10815,11 @@ yauzl@^2.4.2: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= + yn@3.1.1, yn@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"