-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom labels for readability and CLI output (#1481)
- Loading branch information
1 parent
4eca23f
commit 0f6db93
Showing
37 changed files
with
915 additions
and
129 deletions.
There are no files selected for viewing
154 changes: 109 additions & 45 deletions
154
maestro-orchestra-models/src/main/java/maestro/orchestra/Commands.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
maestro-orchestra/src/main/java/maestro/orchestra/yaml/YamlAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package maestro.orchestra.yaml | ||
|
||
data class YamlActionBack( | ||
val label: String? = null, | ||
) | ||
|
||
data class YamlActionClearKeychain( | ||
val label: String? = null, | ||
) | ||
|
||
data class YamlActionHideKeyboard( | ||
val label: String? = null, | ||
) | ||
|
||
data class YamlActionPasteText( | ||
val label: String? = null, | ||
) | ||
|
||
data class YamlActionScroll( | ||
val label: String? = null, | ||
) |
30 changes: 30 additions & 0 deletions
30
maestro-orchestra/src/main/java/maestro/orchestra/yaml/YamlAssertTrue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package maestro.orchestra.yaml | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator | ||
|
||
data class YamlAssertTrue( | ||
val condition: String? = null, | ||
val label: String? = null, | ||
){ | ||
companion object { | ||
|
||
@JvmStatic | ||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
fun parse(condition: Any): YamlAssertTrue { | ||
val evaluatedCondition = when (condition) { | ||
is String -> condition | ||
is Int, is Long, is Char, is Boolean, is Float, is Double -> condition.toString() | ||
is Map<*, *> -> { | ||
val evaluatedCondition = condition.getOrDefault("condition", "") as String | ||
val label = condition.getOrDefault("label", "") as String | ||
return YamlAssertTrue(evaluatedCondition, label) | ||
} | ||
else -> throw UnsupportedOperationException("Cannot deserialize assert true with data type ${condition.javaClass}") | ||
} | ||
return YamlAssertTrue( | ||
condition = evaluatedCondition, | ||
) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
maestro-orchestra/src/main/java/maestro/orchestra/yaml/YamlEvalScript.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package maestro.orchestra.yaml | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator | ||
import java.lang.UnsupportedOperationException | ||
|
||
data class YamlEvalScript( | ||
val script: String, | ||
val label: String? = null, | ||
){ | ||
companion object { | ||
|
||
@JvmStatic | ||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) | ||
fun parse(script: Any): YamlEvalScript { | ||
val evalScript = when (script) { | ||
is String -> script | ||
is Map<*, *> -> { | ||
val evaluatedScript = script.getOrDefault("script", "") as String | ||
val label = script.getOrDefault("label", "") as String | ||
return YamlEvalScript(evaluatedScript, label) | ||
} | ||
is Int, is Long, is Char, is Boolean, is Float, is Double -> script.toString() | ||
else -> throw UnsupportedOperationException("Cannot deserialize evaluate script with data type ${script.javaClass}") | ||
} | ||
return YamlEvalScript( | ||
script = evalScript, | ||
) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.