@agonyz/packagist-api-client
Version:
API Client for the Packagist API
41 lines (40 loc) • 1.55 kB
TypeScript
import AbstractPackagistApi from './AbstractPackagistApi';
import { Package, PackagesByType, PopularPackage, PackagesByOrganization, PackageDownloadStats, PackageSearchResult } from '../interfaces';
declare class PackagistApi extends AbstractPackagistApi {
constructor(userAgent?: string);
protected processResponse<T>(response: Response): Promise<T>;
/**
* Reference: https://packagist.org/apidoc#get-package-data
* @param packageName
*/
getPackageInfo(packageName: string): Promise<Package>;
/**
* Reference: https://packagist.org/apidoc#list-packages-by-type
* @param type
*/
getPackagesByType(type: string): Promise<PackagesByType>;
/**
* Reference: https://packagist.org/apidoc#list-popular-packages
* @param perPage
*/
getPopularPackages(perPage?: number): Promise<PopularPackage>;
/**
* Reference: https://packagist.org/apidoc#list-packages-by-organization
* @param vendor
*/
getPackagesByOrganization(vendor: string): Promise<PackagesByOrganization>;
/**
* Reference: https://packagist.org/apidoc#get-package-stats
* @param packageName
*/
getPackageDownloadStats(packageName: string): Promise<PackageDownloadStats>;
/**
* Reference: https://packagist.org/apidoc#search-packages
* @param query
* @param tag
* @param type
* @param perPage
*/
searchPackages(query?: string, tag?: string, type?: string, perPage?: number): Promise<PackageSearchResult>;
}
export default PackagistApi;