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