9d44ccfc90283e1bd7006cc6370d6b2b8858c2e9
[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 _0x6e90=['error','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x2711b7,_0x309ca6){var _0x27c40c=function(_0x569f06){while(--_0x569f06){_0x2711b7['push'](_0x2711b7['shift']());}};_0x27c40c(++_0x309ca6);}(_0x6e90,0xf5));var _0x06e9=function(_0x10c9f2,_0x2f7296){_0x10c9f2=_0x10c9f2-0x0;var _0x5cf80c=_0x6e90[_0x10c9f2];return _0x5cf80c;};'use strict';var _=require(_0x06e9('0x0'));var util=require(_0x06e9('0x1'));var moment=require(_0x06e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x06e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x06e9('0x4'));var logger=require(_0x06e9('0x5'))(_0x06e9('0x6'));var config=require(_0x06e9('0x7'));var jayson=require(_0x06e9('0x8'));var client=jayson[_0x06e9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3781fc,_0x2215d6,_0xce440a){return new BPromise(function(_0x329db1,_0x2c86f1){return client[_0x06e9('0xa')](_0x3781fc,_0xce440a)[_0x06e9('0xb')](function(_0x4af2ca){logger[_0x06e9('0xc')](_0x06e9('0xd'),_0x2215d6,_0x06e9('0xe'));logger[_0x06e9('0xf')](_0x06e9('0x10'),_0x2215d6,_0x06e9('0xe'),JSON[_0x06e9('0x11')](_0x4af2ca));if(_0x4af2ca['error']){if(_0x4af2ca['error'][_0x06e9('0x12')]===0x1f4){logger[_0x06e9('0x13')](_0x06e9('0xd'),_0x2215d6,_0x4af2ca[_0x06e9('0x13')][_0x06e9('0x14')]);return _0x2c86f1(_0x4af2ca[_0x06e9('0x13')]['message']);}logger[_0x06e9('0x13')](_0x06e9('0xd'),_0x2215d6,_0x4af2ca[_0x06e9('0x13')][_0x06e9('0x14')]);return _0x329db1(_0x4af2ca[_0x06e9('0x13')][_0x06e9('0x14')]);}else{logger[_0x06e9('0xc')](_0x06e9('0xd'),_0x2215d6,_0x06e9('0xe'));_0x329db1(_0x4af2ca[_0x06e9('0x15')][_0x06e9('0x14')]);}})['catch'](function(_0x524301){logger[_0x06e9('0x13')](_0x06e9('0xd'),_0x2215d6,_0x524301);_0x2c86f1(_0x524301);});});}