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/projects/get.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema } from "../common";
4
5
import { AdminAccountIdSchema } from "../accounts/common";
6
7
import { ProjectIdSchema } from "./common";
8
9
// OpenAPI spec
10
//
11
export const GetAccountProjectsInputSchema = z
12
.object({
13
account_id: AdminAccountIdSchema,
14
limit: z
15
.number()
16
.default(50)
17
.describe("Upper bound on the number of projects to return.")
18
.nullish(),
19
})
20
.describe("Gets projects for a particular account.");
21
22
export const GetAccountProjectsOutputSchema = z.union([
23
FailedAPIOperationSchema,
24
z
25
.array(
26
z.object({
27
project_id: ProjectIdSchema,
28
title: ProjectIdSchema,
29
}),
30
)
31
.describe("An array of projects corresponding to a particular account."),
32
]);
33
34
export type GetAccountProjectsInput = z.infer<
35
typeof GetAccountProjectsInputSchema
36
>;
37
export type GetAccountProjectsOutput = z.infer<
38
typeof GetAccountProjectsOutputSchema
39
>;
40
41