WebhookStore migration (#15042)
* Migration completed * Fix tests Co-authored-by: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ed3c93716d
Коммит
1c5b6522e3
@@ -628,7 +628,7 @@ func TestGetOutgoingWebhook(t *testing.T) {
|
|||||||
|
|
||||||
nonExistentHook.Id = model.NewId()
|
nonExistentHook.Id = model.NewId()
|
||||||
_, resp = th.SystemAdminClient.GetOutgoingWebhook(nonExistentHook.Id)
|
_, resp = th.SystemAdminClient.GetOutgoingWebhook(nonExistentHook.Id)
|
||||||
CheckInternalErrorStatus(t, resp)
|
CheckNotFoundStatus(t, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUpdateIncomingHook(t *testing.T) {
|
func TestUpdateIncomingHook(t *testing.T) {
|
||||||
@@ -940,7 +940,7 @@ func TestUpdateOutgoingHook(t *testing.T) {
|
|||||||
|
|
||||||
nonExistentHook.Id = model.NewId()
|
nonExistentHook.Id = model.NewId()
|
||||||
_, resp = th.SystemAdminClient.UpdateOutgoingWebhook(nonExistentHook)
|
_, resp = th.SystemAdminClient.UpdateOutgoingWebhook(nonExistentHook)
|
||||||
CheckInternalErrorStatus(t, resp)
|
CheckNotFoundStatus(t, resp)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("UserIsNotAdminOfTeam", func(t *testing.T) {
|
t.Run("UserIsNotAdminOfTeam", func(t *testing.T) {
|
||||||
@@ -1075,7 +1075,7 @@ func TestDeleteOutgoingHook(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("WhenHookDoesNotExist", func(t *testing.T) {
|
t.Run("WhenHookDoesNotExist", func(t *testing.T) {
|
||||||
status, resp = Client.DeleteOutgoingWebhook(model.NewId())
|
status, resp = Client.DeleteOutgoingWebhook(model.NewId())
|
||||||
CheckInternalErrorStatus(t, resp)
|
CheckNotFoundStatus(t, resp)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("WhenHookExists", func(t *testing.T) {
|
t.Run("WhenHookExists", func(t *testing.T) {
|
||||||
|
|||||||
@@ -232,14 +232,14 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo
|
|||||||
iHookChan := make(chan store.StoreResult, 1)
|
iHookChan := make(chan store.StoreResult, 1)
|
||||||
go func() {
|
go func() {
|
||||||
c, err2 := a.Srv().Store.Webhook().AnalyticsIncomingCount(teamId)
|
c, err2 := a.Srv().Store.Webhook().AnalyticsIncomingCount(teamId)
|
||||||
iHookChan <- store.StoreResult{Data: c, Err: err2}
|
iHookChan <- store.StoreResult{Data: c, NErr: err2}
|
||||||
close(iHookChan)
|
close(iHookChan)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
oHookChan := make(chan store.StoreResult, 1)
|
oHookChan := make(chan store.StoreResult, 1)
|
||||||
go func() {
|
go func() {
|
||||||
c, err2 := a.Srv().Store.Webhook().AnalyticsOutgoingCount(teamId)
|
c, err2 := a.Srv().Store.Webhook().AnalyticsOutgoingCount(teamId)
|
||||||
oHookChan <- store.StoreResult{Data: c, Err: err2}
|
oHookChan <- store.StoreResult{Data: c, NErr: err2}
|
||||||
close(oHookChan)
|
close(oHookChan)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -297,14 +297,14 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
r := <-iHookChan
|
r := <-iHookChan
|
||||||
if r.Err != nil {
|
if r.NErr != nil {
|
||||||
return nil, r.Err
|
return nil, model.NewAppError("GetAnalytics", "app.webhooks.analytics_incoming_count.app_error", nil, r.NErr.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
rows[2].Value = float64(r.Data.(int64))
|
rows[2].Value = float64(r.Data.(int64))
|
||||||
|
|
||||||
r = <-oHookChan
|
r = <-oHookChan
|
||||||
if r.Err != nil {
|
if r.NErr != nil {
|
||||||
return nil, r.Err
|
return nil, model.NewAppError("GetAnalytics", "app.webhooks.analytics_outgoing_count.app_error", nil, r.NErr.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
rows[3].Value = float64(r.Data.(int64))
|
rows[3].Value = float64(r.Data.(int64))
|
||||||
|
|
||||||
|
|||||||
@@ -1128,13 +1128,13 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
webhooks, err := a.Srv().Store.Webhook().GetIncomingByChannel(channel.Id)
|
webhooks, err := a.Srv().Store.Webhook().GetIncomingByChannel(channel.Id)
|
||||||
ihc <- store.StoreResult{Data: webhooks, Err: err}
|
ihc <- store.StoreResult{Data: webhooks, NErr: err}
|
||||||
close(ihc)
|
close(ihc)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
outgoingHooks, err := a.Srv().Store.Webhook().GetOutgoingByChannel(channel.Id, -1, -1)
|
outgoingHooks, err := a.Srv().Store.Webhook().GetOutgoingByChannel(channel.Id, -1, -1)
|
||||||
ohc <- store.StoreResult{Data: outgoingHooks, Err: err}
|
ohc <- store.StoreResult{Data: outgoingHooks, NErr: err}
|
||||||
close(ohc)
|
close(ohc)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -1148,13 +1148,13 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr
|
|||||||
}
|
}
|
||||||
|
|
||||||
ihcresult := <-ihc
|
ihcresult := <-ihc
|
||||||
if ihcresult.Err != nil {
|
if ihcresult.NErr != nil {
|
||||||
return ihcresult.Err
|
return model.NewAppError("DeleteChannel", "app.webhooks.get_incoming_by_channel.app_error", nil, ihcresult.NErr.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
ohcresult := <-ohc
|
ohcresult := <-ohc
|
||||||
if ohcresult.Err != nil {
|
if ohcresult.NErr != nil {
|
||||||
return ohcresult.Err
|
return model.NewAppError("DeleteChannel", "app.webhooks.get_outgoing_by_channel.app_error", nil, ohcresult.NErr.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
incomingHooks := ihcresult.Data.([]*model.IncomingWebhook)
|
incomingHooks := ihcresult.Data.([]*model.IncomingWebhook)
|
||||||
@@ -2340,11 +2340,11 @@ func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Webhook().PermanentDeleteIncomingByChannel(channel.Id); err != nil {
|
if err := a.Srv().Store.Webhook().PermanentDeleteIncomingByChannel(channel.Id); err != nil {
|
||||||
return err
|
return model.NewAppError("PermanentDeleteChannel", "app.webhooks.permanent_delete_incoming_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Webhook().PermanentDeleteOutgoingByChannel(channel.Id); err != nil {
|
if err := a.Srv().Store.Webhook().PermanentDeleteOutgoingByChannel(channel.Id); err != nil {
|
||||||
return err
|
return model.NewAppError("PermanentDeleteChannel", "app.webhooks.permanent_delete_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if nErr := a.Srv().Store.Channel().PermanentDelete(channel.Id); nErr != nil {
|
if nErr := a.Srv().Store.Channel().PermanentDelete(channel.Id); nErr != nil {
|
||||||
|
|||||||
@@ -1465,11 +1465,11 @@ func (a *App) PermanentDeleteUser(user *model.User) *model.AppError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Webhook().PermanentDeleteIncomingByUser(user.Id); err != nil {
|
if err := a.Srv().Store.Webhook().PermanentDeleteIncomingByUser(user.Id); err != nil {
|
||||||
return err
|
return model.NewAppError("PermanentDeleteUser", "app.webhooks.permanent_delete_incoming_by_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Webhook().PermanentDeleteOutgoingByUser(user.Id); err != nil {
|
if err := a.Srv().Store.Webhook().PermanentDeleteOutgoingByUser(user.Id); err != nil {
|
||||||
return err
|
return model.NewAppError("PermanentDeleteUser", "app.webhooks.permanent_delete_outgoing_by_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Command().PermanentDeleteByUser(user.Id); err != nil {
|
if err := a.Srv().Store.Command().PermanentDeleteByUser(user.Id); err != nil {
|
||||||
|
|||||||
130
app/webhook.go
130
app/webhook.go
@@ -35,7 +35,7 @@ func (a *App) handleWebhookEvents(post *model.Post, team *model.Team, channel *m
|
|||||||
|
|
||||||
hooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(team.Id, -1, -1)
|
hooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(team.Id, -1, -1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return model.NewAppError("handleWebhookEvents", "app.webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(hooks) == 0 {
|
if len(hooks) == 0 {
|
||||||
@@ -325,7 +325,21 @@ func (a *App) CreateIncomingWebhookForChannel(creatorId string, channel *model.C
|
|||||||
return nil, model.NewAppError("CreateIncomingWebhookForChannel", "api.incoming_webhook.invalid_username.app_error", nil, "", http.StatusBadRequest)
|
return nil, model.NewAppError("CreateIncomingWebhookForChannel", "api.incoming_webhook.invalid_username.app_error", nil, "", http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().SaveIncoming(hook)
|
webhook, err := a.Srv().Store.Webhook().SaveIncoming(hook)
|
||||||
|
if err != nil {
|
||||||
|
var invErr *store.ErrInvalidInput
|
||||||
|
var appErr *model.AppError
|
||||||
|
switch {
|
||||||
|
case errors.As(err, &appErr):
|
||||||
|
return nil, appErr
|
||||||
|
case errors.As(err, &invErr):
|
||||||
|
return nil, model.NewAppError("CreateIncomingWebhookForChannel", "app.webhooks.save_incoming.existing.app_error", nil, invErr.Error(), http.StatusBadRequest)
|
||||||
|
default:
|
||||||
|
return nil, model.NewAppError("CreateIncomingWebhookForChannel", "app.webhooks.save_incoming.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||||
@@ -353,7 +367,7 @@ func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook)
|
|||||||
|
|
||||||
newWebhook, err := a.Srv().Store.Webhook().UpdateIncoming(updatedHook)
|
newWebhook, err := a.Srv().Store.Webhook().UpdateIncoming(updatedHook)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, model.NewAppError("UpdateIncomingWebhook", "app.webhooks.update_incoming.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
a.invalidateCacheForWebhook(oldHook.Id)
|
a.invalidateCacheForWebhook(oldHook.Id)
|
||||||
return newWebhook, nil
|
return newWebhook, nil
|
||||||
@@ -365,7 +379,7 @@ func (a *App) DeleteIncomingWebhook(hookId string) *model.AppError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := a.Srv().Store.Webhook().DeleteIncoming(hookId, model.GetMillis()); err != nil {
|
if err := a.Srv().Store.Webhook().DeleteIncoming(hookId, model.GetMillis()); err != nil {
|
||||||
return err
|
return model.NewAppError("DeleteIncomingWebhook", "app.webhooks.delete_incoming.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
a.invalidateCacheForWebhook(hookId)
|
a.invalidateCacheForWebhook(hookId)
|
||||||
@@ -378,7 +392,18 @@ func (a *App) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.
|
|||||||
return nil, model.NewAppError("GetIncomingWebhook", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetIncomingWebhook", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetIncoming(hookId, true)
|
webhook, err := a.Srv().Store.Webhook().GetIncoming(hookId, true)
|
||||||
|
if err != nil {
|
||||||
|
var nfErr *store.ErrNotFound
|
||||||
|
switch {
|
||||||
|
case errors.As(err, &nfErr):
|
||||||
|
return nil, model.NewAppError("GetIncomingWebhook", "app.webhooks.get_incoming.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
||||||
|
default:
|
||||||
|
return nil, model.NewAppError("GetIncomingWebhook", "app.webhooks.get_incoming.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetIncomingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (a *App) GetIncomingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||||
@@ -390,15 +415,25 @@ func (a *App) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string,
|
|||||||
return nil, model.NewAppError("GetIncomingWebhooksForTeamPage", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetIncomingWebhooksForTeamPage", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetIncomingByTeamByUser(teamId, userId, page*perPage, perPage)
|
webhooks, err := a.Srv().Store.Webhook().GetIncomingByTeamByUser(teamId, userId, page*perPage, perPage)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("GetIncomingWebhooksForTeamPage", "app.webhooks.get_incoming_by_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetIncomingWebhooksPageByUser(userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (a *App) GetIncomingWebhooksPageByUser(userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||||
if !*a.Config().ServiceSettings.EnableIncomingWebhooks {
|
if !*a.Config().ServiceSettings.EnableIncomingWebhooks {
|
||||||
return nil, model.NewAppError("GetIncomingWebhooksPage", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetIncomingWebhooksPageByUser", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetIncomingListByUser(userId, page*perPage, perPage)
|
webhooks, err := a.Srv().Store.Webhook().GetIncomingListByUser(userId, page*perPage, perPage)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("GetIncomingWebhooksPageByUser", "app.webhooks.get_incoming_by_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (a *App) GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||||
@@ -434,7 +469,7 @@ func (a *App) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.Outgoin
|
|||||||
}
|
}
|
||||||
|
|
||||||
if allHooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(hook.TeamId, -1, -1); err != nil {
|
if allHooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(hook.TeamId, -1, -1); err != nil {
|
||||||
return nil, err
|
return nil, model.NewAppError("CreateOutgoingWebhook", "app.webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for _, existingOutHook := range allHooks {
|
for _, existingOutHook := range allHooks {
|
||||||
@@ -449,7 +484,16 @@ func (a *App) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.Outgoin
|
|||||||
|
|
||||||
webhook, err := a.Srv().Store.Webhook().SaveOutgoing(hook)
|
webhook, err := a.Srv().Store.Webhook().SaveOutgoing(hook)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
var appErr *model.AppError
|
||||||
|
var invErr *store.ErrInvalidInput
|
||||||
|
switch {
|
||||||
|
case errors.As(err, &appErr):
|
||||||
|
return nil, appErr
|
||||||
|
case errors.As(err, &invErr):
|
||||||
|
return nil, model.NewAppError("CreateOutgoingWebhook", "app.webhooks.save_outgoing.override.app_error", nil, invErr.Error(), http.StatusBadRequest)
|
||||||
|
default:
|
||||||
|
return nil, model.NewAppError("CreateOutgoingWebhook", "app.webhooks.save_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhook, nil
|
return webhook, nil
|
||||||
@@ -479,7 +523,7 @@ func (a *App) UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook)
|
|||||||
|
|
||||||
allHooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(oldHook.TeamId, -1, -1)
|
allHooks, err := a.Srv().Store.Webhook().GetOutgoingByTeam(oldHook.TeamId, -1, -1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, model.NewAppError("UpdateOutgoingWebhook", "app.webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, existingOutHook := range allHooks {
|
for _, existingOutHook := range allHooks {
|
||||||
@@ -497,7 +541,12 @@ func (a *App) UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook)
|
|||||||
updatedHook.TeamId = oldHook.TeamId
|
updatedHook.TeamId = oldHook.TeamId
|
||||||
updatedHook.UpdateAt = model.GetMillis()
|
updatedHook.UpdateAt = model.GetMillis()
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().UpdateOutgoing(updatedHook)
|
webhook, err := a.Srv().Store.Webhook().UpdateOutgoing(updatedHook)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("UpdateOutgoingWebhook", "app.webhooks.update_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) {
|
||||||
@@ -505,7 +554,18 @@ func (a *App) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.
|
|||||||
return nil, model.NewAppError("GetOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetOutgoing(hookId)
|
webhook, err := a.Srv().Store.Webhook().GetOutgoing(hookId)
|
||||||
|
if err != nil {
|
||||||
|
var nfErr *store.ErrNotFound
|
||||||
|
switch {
|
||||||
|
case errors.As(err, &nfErr):
|
||||||
|
return nil, model.NewAppError("GetOutgoingWebhook", "app.webhooks.get_outgoing.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
||||||
|
default:
|
||||||
|
return nil, model.NewAppError("GetOutgoingWebhook", "app.webhooks.get_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||||
@@ -514,10 +574,15 @@ func (a *App) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebho
|
|||||||
|
|
||||||
func (a *App) GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||||
if !*a.Config().ServiceSettings.EnableOutgoingWebhooks {
|
if !*a.Config().ServiceSettings.EnableOutgoingWebhooks {
|
||||||
return nil, model.NewAppError("GetOutgoingWebhooksPage", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetOutgoingWebhooksPageByUser", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetOutgoingListByUser(userId, page*perPage, perPage)
|
webhooks, err := a.Srv().Store.Webhook().GetOutgoingListByUser(userId, page*perPage, perPage)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("GetOutgoingWebhooksPageByUser", "app.webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||||
@@ -525,7 +590,12 @@ func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId s
|
|||||||
return nil, model.NewAppError("GetOutgoingWebhooksForChannelPage", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetOutgoingWebhooksForChannelPage", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetOutgoingByChannelByUser(channelId, userId, page*perPage, perPage)
|
webhooks, err := a.Srv().Store.Webhook().GetOutgoingByChannelByUser(channelId, userId, page*perPage, perPage)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("GetOutgoingWebhooksForChannelPage", "app.webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||||
@@ -534,10 +604,15 @@ func (a *App) GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) (
|
|||||||
|
|
||||||
func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||||
if !*a.Config().ServiceSettings.EnableOutgoingWebhooks {
|
if !*a.Config().ServiceSettings.EnableOutgoingWebhooks {
|
||||||
return nil, model.NewAppError("GetOutgoingWebhooksForTeamPage", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return nil, model.NewAppError("GetOutgoingWebhooksForTeamPageByUser", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().GetOutgoingByTeamByUser(teamId, userId, page*perPage, perPage)
|
webhooks, err := a.Srv().Store.Webhook().GetOutgoingByTeamByUser(teamId, userId, page*perPage, perPage)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("GetOutgoingWebhooksForTeamPageByUser", "app.webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) DeleteOutgoingWebhook(hookId string) *model.AppError {
|
func (a *App) DeleteOutgoingWebhook(hookId string) *model.AppError {
|
||||||
@@ -545,7 +620,11 @@ func (a *App) DeleteOutgoingWebhook(hookId string) *model.AppError {
|
|||||||
return model.NewAppError("DeleteOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
return model.NewAppError("DeleteOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().DeleteOutgoing(hookId, model.GetMillis())
|
if err := a.Srv().Store.Webhook().DeleteOutgoing(hookId, model.GetMillis()); err != nil {
|
||||||
|
return model.NewAppError("DeleteOutgoingWebhook", "app.webhooks.delete_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||||
@@ -555,7 +634,12 @@ func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.Out
|
|||||||
|
|
||||||
hook.Token = model.NewId()
|
hook.Token = model.NewId()
|
||||||
|
|
||||||
return a.Srv().Store.Webhook().UpdateOutgoing(hook)
|
webhook, err := a.Srv().Store.Webhook().UpdateOutgoing(hook)
|
||||||
|
if err != nil {
|
||||||
|
return nil, model.NewAppError("RegenOutgoingWebhookToken", "app.webhooks.update_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError {
|
func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError {
|
||||||
@@ -566,7 +650,7 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
|
|||||||
hchan := make(chan store.StoreResult, 1)
|
hchan := make(chan store.StoreResult, 1)
|
||||||
go func() {
|
go func() {
|
||||||
webhook, err := a.Srv().Store.Webhook().GetIncoming(hookId, true)
|
webhook, err := a.Srv().Store.Webhook().GetIncoming(hookId, true)
|
||||||
hchan <- store.StoreResult{Data: webhook, Err: err}
|
hchan <- store.StoreResult{Data: webhook, NErr: err}
|
||||||
close(hchan)
|
close(hchan)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -583,8 +667,8 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
|
|||||||
webhookType := req.Type
|
webhookType := req.Type
|
||||||
|
|
||||||
var hook *model.IncomingWebhook
|
var hook *model.IncomingWebhook
|
||||||
if result := <-hchan; result.Err != nil {
|
if result := <-hchan; result.NErr != nil {
|
||||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.invalid.app_error", nil, "err="+result.Err.Message, http.StatusBadRequest)
|
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.invalid.app_error", nil, result.NErr.Error(), http.StatusBadRequest)
|
||||||
} else {
|
} else {
|
||||||
hook = result.Data.(*model.IncomingWebhook)
|
hook = result.Data.(*model.IncomingWebhook)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,17 +116,17 @@ func listWebhookCmdF(command *cobra.Command, args []string) error {
|
|||||||
incomingResult := make(chan store.StoreResult, 1)
|
incomingResult := make(chan store.StoreResult, 1)
|
||||||
go func() {
|
go func() {
|
||||||
incomingHooks, err := app.Srv().Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
|
incomingHooks, err := app.Srv().Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
|
||||||
incomingResult <- store.StoreResult{Data: incomingHooks, Err: err}
|
incomingResult <- store.StoreResult{Data: incomingHooks, NErr: err}
|
||||||
close(incomingResult)
|
close(incomingResult)
|
||||||
}()
|
}()
|
||||||
outgoingResult := make(chan store.StoreResult, 1)
|
outgoingResult := make(chan store.StoreResult, 1)
|
||||||
go func() {
|
go func() {
|
||||||
outgoingHooks, err := app.Srv().Store.Webhook().GetOutgoingByTeam(team.Id, 0, 100000000)
|
outgoingHooks, err := app.Srv().Store.Webhook().GetOutgoingByTeam(team.Id, 0, 100000000)
|
||||||
outgoingResult <- store.StoreResult{Data: outgoingHooks, Err: err}
|
outgoingResult <- store.StoreResult{Data: outgoingHooks, NErr: err}
|
||||||
close(outgoingResult)
|
close(outgoingResult)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if result := <-incomingResult; result.Err == nil {
|
if result := <-incomingResult; result.NErr == nil {
|
||||||
CommandPrettyPrintln(fmt.Sprintf("Incoming webhooks for %s (%s):", team.DisplayName, team.Name))
|
CommandPrettyPrintln(fmt.Sprintf("Incoming webhooks for %s (%s):", team.DisplayName, team.Name))
|
||||||
hooks := result.Data.([]*model.IncomingWebhook)
|
hooks := result.Data.([]*model.IncomingWebhook)
|
||||||
for _, hook := range hooks {
|
for _, hook := range hooks {
|
||||||
@@ -136,7 +136,7 @@ func listWebhookCmdF(command *cobra.Command, args []string) error {
|
|||||||
CommandPrintErrorln("Unable to list incoming webhooks for '" + args[i] + "'")
|
CommandPrintErrorln("Unable to list incoming webhooks for '" + args[i] + "'")
|
||||||
}
|
}
|
||||||
|
|
||||||
if result := <-outgoingResult; result.Err == nil {
|
if result := <-outgoingResult; result.NErr == nil {
|
||||||
hooks := result.Data.([]*model.OutgoingWebhook)
|
hooks := result.Data.([]*model.OutgoingWebhook)
|
||||||
CommandPrettyPrintln(fmt.Sprintf("Outgoing webhooks for %s (%s):", team.DisplayName, team.Name))
|
CommandPrettyPrintln(fmt.Sprintf("Outgoing webhooks for %s (%s):", team.DisplayName, team.Name))
|
||||||
for _, hook := range hooks {
|
for _, hook := range hooks {
|
||||||
|
|||||||
160
i18n/en.json
160
i18n/en.json
@@ -4490,6 +4490,86 @@
|
|||||||
"id": "app.user_terms_of_service.save.app_error",
|
"id": "app.user_terms_of_service.save.app_error",
|
||||||
"translation": "Unable to save terms of service."
|
"translation": "Unable to save terms of service."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.analytics_incoming_count.app_error",
|
||||||
|
"translation": "Unable to count the incoming webhooks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.analytics_outgoing_count.app_error",
|
||||||
|
"translation": "Unable to count the outgoing webhooks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.delete_incoming.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.delete_outgoing.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_incoming.app_error",
|
||||||
|
"translation": "Unable to get the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_incoming_by_channel.app_error",
|
||||||
|
"translation": "Unable to get the webhooks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_incoming_by_user.app_error",
|
||||||
|
"translation": "Unable to get the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_outgoing.app_error",
|
||||||
|
"translation": "Unable to get the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_outgoing_by_channel.app_error",
|
||||||
|
"translation": "Unable to get the webhooks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.get_outgoing_by_team.app_error",
|
||||||
|
"translation": "Unable to get the webhooks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.permanent_delete_incoming_by_channel.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.permanent_delete_incoming_by_user.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.permanent_delete_outgoing_by_channel.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.permanent_delete_outgoing_by_user.app_error",
|
||||||
|
"translation": "Unable to delete the webhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.save_incoming.app_error",
|
||||||
|
"translation": "Unable to save the IncomingWebhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.save_incoming.existing.app_error",
|
||||||
|
"translation": "You cannot overwrite an existing IncomingWebhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.save_outgoing.app_error",
|
||||||
|
"translation": "Unable to save the OutgoingWebhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.save_outgoing.override.app_error",
|
||||||
|
"translation": "You cannot overwrite an existing OutgoingWebhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.update_incoming.app_error",
|
||||||
|
"translation": "Unable to update the IncomingWebhook."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.webhooks.update_outgoing.app_error",
|
||||||
|
"translation": "Unable to update the webhook."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "bleveengine.already_started.error",
|
"id": "bleveengine.already_started.error",
|
||||||
"translation": "Bleve is already started."
|
"translation": "Bleve is already started."
|
||||||
@@ -7738,86 +7818,6 @@
|
|||||||
"id": "store.sql_user.verify_email.app_error",
|
"id": "store.sql_user.verify_email.app_error",
|
||||||
"translation": "Unable to update verify email field."
|
"translation": "Unable to update verify email field."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.analytics_incoming_count.app_error",
|
|
||||||
"translation": "Unable to count the incoming webhooks."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.analytics_outgoing_count.app_error",
|
|
||||||
"translation": "Unable to count the outgoing webhooks."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.delete_incoming.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.delete_outgoing.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_incoming.app_error",
|
|
||||||
"translation": "Unable to get the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_incoming_by_channel.app_error",
|
|
||||||
"translation": "Unable to get the webhooks."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_incoming_by_user.app_error",
|
|
||||||
"translation": "Unable to get the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_outgoing.app_error",
|
|
||||||
"translation": "Unable to get the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_outgoing_by_channel.app_error",
|
|
||||||
"translation": "Unable to get the webhooks."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.get_outgoing_by_team.app_error",
|
|
||||||
"translation": "Unable to get the webhooks."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.permanent_delete_incoming_by_channel.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.permanent_delete_incoming_by_user.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.permanent_delete_outgoing_by_channel.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.permanent_delete_outgoing_by_user.app_error",
|
|
||||||
"translation": "Unable to delete the webhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.save_incoming.app_error",
|
|
||||||
"translation": "Unable to save the IncomingWebhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.save_incoming.existing.app_error",
|
|
||||||
"translation": "You cannot overwrite an existing IncomingWebhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.save_outgoing.app_error",
|
|
||||||
"translation": "Unable to save the OutgoingWebhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.save_outgoing.override.app_error",
|
|
||||||
"translation": "You cannot overwrite an existing OutgoingWebhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.update_incoming.app_error",
|
|
||||||
"translation": "Unable to update the IncomingWebhook."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "store.sql_webhooks.update_outgoing.app_error",
|
|
||||||
"translation": "Unable to update the webhook."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "store.update_error",
|
"id": "store.update_error",
|
||||||
"translation": "update error"
|
"translation": "update error"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||||
if !allowFromCache {
|
if !allowFromCache {
|
||||||
return s.WebhookStore.GetIncoming(id, allowFromCache)
|
return s.WebhookStore.GetIncoming(id, allowFromCache)
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*mo
|
|||||||
return incomingWebhook, nil
|
return incomingWebhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||||
err := s.WebhookStore.DeleteIncoming(webhookId, time)
|
err := s.WebhookStore.DeleteIncoming(webhookId, time)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -66,7 +66,7 @@ func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) *mo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||||
err := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
err := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -76,7 +76,7 @@ func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) *mo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||||
err := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
err := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -8928,7 +8928,7 @@ func (s *OpenTracingLayerUserTermsOfServiceStore) Save(userTermsOfService *model
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsIncomingCount")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsIncomingCount")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -8946,7 +8946,7 @@ func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (in
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsOutgoingCount")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsOutgoingCount")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -8977,7 +8977,7 @@ func (s *OpenTracingLayerWebhookStore) ClearCaches() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteIncoming")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteIncoming")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -8995,7 +8995,7 @@ func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteOutgoing")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteOutgoing")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9013,7 +9013,7 @@ func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncoming")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncoming")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9031,7 +9031,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache boo
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByChannel")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByChannel")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9049,7 +9049,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeam")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeam")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9067,7 +9067,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset i
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeamByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeamByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9085,7 +9085,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, us
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingList")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingList")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9103,7 +9103,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingListByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingListByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9121,7 +9121,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offs
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoing")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoing")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9139,7 +9139,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWe
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannel")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannel")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9157,7 +9157,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, of
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannelByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannelByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9175,7 +9175,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId stri
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeam")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeam")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9193,7 +9193,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset i
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeamByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeamByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9211,7 +9211,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, us
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingList")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingList")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9229,7 +9229,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingListByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingListByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9260,7 +9260,7 @@ func (s *OpenTracingLayerWebhookStore) InvalidateWebhookCache(webhook string) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByChannel")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByChannel")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9278,7 +9278,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelI
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9296,7 +9296,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId stri
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByChannel")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByChannel")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9314,7 +9314,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelI
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByUser")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByUser")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9332,7 +9332,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId stri
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveIncoming")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveIncoming")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9350,7 +9350,7 @@ func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebho
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveOutgoing")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveOutgoing")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9368,7 +9368,7 @@ func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebho
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateIncoming")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateIncoming")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
@@ -9386,7 +9386,7 @@ func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWeb
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OpenTracingLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *OpenTracingLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
origCtx := s.Root.Store.Context()
|
origCtx := s.Root.Store.Context()
|
||||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateOutgoing")
|
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateOutgoing")
|
||||||
s.Root.Store.SetContext(newCtx)
|
s.Root.Store.SetContext(newCtx)
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ package sqlstore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"net/http"
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
sq "github.com/Masterminds/squirrel"
|
sq "github.com/Masterminds/squirrel"
|
||||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||||
@@ -72,10 +73,10 @@ func (s SqlWebhookStore) createIndexesIfNotExists() {
|
|||||||
func (s SqlWebhookStore) InvalidateWebhookCache(webhookId string) {
|
func (s SqlWebhookStore) InvalidateWebhookCache(webhookId string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
|
|
||||||
if len(webhook.Id) > 0 {
|
if len(webhook.Id) > 0 {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.SaveIncoming", "store.sql_webhooks.save_incoming.existing.app_error", nil, "id="+webhook.Id, http.StatusBadRequest)
|
return nil, store.NewErrInvalidInput("IncomingWebhook", "id", webhook.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
webhook.PreSave()
|
webhook.PreSave()
|
||||||
@@ -84,66 +85,66 @@ func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.In
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := s.GetMaster().Insert(webhook); err != nil {
|
if err := s.GetMaster().Insert(webhook); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.SaveIncoming", "store.sql_webhooks.save_incoming.app_error", nil, "id="+webhook.Id+", "+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to save IncomingWebhook with id=%s", webhook.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhook, nil
|
return webhook, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) UpdateIncoming(hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) UpdateIncoming(hook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
hook.UpdateAt = model.GetMillis()
|
hook.UpdateAt = model.GetMillis()
|
||||||
|
|
||||||
if _, err := s.GetMaster().Update(hook); err != nil {
|
if _, err := s.GetMaster().Update(hook); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.UpdateIncoming", "store.sql_webhooks.update_incoming.app_error", nil, "id="+hook.Id+", "+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to update IncomingWebhook with id=%s", hook.Id)
|
||||||
}
|
}
|
||||||
return hook, nil
|
return hook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||||
var webhook model.IncomingWebhook
|
var webhook model.IncomingWebhook
|
||||||
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM IncomingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM IncomingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncoming", "store.sql_webhooks.get_incoming.app_error", nil, "id="+id+", err="+err.Error(), http.StatusNotFound)
|
return nil, store.NewErrNotFound("IncomingWebhook", id)
|
||||||
}
|
}
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncoming", "store.sql_webhooks.get_incoming.app_error", nil, "id="+id+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to get IncomingWebhook with id=%s", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &webhook, nil
|
return &webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||||
_, err := s.GetMaster().Exec("Update IncomingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
_, err := s.GetMaster().Exec("Update IncomingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteIncoming", "store.sql_webhooks.delete_incoming.app_error", nil, "id="+webhookId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to update IncomingWebhook with id=%s", webhookId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||||
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
|
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteIncomingByUser", "store.sql_webhooks.permanent_delete_incoming_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to delete IncomingWebhook with userId=%s", userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
func (s SqlWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||||
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteIncomingByChannel", "store.sql_webhooks.permanent_delete_incoming_by_channel.app_error", nil, "id="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to delete IncomingWebhook with channelId=%s", channelId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
return s.GetIncomingListByUser("", offset, limit)
|
return s.GetIncomingListByUser("", offset, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
var webhooks []*model.IncomingWebhook
|
var webhooks []*model.IncomingWebhook
|
||||||
|
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
@@ -157,18 +158,18 @@ func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int)
|
|||||||
|
|
||||||
queryString, args, err := query.ToSql()
|
queryString, args, err := query.ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingList", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "incoming_webhook_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingList", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "failed to find IncomingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
var webhooks []*model.IncomingWebhook
|
var webhooks []*model.IncomingWebhook
|
||||||
|
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
@@ -185,33 +186,33 @@ func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, o
|
|||||||
|
|
||||||
queryString, args, err := query.ToSql()
|
queryString, args, err := query.ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByUser", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "incoming_webhook_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByUser", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to find IncomingWebhoook with teamId=%s", teamId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
return s.GetIncomingByTeamByUser(teamId, "", offset, limit)
|
return s.GetIncomingByTeamByUser(teamId, "", offset, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||||
var webhooks []*model.IncomingWebhook
|
var webhooks []*model.IncomingWebhook
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, "SELECT * FROM IncomingWebhooks WHERE ChannelId = :ChannelId AND DeleteAt = 0", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, "SELECT * FROM IncomingWebhooks WHERE ChannelId = :ChannelId AND DeleteAt = 0", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByChannel", "store.sql_webhooks.get_incoming_by_channel.app_error", nil, "channelId="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to find IncomingWebhooks with channelId=%s", channelId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
if len(webhook.Id) > 0 {
|
if len(webhook.Id) > 0 {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.SaveOutgoing", "store.sql_webhooks.save_outgoing.override.app_error", nil, "id="+webhook.Id, http.StatusBadRequest)
|
return nil, store.NewErrInvalidInput("OutgoingWebhook", "id", webhook.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
webhook.PreSave()
|
webhook.PreSave()
|
||||||
@@ -220,24 +221,28 @@ func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Ou
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := s.GetMaster().Insert(webhook); err != nil {
|
if err := s.GetMaster().Insert(webhook); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.SaveOutgoing", "store.sql_webhooks.save_outgoing.app_error", nil, "id="+webhook.Id+", "+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to save OutgoingWebhook with id=%s", webhook.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhook, nil
|
return webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||||
|
|
||||||
var webhook model.OutgoingWebhook
|
var webhook model.OutgoingWebhook
|
||||||
|
|
||||||
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM OutgoingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM OutgoingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoing", "store.sql_webhooks.get_outgoing.app_error", nil, "id="+id+", err="+err.Error(), http.StatusInternalServerError)
|
if err == sql.ErrNoRows {
|
||||||
|
return nil, store.NewErrNotFound("OutgoingWebhook", id)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, errors.Wrapf(err, "failed to get OutgoingWebhook with id=%s", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &webhook, nil
|
return &webhook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
var webhooks []*model.OutgoingWebhook
|
var webhooks []*model.OutgoingWebhook
|
||||||
|
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
@@ -253,22 +258,22 @@ func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int)
|
|||||||
|
|
||||||
queryString, args, err := query.ToSql()
|
queryString, args, err := query.ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingList", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
return s.GetOutgoingListByUser("", offset, limit)
|
return s.GetOutgoingListByUser("", offset, limit)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
var webhooks []*model.OutgoingWebhook
|
var webhooks []*model.OutgoingWebhook
|
||||||
|
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
@@ -288,21 +293,21 @@ func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId str
|
|||||||
|
|
||||||
queryString, args, err := query.ToSql()
|
queryString, args, err := query.ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, "channelId="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
return s.GetOutgoingByChannelByUser(channelId, "", offset, limit)
|
return s.GetOutgoingByChannelByUser(channelId, "", offset, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
var webhooks []*model.OutgoingWebhook
|
var webhooks []*model.OutgoingWebhook
|
||||||
|
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
@@ -322,42 +327,42 @@ func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, o
|
|||||||
|
|
||||||
queryString, args, err := query.ToSql()
|
queryString, args, err := query.ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByTeam", "store.sql_webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByTeam", "store.sql_webhooks.get_outgoing_by_team.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
return s.GetOutgoingByTeamByUser(teamId, "", offset, limit)
|
return s.GetOutgoingByTeamByUser(teamId, "", offset, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||||
_, err := s.GetMaster().Exec("Update OutgoingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
_, err := s.GetMaster().Exec("Update OutgoingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoing", "store.sql_webhooks.delete_outgoing.app_error", nil, "id="+webhookId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to update OutgoingWebhook with id=%s", webhookId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||||
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE CreatorId = :UserId", map[string]interface{}{"UserId": userId})
|
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE CreatorId = :UserId", map[string]interface{}{"UserId": userId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoingByUser", "store.sql_webhooks.permanent_delete_outgoing_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to delete OutgoingWebhook with creatorId=%s", userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||||
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoingByChannel", "store.sql_webhooks.permanent_delete_outgoing_by_channel.app_error", nil, "id="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
return errors.Wrapf(err, "failed to delete OutgoingWebhook with channelId=%s", channelId)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.ClearCaches()
|
s.ClearCaches()
|
||||||
@@ -365,17 +370,17 @@ func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *mod
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
hook.UpdateAt = model.GetMillis()
|
hook.UpdateAt = model.GetMillis()
|
||||||
|
|
||||||
if _, err := s.GetMaster().Update(hook); err != nil {
|
if _, err := s.GetMaster().Update(hook); err != nil {
|
||||||
return nil, model.NewAppError("SqlWebhookStore.UpdateOutgoing", "store.sql_webhooks.update_outgoing.app_error", nil, "id="+hook.Id+", "+err.Error(), http.StatusInternalServerError)
|
return nil, errors.Wrapf(err, "failed to update OutgoingWebhook with id=%s", hook.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return hook, nil
|
return hook, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||||
query :=
|
query :=
|
||||||
`SELECT
|
`SELECT
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
@@ -390,13 +395,13 @@ func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.Ap
|
|||||||
|
|
||||||
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, model.NewAppError("SqlWebhookStore.AnalyticsIncomingCount", "store.sql_webhooks.analytics_incoming_count.app_error", nil, "team_id="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
return 0, errors.Wrap(err, "failed to count IncomingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||||
query :=
|
query :=
|
||||||
`SELECT
|
`SELECT
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
@@ -411,7 +416,7 @@ func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.Ap
|
|||||||
|
|
||||||
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, model.NewAppError("SqlWebhookStore.AnalyticsOutgoingCount", "store.sql_webhooks.analytics_outgoing_count.app_error", nil, "team_id="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
return 0, errors.Wrap(err, "failed to count OutgoingWebhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
|
|||||||
@@ -443,33 +443,33 @@ type SystemStore interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WebhookStore interface {
|
type WebhookStore interface {
|
||||||
SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error)
|
||||||
GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError)
|
GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error)
|
||||||
GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, error)
|
||||||
GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||||
GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||||
GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||||
UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error)
|
||||||
GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError)
|
GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error)
|
||||||
DeleteIncoming(webhookId string, time int64) *model.AppError
|
DeleteIncoming(webhookId string, time int64) error
|
||||||
PermanentDeleteIncomingByChannel(channelId string) *model.AppError
|
PermanentDeleteIncomingByChannel(channelId string) error
|
||||||
PermanentDeleteIncomingByUser(userId string) *model.AppError
|
PermanentDeleteIncomingByUser(userId string) error
|
||||||
|
|
||||||
SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error)
|
||||||
GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError)
|
GetOutgoing(id string) (*model.OutgoingWebhook, error)
|
||||||
GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||||
DeleteOutgoing(webhookId string, time int64) *model.AppError
|
DeleteOutgoing(webhookId string, time int64) error
|
||||||
PermanentDeleteOutgoingByChannel(channelId string) *model.AppError
|
PermanentDeleteOutgoingByChannel(channelId string) error
|
||||||
PermanentDeleteOutgoingByUser(userId string) *model.AppError
|
PermanentDeleteOutgoingByUser(userId string) error
|
||||||
UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error)
|
||||||
|
|
||||||
AnalyticsIncomingCount(teamId string) (int64, *model.AppError)
|
AnalyticsIncomingCount(teamId string) (int64, error)
|
||||||
AnalyticsOutgoingCount(teamId string) (int64, *model.AppError)
|
AnalyticsOutgoingCount(teamId string) (int64, error)
|
||||||
InvalidateWebhookCache(webhook string)
|
InvalidateWebhookCache(webhook string)
|
||||||
ClearCaches()
|
ClearCaches()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type WebhookStore struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AnalyticsIncomingCount provides a mock function with given fields: teamId
|
// AnalyticsIncomingCount provides a mock function with given fields: teamId
|
||||||
func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||||
ret := _m.Called(teamId)
|
ret := _m.Called(teamId)
|
||||||
|
|
||||||
var r0 int64
|
var r0 int64
|
||||||
@@ -25,20 +25,18 @@ func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.App
|
|||||||
r0 = ret.Get(0).(int64)
|
r0 = ret.Get(0).(int64)
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||||
r1 = rf(teamId)
|
r1 = rf(teamId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnalyticsOutgoingCount provides a mock function with given fields: teamId
|
// AnalyticsOutgoingCount provides a mock function with given fields: teamId
|
||||||
func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||||
ret := _m.Called(teamId)
|
ret := _m.Called(teamId)
|
||||||
|
|
||||||
var r0 int64
|
var r0 int64
|
||||||
@@ -48,13 +46,11 @@ func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.App
|
|||||||
r0 = ret.Get(0).(int64)
|
r0 = ret.Get(0).(int64)
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||||
r1 = rf(teamId)
|
r1 = rf(teamId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
@@ -66,39 +62,35 @@ func (_m *WebhookStore) ClearCaches() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DeleteIncoming provides a mock function with given fields: webhookId, time
|
// DeleteIncoming provides a mock function with given fields: webhookId, time
|
||||||
func (_m *WebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
func (_m *WebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||||
ret := _m.Called(webhookId, time)
|
ret := _m.Called(webhookId, time)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string, int64) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||||
r0 = rf(webhookId, time)
|
r0 = rf(webhookId, time)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteOutgoing provides a mock function with given fields: webhookId, time
|
// DeleteOutgoing provides a mock function with given fields: webhookId, time
|
||||||
func (_m *WebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
func (_m *WebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||||
ret := _m.Called(webhookId, time)
|
ret := _m.Called(webhookId, time)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string, int64) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||||
r0 = rf(webhookId, time)
|
r0 = rf(webhookId, time)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncoming provides a mock function with given fields: id, allowFromCache
|
// GetIncoming provides a mock function with given fields: id, allowFromCache
|
||||||
func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(id, allowFromCache)
|
ret := _m.Called(id, allowFromCache)
|
||||||
|
|
||||||
var r0 *model.IncomingWebhook
|
var r0 *model.IncomingWebhook
|
||||||
@@ -110,20 +102,18 @@ func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.Inco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||||
r1 = rf(id, allowFromCache)
|
r1 = rf(id, allowFromCache)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncomingByChannel provides a mock function with given fields: channelId
|
// GetIncomingByChannel provides a mock function with given fields: channelId
|
||||||
func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(channelId)
|
ret := _m.Called(channelId)
|
||||||
|
|
||||||
var r0 []*model.IncomingWebhook
|
var r0 []*model.IncomingWebhook
|
||||||
@@ -135,20 +125,18 @@ func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.Incomin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||||
r1 = rf(channelId)
|
r1 = rf(channelId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncomingByTeam provides a mock function with given fields: teamId, offset, limit
|
// GetIncomingByTeam provides a mock function with given fields: teamId, offset, limit
|
||||||
func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(teamId, offset, limit)
|
ret := _m.Called(teamId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.IncomingWebhook
|
var r0 []*model.IncomingWebhook
|
||||||
@@ -160,20 +148,18 @@ func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||||
r1 = rf(teamId, offset, limit)
|
r1 = rf(teamId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncomingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
// GetIncomingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
||||||
func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(teamId, userId, offset, limit)
|
ret := _m.Called(teamId, userId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.IncomingWebhook
|
var r0 []*model.IncomingWebhook
|
||||||
@@ -185,20 +171,18 @@ func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, of
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||||
r1 = rf(teamId, userId, offset, limit)
|
r1 = rf(teamId, userId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncomingList provides a mock function with given fields: offset, limit
|
// GetIncomingList provides a mock function with given fields: offset, limit
|
||||||
func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(offset, limit)
|
ret := _m.Called(offset, limit)
|
||||||
|
|
||||||
var r0 []*model.IncomingWebhook
|
var r0 []*model.IncomingWebhook
|
||||||
@@ -210,20 +194,18 @@ func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.Incomin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||||
r1 = rf(offset, limit)
|
r1 = rf(offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIncomingListByUser provides a mock function with given fields: userId, offset, limit
|
// GetIncomingListByUser provides a mock function with given fields: userId, offset, limit
|
||||||
func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(userId, offset, limit)
|
ret := _m.Called(userId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.IncomingWebhook
|
var r0 []*model.IncomingWebhook
|
||||||
@@ -235,20 +217,18 @@ func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||||
r1 = rf(userId, offset, limit)
|
r1 = rf(userId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoing provides a mock function with given fields: id
|
// GetOutgoing provides a mock function with given fields: id
|
||||||
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(id)
|
ret := _m.Called(id)
|
||||||
|
|
||||||
var r0 *model.OutgoingWebhook
|
var r0 *model.OutgoingWebhook
|
||||||
@@ -260,20 +240,18 @@ func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.A
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||||
r1 = rf(id)
|
r1 = rf(id)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingByChannel provides a mock function with given fields: channelId, offset, limit
|
// GetOutgoingByChannel provides a mock function with given fields: channelId, offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(channelId, offset, limit)
|
ret := _m.Called(channelId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -285,20 +263,18 @@ func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||||
r1 = rf(channelId, offset, limit)
|
r1 = rf(channelId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingByChannelByUser provides a mock function with given fields: channelId, userId, offset, limit
|
// GetOutgoingByChannelByUser provides a mock function with given fields: channelId, userId, offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(channelId, userId, offset, limit)
|
ret := _m.Called(channelId, userId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -310,20 +286,18 @@ func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId stri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||||
r1 = rf(channelId, userId, offset, limit)
|
r1 = rf(channelId, userId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingByTeam provides a mock function with given fields: teamId, offset, limit
|
// GetOutgoingByTeam provides a mock function with given fields: teamId, offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(teamId, offset, limit)
|
ret := _m.Called(teamId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -335,20 +309,18 @@ func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||||
r1 = rf(teamId, offset, limit)
|
r1 = rf(teamId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
// GetOutgoingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(teamId, userId, offset, limit)
|
ret := _m.Called(teamId, userId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -360,20 +332,18 @@ func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, of
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||||
r1 = rf(teamId, userId, offset, limit)
|
r1 = rf(teamId, userId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingList provides a mock function with given fields: offset, limit
|
// GetOutgoingList provides a mock function with given fields: offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(offset, limit)
|
ret := _m.Called(offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -385,20 +355,18 @@ func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.Outgoin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||||
r1 = rf(offset, limit)
|
r1 = rf(offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOutgoingListByUser provides a mock function with given fields: userId, offset, limit
|
// GetOutgoingListByUser provides a mock function with given fields: userId, offset, limit
|
||||||
func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(userId, offset, limit)
|
ret := _m.Called(userId, offset, limit)
|
||||||
|
|
||||||
var r0 []*model.OutgoingWebhook
|
var r0 []*model.OutgoingWebhook
|
||||||
@@ -410,13 +378,11 @@ func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||||
r1 = rf(userId, offset, limit)
|
r1 = rf(userId, offset, limit)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
@@ -428,71 +394,63 @@ func (_m *WebhookStore) InvalidateWebhookCache(webhook string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PermanentDeleteIncomingByChannel provides a mock function with given fields: channelId
|
// PermanentDeleteIncomingByChannel provides a mock function with given fields: channelId
|
||||||
func (_m *WebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
func (_m *WebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||||
ret := _m.Called(channelId)
|
ret := _m.Called(channelId)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||||
r0 = rf(channelId)
|
r0 = rf(channelId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// PermanentDeleteIncomingByUser provides a mock function with given fields: userId
|
// PermanentDeleteIncomingByUser provides a mock function with given fields: userId
|
||||||
func (_m *WebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
func (_m *WebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||||
ret := _m.Called(userId)
|
ret := _m.Called(userId)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||||
r0 = rf(userId)
|
r0 = rf(userId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// PermanentDeleteOutgoingByChannel provides a mock function with given fields: channelId
|
// PermanentDeleteOutgoingByChannel provides a mock function with given fields: channelId
|
||||||
func (_m *WebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
func (_m *WebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||||
ret := _m.Called(channelId)
|
ret := _m.Called(channelId)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||||
r0 = rf(channelId)
|
r0 = rf(channelId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// PermanentDeleteOutgoingByUser provides a mock function with given fields: userId
|
// PermanentDeleteOutgoingByUser provides a mock function with given fields: userId
|
||||||
func (_m *WebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
func (_m *WebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||||
ret := _m.Called(userId)
|
ret := _m.Called(userId)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 error
|
||||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||||
r0 = rf(userId)
|
r0 = rf(userId)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
r0 = ret.Error(0)
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveIncoming provides a mock function with given fields: webhook
|
// SaveIncoming provides a mock function with given fields: webhook
|
||||||
func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(webhook)
|
ret := _m.Called(webhook)
|
||||||
|
|
||||||
var r0 *model.IncomingWebhook
|
var r0 *model.IncomingWebhook
|
||||||
@@ -504,20 +462,18 @@ func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.Inc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||||
r1 = rf(webhook)
|
r1 = rf(webhook)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveOutgoing provides a mock function with given fields: webhook
|
// SaveOutgoing provides a mock function with given fields: webhook
|
||||||
func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(webhook)
|
ret := _m.Called(webhook)
|
||||||
|
|
||||||
var r0 *model.OutgoingWebhook
|
var r0 *model.OutgoingWebhook
|
||||||
@@ -529,20 +485,18 @@ func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Out
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||||
r1 = rf(webhook)
|
r1 = rf(webhook)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateIncoming provides a mock function with given fields: webhook
|
// UpdateIncoming provides a mock function with given fields: webhook
|
||||||
func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
ret := _m.Called(webhook)
|
ret := _m.Called(webhook)
|
||||||
|
|
||||||
var r0 *model.IncomingWebhook
|
var r0 *model.IncomingWebhook
|
||||||
@@ -554,20 +508,18 @@ func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||||
r1 = rf(webhook)
|
r1 = rf(webhook)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateOutgoing provides a mock function with given fields: hook
|
// UpdateOutgoing provides a mock function with given fields: hook
|
||||||
func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
ret := _m.Called(hook)
|
ret := _m.Called(hook)
|
||||||
|
|
||||||
var r0 *model.OutgoingWebhook
|
var r0 *model.OutgoingWebhook
|
||||||
@@ -579,13 +531,11 @@ func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Outg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 error
|
||||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||||
r1 = rf(hook)
|
r1 = rf(hook)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
r1 = ret.Error(1)
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r0, r1
|
return r0, r1
|
||||||
|
|||||||
@@ -4,12 +4,13 @@
|
|||||||
package storetest
|
package storetest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v5/model"
|
"github.com/mattermost/mattermost-server/v5/model"
|
||||||
"github.com/mattermost/mattermost-server/v5/store"
|
"github.com/mattermost/mattermost-server/v5/store"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ func TestWebhookStore(t *testing.T, ss store.Store) {
|
|||||||
t.Run("GetIncomingListByUser", func(t *testing.T) { testWebhookStoreGetIncomingListByUser(t, ss) })
|
t.Run("GetIncomingListByUser", func(t *testing.T) { testWebhookStoreGetIncomingListByUser(t, ss) })
|
||||||
t.Run("GetIncomingByTeam", func(t *testing.T) { testWebhookStoreGetIncomingByTeam(t, ss) })
|
t.Run("GetIncomingByTeam", func(t *testing.T) { testWebhookStoreGetIncomingByTeam(t, ss) })
|
||||||
t.Run("GetIncomingByTeamByUser", func(t *testing.T) { TestWebhookStoreGetIncomingByTeamByUser(t, ss) })
|
t.Run("GetIncomingByTeamByUser", func(t *testing.T) { TestWebhookStoreGetIncomingByTeamByUser(t, ss) })
|
||||||
|
t.Run("GetIncomingByTeamByChannel", func(t *testing.T) { testWebhookStoreGetIncomingByChannel(t, ss) })
|
||||||
t.Run("DeleteIncoming", func(t *testing.T) { testWebhookStoreDeleteIncoming(t, ss) })
|
t.Run("DeleteIncoming", func(t *testing.T) { testWebhookStoreDeleteIncoming(t, ss) })
|
||||||
t.Run("DeleteIncomingByChannel", func(t *testing.T) { testWebhookStoreDeleteIncomingByChannel(t, ss) })
|
t.Run("DeleteIncomingByChannel", func(t *testing.T) { testWebhookStoreDeleteIncomingByChannel(t, ss) })
|
||||||
t.Run("DeleteIncomingByUser", func(t *testing.T) { testWebhookStoreDeleteIncomingByUser(t, ss) })
|
t.Run("DeleteIncomingByUser", func(t *testing.T) { testWebhookStoreDeleteIncomingByUser(t, ss) })
|
||||||
@@ -52,7 +54,7 @@ func testWebhookStoreSaveIncoming(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
func testWebhookStoreUpdateIncoming(t *testing.T, ss store.Store) {
|
func testWebhookStoreUpdateIncoming(t *testing.T, ss store.Store) {
|
||||||
|
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -72,7 +74,7 @@ func testWebhookStoreUpdateIncoming(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreGetIncoming(t *testing.T, ss store.Store) {
|
func testWebhookStoreGetIncoming(t *testing.T, ss store.Store) {
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -94,7 +96,8 @@ func testWebhookStoreGetIncoming(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
_, err = ss.Webhook().GetIncoming("123", true)
|
_, err = ss.Webhook().GetIncoming("123", true)
|
||||||
require.NotNil(t, err)
|
require.NotNil(t, err)
|
||||||
require.Equal(t, err.StatusCode, http.StatusNotFound, "Should have set the status as not found for missing id")
|
var nfErr *store.ErrNotFound
|
||||||
|
require.True(t, errors.As(err, &nfErr), "Should have set the status as not found for missing id")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreGetIncomingList(t *testing.T, ss store.Store) {
|
func testWebhookStoreGetIncomingList(t *testing.T, ss store.Store) {
|
||||||
@@ -103,7 +106,7 @@ func testWebhookStoreGetIncomingList(t *testing.T, ss store.Store) {
|
|||||||
o1.UserId = model.NewId()
|
o1.UserId = model.NewId()
|
||||||
o1.TeamId = model.NewId()
|
o1.TeamId = model.NewId()
|
||||||
|
|
||||||
var err *model.AppError
|
var err error
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
require.Nil(t, err, "unable to save webhook")
|
require.Nil(t, err, "unable to save webhook")
|
||||||
|
|
||||||
@@ -147,7 +150,7 @@ func testWebhookStoreGetIncomingListByUser(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreGetIncomingByTeam(t *testing.T, ss store.Store) {
|
func testWebhookStoreGetIncomingByTeam(t *testing.T, ss store.Store) {
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -163,7 +166,7 @@ func testWebhookStoreGetIncomingByTeam(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestWebhookStoreGetIncomingByTeamByUser(t *testing.T, ss store.Store) {
|
func TestWebhookStoreGetIncomingByTeamByUser(t *testing.T, ss store.Store) {
|
||||||
var appErr *model.AppError
|
var appErr error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, appErr = ss.Webhook().SaveIncoming(o1)
|
o1, appErr = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -194,7 +197,7 @@ func TestWebhookStoreGetIncomingByTeamByUser(t *testing.T, ss store.Store) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
func testWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
|
|
||||||
o1, err := ss.Webhook().SaveIncoming(o1)
|
o1, err := ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -210,7 +213,7 @@ func TestWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreDeleteIncoming(t *testing.T, ss store.Store) {
|
func testWebhookStoreDeleteIncoming(t *testing.T, ss store.Store) {
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -228,7 +231,7 @@ func testWebhookStoreDeleteIncoming(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreDeleteIncomingByChannel(t *testing.T, ss store.Store) {
|
func testWebhookStoreDeleteIncomingByChannel(t *testing.T, ss store.Store) {
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -246,7 +249,7 @@ func testWebhookStoreDeleteIncomingByChannel(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreDeleteIncomingByUser(t *testing.T, ss store.Store) {
|
func testWebhookStoreDeleteIncomingByUser(t *testing.T, ss store.Store) {
|
||||||
var err *model.AppError
|
var err error
|
||||||
|
|
||||||
o1 := buildIncomingWebhook()
|
o1 := buildIncomingWebhook()
|
||||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||||
@@ -448,7 +451,7 @@ func testWebhookStoreGetOutgoingByTeam(t *testing.T, ss store.Store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testWebhookStoreGetOutgoingByTeamByUser(t *testing.T, ss store.Store) {
|
func testWebhookStoreGetOutgoingByTeamByUser(t *testing.T, ss store.Store) {
|
||||||
var appErr *model.AppError
|
var appErr error
|
||||||
|
|
||||||
o1 := &model.OutgoingWebhook{}
|
o1 := &model.OutgoingWebhook{}
|
||||||
o1.ChannelId = model.NewId()
|
o1.ChannelId = model.NewId()
|
||||||
@@ -587,7 +590,8 @@ func testWebhookStoreCountOutgoing(t *testing.T, ss store.Store) {
|
|||||||
o1.TeamId = model.NewId()
|
o1.TeamId = model.NewId()
|
||||||
o1.CallbackURLs = []string{"http://nowhere.com/"}
|
o1.CallbackURLs = []string{"http://nowhere.com/"}
|
||||||
|
|
||||||
ss.Webhook().SaveOutgoing(o1)
|
_, err := ss.Webhook().SaveOutgoing(o1)
|
||||||
|
require.Nil(t, err)
|
||||||
|
|
||||||
r, err := ss.Webhook().AnalyticsOutgoingCount("")
|
r, err := ss.Webhook().AnalyticsOutgoingCount("")
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|||||||
@@ -8069,7 +8069,7 @@ func (s *TimerLayerUserTermsOfServiceStore) Save(userTermsOfService *model.UserT
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.AnalyticsIncomingCount(teamId)
|
resultVar0, resultVar1 := s.WebhookStore.AnalyticsIncomingCount(teamId)
|
||||||
@@ -8085,7 +8085,7 @@ func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.AnalyticsOutgoingCount(teamId)
|
resultVar0, resultVar1 := s.WebhookStore.AnalyticsOutgoingCount(teamId)
|
||||||
@@ -8116,7 +8116,7 @@ func (s *TimerLayerWebhookStore) ClearCaches() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.DeleteIncoming(webhookId, time)
|
resultVar0 := s.WebhookStore.DeleteIncoming(webhookId, time)
|
||||||
@@ -8132,7 +8132,7 @@ func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *m
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.DeleteOutgoing(webhookId, time)
|
resultVar0 := s.WebhookStore.DeleteOutgoing(webhookId, time)
|
||||||
@@ -8148,7 +8148,7 @@ func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *m
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncoming(id, allowFromCache)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncoming(id, allowFromCache)
|
||||||
@@ -8164,7 +8164,7 @@ func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*m
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByChannel(channelId)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByChannel(channelId)
|
||||||
@@ -8180,7 +8180,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*mode
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeam(teamId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeam(teamId, offset, limit)
|
||||||
@@ -8196,7 +8196,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, li
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeamByUser(teamId, userId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeamByUser(teamId, userId, offset, limit)
|
||||||
@@ -8212,7 +8212,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId s
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingList(offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncomingList(offset, limit)
|
||||||
@@ -8228,7 +8228,7 @@ func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*mode
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingListByUser(userId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetIncomingListByUser(userId, offset, limit)
|
||||||
@@ -8244,7 +8244,7 @@ func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoing(id)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoing(id)
|
||||||
@@ -8260,7 +8260,7 @@ func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook,
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannel(channelId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannel(channelId, offset, limit)
|
||||||
@@ -8276,7 +8276,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset i
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannelByUser(channelId, userId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannelByUser(channelId, userId, offset, limit)
|
||||||
@@ -8292,7 +8292,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, us
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeam(teamId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeam(teamId, offset, limit)
|
||||||
@@ -8308,7 +8308,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, li
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeamByUser(teamId, userId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeamByUser(teamId, userId, offset, limit)
|
||||||
@@ -8324,7 +8324,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId s
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingList(offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingList(offset, limit)
|
||||||
@@ -8340,7 +8340,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*mode
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingListByUser(userId, offset, limit)
|
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingListByUser(userId, offset, limit)
|
||||||
@@ -8371,7 +8371,7 @@ func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
||||||
@@ -8387,7 +8387,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId stri
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
||||||
@@ -8403,7 +8403,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *m
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByChannel(channelId)
|
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByChannel(channelId)
|
||||||
@@ -8419,7 +8419,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId stri
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByUser(userId)
|
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByUser(userId)
|
||||||
@@ -8435,7 +8435,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *m
|
|||||||
return resultVar0
|
return resultVar0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.SaveIncoming(webhook)
|
resultVar0, resultVar1 := s.WebhookStore.SaveIncoming(webhook)
|
||||||
@@ -8451,7 +8451,7 @@ func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.SaveOutgoing(webhook)
|
resultVar0, resultVar1 := s.WebhookStore.SaveOutgoing(webhook)
|
||||||
@@ -8467,7 +8467,7 @@ func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.UpdateIncoming(webhook)
|
resultVar0, resultVar1 := s.WebhookStore.UpdateIncoming(webhook)
|
||||||
@@ -8483,7 +8483,7 @@ func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook)
|
|||||||
return resultVar0, resultVar1
|
return resultVar0, resultVar1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||||
start := timemodule.Now()
|
start := timemodule.Now()
|
||||||
|
|
||||||
resultVar0, resultVar1 := s.WebhookStore.UpdateOutgoing(hook)
|
resultVar0, resultVar1 := s.WebhookStore.UpdateOutgoing(hook)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user