@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>
55 lines (48 loc) • 1.45 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 { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* The affected authorization scope. user means each affected user must authorize again.
*/
export const Scope = {
User: "user",
} as const;
/**
* The affected authorization scope. user means each affected user must authorize again.
*/
export type Scope = ClosedEnum<typeof Scope>;
/**
* Existing authorizations no longer cover the connector's configured scopes, so they must be re-authorized.
*/
export type ConnectReconsent = {
/**
* The affected authorization scope. user means each affected user must authorize again.
*/
scope: Scope;
};
/** @internal */
export const Scope$inboundSchema: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(
Scope,
);
/** @internal */
export const ConnectReconsent$inboundSchema: z.ZodType<
ConnectReconsent,
z.ZodTypeDef,
unknown
> = z.object({
scope: Scope$inboundSchema,
});
export function connectReconsentFromJSON(
jsonString: string,
): SafeParseResult<ConnectReconsent, SDKValidationError> {
return safeParse(
jsonString,
(x) => ConnectReconsent$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ConnectReconsent' from JSON`,
);
}