Built motion from commit 3d3e98f2.|2.6.29
[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 _0x260f=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x260f,0x94));var _0xf260=function(_0x4a6fb8,_0x1c0e0f){_0x4a6fb8=_0x4a6fb8-0x0;var _0xe92da=_0x260f[_0x4a6fb8];return _0xe92da;};'use strict';var _=require(_0xf260('0x0'));var util=require(_0xf260('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf260('0x2'));var fs=require('fs');var Redis=require(_0xf260('0x3'));var db=require(_0xf260('0x4'))['db'];var utils=require(_0xf260('0x5'));var logger=require(_0xf260('0x6'))(_0xf260('0x7'));var config=require(_0xf260('0x8'));var jayson=require(_0xf260('0x9'));var client=jayson[_0xf260('0xa')][_0xf260('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ea9f8,_0x28f7b4,_0x5dfe70){return new BPromise(function(_0x16de41,_0x44fbdd){return client['request'](_0x2ea9f8,_0x5dfe70)[_0xf260('0xc')](function(_0x2f0151){logger[_0xf260('0xd')](_0xf260('0xe'),_0x28f7b4,_0xf260('0xf'));logger[_0xf260('0x10')](_0xf260('0x11'),_0x28f7b4,_0xf260('0xf'),JSON['stringify'](_0x2f0151));if(_0x2f0151['error']){if(_0x2f0151[_0xf260('0x12')][_0xf260('0x13')]===0x1f4){logger[_0xf260('0x12')](_0xf260('0xe'),_0x28f7b4,_0x2f0151[_0xf260('0x12')][_0xf260('0x14')]);return _0x44fbdd(_0x2f0151[_0xf260('0x12')][_0xf260('0x14')]);}logger[_0xf260('0x12')](_0xf260('0xe'),_0x28f7b4,_0x2f0151['error'][_0xf260('0x14')]);return _0x16de41(_0x2f0151['error']['message']);}else{logger[_0xf260('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x28f7b4,_0xf260('0xf'));_0x16de41(_0x2f0151[_0xf260('0x15')][_0xf260('0x14')]);}})[_0xf260('0x16')](function(_0x2b3781){logger['error'](_0xf260('0xe'),_0x28f7b4,_0x2b3781);_0x44fbdd(_0x2b3781);});});}