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/accounts/set-email-address.ts
Views: 688
1
import { z } from "../../framework";
2
3
import {
4
FailedAPIOperationSchema,
5
SuccessfulAPIOperationSchema,
6
} from "../common";
7
8
import { AccountEmailSchema } from "./common";
9
10
// OpenAPI spec
11
//
12
export const SetAccountEmailAddressInputSchema = z
13
.object({
14
email_address: AccountEmailSchema,
15
password: z.string().describe("The password for the account."),
16
})
17
.describe(
18
`Set email address of an account. The password must also be provided. If the
19
email address is already set in the database, then \`password\` must be the current
20
correct password. If the email address is NOT set, then a new email address and
21
password are set.`,
22
);
23
24
export const SetAccountEmailAddressOutputSchema = z.union([
25
FailedAPIOperationSchema,
26
SuccessfulAPIOperationSchema,
27
]);
28
29
export type SetAccountEmailAddressInput = z.infer<
30
typeof SetAccountEmailAddressInputSchema
31
>;
32
export type SetAccountEmailAddressOutput = z.infer<
33
typeof SetAccountEmailAddressOutputSchema
34
>;
35
36