cf500569070c432b38e82c4f428b35af7aa92e93
[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 _0x40c6=['ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x21ca00,_0x2d9f28){var _0x43f543=function(_0x20b6a6){while(--_0x20b6a6){_0x21ca00['push'](_0x21ca00['shift']());}};_0x43f543(++_0x2d9f28);}(_0x40c6,0x8f));var _0x640c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x40c6[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x640c('0x0'));var util=require(_0x640c('0x1'));var moment=require(_0x640c('0x2'));var BPromise=require('bluebird');var rs=require(_0x640c('0x3'));var fs=require('fs');var Redis=require(_0x640c('0x4'));var db=require(_0x640c('0x5'))['db'];var utils=require(_0x640c('0x6'));var logger=require('../../config/logger')(_0x640c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x640c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bcdc6,_0xe3f013,_0x1f6ca5){return new BPromise(function(_0x586582,_0x5baa44){return client[_0x640c('0x9')](_0x5bcdc6,_0x1f6ca5)[_0x640c('0xa')](function(_0x39bd10){logger[_0x640c('0xb')](_0x640c('0xc'),_0xe3f013,'request\x20sent');logger[_0x640c('0xd')](_0x640c('0xe'),_0xe3f013,_0x640c('0xf'),JSON[_0x640c('0x10')](_0x39bd10));if(_0x39bd10[_0x640c('0x11')]){if(_0x39bd10[_0x640c('0x11')][_0x640c('0x12')]===0x1f4){logger[_0x640c('0x11')](_0x640c('0xc'),_0xe3f013,_0x39bd10['error'][_0x640c('0x13')]);return _0x5baa44(_0x39bd10[_0x640c('0x11')][_0x640c('0x13')]);}logger['error'](_0x640c('0xc'),_0xe3f013,_0x39bd10['error'][_0x640c('0x13')]);return _0x586582(_0x39bd10[_0x640c('0x11')][_0x640c('0x13')]);}else{logger[_0x640c('0xb')](_0x640c('0xc'),_0xe3f013,_0x640c('0xf'));_0x586582(_0x39bd10['result'][_0x640c('0x13')]);}})[_0x640c('0x14')](function(_0x27fb04){logger[_0x640c('0x11')](_0x640c('0xc'),_0xe3f013,_0x27fb04);_0x5baa44(_0x27fb04);});});}