ec9afa7e16aa6f040ab10e175bcc93090c669f11
[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 _0x7633=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x7633,0x1c4));var _0x3763=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7633[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var moment=require(_0x3763('0x2'));var BPromise=require(_0x3763('0x3'));var rs=require(_0x3763('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3763('0x5'))['db'];var utils=require(_0x3763('0x6'));var logger=require('../../config/logger')(_0x3763('0x7'));var config=require(_0x3763('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3763('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8a2d3e,_0x28f9b0,_0x335382){return new BPromise(function(_0x50b634,_0x550b39){return client[_0x3763('0xa')](_0x8a2d3e,_0x335382)[_0x3763('0xb')](function(_0x4aa292){logger[_0x3763('0xc')](_0x3763('0xd'),_0x28f9b0,_0x3763('0xe'));logger[_0x3763('0xf')](_0x3763('0x10'),_0x28f9b0,_0x3763('0xe'),JSON[_0x3763('0x11')](_0x4aa292));if(_0x4aa292[_0x3763('0x12')]){if(_0x4aa292['error'][_0x3763('0x13')]===0x1f4){logger[_0x3763('0x12')](_0x3763('0xd'),_0x28f9b0,_0x4aa292['error']['message']);return _0x550b39(_0x4aa292[_0x3763('0x12')]['message']);}logger[_0x3763('0x12')](_0x3763('0xd'),_0x28f9b0,_0x4aa292[_0x3763('0x12')][_0x3763('0x14')]);return _0x50b634(_0x4aa292[_0x3763('0x12')][_0x3763('0x14')]);}else{logger[_0x3763('0xc')]('License,\x20%s,\x20%s',_0x28f9b0,_0x3763('0xe'));_0x50b634(_0x4aa292[_0x3763('0x15')][_0x3763('0x14')]);}})['catch'](function(_0x4dde36){logger['error'](_0x3763('0xd'),_0x28f9b0,_0x4dde36);_0x550b39(_0x4dde36);});});}