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