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