112 lines
2.9 KiB
Go
112 lines
2.9 KiB
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"browser.local/platform/dto"
|
|
)
|
|
|
|
func (h *coreHandlers) serverSCUMSchemaProbe(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodPost {
|
|
writeMethodNotAllowed(w, http.MethodPost)
|
|
return
|
|
}
|
|
request, err := decodeJSON[dto.SCUMSchemaProbeDispatchRequest](r)
|
|
if err != nil {
|
|
writeDecodeError(w, err)
|
|
return
|
|
}
|
|
probeRequest, queued, err := h.core.RequestSCUMSchemaProbeForSession(bearerToken(r), r.PathValue("id"), request.IdempotencyKey)
|
|
if err != nil {
|
|
writeServiceError(w, err)
|
|
return
|
|
}
|
|
writeJSON(w, http.StatusAccepted, dto.SCUMSchemaProbeDispatchFromDomain(probeRequest, queued))
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMPlayers(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMSquads(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMSquadMembers(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMVehicles(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMFlags(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMPositions(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMOperations(w http.ResponseWriter, r *http.Request) {
|
|
switch r.Method {
|
|
case http.MethodGet, http.MethodPost:
|
|
writeRemovedSCUMEndpoint(w)
|
|
default:
|
|
writeMethodNotAllowed(w, "GET, POST")
|
|
}
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMOperationApprove(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodPost {
|
|
writeMethodNotAllowed(w, http.MethodPost)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMWorkflows(w http.ResponseWriter, r *http.Request) {
|
|
switch r.Method {
|
|
case http.MethodGet, http.MethodPost:
|
|
writeRemovedSCUMEndpoint(w)
|
|
default:
|
|
writeMethodNotAllowed(w, "GET, POST")
|
|
}
|
|
}
|
|
|
|
func (h *coreHandlers) serverSCUMWorkflowSteps(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
writeMethodNotAllowed(w, http.MethodGet)
|
|
return
|
|
}
|
|
writeRemovedSCUMEndpoint(w)
|
|
}
|
|
|
|
func writeRemovedSCUMEndpoint(w http.ResponseWriter) {
|
|
writeAPIError(w, http.StatusNotFound, errorCodeNotFound, "legacy SCUM endpoint removed; use the local SCUM management APIs", nil)
|
|
}
|