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/common.ts
Views: 687
import { z } from "../framework";12const BasicallyAnHTTP204 = <T extends string>(status: T) =>3z.object({4status: z.enum([status]).describe(5`Indicates the status of this operation; if the operation was successful, the6value of this field is always set to \`${status}\`.`,7),8});910export const OkAPIOperationSchema = BasicallyAnHTTP204("ok");11export const SuccessfulAPIOperationSchema = BasicallyAnHTTP204("success");1213export const FailedAPIOperationSchema = z.object({14error: z.string().describe("Error message if something goes badly wrong."),15});1617export type FailedAPIOperation = z.infer<typeof FailedAPIOperationSchema>;18export type SuccessfulAPIOperation = z.infer<19typeof SuccessfulAPIOperationSchema20>;21export type OkAPIOperation = z.infer<typeof OkAPIOperationSchema>;2223export const RequestNoCacheSchema = z24.boolean()25.describe(26"**Administrators only**. Disables database caching for this query.",27)28.optional();2930export type RequestNoCache = z.infer<typeof RequestNoCacheSchema>;3132export const LimitResultsSchema = z33.number()34.min(1)35.describe("Limits the number of returned results.");3637export type LimitResults = z.infer<typeof LimitResultsSchema>;3839export const SkipResultsSchema = z40.number()41.min(1)42.describe("Skips the first `n` results.");4344export type SkipResults = z.infer<typeof SkipResultsSchema>;454647