Skip to content

Commit

Permalink
Merge pull request #280 from JetBrains/update-resources
Browse files Browse the repository at this point in the history
Support for new resource properties
  • Loading branch information
rafaelldi authored Oct 29, 2024
2 parents d543cfa + 9206db5 commit ec9ec56
Show file tree
Hide file tree
Showing 41 changed files with 3,207 additions and 739 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

### Added

- Support for new resource properties

## [1.6.0] - 2024-10-24

### Changed
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = me.rafaelldi.aspire
pluginName = aspire-plugin
pluginRepositoryUrl = https://github.com/JetBrains/aspire-plugin
# SemVer format -> https://semver.org
pluginVersion = 1.6.0
pluginVersion = 1.6.1

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 243
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ object AspireSessionHostModel : Ext(AspireSessionHostRoot) {
property("model", ResourceModel)
property("isInitialized", bool).async
sink("logReceived", ResourceLog)
call("executeCommand", ResourceCommandRequest, ResourceCommandResponse)
}

private val ResourceModel = structdef {
Expand Down Expand Up @@ -80,16 +81,23 @@ object AspireSessionHostModel : Ext(AspireSessionHostRoot) {
+"Error"
+"Unknown"
}.nullable)
field("createdAt", dateTime)
field("createdAt", dateTime.nullable)
field("startedAt", dateTime.nullable)
field("stoppedAt", dateTime.nullable)
field("properties", array(ResourceProperty))
field("environment", array(ResourceEnvironmentVariable))
field("urls", array(ResourceUrl))
field("volumes", array(ResourceVolume))
field("healthStatus", ResourceHealthStatus.nullable)
field("healthReports", array(ResourceHealthReport))
field("commands", array(ResourceCommand))
}

private val ResourceProperty = structdef {
field("name", string)
field("displayName", string.nullable)
field("value", string.nullable)
field("isSensitive", bool.nullable)
}

private val ResourceEnvironmentVariable = structdef {
Expand All @@ -103,12 +111,62 @@ object AspireSessionHostModel : Ext(AspireSessionHostRoot) {
field("isInternal", bool)
}

private val ResourceVolume = structdef {
field("source", string)
field("target", string)
field("mountType", string)
field("isReadOnly", bool)
}

private val ResourceHealthStatus = enum("ResourceHealthStatus") {
+"Healthy"
+"Unhealthy"
+"Degraded"
}

private val ResourceHealthReport = structdef {
field("status", ResourceHealthStatus)
field("key", string)
field("description", string)
field("exception", string)
}

private val ResourceCommand = structdef {
field("commandType", string)
field("displayName", string)
field("confirmationMessage", string.nullable)
field("isHighlighted", bool)
field("iconName", string.nullable)
field("displayDescription", string.nullable)
field("state", enum("ResourceCommandState") {
+"Enabled"
+"Disabled"
+"Hidden"
})
}

private val ResourceLog = structdef {
field("text", string)
field("isError", bool)
field("lineNumber", int)
}

private val ResourceCommandRequest = structdef {
field("commandType", string)
field("resourceName", string)
field("resourceType", string)
}

private val ResourceCommandResponse = structdef {
field("kind", enum("ResourceCommandResponseKind") {
+"Undefined"
+"Succeeded"
+"Failed"
+"Canceled"
})
field("errorMessage", string.nullable)
}

init {
callback("createSession", SessionModel, SessionCreationResult.nullable)
callback("deleteSession", string, bool)
Expand Down
Loading

0 comments on commit ec9ec56

Please sign in to comment.