Built motion from commit da24aabd.|2.6.20
[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 _0x5be7=['../../config/environment','jayson/promise','http','then','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','CmContactHasItem,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd0dff3,_0x13fd28){var _0x3852aa=function(_0x46ed21){while(--_0x46ed21){_0xd0dff3['push'](_0xd0dff3['shift']());}};_0x3852aa(++_0x13fd28);}(_0x5be7,0xdd));var _0x75be=function(_0xbb824c,_0x32aeea){_0xbb824c=_0xbb824c-0x0;var _0x2b5d4c=_0x5be7[_0xbb824c];return _0x2b5d4c;};'use strict';var _=require(_0x75be('0x0'));var util=require(_0x75be('0x1'));var moment=require(_0x75be('0x2'));var BPromise=require(_0x75be('0x3'));var rs=require(_0x75be('0x4'));var fs=require('fs');var Redis=require(_0x75be('0x5'));var db=require(_0x75be('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x75be('0x7'));var jayson=require(_0x75be('0x8'));var client=jayson['client'][_0x75be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b803a,_0x44f331,_0x11b6f0){return new BPromise(function(_0x57d8fb,_0x1a5f9f){return client['request'](_0x4b803a,_0x11b6f0)[_0x75be('0xa')](function(_0xad5215){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x44f331,_0x75be('0xb'));logger[_0x75be('0xc')](_0x75be('0xd'),_0x44f331,'request\x20sent',JSON[_0x75be('0xe')](_0xad5215));if(_0xad5215[_0x75be('0xf')]){if(_0xad5215[_0x75be('0xf')]['code']===0x1f4){logger[_0x75be('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x44f331,_0xad5215[_0x75be('0xf')][_0x75be('0x10')]);return _0x1a5f9f(_0xad5215[_0x75be('0xf')][_0x75be('0x10')]);}logger['error'](_0x75be('0x11'),_0x44f331,_0xad5215[_0x75be('0xf')][_0x75be('0x10')]);return _0x57d8fb(_0xad5215[_0x75be('0xf')]['message']);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x44f331,_0x75be('0xb'));_0x57d8fb(_0xad5215['result'][_0x75be('0x10')]);}})[_0x75be('0x12')](function(_0x435ead){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x44f331,_0x435ead);_0x1a5f9f(_0x435ead);});});}