Built motion from commit (unavailable).|2.5.25
[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 _0x9780=['request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x9780,0x1d4));var _0x0978=function(_0x5acfde,_0x3596d4){_0x5acfde=_0x5acfde-0x0;var _0x123d61=_0x9780[_0x5acfde];return _0x123d61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0978('0x0'));var BPromise=require(_0x0978('0x1'));var rs=require(_0x0978('0x2'));var fs=require('fs');var Redis=require(_0x0978('0x3'));var db=require(_0x0978('0x4'))['db'];var utils=require(_0x0978('0x5'));var logger=require(_0x0978('0x6'))(_0x0978('0x7'));var config=require(_0x0978('0x8'));var jayson=require(_0x0978('0x9'));var client=jayson[_0x0978('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x422038,_0xdb9e6c,_0x3e4d16){return new BPromise(function(_0xefd03b,_0x34fe92){return client[_0x0978('0xb')](_0x422038,_0x3e4d16)[_0x0978('0xc')](function(_0x34081e){logger[_0x0978('0xd')](_0x0978('0xe'),_0xdb9e6c,_0x0978('0xf'));logger['debug'](_0x0978('0x10'),_0xdb9e6c,'request\x20sent',JSON[_0x0978('0x11')](_0x34081e));if(_0x34081e[_0x0978('0x12')]){if(_0x34081e[_0x0978('0x12')][_0x0978('0x13')]===0x1f4){logger['error'](_0x0978('0xe'),_0xdb9e6c,_0x34081e['error'][_0x0978('0x14')]);return _0x34fe92(_0x34081e[_0x0978('0x12')][_0x0978('0x14')]);}logger[_0x0978('0x12')](_0x0978('0xe'),_0xdb9e6c,_0x34081e[_0x0978('0x12')][_0x0978('0x14')]);return _0xefd03b(_0x34081e[_0x0978('0x12')]['message']);}else{logger[_0x0978('0xd')](_0x0978('0xe'),_0xdb9e6c,_0x0978('0xf'));_0xefd03b(_0x34081e[_0x0978('0x15')][_0x0978('0x14')]);}})[_0x0978('0x16')](function(_0xb41163){logger[_0x0978('0x12')](_0x0978('0xe'),_0xdb9e6c,_0xb41163);_0x34fe92(_0xb41163);});});}