5961aaadef6495bbbb52790491a9838e9fc75926
[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 _0x2dce=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x781470,_0x74550c){var _0x21268c=function(_0x3e242c){while(--_0x3e242c){_0x781470['push'](_0x781470['shift']());}};_0x21268c(++_0x74550c);}(_0x2dce,0xb1));var _0xe2dc=function(_0xa78862,_0x4bd931){_0xa78862=_0xa78862-0x0;var _0x536c41=_0x2dce[_0xa78862];return _0x536c41;};'use strict';var _=require(_0xe2dc('0x0'));var util=require(_0xe2dc('0x1'));var moment=require(_0xe2dc('0x2'));var BPromise=require(_0xe2dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2dc('0x4'));var db=require(_0xe2dc('0x5'))['db'];var utils=require(_0xe2dc('0x6'));var logger=require(_0xe2dc('0x7'))(_0xe2dc('0x8'));var config=require(_0xe2dc('0x9'));var jayson=require(_0xe2dc('0xa'));var client=jayson[_0xe2dc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0898,_0x1a958a,_0x313810){return new BPromise(function(_0x511d13,_0x219fb5){return client[_0xe2dc('0xc')](_0x4d0898,_0x313810)[_0xe2dc('0xd')](function(_0x347376){logger[_0xe2dc('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x1a958a,_0xe2dc('0xf'));logger[_0xe2dc('0x10')](_0xe2dc('0x11'),_0x1a958a,_0xe2dc('0xf'),JSON[_0xe2dc('0x12')](_0x347376));if(_0x347376[_0xe2dc('0x13')]){if(_0x347376[_0xe2dc('0x13')]['code']===0x1f4){logger[_0xe2dc('0x13')](_0xe2dc('0x14'),_0x1a958a,_0x347376[_0xe2dc('0x13')][_0xe2dc('0x15')]);return _0x219fb5(_0x347376['error'][_0xe2dc('0x15')]);}logger[_0xe2dc('0x13')](_0xe2dc('0x14'),_0x1a958a,_0x347376[_0xe2dc('0x13')]['message']);return _0x511d13(_0x347376['error']['message']);}else{logger[_0xe2dc('0xe')](_0xe2dc('0x14'),_0x1a958a,_0xe2dc('0xf'));_0x511d13(_0x347376[_0xe2dc('0x16')][_0xe2dc('0x15')]);}})[_0xe2dc('0x17')](function(_0x471f18){logger[_0xe2dc('0x13')](_0xe2dc('0x14'),_0x1a958a,_0x471f18);_0x219fb5(_0x471f18);});});}