UNPKG

@supernovaio/cli

Version:

Supernova.io Command Line Interface

35 lines (33 loc) 1.34 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d59bf6dd-21c7-5c1d-a78b-e5afed2781e3")}catch(e){}}(); import { z } from "zod"; import { TargetEnv } from "./environment.js"; export const TokensSchema = z.object({ accessToken: z.string(), refreshToken: z.string().optional(), }); const PendingStatusTokensSchema = z.object({ status: z.literal("Pending"), tokens: z.never().optional(), }); const SuccessStatusTokensSchema = z.object({ status: z.literal("Success"), tokens: TokensSchema, }); export const StatusTokensSchema = z.discriminatedUnion("status", [PendingStatusTokensSchema, SuccessStatusTokensSchema]); export const TokensResponseSchema = z.object({ result: StatusTokensSchema, }); export const RefreshTokenResponseSchema = z.object({ result: z.object({ tokens: TokensSchema, }), }); export const AuthResponseSchema = z.object({ result: z.object({ authorizeUrl: z.string(), readKey: z.string(), }), }); export const EnvTokensSchema = z.record(TargetEnv, TokensSchema.optional()); //# sourceMappingURL=login.js.map //# debugId=d59bf6dd-21c7-5c1d-a78b-e5afed2781e3