Built motion from commit 87cd5f02.|2.5.48
[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 _0x413d=['code','License,\x20%s,\x20%s','message','request\x20sent','result','lodash','randomstring','../../config/logger','client','http','request','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45ae23,_0x1b3633){var _0x398ba7=function(_0x5baff2){while(--_0x5baff2){_0x45ae23['push'](_0x45ae23['shift']());}};_0x398ba7(++_0x1b3633);}(_0x413d,0x1a5));var _0xd413=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x413d[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0xd413('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd413('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd413('0x2'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd413('0x3')][_0xd413('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x7ea2c1,_0x4d5c1a,_0x1b8965){return new BPromise(function(_0x589309,_0xcb7f8f){return client[_0xd413('0x5')](_0x7ea2c1,_0x1b8965)['then'](function(_0x3daba3){logger[_0xd413('0x6')]('License,\x20%s,\x20%s',_0x4d5c1a,'request\x20sent');logger[_0xd413('0x7')](_0xd413('0x8'),_0x4d5c1a,'request\x20sent',JSON[_0xd413('0x9')](_0x3daba3));if(_0x3daba3[_0xd413('0xa')]){if(_0x3daba3[_0xd413('0xa')][_0xd413('0xb')]===0x1f4){logger[_0xd413('0xa')](_0xd413('0xc'),_0x4d5c1a,_0x3daba3['error'][_0xd413('0xd')]);return _0xcb7f8f(_0x3daba3[_0xd413('0xa')][_0xd413('0xd')]);}logger['error'](_0xd413('0xc'),_0x4d5c1a,_0x3daba3['error'][_0xd413('0xd')]);return _0x589309(_0x3daba3[_0xd413('0xa')][_0xd413('0xd')]);}else{logger[_0xd413('0x6')](_0xd413('0xc'),_0x4d5c1a,_0xd413('0xe'));_0x589309(_0x3daba3[_0xd413('0xf')][_0xd413('0xd')]);}})['catch'](function(_0x1887f7){logger[_0xd413('0xa')]('License,\x20%s,\x20%s',_0x4d5c1a,_0x1887f7);_0xcb7f8f(_0x1887f7);});});}