Built motion from commit e1760111.|2.6.18
[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 _0x407c=['request\x20sent','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x407c,0xe9));var _0xc407=function(_0xcc2fce,_0x24b95e){_0xcc2fce=_0xcc2fce-0x0;var _0x287b9a=_0x407c[_0xcc2fce];return _0x287b9a;};'use strict';var _=require(_0xc407('0x0'));var util=require(_0xc407('0x1'));var moment=require(_0xc407('0x2'));var BPromise=require(_0xc407('0x3'));var rs=require(_0xc407('0x4'));var fs=require('fs');var Redis=require(_0xc407('0x5'));var db=require(_0xc407('0x6'))['db'];var utils=require(_0xc407('0x7'));var logger=require(_0xc407('0x8'))(_0xc407('0x9'));var config=require(_0xc407('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc407('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bcf95,_0x57eaff,_0x3e592f){return new BPromise(function(_0x480c28,_0x2c48d0){return client[_0xc407('0xc')](_0x3bcf95,_0x3e592f)[_0xc407('0xd')](function(_0x31fe71){logger[_0xc407('0xe')]('SalesforceField,\x20%s,\x20%s',_0x57eaff,'request\x20sent');logger[_0xc407('0xf')](_0xc407('0x10'),_0x57eaff,_0xc407('0x11'),JSON[_0xc407('0x12')](_0x31fe71));if(_0x31fe71[_0xc407('0x13')]){if(_0x31fe71[_0xc407('0x13')][_0xc407('0x14')]===0x1f4){logger[_0xc407('0x13')](_0xc407('0x15'),_0x57eaff,_0x31fe71[_0xc407('0x13')][_0xc407('0x16')]);return _0x2c48d0(_0x31fe71[_0xc407('0x13')][_0xc407('0x16')]);}logger[_0xc407('0x13')](_0xc407('0x15'),_0x57eaff,_0x31fe71['error'][_0xc407('0x16')]);return _0x480c28(_0x31fe71[_0xc407('0x13')][_0xc407('0x16')]);}else{logger[_0xc407('0xe')](_0xc407('0x15'),_0x57eaff,_0xc407('0x11'));_0x480c28(_0x31fe71[_0xc407('0x17')]['message']);}})[_0xc407('0x18')](function(_0x1497bf){logger['error'](_0xc407('0x15'),_0x57eaff,_0x1497bf);_0x2c48d0(_0x1497bf);});});}