Built motion from commit (unavailable).|2.4.18
[motion2.git] / server / api / jscriptyProject / jscriptyProject.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 _0x176a=['info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0xb81471,_0x7ef001){var _0x20a710=function(_0x1399cc){while(--_0x1399cc){_0xb81471['push'](_0xb81471['shift']());}};_0x20a710(++_0x7ef001);}(_0x176a,0x11e));var _0xa176=function(_0x43f99b,_0x7e2d77){_0x43f99b=_0x43f99b-0x0;var _0x33ad92=_0x176a[_0x43f99b];return _0x33ad92;};'use strict';var _=require(_0xa176('0x0'));var util=require('util');var moment=require(_0xa176('0x1'));var BPromise=require(_0xa176('0x2'));var rs=require(_0xa176('0x3'));var fs=require('fs');var Redis=require(_0xa176('0x4'));var db=require(_0xa176('0x5'))['db'];var utils=require(_0xa176('0x6'));var logger=require(_0xa176('0x7'))(_0xa176('0x8'));var config=require('../../config/environment');var jayson=require(_0xa176('0x9'));var client=jayson['client'][_0xa176('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47ca36,_0x4bb0bf,_0x339df1){return new BPromise(function(_0x558894,_0x21b10c){return client[_0xa176('0xb')](_0x47ca36,_0x339df1)[_0xa176('0xc')](function(_0x51ff30){logger[_0xa176('0xd')](_0xa176('0xe'),_0x4bb0bf,_0xa176('0xf'));logger[_0xa176('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x4bb0bf,_0xa176('0xf'),JSON[_0xa176('0x11')](_0x51ff30));if(_0x51ff30[_0xa176('0x12')]){if(_0x51ff30[_0xa176('0x12')][_0xa176('0x13')]===0x1f4){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4bb0bf,_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);return _0x21b10c(_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4bb0bf,_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);return _0x558894(_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);}else{logger[_0xa176('0xd')](_0xa176('0xe'),_0x4bb0bf,_0xa176('0xf'));_0x558894(_0x51ff30[_0xa176('0x15')][_0xa176('0x14')]);}})[_0xa176('0x16')](function(_0x4feec0){logger[_0xa176('0x12')](_0xa176('0xe'),_0x4bb0bf,_0x4feec0);_0x21b10c(_0x4feec0);});});}