Built motion from commit f7863d46.|2.5.41
[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 _0x9396=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then'];(function(_0x3c3213,_0x5d1f67){var _0x302f15=function(_0x335867){while(--_0x335867){_0x3c3213['push'](_0x3c3213['shift']());}};_0x302f15(++_0x5d1f67);}(_0x9396,0x8d));var _0x6939=function(_0x5c9ddf,_0x202e38){_0x5c9ddf=_0x5c9ddf-0x0;var _0x392b84=_0x9396[_0x5c9ddf];return _0x392b84;};'use strict';var _=require(_0x6939('0x0'));var util=require(_0x6939('0x1'));var moment=require('moment');var BPromise=require(_0x6939('0x2'));var rs=require(_0x6939('0x3'));var fs=require('fs');var Redis=require(_0x6939('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6939('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6939('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6939('0x7')][_0x6939('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4af7a8,_0x3a6303,_0x5f55f9){return new BPromise(function(_0x2eb9ef,_0x442606){return client[_0x6939('0x9')](_0x4af7a8,_0x5f55f9)[_0x6939('0xa')](function(_0x1adbc3){logger['info'](_0x6939('0xb'),_0x3a6303,_0x6939('0xc'));logger[_0x6939('0xd')](_0x6939('0xe'),_0x3a6303,'request\x20sent',JSON[_0x6939('0xf')](_0x1adbc3));if(_0x1adbc3[_0x6939('0x10')]){if(_0x1adbc3[_0x6939('0x10')][_0x6939('0x11')]===0x1f4){logger[_0x6939('0x10')](_0x6939('0xb'),_0x3a6303,_0x1adbc3[_0x6939('0x10')][_0x6939('0x12')]);return _0x442606(_0x1adbc3[_0x6939('0x10')][_0x6939('0x12')]);}logger[_0x6939('0x10')](_0x6939('0xb'),_0x3a6303,_0x1adbc3[_0x6939('0x10')][_0x6939('0x12')]);return _0x2eb9ef(_0x1adbc3[_0x6939('0x10')]['message']);}else{logger['info'](_0x6939('0xb'),_0x3a6303,'request\x20sent');_0x2eb9ef(_0x1adbc3['result']['message']);}})['catch'](function(_0x5397bf){logger[_0x6939('0x10')](_0x6939('0xb'),_0x3a6303,_0x5397bf);_0x442606(_0x5397bf);});});}