Built motion from commit 6362bb75.|2.6.13
[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 _0xbc7d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xbc7d,0x153));var _0xdbc7=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xbc7d[_0xce9195];return _0x530fe6;};'use strict';var _=require(_0xdbc7('0x0'));var util=require(_0xdbc7('0x1'));var moment=require('moment');var BPromise=require(_0xdbc7('0x2'));var rs=require(_0xdbc7('0x3'));var fs=require('fs');var Redis=require(_0xdbc7('0x4'));var db=require(_0xdbc7('0x5'))['db'];var utils=require(_0xdbc7('0x6'));var logger=require(_0xdbc7('0x7'))(_0xdbc7('0x8'));var config=require(_0xdbc7('0x9'));var jayson=require(_0xdbc7('0xa'));var client=jayson['client'][_0xdbc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x428fd3,_0x24d0ba,_0x4365c2){return new BPromise(function(_0x319a9a,_0x170c8d){return client[_0xdbc7('0xc')](_0x428fd3,_0x4365c2)[_0xdbc7('0xd')](function(_0x500e80){logger[_0xdbc7('0xe')]('License,\x20%s,\x20%s',_0x24d0ba,'request\x20sent');logger[_0xdbc7('0xf')](_0xdbc7('0x10'),_0x24d0ba,'request\x20sent',JSON[_0xdbc7('0x11')](_0x500e80));if(_0x500e80[_0xdbc7('0x12')]){if(_0x500e80[_0xdbc7('0x12')]['code']===0x1f4){logger['error'](_0xdbc7('0x13'),_0x24d0ba,_0x500e80[_0xdbc7('0x12')][_0xdbc7('0x14')]);return _0x170c8d(_0x500e80[_0xdbc7('0x12')][_0xdbc7('0x14')]);}logger[_0xdbc7('0x12')](_0xdbc7('0x13'),_0x24d0ba,_0x500e80[_0xdbc7('0x12')]['message']);return _0x319a9a(_0x500e80[_0xdbc7('0x12')][_0xdbc7('0x14')]);}else{logger[_0xdbc7('0xe')](_0xdbc7('0x13'),_0x24d0ba,_0xdbc7('0x15'));_0x319a9a(_0x500e80[_0xdbc7('0x16')][_0xdbc7('0x14')]);}})['catch'](function(_0x53aee0){logger[_0xdbc7('0x12')]('License,\x20%s,\x20%s',_0x24d0ba,_0x53aee0);_0x170c8d(_0x53aee0);});});}