providerAuthModeSchema (schemas/provider.ts)

nexu · packages/shared/src/schemas/provider.ts · typescript · MIT
auth, tag:embed-classified

Zod schemas for provider authentication, OAuth, and cloud profile management.

// Source: https://github.com/nexu-io/nexu | License: MIT | Copyright 2026 Powerformer, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";

// ── Provider CRUD ────────────────────────────────────────────────

export const providerAuthModeSchema = z.enum(["apiKey", "oauth"]);
export const minimaxOauthRegionSchema = z.enum(["global", "cn"]);

export const providerResponseSchema = z.object({
  id: z.string(),
  providerId: z.string(),
  displayName: z.string().nullable(),
  enabled: z.boolean(),
  baseUrl: z.string().nullable(),
  authMode: providerAuthModeSchema.optional(),
  hasApiKey: z.boolean(),
  hasOauthCredential: z.boolean().optional(),
  oauthRegion: minimaxOauthRegionSchema.nullable().optional(),
  oauthEmail: z.string().nullable().option

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key