Built motion from commit 10af8726.|2.6.34
[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 _0x3b4d=['bluebird','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x3b4d,0x66));var _0xd3b4=function(_0x563614,_0x12187a){_0x563614=_0x563614-0x0;var _0x3f9c3a=_0x3b4d[_0x563614];return _0x3f9c3a;};'use strict';var _=require(_0xd3b4('0x0'));var util=require(_0xd3b4('0x1'));var moment=require(_0xd3b4('0x2'));var BPromise=require(_0xd3b4('0x3'));var rs=require(_0xd3b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd3b4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd3b4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3b4('0x7')][_0xd3b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a6afb,_0x55c637,_0x502850){return new BPromise(function(_0x527953,_0x11ccb3){return client[_0xd3b4('0x9')](_0x2a6afb,_0x502850)[_0xd3b4('0xa')](function(_0x26b13b){logger[_0xd3b4('0xb')](_0xd3b4('0xc'),_0x55c637,'request\x20sent');logger['debug'](_0xd3b4('0xd'),_0x55c637,_0xd3b4('0xe'),JSON[_0xd3b4('0xf')](_0x26b13b));if(_0x26b13b[_0xd3b4('0x10')]){if(_0x26b13b['error'][_0xd3b4('0x11')]===0x1f4){logger['error'](_0xd3b4('0xc'),_0x55c637,_0x26b13b['error'][_0xd3b4('0x12')]);return _0x11ccb3(_0x26b13b[_0xd3b4('0x10')][_0xd3b4('0x12')]);}logger[_0xd3b4('0x10')](_0xd3b4('0xc'),_0x55c637,_0x26b13b[_0xd3b4('0x10')][_0xd3b4('0x12')]);return _0x527953(_0x26b13b[_0xd3b4('0x10')][_0xd3b4('0x12')]);}else{logger['info'](_0xd3b4('0xc'),_0x55c637,'request\x20sent');_0x527953(_0x26b13b[_0xd3b4('0x13')][_0xd3b4('0x12')]);}})[_0xd3b4('0x14')](function(_0x4542ec){logger[_0xd3b4('0x10')](_0xd3b4('0xc'),_0x55c637,_0x4542ec);_0x11ccb3(_0x4542ec);});});}