Built motion from commit c738b9ac.|2.6.25
[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 _0xa220=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s'];(function(_0x5a4862,_0x5c516e){var _0x3d7490=function(_0x138949){while(--_0x138949){_0x5a4862['push'](_0x5a4862['shift']());}};_0x3d7490(++_0x5c516e);}(_0xa220,0x10a));var _0x0a22=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa220[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0a22('0x0'));var util=require('util');var moment=require(_0x0a22('0x1'));var BPromise=require(_0x0a22('0x2'));var rs=require(_0x0a22('0x3'));var fs=require('fs');var Redis=require(_0x0a22('0x4'));var db=require(_0x0a22('0x5'))['db'];var utils=require(_0x0a22('0x6'));var logger=require(_0x0a22('0x7'))(_0x0a22('0x8'));var config=require(_0x0a22('0x9'));var jayson=require(_0x0a22('0xa'));var client=jayson[_0x0a22('0xb')][_0x0a22('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x178831,_0x3c3346,_0x570857){return new BPromise(function(_0x293f2c,_0x6dd4ee){return client[_0x0a22('0xd')](_0x178831,_0x570857)[_0x0a22('0xe')](function(_0x5c79de){logger[_0x0a22('0xf')]('ZendeskField,\x20%s,\x20%s',_0x3c3346,_0x0a22('0x10'));logger[_0x0a22('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3c3346,_0x0a22('0x10'),JSON[_0x0a22('0x12')](_0x5c79de));if(_0x5c79de[_0x0a22('0x13')]){if(_0x5c79de[_0x0a22('0x13')][_0x0a22('0x14')]===0x1f4){logger[_0x0a22('0x13')](_0x0a22('0x15'),_0x3c3346,_0x5c79de[_0x0a22('0x13')][_0x0a22('0x16')]);return _0x6dd4ee(_0x5c79de[_0x0a22('0x13')][_0x0a22('0x16')]);}logger[_0x0a22('0x13')](_0x0a22('0x15'),_0x3c3346,_0x5c79de['error'][_0x0a22('0x16')]);return _0x293f2c(_0x5c79de[_0x0a22('0x13')]['message']);}else{logger[_0x0a22('0xf')](_0x0a22('0x15'),_0x3c3346,_0x0a22('0x10'));_0x293f2c(_0x5c79de['result'][_0x0a22('0x16')]);}})[_0x0a22('0x17')](function(_0x581fac){logger[_0x0a22('0x13')](_0x0a22('0x15'),_0x3c3346,_0x581fac);_0x6dd4ee(_0x581fac);});});}