Built motion from commit (unavailable).|2.5.17
[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 _0xb09d=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5884d5,_0x416266){var _0x2d7c63=function(_0x1ce98c){while(--_0x1ce98c){_0x5884d5['push'](_0x5884d5['shift']());}};_0x2d7c63(++_0x416266);}(_0xb09d,0xed));var _0xdb09=function(_0x1eea64,_0x49d7c3){_0x1eea64=_0x1eea64-0x0;var _0x4801d1=_0xb09d[_0x1eea64];return _0x4801d1;};'use strict';var _=require(_0xdb09('0x0'));var util=require(_0xdb09('0x1'));var moment=require(_0xdb09('0x2'));var BPromise=require(_0xdb09('0x3'));var rs=require(_0xdb09('0x4'));var fs=require('fs');var Redis=require(_0xdb09('0x5'));var db=require(_0xdb09('0x6'))['db'];var utils=require(_0xdb09('0x7'));var logger=require('../../config/logger')(_0xdb09('0x8'));var config=require(_0xdb09('0x9'));var jayson=require(_0xdb09('0xa'));var client=jayson[_0xdb09('0xb')][_0xdb09('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20a6ef,_0xa0e24,_0x332ab2){return new BPromise(function(_0x3bbf9b,_0x1e6e67){return client[_0xdb09('0xd')](_0x20a6ef,_0x332ab2)['then'](function(_0x4b6e2e){logger[_0xdb09('0xe')](_0xdb09('0xf'),_0xa0e24,_0xdb09('0x10'));logger[_0xdb09('0x11')](_0xdb09('0x12'),_0xa0e24,_0xdb09('0x10'),JSON['stringify'](_0x4b6e2e));if(_0x4b6e2e['error']){if(_0x4b6e2e[_0xdb09('0x13')]['code']===0x1f4){logger[_0xdb09('0x13')](_0xdb09('0xf'),_0xa0e24,_0x4b6e2e[_0xdb09('0x13')][_0xdb09('0x14')]);return _0x1e6e67(_0x4b6e2e[_0xdb09('0x13')][_0xdb09('0x14')]);}logger['error'](_0xdb09('0xf'),_0xa0e24,_0x4b6e2e[_0xdb09('0x13')][_0xdb09('0x14')]);return _0x3bbf9b(_0x4b6e2e[_0xdb09('0x13')][_0xdb09('0x14')]);}else{logger[_0xdb09('0xe')]('License,\x20%s,\x20%s',_0xa0e24,_0xdb09('0x10'));_0x3bbf9b(_0x4b6e2e['result']['message']);}})['catch'](function(_0x29a116){logger[_0xdb09('0x13')](_0xdb09('0xf'),_0xa0e24,_0x29a116);_0x1e6e67(_0x29a116);});});}