|
@@ -50,22 +50,22 @@ func (prov *ProvisioningAPI) Init() {
|
|
|
prov.log.Debugln("Enabling provisioning API at", prov.bridge.Config.AppService.Provisioning.Prefix)
|
|
|
r := prov.bridge.AS.Router.PathPrefix(prov.bridge.Config.AppService.Provisioning.Prefix).Subrouter()
|
|
|
r.Use(prov.AuthMiddleware)
|
|
|
- r.HandleFunc("/ping", prov.Ping).Methods(http.MethodGet)
|
|
|
- r.HandleFunc("/login", prov.Login).Methods(http.MethodGet)
|
|
|
- r.HandleFunc("/logout", prov.Logout).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/delete_session", prov.DeleteSession).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/disconnect", prov.Disconnect).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/reconnect", prov.Reconnect).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/sync/appstate/{name}", prov.SyncAppState).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/contacts", prov.ListContacts).Methods(http.MethodGet)
|
|
|
- r.HandleFunc("/groups", prov.ListGroups).Methods(http.MethodGet)
|
|
|
- r.HandleFunc("/pm/{number}", prov.StartPM).Methods(http.MethodPost)
|
|
|
- r.HandleFunc("/open/{groupID}", prov.OpenGroup).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/ping", prov.Ping).Methods(http.MethodGet)
|
|
|
+ r.HandleFunc("/v1/login", prov.Login).Methods(http.MethodGet)
|
|
|
+ r.HandleFunc("/v1/logout", prov.Logout).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/delete_session", prov.DeleteSession).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/disconnect", prov.Disconnect).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/reconnect", prov.Reconnect).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/sync/appstate/{name}", prov.SyncAppState).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/contacts", prov.ListContacts).Methods(http.MethodGet)
|
|
|
+ r.HandleFunc("/v1/groups", prov.ListGroups).Methods(http.MethodGet)
|
|
|
+ r.HandleFunc("/v1/pm/{number}", prov.StartPM).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/open/{groupID}", prov.OpenGroup).Methods(http.MethodPost)
|
|
|
prov.bridge.AS.Router.HandleFunc("/_matrix/app/com.beeper.asmux/ping", prov.BridgeStatePing).Methods(http.MethodPost)
|
|
|
prov.bridge.AS.Router.HandleFunc("/_matrix/app/com.beeper.bridge_state", prov.BridgeStatePing).Methods(http.MethodPost)
|
|
|
|
|
|
// Deprecated, just use /disconnect
|
|
|
- r.HandleFunc("/delete_connection", prov.Disconnect).Methods(http.MethodPost)
|
|
|
+ r.HandleFunc("/v1/delete_connection", prov.Disconnect).Methods(http.MethodPost)
|
|
|
}
|
|
|
|
|
|
type responseWrap struct {
|