Built motion from commit (unavailable).|2.4.4
[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 _0x84ae=['stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dce9f,_0x1d1880){var _0x1cd454=function(_0x2a909c){while(--_0x2a909c){_0x2dce9f['push'](_0x2dce9f['shift']());}};_0x1cd454(++_0x1d1880);}(_0x84ae,0x118));var _0xe84a=function(_0x332ce2,_0x57c600){_0x332ce2=_0x332ce2-0x0;var _0x11bf58=_0x84ae[_0x332ce2];return _0x11bf58;};'use strict';var _=require(_0xe84a('0x0'));var util=require('util');var moment=require(_0xe84a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe84a('0x2'));var fs=require('fs');var Redis=require(_0xe84a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe84a('0x4'));var logger=require(_0xe84a('0x5'))(_0xe84a('0x6'));var config=require('../../config/environment');var jayson=require(_0xe84a('0x7'));var client=jayson[_0xe84a('0x8')][_0xe84a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x455b4c,_0x26657f,_0x4e9818){return new BPromise(function(_0x48c3e5,_0x225d4d){return client['request'](_0x455b4c,_0x4e9818)[_0xe84a('0xa')](function(_0x4fd78c){logger['info'](_0xe84a('0xb'),_0x26657f,_0xe84a('0xc'));logger[_0xe84a('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x26657f,_0xe84a('0xc'),JSON[_0xe84a('0xe')](_0x4fd78c));if(_0x4fd78c[_0xe84a('0xf')]){if(_0x4fd78c[_0xe84a('0xf')][_0xe84a('0x10')]===0x1f4){logger[_0xe84a('0xf')](_0xe84a('0xb'),_0x26657f,_0x4fd78c[_0xe84a('0xf')]['message']);return _0x225d4d(_0x4fd78c[_0xe84a('0xf')][_0xe84a('0x11')]);}logger['error'](_0xe84a('0xb'),_0x26657f,_0x4fd78c['error'][_0xe84a('0x11')]);return _0x48c3e5(_0x4fd78c[_0xe84a('0xf')][_0xe84a('0x11')]);}else{logger[_0xe84a('0x12')](_0xe84a('0xb'),_0x26657f,_0xe84a('0xc'));_0x48c3e5(_0x4fd78c[_0xe84a('0x13')][_0xe84a('0x11')]);}})[_0xe84a('0x14')](function(_0x339f4c){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x26657f,_0x339f4c);_0x225d4d(_0x339f4c);});});}