@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
42 lines • 1.7 kB
TypeScript
import * as z from "zod";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type V2Ratelimit = {
/**
* The name of this limit. You will need to use this again when verifying a key.
*/
name: string;
/**
* How many requests may pass within a given window before requests are rejected.
*/
limit: number;
/**
* The duration for each ratelimit window in milliseconds.
*/
duration: number;
};
/** @internal */
export declare const V2Ratelimit$inboundSchema: z.ZodType<V2Ratelimit, z.ZodTypeDef, unknown>;
/** @internal */
export type V2Ratelimit$Outbound = {
name: string;
limit: number;
duration: number;
};
/** @internal */
export declare const V2Ratelimit$outboundSchema: z.ZodType<V2Ratelimit$Outbound, z.ZodTypeDef, V2Ratelimit>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace V2Ratelimit$ {
/** @deprecated use `V2Ratelimit$inboundSchema` instead. */
const inboundSchema: z.ZodType<V2Ratelimit, z.ZodTypeDef, unknown>;
/** @deprecated use `V2Ratelimit$outboundSchema` instead. */
const outboundSchema: z.ZodType<V2Ratelimit$Outbound, z.ZodTypeDef, V2Ratelimit>;
/** @deprecated use `V2Ratelimit$Outbound` instead. */
type Outbound = V2Ratelimit$Outbound;
}
export declare function v2RatelimitToJSON(v2Ratelimit: V2Ratelimit): string;
export declare function v2RatelimitFromJSON(jsonString: string): SafeParseResult<V2Ratelimit, SDKValidationError>;
//# sourceMappingURL=v2ratelimit.d.ts.map