Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / chatWebsite / index.js
index ed97ff4..1b2dbf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eff=['addProactiveActions','/:id/users','addAgents','update','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','post','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','originalname','/:id/logo','single','addLogo','join','server/files/images/avatars/','/:id/avatar','file','addAvatar','addCustomerAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','offline','addApplications'];(function(_0x75da66,_0x171a52){var _0x2aefc0=function(_0x590cea){while(--_0x590cea){_0x75da66['push'](_0x75da66['shift']());}};_0x2aefc0(++_0x171a52);}(_0x6eff,0xce));var _0xf6ef=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x6eff[_0x18cac4];return _0x2227c6;};'use strict';var multer=require(_0xf6ef('0x0'));var util=require('util');var path=require(_0xf6ef('0x1'));var timeout=require(_0xf6ef('0x2'));var express=require(_0xf6ef('0x3'));var router=express[_0xf6ef('0x4')]();var fs_extra=require(_0xf6ef('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6ef('0x6'));var controller=require(_0xf6ef('0x7'));router['get']('/',auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x9')]);router[_0xf6ef('0xa')](_0xf6ef('0xb'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0xc')]);router[_0xf6ef('0xa')](_0xf6ef('0xd'),auth['isAuthenticated'](),controller[_0xf6ef('0xe')]);router[_0xf6ef('0xa')](_0xf6ef('0xf'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x10')]);router['get'](_0xf6ef('0x11'),auth['isAuthenticated'](),controller[_0xf6ef('0x12')]);router['get']('/:id/logo',controller[_0xf6ef('0x13')]);router['get']('/:id/avatar',controller[_0xf6ef('0x14')]);router[_0xf6ef('0xa')]('/:id/customer_avatar',controller[_0xf6ef('0x15')]);router[_0xf6ef('0xa')](_0xf6ef('0x16'),controller[_0xf6ef('0x17')]);router[_0xf6ef('0xa')](_0xf6ef('0x18'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xf6ef('0xa')](_0xf6ef('0x19'),controller[_0xf6ef('0x1a')]);router[_0xf6ef('0xa')](_0xf6ef('0x1b'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x1c')]);router[_0xf6ef('0xa')](_0xf6ef('0x1d'),auth['isAuthenticated'](),controller[_0xf6ef('0x1e')]);router[_0xf6ef('0xa')](_0xf6ef('0x1f'),controller['getFields']);router[_0xf6ef('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xf6ef('0x20')]('/',auth[_0xf6ef('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x21')]);router[_0xf6ef('0x20')](_0xf6ef('0x11'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x22')]);var upload=multer({'storage':multer[_0xf6ef('0x23')]({'destination':function(_0x4e5c35,_0xe4c46c,_0x3ee193){_0x3ee193(null,path['join'](config[_0xf6ef('0x24')],'server/files/images/logos/'));},'filename':function(_0x1548c1,_0x1fce5a,_0x357bd2){_0x357bd2(null,util[_0xf6ef('0x25')](_0xf6ef('0x26'),Date[_0xf6ef('0x27')](),_0x1fce5a[_0xf6ef('0x28')]));}})});router[_0xf6ef('0x20')](_0xf6ef('0x29'),upload[_0xf6ef('0x2a')]('file'),controller[_0xf6ef('0x2b')]);var upload=multer({'storage':multer[_0xf6ef('0x23')]({'destination':function(_0x2dfe1a,_0xb68853,_0x4bdcdb){_0x4bdcdb(null,path[_0xf6ef('0x2c')](config[_0xf6ef('0x24')],_0xf6ef('0x2d')));},'filename':function(_0x30cd2a,_0x53ed60,_0x1f413f){_0x1f413f(null,util[_0xf6ef('0x25')](_0xf6ef('0x26'),Date[_0xf6ef('0x27')](),_0x53ed60[_0xf6ef('0x28')]));}})});router[_0xf6ef('0x20')](_0xf6ef('0x2e'),upload[_0xf6ef('0x2a')](_0xf6ef('0x2f')),controller[_0xf6ef('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4affbd,_0x4e1af6,_0x3a1c46){_0x3a1c46(null,path[_0xf6ef('0x2c')](config['root'],_0xf6ef('0x2d')));},'filename':function(_0x471ae2,_0xb61091,_0x298159){_0x298159(null,util['format']('%s-%s',Date[_0xf6ef('0x27')](),_0xb61091['originalname']));}})});router[_0xf6ef('0x20')]('/:id/customer_avatar',upload[_0xf6ef('0x2a')](_0xf6ef('0x2f')),controller[_0xf6ef('0x31')]);var upload=multer({'storage':multer[_0xf6ef('0x23')]({'destination':function(_0x2cd821,_0x16dbcf,_0xed822f){_0xed822f(null,path['join'](config[_0xf6ef('0x24')],'server/files/images/avatars/'));},'filename':function(_0x1e1670,_0x44f4cd,_0x81b1bb){_0x81b1bb(null,util[_0xf6ef('0x25')](_0xf6ef('0x26'),Date[_0xf6ef('0x27')](),_0x44f4cd[_0xf6ef('0x28')]));}})});router[_0xf6ef('0x20')](_0xf6ef('0x16'),upload['single'](_0xf6ef('0x2f')),controller['addSystemAvatar']);router['post'](_0xf6ef('0x32'),controller[_0xf6ef('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xf6ef('0x23')]({'destination':function(_0x1a6b60,_0x12cddd,_0x3cd71d){const _0x355dc5=path['join'](config['root'],'server/files',_0xf6ef('0x34'),_0xf6ef('0x35'));fs_extra[_0xf6ef('0x36')](_0x355dc5,function(){_0x3cd71d(null,_0x355dc5);});},'filename':function(_0x4f26dc,_0x120f12,_0x59c315){const _0x14b922=_0x120f12['originalname'][_0xf6ef('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7d7970=path['extname'](_0x14b922);const _0xd9cd8f=Date['now']()+'-'+_0x14b922['replace'](_0x7d7970,'')+_0x7d7970;_0x59c315(null,_0xd9cd8f);}})});router[_0xf6ef('0x20')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xf6ef('0x38')]);router['post'](_0xf6ef('0x18'),auth[_0xf6ef('0x8')](),controller['addInteraction']);router[_0xf6ef('0x20')](_0xf6ef('0x1b'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x39')]);router[_0xf6ef('0x20')](_0xf6ef('0x1d'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x3a')]);router[_0xf6ef('0x20')](_0xf6ef('0x3b'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x3c')]);router['put'](_0xf6ef('0xd'),auth['isAuthenticated'](),controller[_0xf6ef('0x3d')]);router[_0xf6ef('0x3e')](_0xf6ef('0xd'),auth[_0xf6ef('0x8')](),controller['destroy']);router['delete'](_0xf6ef('0xf'),auth[_0xf6ef('0x8')](),controller['removeDispositions']);router[_0xf6ef('0x3e')](_0xf6ef('0x11'),auth[_0xf6ef('0x8')](),controller[_0xf6ef('0x3f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xf6ef('0x40')]);module[_0xf6ef('0x41')]=router;
\ No newline at end of file
+var _0x0d1f=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','server/files/images/avatars/','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x0d1f,0x159));var _0xf0d1=function(_0x40a006,_0x29f2b0){_0x40a006=_0x40a006-0x0;var _0x57ce2a=_0x0d1f[_0x40a006];return _0x57ce2a;};'use strict';var multer=require(_0xf0d1('0x0'));var util=require(_0xf0d1('0x1'));var path=require('path');var timeout=require(_0xf0d1('0x2'));var express=require(_0xf0d1('0x3'));var router=express[_0xf0d1('0x4')]();var fs_extra=require(_0xf0d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf0d1('0x6'));var config=require(_0xf0d1('0x7'));var controller=require(_0xf0d1('0x8'));router['get']('/',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0xa')]);router[_0xf0d1('0xb')](_0xf0d1('0xc'),auth['isAuthenticated'](),controller[_0xf0d1('0xd')]);router['get'](_0xf0d1('0xe'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0xf')]);router['get'](_0xf0d1('0x10'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x11')]);router[_0xf0d1('0xb')](_0xf0d1('0x12'),auth[_0xf0d1('0x9')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0xf0d1('0xb')](_0xf0d1('0x13'),controller[_0xf0d1('0x14')]);router['get'](_0xf0d1('0x15'),controller[_0xf0d1('0x16')]);router[_0xf0d1('0xb')](_0xf0d1('0x17'),controller['getSystemAvatar']);router['get'](_0xf0d1('0x18'),auth['isAuthenticated'](),controller[_0xf0d1('0x19')]);router[_0xf0d1('0xb')](_0xf0d1('0x1a'),controller[_0xf0d1('0x1b')]);router['get'](_0xf0d1('0x1c'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x1d')]);router[_0xf0d1('0xb')](_0xf0d1('0x1e'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x1f')]);router['get'](_0xf0d1('0x20'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x21')]);router[_0xf0d1('0xb')](_0xf0d1('0x22'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x23')]);router['post']('/',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x24')]);router[_0xf0d1('0x25')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf0d1('0x26')]);router[_0xf0d1('0x25')]('/:id/canned_answers',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x27')]);var upload=multer({'storage':multer[_0xf0d1('0x28')]({'destination':function(_0x12fd78,_0x3a209a,_0x4a0529){_0x4a0529(null,path[_0xf0d1('0x29')](config[_0xf0d1('0x2a')],_0xf0d1('0x2b')));},'filename':function(_0x28c26e,_0x5a1f45,_0x4a80c3){_0x4a80c3(null,util[_0xf0d1('0x2c')](_0xf0d1('0x2d'),Date[_0xf0d1('0x2e')](),_0x5a1f45[_0xf0d1('0x2f')]));}})});router['post']('/:id/logo',upload['single'](_0xf0d1('0x30')),controller['addLogo']);var upload=multer({'storage':multer[_0xf0d1('0x28')]({'destination':function(_0x271f04,_0x554400,_0x3b2515){_0x3b2515(null,path[_0xf0d1('0x29')](config[_0xf0d1('0x2a')],_0xf0d1('0x31')));},'filename':function(_0x512d51,_0x4465c6,_0x3064c1){_0x3064c1(null,util[_0xf0d1('0x2c')]('%s-%s',Date[_0xf0d1('0x2e')](),_0x4465c6['originalname']));}})});router[_0xf0d1('0x25')](_0xf0d1('0x13'),upload[_0xf0d1('0x32')](_0xf0d1('0x30')),controller[_0xf0d1('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x118236,_0xa7e4ca,_0x2eb861){_0x2eb861(null,path[_0xf0d1('0x29')](config[_0xf0d1('0x2a')],_0xf0d1('0x31')));},'filename':function(_0x41e3ab,_0x5231a4,_0x8f319a){_0x8f319a(null,util['format'](_0xf0d1('0x2d'),Date[_0xf0d1('0x2e')](),_0x5231a4[_0xf0d1('0x2f')]));}})});router['post']('/:id/customer_avatar',upload[_0xf0d1('0x32')]('file'),controller[_0xf0d1('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a75cf,_0x3e3337,_0x3b54e8){_0x3b54e8(null,path[_0xf0d1('0x29')](config[_0xf0d1('0x2a')],_0xf0d1('0x31')));},'filename':function(_0x2c8ce8,_0x49ba07,_0x1d67e1){_0x1d67e1(null,util[_0xf0d1('0x2c')]('%s-%s',Date[_0xf0d1('0x2e')](),_0x49ba07[_0xf0d1('0x2f')]));}})});router['post'](_0xf0d1('0x17'),upload[_0xf0d1('0x32')](_0xf0d1('0x30')),controller[_0xf0d1('0x35')]);router['post'](_0xf0d1('0x36'),controller[_0xf0d1('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xf0d1('0x28')]({'destination':function(_0xf3979,_0x31bdb0,_0xa91728){const _0x439193=path['join'](config[_0xf0d1('0x2a')],_0xf0d1('0x38'),_0xf0d1('0x39'),_0xf0d1('0x3a'));fs_extra['ensureDir'](_0x439193,function(){_0xa91728(null,_0x439193);});},'filename':function(_0x3a4581,_0x4631ba,_0x770c6c){const _0x34f277=_0x4631ba['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x57943d=path['extname'](_0x34f277);const _0x5b3a5c=Date[_0xf0d1('0x2e')]()+'-'+_0x34f277[_0xf0d1('0x3b')](_0x57943d,'')+_0x57943d;_0x770c6c(null,_0x5b3a5c);}})});router['post']('/:id/offline',offlineUploadMulter[_0xf0d1('0x3c')](),controller['offline']);router['post']('/:id/interactions',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x3d')]);router[_0xf0d1('0x25')](_0xf0d1('0x1c'),auth['isAuthenticated'](),controller[_0xf0d1('0x3e')]);router[_0xf0d1('0x25')](_0xf0d1('0x1e'),auth['isAuthenticated'](),controller[_0xf0d1('0x3f')]);router[_0xf0d1('0x25')](_0xf0d1('0x22'),auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x40')]);router[_0xf0d1('0x41')]('/:id',auth['isAuthenticated'](),controller[_0xf0d1('0x42')]);router[_0xf0d1('0x43')]('/:id',auth['isAuthenticated'](),controller[_0xf0d1('0x44')]);router[_0xf0d1('0x43')](_0xf0d1('0x10'),auth['isAuthenticated'](),controller[_0xf0d1('0x45')]);router[_0xf0d1('0x43')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf0d1('0x46')]);router['delete']('/:id/users',auth[_0xf0d1('0x9')](),controller[_0xf0d1('0x47')]);module[_0xf0d1('0x48')]=router;
\ No newline at end of file