Built motion from commit (unavailable).|2.5.30
[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 _0x604b=['JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1653bf,_0x43083b){var _0xe57166=function(_0x2cc1f0){while(--_0x2cc1f0){_0x1653bf['push'](_0x1653bf['shift']());}};_0xe57166(++_0x43083b);}(_0x604b,0xa2));var _0xb604=function(_0x4ffdf1,_0x317116){_0x4ffdf1=_0x4ffdf1-0x0;var _0x409b43=_0x604b[_0x4ffdf1];return _0x409b43;};'use strict';var _=require(_0xb604('0x0'));var util=require(_0xb604('0x1'));var moment=require(_0xb604('0x2'));var BPromise=require('bluebird');var rs=require(_0xb604('0x3'));var fs=require('fs');var Redis=require(_0xb604('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb604('0x5'));var logger=require(_0xb604('0x6'))(_0xb604('0x7'));var config=require('../../config/environment');var jayson=require(_0xb604('0x8'));var client=jayson[_0xb604('0x9')][_0xb604('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43d042,_0x360556,_0x3ac14b){return new BPromise(function(_0xb80fce,_0x293935){return client[_0xb604('0xb')](_0x43d042,_0x3ac14b)[_0xb604('0xc')](function(_0x4383d0){logger[_0xb604('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x360556,'request\x20sent');logger['debug'](_0xb604('0xe'),_0x360556,_0xb604('0xf'),JSON['stringify'](_0x4383d0));if(_0x4383d0[_0xb604('0x10')]){if(_0x4383d0[_0xb604('0x10')][_0xb604('0x11')]===0x1f4){logger[_0xb604('0x10')](_0xb604('0x12'),_0x360556,_0x4383d0[_0xb604('0x10')]['message']);return _0x293935(_0x4383d0[_0xb604('0x10')][_0xb604('0x13')]);}logger[_0xb604('0x10')](_0xb604('0x12'),_0x360556,_0x4383d0[_0xb604('0x10')][_0xb604('0x13')]);return _0xb80fce(_0x4383d0[_0xb604('0x10')][_0xb604('0x13')]);}else{logger['info'](_0xb604('0x12'),_0x360556,'request\x20sent');_0xb80fce(_0x4383d0[_0xb604('0x14')][_0xb604('0x13')]);}})[_0xb604('0x15')](function(_0x2ba6d4){logger[_0xb604('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x360556,_0x2ba6d4);_0x293935(_0x2ba6d4);});});}