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