@@ -79,7 +79,7 @@ func initHandlers(g *fastglue.Fastglue, hub *ws.Hub) {
79
79
g .DELETE ("/api/v1/statuses/{id}" , perm (handleDeleteStatus , "status:manage" ))
80
80
g .GET ("/api/v1/priorities" , auth (handleGetPriorities ))
81
81
82
- // Tag .
82
+ // Tags .
83
83
g .GET ("/api/v1/tags" , auth (handleGetTags ))
84
84
g .POST ("/api/v1/tags" , perm (handleCreateTag , "tags:manage" ))
85
85
g .PUT ("/api/v1/tags/{id}" , perm (handleUpdateTag , "tags:manage" ))
@@ -93,22 +93,28 @@ func initHandlers(g *fastglue.Fastglue, hub *ws.Hub) {
93
93
g .DELETE ("/api/v1/macros/{id}" , perm (handleDeleteMacro , "macros:manage" ))
94
94
g .POST ("/api/v1/conversations/{uuid}/macros/{id}/apply" , auth (handleApplyMacro ))
95
95
96
- // User.
97
- g .GET ("/api/v1/users/me" , auth (handleGetCurrentUser ))
98
- g .PUT ("/api/v1/users/me" , auth (handleUpdateCurrentUser ))
99
- g .GET ("/api/v1/users/me/teams" , auth (handleGetCurrentUserTeams ))
100
- g .PUT ("/api/v1/users/me/availability" , auth (handleUpdateUserAvailability ))
101
- g .DELETE ("/api/v1/users/me/avatar" , auth (handleDeleteAvatar ))
102
- g .GET ("/api/v1/users/compact" , auth (handleGetUsersCompact ))
103
- g .GET ("/api/v1/users" , perm (handleGetUsers , "users:manage" ))
104
- g .GET ("/api/v1/users/{id}" , perm (handleGetUser , "users:manage" ))
105
- g .POST ("/api/v1/users" , perm (handleCreateUser , "users:manage" ))
106
- g .PUT ("/api/v1/users/{id}" , perm (handleUpdateUser , "users:manage" ))
107
- g .DELETE ("/api/v1/users/{id}" , perm (handleDeleteUser , "users:manage" ))
108
- g .POST ("/api/v1/users/reset-password" , tryAuth (handleResetPassword ))
109
- g .POST ("/api/v1/users/set-password" , tryAuth (handleSetPassword ))
110
-
111
- // Team.
96
+ // Agents.
97
+ g .GET ("/api/v1/agents/me" , auth (handleGetCurrentAgent ))
98
+ g .PUT ("/api/v1/agents/me" , auth (handleUpdateCurrentAgent ))
99
+ g .GET ("/api/v1/agents/me/teams" , auth (handleGetCurrentAgentTeams ))
100
+ g .PUT ("/api/v1/agents/me/availability" , auth (handleUpdateAgentAvailability ))
101
+ g .DELETE ("/api/v1/agents/me/avatar" , auth (handleDeleteCurrentAgentAvatar ))
102
+
103
+ g .GET ("/api/v1/agents/compact" , auth (handleGetAgentsCompact ))
104
+ g .GET ("/api/v1/agents" , perm (handleGetAgents , "users:manage" ))
105
+ g .GET ("/api/v1/agents/{id}" , perm (handleGetAgent , "users:manage" ))
106
+ g .POST ("/api/v1/agents" , perm (handleCreateAgent , "users:manage" ))
107
+ g .PUT ("/api/v1/agents/{id}" , perm (handleUpdateAgent , "users:manage" ))
108
+ g .DELETE ("/api/v1/agents/{id}" , perm (handleDeleteAgent , "users:manage" ))
109
+ g .POST ("/api/v1/agents/reset-password" , tryAuth (handleResetPassword ))
110
+ g .POST ("/api/v1/agents/set-password" , tryAuth (handleSetPassword ))
111
+
112
+ // Contacts.
113
+ g .GET ("/api/v1/contacts" , perm (handleGetContacts , "contacts:manage" ))
114
+ g .GET ("/api/v1/contacts/{id}" , perm (handleGetContact , "contacts:manage" ))
115
+ g .PUT ("/api/v1/contacts/{id}" , perm (handleUpdateContact , "contacts:manage" ))
116
+
117
+ // Teams.
112
118
g .GET ("/api/v1/teams/compact" , auth (handleGetTeamsCompact ))
113
119
g .GET ("/api/v1/teams" , perm (handleGetTeams , "teams:manage" ))
114
120
g .GET ("/api/v1/teams/{id}" , perm (handleGetTeam , "teams:manage" ))
@@ -119,36 +125,36 @@ func initHandlers(g *fastglue.Fastglue, hub *ws.Hub) {
119
125
// i18n.
120
126
g .GET ("/api/v1/lang/{lang}" , handleGetI18nLang )
121
127
122
- // Automation .
123
- g .GET ("/api/v1/automation /rules" , perm (handleGetAutomationRules , "automations:manage" ))
124
- g .GET ("/api/v1/automation /rules/{id}" , perm (handleGetAutomationRule , "automations:manage" ))
125
- g .POST ("/api/v1/automation /rules" , perm (handleCreateAutomationRule , "automations:manage" ))
126
- g .PUT ("/api/v1/automation /rules/{id}/toggle" , perm (handleToggleAutomationRule , "automations:manage" ))
127
- g .PUT ("/api/v1/automation /rules/{id}" , perm (handleUpdateAutomationRule , "automations:manage" ))
128
- g .PUT ("/api/v1/automation /rules/weights" , perm (handleUpdateAutomationRuleWeights , "automations:manage" ))
129
- g .PUT ("/api/v1/automation /rules/execution-mode" , perm (handleUpdateAutomationRuleExecutionMode , "automations:manage" ))
130
- g .DELETE ("/api/v1/automation /rules/{id}" , perm (handleDeleteAutomationRule , "automations:manage" ))
131
-
132
- // Inbox .
128
+ // Automations .
129
+ g .GET ("/api/v1/automations /rules" , perm (handleGetAutomationRules , "automations:manage" ))
130
+ g .GET ("/api/v1/automations /rules/{id}" , perm (handleGetAutomationRule , "automations:manage" ))
131
+ g .POST ("/api/v1/automations /rules" , perm (handleCreateAutomationRule , "automations:manage" ))
132
+ g .PUT ("/api/v1/automations /rules/{id}/toggle" , perm (handleToggleAutomationRule , "automations:manage" ))
133
+ g .PUT ("/api/v1/automations /rules/{id}" , perm (handleUpdateAutomationRule , "automations:manage" ))
134
+ g .PUT ("/api/v1/automations /rules/weights" , perm (handleUpdateAutomationRuleWeights , "automations:manage" ))
135
+ g .PUT ("/api/v1/automations /rules/execution-mode" , perm (handleUpdateAutomationRuleExecutionMode , "automations:manage" ))
136
+ g .DELETE ("/api/v1/automations /rules/{id}" , perm (handleDeleteAutomationRule , "automations:manage" ))
137
+
138
+ // Inboxes .
133
139
g .GET ("/api/v1/inboxes" , auth (handleGetInboxes ))
134
140
g .GET ("/api/v1/inboxes/{id}" , perm (handleGetInbox , "inboxes:manage" ))
135
141
g .POST ("/api/v1/inboxes" , perm (handleCreateInbox , "inboxes:manage" ))
136
142
g .PUT ("/api/v1/inboxes/{id}/toggle" , perm (handleToggleInbox , "inboxes:manage" ))
137
143
g .PUT ("/api/v1/inboxes/{id}" , perm (handleUpdateInbox , "inboxes:manage" ))
138
144
g .DELETE ("/api/v1/inboxes/{id}" , perm (handleDeleteInbox , "inboxes:manage" ))
139
145
140
- // Role .
146
+ // Roles .
141
147
g .GET ("/api/v1/roles" , perm (handleGetRoles , "roles:manage" ))
142
148
g .GET ("/api/v1/roles/{id}" , perm (handleGetRole , "roles:manage" ))
143
149
g .POST ("/api/v1/roles" , perm (handleCreateRole , "roles:manage" ))
144
150
g .PUT ("/api/v1/roles/{id}" , perm (handleUpdateRole , "roles:manage" ))
145
151
g .DELETE ("/api/v1/roles/{id}" , perm (handleDeleteRole , "roles:manage" ))
146
152
147
- // Dashboard .
153
+ // Reports .
148
154
g .GET ("/api/v1/reports/overview/counts" , perm (handleDashboardCounts , "reports:manage" ))
149
155
g .GET ("/api/v1/reports/overview/charts" , perm (handleDashboardCharts , "reports:manage" ))
150
156
151
- // Template .
157
+ // Templates .
152
158
g .GET ("/api/v1/templates" , perm (handleGetTemplates , "templates:manage" ))
153
159
g .GET ("/api/v1/templates/{id}" , perm (handleGetTemplate , "templates:manage" ))
154
160
g .POST ("/api/v1/templates" , perm (handleCreateTemplate , "templates:manage" ))
@@ -162,14 +168,14 @@ func initHandlers(g *fastglue.Fastglue, hub *ws.Hub) {
162
168
g .PUT ("/api/v1/business-hours/{id}" , perm (handleUpdateBusinessHours , "business_hours:manage" ))
163
169
g .DELETE ("/api/v1/business-hours/{id}" , perm (handleDeleteBusinessHour , "business_hours:manage" ))
164
170
165
- // SLA .
171
+ // SLAs .
166
172
g .GET ("/api/v1/sla" , perm (handleGetSLAs , "sla:manage" ))
167
173
g .GET ("/api/v1/sla/{id}" , perm (handleGetSLA , "sla:manage" ))
168
174
g .POST ("/api/v1/sla" , perm (handleCreateSLA , "sla:manage" ))
169
175
g .PUT ("/api/v1/sla/{id}" , perm (handleUpdateSLA , "sla:manage" ))
170
176
g .DELETE ("/api/v1/sla/{id}" , perm (handleDeleteSLA , "sla:manage" ))
171
177
172
- // AI completion .
178
+ // AI completions .
173
179
g .GET ("/api/v1/ai/prompts" , auth (handleGetAIPrompts ))
174
180
g .POST ("/api/v1/ai/completion" , auth (handleAICompletion ))
175
181
g .PUT ("/api/v1/ai/provider" , perm (handleUpdateAIProvider , "ai:manage" ))
0 commit comments