mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 17:47:22 +00:00
chore: updated tsconfig and fixed typecheck
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>
This commit is contained in:
parent
0e0726bf12
commit
f2e4b74ab8
4 changed files with 30 additions and 6 deletions
|
|
@ -62,6 +62,7 @@ async function download(tagVersion: string, repoPath: string, fileName: string):
|
|||
});
|
||||
let buffer;
|
||||
|
||||
if (!manifests.data.content) return;
|
||||
if (manifests.data.encoding && manifests.data.encoding === 'base64') {
|
||||
buffer = Buffer.from(manifests.data.content, 'base64');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
"resolveJsonModule": true,
|
||||
"lib": ["ES2017", "webworker"],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"rootDirs": ["src", "scripts"],
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src", "types/*.d.ts", "../../types/**/*.d.ts"]
|
||||
"include": ["src", "types/*.d.ts", "../../types/**/*.d.ts", "scripts"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,28 @@ export enum DiskType {
|
|||
Applehv = 'applehv',
|
||||
}
|
||||
|
||||
type ResponseManifest = {
|
||||
digest: string;
|
||||
annotations: {
|
||||
disktype: string;
|
||||
};
|
||||
platform: {
|
||||
os: string;
|
||||
architecture: string;
|
||||
};
|
||||
};
|
||||
|
||||
type ResponseLayers = {
|
||||
digest: string;
|
||||
size: number;
|
||||
};
|
||||
|
||||
type ResponseJSON = {
|
||||
layers: ResponseLayers[];
|
||||
errors: unknown;
|
||||
manifests: ResponseManifest[];
|
||||
};
|
||||
|
||||
// to make this file a module
|
||||
export class PodmanDownload {
|
||||
#podmanVersion: string;
|
||||
|
|
@ -288,9 +310,10 @@ export class Podman5DownloadMachineOS {
|
|||
this.#version = version;
|
||||
this.#shaCheck = shaCheck;
|
||||
this.#assetsFolder = assetsFolder;
|
||||
this.#ociRegistryProjectLink = '';
|
||||
}
|
||||
|
||||
async getManifest(manifestUrl: string): Promise<any> {
|
||||
async getManifest(manifestUrl: string): Promise<ResponseJSON> {
|
||||
const response = await fetch(manifestUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
|
@ -298,7 +321,7 @@ export class Podman5DownloadMachineOS {
|
|||
Accept: 'application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json',
|
||||
},
|
||||
});
|
||||
return response.json();
|
||||
return response.json() as unknown as ResponseJSON;
|
||||
}
|
||||
|
||||
protected async pipe(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"lib": ["ES2017"],
|
||||
"module": "esnext",
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"rootDirs": ["src", "scripts"],
|
||||
"outDir": "dist",
|
||||
"target": "esnext",
|
||||
"moduleResolution": "Node",
|
||||
|
|
@ -13,5 +13,5 @@
|
|||
"allowSyntheticDefaultImports": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src", "types/*.d.ts"]
|
||||
"include": ["src", "types/*.d.ts", "scripts"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue