Built motion from commit (unavailable).|2.5.5
[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 _0x528e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2b16b3,_0x1611a1){var _0x415632=function(_0x64039a){while(--_0x64039a){_0x2b16b3['push'](_0x2b16b3['shift']());}};_0x415632(++_0x1611a1);}(_0x528e,0x1d2));var _0xe528=function(_0x143e9d,_0x1c4e87){_0x143e9d=_0x143e9d-0x0;var _0x55678f=_0x528e[_0x143e9d];return _0x55678f;};'use strict';var _=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var moment=require(_0xe528('0x2'));var BPromise=require(_0xe528('0x3'));var rs=require(_0xe528('0x4'));var fs=require('fs');var Redis=require(_0xe528('0x5'));var db=require(_0xe528('0x6'))['db'];var utils=require(_0xe528('0x7'));var logger=require(_0xe528('0x8'))(_0xe528('0x9'));var config=require('../../config/environment');var jayson=require(_0xe528('0xa'));var client=jayson[_0xe528('0xb')][_0xe528('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cda6c,_0x572ca3,_0x2c0e02){return new BPromise(function(_0x3bfc13,_0x2505cc){return client[_0xe528('0xd')](_0x1cda6c,_0x2c0e02)[_0xe528('0xe')](function(_0x37306d){logger[_0xe528('0xf')]('Migration,\x20%s,\x20%s',_0x572ca3,'request\x20sent');logger[_0xe528('0x10')](_0xe528('0x11'),_0x572ca3,_0xe528('0x12'),JSON[_0xe528('0x13')](_0x37306d));if(_0x37306d[_0xe528('0x14')]){if(_0x37306d[_0xe528('0x14')][_0xe528('0x15')]===0x1f4){logger['error'](_0xe528('0x16'),_0x572ca3,_0x37306d[_0xe528('0x14')][_0xe528('0x17')]);return _0x2505cc(_0x37306d[_0xe528('0x14')][_0xe528('0x17')]);}logger[_0xe528('0x14')](_0xe528('0x16'),_0x572ca3,_0x37306d[_0xe528('0x14')][_0xe528('0x17')]);return _0x3bfc13(_0x37306d['error'][_0xe528('0x17')]);}else{logger[_0xe528('0xf')](_0xe528('0x16'),_0x572ca3,'request\x20sent');_0x3bfc13(_0x37306d[_0xe528('0x18')][_0xe528('0x17')]);}})[_0xe528('0x19')](function(_0x15c839){logger['error']('Migration,\x20%s,\x20%s',_0x572ca3,_0x15c839);_0x2505cc(_0x15c839);});});}