Built motion from commit 21186556.|2.6.19
[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 _0x0a1e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','catch','lodash','util','bluebird','ioredis'];(function(_0x59a8a1,_0x5122fc){var _0x1dec66=function(_0x31b3dd){while(--_0x31b3dd){_0x59a8a1['push'](_0x59a8a1['shift']());}};_0x1dec66(++_0x5122fc);}(_0x0a1e,0x1a0));var _0xe0a1=function(_0x2a8f81,_0x156b6c){_0x2a8f81=_0x2a8f81-0x0;var _0x2ec2f0=_0x0a1e[_0x2a8f81];return _0x2ec2f0;};'use strict';var _=require(_0xe0a1('0x0'));var util=require(_0xe0a1('0x1'));var moment=require('moment');var BPromise=require(_0xe0a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0a1('0x3'));var db=require(_0xe0a1('0x4'))['db'];var utils=require(_0xe0a1('0x5'));var logger=require(_0xe0a1('0x6'))(_0xe0a1('0x7'));var config=require(_0xe0a1('0x8'));var jayson=require(_0xe0a1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x509f73,_0x4395d6,_0x460577){return new BPromise(function(_0x4c77b9,_0x4a207b){return client[_0xe0a1('0xa')](_0x509f73,_0x460577)['then'](function(_0x14015b){logger[_0xe0a1('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x4395d6,_0xe0a1('0xc'));logger[_0xe0a1('0xd')](_0xe0a1('0xe'),_0x4395d6,_0xe0a1('0xc'),JSON[_0xe0a1('0xf')](_0x14015b));if(_0x14015b['error']){if(_0x14015b[_0xe0a1('0x10')][_0xe0a1('0x11')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4395d6,_0x14015b[_0xe0a1('0x10')][_0xe0a1('0x12')]);return _0x4a207b(_0x14015b[_0xe0a1('0x10')][_0xe0a1('0x12')]);}logger['error'](_0xe0a1('0x13'),_0x4395d6,_0x14015b[_0xe0a1('0x10')][_0xe0a1('0x12')]);return _0x4c77b9(_0x14015b['error'][_0xe0a1('0x12')]);}else{logger[_0xe0a1('0xb')](_0xe0a1('0x13'),_0x4395d6,_0xe0a1('0xc'));_0x4c77b9(_0x14015b['result'][_0xe0a1('0x12')]);}})[_0xe0a1('0x14')](function(_0x4d130b){logger['error'](_0xe0a1('0x13'),_0x4395d6,_0x4d130b);_0x4a207b(_0x4d130b);});});}