Built motion from commit 746c7d2a.|2.5.35
[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 _0xf3cd=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x4609b8,_0x222b6a){var _0x56b675=function(_0x4a9a60){while(--_0x4a9a60){_0x4609b8['push'](_0x4609b8['shift']());}};_0x56b675(++_0x222b6a);}(_0xf3cd,0x79));var _0xdf3c=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0xf3cd[_0x4cb095];return _0x2b565d;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require(_0xdf3c('0x6'))['db'];var utils=require(_0xdf3c('0x7'));var logger=require(_0xdf3c('0x8'))(_0xdf3c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39f880,_0x10b381,_0x51c730){return new BPromise(function(_0x3a4c1f,_0x40b8d8){return client[_0xdf3c('0xc')](_0x39f880,_0x51c730)[_0xdf3c('0xd')](function(_0x26a478){logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x10b381,_0xdf3c('0x10'));logger['debug'](_0xdf3c('0x11'),_0x10b381,_0xdf3c('0x10'),JSON[_0xdf3c('0x12')](_0x26a478));if(_0x26a478['error']){if(_0x26a478[_0xdf3c('0x13')][_0xdf3c('0x14')]===0x1f4){logger[_0xdf3c('0x13')]('License,\x20%s,\x20%s',_0x10b381,_0x26a478[_0xdf3c('0x13')]['message']);return _0x40b8d8(_0x26a478[_0xdf3c('0x13')][_0xdf3c('0x15')]);}logger['error']('License,\x20%s,\x20%s',_0x10b381,_0x26a478[_0xdf3c('0x13')][_0xdf3c('0x15')]);return _0x3a4c1f(_0x26a478[_0xdf3c('0x13')][_0xdf3c('0x15')]);}else{logger['info'](_0xdf3c('0xf'),_0x10b381,_0xdf3c('0x10'));_0x3a4c1f(_0x26a478['result'][_0xdf3c('0x15')]);}})[_0xdf3c('0x16')](function(_0x2790c4){logger['error'](_0xdf3c('0xf'),_0x10b381,_0x2790c4);_0x40b8d8(_0x2790c4);});});}