mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Merge branch 'next/minor' of github.com:Start9Labs/start-os into next/major
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
Host,
|
||||
ExportServiceInterfaceParams,
|
||||
ServiceInterface,
|
||||
ActionRequest,
|
||||
RequestActionParams,
|
||||
MainStatus,
|
||||
} from "./osBindings"
|
||||
|
||||
@@ -14,7 +14,7 @@ export type Run<
|
||||
> = (options: {
|
||||
effects: T.Effects
|
||||
input: ExtractInputSpecType<A> & Record<string, any>
|
||||
}) => Promise<T.ActionResult | null | void | undefined>
|
||||
}) => Promise<(T.ActionResult & { version: "1" }) | null | void | undefined>
|
||||
export type GetInput<
|
||||
A extends
|
||||
| Record<string, any>
|
||||
|
||||
@@ -3,11 +3,35 @@ import type { ActionVisibility } from "./ActionVisibility"
|
||||
import type { AllowedStatuses } from "./AllowedStatuses"
|
||||
|
||||
export type ActionMetadata = {
|
||||
/**
|
||||
* A human-readable name
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* A detailed description of what the action will do
|
||||
*/
|
||||
description: string
|
||||
/**
|
||||
* Presents as an alert prior to executing the action. Should be used sparingly but important if the action could have harmful, unintended consequences
|
||||
*/
|
||||
warning: string | null
|
||||
/**
|
||||
* One of: "enabled", "hidden", or { disabled: "" }
|
||||
* - "enabled" - the action is available be run
|
||||
* - "hidden" - the action cannot be seen or run
|
||||
* - { disabled: "example explanation" } means the action is visible but cannot be run. Replace "example explanation" with a reason why the action is disable to prevent user confusion.
|
||||
*/
|
||||
visibility: ActionVisibility
|
||||
/**
|
||||
* One of: "only-stopped", "only-running", "all"
|
||||
* - "only-stopped" - the action can only be run when the service is stopped
|
||||
* - "only-running" - the action can only be run when the service is running
|
||||
* - "any" - the action can only be run regardless of the service's status
|
||||
*/
|
||||
allowedStatuses: AllowedStatuses
|
||||
hasInput: boolean
|
||||
/**
|
||||
* If provided, this action will be nested under a header of this value, along with other actions of the same group
|
||||
*/
|
||||
group: string | null
|
||||
}
|
||||
|
||||
@@ -1,15 +1,39 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ActionResultMember = {
|
||||
/**
|
||||
* A human-readable name or title of the value, such as "Last Active" or "Login Password"
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* (optional) A description of the value, such as an explaining why it exists or how to use it
|
||||
*/
|
||||
description: string | null
|
||||
} & (
|
||||
| {
|
||||
type: "single"
|
||||
/**
|
||||
* The actual string value to display
|
||||
*/
|
||||
value: string
|
||||
/**
|
||||
* Whether or not to include a copy to clipboard icon to copy the value
|
||||
*/
|
||||
copyable: boolean
|
||||
/**
|
||||
* Whether or not to also display the value as a QR code
|
||||
*/
|
||||
qr: boolean
|
||||
/**
|
||||
* Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information
|
||||
*/
|
||||
masked: boolean
|
||||
}
|
||||
| { type: "group"; value: Array<ActionResultMember> }
|
||||
| {
|
||||
type: "group"
|
||||
/**
|
||||
* An new group of nested values, experienced by the user as an accordion dropdown
|
||||
*/
|
||||
value: Array<ActionResultMember>
|
||||
}
|
||||
)
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
import type { ActionResultValue } from "./ActionResultValue"
|
||||
|
||||
export type ActionResultV1 = {
|
||||
/**
|
||||
* Primary text to display as the header of the response modal. e.g. "Success!", "Name Updated", or "Service Information", whatever makes sense
|
||||
*/
|
||||
title: string
|
||||
/**
|
||||
* (optional) A general message for the user, just under the title
|
||||
*/
|
||||
message: string | null
|
||||
/**
|
||||
* (optional) Structured data to present inside the modal
|
||||
*/
|
||||
result: ActionResultValue | null
|
||||
}
|
||||
|
||||
@@ -4,9 +4,27 @@ import type { ActionResultMember } from "./ActionResultMember"
|
||||
export type ActionResultValue =
|
||||
| {
|
||||
type: "single"
|
||||
/**
|
||||
* The actual string value to display
|
||||
*/
|
||||
value: string
|
||||
/**
|
||||
* Whether or not to include a copy to clipboard icon to copy the value
|
||||
*/
|
||||
copyable: boolean
|
||||
/**
|
||||
* Whether or not to also display the value as a QR code
|
||||
*/
|
||||
qr: boolean
|
||||
/**
|
||||
* Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information
|
||||
*/
|
||||
masked: boolean
|
||||
}
|
||||
| { type: "group"; value: Array<ActionResultMember> }
|
||||
| {
|
||||
type: "group"
|
||||
/**
|
||||
* An new group of nested values, experienced by the user as an accordion dropdown
|
||||
*/
|
||||
value: Array<ActionResultMember>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user