a4a213b3515557b5273d07245b97ade3e22e452d
[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 _0xe74a=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x115f75,_0x3e6b57){var _0x4e509a=function(_0x3acd7a){while(--_0x3acd7a){_0x115f75['push'](_0x115f75['shift']());}};_0x4e509a(++_0x3e6b57);}(_0xe74a,0x127));var _0xae74=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xe74a[_0x39a2d6];return _0x23af66;};'use strict';var _=require(_0xae74('0x0'));var util=require(_0xae74('0x1'));var moment=require('moment');var BPromise=require(_0xae74('0x2'));var rs=require(_0xae74('0x3'));var fs=require('fs');var Redis=require(_0xae74('0x4'));var db=require(_0xae74('0x5'))['db'];var utils=require(_0xae74('0x6'));var logger=require('../../config/logger')(_0xae74('0x7'));var config=require('../../config/environment');var jayson=require(_0xae74('0x8'));var client=jayson[_0xae74('0x9')][_0xae74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e19e6,_0x2dc15e,_0x122b87){return new BPromise(function(_0x13cc22,_0x458bf7){return client[_0xae74('0xb')](_0x1e19e6,_0x122b87)[_0xae74('0xc')](function(_0x6edd7b){logger[_0xae74('0xd')](_0xae74('0xe'),_0x2dc15e,_0xae74('0xf'));logger['debug'](_0xae74('0x10'),_0x2dc15e,_0xae74('0xf'),JSON[_0xae74('0x11')](_0x6edd7b));if(_0x6edd7b['error']){if(_0x6edd7b[_0xae74('0x12')][_0xae74('0x13')]===0x1f4){logger[_0xae74('0x12')](_0xae74('0xe'),_0x2dc15e,_0x6edd7b['error'][_0xae74('0x14')]);return _0x458bf7(_0x6edd7b[_0xae74('0x12')][_0xae74('0x14')]);}logger['error'](_0xae74('0xe'),_0x2dc15e,_0x6edd7b[_0xae74('0x12')][_0xae74('0x14')]);return _0x13cc22(_0x6edd7b[_0xae74('0x12')][_0xae74('0x14')]);}else{logger[_0xae74('0xd')](_0xae74('0xe'),_0x2dc15e,_0xae74('0xf'));_0x13cc22(_0x6edd7b[_0xae74('0x15')]['message']);}})[_0xae74('0x16')](function(_0x148a02){logger['error'](_0xae74('0xe'),_0x2dc15e,_0x148a02);_0x458bf7(_0x148a02);});});}