e0340f2a6b01a9332d4b05da24d9fb05b84174da
[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 _0x8b83=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x32e81c,_0x75897){var _0x186401=function(_0x215c77){while(--_0x215c77){_0x32e81c['push'](_0x32e81c['shift']());}};_0x186401(++_0x75897);}(_0x8b83,0x8b));var _0x38b8=function(_0x21e4c2,_0x3f3199){_0x21e4c2=_0x21e4c2-0x0;var _0x1760d=_0x8b83[_0x21e4c2];return _0x1760d;};'use strict';var _=require(_0x38b8('0x0'));var util=require(_0x38b8('0x1'));var moment=require(_0x38b8('0x2'));var BPromise=require(_0x38b8('0x3'));var rs=require(_0x38b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38b8('0x5'))['db'];var utils=require(_0x38b8('0x6'));var logger=require('../../config/logger')(_0x38b8('0x7'));var config=require(_0x38b8('0x8'));var jayson=require(_0x38b8('0x9'));var client=jayson[_0x38b8('0xa')][_0x38b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c965,_0x187f4d,_0x436085){return new BPromise(function(_0x1ee507,_0xf04831){return client['request'](_0x42c965,_0x436085)[_0x38b8('0xc')](function(_0x35088e){logger['info'](_0x38b8('0xd'),_0x187f4d,'request\x20sent');logger['debug'](_0x38b8('0xe'),_0x187f4d,_0x38b8('0xf'),JSON[_0x38b8('0x10')](_0x35088e));if(_0x35088e[_0x38b8('0x11')]){if(_0x35088e[_0x38b8('0x11')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x35088e[_0x38b8('0x11')]['message']);return _0xf04831(_0x35088e['error'][_0x38b8('0x12')]);}logger[_0x38b8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x35088e[_0x38b8('0x11')][_0x38b8('0x12')]);return _0x1ee507(_0x35088e[_0x38b8('0x11')]['message']);}else{logger['info'](_0x38b8('0xd'),_0x187f4d,_0x38b8('0xf'));_0x1ee507(_0x35088e[_0x38b8('0x13')][_0x38b8('0x12')]);}})['catch'](function(_0x1f693f){logger[_0x38b8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x1f693f);_0xf04831(_0x1f693f);});});}