UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

53 lines 2.03 kB
import * as z from "zod/v3"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * How often credits are automatically refilled. */ export declare const KeyCreditsRefillInterval: { readonly Daily: "daily"; readonly Monthly: "monthly"; }; /** * How often credits are automatically refilled. */ export type KeyCreditsRefillInterval = OpenEnum<typeof KeyCreditsRefillInterval>; /** * Configuration for automatic credit refill behavior. */ export type KeyCreditsRefill = { /** * How often credits are automatically refilled. */ interval: KeyCreditsRefillInterval; /** * Number of credits to add during each refill cycle. */ amount: number; /** * Day of the month for monthly refills (1-31). * * @remarks * Only required when interval is 'monthly'. * For days beyond the month's length, refill occurs on the last day of the month. */ refillDay?: number | undefined; }; /** @internal */ export declare const KeyCreditsRefillInterval$inboundSchema: z.ZodType<KeyCreditsRefillInterval, z.ZodTypeDef, unknown>; /** @internal */ export declare const KeyCreditsRefillInterval$outboundSchema: z.ZodType<string, z.ZodTypeDef, KeyCreditsRefillInterval>; /** @internal */ export declare const KeyCreditsRefill$inboundSchema: z.ZodType<KeyCreditsRefill, z.ZodTypeDef, unknown>; /** @internal */ export type KeyCreditsRefill$Outbound = { interval: string; amount: number; refillDay?: number | undefined; }; /** @internal */ export declare const KeyCreditsRefill$outboundSchema: z.ZodType<KeyCreditsRefill$Outbound, z.ZodTypeDef, KeyCreditsRefill>; export declare function keyCreditsRefillToJSON(keyCreditsRefill: KeyCreditsRefill): string; export declare function keyCreditsRefillFromJSON(jsonString: string): SafeParseResult<KeyCreditsRefill, SDKValidationError>; //# sourceMappingURL=keycreditsrefill.d.ts.map