Built motion from commit 52c8a02d.|2.6.29
[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 _0xe73c=['request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xe73c,0x131));var _0xce73=function(_0x1a51e2,_0x2ad3ba){_0x1a51e2=_0x1a51e2-0x0;var _0x20b93c=_0xe73c[_0x1a51e2];return _0x20b93c;};'use strict';var _=require('lodash');var util=require(_0xce73('0x0'));var moment=require(_0xce73('0x1'));var BPromise=require(_0xce73('0x2'));var rs=require(_0xce73('0x3'));var fs=require('fs');var Redis=require(_0xce73('0x4'));var db=require(_0xce73('0x5'))['db'];var utils=require(_0xce73('0x6'));var logger=require('../../config/logger')(_0xce73('0x7'));var config=require(_0xce73('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce73('0x9')][_0xce73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f9eba,_0x47b399,_0x5b9730){return new BPromise(function(_0x53ab65,_0x366d6f){return client[_0xce73('0xb')](_0x1f9eba,_0x5b9730)[_0xce73('0xc')](function(_0x5558f0){logger[_0xce73('0xd')](_0xce73('0xe'),_0x47b399,'request\x20sent');logger[_0xce73('0xf')](_0xce73('0x10'),_0x47b399,_0xce73('0x11'),JSON['stringify'](_0x5558f0));if(_0x5558f0[_0xce73('0x12')]){if(_0x5558f0[_0xce73('0x12')][_0xce73('0x13')]===0x1f4){logger[_0xce73('0x12')](_0xce73('0xe'),_0x47b399,_0x5558f0['error'][_0xce73('0x14')]);return _0x366d6f(_0x5558f0[_0xce73('0x12')]['message']);}logger['error'](_0xce73('0xe'),_0x47b399,_0x5558f0['error'][_0xce73('0x14')]);return _0x53ab65(_0x5558f0[_0xce73('0x12')][_0xce73('0x14')]);}else{logger[_0xce73('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x47b399,_0xce73('0x11'));_0x53ab65(_0x5558f0[_0xce73('0x15')]['message']);}})[_0xce73('0x16')](function(_0x414cd4){logger[_0xce73('0x12')](_0xce73('0xe'),_0x47b399,_0x414cd4);_0x366d6f(_0x414cd4);});});}