Built motion from commit 25580385.|2.6.2
[motion2.git] / server / api / cmCustomField / cmCustomField.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 _0xce92=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','CmCustomField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x506df9,_0x1b3001){var _0x26b786=function(_0x1bbea4){while(--_0x1bbea4){_0x506df9['push'](_0x506df9['shift']());}};_0x26b786(++_0x1b3001);}(_0xce92,0x195));var _0x2ce9=function(_0x5a6d3b,_0x15a93b){_0x5a6d3b=_0x5a6d3b-0x0;var _0x3aaf17=_0xce92[_0x5a6d3b];return _0x3aaf17;};'use strict';var _=require(_0x2ce9('0x0'));var util=require(_0x2ce9('0x1'));var moment=require(_0x2ce9('0x2'));var BPromise=require(_0x2ce9('0x3'));var rs=require(_0x2ce9('0x4'));var fs=require('fs');var Redis=require(_0x2ce9('0x5'));var db=require(_0x2ce9('0x6'))['db'];var utils=require(_0x2ce9('0x7'));var logger=require('../../config/logger')(_0x2ce9('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ce9('0x9'));var client=jayson[_0x2ce9('0xa')][_0x2ce9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25184d,_0x56f94d,_0x2377aa){return new BPromise(function(_0x254db2,_0x494331){return client[_0x2ce9('0xc')](_0x25184d,_0x2377aa)[_0x2ce9('0xd')](function(_0x12c543){logger[_0x2ce9('0xe')]('CmCustomField,\x20%s,\x20%s',_0x56f94d,_0x2ce9('0xf'));logger[_0x2ce9('0x10')](_0x2ce9('0x11'),_0x56f94d,_0x2ce9('0xf'),JSON[_0x2ce9('0x12')](_0x12c543));if(_0x12c543['error']){if(_0x12c543['error']['code']===0x1f4){logger[_0x2ce9('0x13')]('CmCustomField,\x20%s,\x20%s',_0x56f94d,_0x12c543[_0x2ce9('0x13')][_0x2ce9('0x14')]);return _0x494331(_0x12c543['error'][_0x2ce9('0x14')]);}logger[_0x2ce9('0x13')](_0x2ce9('0x15'),_0x56f94d,_0x12c543[_0x2ce9('0x13')]['message']);return _0x254db2(_0x12c543['error'][_0x2ce9('0x14')]);}else{logger[_0x2ce9('0xe')](_0x2ce9('0x15'),_0x56f94d,_0x2ce9('0xf'));_0x254db2(_0x12c543[_0x2ce9('0x16')][_0x2ce9('0x14')]);}})[_0x2ce9('0x17')](function(_0x317087){logger[_0x2ce9('0x13')](_0x2ce9('0x15'),_0x56f94d,_0x317087);_0x494331(_0x317087);});});}