(runtime, options = {})
| 109 | AdminShutdownCommandOptions | undefined, |
| 110 | AdminShutdownCommandResult |
| 111 | > = async (runtime, options = {}): Promise<AdminShutdownCommandResult> => { |
| 112 | if (!runtime.backend.shutdownDevice) { |
| 113 | throw new AppError('UNSUPPORTED_OPERATION', 'admin.shutdown is not supported by this backend'); |
| 114 | } |
| 115 | const target = normalizeDeviceTarget(options.target); |
| 116 | const backendResult = await runtime.backend.shutdownDevice( |
| 117 | toBackendContext(runtime, options), |
| 118 | target, |
| 119 | ); |
| 120 | const formattedBackendResult = toBackendResult(backendResult); |
| 121 | return { |
| 122 | kind: 'deviceShutdown', |
| 123 | ...(target ? { target } : {}), |
| 124 | ...(formattedBackendResult ? { backendResult: formattedBackendResult } : {}), |
| 125 | ...successText('Shutdown device'), |
| 126 | }; |
| 127 | }; |
| 128 | |
| 129 | export const installCommand: RuntimeCommand< |
| 130 | AdminInstallCommandOptions, |
nothing calls this directly
no test coverage detected
searching dependent graphs…