fleet/frontend/interfaces/command.ts
Ian Littman da6cfd8e9f
Show configuration profile name and more fine-grained status (#42126)
Resolves #40177 and subissues.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [sorta] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [x] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Profile names are now displayed alongside mobile device management
commands for installing or removing profiles. These names are visible in
command details modals and within device activity timelines.
* Added "NotNow" status for deferred profile commands, providing
improved transparency into which profiles are being managed and the
current status of profile installation or removal operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-09 12:46:11 -05:00

39 lines
1.4 KiB
TypeScript

/** The original mdm command status representation */
export type CommandStatus = "Pending" | "Acknowledged" | "Error" | "NotNow";
/** The fleet representation of command status */
export type FleetCommandStatus = "ran" | "pending" | "failed";
export interface ICommand {
host_uuid: string;
command_uuid: string;
status: CommandStatus;
command_status: FleetCommandStatus;
updated_at: string;
request_type: string;
hostname: string;
name: string | null; // Profile name when command is for installing/removing a macOS profile
}
/**
* Shape of an mdm command result object returned by the Fleet API.
*/
export interface ICommandResult {
host_uuid: string;
command_uuid: string;
/** Status of the command. It can be one of Acknowledged, Error, or NotNow for
// Apple, or 200, 400, etc for Windows. */
status: string;
updated_at: string;
request_type: string;
hostname: string;
/** Base64-encoded string containing the MDM command request */
payload: string;
/** Base64-encoded string containing the MDM command response */
result: string;
name: string | null; // Profile name when command is for installing/removing a macOS profile
/** ResultsMetadata contains command-specific metadata.
* VPP install commands include a "software_installed" boolean and
* "vpp_verify_timeout_seconds" integer. */
results_metadata?: Record<string, unknown>;
}