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/update.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema, OkAPIOperationSchema } from "../common";
4
5
import { AdminAccountIdSchema } from "../accounts/common";
6
7
import {
8
ProjectDescriptionSchema,
9
ProjectIdSchema,
10
ProjectNameSchema,
11
ProjectTitleSchema,
12
} from "./common";
13
14
// OpenAPI spec
15
//
16
export const UpdateProjectInputSchema = z
17
.object({
18
account_id: AdminAccountIdSchema,
19
project_id: ProjectIdSchema,
20
title: ProjectTitleSchema.optional(),
21
description: ProjectDescriptionSchema.optional(),
22
name: ProjectNameSchema.optional(),
23
})
24
.describe(
25
`Update an existing project's title, name, and/or description. If the API client is an
26
admin, they may act on any project. Otherwise, the client may only update projects
27
for which they are listed as collaborators.`,
28
);
29
30
export const UpdateProjectOutputSchema = z.union([
31
FailedAPIOperationSchema,
32
OkAPIOperationSchema,
33
]);
34
35
export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;
36
export type UpdateProjectOutput = z.infer<typeof UpdateProjectOutputSchema>;
37
38