Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / chatWebsite / index.js
index b652126..1cdf22f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a62=['getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addSystemAvatar','notify','ensureDir','replace','/:id/offline','any','addProactiveActions','addAgents','delete','removeDispositions','removeAnswers','removeAgents','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar'];(function(_0x2dc0f,_0x2be249){var _0x5ac977=function(_0x5a0bc2){while(--_0x5a0bc2){_0x2dc0f['push'](_0x2dc0f['shift']());}};_0x5ac977(++_0x2be249);}(_0x9a62,0x1d0));var _0x29a6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9a62[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x29a6('0x0'));var router=express[_0x29a6('0x1')]();var fs_extra=require(_0x29a6('0x2'));var auth=require(_0x29a6('0x3'));var interaction=require(_0x29a6('0x4'));var config=require('../../config/environment');var controller=require(_0x29a6('0x5'));router[_0x29a6('0x6')]('/',auth[_0x29a6('0x7')](),controller['index']);router[_0x29a6('0x6')](_0x29a6('0x8'),auth['isAuthenticated'](),controller[_0x29a6('0x9')]);router['get'](_0x29a6('0xa'),auth[_0x29a6('0x7')](),controller[_0x29a6('0xb')]);router[_0x29a6('0x6')](_0x29a6('0xc'),auth[_0x29a6('0x7')](),controller[_0x29a6('0xd')]);router[_0x29a6('0x6')]('/:id/canned_answers',auth[_0x29a6('0x7')](),controller['getAnswers']);router[_0x29a6('0x6')](_0x29a6('0xe'),controller['getLogo']);router['get'](_0x29a6('0xf'),controller[_0x29a6('0x10')]);router['get']('/:id/customer_avatar',controller[_0x29a6('0x11')]);router[_0x29a6('0x6')](_0x29a6('0x12'),controller['getSystemAvatar']);router['get'](_0x29a6('0x13'),auth[_0x29a6('0x7')](),controller['getInteractions']);router[_0x29a6('0x6')](_0x29a6('0x14'),controller[_0x29a6('0x15')]);router['get'](_0x29a6('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0x29a6('0x6')](_0x29a6('0x17'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x18')]);router[_0x29a6('0x6')]('/:id/fields',controller[_0x29a6('0x19')]);router[_0x29a6('0x6')](_0x29a6('0x1a'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x1b')]);router[_0x29a6('0x6')](_0x29a6('0x1c'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x1d')]);router[_0x29a6('0x1e')]('/',auth['isAuthenticated'](),controller[_0x29a6('0x1f')]);router[_0x29a6('0x1e')](_0x29a6('0xc'),auth[_0x29a6('0x7')](),controller['addDisposition']);router[_0x29a6('0x1e')](_0x29a6('0x20'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x21')]);var upload=multer({'storage':multer[_0x29a6('0x22')]({'destination':function(_0x101a00,_0x400d96,_0xfad3f3){_0xfad3f3(null,path[_0x29a6('0x23')](config[_0x29a6('0x24')],_0x29a6('0x25')));},'filename':function(_0x1fe4f8,_0xaa411c,_0x214f00){_0x214f00(null,util['format'](_0x29a6('0x26'),Date[_0x29a6('0x27')](),_0xaa411c[_0x29a6('0x28')]));}})});router[_0x29a6('0x1e')](_0x29a6('0xe'),upload[_0x29a6('0x29')](_0x29a6('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0x29a6('0x22')]({'destination':function(_0x2fa30f,_0x2f58d4,_0x3e02b6){_0x3e02b6(null,path[_0x29a6('0x23')](config[_0x29a6('0x24')],_0x29a6('0x2b')));},'filename':function(_0x38d4c5,_0x5a3ff6,_0x264768){_0x264768(null,util[_0x29a6('0x2c')](_0x29a6('0x26'),Date[_0x29a6('0x27')](),_0x5a3ff6[_0x29a6('0x28')]));}})});router[_0x29a6('0x1e')](_0x29a6('0xf'),upload['single'](_0x29a6('0x2a')),controller[_0x29a6('0x2d')]);var upload=multer({'storage':multer[_0x29a6('0x22')]({'destination':function(_0x1d7aae,_0x339edb,_0x16a468){_0x16a468(null,path['join'](config[_0x29a6('0x24')],'server/files/images/avatars/'));},'filename':function(_0x5f55ae,_0x505673,_0x200196){_0x200196(null,util[_0x29a6('0x2c')](_0x29a6('0x26'),Date[_0x29a6('0x27')](),_0x505673[_0x29a6('0x28')]));}})});router[_0x29a6('0x1e')](_0x29a6('0x2e'),upload[_0x29a6('0x29')](_0x29a6('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x29a6('0x22')]({'destination':function(_0x543c39,_0x2a7f69,_0x45a96a){_0x45a96a(null,path[_0x29a6('0x23')](config['root'],_0x29a6('0x2b')));},'filename':function(_0x22cd57,_0x237eeb,_0x2c1813){_0x2c1813(null,util[_0x29a6('0x2c')](_0x29a6('0x26'),Date[_0x29a6('0x27')](),_0x237eeb[_0x29a6('0x28')]));}})});router['post'](_0x29a6('0x12'),upload[_0x29a6('0x29')]('file'),controller[_0x29a6('0x2f')]);router[_0x29a6('0x1e')]('/:id/notify',controller[_0x29a6('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x29a6('0x22')]({'destination':function(_0x1cb0a3,_0x21f2cb,_0x509bb4){const _0x42b08a=path[_0x29a6('0x23')](config[_0x29a6('0x24')],'server/files','attachments','offline-chat');fs_extra[_0x29a6('0x31')](_0x42b08a,function(){_0x509bb4(null,_0x42b08a);});},'filename':function(_0x3c7f69,_0x521976,_0x588444){const _0x46c639=_0x521976[_0x29a6('0x28')][_0x29a6('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x46346e=path['extname'](_0x46c639);const _0x402c72=Date[_0x29a6('0x27')]()+'-'+_0x46c639[_0x29a6('0x32')](_0x46346e,'')+_0x46346e;_0x588444(null,_0x402c72);}})});router[_0x29a6('0x1e')](_0x29a6('0x33'),offlineUploadMulter[_0x29a6('0x34')](),controller['offline']);router[_0x29a6('0x1e')](_0x29a6('0x13'),auth[_0x29a6('0x7')](),controller['addInteraction']);router['post'](_0x29a6('0x16'),auth[_0x29a6('0x7')](),controller['addApplications']);router[_0x29a6('0x1e')](_0x29a6('0x17'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x35')]);router[_0x29a6('0x1e')](_0x29a6('0x1c'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x36')]);router['put'](_0x29a6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x29a6('0x37')](_0x29a6('0xa'),auth[_0x29a6('0x7')](),controller['destroy']);router[_0x29a6('0x37')](_0x29a6('0xc'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x38')]);router[_0x29a6('0x37')](_0x29a6('0x20'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x39')]);router[_0x29a6('0x37')](_0x29a6('0x1c'),auth[_0x29a6('0x7')](),controller[_0x29a6('0x3a')]);module[_0x29a6('0x3b')]=router;
\ No newline at end of file
+var _0x7352=['/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','server/files/images/avatars/','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo'];(function(_0x2426a2,_0x46da0d){var _0x5cedd1=function(_0x26e52e){while(--_0x26e52e){_0x2426a2['push'](_0x2426a2['shift']());}};_0x5cedd1(++_0x46da0d);}(_0x7352,0x10d));var _0x2735=function(_0x136e11,_0x29bd0b){_0x136e11=_0x136e11-0x0;var _0x36d346=_0x7352[_0x136e11];return _0x36d346;};'use strict';var multer=require(_0x2735('0x0'));var util=require(_0x2735('0x1'));var path=require(_0x2735('0x2'));var timeout=require('connect-timeout');var express=require(_0x2735('0x3'));var router=express[_0x2735('0x4')]();var fs_extra=require(_0x2735('0x5'));var auth=require(_0x2735('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2735('0x7'));var controller=require(_0x2735('0x8'));router[_0x2735('0x9')]('/',auth['isAuthenticated'](),controller[_0x2735('0xa')]);router['get']('/describe',auth[_0x2735('0xb')](),controller[_0x2735('0xc')]);router['get'](_0x2735('0xd'),auth['isAuthenticated'](),controller[_0x2735('0xe')]);router['get'](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['getDispositions']);router[_0x2735('0x9')](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x11')]);router['get'](_0x2735('0x12'),controller['getLogo']);router[_0x2735('0x9')](_0x2735('0x13'),controller[_0x2735('0x14')]);router[_0x2735('0x9')]('/:id/customer_avatar',controller[_0x2735('0x15')]);router['get']('/:id/system_avatar',controller[_0x2735('0x16')]);router['get'](_0x2735('0x17'),auth[_0x2735('0xb')](),controller[_0x2735('0x18')]);router[_0x2735('0x9')](_0x2735('0x19'),controller[_0x2735('0x1a')]);router[_0x2735('0x9')](_0x2735('0x1b'),auth[_0x2735('0xb')](),controller['getApplications']);router['get'](_0x2735('0x1c'),auth[_0x2735('0xb')](),controller['getProactiveActions']);router['get'](_0x2735('0x1d'),controller[_0x2735('0x1e')]);router[_0x2735('0x9')](_0x2735('0x1f'),auth[_0x2735('0xb')](),controller[_0x2735('0x20')]);router[_0x2735('0x9')]('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x21')]);router[_0x2735('0x22')]('/',auth[_0x2735('0xb')](),controller[_0x2735('0x23')]);router[_0x2735('0x22')](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['addDisposition']);router[_0x2735('0x22')](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x24')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x52dc57,_0x57cf0b,_0x562f76){_0x562f76(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x28')));},'filename':function(_0x4b52e3,_0x91d68d,_0x3299a0){_0x3299a0(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x91d68d['originalname']));}})});router[_0x2735('0x22')](_0x2735('0x12'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller[_0x2735('0x2e')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x401598,_0x1fd969,_0xa63d39){_0xa63d39(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x2f')));},'filename':function(_0xdff0a,_0x4418b0,_0x1258c2){_0x1258c2(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x4418b0[_0x2735('0x30')]));}})});router['post'](_0x2735('0x13'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x48b6f9,_0x201be3,_0x1af84d){_0x1af84d(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x2f')));},'filename':function(_0x21fd4b,_0x5e7f10,_0xdab324){_0xdab324(null,util['format']('%s-%s',Date[_0x2735('0x2b')](),_0x5e7f10[_0x2735('0x30')]));}})});router['post'](_0x2735('0x31'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller[_0x2735('0x32')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x74bb9a,_0x336135,_0x122df1){_0x122df1(null,path[_0x2735('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x493887,_0x75ea87,_0x563e3e){_0x563e3e(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x75ea87['originalname']));}})});router[_0x2735('0x22')](_0x2735('0x33'),upload[_0x2735('0x2c')]('file'),controller[_0x2735('0x34')]);router[_0x2735('0x22')](_0x2735('0x35'),controller[_0x2735('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x28410a,_0x3c1291,_0x190679){const _0x3e137f=path[_0x2735('0x26')](config[_0x2735('0x27')],'server/files',_0x2735('0x37'),_0x2735('0x38'));fs_extra[_0x2735('0x39')](_0x3e137f,function(){_0x190679(null,_0x3e137f);});},'filename':function(_0x415943,_0x421385,_0x55616c){const _0xcebd1a=_0x421385[_0x2735('0x30')][_0x2735('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5e2f04=path[_0x2735('0x3b')](_0xcebd1a);const _0x3680f4=Date[_0x2735('0x2b')]()+'-'+_0xcebd1a[_0x2735('0x3a')](_0x5e2f04,'')+_0x5e2f04;_0x55616c(null,_0x3680f4);}})});router['post'](_0x2735('0x3c'),offlineUploadMulter[_0x2735('0x3d')](),controller[_0x2735('0x3e')]);router[_0x2735('0x22')](_0x2735('0x17'),auth[_0x2735('0xb')](),controller[_0x2735('0x3f')]);router['post']('/:id/applications',auth[_0x2735('0xb')](),controller[_0x2735('0x40')]);router[_0x2735('0x22')](_0x2735('0x1c'),auth[_0x2735('0xb')](),controller[_0x2735('0x41')]);router[_0x2735('0x22')]('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x42')]);router[_0x2735('0x43')](_0x2735('0xd'),auth['isAuthenticated'](),controller[_0x2735('0x44')]);router['delete'](_0x2735('0xd'),auth[_0x2735('0xb')](),controller['destroy']);router['delete'](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['removeDispositions']);router['delete'](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x45')]);router['delete']('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x46')]);module[_0x2735('0x47')]=router;
\ No newline at end of file