Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / intZendeskField / intZendeskField.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 _0xc43f=['client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x56eb02,_0x1f4beb){var _0x535ee4=function(_0xd143ba){while(--_0xd143ba){_0x56eb02['push'](_0x56eb02['shift']());}};_0x535ee4(++_0x1f4beb);}(_0xc43f,0x120));var _0xfc43=function(_0x2cdf5b,_0x41eece){_0x2cdf5b=_0x2cdf5b-0x0;var _0x87798e=_0xc43f[_0x2cdf5b];return _0x87798e;};'use strict';var _=require(_0xfc43('0x0'));var util=require(_0xfc43('0x1'));var moment=require(_0xfc43('0x2'));var BPromise=require(_0xfc43('0x3'));var rs=require(_0xfc43('0x4'));var fs=require('fs');var Redis=require(_0xfc43('0x5'));var db=require(_0xfc43('0x6'))['db'];var utils=require(_0xfc43('0x7'));var logger=require('../../config/logger')(_0xfc43('0x8'));var config=require(_0xfc43('0x9'));var jayson=require(_0xfc43('0xa'));var client=jayson[_0xfc43('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x241725,_0x91ede3,_0x5c032c){return new BPromise(function(_0x218a81,_0x943dd9){return client[_0xfc43('0xc')](_0x241725,_0x5c032c)[_0xfc43('0xd')](function(_0x49cd71){logger[_0xfc43('0xe')](_0xfc43('0xf'),_0x91ede3,_0xfc43('0x10'));logger[_0xfc43('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x91ede3,_0xfc43('0x10'),JSON[_0xfc43('0x12')](_0x49cd71));if(_0x49cd71[_0xfc43('0x13')]){if(_0x49cd71[_0xfc43('0x13')][_0xfc43('0x14')]===0x1f4){logger[_0xfc43('0x13')](_0xfc43('0xf'),_0x91ede3,_0x49cd71[_0xfc43('0x13')][_0xfc43('0x15')]);return _0x943dd9(_0x49cd71['error'][_0xfc43('0x15')]);}logger['error'](_0xfc43('0xf'),_0x91ede3,_0x49cd71[_0xfc43('0x13')][_0xfc43('0x15')]);return _0x218a81(_0x49cd71[_0xfc43('0x13')][_0xfc43('0x15')]);}else{logger[_0xfc43('0xe')](_0xfc43('0xf'),_0x91ede3,_0xfc43('0x10'));_0x218a81(_0x49cd71['result'][_0xfc43('0x15')]);}})[_0xfc43('0x16')](function(_0xfeb098){logger[_0xfc43('0x13')](_0xfc43('0xf'),_0x91ede3,_0xfeb098);_0x943dd9(_0xfeb098);});});}