Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/lib/api/schema/accounts/sign-up.ts
Views: 688
import { SignUpIssues } from "lib/types/sign-up";1import { z } from "../../framework";23import { FailedAPIOperationSchema } from "../common";45import { AccountIdSchema } from "./common";67// OpenAPI spec8//9export const SignUpInputSchema = z10.object({11email: z12.string()13.email()14.describe(15"Email address of new user. TIP: If you want to pass in an email like [email protected], use '%2B' in place of '+'",16),17password: z.string().describe("Initial password of new user."),18firstName: z.string().describe("First name"),19lastName: z.string().describe("Last name"),20terms: z21.boolean()22.describe("Must be set to 'true' to indicate acceptance of ToS."),23registrationToken: z24.string()25.optional()26.describe("If required, enter a currently valid registration token."),27tags: z.array(z.string()).optional().describe("Tag users"),28publicPathId: z29.string()30.optional()31.describe("ID of published document, used to get a license ID"),32signupReason: z.string().optional(),33})34.describe(35"Create a new account. In production, this is not available for all users and requires additional trust! For on-premises, this functionality is only available for administrators.",36);3738const IssuesSchema = z.object({39terms: z.string().optional().describe("Problem with ToS"),40email: z.string().optional().describe("Problem with the email address"),41password: z.string().optional().describe("Problem with the password"),42api: z.string().optional().describe("Problem with the API"),43});4445export const SignUpOutputSchema = z.union([46z.union([47z.object({48account_id: AccountIdSchema.describe("Account ID"),49}),50z51.object({52issues: IssuesSchema,53})54.describe("Reporting back possible issues creating a new account."),55]),56FailedAPIOperationSchema,57]);5859export type SignUpInput = z.infer<typeof SignUpInputSchema>;60export type SignUpOutput = z.infer<typeof SignUpOutputSchema>;6162// consistency check63export const _1: Required<SignUpIssues> = {} as Required<64z.infer<typeof IssuesSchema>65>;666768