balena-cli
Version:
The official balena Command Line Interface
143 lines (142 loc) • 6.94 kB
TypeScript
import { Command } from '@oclif/core';
import type { Application, BalenaSDK, Pine, Release } from 'balena-sdk';
import type { Preloader } from 'balena-preload';
declare const applicationExpandOptions: {
readonly owns__release: {
readonly $select: readonly ["id", "commit", "end_timestamp", "composition"];
readonly $expand: {
readonly release_image: {
readonly $select: readonly ["id"];
readonly $expand: {
readonly image: {
readonly $select: readonly ["image_size", "is_stored_at__image_location"];
};
};
};
};
readonly $filter: {
readonly status: "success";
};
readonly $orderby: readonly [{
readonly end_timestamp: "desc";
}, {
readonly id: "desc";
}];
};
readonly should_be_running__release: {
readonly $select: "commit";
};
};
declare const getApplicationsWithBuildOptions: (deviceTypeSlug: string) => {
readonly $select: readonly ["id", "slug", "should_track_latest_release"];
readonly $expand: {
readonly owns__release: {
readonly $select: readonly ["id", "commit", "end_timestamp", "composition"];
readonly $expand: {
readonly release_image: {
readonly $select: readonly ["id"];
readonly $expand: {
readonly image: {
readonly $select: readonly ["image_size", "is_stored_at__image_location"];
};
};
};
};
readonly $filter: {
readonly status: "success";
};
readonly $orderby: readonly [{
readonly end_timestamp: "desc";
}, {
readonly id: "desc";
}];
};
readonly should_be_running__release: {
readonly $select: "commit";
};
};
readonly $filter: {
readonly is_for__device_type: {
readonly $any: {
readonly $alias: "dt";
readonly $expr: {
readonly dt: {
readonly is_of__cpu_architecture: {
readonly $any: {
readonly $alias: "ioca";
readonly $expr: {
readonly ioca: {
readonly is_supported_by__device_type: {
readonly $any: {
readonly $alias: "isbdt";
readonly $expr: {
readonly isbdt: {
readonly slug: string;
};
};
};
};
};
};
};
};
};
};
};
};
readonly owns__release: {
readonly $any: {
readonly $alias: "r";
readonly $expr: {
readonly r: {
readonly status: "success";
};
};
};
};
};
readonly $orderby: {
readonly slug: "asc";
};
};
type ApplicationWithReleases = NonNullable<Pine.OptionsToResponse<Application['Read'], {
$expand: typeof applicationExpandOptions;
}, string>>;
type ApplicationsWithBuilds = Pine.OptionsToResponse<Application['Read'], ReturnType<typeof getApplicationsWithBuildOptions>, undefined>;
export default class PreloadCmd extends Command {
static description: string;
static examples: string[];
static args: {
image: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
};
static flags: {
dockerPort: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
docker: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
dockerHost: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
ca: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
cert: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
key: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
fleet: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
commit: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
'splash-image': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
'dont-check-arch': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
'pin-device-to-release': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
'additional-space': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
'add-certificate': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
};
static authenticated: boolean;
static primary: boolean;
run(): Promise<void>;
isCurrentCommit(commit: string): commit is "current" | "latest";
getApplicationsWithSuccessfulBuilds(deviceTypeSlug: string): Promise<ApplicationsWithBuilds>;
selectApplication(deviceTypeSlug: string): Promise<ApplicationsWithBuilds[number]>;
selectApplicationCommit(releases: Pine.OptionsToResponse<Release['Read'], (typeof applicationExpandOptions)['owns__release'], undefined>): Promise<string>;
offerToDisableAutomaticUpdates(application: Pick<Application['Read'], 'id' | 'should_track_latest_release'>, commit: string, pinDevice: boolean | undefined): Promise<void>;
getAppWithReleases(balenaSdk: BalenaSDK, slug: string): Promise<ApplicationWithReleases>;
prepareAndPreload(preloader: Preloader, balenaSdk: BalenaSDK, options: {
slug?: string;
commit?: string;
pinDevice?: boolean;
}): Promise<void>;
}
export {};