07725046d08fad606576061210aeb7cc224658aa
[motion2.git] / server / api / migration / migration.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 _0xe32f=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x1688f6,_0x9ab079){var _0x144c86=function(_0x3e979e){while(--_0x3e979e){_0x1688f6['push'](_0x1688f6['shift']());}};_0x144c86(++_0x9ab079);}(_0xe32f,0x1cd));var _0xfe32=function(_0x4c7842,_0xfc29bc){_0x4c7842=_0x4c7842-0x0;var _0x4d0030=_0xe32f[_0x4c7842];return _0x4d0030;};'use strict';var _=require(_0xfe32('0x0'));var util=require(_0xfe32('0x1'));var moment=require(_0xfe32('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe32('0x3'))['db'];var utils=require(_0xfe32('0x4'));var logger=require(_0xfe32('0x5'))(_0xfe32('0x6'));var config=require(_0xfe32('0x7'));var jayson=require(_0xfe32('0x8'));var client=jayson[_0xfe32('0x9')][_0xfe32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23001f,_0x34fbd6,_0x27f7e4){return new BPromise(function(_0x39f43d,_0x1e8073){return client[_0xfe32('0xb')](_0x23001f,_0x27f7e4)[_0xfe32('0xc')](function(_0x349125){logger['info'](_0xfe32('0xd'),_0x34fbd6,_0xfe32('0xe'));logger[_0xfe32('0xf')](_0xfe32('0x10'),_0x34fbd6,_0xfe32('0xe'),JSON[_0xfe32('0x11')](_0x349125));if(_0x349125[_0xfe32('0x12')]){if(_0x349125[_0xfe32('0x12')][_0xfe32('0x13')]===0x1f4){logger[_0xfe32('0x12')](_0xfe32('0xd'),_0x34fbd6,_0x349125[_0xfe32('0x12')][_0xfe32('0x14')]);return _0x1e8073(_0x349125[_0xfe32('0x12')][_0xfe32('0x14')]);}logger[_0xfe32('0x12')](_0xfe32('0xd'),_0x34fbd6,_0x349125[_0xfe32('0x12')][_0xfe32('0x14')]);return _0x39f43d(_0x349125['error']['message']);}else{logger['info'](_0xfe32('0xd'),_0x34fbd6,_0xfe32('0xe'));_0x39f43d(_0x349125['result']['message']);}})['catch'](function(_0x2cca1b){logger['error'](_0xfe32('0xd'),_0x34fbd6,_0x2cca1b);_0x1e8073(_0x2cca1b);});});}