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