Plugins: Add plugin settings DTO (#46283)

* add clearer service layer

* re-order frontend settings for clarity

* fix fetch fail

* fix API response

* fix mockstore

* in -> where
This commit is contained in:
Will Browne
2022-03-18 20:49:13 +01:00
committed by GitHub
parent 1afd278bd0
commit bda3f860a8
16 changed files with 426 additions and 308 deletions
@@ -2,20 +2,18 @@ package pluginsettings
import (
"context"
"github.com/grafana/grafana/pkg/models"
)
type Service interface {
// GetPluginSettings returns all Plugin Settings for the provided Org
GetPluginSettings(ctx context.Context, orgID int64) ([]*models.PluginSettingInfoDTO, error)
// GetPluginSettingById returns a Plugin Settings by Plugin ID
GetPluginSettingById(ctx context.Context, query *models.GetPluginSettingByIdQuery) error
GetPluginSettings(ctx context.Context, args *GetArgs) ([]*DTO, error)
// GetPluginSettingByPluginID returns a Plugin Settings by Plugin ID
GetPluginSettingByPluginID(ctx context.Context, args *GetByPluginIDArgs) (*DTO, error)
// UpdatePluginSetting updates a Plugin Setting
UpdatePluginSetting(ctx context.Context, cmd *models.UpdatePluginSettingCmd) error
// UpdatePluginSettingVersion updates a Plugin Setting's plugin version
UpdatePluginSettingVersion(ctx context.Context, cmd *models.UpdatePluginSettingVersionCmd) error
UpdatePluginSetting(ctx context.Context, args *UpdateArgs) error
// UpdatePluginSettingPluginVersion updates a Plugin Setting's plugin version
UpdatePluginSettingPluginVersion(ctx context.Context, args *UpdatePluginVersionArgs) error
// DecryptedValues decrypts the encrypted secureJSONData of the provided plugin setting and
// returns the decrypted values.
DecryptedValues(ps *models.PluginSetting) map[string]string
DecryptedValues(ps *DTO) map[string]string
}