Built motion from commit fe909640.|2.6.8
[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 _0xae17=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x45c9d2,_0x96b578){var _0x2c317b=function(_0x1ff3d2){while(--_0x1ff3d2){_0x45c9d2['push'](_0x45c9d2['shift']());}};_0x2c317b(++_0x96b578);}(_0xae17,0x1a5));var _0x7ae1=function(_0x2f32bf,_0x2e9ddd){_0x2f32bf=_0x2f32bf-0x0;var _0x2afeff=_0xae17[_0x2f32bf];return _0x2afeff;};'use strict';var _=require(_0x7ae1('0x0'));var util=require('util');var moment=require(_0x7ae1('0x1'));var BPromise=require(_0x7ae1('0x2'));var rs=require(_0x7ae1('0x3'));var fs=require('fs');var Redis=require(_0x7ae1('0x4'));var db=require(_0x7ae1('0x5'))['db'];var utils=require(_0x7ae1('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ae1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c456a,_0x20af1c,_0x5a2c7b){return new BPromise(function(_0x583602,_0x1a4c80){return client[_0x7ae1('0x8')](_0x5c456a,_0x5a2c7b)[_0x7ae1('0x9')](function(_0x34c37c){logger[_0x7ae1('0xa')](_0x7ae1('0xb'),_0x20af1c,_0x7ae1('0xc'));logger[_0x7ae1('0xd')](_0x7ae1('0xe'),_0x20af1c,_0x7ae1('0xc'),JSON[_0x7ae1('0xf')](_0x34c37c));if(_0x34c37c[_0x7ae1('0x10')]){if(_0x34c37c[_0x7ae1('0x10')]['code']===0x1f4){logger['error'](_0x7ae1('0xb'),_0x20af1c,_0x34c37c[_0x7ae1('0x10')]['message']);return _0x1a4c80(_0x34c37c[_0x7ae1('0x10')]['message']);}logger[_0x7ae1('0x10')](_0x7ae1('0xb'),_0x20af1c,_0x34c37c[_0x7ae1('0x10')][_0x7ae1('0x11')]);return _0x583602(_0x34c37c[_0x7ae1('0x10')][_0x7ae1('0x11')]);}else{logger['info'](_0x7ae1('0xb'),_0x20af1c,_0x7ae1('0xc'));_0x583602(_0x34c37c[_0x7ae1('0x12')]['message']);}})[_0x7ae1('0x13')](function(_0x120656){logger[_0x7ae1('0x10')]('License,\x20%s,\x20%s',_0x20af1c,_0x120656);_0x1a4c80(_0x120656);});});}