Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / user / 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 _0x5744=['index','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','addQueues','join','root','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x5744,0x65));var _0x4574=function(_0x523332,_0x586247){_0x523332=_0x523332-0x0;var _0x46dd88=_0x5744[_0x523332];return _0x46dd88;};'use strict';var multer=require(_0x4574('0x0'));var util=require(_0x4574('0x1'));var path=require(_0x4574('0x2'));var timeout=require('connect-timeout');var express=require(_0x4574('0x3'));var router=express[_0x4574('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4574('0x5'));var interaction=require(_0x4574('0x6'));var config=require(_0x4574('0x7'));var controller=require(_0x4574('0x8'));router['get']('/',auth[_0x4574('0x9')](),controller[_0x4574('0xa')]);router[_0x4574('0xb')](_0x4574('0xc'),auth[_0x4574('0x9')](),controller[_0x4574('0xd')]);router[_0x4574('0xb')](_0x4574('0xe'),auth[_0x4574('0x9')](),controller[_0x4574('0xf')]);router[_0x4574('0xb')](_0x4574('0x10'),auth[_0x4574('0x9')](),controller[_0x4574('0x11')]);router[_0x4574('0xb')](_0x4574('0x12'),auth[_0x4574('0x9')](),controller[_0x4574('0x13')]);router[_0x4574('0xb')](_0x4574('0x14'),controller['getAvatar']);router['get'](_0x4574('0x15'),auth[_0x4574('0x9')](),controller['getOpenTabs']);router[_0x4574('0xb')](_0x4574('0x16'),auth[_0x4574('0x9')](),controller[_0x4574('0x17')]);router['get'](_0x4574('0x18'),auth[_0x4574('0x9')](),controller[_0x4574('0x19')]);router[_0x4574('0xb')](_0x4574('0x1a'),auth[_0x4574('0x9')](),controller[_0x4574('0x1b')]);router['get'](_0x4574('0x1c'),auth['isAuthenticated'](),controller[_0x4574('0x1d')]);router[_0x4574('0xb')](_0x4574('0x1e'),auth[_0x4574('0x9')](),controller['getRecordings']);router[_0x4574('0xb')](_0x4574('0x1f'),auth[_0x4574('0x9')](),controller[_0x4574('0x20')]);router['get']('/:id/chat/interactions',auth[_0x4574('0x9')](),controller['getChatInteractions']);router[_0x4574('0xb')]('/:id/openchannel/interactions',auth[_0x4574('0x9')](),controller[_0x4574('0x21')]);router[_0x4574('0xb')](_0x4574('0x22'),auth['isAuthenticated'](),controller[_0x4574('0x23')]);router['get'](_0x4574('0x24'),auth[_0x4574('0x9')](),controller[_0x4574('0x25')]);router[_0x4574('0xb')]('/:id/fax/interactions',auth[_0x4574('0x9')](),controller['getFaxInteractions']);router[_0x4574('0xb')](_0x4574('0x26'),auth[_0x4574('0x9')](),controller['getWhatsappInteractions']);router[_0x4574('0xb')](_0x4574('0x27'),auth[_0x4574('0x9')](),controller[_0x4574('0x28')]);router['get']('/:id/lists',auth[_0x4574('0x9')](),controller[_0x4574('0x29')]);router[_0x4574('0xb')]('/:id/agents',auth[_0x4574('0x9')](),controller[_0x4574('0x2a')]);router['get'](_0x4574('0x2b'),auth['isAuthenticated'](),controller[_0x4574('0x2c')]);router[_0x4574('0xb')](_0x4574('0x2d'),auth[_0x4574('0x9')](),controller[_0x4574('0x2e')]);router[_0x4574('0xb')](_0x4574('0x2f'),auth[_0x4574('0x9')](),controller['getMailAccounts']);router[_0x4574('0xb')](_0x4574('0x30'),auth[_0x4574('0x9')](),controller[_0x4574('0x31')]);router[_0x4574('0xb')](_0x4574('0x32'),auth[_0x4574('0x9')](),controller[_0x4574('0x33')]);router[_0x4574('0xb')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x4574('0x34')]);router[_0x4574('0xb')](_0x4574('0x35'),auth['isAuthenticated'](),controller[_0x4574('0x36')]);router[_0x4574('0xb')](_0x4574('0x37'),auth[_0x4574('0x9')](),controller['getSquareProjects']);router[_0x4574('0xb')](_0x4574('0x38'),auth[_0x4574('0x9')](),controller[_0x4574('0x39')]);router[_0x4574('0xb')](_0x4574('0x3a'),auth[_0x4574('0x9')](),controller[_0x4574('0x3b')]);router[_0x4574('0x3c')](_0x4574('0x16'),auth['isAuthenticated'](),controller['addContacts']);router[_0x4574('0x3c')]('/',auth[_0x4574('0x9')](),controller['create']);router['post'](_0x4574('0x3d'),auth[_0x4574('0x9')](),controller['bulkCreate']);router[_0x4574('0x3c')](_0x4574('0x18'),auth['isAuthenticated'](),controller[_0x4574('0x3e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19aa11,_0x17bc84,_0x1d1382){_0x1d1382(null,path[_0x4574('0x3f')](config[_0x4574('0x40')],'server/files/images/'));},'filename':function(_0x445d47,_0x192e0,_0x4efcdd){_0x4efcdd(null,util['format'](_0x4574('0x41'),Date['now'](),_0x192e0[_0x4574('0x42')]));}})});router[_0x4574('0x3c')]('/:id/avatar',upload[_0x4574('0x43')](_0x4574('0x44')),controller[_0x4574('0x45')]);router['post'](_0x4574('0x46'),auth[_0x4574('0x9')](),controller[_0x4574('0x47')]);router[_0x4574('0x3c')](_0x4574('0x48'),auth['isAuthenticated'](),controller[_0x4574('0x49')]);router[_0x4574('0x3c')](_0x4574('0x4a'),auth[_0x4574('0x9')](),controller[_0x4574('0x4b')]);router[_0x4574('0x3c')](_0x4574('0x4c'),auth[_0x4574('0x9')](),controller['unpause']);router[_0x4574('0x3c')]('/:id/teams',auth[_0x4574('0x9')](),controller[_0x4574('0x4d')]);router[_0x4574('0x3c')](_0x4574('0x4e'),auth[_0x4574('0x9')](),controller['addChatInteractions']);router[_0x4574('0x3c')](_0x4574('0x4f'),auth['isAuthenticated'](),controller[_0x4574('0x50')]);router[_0x4574('0x3c')]('/:id/fax_interactions',auth[_0x4574('0x9')](),controller[_0x4574('0x51')]);router[_0x4574('0x3c')]('/:id/sms_interactions',auth[_0x4574('0x9')](),controller[_0x4574('0x52')]);router[_0x4574('0x3c')]('/:id/openchannel_interactions',auth[_0x4574('0x9')](),controller[_0x4574('0x53')]);router[_0x4574('0x3c')](_0x4574('0x54'),auth['isAuthenticated'](),controller[_0x4574('0x55')]);router[_0x4574('0x3c')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x4574('0x3c')](_0x4574('0x2f'),auth[_0x4574('0x9')](),controller['addMailAccounts']);router[_0x4574('0x3c')](_0x4574('0x30'),auth[_0x4574('0x9')](),controller[_0x4574('0x56')]);router[_0x4574('0x3c')](_0x4574('0x32'),auth['isAuthenticated'](),controller[_0x4574('0x57')]);router[_0x4574('0x3c')](_0x4574('0x58'),auth[_0x4574('0x9')](),controller[_0x4574('0x59')]);router[_0x4574('0x3c')](_0x4574('0x35'),auth['isAuthenticated'](),controller[_0x4574('0x5a')]);router['post'](_0x4574('0x37'),auth['isAuthenticated'](),controller[_0x4574('0x5b')]);router[_0x4574('0x3c')](_0x4574('0x3a'),auth['isAuthenticated'](),controller[_0x4574('0x5c')]);router[_0x4574('0x5d')](_0x4574('0x12'),auth[_0x4574('0x9')](),controller[_0x4574('0x5e')]);router[_0x4574('0x5d')]('/:id/password',auth[_0x4574('0x9')](),controller[_0x4574('0x5f')]);router['delete'](_0x4574('0x18'),auth['isAuthenticated'](),controller[_0x4574('0x60')]);router[_0x4574('0x61')](_0x4574('0x27'),auth[_0x4574('0x9')](),controller[_0x4574('0x62')]);router[_0x4574('0x61')](_0x4574('0x12'),auth[_0x4574('0x9')](),controller[_0x4574('0x63')]);router['delete'](_0x4574('0x4e'),auth[_0x4574('0x9')](),controller[_0x4574('0x64')]);router['delete'](_0x4574('0x4f'),auth[_0x4574('0x9')](),controller[_0x4574('0x65')]);router['delete'](_0x4574('0x66'),auth[_0x4574('0x9')](),controller[_0x4574('0x67')]);router['delete'](_0x4574('0x68'),auth['isAuthenticated'](),controller[_0x4574('0x69')]);router['delete']('/:id/openchannel_interactions',auth[_0x4574('0x9')](),controller['removeOpenchannelInteractions']);router[_0x4574('0x61')](_0x4574('0x54'),auth['isAuthenticated'](),controller[_0x4574('0x6a')]);router[_0x4574('0x61')](_0x4574('0x2d'),auth[_0x4574('0x9')](),controller[_0x4574('0x6b')]);router[_0x4574('0x61')]('/:id/mail_accounts',auth[_0x4574('0x9')](),controller[_0x4574('0x6c')]);router[_0x4574('0x61')](_0x4574('0x30'),auth[_0x4574('0x9')](),controller['removeOpenchannelAccounts']);router[_0x4574('0x61')]('/:id/sms_accounts',auth[_0x4574('0x9')](),controller['removeSmsAccounts']);router['delete'](_0x4574('0x58'),auth[_0x4574('0x9')](),controller['removeChatWebsites']);router[_0x4574('0x61')]('/:id/whatsapp_accounts',auth[_0x4574('0x9')](),controller[_0x4574('0x6d')]);router['delete']('/:id/square_projects',auth[_0x4574('0x9')](),controller[_0x4574('0x6e')]);router[_0x4574('0x61')](_0x4574('0x3a'),auth[_0x4574('0x9')](),controller['removeApiKey']);module['exports']=router;