Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / license / license.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 _0x3a66=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3a66,0x176));var _0x63a6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3a66[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x63a6('0x0'));var util=require(_0x63a6('0x1'));var moment=require(_0x63a6('0x2'));var BPromise=require(_0x63a6('0x3'));var rs=require(_0x63a6('0x4'));var fs=require('fs');var Redis=require(_0x63a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x63a6('0x6'));var logger=require(_0x63a6('0x7'))(_0x63a6('0x8'));var config=require(_0x63a6('0x9'));var jayson=require(_0x63a6('0xa'));var client=jayson['client'][_0x63a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ae7c,_0x371b0c,_0x49c2a1){return new BPromise(function(_0x3b47b4,_0x384cc0){return client[_0x63a6('0xc')](_0x59ae7c,_0x49c2a1)['then'](function(_0x27113c){logger['info'](_0x63a6('0xd'),_0x371b0c,_0x63a6('0xe'));logger[_0x63a6('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x371b0c,'request\x20sent',JSON['stringify'](_0x27113c));if(_0x27113c[_0x63a6('0x10')]){if(_0x27113c[_0x63a6('0x10')][_0x63a6('0x11')]===0x1f4){logger[_0x63a6('0x10')](_0x63a6('0xd'),_0x371b0c,_0x27113c['error'][_0x63a6('0x12')]);return _0x384cc0(_0x27113c[_0x63a6('0x10')][_0x63a6('0x12')]);}logger[_0x63a6('0x10')]('License,\x20%s,\x20%s',_0x371b0c,_0x27113c[_0x63a6('0x10')]['message']);return _0x3b47b4(_0x27113c[_0x63a6('0x10')][_0x63a6('0x12')]);}else{logger[_0x63a6('0x13')](_0x63a6('0xd'),_0x371b0c,_0x63a6('0xe'));_0x3b47b4(_0x27113c[_0x63a6('0x14')][_0x63a6('0x12')]);}})[_0x63a6('0x15')](function(_0x51a1ae){logger[_0x63a6('0x10')](_0x63a6('0xd'),_0x371b0c,_0x51a1ae);_0x384cc0(_0x51a1ae);});});}