Built motion from commit (unavailable).|2.5.24
[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 _0x3c2e=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../config/utils'];(function(_0x85032f,_0x1fca64){var _0x2e47fe=function(_0x4cc9b6){while(--_0x4cc9b6){_0x85032f['push'](_0x85032f['shift']());}};_0x2e47fe(++_0x1fca64);}(_0x3c2e,0xbb));var _0xe3c2=function(_0x26b43d,_0x1060a9){_0x26b43d=_0x26b43d-0x0;var _0x805479=_0x3c2e[_0x26b43d];return _0x805479;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3c2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3c2('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3c2('0x2'));var logger=require(_0xe3c2('0x3'))(_0xe3c2('0x4'));var config=require(_0xe3c2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe3c2('0x6')][_0xe3c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2549b5,_0x276ae4,_0x312de2){return new BPromise(function(_0x1471fd,_0x56cda7){return client['request'](_0x2549b5,_0x312de2)[_0xe3c2('0x8')](function(_0xf35644){logger[_0xe3c2('0x9')]('ZendeskField,\x20%s,\x20%s',_0x276ae4,_0xe3c2('0xa'));logger['debug'](_0xe3c2('0xb'),_0x276ae4,_0xe3c2('0xa'),JSON[_0xe3c2('0xc')](_0xf35644));if(_0xf35644[_0xe3c2('0xd')]){if(_0xf35644[_0xe3c2('0xd')][_0xe3c2('0xe')]===0x1f4){logger[_0xe3c2('0xd')](_0xe3c2('0xf'),_0x276ae4,_0xf35644['error'][_0xe3c2('0x10')]);return _0x56cda7(_0xf35644['error'][_0xe3c2('0x10')]);}logger[_0xe3c2('0xd')](_0xe3c2('0xf'),_0x276ae4,_0xf35644['error'][_0xe3c2('0x10')]);return _0x1471fd(_0xf35644[_0xe3c2('0xd')][_0xe3c2('0x10')]);}else{logger[_0xe3c2('0x9')](_0xe3c2('0xf'),_0x276ae4,_0xe3c2('0xa'));_0x1471fd(_0xf35644[_0xe3c2('0x11')][_0xe3c2('0x10')]);}})[_0xe3c2('0x12')](function(_0x521ff8){logger[_0xe3c2('0xd')](_0xe3c2('0xf'),_0x276ae4,_0x521ff8);_0x56cda7(_0x521ff8);});});}