c476c66949fa62c7a754a0ada992bc8bcf5d6343
[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 _0x19bf=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b3588,_0x29c633){var _0x244b40=function(_0x19eaa3){while(--_0x19eaa3){_0x4b3588['push'](_0x4b3588['shift']());}};_0x244b40(++_0x29c633);}(_0x19bf,0x18f));var _0xf19b=function(_0x3af17f,_0x379478){_0x3af17f=_0x3af17f-0x0;var _0x53ed80=_0x19bf[_0x3af17f];return _0x53ed80;};'use strict';var _=require(_0xf19b('0x0'));var util=require(_0xf19b('0x1'));var moment=require(_0xf19b('0x2'));var BPromise=require(_0xf19b('0x3'));var rs=require(_0xf19b('0x4'));var fs=require('fs');var Redis=require(_0xf19b('0x5'));var db=require(_0xf19b('0x6'))['db'];var utils=require(_0xf19b('0x7'));var logger=require(_0xf19b('0x8'))(_0xf19b('0x9'));var config=require(_0xf19b('0xa'));var jayson=require(_0xf19b('0xb'));var client=jayson[_0xf19b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbf1918,_0x26c966,_0x5a849b){return new BPromise(function(_0x2bba54,_0x438600){return client[_0xf19b('0xd')](_0xbf1918,_0x5a849b)['then'](function(_0x4ee4b1){logger[_0xf19b('0xe')](_0xf19b('0xf'),_0x26c966,'request\x20sent');logger[_0xf19b('0x10')](_0xf19b('0x11'),_0x26c966,'request\x20sent',JSON['stringify'](_0x4ee4b1));if(_0x4ee4b1[_0xf19b('0x12')]){if(_0x4ee4b1['error'][_0xf19b('0x13')]===0x1f4){logger[_0xf19b('0x12')]('ContactItemType,\x20%s,\x20%s',_0x26c966,_0x4ee4b1['error']['message']);return _0x438600(_0x4ee4b1['error'][_0xf19b('0x14')]);}logger[_0xf19b('0x12')]('ContactItemType,\x20%s,\x20%s',_0x26c966,_0x4ee4b1[_0xf19b('0x12')][_0xf19b('0x14')]);return _0x2bba54(_0x4ee4b1[_0xf19b('0x12')][_0xf19b('0x14')]);}else{logger[_0xf19b('0xe')](_0xf19b('0xf'),_0x26c966,'request\x20sent');_0x2bba54(_0x4ee4b1[_0xf19b('0x15')][_0xf19b('0x14')]);}})['catch'](function(_0x3b4f26){logger[_0xf19b('0x12')]('ContactItemType,\x20%s,\x20%s',_0x26c966,_0x3b4f26);_0x438600(_0x3b4f26);});});}