Built motion from commit (unavailable).|2.6.0
[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 _0xf7e1=['rpc','../../config/environment','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf7e1,0x170));var _0x1f7e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xf7e1[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x1f7e('0x0'));var util=require(_0x1f7e('0x1'));var moment=require(_0x1f7e('0x2'));var BPromise=require(_0x1f7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f7e('0x5'))(_0x1f7e('0x6'));var config=require(_0x1f7e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1f7e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab1f2,_0x2f7674,_0x42d5b5){return new BPromise(function(_0x5d5efa,_0x7142b3){return client[_0x1f7e('0x9')](_0x5ab1f2,_0x42d5b5)[_0x1f7e('0xa')](function(_0x58fe97){logger[_0x1f7e('0xb')](_0x1f7e('0xc'),_0x2f7674,_0x1f7e('0xd'));logger[_0x1f7e('0xe')](_0x1f7e('0xf'),_0x2f7674,_0x1f7e('0xd'),JSON[_0x1f7e('0x10')](_0x58fe97));if(_0x58fe97[_0x1f7e('0x11')]){if(_0x58fe97['error'][_0x1f7e('0x12')]===0x1f4){logger[_0x1f7e('0x11')](_0x1f7e('0xc'),_0x2f7674,_0x58fe97[_0x1f7e('0x11')][_0x1f7e('0x13')]);return _0x7142b3(_0x58fe97[_0x1f7e('0x11')][_0x1f7e('0x13')]);}logger[_0x1f7e('0x11')](_0x1f7e('0xc'),_0x2f7674,_0x58fe97[_0x1f7e('0x11')][_0x1f7e('0x13')]);return _0x5d5efa(_0x58fe97['error']['message']);}else{logger['info'](_0x1f7e('0xc'),_0x2f7674,_0x1f7e('0xd'));_0x5d5efa(_0x58fe97[_0x1f7e('0x14')][_0x1f7e('0x13')]);}})[_0x1f7e('0x15')](function(_0x48d57d){logger['error'](_0x1f7e('0xc'),_0x2f7674,_0x48d57d);_0x7142b3(_0x48d57d);});});}