CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/api/schema/compute/get-images.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema, RequestNoCacheSchema } from "../common";
4
5
import { ComputeServerImageProxySchema } from "./common";
6
7
// OpenAPI spec
8
//
9
export const GetComputeServerImagesInputSchema = z
10
.object({
11
noCache: RequestNoCacheSchema.optional(),
12
})
13
.describe("Used to get available compute server images.");
14
15
export const GetComputeServerImagesOutputSchema = z.union([
16
FailedAPIOperationSchema,
17
z
18
.record(
19
z.string(),
20
z.object({
21
system: z.boolean().describe("").optional(),
22
priority: z.number().min(0).describe("").optional(),
23
disabled: z.boolean().describe("").optional(),
24
label: z.string().describe("").optional(),
25
comment: z.string().describe("").optional(),
26
package: z.string().describe("").optional(),
27
package_arm64: z.string().describe("").optional(),
28
minDiskSizeGb: z.number().min(0).describe("").optional(),
29
dockerSizeGb: z.number().min(0).describe("").optional(),
30
gpu: z.boolean().describe("").optional(),
31
icon: z.string().describe("").optional(),
32
url: z.string().describe("").optional(),
33
source: z.string().describe("").optional(),
34
description: z.string().describe("").optional(),
35
versions: z
36
.array(
37
z.object({
38
tag: z.string(),
39
tested: z.boolean(),
40
version: z.string().optional(),
41
label: z.string().optional(),
42
}),
43
)
44
.optional(),
45
videos: z.array(z.string()).optional(),
46
tutorials: z.array(z.string()).optional(),
47
jupyterKernels: z.boolean().optional(),
48
requireDns: z.boolean().optional(),
49
upstreamVersions: z.string().optional(),
50
proxy: ComputeServerImageProxySchema.optional(),
51
}),
52
)
53
.describe(
54
`Maps server image keys to detailed JSON information about the server image (e.g.,
55
download URL, descriptions, source files, etc.`,
56
),
57
]);
58
59
export type GetComputeServerImagesInput = z.infer<
60
typeof GetComputeServerImagesInputSchema
61
>;
62
export type GetComputeServerImagesOutput = z.infer<
63
typeof GetComputeServerImagesOutputSchema
64
>;
65
66