Built motion from commit 5293bb2a.|2.6.30
[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 _0xd012=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result'];(function(_0x3b0491,_0x23f524){var _0x3ee467=function(_0x31a9eb){while(--_0x31a9eb){_0x3b0491['push'](_0x3b0491['shift']());}};_0x3ee467(++_0x23f524);}(_0xd012,0xe7));var _0x2d01=function(_0x2846f9,_0x286ebb){_0x2846f9=_0x2846f9-0x0;var _0x2f3113=_0xd012[_0x2846f9];return _0x2f3113;};'use strict';var _=require(_0x2d01('0x0'));var util=require(_0x2d01('0x1'));var moment=require(_0x2d01('0x2'));var BPromise=require(_0x2d01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d01('0x4'));var db=require(_0x2d01('0x5'))['db'];var utils=require(_0x2d01('0x6'));var logger=require(_0x2d01('0x7'))('rpc');var config=require(_0x2d01('0x8'));var jayson=require(_0x2d01('0x9'));var client=jayson[_0x2d01('0xa')][_0x2d01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42a023,_0x2a5485,_0x3f0ef2){return new BPromise(function(_0x19299e,_0x2414ec){return client[_0x2d01('0xc')](_0x42a023,_0x3f0ef2)[_0x2d01('0xd')](function(_0x4dea2d){logger[_0x2d01('0xe')](_0x2d01('0xf'),_0x2a5485,'request\x20sent');logger[_0x2d01('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x2a5485,_0x2d01('0x11'),JSON['stringify'](_0x4dea2d));if(_0x4dea2d['error']){if(_0x4dea2d[_0x2d01('0x12')][_0x2d01('0x13')]===0x1f4){logger[_0x2d01('0x12')](_0x2d01('0xf'),_0x2a5485,_0x4dea2d['error']['message']);return _0x2414ec(_0x4dea2d[_0x2d01('0x12')]['message']);}logger[_0x2d01('0x12')]('License,\x20%s,\x20%s',_0x2a5485,_0x4dea2d[_0x2d01('0x12')][_0x2d01('0x14')]);return _0x19299e(_0x4dea2d[_0x2d01('0x12')][_0x2d01('0x14')]);}else{logger[_0x2d01('0xe')]('License,\x20%s,\x20%s',_0x2a5485,_0x2d01('0x11'));_0x19299e(_0x4dea2d[_0x2d01('0x15')][_0x2d01('0x14')]);}})[_0x2d01('0x16')](function(_0x14b960){logger['error']('License,\x20%s,\x20%s',_0x2a5485,_0x14b960);_0x2414ec(_0x14b960);});});}