Function
withTargetDeviceResolutionScope
(
provider: DeviceInventoryProvider | undefined,
task: () => Promise<T>,
)
Source from the content-addressed store, hash-verified
| 226 | } |
| 227 | |
| 228 | export async function withTargetDeviceResolutionScope<T>( |
| 229 | provider: DeviceInventoryProvider | undefined, |
| 230 | task: () => Promise<T>, |
| 231 | ): Promise<T> { |
| 232 | return await withDeviceInventoryProvider( |
| 233 | provider, |
| 234 | async () => await withResolveTargetDeviceCacheScope(task), |
| 235 | ); |
| 236 | } |
| 237 | |
| 238 | export async function listDeviceInventory(request: DeviceInventoryRequest): Promise<DeviceInfo[]> { |
| 239 | return (await readInjectedDeviceInventory(request)) ?? (await listLocalDeviceInventory(request)); |