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