Complete platform management workflows
This commit is contained in:
+63
-15
@@ -158,11 +158,12 @@ type AIProviderModelsResponse struct {
|
||||
}
|
||||
|
||||
type PluginPermissionsResponse struct {
|
||||
AI bool `json:"ai"`
|
||||
Logs bool `json:"logs"`
|
||||
Files bool `json:"files"`
|
||||
Jobs bool `json:"jobs"`
|
||||
Artifacts bool `json:"artifacts"`
|
||||
AI bool `json:"ai"`
|
||||
Logs bool `json:"logs"`
|
||||
Files bool `json:"files"`
|
||||
Jobs bool `json:"jobs"`
|
||||
Artifacts bool `json:"artifacts"`
|
||||
RemoteAccess bool `json:"remoteAccess"`
|
||||
}
|
||||
|
||||
type PluginLifecycleActionsBody struct {
|
||||
@@ -196,6 +197,14 @@ type GamePluginManifestAIBody struct {
|
||||
Purposes []string `json:"purposes,omitempty"`
|
||||
}
|
||||
|
||||
type GamePluginRemoteAccessBody struct {
|
||||
Methods []string `json:"methods,omitempty"`
|
||||
RunCapabilities []string `json:"runCapabilities,omitempty"`
|
||||
DatabaseEngines []string `json:"databaseEngines,omitempty"`
|
||||
RCON bool `json:"rcon,omitempty"`
|
||||
LogTransfer bool `json:"logTransfer,omitempty"`
|
||||
}
|
||||
|
||||
type GamePluginManifestBody struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
@@ -210,6 +219,7 @@ type GamePluginManifestBody struct {
|
||||
Actions PluginLifecycleActionsBody `json:"actions"`
|
||||
Pages []GamePluginPageBody `json:"pages,omitempty"`
|
||||
AI GamePluginManifestAIBody `json:"ai,omitempty"`
|
||||
RemoteAccess GamePluginRemoteAccessBody `json:"remoteAccess,omitempty"`
|
||||
}
|
||||
|
||||
type GamePluginManifestRegistrationRequest struct {
|
||||
@@ -235,6 +245,7 @@ type GamePluginCreateRequest struct {
|
||||
Pages []GamePluginPageBody `json:"pages,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
AIPurposes []string `json:"aiPurposes,omitempty"`
|
||||
RemoteAccess GamePluginRemoteAccessBody `json:"remoteAccess,omitempty"`
|
||||
ValidationViolations []string `json:"validationViolations,omitempty"`
|
||||
}
|
||||
|
||||
@@ -256,6 +267,7 @@ type GamePluginResponse struct {
|
||||
Pages []GamePluginPageBody `json:"pages"`
|
||||
Tags []string `json:"tags"`
|
||||
AIPurposes []string `json:"aiPurposes"`
|
||||
RemoteAccess GamePluginRemoteAccessBody `json:"remoteAccess,omitempty"`
|
||||
ValidationViolations []string `json:"validationViolations,omitempty"`
|
||||
Status domain.GamePluginStatus `json:"status"`
|
||||
}
|
||||
@@ -283,6 +295,7 @@ type MarketplacePluginResponse struct {
|
||||
Pages []GamePluginPageBody `json:"pages"`
|
||||
Tags []string `json:"tags"`
|
||||
AIPurposes []string `json:"aiPurposes"`
|
||||
RemoteAccess GamePluginRemoteAccessBody `json:"remoteAccess,omitempty"`
|
||||
ValidationViolations []string `json:"validationViolations,omitempty"`
|
||||
Status domain.GamePluginStatus `json:"status"`
|
||||
Source string `json:"source"`
|
||||
@@ -353,6 +366,10 @@ type ServerInstanceCreateRequest struct {
|
||||
State domain.ServerInstanceState `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type ServerInstanceUpdateRequest struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
type ServerMemberRequest struct {
|
||||
UserID string `json:"userId"`
|
||||
}
|
||||
@@ -764,6 +781,7 @@ func (request GamePluginManifestRegistrationRequest) ToDomain() domain.GamePlugi
|
||||
Actions: request.Manifest.Actions.ToDomain(),
|
||||
Pages: pagesToDomain(request.Manifest.Pages),
|
||||
AI: request.Manifest.AI.ToDomain(),
|
||||
RemoteAccess: request.Manifest.RemoteAccess.ToDomain(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -785,6 +803,16 @@ func (ai GamePluginManifestAIBody) ToDomain() domain.GamePluginManifestAI {
|
||||
return domain.GamePluginManifestAI{Purposes: domain.CopyStringSlice(ai.Purposes)}
|
||||
}
|
||||
|
||||
func (remote GamePluginRemoteAccessBody) ToDomain() domain.GamePluginRemoteAccess {
|
||||
return domain.GamePluginRemoteAccess{
|
||||
Methods: domain.CopyStringSlice(remote.Methods),
|
||||
RunCapabilities: domain.CopyStringSlice(remote.RunCapabilities),
|
||||
DatabaseEngines: domain.CopyStringSlice(remote.DatabaseEngines),
|
||||
RCON: remote.RCON,
|
||||
LogTransfer: remote.LogTransfer,
|
||||
}
|
||||
}
|
||||
|
||||
func (actions PluginLifecycleActionsBody) ToDomain() domain.PluginLifecycleActions {
|
||||
return domain.PluginLifecycleActions{
|
||||
Install: actions.Install,
|
||||
@@ -814,6 +842,7 @@ func (request GamePluginCreateRequest) ToDomain() domain.GamePlugin {
|
||||
Pages: pagesToDomain(request.Pages),
|
||||
Tags: domain.CopyStringSlice(request.Tags),
|
||||
AIPurposes: domain.CopyStringSlice(request.AIPurposes),
|
||||
RemoteAccess: request.RemoteAccess.ToDomain(),
|
||||
ValidationViolations: domain.CopyStringSlice(request.ValidationViolations),
|
||||
}
|
||||
}
|
||||
@@ -830,6 +859,10 @@ func (request ServerInstanceCreateRequest) ToDomain() domain.ServerInstance {
|
||||
}
|
||||
}
|
||||
|
||||
func (request ServerInstanceUpdateRequest) ToDomain() domain.ServerInstanceUpdate {
|
||||
return domain.ServerInstanceUpdate{Name: request.Name}
|
||||
}
|
||||
|
||||
func (request ServerConfigDiffPreviewRequest) ToDomain(serverInstanceID string) domain.ServerConfigDiffRequest {
|
||||
return domain.ServerConfigDiffRequest{
|
||||
ServerInstanceID: serverInstanceID,
|
||||
@@ -1045,6 +1078,7 @@ func GamePluginFromDomain(plugin domain.GamePlugin) GamePluginResponse {
|
||||
Pages: pagesFromDomain(plugin.Pages),
|
||||
Tags: plugin.Tags,
|
||||
AIPurposes: plugin.AIPurposes,
|
||||
RemoteAccess: remoteAccessFromDomain(plugin.RemoteAccess),
|
||||
ValidationViolations: plugin.ValidationViolations,
|
||||
Status: plugin.Status,
|
||||
}
|
||||
@@ -1132,6 +1166,7 @@ func MarketplacePluginFromDomain(plugin domain.PluginMarketplacePlugin) Marketpl
|
||||
Pages: pagesFromDomain(plugin.Pages),
|
||||
Tags: plugin.Tags,
|
||||
AIPurposes: plugin.AIPurposes,
|
||||
RemoteAccess: remoteAccessFromDomain(plugin.RemoteAccess),
|
||||
ValidationViolations: plugin.ValidationViolations,
|
||||
Status: plugin.Status,
|
||||
Source: plugin.Source,
|
||||
@@ -1403,21 +1438,34 @@ func AuditEventListFromDomain(events []domain.AuditEvent) AuditEventListResponse
|
||||
|
||||
func permissionsFromDomain(permissions domain.PluginPermissions) PluginPermissionsResponse {
|
||||
return PluginPermissionsResponse{
|
||||
AI: permissions.AI,
|
||||
Logs: permissions.Logs,
|
||||
Files: permissions.Files,
|
||||
Jobs: permissions.Jobs,
|
||||
Artifacts: permissions.Artifacts,
|
||||
AI: permissions.AI,
|
||||
Logs: permissions.Logs,
|
||||
Files: permissions.Files,
|
||||
Jobs: permissions.Jobs,
|
||||
Artifacts: permissions.Artifacts,
|
||||
RemoteAccess: permissions.RemoteAccess,
|
||||
}
|
||||
}
|
||||
|
||||
func permissionsToDomain(permissions PluginPermissionsResponse) domain.PluginPermissions {
|
||||
return domain.PluginPermissions{
|
||||
AI: permissions.AI,
|
||||
Logs: permissions.Logs,
|
||||
Files: permissions.Files,
|
||||
Jobs: permissions.Jobs,
|
||||
Artifacts: permissions.Artifacts,
|
||||
AI: permissions.AI,
|
||||
Logs: permissions.Logs,
|
||||
Files: permissions.Files,
|
||||
Jobs: permissions.Jobs,
|
||||
Artifacts: permissions.Artifacts,
|
||||
RemoteAccess: permissions.RemoteAccess,
|
||||
}
|
||||
}
|
||||
|
||||
func remoteAccessFromDomain(remote domain.GamePluginRemoteAccess) GamePluginRemoteAccessBody {
|
||||
remote = domain.CopyGamePluginRemoteAccess(remote)
|
||||
return GamePluginRemoteAccessBody{
|
||||
Methods: remote.Methods,
|
||||
RunCapabilities: remote.RunCapabilities,
|
||||
DatabaseEngines: remote.DatabaseEngines,
|
||||
RCON: remote.RCON,
|
||||
LogTransfer: remote.LogTransfer,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user