Built motion from commit (unavailable).|2.3.1
[motion2.git] / server / api / tag / tag.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xace2=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s'];(function(_0x5cd7a3,_0x1aa14f){var _0x21235d=function(_0x3152a9){while(--_0x3152a9){_0x5cd7a3['push'](_0x5cd7a3['shift']());}};_0x21235d(++_0x1aa14f);}(_0xace2,0x1a5));var _0x2ace=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0xace2[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0x2ace('0x0'));var util=require(_0x2ace('0x1'));var moment=require(_0x2ace('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ace('0x3'));var fs=require('fs');var Redis=require(_0x2ace('0x4'));var db=require(_0x2ace('0x5'))['db'];var utils=require(_0x2ace('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2ace('0x7'));var client=jayson[_0x2ace('0x8')][_0x2ace('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd911c4,_0x3b4b11,_0xcdd648){return new BPromise(function(_0xc102dd,_0xa9847e){return client[_0x2ace('0xa')](_0xd911c4,_0xcdd648)[_0x2ace('0xb')](function(_0x571d04){logger[_0x2ace('0xc')]('Tag,\x20%s,\x20%s',_0x3b4b11,_0x2ace('0xd'));logger['debug'](_0x2ace('0xe'),_0x3b4b11,_0x2ace('0xd'),JSON[_0x2ace('0xf')](_0x571d04));if(_0x571d04[_0x2ace('0x10')]){if(_0x571d04[_0x2ace('0x10')][_0x2ace('0x11')]===0x1f4){logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);return _0xa9847e(_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);}logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);return _0xc102dd(_0x571d04[_0x2ace('0x10')]['message']);}else{logger[_0x2ace('0xc')](_0x2ace('0x12'),_0x3b4b11,_0x2ace('0xd'));_0xc102dd(_0x571d04[_0x2ace('0x14')]['message']);}})[_0x2ace('0x15')](function(_0x5e7b1a){logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x5e7b1a);_0xa9847e(_0x5e7b1a);});});}