Built motion from commit 639a1a7f.|2.6.19
[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 _0x790a=['then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x357e45,_0x362fe5){var _0x4d5d2a=function(_0x3bf67a){while(--_0x3bf67a){_0x357e45['push'](_0x357e45['shift']());}};_0x4d5d2a(++_0x362fe5);}(_0x790a,0xab));var _0xa790=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x790a[_0x53bcc3];return _0x47c959;};'use strict';var _=require('lodash');var util=require(_0xa790('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa790('0x1'));var fs=require('fs');var Redis=require(_0xa790('0x2'));var db=require(_0xa790('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa790('0x4'))('rpc');var config=require(_0xa790('0x5'));var jayson=require(_0xa790('0x6'));var client=jayson['client'][_0xa790('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54a942,_0x2f1f02,_0x5144ad){return new BPromise(function(_0x24a8fa,_0x4eb694){return client[_0xa790('0x8')](_0x54a942,_0x5144ad)[_0xa790('0x9')](function(_0x4e76d3){logger[_0xa790('0xa')](_0xa790('0xb'),_0x2f1f02,_0xa790('0xc'));logger[_0xa790('0xd')](_0xa790('0xe'),_0x2f1f02,_0xa790('0xc'),JSON[_0xa790('0xf')](_0x4e76d3));if(_0x4e76d3[_0xa790('0x10')]){if(_0x4e76d3[_0xa790('0x10')]['code']===0x1f4){logger[_0xa790('0x10')](_0xa790('0xb'),_0x2f1f02,_0x4e76d3['error'][_0xa790('0x11')]);return _0x4eb694(_0x4e76d3[_0xa790('0x10')][_0xa790('0x11')]);}logger[_0xa790('0x10')](_0xa790('0xb'),_0x2f1f02,_0x4e76d3['error'][_0xa790('0x11')]);return _0x24a8fa(_0x4e76d3[_0xa790('0x10')][_0xa790('0x11')]);}else{logger[_0xa790('0xa')](_0xa790('0xb'),_0x2f1f02,_0xa790('0xc'));_0x24a8fa(_0x4e76d3[_0xa790('0x12')]['message']);}})[_0xa790('0x13')](function(_0x1fffff){logger[_0xa790('0x10')](_0xa790('0xb'),_0x2f1f02,_0x1fffff);_0x4eb694(_0x1fffff);});});}