Built motion from commit (unavailable).|2.5.21
[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 _0x96d9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45801c,_0x2db8e2){var _0x2ee28e=function(_0x2de68a){while(--_0x2de68a){_0x45801c['push'](_0x45801c['shift']());}};_0x2ee28e(++_0x2db8e2);}(_0x96d9,0xea));var _0x996d=function(_0x1848ed,_0x555123){_0x1848ed=_0x1848ed-0x0;var _0x5dd96c=_0x96d9[_0x1848ed];return _0x5dd96c;};'use strict';var _=require(_0x996d('0x0'));var util=require(_0x996d('0x1'));var moment=require(_0x996d('0x2'));var BPromise=require(_0x996d('0x3'));var rs=require(_0x996d('0x4'));var fs=require('fs');var Redis=require(_0x996d('0x5'));var db=require(_0x996d('0x6'))['db'];var utils=require(_0x996d('0x7'));var logger=require('../../config/logger')(_0x996d('0x8'));var config=require(_0x996d('0x9'));var jayson=require(_0x996d('0xa'));var client=jayson[_0x996d('0xb')][_0x996d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x427a02,_0x327d3e,_0x4d65b5){return new BPromise(function(_0x40c142,_0x344899){return client[_0x996d('0xd')](_0x427a02,_0x4d65b5)[_0x996d('0xe')](function(_0x31694c){logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));logger[_0x996d('0x11')](_0x996d('0x12'),_0x327d3e,'request\x20sent',JSON[_0x996d('0x13')](_0x31694c));if(_0x31694c[_0x996d('0x14')]){if(_0x31694c['error']['code']===0x1f4){logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')]['message']);return _0x344899(_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);}logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);return _0x40c142(_0x31694c['error'][_0x996d('0x15')]);}else{logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));_0x40c142(_0x31694c[_0x996d('0x16')][_0x996d('0x15')]);}})[_0x996d('0x17')](function(_0x87f980){logger[_0x996d('0x14')]('License,\x20%s,\x20%s',_0x327d3e,_0x87f980);_0x344899(_0x87f980);});});}