Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crates.io

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crates.io - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

CHANGELOG.md

53

dist/api/CratesAPI.d.ts

@@ -6,67 +6,14 @@ import { AuthorsResult, CrateResult, DependenciesResult, DownloadsResult, FollowingResult, ReverseDependenciesResult, SearchOptions, SearchResult, TeamsResult, UrlResult, UsersResult, Version } from '../interfaces/';

constructor(requestService: RequestService);
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
following(packageName: string): Promise<FollowingResult>;
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
getAuthors(packageName: string, version: string): Promise<AuthorsResult>;
/**
* Retrieve information of a crate.
* @param packageName The package name
*/
getCrate(packageName: string): Promise<CrateResult>;
/**
* Retrieve a page of crates, optionally constrained by a query.
* @param query The search query
* @param options The search options
*/
getCrates(query: string, options?: SearchOptions): Promise<SearchResult>;
/**
* Retrieve a download link for a certain version of a crate.
* @param packageName The package name
*/
getDownloadUrl(packageName: string, version: string): Promise<UrlResult>;
/**
* Retrieve the dependencies of a crate version.
* @param packageName The package name
*/
getDependencies(packageName: string): Promise<DependenciesResult>;
/**
* Retrieve download stats for a crate.
* @param packageName The package name
*/
getDownloads(packageName: string): Promise<DownloadsResult>;
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
getOwners(packageName: string): Promise<UsersResult>;
/**
* Retrieve the reverse dependencies of a crate version.
* @param packageName The package name
*/
getReverseDependencies(packageName: string): Promise<ReverseDependenciesResult>;
/**
* Retrieve the team owner of a crate.
* @param packageName The package name
*/
getTeamOwner(packageName: string): Promise<TeamsResult>;
/**
* Retrieve the user owner of a crate.
* @param packageName The package name
*/
getUserOwner(packageName: string): Promise<UsersResult>;
/**
* Retrieve a specific version of a crate.
* @param packageName The package name
*/
getVersion(packageName: string, version: string): Promise<Version>;
/**
* Retrieve all versions of a crate.
* @param packageName The package name
*/
getVersions(packageName: string): Promise<{

@@ -73,0 +20,0 @@ versions: Version[];

55

dist/api/CratesAPI.js

@@ -15,10 +15,6 @@ "use strict";

var Endpoints_1 = require("../Endpoints");
var CratesAPI = /** @class */ (function () {
var CratesAPI = (function () {
function CratesAPI(requestService) {
this.requestService = requestService;
}
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.following = function (packageName) {

@@ -28,6 +24,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.following(packageName);

};
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getAuthors = function (packageName, version) {

@@ -37,6 +29,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.authors(packageName, version);

};
/**
* Retrieve information of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getCrate = function (packageName) {

@@ -46,7 +34,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.crate(packageName);

};
/**
* Retrieve a page of crates, optionally constrained by a query.
* @param query The search query
* @param options The search options
*/
CratesAPI.prototype.getCrates = function (query, options) {

@@ -56,6 +39,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.crates();

};
/**
* Retrieve a download link for a certain version of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getDownloadUrl = function (packageName, version) {

@@ -65,6 +44,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.download(packageName, version);

};
/**
* Retrieve the dependencies of a crate version.
* @param packageName The package name
*/
CratesAPI.prototype.getDependencies = function (packageName) {

@@ -74,6 +49,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.dependencies(packageName);

};
/**
* Retrieve download stats for a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getDownloads = function (packageName) {

@@ -83,6 +54,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.downloads(packageName);

};
/**
* Retrieve the owners of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getOwners = function (packageName) {

@@ -92,6 +59,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.owners(packageName);

};
/**
* Retrieve the reverse dependencies of a crate version.
* @param packageName The package name
*/
CratesAPI.prototype.getReverseDependencies = function (packageName) {

@@ -101,6 +64,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.dependants(packageName);

};
/**
* Retrieve the team owner of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getTeamOwner = function (packageName) {

@@ -110,6 +69,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.ownerTeam(packageName);

};
/**
* Retrieve the user owner of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getUserOwner = function (packageName) {

@@ -119,6 +74,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.ownerUser(packageName);

};
/**
* Retrieve a specific version of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getVersion = function (packageName, version) {

@@ -128,6 +79,2 @@ var endpoint = Endpoints_1.Endpoint.Crates.version(packageName, version);

};
/**
* Retrieve all versions of a crate.
* @param packageName The package name
*/
CratesAPI.prototype.getVersions = function (packageName) {

@@ -134,0 +81,0 @@ var endpoint = Endpoints_1.Endpoint.Crates.versions(packageName);

@@ -7,11 +7,4 @@ import { API, ClientOptions, Summary } from './interfaces/';

constructor(options?: ClientOptions);
/**
* Retrieve a summary containing crates.io wide information.
*/
summary(): Promise<Summary>;
/**
* Set a new API URL.
* @param newUrl The new API url
*/
setApiUrl(newUrl: string): void;
}

@@ -6,3 +6,3 @@ "use strict";

var RequestService_1 = require("./RequestService");
var CratesIO = /** @class */ (function () {
var CratesIO = (function () {
function CratesIO(options) {

@@ -17,5 +17,2 @@ if (typeof options === 'string') {

}
/**
* Retrieve a summary containing crates.io wide information.
*/
CratesIO.prototype.summary = function () {

@@ -25,6 +22,2 @@ var endpoint = Endpoints_1.Endpoint.summary();

};
/**
* Set a new API URL.
* @param newUrl The new API url
*/
CratesIO.prototype.setApiUrl = function (newUrl) {

@@ -31,0 +24,0 @@ this.requestService.setApiUrl(newUrl);

@@ -17,3 +17,3 @@ "use strict";

var interfaces_1 = require("./interfaces/");
var APIException = /** @class */ (function (_super) {
var APIException = (function (_super) {
__extends(APIException, _super);

@@ -31,3 +31,3 @@ function APIException(message, serverMessage) {

exports.APIException = APIException;
var AuthenticationError = /** @class */ (function (_super) {
var AuthenticationError = (function (_super) {
__extends(AuthenticationError, _super);

@@ -45,3 +45,3 @@ function AuthenticationError(message, serverMessage) {

exports.AuthenticationError = AuthenticationError;
var RateLimitError = /** @class */ (function (_super) {
var RateLimitError = (function (_super) {
__extends(RateLimitError, _super);

@@ -59,3 +59,3 @@ function RateLimitError(message, serverMessage) {

exports.RateLimitError = RateLimitError;
var NotFoundError = /** @class */ (function (_super) {
var NotFoundError = (function (_super) {
__extends(NotFoundError, _super);

@@ -73,3 +73,3 @@ function NotFoundError(message, serverMessage) {

exports.NotFoundError = NotFoundError;
var InvalidResponseError = /** @class */ (function (_super) {
var InvalidResponseError = (function (_super) {
__extends(InvalidResponseError, _super);

@@ -76,0 +76,0 @@ function InvalidResponseError(message) {

@@ -41,3 +41,3 @@ "use strict";

var interfaces_1 = require("./interfaces/");
var RequestService = /** @class */ (function () {
var RequestService = (function () {
function RequestService(options) {

@@ -79,3 +79,3 @@ this.apiUrl = 'https://crates.io/api/v1';

_b.trys.push([1, 3, , 4]);
return [4 /*yield*/, axios_1.default.request(config)];
return [4, axios_1.default.request(config)];
case 2:

@@ -86,3 +86,3 @@ _a = _b.sent(), data = _a.data, headers = _a.headers, status = _a.status;

if (contentType.includes('application/json')) {
return [2 /*return*/, data];
return [2, data];
}

@@ -94,3 +94,3 @@ else {

else if (status === interfaces_1.HttpStatus.NO_CONTENT) {
return [2 /*return*/, data];
return [2, data];
}

@@ -100,7 +100,7 @@ else {

}
return [3 /*break*/, 4];
return [3, 4];
case 3:
error_1 = _b.sent();
throw APIException_1.ExceptionMapper(error_1);
case 4: return [2 /*return*/];
case 4: return [2];
}

@@ -107,0 +107,0 @@ });

@@ -30,6 +30,6 @@ {

"name": "crates.io",
"repository": "https://github.com/ffflorian/crates.io.js.git",
"repository": "https://github.com/ffflorian/api-clients/tree/master/packages/crates.io",
"scripts": {
"build": "tsc",
"build:docs": "typedoc --out docs/ --mode modules --excludePrivate --excludeExternals --exclude \"**/*(index|Endpoints|RequestService).ts\"",
"build:docs": "typedoc",
"clear": "rimraf dist",

@@ -45,3 +45,3 @@ "clear:docs": "rimraf docs",

},
"version": "0.1.1"
"version": "0.2.0"
}

@@ -1,2 +0,2 @@

# crates.io.js [![npm version](https://img.shields.io/npm/v/crates.io.svg?style=flat)](https://www.npmjs.com/package/crates.io) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ffflorian/crates.io.js)](https://dependabot.com)
# crates.io.js [![npm version](https://img.shields.io/npm/v/crates.io.svg?style=flat)](https://www.npmjs.com/package/crates.io)

@@ -3,0 +3,0 @@ A [crates.io](https://crates.io) API client.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc