UNPKG

@limitly/limitly-js

Version:

Official Node.js SDK for Limitly - API Key management, plans, users and request validation

46 lines 1.63 kB
import { HttpClient } from '../client'; import { ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, ApiKeyUsage, ApiKeyRequestsResponse, ApiResponse, PaginatedResponse, LimitInfo, RequestOptions } from '../types'; /** * Module for managing API Keys */ export declare class ApiKeysModule { private client; constructor(client: HttpClient); /** * Lists all API Keys for the authenticated owner */ list(options?: RequestOptions): Promise<PaginatedResponse<ApiKey>>; /** * Creates a new API Key */ create(data: CreateApiKeyRequest, options?: RequestOptions): Promise<ApiResponse<ApiKey & { limitInfo?: LimitInfo; }>>; /** * Gets a specific API Key by ID */ get(keyId: string, options?: RequestOptions): Promise<ApiResponse<ApiKey>>; /** * Updates an existing API Key */ update(keyId: string, data: UpdateApiKeyRequest, options?: RequestOptions): Promise<ApiResponse<ApiKey>>; /** * Deletes an API Key (soft delete) */ delete(keyId: string, options?: RequestOptions): Promise<ApiResponse<{ message: string; }>>; /** * Regenerates an existing API Key */ regenerate(keyId: string, options?: RequestOptions): Promise<ApiResponse<ApiKey>>; /** * Gets usage statistics for an API Key */ getUsage(keyId: string, options?: RequestOptions): Promise<ApiResponse<ApiKeyUsage>>; /** * Gets detailed request history for an API Key */ getRequests(keyId: string, options?: RequestOptions): Promise<ApiResponse<ApiKeyRequestsResponse>>; } //# sourceMappingURL=api-keys.d.ts.map