crates.io 2.3.7 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,9 +12,9 @@ export declare class CratesIO {
12
12
  setApiKey(apiKey: string): void;
13
13
  /**
14
14
  * Set a new API URL.
15
- * @param newUrl The new API url
15
+ * @param newURL The new API url
16
16
  */
17
- setApiUrl(newUrl: string): void;
17
+ setApiUrl(newURL: string): void;
18
18
  /**
19
19
  * Retrieve a summary containing crates.io wide information.
20
20
  */
package/dist/CratesIO.js CHANGED
@@ -10,13 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CratesIO = void 0;
13
- const axios_1 = require("axios");
13
+ const api_client_1 = require("@ffflorian/api-client");
14
14
  const api_1 = require("./api");
15
15
  const Endpoints_1 = require("./Endpoints");
16
16
  class CratesIO {
17
17
  constructor(options) {
18
18
  this.options = typeof options === 'string' ? { apiKey: options } : options || {};
19
- this.apiClient = axios_1.default.create({ baseURL: 'https://crates.io/api/v1' });
19
+ this.apiClient = new api_client_1.APIClient('https://crates.io/api/v1');
20
20
  this.api = {
21
21
  crates: new api_1.CratesAPI(this.apiClient),
22
22
  };
@@ -31,10 +31,10 @@ class CratesIO {
31
31
  }
32
32
  /**
33
33
  * Set a new API URL.
34
- * @param newUrl The new API url
34
+ * @param newURL The new API url
35
35
  */
36
- setApiUrl(newUrl) {
37
- this.apiClient.defaults.baseURL = newUrl;
36
+ setApiUrl(newURL) {
37
+ this.apiClient.setBaseURL(newURL);
38
38
  }
39
39
  /**
40
40
  * Retrieve a summary containing crates.io wide information.
@@ -1,9 +1,9 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { AuthorsResult, CrateResult, DependenciesResult, DownloadsResult, FollowingResult, ReverseDependenciesResult, SearchOptions, SearchResult, TeamsResult, UrlResult, UsersResult, Version } from '../interfaces/';
3
3
  export declare class CratesAPI {
4
4
  private readonly apiClient;
5
5
  private apiKey?;
6
- constructor(apiClient: AxiosInstance, apiKey?: string);
6
+ constructor(apiClient: APIClient, apiKey?: string);
7
7
  /**
8
8
  * Retrieve the owners of a crate.
9
9
  * @param packageName The package name
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "axios": "1.12.2"
4
+ "@ffflorian/api-client": "2.1.2"
5
5
  },
6
6
  "description": "A crates.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
- "rimraf": "6.0.1",
10
- "typedoc": "0.28.13",
9
+ "rimraf": "6.1.0",
10
+ "typedoc": "0.28.14",
11
11
  "typescript": "5.9.3"
12
12
  },
13
13
  "engines": {
14
- "node": ">= 10.9"
14
+ "node": ">= 21"
15
15
  },
16
16
  "files": [
17
17
  "dist"
@@ -27,12 +27,12 @@
27
27
  "name": "crates.io",
28
28
  "repository": "https://github.com/ffflorian/api-clients/tree/main/packages/crates.io",
29
29
  "scripts": {
30
- "build:ts": "tsc",
31
- "build:docs": "typedoc --options ../../typedoc.json --out ../../docs/packages/crates.io src/index.ts",
30
+ "build:ts": "tsc -p tsconfig.build.json",
31
+ "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/crates.io src/index.ts",
32
32
  "clean": "rimraf dist",
33
33
  "dist": "yarn clean && yarn build:ts",
34
34
  "test": "exit 0"
35
35
  },
36
- "version": "2.3.7",
37
- "gitHead": "ad816b675937c5075c585f666f180ccd0918021a"
36
+ "version": "2.4.0",
37
+ "gitHead": "b6392f3b78cc68d334526b7ebd5f1375511c769f"
38
38
  }