Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / chatWebsite / index.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 _0x4a45=['create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','join','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','/:id/offline','offline','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','post'];(function(_0x260057,_0x3666ee){var _0x519b3e=function(_0x153070){while(--_0x153070){_0x260057['push'](_0x260057['shift']());}};_0x519b3e(++_0x3666ee);}(_0x4a45,0x1f3));var _0x54a4=function(_0x456c27,_0x44a9df){_0x456c27=_0x456c27-0x0;var _0xb294ef=_0x4a45[_0x456c27];return _0xb294ef;};'use strict';var multer=require(_0x54a4('0x0'));var util=require(_0x54a4('0x1'));var path=require(_0x54a4('0x2'));var timeout=require(_0x54a4('0x3'));var express=require(_0x54a4('0x4'));var router=express[_0x54a4('0x5')]();var auth=require(_0x54a4('0x6'));var interaction=require(_0x54a4('0x7'));var config=require(_0x54a4('0x8'));var controller=require(_0x54a4('0x9'));router[_0x54a4('0xa')]('/',auth[_0x54a4('0xb')](),controller[_0x54a4('0xc')]);router[_0x54a4('0xa')](_0x54a4('0xd'),auth[_0x54a4('0xb')](),controller[_0x54a4('0xe')]);router['get'](_0x54a4('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x54a4('0xa')](_0x54a4('0x10'),auth[_0x54a4('0xb')](),controller['getDispositions']);router['get'](_0x54a4('0x11'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x12')]);router[_0x54a4('0xa')](_0x54a4('0x13'),controller[_0x54a4('0x14')]);router[_0x54a4('0xa')](_0x54a4('0x15'),controller[_0x54a4('0x16')]);router[_0x54a4('0xa')]('/:id/customer_avatar',controller[_0x54a4('0x17')]);router[_0x54a4('0xa')](_0x54a4('0x18'),controller[_0x54a4('0x19')]);router[_0x54a4('0xa')](_0x54a4('0x1a'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x1b')]);router[_0x54a4('0xa')](_0x54a4('0x1c'),controller['getSnippet']);router['get'](_0x54a4('0x1d'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x1e')]);router['get'](_0x54a4('0x1f'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x20')]);router[_0x54a4('0xa')](_0x54a4('0x21'),controller['getFields']);router[_0x54a4('0xa')](_0x54a4('0x22'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x23')]);router[_0x54a4('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x54a4('0x24')]('/',auth[_0x54a4('0xb')](),controller[_0x54a4('0x25')]);router[_0x54a4('0x24')](_0x54a4('0x10'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x26')]);router['post'](_0x54a4('0x11'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x27')]);var upload=multer({'storage':multer[_0x54a4('0x28')]({'destination':function(_0x4c0a6d,_0x2797a0,_0x288077){_0x288077(null,path['join'](config[_0x54a4('0x29')],_0x54a4('0x2a')));},'filename':function(_0x9faa1f,_0xfd92f,_0x285e2c){_0x285e2c(null,util[_0x54a4('0x2b')](_0x54a4('0x2c'),Date['now'](),_0xfd92f[_0x54a4('0x2d')]));}})});router[_0x54a4('0x24')](_0x54a4('0x13'),upload[_0x54a4('0x2e')](_0x54a4('0x2f')),controller[_0x54a4('0x30')]);var upload=multer({'storage':multer[_0x54a4('0x28')]({'destination':function(_0x1fd593,_0x2962a1,_0x23253e){_0x23253e(null,path[_0x54a4('0x31')](config[_0x54a4('0x29')],_0x54a4('0x32')));},'filename':function(_0x476977,_0x513299,_0x4ce1d8){_0x4ce1d8(null,util[_0x54a4('0x2b')](_0x54a4('0x2c'),Date[_0x54a4('0x33')](),_0x513299[_0x54a4('0x2d')]));}})});router[_0x54a4('0x24')](_0x54a4('0x15'),upload[_0x54a4('0x2e')](_0x54a4('0x2f')),controller[_0x54a4('0x34')]);var upload=multer({'storage':multer[_0x54a4('0x28')]({'destination':function(_0x1ebd31,_0x3c6501,_0x18f18c){_0x18f18c(null,path[_0x54a4('0x31')](config[_0x54a4('0x29')],_0x54a4('0x32')));},'filename':function(_0x25a266,_0x2beae6,_0x312c01){_0x312c01(null,util[_0x54a4('0x2b')](_0x54a4('0x2c'),Date[_0x54a4('0x33')](),_0x2beae6[_0x54a4('0x2d')]));}})});router[_0x54a4('0x24')](_0x54a4('0x35'),upload['single']('file'),controller[_0x54a4('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x593872,_0x15a8e0,_0x2c6f39){_0x2c6f39(null,path[_0x54a4('0x31')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x486c59,_0x21f0fc,_0x1aa90d){_0x1aa90d(null,util['format'](_0x54a4('0x2c'),Date[_0x54a4('0x33')](),_0x21f0fc[_0x54a4('0x2d')]));}})});router[_0x54a4('0x24')](_0x54a4('0x18'),upload[_0x54a4('0x2e')](_0x54a4('0x2f')),controller['addSystemAvatar']);router['post'](_0x54a4('0x37'),controller[_0x54a4('0x38')]);router[_0x54a4('0x24')](_0x54a4('0x39'),controller[_0x54a4('0x3a')]);router['post'](_0x54a4('0x1a'),auth[_0x54a4('0xb')](),controller['addInteraction']);router[_0x54a4('0x24')](_0x54a4('0x1d'),auth[_0x54a4('0xb')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x54a4('0x3b')]);router[_0x54a4('0x24')]('/:id/users',auth[_0x54a4('0xb')](),controller[_0x54a4('0x3c')]);router['put']('/:id',auth[_0x54a4('0xb')](),controller[_0x54a4('0x3d')]);router[_0x54a4('0x3e')](_0x54a4('0xf'),auth[_0x54a4('0xb')](),controller[_0x54a4('0x3f')]);router[_0x54a4('0x3e')](_0x54a4('0x10'),auth['isAuthenticated'](),controller[_0x54a4('0x40')]);router[_0x54a4('0x3e')](_0x54a4('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x54a4('0x3e')]('/:id/users',auth[_0x54a4('0xb')](),controller[_0x54a4('0x41')]);module[_0x54a4('0x42')]=router;