Built motion from commit da617fac.|2.6.6
[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 _0x09dd=['stringify','error','code','message','result','catch','Migration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x09dd,0xb7));var _0xd09d=function(_0x13915f,_0x3d90c6){_0x13915f=_0x13915f-0x0;var _0x373181=_0x09dd[_0x13915f];return _0x373181;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));var BPromise=require(_0xd09d('0x3'));var rs=require(_0xd09d('0x4'));var fs=require('fs');var Redis=require(_0xd09d('0x5'));var db=require(_0xd09d('0x6'))['db'];var utils=require(_0xd09d('0x7'));var logger=require(_0xd09d('0x8'))('rpc');var config=require(_0xd09d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd09d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57eba0,_0x5e2910,_0x50af75){return new BPromise(function(_0x58c10c,_0x483c0a){return client[_0xd09d('0xb')](_0x57eba0,_0x50af75)['then'](function(_0x439f9c){logger[_0xd09d('0xc')]('Migration,\x20%s,\x20%s',_0x5e2910,'request\x20sent');logger['debug'](_0xd09d('0xd'),_0x5e2910,_0xd09d('0xe'),JSON[_0xd09d('0xf')](_0x439f9c));if(_0x439f9c[_0xd09d('0x10')]){if(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x11')]===0x1f4){logger[_0xd09d('0x10')]('Migration,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x483c0a(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}logger[_0xd09d('0x10')]('Migration,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x58c10c(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}else{logger[_0xd09d('0xc')]('Migration,\x20%s,\x20%s',_0x5e2910,_0xd09d('0xe'));_0x58c10c(_0x439f9c[_0xd09d('0x13')]['message']);}})[_0xd09d('0x14')](function(_0x1a4def){logger[_0xd09d('0x10')](_0xd09d('0x15'),_0x5e2910,_0x1a4def);_0x483c0a(_0x1a4def);});});}