Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / contactItemType / contactItemType.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 _0xac90=['http','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x25c0a2,_0xd39bfa){var _0xc1ef1b=function(_0x58df76){while(--_0x58df76){_0x25c0a2['push'](_0x25c0a2['shift']());}};_0xc1ef1b(++_0xd39bfa);}(_0xac90,0x1b0));var _0x0ac9=function(_0x4aa5e1,_0x3f584e){_0x4aa5e1=_0x4aa5e1-0x0;var _0x5a6e9c=_0xac90[_0x4aa5e1];return _0x5a6e9c;};'use strict';var _=require(_0x0ac9('0x0'));var util=require(_0x0ac9('0x1'));var moment=require(_0x0ac9('0x2'));var BPromise=require(_0x0ac9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ac9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ac9('0x5'));var logger=require('../../config/logger')(_0x0ac9('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ac9('0x7'));var client=jayson[_0x0ac9('0x8')][_0x0ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c5b14,_0x241a9f,_0x3fb169){return new BPromise(function(_0x2c304c,_0x438e34){return client['request'](_0x1c5b14,_0x3fb169)[_0x0ac9('0xa')](function(_0x52ebbe){logger[_0x0ac9('0xb')]('ContactItemType,\x20%s,\x20%s',_0x241a9f,_0x0ac9('0xc'));logger[_0x0ac9('0xd')](_0x0ac9('0xe'),_0x241a9f,'request\x20sent',JSON[_0x0ac9('0xf')](_0x52ebbe));if(_0x52ebbe[_0x0ac9('0x10')]){if(_0x52ebbe[_0x0ac9('0x10')][_0x0ac9('0x11')]===0x1f4){logger[_0x0ac9('0x10')](_0x0ac9('0x12'),_0x241a9f,_0x52ebbe[_0x0ac9('0x10')]['message']);return _0x438e34(_0x52ebbe[_0x0ac9('0x10')][_0x0ac9('0x13')]);}logger[_0x0ac9('0x10')]('ContactItemType,\x20%s,\x20%s',_0x241a9f,_0x52ebbe[_0x0ac9('0x10')]['message']);return _0x2c304c(_0x52ebbe[_0x0ac9('0x10')][_0x0ac9('0x13')]);}else{logger['info'](_0x0ac9('0x12'),_0x241a9f,_0x0ac9('0xc'));_0x2c304c(_0x52ebbe[_0x0ac9('0x14')][_0x0ac9('0x13')]);}})['catch'](function(_0x4fd038){logger['error'](_0x0ac9('0x12'),_0x241a9f,_0x4fd038);_0x438e34(_0x4fd038);});});}