import { IApp } from "./toDesktop"; import { Configuration, PackagerOptions, PublishOptions, } from "@adam-lynch/app-builder-lib"; type appBuilderLib = PackagerOptions & PublishOptions; export interface IAppBuilderLib extends appBuilderLib { config: Configuration; } export interface ExtraFileReference { from: FilePath; to?: FilePath; } export type ISODate = string; // TODO: define more export enum PlatformName { linux = "linux", mac = "mac", windows = "windows", } export type FilePath = string; export type SemanticVersion = string; // TODO: define more export type URL = string; // TODO: define more export enum PackageManager { npm = "npm", yarn = "yarn", } export enum BuildSummaryType { date = "date", text = "text", } export interface BuildSummaryItem { label: string; value: string; type: BuildSummaryType; } export enum BuildStatus { queued = "queued", failed = "failed", building = "building", succeeded = "succeeded", } export type Arch = "ia32" | "x64"; export type LinuxArtifactName = "appImage" | "deb" | "rpm" | "snap"; export type MacArtifactName = "dmg" | "zip"; export type WindowsArtifactName = "msi" | "nsis" | "appx"; type ArtifactDownload = Record< Arch, { standardUrl: URL; url: URL } | null > | null; export type LinuxArtifactDownloads = Record< LinuxArtifactName, ArtifactDownload >; export type MacArtifactDownloads = Record; export type WindowsArtifactDownloads = Record< WindowsArtifactName, ArtifactDownload >; export type CodeSignSkipReason = "no-cert" | "user-disabled"; export interface PlatformBuild { appBuilderLibConfig?: IAppBuilderLib; // appBuilderLibVersion: SemanticVersion; artifactDownloads?: | LinuxArtifactDownloads | MacArtifactDownloads | WindowsArtifactDownloads; // desktopifyCommitId: string; codeSignSkipReason?: CodeSignSkipReason; desktopifyVersion?: SemanticVersion; didCodeSign: boolean; downloadUrl?: URL; electronVersionUsed?: SemanticVersion; endedAt: ISODate; errorMessage?: string; // nodeVersion: number; // npmVersion: number; numberOfAttemptedBuilds: number; platform: PlatformName; progressActivityName: string; progressActivityType: string; progressPercentage: number; screenshotUrl?: URL; shouldSkip: boolean; standardDownloadUrl?: URL; startedAt: ISODate; status: BuildStatus; } export interface Build { appCustomDomain?: string; appName: string; appNotarizaionBundleId: string; appVersion?: SemanticVersion; cliConfigSchemaVersion: number; continuousIntegrationServiceName?: string; commitId?: string; commitMessage?: string; createdAt: ISODate; // createdByOsArch: string; // createdByOsName: string; // createdByOsVersion: string; // createdByUserId: string; desktopifyVersion?: SemanticVersion; endedAt?: ISODate; electronVersionSpecified?: SemanticVersion; electronVersionUsed?: SemanticVersion; errorMessage?: string; icon?: string; id: string; linux?: PlatformBuild; mac?: PlatformBuild; releasedAt?: ISODate; shouldCodeSign: boolean; shouldRelease: boolean; summary: BuildSummaryItem[]; // sourceArchiveUrl: URL; sourcePackageManager?: PackageManager; standardUniversalDownloadUrl?: URL; startedAt: ISODate; status: BuildStatus; // TODO: total progress percentage? universalDownloadUrl?: URL; url?: URL; versionControlInfo?: { branchName: string; commitDate: string; commitId: string; commitMessage: string; hasUncommittedChanges: boolean; repositoryRemoteUrl: string; versionControlSystemName: string; }; // wasCreatedByContinuousIntegrationService: boolean; windows?: PlatformBuild; } export interface BuildArtifacts { appBuilderLibConfig: IAppBuilderLib; appVersion: Build["appVersion"]; desktopifyVersion: Build["desktopifyVersion"]; electronVersionSpecified: Build["electronVersionSpecified"]; electronVersionUsed: Build["electronVersionUsed"]; localArtifacts: any; onlineArtifacts: any; sourcePackageManager: PackageManager; updatedConfig: IApp; updatedVersions: { desktopify?: string; electron?: string; version?: string; }; wasSkippedBecausePlatformIsNotSupported: boolean; } export type ComputedBuildProperties = Pick< Build, | "desktopifyVersion" | "electronVersionUsed" | "endedAt" | "errorMessage" | "standardUniversalDownloadUrl" | "startedAt" | "status" | "summary" | "universalDownloadUrl" >; export enum ManifestCategory { primary = "primary", buildStamped = "build-stamped", versioned = "versioned", } export interface CustomManifestArtifactDetails { path: FilePath; url: URL; } export interface CustomManifest { artifacts: { [propertyName: string]: Record< string, CustomManifestArtifactDetails | null > | null; }; createdAt: ISODate; version: SemanticVersion; } export interface LinuxCustomManifest extends CustomManifest { artifacts: Record< LinuxArtifactName, Record | null >; } export interface MacCustomManifest extends CustomManifest { artifacts: Record< MacArtifactName, Record | null >; } export interface WindowsCustomManifest extends CustomManifest { artifacts: Record< WindowsArtifactName, Record | null >; }