83bbc646a4767554cea1d5064d7babcaef28d5c3
[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 _0xbfb8=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x32b55c,_0x59c161){var _0x412eba=function(_0x15895f){while(--_0x15895f){_0x32b55c['push'](_0x32b55c['shift']());}};_0x412eba(++_0x59c161);}(_0xbfb8,0xb9));var _0x8bfb=function(_0x2ca442,_0x36fd70){_0x2ca442=_0x2ca442-0x0;var _0x25a426=_0xbfb8[_0x2ca442];return _0x25a426;};'use strict';var _=require(_0x8bfb('0x0'));var util=require('util');var moment=require(_0x8bfb('0x1'));var BPromise=require(_0x8bfb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bfb('0x3'));var db=require(_0x8bfb('0x4'))['db'];var utils=require(_0x8bfb('0x5'));var logger=require(_0x8bfb('0x6'))(_0x8bfb('0x7'));var config=require(_0x8bfb('0x8'));var jayson=require(_0x8bfb('0x9'));var client=jayson[_0x8bfb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6da363,_0x1cff0b,_0x47bd0d){return new BPromise(function(_0x18a38a,_0x28fcb4){return client[_0x8bfb('0xb')](_0x6da363,_0x47bd0d)[_0x8bfb('0xc')](function(_0x259717){logger[_0x8bfb('0xd')](_0x8bfb('0xe'),_0x1cff0b,_0x8bfb('0xf'));logger[_0x8bfb('0x10')](_0x8bfb('0x11'),_0x1cff0b,_0x8bfb('0xf'),JSON[_0x8bfb('0x12')](_0x259717));if(_0x259717[_0x8bfb('0x13')]){if(_0x259717['error']['code']===0x1f4){logger[_0x8bfb('0x13')](_0x8bfb('0xe'),_0x1cff0b,_0x259717[_0x8bfb('0x13')][_0x8bfb('0x14')]);return _0x28fcb4(_0x259717[_0x8bfb('0x13')]['message']);}logger[_0x8bfb('0x13')](_0x8bfb('0xe'),_0x1cff0b,_0x259717[_0x8bfb('0x13')][_0x8bfb('0x14')]);return _0x18a38a(_0x259717[_0x8bfb('0x13')][_0x8bfb('0x14')]);}else{logger[_0x8bfb('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x1cff0b,_0x8bfb('0xf'));_0x18a38a(_0x259717[_0x8bfb('0x15')]['message']);}})[_0x8bfb('0x16')](function(_0x53aabd){logger[_0x8bfb('0x13')](_0x8bfb('0xe'),_0x1cff0b,_0x53aabd);_0x28fcb4(_0x53aabd);});});}