Built motion from commit 97153652.|2.6.26
[motion2.git] / server / api / cmContactHasItem / cmContactHasItem.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 _0xceaa=['http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0xceaa,0x19b));var _0xacea=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xceaa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xacea('0x0'));var util=require('util');var moment=require(_0xacea('0x1'));var BPromise=require(_0xacea('0x2'));var rs=require(_0xacea('0x3'));var fs=require('fs');var Redis=require(_0xacea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacea('0x5'))(_0xacea('0x6'));var config=require(_0xacea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacea('0x8')][_0xacea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1579bb,_0x13dd63,_0xb3dd48){return new BPromise(function(_0x513917,_0x4a7eb2){return client[_0xacea('0xa')](_0x1579bb,_0xb3dd48)[_0xacea('0xb')](function(_0x415ea9){logger[_0xacea('0xc')](_0xacea('0xd'),_0x13dd63,_0xacea('0xe'));logger[_0xacea('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x13dd63,'request\x20sent',JSON[_0xacea('0x10')](_0x415ea9));if(_0x415ea9[_0xacea('0x11')]){if(_0x415ea9['error']['code']===0x1f4){logger['error'](_0xacea('0xd'),_0x13dd63,_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);return _0x4a7eb2(_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x13dd63,_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);return _0x513917(_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);}else{logger[_0xacea('0xc')](_0xacea('0xd'),_0x13dd63,_0xacea('0xe'));_0x513917(_0x415ea9[_0xacea('0x13')][_0xacea('0x12')]);}})['catch'](function(_0xd1efeb){logger[_0xacea('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x13dd63,_0xd1efeb);_0x4a7eb2(_0xd1efeb);});});}