UNPKG

balena-sdk

Version:
47 lines (46 loc) 1.6 kB
import type { OptionsToResponse } from 'pinejs-client-core'; import type { Device } from '..'; export interface CurrentService { commit: string; raw_version: string; release_id: number; id: number; image_id: number; service_id: number; download_progress: number | null; status: string; install_date: string; } export declare const getCurrentServiceDetailsPineExpand: { readonly image_install: { readonly $select: readonly ["id", "download_progress", "status", "install_date"]; readonly $filter: { readonly status: { readonly $ne: "deleted"; }; }; readonly $expand: { readonly installs__image: { readonly $select: readonly ["id"]; readonly $expand: { readonly is_a_build_of__service: { readonly $select: readonly ["id", "service_name"]; }; }; }; readonly is_provided_by__release: { readonly $select: readonly ["id", "commit", "raw_version"]; }; }; }; }; export type DeviceWithServiceDetails = OptionsToResponse<Device['Read'], { $expand: typeof getCurrentServiceDetailsPineExpand; }, undefined>[number] & { current_services: { [serviceName: string]: CurrentService[]; }; }; export declare const generateCurrentServiceDetails: (rawDevice: OptionsToResponse<Device["Read"], { $expand: typeof getCurrentServiceDetailsPineExpand; }, undefined>[number]) => DeviceWithServiceDetails;