Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / cloudProvider / cloudProvider.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 _0x28e3=['jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x129de,_0x4348ec){var _0x187733=function(_0x3f2bef){while(--_0x3f2bef){_0x129de['push'](_0x129de['shift']());}};_0x187733(++_0x4348ec);}(_0x28e3,0xc0));var _0x328e=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x28e3[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require('moment');var BPromise=require(_0x328e('0x2'));var rs=require(_0x328e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x328e('0x4'));var logger=require(_0x328e('0x5'))(_0x328e('0x6'));var config=require(_0x328e('0x7'));var jayson=require(_0x328e('0x8'));var client=jayson['client'][_0x328e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502083,_0x4852b6,_0x5b3029){return new BPromise(function(_0x43853,_0x4f3196){return client[_0x328e('0xa')](_0x502083,_0x5b3029)[_0x328e('0xb')](function(_0x5b7bf4){logger['info'](_0x328e('0xc'),_0x4852b6,_0x328e('0xd'));logger['debug'](_0x328e('0xe'),_0x4852b6,_0x328e('0xd'),JSON[_0x328e('0xf')](_0x5b7bf4));if(_0x5b7bf4[_0x328e('0x10')]){if(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x11')]===0x1f4){logger[_0x328e('0x10')](_0x328e('0xc'),_0x4852b6,_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);return _0x4f3196(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);}logger[_0x328e('0x10')]('CloudProvider,\x20%s,\x20%s',_0x4852b6,_0x5b7bf4[_0x328e('0x10')]['message']);return _0x43853(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);}else{logger['info'](_0x328e('0xc'),_0x4852b6,_0x328e('0xd'));_0x43853(_0x5b7bf4['result'][_0x328e('0x12')]);}})[_0x328e('0x13')](function(_0x350d23){logger[_0x328e('0x10')](_0x328e('0xc'),_0x4852b6,_0x350d23);_0x4f3196(_0x350d23);});});}