2db0d40a3002bfd8305c893097ef1fea4e8a1d8c
[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 _0x62af=['../../config/environment','jayson/promise','http','request','then','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x62af,0x113));var _0xf62a=function(_0x3e1ffb,_0x16d000){_0x3e1ffb=_0x3e1ffb-0x0;var _0x4a28c6=_0x62af[_0x3e1ffb];return _0x4a28c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf62a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf62a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf62a('0x2'));var logger=require(_0xf62a('0x3'))(_0xf62a('0x4'));var config=require(_0xf62a('0x5'));var jayson=require(_0xf62a('0x6'));var client=jayson['client'][_0xf62a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c6348,_0xf4eef7,_0x15b647){return new BPromise(function(_0x33428a,_0x28273f){return client[_0xf62a('0x8')](_0x5c6348,_0x15b647)[_0xf62a('0x9')](function(_0x4155a7){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0xf4eef7,_0xf62a('0xa'));logger['debug'](_0xf62a('0xb'),_0xf4eef7,_0xf62a('0xa'),JSON[_0xf62a('0xc')](_0x4155a7));if(_0x4155a7[_0xf62a('0xd')]){if(_0x4155a7[_0xf62a('0xd')][_0xf62a('0xe')]===0x1f4){logger[_0xf62a('0xd')](_0xf62a('0xf'),_0xf4eef7,_0x4155a7[_0xf62a('0xd')]['message']);return _0x28273f(_0x4155a7[_0xf62a('0xd')][_0xf62a('0x10')]);}logger[_0xf62a('0xd')](_0xf62a('0xf'),_0xf4eef7,_0x4155a7['error'][_0xf62a('0x10')]);return _0x33428a(_0x4155a7[_0xf62a('0xd')][_0xf62a('0x10')]);}else{logger[_0xf62a('0x11')](_0xf62a('0xf'),_0xf4eef7,'request\x20sent');_0x33428a(_0x4155a7[_0xf62a('0x12')]['message']);}})[_0xf62a('0x13')](function(_0x43d972){logger['error'](_0xf62a('0xf'),_0xf4eef7,_0x43d972);_0x28273f(_0x43d972);});});}