npms.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,14 +1,14 @@
1
1
  export declare const Endpoint: {
2
+ MGET: string;
2
3
  PACKAGE: string;
4
+ Package: {
5
+ multiPackageInfo(): string;
6
+ packageInfo(packageName: string): string;
7
+ };
3
8
  SEARCH: string;
4
- SUGGESTIONS: string;
5
- MGET: string;
6
9
  Search: {
7
10
  search(): string;
8
11
  suggestions(): string;
9
12
  };
10
- Package: {
11
- packageInfo(packageName: string): string;
12
- multiPackageInfo(): string;
13
- };
13
+ SUGGESTIONS: string;
14
14
  };
package/dist/Endpoints.js CHANGED
@@ -2,10 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Endpoint = void 0;
4
4
  exports.Endpoint = {
5
+ MGET: 'mget',
5
6
  PACKAGE: 'package',
7
+ Package: {
8
+ multiPackageInfo() {
9
+ return `/${exports.Endpoint.PACKAGE}/${exports.Endpoint.MGET}`;
10
+ },
11
+ packageInfo(packageName) {
12
+ return `/${exports.Endpoint.PACKAGE}/${encodeURIComponent(packageName)}`;
13
+ },
14
+ },
6
15
  SEARCH: 'search',
7
- SUGGESTIONS: 'suggestions',
8
- MGET: 'mget',
9
16
  Search: {
10
17
  search() {
11
18
  return `/${exports.Endpoint.SEARCH}`;
@@ -14,12 +21,5 @@ exports.Endpoint = {
14
21
  return `/${exports.Endpoint.SEARCH}/${exports.Endpoint.SUGGESTIONS}`;
15
22
  },
16
23
  },
17
- Package: {
18
- packageInfo(packageName) {
19
- return `/${exports.Endpoint.PACKAGE}/${encodeURIComponent(packageName)}`;
20
- },
21
- multiPackageInfo() {
22
- return `/${exports.Endpoint.PACKAGE}/${exports.Endpoint.MGET}`;
23
- },
24
- },
24
+ SUGGESTIONS: 'suggestions',
25
25
  };
@@ -23,7 +23,9 @@ class SearchAPI {
23
23
  getSuggestions(query_1) {
24
24
  return __awaiter(this, arguments, void 0, function* (query, options = {}) {
25
25
  const endpoint = Endpoints_1.Endpoint.Search.search();
26
- const params = Object.assign({ q: query }, (options.size && { size: options.size }));
26
+ const params = Object.assign({
27
+ // eslint-disable-next-line id-length
28
+ q: query }, (options.size && { size: options.size }));
27
29
  const { data } = yield this.apiClient.get(endpoint, { params });
28
30
  return data;
29
31
  });
@@ -52,7 +54,9 @@ class SearchAPI {
52
54
  searchPackage(query_1) {
53
55
  return __awaiter(this, arguments, void 0, function* (query, options = {}) {
54
56
  const endpoint = Endpoints_1.Endpoint.Search.search();
55
- const params = Object.assign(Object.assign({ q: query }, (options.from && { from: options.from })), (options.size && { size: options.size }));
57
+ const params = Object.assign(Object.assign({
58
+ // eslint-disable-next-line id-length
59
+ q: query }, (options.from && { from: options.from })), (options.size && { size: options.size }));
56
60
  const { data } = yield this.apiClient.get(endpoint, { params });
57
61
  return data;
58
62
  });
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './NpmsIO';
1
+ export * from './api/';
2
2
  export * from './interfaces/';
3
+ export * from './NpmsIO';
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("./NpmsIO"), exports);
17
+ __exportStar(require("./api/"), exports);
18
18
  __exportStar(require("./interfaces/"), exports);
19
+ __exportStar(require("./NpmsIO"), exports);
@@ -1,3 +1,22 @@
1
+ export interface Badge {
2
+ info: Info;
3
+ urls: Urls;
4
+ }
5
+ export interface Collected {
6
+ github?: GitHub;
7
+ metadata: Metadata;
8
+ npm: Npm;
9
+ source?: Source;
10
+ }
11
+ export interface Error {
12
+ code: string;
13
+ message: string;
14
+ }
15
+ export interface Evaluation {
16
+ maintenance: Maintenance;
17
+ popularity: Popularity;
18
+ quality: Quality;
19
+ }
1
20
  export interface PackageInfo {
2
21
  /** The date in which the package was last analyzed */
3
22
  analyzedAt: string;
@@ -10,15 +29,9 @@ export interface PackageInfo {
10
29
  /** The package score */
11
30
  score: Score;
12
31
  }
13
- interface Badge {
14
- info: Info;
15
- urls: Urls;
16
- }
17
- interface Collected {
18
- github?: GitHub;
19
- metadata: Metadata;
20
- npm: Npm;
21
- source?: Source;
32
+ export interface Score {
33
+ detail: Detail;
34
+ final: number;
22
35
  }
23
36
  interface Contributor {
24
37
  commitsCount: number;
@@ -29,15 +42,6 @@ interface Detail {
29
42
  popularity: number;
30
43
  quality: number;
31
44
  }
32
- interface Error {
33
- code: string;
34
- message: string;
35
- }
36
- interface Evaluation {
37
- maintenance: Maintenance;
38
- popularity: Popularity;
39
- quality: Quality;
40
- }
41
45
  interface Files {
42
46
  hasChangelog: boolean;
43
47
  readmeSize: number;
@@ -53,17 +57,17 @@ interface GitHub {
53
57
  statuses: Status[];
54
58
  subscribersCount: number;
55
59
  }
60
+ interface Info {
61
+ modifiers?: Modifiers;
62
+ service: string;
63
+ type: string;
64
+ }
56
65
  interface Issues {
57
66
  count: number;
58
67
  distribution: Record<string, number>;
59
68
  isDisabled: boolean;
60
69
  openCount: number;
61
70
  }
62
- interface Info {
63
- modifiers?: Modifiers;
64
- service: string;
65
- type: string;
66
- }
67
71
  interface Links {
68
72
  bugs?: string;
69
73
  homepage?: string;
@@ -128,10 +132,6 @@ interface Repository {
128
132
  type?: string;
129
133
  url: string;
130
134
  }
131
- interface Score {
132
- detail: Detail;
133
- final: number;
134
- }
135
135
  interface Source {
136
136
  badges: Badge[];
137
137
  coverage: number;
@@ -1,40 +1,15 @@
1
- export interface SearchResult {
2
- results: Result[];
3
- total: number;
4
- }
5
- interface Result {
6
- /** The package flags (deprecated, unstable, insecure) */
7
- flags?: Flags;
8
- /** The package data which contains the name, version and other useful information */
9
- package: Package;
10
- /** The package score */
11
- score: Score;
12
- /** The computed search score (from Elasticsearch) */
13
- searchScore: number;
14
- }
15
- interface Author {
1
+ export interface Author {
16
2
  email?: string;
17
3
  name: string;
18
4
  url?: string;
19
5
  username?: string;
20
6
  }
21
- interface Detail {
22
- maintenance: number;
23
- popularity: number;
24
- quality: number;
25
- }
26
- interface Flags {
7
+ export interface Flags {
27
8
  deprecated?: boolean;
28
9
  insecure?: boolean;
29
10
  unstable?: boolean;
30
11
  }
31
- interface Links {
32
- bugs?: string;
33
- homepage?: string;
34
- npm: string;
35
- repository?: string;
36
- }
37
- interface Package {
12
+ export interface Package {
38
13
  author?: Author;
39
14
  date: string;
40
15
  description: string;
@@ -46,10 +21,35 @@ interface Package {
46
21
  scope: string;
47
22
  version: string;
48
23
  }
49
- interface Publisher {
24
+ export interface Publisher {
50
25
  email: string;
51
26
  username: string;
52
27
  }
28
+ export interface Result {
29
+ /** The package flags (deprecated, unstable, insecure) */
30
+ flags?: Flags;
31
+ /** The package data which contains the name, version and other useful information */
32
+ package: Package;
33
+ /** The package score */
34
+ score: Score;
35
+ /** The computed search score (from Elasticsearch) */
36
+ searchScore: number;
37
+ }
38
+ export interface SearchResult {
39
+ results: Result[];
40
+ total: number;
41
+ }
42
+ interface Detail {
43
+ maintenance: number;
44
+ popularity: number;
45
+ quality: number;
46
+ }
47
+ interface Links {
48
+ bugs?: string;
49
+ homepage?: string;
50
+ npm: string;
51
+ repository?: string;
52
+ }
53
53
  interface Score {
54
54
  detail: Detail;
55
55
  final: number;
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 npms.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/npms.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
  }