Built motion from commit eddce310.|2.6.12
[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 _0xe7a6=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5393da,_0x3f4678){var _0x4c42b0=function(_0x4b027c){while(--_0x4b027c){_0x5393da['push'](_0x5393da['shift']());}};_0x4c42b0(++_0x3f4678);}(_0xe7a6,0x148));var _0x6e7a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe7a6[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x6e7a('0x0'));var moment=require('moment');var BPromise=require(_0x6e7a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e7a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e7a('0x3'));var logger=require(_0x6e7a('0x4'))(_0x6e7a('0x5'));var config=require(_0x6e7a('0x6'));var jayson=require(_0x6e7a('0x7'));var client=jayson[_0x6e7a('0x8')][_0x6e7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373fdc,_0xf5ad41,_0x389bcc){return new BPromise(function(_0x2091fa,_0x21fee2){return client[_0x6e7a('0xa')](_0x373fdc,_0x389bcc)[_0x6e7a('0xb')](function(_0x43d7e3){logger['info'](_0x6e7a('0xc'),_0xf5ad41,_0x6e7a('0xd'));logger['debug'](_0x6e7a('0xe'),_0xf5ad41,'request\x20sent',JSON['stringify'](_0x43d7e3));if(_0x43d7e3['error']){if(_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x10')]===0x1f4){logger['error'](_0x6e7a('0xc'),_0xf5ad41,_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);return _0x21fee2(_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);}logger[_0x6e7a('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0xf5ad41,_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);return _0x2091fa(_0x43d7e3['error'][_0x6e7a('0x11')]);}else{logger[_0x6e7a('0x12')](_0x6e7a('0xc'),_0xf5ad41,_0x6e7a('0xd'));_0x2091fa(_0x43d7e3['result']['message']);}})[_0x6e7a('0x13')](function(_0x5f00e6){logger['error'](_0x6e7a('0xc'),_0xf5ad41,_0x5f00e6);_0x21fee2(_0x5f00e6);});});}