Built motion from commit (unavailable).|2.5.14
[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 _0xe14f=['info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x4a1066,_0x4f349d){var _0x40fbc5=function(_0x4f68e6){while(--_0x4f68e6){_0x4a1066['push'](_0x4a1066['shift']());}};_0x40fbc5(++_0x4f349d);}(_0xe14f,0xcb));var _0xfe14=function(_0x42a360,_0x205a2c){_0x42a360=_0x42a360-0x0;var _0x54270c=_0xe14f[_0x42a360];return _0x54270c;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var moment=require(_0xfe14('0x2'));var BPromise=require(_0xfe14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe14('0x4'));var db=require(_0xfe14('0x5'))['db'];var utils=require(_0xfe14('0x6'));var logger=require('../../config/logger')(_0xfe14('0x7'));var config=require(_0xfe14('0x8'));var jayson=require(_0xfe14('0x9'));var client=jayson[_0xfe14('0xa')][_0xfe14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x569f26,_0x29c7bd,_0x1ed83a){return new BPromise(function(_0x313932,_0x11db1c){return client['request'](_0x569f26,_0x1ed83a)[_0xfe14('0xc')](function(_0x1671d2){logger[_0xfe14('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x29c7bd,_0xfe14('0xe'));logger[_0xfe14('0xf')](_0xfe14('0x10'),_0x29c7bd,_0xfe14('0xe'),JSON[_0xfe14('0x11')](_0x1671d2));if(_0x1671d2[_0xfe14('0x12')]){if(_0x1671d2[_0xfe14('0x12')][_0xfe14('0x13')]===0x1f4){logger[_0xfe14('0x12')](_0xfe14('0x14'),_0x29c7bd,_0x1671d2[_0xfe14('0x12')][_0xfe14('0x15')]);return _0x11db1c(_0x1671d2[_0xfe14('0x12')][_0xfe14('0x15')]);}logger[_0xfe14('0x12')](_0xfe14('0x14'),_0x29c7bd,_0x1671d2[_0xfe14('0x12')][_0xfe14('0x15')]);return _0x313932(_0x1671d2['error'][_0xfe14('0x15')]);}else{logger[_0xfe14('0xd')](_0xfe14('0x14'),_0x29c7bd,_0xfe14('0xe'));_0x313932(_0x1671d2[_0xfe14('0x16')][_0xfe14('0x15')]);}})[_0xfe14('0x17')](function(_0x571ab9){logger[_0xfe14('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x29c7bd,_0x571ab9);_0x11db1c(_0x571ab9);});});}