b9900b060fe5e4f415203e4388db9228072b579d
[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 _0x5d21=['../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51e106,_0xeb96b3){var _0x20a315=function(_0x694a50){while(--_0x694a50){_0x51e106['push'](_0x51e106['shift']());}};_0x20a315(++_0xeb96b3);}(_0x5d21,0x178));var _0x15d2=function(_0x4ee0cc,_0x2aef4c){_0x4ee0cc=_0x4ee0cc-0x0;var _0x41398e=_0x5d21[_0x4ee0cc];return _0x41398e;};'use strict';var _=require(_0x15d2('0x0'));var util=require(_0x15d2('0x1'));var moment=require('moment');var BPromise=require(_0x15d2('0x2'));var rs=require(_0x15d2('0x3'));var fs=require('fs');var Redis=require(_0x15d2('0x4'));var db=require(_0x15d2('0x5'))['db'];var utils=require(_0x15d2('0x6'));var logger=require(_0x15d2('0x7'))('rpc');var config=require(_0x15d2('0x8'));var jayson=require(_0x15d2('0x9'));var client=jayson['client'][_0x15d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3f45,_0x2134cf,_0x45b15d){return new BPromise(function(_0x3f4edc,_0x24a286){return client[_0x15d2('0xb')](_0x3c3f45,_0x45b15d)[_0x15d2('0xc')](function(_0x23e563){logger[_0x15d2('0xd')](_0x15d2('0xe'),_0x2134cf,'request\x20sent');logger[_0x15d2('0xf')](_0x15d2('0x10'),_0x2134cf,_0x15d2('0x11'),JSON[_0x15d2('0x12')](_0x23e563));if(_0x23e563['error']){if(_0x23e563[_0x15d2('0x13')][_0x15d2('0x14')]===0x1f4){logger[_0x15d2('0x13')](_0x15d2('0xe'),_0x2134cf,_0x23e563['error']['message']);return _0x24a286(_0x23e563[_0x15d2('0x13')]['message']);}logger[_0x15d2('0x13')]('ContactItemType,\x20%s,\x20%s',_0x2134cf,_0x23e563[_0x15d2('0x13')][_0x15d2('0x15')]);return _0x3f4edc(_0x23e563['error'][_0x15d2('0x15')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x2134cf,'request\x20sent');_0x3f4edc(_0x23e563[_0x15d2('0x16')][_0x15d2('0x15')]);}})[_0x15d2('0x17')](function(_0x371798){logger[_0x15d2('0x13')](_0x15d2('0xe'),_0x2134cf,_0x371798);_0x24a286(_0x371798);});});}