@limitly/limitly-nextjs
Version:
Official Next.js SDK for Limitly - API Key management, plans, users and request validation optimized for server-side
77 lines • 2.95 kB
TypeScript
import { HttpClient } from '../client';
import { Plan, CreatePlanRequest, UpdatePlanRequest, PlanUsage, PlanUsersResponse, PlanKeysResponse, ApiResponse, PaginatedResponse, RequestOptions } from '../types';
/**
* Module for managing Plans
* Optimized for Next.js server-side rendering
*/
export declare class PlansModule {
private client;
constructor(client: HttpClient);
/**
* Lists all plans
* @param options - Request options including Next.js cache options
* @returns Promise with paginated plans
*/
list(options?: RequestOptions): Promise<PaginatedResponse<Plan>>;
/**
* Creates a new plan
* @param data - Plan creation data
* @param options - Request options
* @returns Promise with created plan
*/
create(data: CreatePlanRequest, options?: RequestOptions): Promise<ApiResponse<Plan>>;
/**
* Gets a specific plan by ID
* @param planId - The plan ID
* @param options - Request options including Next.js cache options
* @returns Promise with plan details
*/
get(planId: string, options?: RequestOptions): Promise<ApiResponse<Plan>>;
/**
* Updates an existing plan
* @param planId - The plan ID
* @param data - Update data
* @param options - Request options
* @returns Promise with updated plan
*/
update(planId: string, data: UpdatePlanRequest, options?: RequestOptions): Promise<ApiResponse<Plan>>;
/**
* Deletes a plan
* @param planId - The plan ID
* @param options - Request options
* @returns Promise with deletion confirmation
*/
delete(planId: string, options?: RequestOptions): Promise<ApiResponse<{
message: string;
}>>;
/**
* Gets usage statistics for a plan
* @param planId - The plan ID
* @param options - Request options including Next.js cache options
* @returns Promise with plan usage statistics
*/
getUsage(planId: string, options?: RequestOptions): Promise<ApiResponse<PlanUsage>>;
/**
* Gets all users assigned to a plan
* @param planId - The plan ID
* @param options - Request options including Next.js cache options
* @returns Promise with plan users
*/
getUsers(planId: string, options?: RequestOptions): Promise<ApiResponse<PlanUsersResponse>>;
/**
* Gets all API Keys assigned to a plan
* @param planId - The plan ID
* @param options - Request options including Next.js cache options
* @returns Promise with plan API keys
*/
getKeys(planId: string, options?: RequestOptions): Promise<ApiResponse<PlanKeysResponse>>;
/**
* Gets plans with usage statistics (optimized for Next.js)
* @param options - Request options
* @returns Promise with plans and their usage
*/
listWithUsage(options?: RequestOptions): Promise<PaginatedResponse<Plan & {
usage?: PlanUsage;
}>>;
}
//# sourceMappingURL=plans.d.ts.map