@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
79 lines (74 loc) • 2.52 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* A limited form of data for the currently authenticated User, due to the authentication token missing privileges to read the full User data.
*/
export type AuthUserLimited = {
/**
* Property indicating that this User data contains only limited information, due to the authentication token missing privileges to read the full User data. Re-login with email, GitHub, GitLab or Bitbucket in order to upgrade the authentication token with the necessary privileges.
*/
limited: true;
/**
* The User's unique identifier.
*/
id: string;
/**
* Email address associated with the User account.
*/
email: string;
/**
* Name associated with the User account, or `null` if none has been provided.
*/
name: string | null;
/**
* Unique username associated with the User account.
*/
username: string;
/**
* SHA1 hash of the avatar for the User account. Can be used in conjuction with the ... endpoint to retrieve the avatar image.
*/
avatar: string | null;
/**
* The user's default team.
*/
defaultTeamId: string | null;
/**
* Indicates whether the user is managed by an enterprise.
*/
isEnterpriseManaged?: boolean | undefined;
/**
* Whether the Enterprise Managed User joined the current team through the Update Account flow and should see its welcome experience.
*/
shouldShowEnterpriseManagedWelcome?: boolean | undefined;
};
/** @internal */
export const AuthUserLimited$inboundSchema: z.ZodType<
AuthUserLimited,
z.ZodTypeDef,
unknown
> = z.object({
limited: types.literal(true),
id: types.string(),
email: types.string(),
name: types.nullable(types.string()),
username: types.string(),
avatar: types.nullable(types.string()),
defaultTeamId: types.nullable(types.string()),
isEnterpriseManaged: types.optional(types.boolean()),
shouldShowEnterpriseManagedWelcome: types.optional(types.boolean()),
});
export function authUserLimitedFromJSON(
jsonString: string,
): SafeParseResult<AuthUserLimited, SDKValidationError> {
return safeParse(
jsonString,
(x) => AuthUserLimited$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AuthUserLimited' from JSON`,
);
}