crates.io 2.4.5 → 2.4.7

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.
@@ -1,16 +1,6 @@
1
1
  export declare const Endpoint: {
2
2
  AUTHORS: string;
3
3
  CRATES: string;
4
- DEPENDENCIES: string;
5
- DOWNLOAD: string;
6
- DOWNLOADS: string;
7
- FOLLOWING: string;
8
- OWNERS: string;
9
- OWNER_TEAM: string;
10
- OWNER_USER: string;
11
- REVERSE_DEPENDENCIES: string;
12
- SUMMARY: string;
13
- VERSIONS: string;
14
4
  Crates: {
15
5
  authors(packageName: string, version: string): string;
16
6
  crate(packageName: string): string;
@@ -26,5 +16,15 @@ export declare const Endpoint: {
26
16
  version(packageName: string, version: string): string;
27
17
  versions(packageName: string): string;
28
18
  };
19
+ DEPENDENCIES: string;
20
+ DOWNLOAD: string;
21
+ DOWNLOADS: string;
22
+ FOLLOWING: string;
23
+ OWNER_TEAM: string;
24
+ OWNER_USER: string;
25
+ OWNERS: string;
26
+ REVERSE_DEPENDENCIES: string;
27
+ SUMMARY: string;
29
28
  summary(): string;
29
+ VERSIONS: string;
30
30
  };
package/dist/Endpoints.js CHANGED
@@ -5,16 +5,6 @@ const encode = encodeURIComponent;
5
5
  exports.Endpoint = {
6
6
  AUTHORS: 'authors',
7
7
  CRATES: 'crates',
8
- DEPENDENCIES: 'dependencies',
9
- DOWNLOAD: 'download',
10
- DOWNLOADS: 'downloads',
11
- FOLLOWING: 'following',
12
- OWNERS: 'owners',
13
- OWNER_TEAM: 'owner_team',
14
- OWNER_USER: 'owner_user',
15
- REVERSE_DEPENDENCIES: 'reverse_dependencies',
16
- SUMMARY: 'summary',
17
- VERSIONS: 'versions',
18
8
  Crates: {
19
9
  authors(packageName, version) {
20
10
  return `/${exports.Endpoint.CRATES}/${encode(packageName)}/${encode(version)}/${exports.Endpoint.AUTHORS}`;
@@ -56,7 +46,17 @@ exports.Endpoint = {
56
46
  return `/${exports.Endpoint.CRATES}/${encode(packageName)}/${exports.Endpoint.VERSIONS}`;
57
47
  },
58
48
  },
49
+ DEPENDENCIES: 'dependencies',
50
+ DOWNLOAD: 'download',
51
+ DOWNLOADS: 'downloads',
52
+ FOLLOWING: 'following',
53
+ OWNER_TEAM: 'owner_team',
54
+ OWNER_USER: 'owner_user',
55
+ OWNERS: 'owners',
56
+ REVERSE_DEPENDENCIES: 'reverse_dependencies',
57
+ SUMMARY: 'summary',
59
58
  summary() {
60
59
  return `/${exports.Endpoint.SUMMARY}`;
61
60
  },
61
+ VERSIONS: 'versions',
62
62
  };
@@ -66,7 +66,9 @@ class CratesAPI {
66
66
  return __awaiter(this, void 0, void 0, function* () {
67
67
  const endpoint = Endpoints_1.Endpoint.Crates.crates();
68
68
  const additionalConfig = {
69
- params: Object.assign(Object.assign({}, options), { q: query }),
69
+ params: Object.assign(Object.assign({}, options), {
70
+ // eslint-disable-next-line id-length
71
+ q: query }),
70
72
  };
71
73
  const { data } = yield this.apiClient.get(endpoint, additionalConfig);
72
74
  return data;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './api/';
1
2
  export * from './CratesIO';
2
3
  export * from './interfaces/';
package/dist/index.js CHANGED
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/"), exports);
17
18
  __exportStar(require("./CratesIO"), exports);
18
19
  __exportStar(require("./interfaces/"), exports);
@@ -4,15 +4,15 @@ export interface Crate {
4
4
  [key: string]: string;
5
5
  };
6
6
  } | null;
7
- categories: string | null;
7
+ categories: null | string;
8
8
  created_at: string;
9
9
  description: string;
10
- documentation: string | null;
10
+ documentation: null | string;
11
11
  downloads: number;
12
12
  exact_match: boolean;
13
- homepage: string | null;
13
+ homepage: null | string;
14
14
  id: string;
15
- keywords: string | null;
15
+ keywords: null | string;
16
16
  links: {
17
17
  owner_team: string;
18
18
  owner_user: string;
@@ -23,8 +23,8 @@ export interface Crate {
23
23
  };
24
24
  max_version: string;
25
25
  name: string;
26
- recent_downloads: number | null;
27
- repository: string | null;
26
+ recent_downloads: null | number;
27
+ repository: null | string;
28
28
  updated_at: string;
29
- versions: number[] | null;
29
+ versions: null | number[];
30
30
  }
@@ -4,9 +4,9 @@ export interface Dependency {
4
4
  downloads: number;
5
5
  features: string[];
6
6
  id: number;
7
- kind: 'build' | 'normal' | 'dev';
7
+ kind: 'build' | 'dev' | 'normal';
8
8
  optional: boolean;
9
9
  req: string;
10
- target: string | null;
10
+ target: null | string;
11
11
  version_id: number;
12
12
  }
@@ -30,18 +30,18 @@ export interface SearchResult {
30
30
  total: number;
31
31
  };
32
32
  }
33
+ export interface TeamsResult {
34
+ teams: Team[];
35
+ }
33
36
  export interface UrlResult {
34
37
  url: string;
35
38
  }
36
39
  export interface UsersResult {
37
40
  users: User[];
38
41
  }
39
- export interface TeamsResult {
40
- teams: Team[];
42
+ export interface VersionResult {
43
+ version: Version;
41
44
  }
42
45
  export interface VersionsResult {
43
46
  versions: Version[];
44
47
  }
45
- export interface VersionResult {
46
- version: Version;
47
- }
@@ -1,8 +1,8 @@
1
1
  export interface User {
2
- avatar: string | null;
2
+ avatar: null | string;
3
3
  id: number;
4
4
  kind: string;
5
5
  login: string;
6
- name: string | null;
7
- url: string | null;
6
+ name: null | string;
7
+ url: null | string;
8
8
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "@ffflorian/api-client": "2.2.0"
4
+ "@ffflorian/api-client": "2.5.1"
5
5
  },
6
6
  "description": "A crates.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
- "rimraf": "6.1.2",
10
- "typedoc": "0.28.15",
11
- "typescript": "5.9.3"
9
+ "rimraf": "6.1.3",
10
+ "typedoc": "0.28.18",
11
+ "typescript": "6.0.2"
12
12
  },
13
13
  "engines": {
14
14
  "node": ">= 21"
@@ -29,12 +29,12 @@
29
29
  "readme": "https://github.com/ffflorian/api-clients#readme",
30
30
  "repository": "https://github.com/ffflorian/api-clients.git",
31
31
  "scripts": {
32
+ "build": "yarn build:ts",
32
33
  "build:ts": "tsc -p tsconfig.build.json",
33
34
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/crates.io src/index.ts",
34
35
  "clean": "rimraf dist",
35
- "dist": "yarn clean && yarn build:ts",
36
+ "dist": "yarn clean && yarn build",
36
37
  "test": "exit 0"
37
38
  },
38
- "version": "2.4.5",
39
- "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
39
+ "version": "2.4.7"
40
40
  }