libraries.io 3.4.5 → 3.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.
@@ -4,26 +4,6 @@ export declare const Endpoint: {
4
4
  DEPENDENT_REPOSITORIES: string;
5
5
  DEPENDENTS: string;
6
6
  GITHUB: string;
7
- PLATFORMS: string;
8
- PROJECT_CONTRIBUTIONS: string;
9
- PROJECTS: string;
10
- REPOSITORIES: string;
11
- REPOSITORY_CONTRIBUTIONS: string;
12
- SEARCH: string;
13
- SOURCERANK: string;
14
- SUBSCRIPTIONS: string;
15
- USAGE: string;
16
- Project: {
17
- contributors(platform: string, name: string): string;
18
- dependencies(platform: string, name: string, version: string): string;
19
- dependentRepositories(platform: string, name: string): string;
20
- dependents(platform: string, name: string): string;
21
- search(): string;
22
- sourceRank(platform: string, name: string): string;
23
- subscriptions(platform: string, name: string): string;
24
- usage(platform: string, name: string): string;
25
- project(platform: string, name: string): string;
26
- };
27
7
  GitHub: {
28
8
  Repository: {
29
9
  dependencies(owner: string, name: string): string;
@@ -31,15 +11,35 @@ export declare const Endpoint: {
31
11
  repository(owner: string, name: string): string;
32
12
  };
33
13
  User: {
14
+ contributedProjects(login: string): string;
15
+ contributedRepositories(login: string): string;
34
16
  dependencies(login: string): string;
35
17
  packages(login: string): string;
36
18
  projects(login: string): string;
37
- contributedProjects(login: string): string;
38
19
  repositories(login: string): string;
39
- contributedRepositories(login: string): string;
40
20
  user(login: string): string;
41
21
  };
42
22
  };
23
+ PLATFORMS: string;
43
24
  platforms(): string;
25
+ Project: {
26
+ contributors(platform: string, name: string): string;
27
+ dependencies(platform: string, name: string, version: string): string;
28
+ dependentRepositories(platform: string, name: string): string;
29
+ dependents(platform: string, name: string): string;
30
+ project(platform: string, name: string): string;
31
+ search(): string;
32
+ sourceRank(platform: string, name: string): string;
33
+ subscriptions(platform: string, name: string): string;
34
+ usage(platform: string, name: string): string;
35
+ };
36
+ PROJECT_CONTRIBUTIONS: string;
37
+ PROJECTS: string;
38
+ REPOSITORIES: string;
39
+ REPOSITORY_CONTRIBUTIONS: string;
40
+ SEARCH: string;
41
+ SOURCERANK: string;
42
+ SUBSCRIPTIONS: string;
44
43
  subscriptions(platform?: string, name?: string): string;
44
+ USAGE: string;
45
45
  };
package/dist/Endpoints.js CHANGED
@@ -8,44 +8,6 @@ exports.Endpoint = {
8
8
  DEPENDENT_REPOSITORIES: 'dependent_repositories',
9
9
  DEPENDENTS: 'dependents',
10
10
  GITHUB: 'github',
11
- PLATFORMS: 'platforms',
12
- PROJECT_CONTRIBUTIONS: 'project-contributions',
13
- PROJECTS: 'projects',
14
- REPOSITORIES: 'repositories',
15
- REPOSITORY_CONTRIBUTIONS: 'repository-contributions',
16
- SEARCH: 'search',
17
- SOURCERANK: 'sourcerank',
18
- SUBSCRIPTIONS: 'subscriptions',
19
- USAGE: 'usage',
20
- Project: {
21
- contributors(platform, name) {
22
- return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.CONTRIBUTORS}/`;
23
- },
24
- dependencies(platform, name, version) {
25
- return `/${encode(platform)}/${encode(name)}/${encode(version)}/${exports.Endpoint.DEPENDENCIES}/`;
26
- },
27
- dependentRepositories(platform, name) {
28
- return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.DEPENDENT_REPOSITORIES}/`;
29
- },
30
- dependents(platform, name) {
31
- return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.DEPENDENTS}/`;
32
- },
33
- search() {
34
- return `/${exports.Endpoint.SEARCH}/`;
35
- },
36
- sourceRank(platform, name) {
37
- return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.SOURCERANK}/`;
38
- },
39
- subscriptions(platform, name) {
40
- return `/${exports.Endpoint.SUBSCRIPTIONS}/${encode(platform)}/${encode(name)}/`;
41
- },
42
- usage(platform, name) {
43
- return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.USAGE}/`;
44
- },
45
- project(platform, name) {
46
- return `/${encode(platform)}/${encode(name)}/`;
47
- },
48
- },
49
11
  GitHub: {
50
12
  Repository: {
51
13
  dependencies(owner, name) {
@@ -59,6 +21,12 @@ exports.Endpoint = {
59
21
  },
60
22
  },
61
23
  User: {
24
+ contributedProjects(login) {
25
+ return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.PROJECT_CONTRIBUTIONS}/`;
26
+ },
27
+ contributedRepositories(login) {
28
+ return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.REPOSITORY_CONTRIBUTIONS}/`;
29
+ },
62
30
  dependencies(login) {
63
31
  return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.DEPENDENCIES}/`;
64
32
  },
@@ -68,28 +36,60 @@ exports.Endpoint = {
68
36
  projects(login) {
69
37
  return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.PROJECTS}/`;
70
38
  },
71
- contributedProjects(login) {
72
- return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.PROJECT_CONTRIBUTIONS}/`;
73
- },
74
39
  repositories(login) {
75
40
  return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.REPOSITORIES}/`;
76
41
  },
77
- contributedRepositories(login) {
78
- return `/${exports.Endpoint.GITHUB}/${encode(login)}/${exports.Endpoint.REPOSITORY_CONTRIBUTIONS}/`;
79
- },
80
42
  user(login) {
81
43
  return `/${exports.Endpoint.GITHUB}/${encode(login)}/`;
82
44
  },
83
- }
45
+ },
84
46
  },
47
+ PLATFORMS: 'platforms',
85
48
  platforms() {
86
49
  return `/${exports.Endpoint.PLATFORMS}/`;
87
50
  },
51
+ Project: {
52
+ contributors(platform, name) {
53
+ return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.CONTRIBUTORS}/`;
54
+ },
55
+ dependencies(platform, name, version) {
56
+ return `/${encode(platform)}/${encode(name)}/${encode(version)}/${exports.Endpoint.DEPENDENCIES}/`;
57
+ },
58
+ dependentRepositories(platform, name) {
59
+ return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.DEPENDENT_REPOSITORIES}/`;
60
+ },
61
+ dependents(platform, name) {
62
+ return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.DEPENDENTS}/`;
63
+ },
64
+ project(platform, name) {
65
+ return `/${encode(platform)}/${encode(name)}/`;
66
+ },
67
+ search() {
68
+ return `/${exports.Endpoint.SEARCH}/`;
69
+ },
70
+ sourceRank(platform, name) {
71
+ return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.SOURCERANK}/`;
72
+ },
73
+ subscriptions(platform, name) {
74
+ return `/${exports.Endpoint.SUBSCRIPTIONS}/${encode(platform)}/${encode(name)}/`;
75
+ },
76
+ usage(platform, name) {
77
+ return `/${encode(platform)}/${encode(name)}/${exports.Endpoint.USAGE}/`;
78
+ },
79
+ },
80
+ PROJECT_CONTRIBUTIONS: 'project-contributions',
81
+ PROJECTS: 'projects',
82
+ REPOSITORIES: 'repositories',
83
+ REPOSITORY_CONTRIBUTIONS: 'repository-contributions',
84
+ SEARCH: 'search',
85
+ SOURCERANK: 'sourcerank',
86
+ SUBSCRIPTIONS: 'subscriptions',
88
87
  subscriptions(platform, name) {
89
88
  let endpoint = `/${exports.Endpoint.SUBSCRIPTIONS}/`;
90
89
  if (platform && name) {
91
90
  endpoint += `${encode(platform)}/${encode(name)}/`;
92
91
  }
93
92
  return endpoint;
94
- }
93
+ },
94
+ USAGE: 'usage',
95
95
  };
@@ -118,6 +118,7 @@ class ProjectAPI extends APIBase_1.APIBase {
118
118
  search(query, options) {
119
119
  return __awaiter(this, void 0, void 0, function* () {
120
120
  const endpoint = Endpoints_1.Endpoint.Project.search();
121
+ // eslint-disable-next-line id-length
121
122
  const { data } = yield this.apiClient.get(endpoint, { data: Object.assign(Object.assign({}, options), { q: query }) });
122
123
  return data;
123
124
  });
@@ -15,7 +15,7 @@ export declare class UserAPI extends APIBase {
15
15
  * @param platform The project platform (e.g. "npm", "cargo", ...)
16
16
  * @param projectName The project name
17
17
  */
18
- getSubscription(platform: PlatformType, projectName: string): Promise<LibrariesIOResult<Subscription | null>>;
18
+ getSubscription(platform: PlatformType, projectName: string): Promise<LibrariesIOResult<null | Subscription>>;
19
19
  /**
20
20
  * Subscribe to receive notifications about new releases of a project.
21
21
  * @see https://libraries.io/api#subscriptions-create
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './LibrariesIO';
1
+ export * from './api/';
2
2
  export * from './interfaces/';
3
+ export * from './LibrariesIO';
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("./LibrariesIO"), exports);
17
+ __exportStar(require("./api/"), exports);
18
18
  __exportStar(require("./interfaces/"), exports);
19
+ __exportStar(require("./LibrariesIO"), exports);
@@ -1,16 +1,16 @@
1
1
  export interface Contributor {
2
- bio: string | null;
3
- blog: string | null;
4
- company: string | null;
2
+ bio: null | string;
3
+ blog: null | string;
4
+ company: null | string;
5
5
  created_at: string;
6
- email: string | null;
7
- followers: number | null;
8
- following: number | null;
6
+ email: null | string;
7
+ followers: null | number;
8
+ following: null | number;
9
9
  github_id: string;
10
10
  hidden: boolean;
11
11
  host_type: string;
12
12
  last_synced_at: string;
13
- location: string | null;
13
+ location: null | string;
14
14
  login: string;
15
15
  name: string;
16
16
  updated_at: string;
@@ -1,31 +1,31 @@
1
- export type SortType = 'contributions_count' | 'created_at' | 'dependent_repos_count' | 'dependents_count' | 'latest_release_published_at' | 'rank' | 'stars';
1
+ export interface ClientOptions {
2
+ apiKey: string;
3
+ apiUrl?: string;
4
+ }
2
5
  export interface FilterOptions {
3
6
  keywords?: string[];
4
7
  languages?: string[];
5
8
  licenses?: string[];
6
9
  platforms?: PlatformType[];
7
10
  }
8
- export interface ClientOptions {
9
- apiKey: string;
10
- apiUrl?: string;
11
- }
12
- export interface PreReleaseOptions {
13
- includePreRelease?: boolean;
14
- }
11
+ export type HttpMethod = 'delete' | 'get' | 'post' | 'put';
15
12
  export interface PaginationOptions {
16
13
  page?: number;
17
14
  per_page?: number;
18
15
  }
19
- export interface SearchOptions extends PaginationOptions {
20
- filter?: FilterOptions;
21
- /** sort by */
22
- sort?: SortType;
16
+ export type PlatformType = 'alcatraz' | 'atom' | 'bower' | 'cargo' | 'carthage' | 'clojars' | 'cocoapods' | 'cpan' | 'cran' | 'dub' | 'elm' | 'emacs' | 'go' | 'hackage' | 'haxelib' | 'hex' | 'homebrew' | 'inqlude' | 'julia' | 'maven' | 'meteor' | 'nimble' | 'npm' | 'nuget' | 'packagist' | 'platformio' | 'pub' | 'puppet' | 'purescript' | 'pypi' | 'racket' | 'rubygems' | 'sublime' | 'swiftpm' | 'wordpress';
17
+ export interface PreReleaseOptions {
18
+ includePreRelease?: boolean;
23
19
  }
24
- export interface RequestOptions extends SearchOptions, PreReleaseOptions {
20
+ export interface RequestOptions extends PreReleaseOptions, SearchOptions {
25
21
  api_key?: string;
26
22
  platform?: PlatformType;
27
23
  /** query */
28
24
  q?: string;
29
25
  }
30
- export type HttpMethod = 'delete' | 'get' | 'post' | 'put';
31
- export type PlatformType = 'alcatraz' | 'atom' | 'bower' | 'cargo' | 'carthage' | 'clojars' | 'cocoapods' | 'cpan' | 'cran' | 'dub' | 'elm' | 'emacs' | 'go' | 'hackage' | 'haxelib' | 'hex' | 'homebrew' | 'inqlude' | 'julia' | 'maven' | 'meteor' | 'nimble' | 'npm' | 'nuget' | 'packagist' | 'platformio' | 'pub' | 'puppet' | 'purescript' | 'pypi' | 'racket' | 'rubygems' | 'sublime' | 'swiftpm' | 'wordpress';
26
+ export interface SearchOptions extends PaginationOptions {
27
+ filter?: FilterOptions;
28
+ /** sort by */
29
+ sort?: SortType;
30
+ }
31
+ export type SortType = 'contributions_count' | 'created_at' | 'dependent_repos_count' | 'dependents_count' | 'latest_release_published_at' | 'rank' | 'stars';
@@ -1,7 +1,7 @@
1
1
  export interface Platform {
2
2
  color: string;
3
3
  default_language: string;
4
- homepage: string | null;
4
+ homepage: null | string;
5
5
  name: string;
6
6
  project_count: number;
7
7
  }
@@ -2,9 +2,9 @@ import type { PlatformType } from './Options';
2
2
  export interface Project {
3
3
  dependent_repos_count: number;
4
4
  dependents_count: number;
5
- description: string | null;
5
+ description: null | string;
6
6
  forks: number;
7
- homepage: string | null;
7
+ homepage: null | string;
8
8
  keywords: string[];
9
9
  language: string;
10
10
  latest_download_url: string;
@@ -16,21 +16,15 @@ export interface Project {
16
16
  package_manager_url: string;
17
17
  platform: string;
18
18
  rank: number;
19
- repository_url: string | null;
19
+ repository_url: null | string;
20
20
  stars: number;
21
- status: string | null;
21
+ status: null | string;
22
22
  versions: ProjectVersion[];
23
23
  }
24
- export interface ProjectWithDependencies extends Project {
25
- dependencies: ProjectDependency[];
26
- dependencies_for_version: string;
27
- dependent_repos_count: number;
28
- dependents_count: number;
29
- }
30
24
  export interface ProjectDependency {
31
25
  deprecated: boolean;
32
- filepath: string | null;
33
- kind: 'Development' | 'runtime' | 'Optional';
26
+ filepath: null | string;
27
+ kind: 'Development' | 'Optional' | 'runtime';
34
28
  latest: string;
35
29
  latest_stable: string;
36
30
  name: string;
@@ -45,7 +39,7 @@ export interface ProjectRelease {
45
39
  number: string;
46
40
  project_id: number;
47
41
  published_at: string;
48
- runtime_dependencies_count: number | null;
42
+ runtime_dependencies_count: null | number;
49
43
  updated_at: string;
50
44
  }
51
45
  export interface ProjectUsage {
@@ -55,3 +49,9 @@ export interface ProjectVersion {
55
49
  number: string;
56
50
  published_at: string;
57
51
  }
52
+ export interface ProjectWithDependencies extends Project {
53
+ dependencies: ProjectDependency[];
54
+ dependencies_for_version: string;
55
+ dependent_repos_count: number;
56
+ dependents_count: number;
57
+ }
@@ -1,45 +1,45 @@
1
1
  import type { ProjectDependency } from '../interfaces/Project';
2
2
  export interface Repository {
3
- contributions_count: number | null;
3
+ contributions_count: null | number;
4
4
  created_at: string;
5
5
  default_branch: string;
6
6
  description: string;
7
7
  fork: false;
8
- fork_policy: string | null;
8
+ fork_policy: null | string;
9
9
  forks_count: number;
10
10
  full_name: string;
11
11
  github_contributions_count: number;
12
12
  github_id: string;
13
- has_audit: string | null;
14
- has_changelog: string | null;
15
- has_coc: string | null;
16
- has_contributing: string | null;
13
+ has_audit: null | string;
14
+ has_changelog: null | string;
15
+ has_coc: null | string;
16
+ has_contributing: null | string;
17
17
  has_issues: boolean;
18
- has_license: string | null;
18
+ has_license: null | string;
19
19
  has_pages: boolean;
20
- has_readme: string | null;
21
- has_threat_model: string | null;
20
+ has_readme: null | string;
21
+ has_threat_model: null | string;
22
22
  has_wiki: boolean;
23
23
  homepage: string;
24
- host_domain: string | null;
24
+ host_domain: null | string;
25
25
  host_type: string;
26
26
  keywords: string[];
27
27
  language: string;
28
28
  last_synced_at: string;
29
29
  license: string;
30
- logo_url: string | null;
31
- mirror_url: string | null;
32
- name: string | null;
30
+ logo_url: null | string;
31
+ mirror_url: null | string;
32
+ name: null | string;
33
33
  open_issues_count: number;
34
34
  private: boolean;
35
- pull_requests_enabled: string | null;
35
+ pull_requests_enabled: null | string;
36
36
  pushed_at: string;
37
37
  rank: number;
38
38
  scm: string;
39
39
  size: number;
40
- source_name: string | null;
40
+ source_name: null | string;
41
41
  stargazers_count: number;
42
- status: string | null;
42
+ status: null | string;
43
43
  subscribers_count: number;
44
44
  updated_at: string;
45
45
  uuid: string;
package/package.json CHANGED
@@ -1,15 +1,15 @@
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 libraries.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",
12
- "vitest": "4.0.16"
9
+ "rimraf": "6.1.3",
10
+ "typedoc": "0.28.18",
11
+ "typescript": "6.0.2",
12
+ "vitest": "4.1.2"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">= 21"
@@ -30,12 +30,12 @@
30
30
  "readme": "https://github.com/ffflorian/api-clients#readme",
31
31
  "repository": "https://github.com/ffflorian/api-clients.git",
32
32
  "scripts": {
33
+ "build": "yarn build:ts",
33
34
  "build:ts": "tsc -p tsconfig.build.json",
34
35
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/libraries.io src/index.ts",
35
36
  "clean": "rimraf dist",
36
- "dist": "yarn clean && yarn build:ts",
37
+ "dist": "yarn clean && yarn build",
37
38
  "test": "vitest"
38
39
  },
39
- "version": "3.4.5",
40
- "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
40
+ "version": "3.4.7"
41
41
  }