Built motion from commit da617fac.|2.6.6
[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 _0x8a28=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x240156,_0x48d5a0){var _0x50c5ea=function(_0x353f44){while(--_0x353f44){_0x240156['push'](_0x240156['shift']());}};_0x50c5ea(++_0x48d5a0);}(_0x8a28,0xfd));var _0x88a2=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x8a28[_0x32d457];return _0x338386;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb591,_0x1629ea,_0x5406ed){return new BPromise(function(_0x1cdf6b,_0x2a8576){return client[_0x88a2('0xd')](_0x5cb591,_0x5406ed)[_0x88a2('0xe')](function(_0x2db7dd){logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));logger[_0x88a2('0x12')]('Tag,\x20%s,\x20%s,\x20%s',_0x1629ea,'request\x20sent',JSON[_0x88a2('0x13')](_0x2db7dd));if(_0x2db7dd[_0x88a2('0x14')]){if(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x15')]===0x1f4){logger[_0x88a2('0x14')]('Tag,\x20%s,\x20%s',_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x2a8576(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);}logger['error'](_0x88a2('0x10'),_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x1cdf6b(_0x2db7dd['error'][_0x88a2('0x16')]);}else{logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));_0x1cdf6b(_0x2db7dd[_0x88a2('0x17')][_0x88a2('0x16')]);}})[_0x88a2('0x18')](function(_0x2f5220){logger[_0x88a2('0x14')](_0x88a2('0x10'),_0x1629ea,_0x2f5220);_0x2a8576(_0x2f5220);});});}