Built motion from commit 9d7072cc.|2.5.39
[motion2.git] / server / api / intDynamics365Field / intDynamics365Field.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 _0x1ace=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x268073,_0x86e155){var _0x3d4b81=function(_0x393327){while(--_0x393327){_0x268073['push'](_0x268073['shift']());}};_0x3d4b81(++_0x86e155);}(_0x1ace,0x136));var _0xe1ac=function(_0x5e87cc,_0x24fabb){_0x5e87cc=_0x5e87cc-0x0;var _0x535c15=_0x1ace[_0x5e87cc];return _0x535c15;};'use strict';var _=require(_0xe1ac('0x0'));var util=require(_0xe1ac('0x1'));var moment=require(_0xe1ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1ac('0x4'))['db'];var utils=require(_0xe1ac('0x5'));var logger=require(_0xe1ac('0x6'))(_0xe1ac('0x7'));var config=require(_0xe1ac('0x8'));var jayson=require(_0xe1ac('0x9'));var client=jayson[_0xe1ac('0xa')][_0xe1ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ea14a,_0x4fcd4f,_0x15b748){return new BPromise(function(_0x454280,_0x400dbf){return client['request'](_0x1ea14a,_0x15b748)[_0xe1ac('0xc')](function(_0x5ddd0b){logger[_0xe1ac('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4fcd4f,'request\x20sent');logger['debug'](_0xe1ac('0xe'),_0x4fcd4f,_0xe1ac('0xf'),JSON['stringify'](_0x5ddd0b));if(_0x5ddd0b[_0xe1ac('0x10')]){if(_0x5ddd0b[_0xe1ac('0x10')][_0xe1ac('0x11')]===0x1f4){logger[_0xe1ac('0x10')](_0xe1ac('0x12'),_0x4fcd4f,_0x5ddd0b[_0xe1ac('0x10')][_0xe1ac('0x13')]);return _0x400dbf(_0x5ddd0b[_0xe1ac('0x10')][_0xe1ac('0x13')]);}logger[_0xe1ac('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4fcd4f,_0x5ddd0b['error'][_0xe1ac('0x13')]);return _0x454280(_0x5ddd0b[_0xe1ac('0x10')]['message']);}else{logger[_0xe1ac('0xd')](_0xe1ac('0x12'),_0x4fcd4f,_0xe1ac('0xf'));_0x454280(_0x5ddd0b[_0xe1ac('0x14')]['message']);}})['catch'](function(_0x2fdef2){logger[_0xe1ac('0x10')](_0xe1ac('0x12'),_0x4fcd4f,_0x2fdef2);_0x400dbf(_0x2fdef2);});});}