Built motion from commit b5413ace.|2.6.9
[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 _0x5beb=['http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x498e0b,_0xc8e73e){var _0x2306bb=function(_0x422f7d){while(--_0x422f7d){_0x498e0b['push'](_0x498e0b['shift']());}};_0x2306bb(++_0xc8e73e);}(_0x5beb,0xe8));var _0xb5be=function(_0x20697b,_0x32567d){_0x20697b=_0x20697b-0x0;var _0x28e3ff=_0x5beb[_0x20697b];return _0x28e3ff;};'use strict';var _=require('lodash');var util=require(_0xb5be('0x0'));var moment=require('moment');var BPromise=require(_0xb5be('0x1'));var rs=require(_0xb5be('0x2'));var fs=require('fs');var Redis=require(_0xb5be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5be('0x4'));var logger=require(_0xb5be('0x5'))(_0xb5be('0x6'));var config=require(_0xb5be('0x7'));var jayson=require(_0xb5be('0x8'));var client=jayson[_0xb5be('0x9')][_0xb5be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38983e,_0x1e8a34,_0x5059b6){return new BPromise(function(_0x364286,_0x4d7883){return client[_0xb5be('0xb')](_0x38983e,_0x5059b6)[_0xb5be('0xc')](function(_0x42ae4d){logger[_0xb5be('0xd')](_0xb5be('0xe'),_0x1e8a34,_0xb5be('0xf'));logger[_0xb5be('0x10')](_0xb5be('0x11'),_0x1e8a34,_0xb5be('0xf'),JSON['stringify'](_0x42ae4d));if(_0x42ae4d['error']){if(_0x42ae4d[_0xb5be('0x12')][_0xb5be('0x13')]===0x1f4){logger[_0xb5be('0x12')](_0xb5be('0xe'),_0x1e8a34,_0x42ae4d[_0xb5be('0x12')][_0xb5be('0x14')]);return _0x4d7883(_0x42ae4d[_0xb5be('0x12')][_0xb5be('0x14')]);}logger['error'](_0xb5be('0xe'),_0x1e8a34,_0x42ae4d[_0xb5be('0x12')][_0xb5be('0x14')]);return _0x364286(_0x42ae4d[_0xb5be('0x12')]['message']);}else{logger[_0xb5be('0xd')](_0xb5be('0xe'),_0x1e8a34,_0xb5be('0xf'));_0x364286(_0x42ae4d[_0xb5be('0x15')]['message']);}})['catch'](function(_0x431c56){logger[_0xb5be('0x12')](_0xb5be('0xe'),_0x1e8a34,_0x431c56);_0x4d7883(_0x431c56);});});}