Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / intSalesforceField / intSalesforceField.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 _0x6970=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x22a482,_0x4ffb17){var _0x4f0657=function(_0x2bbcf2){while(--_0x2bbcf2){_0x22a482['push'](_0x22a482['shift']());}};_0x4f0657(++_0x4ffb17);}(_0x6970,0xe5));var _0x0697=function(_0xf6ebd,_0x53aa50){_0xf6ebd=_0xf6ebd-0x0;var _0x2cbd4b=_0x6970[_0xf6ebd];return _0x2cbd4b;};'use strict';var _=require(_0x0697('0x0'));var util=require(_0x0697('0x1'));var moment=require(_0x0697('0x2'));var BPromise=require(_0x0697('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0697('0x4'))['db'];var utils=require(_0x0697('0x5'));var logger=require(_0x0697('0x6'))(_0x0697('0x7'));var config=require(_0x0697('0x8'));var jayson=require(_0x0697('0x9'));var client=jayson[_0x0697('0xa')][_0x0697('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x455784,_0x12ccdc,_0x977279){return new BPromise(function(_0x167812,_0x4050ee){return client[_0x0697('0xc')](_0x455784,_0x977279)[_0x0697('0xd')](function(_0x5d0a43){logger[_0x0697('0xe')](_0x0697('0xf'),_0x12ccdc,_0x0697('0x10'));logger[_0x0697('0x11')](_0x0697('0x12'),_0x12ccdc,_0x0697('0x10'),JSON[_0x0697('0x13')](_0x5d0a43));if(_0x5d0a43[_0x0697('0x14')]){if(_0x5d0a43['error'][_0x0697('0x15')]===0x1f4){logger[_0x0697('0x14')](_0x0697('0xf'),_0x12ccdc,_0x5d0a43[_0x0697('0x14')][_0x0697('0x16')]);return _0x4050ee(_0x5d0a43[_0x0697('0x14')][_0x0697('0x16')]);}logger[_0x0697('0x14')](_0x0697('0xf'),_0x12ccdc,_0x5d0a43[_0x0697('0x14')][_0x0697('0x16')]);return _0x167812(_0x5d0a43[_0x0697('0x14')]['message']);}else{logger['info'](_0x0697('0xf'),_0x12ccdc,'request\x20sent');_0x167812(_0x5d0a43['result']['message']);}})[_0x0697('0x17')](function(_0x175422){logger[_0x0697('0x14')]('SalesforceField,\x20%s,\x20%s',_0x12ccdc,_0x175422);_0x4050ee(_0x175422);});});}