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