Built motion from commit (unavailable).|2.5.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 _0x8b3e=['util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x200c7f,_0x1e43de){var _0x5950c1=function(_0x253d8c){while(--_0x253d8c){_0x200c7f['push'](_0x200c7f['shift']());}};_0x5950c1(++_0x1e43de);}(_0x8b3e,0x68));var _0xe8b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8b3('0x0'));var util=require(_0xe8b3('0x1'));var moment=require('moment');var BPromise=require(_0xe8b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8b3('0x3'));var db=require(_0xe8b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8b3('0x5'))('rpc');var config=require(_0xe8b3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe8b3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21a558,_0x44f807,_0xe72224){return new BPromise(function(_0x260a41,_0x3ec18c){return client[_0xe8b3('0x8')](_0x21a558,_0xe72224)[_0xe8b3('0x9')](function(_0x244390){logger[_0xe8b3('0xa')](_0xe8b3('0xb'),_0x44f807,_0xe8b3('0xc'));logger[_0xe8b3('0xd')](_0xe8b3('0xe'),_0x44f807,_0xe8b3('0xc'),JSON[_0xe8b3('0xf')](_0x244390));if(_0x244390[_0xe8b3('0x10')]){if(_0x244390['error'][_0xe8b3('0x11')]===0x1f4){logger[_0xe8b3('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x44f807,_0x244390[_0xe8b3('0x10')][_0xe8b3('0x12')]);return _0x3ec18c(_0x244390[_0xe8b3('0x10')]['message']);}logger[_0xe8b3('0x10')](_0xe8b3('0xb'),_0x44f807,_0x244390['error']['message']);return _0x260a41(_0x244390[_0xe8b3('0x10')][_0xe8b3('0x12')]);}else{logger[_0xe8b3('0xa')]('JscriptyProject,\x20%s,\x20%s',_0x44f807,'request\x20sent');_0x260a41(_0x244390[_0xe8b3('0x13')][_0xe8b3('0x12')]);}})[_0xe8b3('0x14')](function(_0x21a53e){logger[_0xe8b3('0x10')](_0xe8b3('0xb'),_0x44f807,_0x21a53e);_0x3ec18c(_0x21a53e);});});}