Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0x1033=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1033,0x65));var _0x3103=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1033[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3103('0x0'));var util=require(_0x3103('0x1'));var moment=require('moment');var BPromise=require(_0x3103('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x3103('0x3'))['db'];var utils=require(_0x3103('0x4'));var logger=require(_0x3103('0x5'))(_0x3103('0x6'));var config=require(_0x3103('0x7'));var jayson=require(_0x3103('0x8'));var client=jayson[_0x3103('0x9')][_0x3103('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fc74b,_0x45c9f7,_0x3f3fb6){return new BPromise(function(_0x563610,_0x3a08dd){return client[_0x3103('0xb')](_0x9fc74b,_0x3f3fb6)['then'](function(_0x59c864){logger[_0x3103('0xc')](_0x3103('0xd'),_0x45c9f7,_0x3103('0xe'));logger['debug'](_0x3103('0xf'),_0x45c9f7,_0x3103('0xe'),JSON[_0x3103('0x10')](_0x59c864));if(_0x59c864[_0x3103('0x11')]){if(_0x59c864['error']['code']===0x1f4){logger[_0x3103('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x45c9f7,_0x59c864['error'][_0x3103('0x12')]);return _0x3a08dd(_0x59c864[_0x3103('0x11')][_0x3103('0x12')]);}logger[_0x3103('0x11')](_0x3103('0xd'),_0x45c9f7,_0x59c864[_0x3103('0x11')][_0x3103('0x12')]);return _0x563610(_0x59c864[_0x3103('0x11')][_0x3103('0x12')]);}else{logger['info'](_0x3103('0xd'),_0x45c9f7,_0x3103('0xe'));_0x563610(_0x59c864[_0x3103('0x13')]['message']);}})[_0x3103('0x14')](function(_0x4350f4){logger['error'](_0x3103('0xd'),_0x45c9f7,_0x4350f4);_0x3a08dd(_0x4350f4);});});}