Skip to content

Variable: clientConfigSchema

ts
const clientConfigSchema: ZodObject<{
  auth: ZodOptional<ZodUnion<readonly [ZodObject<{
     apiToken: ZodString;
     email: ZodString;
     type: ZodLiteral<"basic">;
   }, $strip>, ZodUnion<readonly [ZodObject<{
     token: ZodString;
     type: ZodLiteral<"bearer">;
   }, $strip>, ZodObject<{
     getToken: ZodCustom<() => ..., () => ...>;
     type: ZodLiteral<"bearer">;
   }, $strip>]>, ZodObject<{
     accessToken: ZodOptional<ZodString>;
     clientId: ZodOptional<ZodString>;
     clientSecret: ZodOptional<ZodString>;
     cloudId: ZodOptional<ZodString>;
     expiresAt: ZodOptional<ZodNumber>;
     onTokenRefresh: ZodOptional<ZodCustom<OnTokenRefresh, OnTokenRefresh>>;
     refreshToken: ZodOptional<ZodString>;
     siteUrl: ZodOptional<ZodString>;
     type: ZodLiteral<"oauth2">;
  }, $strip>]>>;
  getAuthOn401: ZodOptional<ZodCustom<() => Promise<
     | {
     accessToken?: string;
     clientId?: string;
     clientSecret?: string;
     cloudId?: string;
     expiresAt?: number;
     onTokenRefresh?: OnTokenRefresh;
     refreshToken?: string;
     siteUrl?: string;
     type: "oauth2";
   }
     | {
     apiToken: string;
     email: string;
     type: "basic";
   }
     | {
     token: string;
     type: "bearer";
   }
     | {
     getToken: () => Promise<string>;
     type: "bearer";
   }>, () => Promise<
     | {
     accessToken?: string;
     clientId?: string;
     clientSecret?: string;
     cloudId?: string;
     expiresAt?: number;
     onTokenRefresh?: OnTokenRefresh;
     refreshToken?: string;
     siteUrl?: string;
     type: "oauth2";
   }
     | {
     apiToken: string;
     email: string;
     type: "basic";
   }
     | {
     token: string;
     type: "bearer";
   }
     | {
     getToken: () => Promise<string>;
     type: "bearer";
  }>>>;
  headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
  host: ZodOptional<ZodURL>;
  retry: ZodOptional<ZodObject<{
     backoffFactor: ZodOptional<ZodNumber>;
     initialDelayMs: ZodOptional<ZodNumber>;
     maxAttempts: ZodOptional<ZodNumber>;
  }, $strip>>;
}, $strip>;

Defined in: src/core/schemas/clientConfig.ts:16