Built motion from commit ff78e754.|2.6.29
[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 _0xc737=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','error','code','Migration,\x20%s,\x20%s','message','result','catch'];(function(_0x5cae18,_0x5543e7){var _0x1ed2e5=function(_0x44a302){while(--_0x44a302){_0x5cae18['push'](_0x5cae18['shift']());}};_0x1ed2e5(++_0x5543e7);}(_0xc737,0x154));var _0x7c73=function(_0x4032be,_0x48e59b){_0x4032be=_0x4032be-0x0;var _0x59412b=_0xc737[_0x4032be];return _0x59412b;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require(_0x7c73('0x2'));var BPromise=require(_0x7c73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require('../../config/logger')(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6f81,_0x57e442,_0x9264a9){return new BPromise(function(_0x3281fe,_0x5bf225){return client['request'](_0x3f6f81,_0x9264a9)[_0x7c73('0xa')](function(_0x8237f){logger[_0x7c73('0xb')]('Migration,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'));logger[_0x7c73('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'),JSON['stringify'](_0x8237f));if(_0x8237f[_0x7c73('0xe')]){if(_0x8237f[_0x7c73('0xe')][_0x7c73('0xf')]===0x1f4){logger['error'](_0x7c73('0x10'),_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x5bf225(_0x8237f[_0x7c73('0xe')]['message']);}logger[_0x7c73('0xe')]('Migration,\x20%s,\x20%s',_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x3281fe(_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);}else{logger[_0x7c73('0xb')](_0x7c73('0x10'),_0x57e442,_0x7c73('0xc'));_0x3281fe(_0x8237f[_0x7c73('0x12')]['message']);}})[_0x7c73('0x13')](function(_0x562b50){logger[_0x7c73('0xe')](_0x7c73('0x10'),_0x57e442,_0x562b50);_0x5bf225(_0x562b50);});});}