Built motion from commit (unavailable).|2.5.28
[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 _0x3056=['error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x4d6c61,_0x4e4fa7){var _0x25b831=function(_0x47ad11){while(--_0x47ad11){_0x4d6c61['push'](_0x4d6c61['shift']());}};_0x25b831(++_0x4e4fa7);}(_0x3056,0x1d3));var _0x6305=function(_0x125b91,_0x1206d1){_0x125b91=_0x125b91-0x0;var _0x1047b0=_0x3056[_0x125b91];return _0x1047b0;};'use strict';var _=require(_0x6305('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6305('0x1'));var fs=require('fs');var Redis=require(_0x6305('0x2'));var db=require(_0x6305('0x3'))['db'];var utils=require(_0x6305('0x4'));var logger=require(_0x6305('0x5'))(_0x6305('0x6'));var config=require(_0x6305('0x7'));var jayson=require(_0x6305('0x8'));var client=jayson[_0x6305('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7a321,_0x1f2176,_0x93f824){return new BPromise(function(_0x5fb8c5,_0x5f3205){return client[_0x6305('0xa')](_0xa7a321,_0x93f824)[_0x6305('0xb')](function(_0x56f1f2){logger[_0x6305('0xc')](_0x6305('0xd'),_0x1f2176,_0x6305('0xe'));logger['debug'](_0x6305('0xf'),_0x1f2176,_0x6305('0xe'),JSON['stringify'](_0x56f1f2));if(_0x56f1f2['error']){if(_0x56f1f2[_0x6305('0x10')][_0x6305('0x11')]===0x1f4){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x1f2176,_0x56f1f2[_0x6305('0x10')][_0x6305('0x12')]);return _0x5f3205(_0x56f1f2[_0x6305('0x10')][_0x6305('0x12')]);}logger[_0x6305('0x10')](_0x6305('0xd'),_0x1f2176,_0x56f1f2[_0x6305('0x10')][_0x6305('0x12')]);return _0x5fb8c5(_0x56f1f2[_0x6305('0x10')][_0x6305('0x12')]);}else{logger[_0x6305('0xc')](_0x6305('0xd'),_0x1f2176,'request\x20sent');_0x5fb8c5(_0x56f1f2[_0x6305('0x13')][_0x6305('0x12')]);}})[_0x6305('0x14')](function(_0x420c90){logger[_0x6305('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x1f2176,_0x420c90);_0x5f3205(_0x420c90);});});}