42c73477c13949ec5914dfb0845feeb4765fedbc
[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 _0x31fb=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x31fb,0x105));var _0xb31f=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x31fb[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var moment=require(_0xb31f('0x2'));var BPromise=require(_0xb31f('0x3'));var rs=require(_0xb31f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb31f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb31f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb31f('0x7')][_0xb31f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11d99e,_0x2b4b41,_0x55312d){return new BPromise(function(_0x30696b,_0x372da0){return client[_0xb31f('0x9')](_0x11d99e,_0x55312d)[_0xb31f('0xa')](function(_0x46424e){logger[_0xb31f('0xb')](_0xb31f('0xc'),_0x2b4b41,'request\x20sent');logger[_0xb31f('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2b4b41,_0xb31f('0xe'),JSON['stringify'](_0x46424e));if(_0x46424e[_0xb31f('0xf')]){if(_0x46424e[_0xb31f('0xf')][_0xb31f('0x10')]===0x1f4){logger[_0xb31f('0xf')](_0xb31f('0xc'),_0x2b4b41,_0x46424e[_0xb31f('0xf')]['message']);return _0x372da0(_0x46424e['error'][_0xb31f('0x11')]);}logger[_0xb31f('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x2b4b41,_0x46424e['error'][_0xb31f('0x11')]);return _0x30696b(_0x46424e[_0xb31f('0xf')][_0xb31f('0x11')]);}else{logger['info'](_0xb31f('0xc'),_0x2b4b41,_0xb31f('0xe'));_0x30696b(_0x46424e[_0xb31f('0x12')][_0xb31f('0x11')]);}})[_0xb31f('0x13')](function(_0x1282dd){logger[_0xb31f('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x2b4b41,_0x1282dd);_0x372da0(_0x1282dd);});});}