@re-shell/cli
Version:
Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja
172 lines (171 loc) • 4.95 kB
TypeScript
import { EventEmitter } from 'events';
export interface MarketplacePlugin {
id: string;
name: string;
version: string;
latestVersion: string;
description: string;
author: string;
authorEmail?: string;
license: string;
homepage?: string;
repository?: string;
keywords: string[];
category: PluginCategory;
downloads: number;
rating: number;
reviewCount: number;
featured: boolean;
verified: boolean;
createdAt: string;
updatedAt: string;
size: number;
screenshots?: string[];
readme?: string;
changelog?: string;
dependencies: Record<string, string>;
compatibility: {
cliVersion: string;
nodeVersion: string;
platforms: string[];
};
pricing: PluginPricing;
support: PluginSupport;
metrics: PluginMetrics;
}
export declare enum PluginCategory {
DEVELOPMENT = "development",
PRODUCTIVITY = "productivity",
AUTOMATION = "automation",
INTEGRATION = "integration",
TESTING = "testing",
DEPLOYMENT = "deployment",
MONITORING = "monitoring",
SECURITY = "security",
UTILITY = "utility",
THEME = "theme",
EXTENSION = "extension"
}
export interface PluginPricing {
type: 'free' | 'paid' | 'freemium' | 'subscription';
price?: number;
currency?: string;
billing?: 'monthly' | 'yearly' | 'one-time';
trialDays?: number;
}
export interface PluginSupport {
documentation?: string;
issues?: string;
community?: string;
email?: string;
responseTime?: string;
languages: string[];
}
export interface PluginMetrics {
weeklyDownloads: number;
monthlyDownloads: number;
totalDownloads: number;
stars: number;
forks: number;
issues: number;
lastCommit: string;
contributors: number;
}
export interface PluginReview {
id: string;
pluginId: string;
userId: string;
username: string;
rating: number;
title: string;
content: string;
pros?: string[];
cons?: string[];
version: string;
helpful: number;
verified: boolean;
createdAt: string;
updatedAt: string;
}
export interface MarketplaceSearchFilters {
query?: string;
category?: PluginCategory;
author?: string;
license?: string;
rating?: number;
featured?: boolean;
verified?: boolean;
free?: boolean;
sortBy?: 'relevance' | 'downloads' | 'rating' | 'updated' | 'created' | 'name';
sortOrder?: 'asc' | 'desc';
limit?: number;
offset?: number;
}
export interface MarketplaceSearchResult {
plugins: MarketplacePlugin[];
total: number;
page: number;
pages: number;
filters: MarketplaceSearchFilters;
}
export interface InstallationResult {
success: boolean;
plugin: MarketplacePlugin;
installedVersion: string;
installPath: string;
dependencies: string[];
warnings: string[];
errors: string[];
duration: number;
}
export interface MarketplaceConfig {
apiUrl: string;
authToken?: string;
cacheTimeout: number;
downloadTimeout: number;
verifySignatures: boolean;
allowPrerelease: boolean;
autoUpdate: boolean;
telemetry: boolean;
}
export declare class PluginMarketplace extends EventEmitter {
private config;
private cache;
private downloadQueue;
constructor(config?: Partial<MarketplaceConfig>);
searchPlugins(filters?: MarketplaceSearchFilters): Promise<MarketplaceSearchResult>;
getPlugin(pluginId: string): Promise<MarketplacePlugin | null>;
installPlugin(pluginId: string, version?: string, options?: {
global?: boolean;
force?: boolean;
}): Promise<InstallationResult>;
private performInstallation;
private checkCompatibility;
private downloadPlugin;
private verifyPluginSignature;
private installPluginFiles;
private installDependencies;
getPluginReviews(pluginId: string, limit?: number, offset?: number): Promise<PluginReview[]>;
submitReview(review: Omit<PluginReview, 'id' | 'createdAt' | 'updatedAt'>): Promise<PluginReview>;
getFeaturedPlugins(limit?: number): Promise<MarketplacePlugin[]>;
getPopularPlugins(category?: PluginCategory, limit?: number): Promise<MarketplacePlugin[]>;
getCategories(): Promise<Array<{
name: PluginCategory;
count: number;
description: string;
}>>;
clearCache(): void;
private getCachedData;
private setCachedData;
private mockSearchRequest;
private mockGetPlugin;
private mockDownloadFile;
private mockGetReviews;
private mockGetFeatured;
private mockGetPopular;
getStats(): any;
}
export declare function createMarketplace(config?: Partial<MarketplaceConfig>): PluginMarketplace;
export declare function isValidPluginId(id: string): boolean;
export declare function formatFileSize(bytes: number): string;
export declare function formatDownloadCount(count: number): string;