Built motion from commit (unavailable).|2.5.23
[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 _0x4e4c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x19e26c,_0x21b898){var _0x4fd680=function(_0x581da3){while(--_0x581da3){_0x19e26c['push'](_0x19e26c['shift']());}};_0x4fd680(++_0x21b898);}(_0x4e4c,0x176));var _0xc4e4=function(_0x1e6b51,_0x124f3d){_0x1e6b51=_0x1e6b51-0x0;var _0x16d87a=_0x4e4c[_0x1e6b51];return _0x16d87a;};'use strict';var _=require(_0xc4e4('0x0'));var util=require(_0xc4e4('0x1'));var moment=require(_0xc4e4('0x2'));var BPromise=require(_0xc4e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4e4('0x4'));var db=require(_0xc4e4('0x5'))['db'];var utils=require(_0xc4e4('0x6'));var logger=require('../../config/logger')(_0xc4e4('0x7'));var config=require('../../config/environment');var jayson=require(_0xc4e4('0x8'));var client=jayson[_0xc4e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15383d,_0x40fe65,_0x38dc97){return new BPromise(function(_0x581cd6,_0x25cabc){return client[_0xc4e4('0xa')](_0x15383d,_0x38dc97)[_0xc4e4('0xb')](function(_0x2f179c){logger[_0xc4e4('0xc')](_0xc4e4('0xd'),_0x40fe65,_0xc4e4('0xe'));logger[_0xc4e4('0xf')](_0xc4e4('0x10'),_0x40fe65,_0xc4e4('0xe'),JSON[_0xc4e4('0x11')](_0x2f179c));if(_0x2f179c['error']){if(_0x2f179c[_0xc4e4('0x12')]['code']===0x1f4){logger[_0xc4e4('0x12')](_0xc4e4('0xd'),_0x40fe65,_0x2f179c['error']['message']);return _0x25cabc(_0x2f179c[_0xc4e4('0x12')][_0xc4e4('0x13')]);}logger['error'](_0xc4e4('0xd'),_0x40fe65,_0x2f179c[_0xc4e4('0x12')][_0xc4e4('0x13')]);return _0x581cd6(_0x2f179c['error'][_0xc4e4('0x13')]);}else{logger[_0xc4e4('0xc')]('Migration,\x20%s,\x20%s',_0x40fe65,_0xc4e4('0xe'));_0x581cd6(_0x2f179c[_0xc4e4('0x14')][_0xc4e4('0x13')]);}})[_0xc4e4('0x15')](function(_0x5bc673){logger['error']('Migration,\x20%s,\x20%s',_0x40fe65,_0x5bc673);_0x25cabc(_0x5bc673);});});}