Built motion from commit 85328c08.|2.5.50
[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 _0x99b3=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x2c4820,_0x3f6ee4){var _0x2669c2=function(_0x4feeb6){while(--_0x4feeb6){_0x2c4820['push'](_0x2c4820['shift']());}};_0x2669c2(++_0x3f6ee4);}(_0x99b3,0x137));var _0x399b=function(_0x42bd52,_0x54433e){_0x42bd52=_0x42bd52-0x0;var _0x2ef3d1=_0x99b3[_0x42bd52];return _0x2ef3d1;};'use strict';var _=require(_0x399b('0x0'));var util=require(_0x399b('0x1'));var moment=require(_0x399b('0x2'));var BPromise=require(_0x399b('0x3'));var rs=require(_0x399b('0x4'));var fs=require('fs');var Redis=require(_0x399b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x399b('0x6'));var logger=require(_0x399b('0x7'))(_0x399b('0x8'));var config=require('../../config/environment');var jayson=require(_0x399b('0x9'));var client=jayson[_0x399b('0xa')][_0x399b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1c71,_0x404ae2,_0x1251bf){return new BPromise(function(_0x203455,_0xf4ba15){return client[_0x399b('0xc')](_0x4e1c71,_0x1251bf)[_0x399b('0xd')](function(_0x2f8afb){logger['info']('ZendeskField,\x20%s,\x20%s',_0x404ae2,_0x399b('0xe'));logger[_0x399b('0xf')](_0x399b('0x10'),_0x404ae2,_0x399b('0xe'),JSON['stringify'](_0x2f8afb));if(_0x2f8afb[_0x399b('0x11')]){if(_0x2f8afb[_0x399b('0x11')][_0x399b('0x12')]===0x1f4){logger[_0x399b('0x11')](_0x399b('0x13'),_0x404ae2,_0x2f8afb['error'][_0x399b('0x14')]);return _0xf4ba15(_0x2f8afb[_0x399b('0x11')][_0x399b('0x14')]);}logger[_0x399b('0x11')]('ZendeskField,\x20%s,\x20%s',_0x404ae2,_0x2f8afb['error'][_0x399b('0x14')]);return _0x203455(_0x2f8afb[_0x399b('0x11')][_0x399b('0x14')]);}else{logger[_0x399b('0x15')]('ZendeskField,\x20%s,\x20%s',_0x404ae2,_0x399b('0xe'));_0x203455(_0x2f8afb[_0x399b('0x16')][_0x399b('0x14')]);}})[_0x399b('0x17')](function(_0x54704a){logger[_0x399b('0x11')](_0x399b('0x13'),_0x404ae2,_0x54704a);_0xf4ba15(_0x54704a);});});}