Built motion from commit da617fac.|2.6.6
[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 _0x7c11=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x29bb41,_0x3ddc89){var _0x5dad92=function(_0x1387c3){while(--_0x1387c3){_0x29bb41['push'](_0x29bb41['shift']());}};_0x5dad92(++_0x3ddc89);}(_0x7c11,0x15c));var _0x17c1=function(_0x47776f,_0x482990){_0x47776f=_0x47776f-0x0;var _0x137f26=_0x7c11[_0x47776f];return _0x137f26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x17c1('0x0'));var BPromise=require(_0x17c1('0x1'));var rs=require(_0x17c1('0x2'));var fs=require('fs');var Redis=require(_0x17c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x17c1('0x4'));var logger=require(_0x17c1('0x5'))(_0x17c1('0x6'));var config=require(_0x17c1('0x7'));var jayson=require(_0x17c1('0x8'));var client=jayson[_0x17c1('0x9')][_0x17c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58b4a2,_0x37aa11,_0x41dc0a){return new BPromise(function(_0x132466,_0x4e5e7e){return client[_0x17c1('0xb')](_0x58b4a2,_0x41dc0a)[_0x17c1('0xc')](function(_0x4d12b3){logger[_0x17c1('0xd')](_0x17c1('0xe'),_0x37aa11,'request\x20sent');logger['debug'](_0x17c1('0xf'),_0x37aa11,_0x17c1('0x10'),JSON[_0x17c1('0x11')](_0x4d12b3));if(_0x4d12b3[_0x17c1('0x12')]){if(_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x13')]===0x1f4){logger['error'](_0x17c1('0xe'),_0x37aa11,_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x14')]);return _0x4e5e7e(_0x4d12b3[_0x17c1('0x12')]['message']);}logger[_0x17c1('0x12')]('License,\x20%s,\x20%s',_0x37aa11,_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x14')]);return _0x132466(_0x4d12b3['error']['message']);}else{logger[_0x17c1('0xd')](_0x17c1('0xe'),_0x37aa11,_0x17c1('0x10'));_0x132466(_0x4d12b3[_0x17c1('0x15')][_0x17c1('0x14')]);}})['catch'](function(_0x1a3a6c){logger[_0x17c1('0x12')](_0x17c1('0xe'),_0x37aa11,_0x1a3a6c);_0x4e5e7e(_0x1a3a6c);});});}