Built motion from commit 3c2ce842.|2.6.31
[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 _0xdc30=['rpc','../../config/environment','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10ca28,_0x53392f){var _0x52d77f=function(_0x4ffa95){while(--_0x4ffa95){_0x10ca28['push'](_0x10ca28['shift']());}};_0x52d77f(++_0x53392f);}(_0xdc30,0x109));var _0x0dc3=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xdc30[_0x2e2681];return _0x368a64;};'use strict';var _=require('lodash');var util=require(_0x0dc3('0x0'));var moment=require(_0x0dc3('0x1'));var BPromise=require(_0x0dc3('0x2'));var rs=require(_0x0dc3('0x3'));var fs=require('fs');var Redis=require(_0x0dc3('0x4'));var db=require(_0x0dc3('0x5'))['db'];var utils=require(_0x0dc3('0x6'));var logger=require(_0x0dc3('0x7'))(_0x0dc3('0x8'));var config=require(_0x0dc3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0dc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6260,_0x4d1769,_0x35f876){return new BPromise(function(_0x1d1c1b,_0x4dd5f0){return client[_0x0dc3('0xb')](_0x3e6260,_0x35f876)[_0x0dc3('0xc')](function(_0x8f8460){logger[_0x0dc3('0xd')](_0x0dc3('0xe'),_0x4d1769,_0x0dc3('0xf'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4d1769,_0x0dc3('0xf'),JSON['stringify'](_0x8f8460));if(_0x8f8460[_0x0dc3('0x10')]){if(_0x8f8460[_0x0dc3('0x10')][_0x0dc3('0x11')]===0x1f4){logger[_0x0dc3('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4d1769,_0x8f8460[_0x0dc3('0x10')][_0x0dc3('0x12')]);return _0x4dd5f0(_0x8f8460['error'][_0x0dc3('0x12')]);}logger[_0x0dc3('0x10')](_0x0dc3('0xe'),_0x4d1769,_0x8f8460['error']['message']);return _0x1d1c1b(_0x8f8460['error']['message']);}else{logger['info'](_0x0dc3('0xe'),_0x4d1769,_0x0dc3('0xf'));_0x1d1c1b(_0x8f8460[_0x0dc3('0x13')][_0x0dc3('0x12')]);}})[_0x0dc3('0x14')](function(_0x5322d0){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x4d1769,_0x5322d0);_0x4dd5f0(_0x5322d0);});});}