Built motion from commit (unavailable).|2.4.21
[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 _0x925e=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x51ba50,_0x56625e){var _0x3eda8a=function(_0x4fafec){while(--_0x4fafec){_0x51ba50['push'](_0x51ba50['shift']());}};_0x3eda8a(++_0x56625e);}(_0x925e,0x67));var _0xe925=function(_0x1ef2cf,_0x12eafd){_0x1ef2cf=_0x1ef2cf-0x0;var _0x24ba77=_0x925e[_0x1ef2cf];return _0x24ba77;};'use strict';var _=require(_0xe925('0x0'));var util=require(_0xe925('0x1'));var moment=require(_0xe925('0x2'));var BPromise=require(_0xe925('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe925('0x4'))['db'];var utils=require(_0xe925('0x5'));var logger=require('../../config/logger')(_0xe925('0x6'));var config=require(_0xe925('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe925('0x8')][_0xe925('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dbccf,_0x19b2a0,_0x13d6e9){return new BPromise(function(_0x5b2033,_0x184ad5){return client['request'](_0x4dbccf,_0x13d6e9)[_0xe925('0xa')](function(_0x55e276){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x19b2a0,_0xe925('0xb'));logger[_0xe925('0xc')](_0xe925('0xd'),_0x19b2a0,_0xe925('0xb'),JSON[_0xe925('0xe')](_0x55e276));if(_0x55e276['error']){if(_0x55e276[_0xe925('0xf')][_0xe925('0x10')]===0x1f4){logger[_0xe925('0xf')](_0xe925('0x11'),_0x19b2a0,_0x55e276[_0xe925('0xf')][_0xe925('0x12')]);return _0x184ad5(_0x55e276[_0xe925('0xf')][_0xe925('0x12')]);}logger[_0xe925('0xf')](_0xe925('0x11'),_0x19b2a0,_0x55e276[_0xe925('0xf')][_0xe925('0x12')]);return _0x5b2033(_0x55e276[_0xe925('0xf')][_0xe925('0x12')]);}else{logger['info'](_0xe925('0x11'),_0x19b2a0,_0xe925('0xb'));_0x5b2033(_0x55e276[_0xe925('0x13')][_0xe925('0x12')]);}})[_0xe925('0x14')](function(_0x14dec5){logger[_0xe925('0xf')](_0xe925('0x11'),_0x19b2a0,_0x14dec5);_0x184ad5(_0x14dec5);});});}