UNPKG

@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>

166 lines 5.4 kB
import * as z from "zod/v3"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; export declare const AuthTokenScopesOrigin: { readonly App: "app"; readonly Apple: "apple"; readonly Bitbucket: "bitbucket"; readonly Chatgpt: "chatgpt"; readonly Email: "email"; readonly Emu: "emu"; readonly Github: "github"; readonly GithubWebhook: "github-webhook"; readonly Gitlab: "gitlab"; readonly Google: "google"; readonly Invite: "invite"; readonly Manual: "manual"; readonly Otp: "otp"; readonly Passkey: "passkey"; readonly Saml: "saml"; readonly Sms: "sms"; readonly TokenExchangeOidc: "token-exchange-oidc"; }; export type AuthTokenScopesOrigin = ClosedEnum<typeof AuthTokenScopesOrigin>; /** * The access scopes granted to the token. */ export type Scopes2 = { type: "team"; teamId: string; origin?: AuthTokenScopesOrigin | undefined; createdAt: number; expiresAt?: number | undefined; }; /** * Possible step-up auth origins */ export declare const AuthTokenScopes1Origin: { readonly EmailOtp: "email-otp"; readonly Otp: "otp"; readonly RecoveryCode: "recovery-code"; readonly Totp: "totp"; readonly Webauthn: "webauthn"; }; /** * Possible step-up auth origins */ export type AuthTokenScopes1Origin = ClosedEnum<typeof AuthTokenScopes1Origin>; export type Sudo = { /** * Possible step-up auth origins */ origin: AuthTokenScopes1Origin; verifiedAt?: number | undefined; expiresAt: number; }; export declare const ScopesOrigin: { readonly App: "app"; readonly Apple: "apple"; readonly Bitbucket: "bitbucket"; readonly Chatgpt: "chatgpt"; readonly Email: "email"; readonly Emu: "emu"; readonly Github: "github"; readonly GithubWebhook: "github-webhook"; readonly Gitlab: "gitlab"; readonly Google: "google"; readonly Invite: "invite"; readonly Manual: "manual"; readonly Otp: "otp"; readonly Passkey: "passkey"; readonly Saml: "saml"; readonly Sms: "sms"; readonly TokenExchangeOidc: "token-exchange-oidc"; }; export type ScopesOrigin = ClosedEnum<typeof ScopesOrigin>; /** * The access scopes granted to the token. */ export type Scopes1 = { type: "user"; sudo?: Sudo | undefined; origin?: ScopesOrigin | undefined; createdAt: number; expiresAt?: number | undefined; }; export type Scopes = Scopes1 | Scopes2; /** * Authentication token metadata. */ export type AuthToken = { /** * The unique identifier of the token. */ id: string; /** * The human-readable name of the token. */ name: string; /** * The type of the token. */ type: string; /** * The token's prefix, for identification purposes. */ prefix?: string | undefined; /** * The last few characters of the token, for identification purposes. */ suffix?: string | undefined; /** * The origin of how the token was created. */ origin?: string | undefined; /** * The access scopes granted to the token. */ scopes?: Array<Scopes1 | Scopes2> | undefined; /** * Timestamp (in milliseconds) of when the token was created. */ createdAt: number; /** * Timestamp (in milliseconds) of when the token was most recently used. */ activeAt: number; /** * Timestamp (in milliseconds) of when the token expires. */ expiresAt?: number | undefined; /** * Timestamp (in milliseconds) of when the token was revoked. */ revokedAt?: number | undefined; /** * Timestamp (in milliseconds) of when the token was marked as leaked. */ leakedAt?: number | undefined; /** * URL where the token was discovered as leaked. */ leakedUrl?: string | undefined; }; /** @internal */ export declare const AuthTokenScopesOrigin$inboundSchema: z.ZodNativeEnum<typeof AuthTokenScopesOrigin>; /** @internal */ export declare const Scopes2$inboundSchema: z.ZodType<Scopes2, z.ZodTypeDef, unknown>; export declare function scopes2FromJSON(jsonString: string): SafeParseResult<Scopes2, SDKValidationError>; /** @internal */ export declare const AuthTokenScopes1Origin$inboundSchema: z.ZodNativeEnum<typeof AuthTokenScopes1Origin>; /** @internal */ export declare const Sudo$inboundSchema: z.ZodType<Sudo, z.ZodTypeDef, unknown>; export declare function sudoFromJSON(jsonString: string): SafeParseResult<Sudo, SDKValidationError>; /** @internal */ export declare const ScopesOrigin$inboundSchema: z.ZodNativeEnum<typeof ScopesOrigin>; /** @internal */ export declare const Scopes1$inboundSchema: z.ZodType<Scopes1, z.ZodTypeDef, unknown>; export declare function scopes1FromJSON(jsonString: string): SafeParseResult<Scopes1, SDKValidationError>; /** @internal */ export declare const Scopes$inboundSchema: z.ZodType<Scopes, z.ZodTypeDef, unknown>; export declare function scopesFromJSON(jsonString: string): SafeParseResult<Scopes, SDKValidationError>; /** @internal */ export declare const AuthToken$inboundSchema: z.ZodType<AuthToken, z.ZodTypeDef, unknown>; export declare function authTokenFromJSON(jsonString: string): SafeParseResult<AuthToken, SDKValidationError>; //# sourceMappingURL=authtoken.d.ts.map