ed9446d16d2d6ef97c51fff91cbf2eb92f37b7f4
[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 _0x743e=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info'];(function(_0xb59e60,_0x5dd8ca){var _0x43cc41=function(_0x2d7979){while(--_0x2d7979){_0xb59e60['push'](_0xb59e60['shift']());}};_0x43cc41(++_0x5dd8ca);}(_0x743e,0x1c1));var _0xe743=function(_0x2614bc,_0x4ef1ec){_0x2614bc=_0x2614bc-0x0;var _0x5a1655=_0x743e[_0x2614bc];return _0x5a1655;};'use strict';var _=require(_0xe743('0x0'));var util=require(_0xe743('0x1'));var moment=require(_0xe743('0x2'));var BPromise=require(_0xe743('0x3'));var rs=require(_0xe743('0x4'));var fs=require('fs');var Redis=require(_0xe743('0x5'));var db=require(_0xe743('0x6'))['db'];var utils=require(_0xe743('0x7'));var logger=require('../../config/logger')(_0xe743('0x8'));var config=require('../../config/environment');var jayson=require(_0xe743('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32dfa7,_0x16ac68,_0x56eaf6){return new BPromise(function(_0x45363e,_0x4b1cf0){return client[_0xe743('0xa')](_0x32dfa7,_0x56eaf6)[_0xe743('0xb')](function(_0x5a9469){logger[_0xe743('0xc')](_0xe743('0xd'),_0x16ac68,_0xe743('0xe'));logger[_0xe743('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x16ac68,_0xe743('0xe'),JSON[_0xe743('0x10')](_0x5a9469));if(_0x5a9469[_0xe743('0x11')]){if(_0x5a9469['error'][_0xe743('0x12')]===0x1f4){logger[_0xe743('0x11')](_0xe743('0xd'),_0x16ac68,_0x5a9469['error']['message']);return _0x4b1cf0(_0x5a9469[_0xe743('0x11')]['message']);}logger[_0xe743('0x11')](_0xe743('0xd'),_0x16ac68,_0x5a9469[_0xe743('0x11')]['message']);return _0x45363e(_0x5a9469[_0xe743('0x11')][_0xe743('0x13')]);}else{logger[_0xe743('0xc')](_0xe743('0xd'),_0x16ac68,_0xe743('0xe'));_0x45363e(_0x5a9469[_0xe743('0x14')][_0xe743('0x13')]);}})[_0xe743('0x15')](function(_0x532170){logger[_0xe743('0x11')](_0xe743('0xd'),_0x16ac68,_0x532170);_0x4b1cf0(_0x532170);});});}