npms.io 2.2.0 → 2.2.1
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.
- package/CHANGELOG.md +11 -0
- package/dist/api/SearchAPI.d.ts +15 -15
- package/dist/api/SearchAPI.js +19 -24
- package/dist/api/SearchAPI.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.2.1 (2022-04-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **npms.io:** Search query doesn't need to be encoded ([#959](https://github.com/ffflorian/api-clients/issues/959)) ([ea737a7](https://github.com/ffflorian/api-clients/commit/ea737a735f1c1bac5e5dd4dc1c02c860af0fb818))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 2.2.0 (2022-03-14)
|
|
7
18
|
|
|
8
19
|
|
package/dist/api/SearchAPI.d.ts
CHANGED
|
@@ -12,21 +12,21 @@ export declare class SearchAPI {
|
|
|
12
12
|
/**
|
|
13
13
|
* Perform a search query.
|
|
14
14
|
* @param query Besides normal text, `query` supports qualifiers to express filters and other modifiers:
|
|
15
|
-
* - `scope:types
|
|
16
|
-
* - `author:sindresorhus
|
|
17
|
-
* - `maintainer:sindresorhus
|
|
18
|
-
* - `keywords:gulpplugin
|
|
19
|
-
* - `not:deprecated
|
|
20
|
-
* - `not:unstable
|
|
21
|
-
* - `not:insecure
|
|
22
|
-
* - `is:deprecated
|
|
23
|
-
* - `is:unstable
|
|
24
|
-
* - `is:insecure
|
|
25
|
-
* - `boost-exact:false
|
|
26
|
-
* - `score-effect:14
|
|
27
|
-
* - `quality-weight:1
|
|
28
|
-
* - `popularity-weight:1
|
|
29
|
-
* - `maintenance-weight:1
|
|
15
|
+
* - `scope:types` Show/filter results that belong to the `@types` scope
|
|
16
|
+
* - `author:sindresorhus` Show/filter results in which `sindresorhus` is the author
|
|
17
|
+
* - `maintainer:sindresorhus` Show/filter results in which `sindresorhus` is qualifier as a maintainer
|
|
18
|
+
* - `keywords:gulpplugin` Show/filter results that have `gulpplugin` in the keywords (separate multiple keywords with commas, you may also exclude keywords e.g.: `-framework`)
|
|
19
|
+
* - `not:deprecated` Exclude deprecated packages from the results
|
|
20
|
+
* - `not:unstable` Exclude packages whose version is `< 1.0.0`
|
|
21
|
+
* - `not:insecure` Exclude packages that are insecure or have vulnerable dependencies (as per [nsp](https://nodesecurity.io/))
|
|
22
|
+
* - `is:deprecated` Show/filter is deprecated packages
|
|
23
|
+
* - `is:unstable` Show/filter packages whose version is `< 1.0.0`
|
|
24
|
+
* - `is:insecure` Show/filter packages that are insecure or have vulnerable dependencies (as per [nsp](https://nodesecurity.io/))
|
|
25
|
+
* - `boost-exact:false` Do not boost exact matches, defaults to `true`
|
|
26
|
+
* - `score-effect:14` Set the effect that package scores have for the final search score, defaults to `15.3`
|
|
27
|
+
* - `quality-weight:1` Set the weight that quality has for the each package score, defaults to `1.95`
|
|
28
|
+
* - `popularity-weight:1` Set the weight that popularity has for the each package score, defaults to `3.3`
|
|
29
|
+
* - `maintenance-weight:1` Set the weight that the quality has for the each package score, defaults to `2.05`
|
|
30
30
|
* @param options Additional search options
|
|
31
31
|
* @see https://api-docs.npms.io/#api-Search-ExecuteSearchQuery
|
|
32
32
|
*/
|
package/dist/api/SearchAPI.js
CHANGED
|
@@ -23,11 +23,9 @@ class SearchAPI {
|
|
|
23
23
|
getSuggestions(query, options = {}) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
const endpoint = Endpoints_1.Endpoint.Search.search();
|
|
26
|
-
const params = {
|
|
26
|
+
const params = Object.assign({
|
|
27
27
|
// eslint-disable-next-line id-length
|
|
28
|
-
q:
|
|
29
|
-
size: options.size,
|
|
30
|
-
};
|
|
28
|
+
q: query }, (options.size && { size: options.size }));
|
|
31
29
|
const { data } = yield this.apiClient.get(endpoint, { params });
|
|
32
30
|
return data;
|
|
33
31
|
});
|
|
@@ -35,33 +33,30 @@ class SearchAPI {
|
|
|
35
33
|
/**
|
|
36
34
|
* Perform a search query.
|
|
37
35
|
* @param query Besides normal text, `query` supports qualifiers to express filters and other modifiers:
|
|
38
|
-
* - `scope:types
|
|
39
|
-
* - `author:sindresorhus
|
|
40
|
-
* - `maintainer:sindresorhus
|
|
41
|
-
* - `keywords:gulpplugin
|
|
42
|
-
* - `not:deprecated
|
|
43
|
-
* - `not:unstable
|
|
44
|
-
* - `not:insecure
|
|
45
|
-
* - `is:deprecated
|
|
46
|
-
* - `is:unstable
|
|
47
|
-
* - `is:insecure
|
|
48
|
-
* - `boost-exact:false
|
|
49
|
-
* - `score-effect:14
|
|
50
|
-
* - `quality-weight:1
|
|
51
|
-
* - `popularity-weight:1
|
|
52
|
-
* - `maintenance-weight:1
|
|
36
|
+
* - `scope:types` Show/filter results that belong to the `@types` scope
|
|
37
|
+
* - `author:sindresorhus` Show/filter results in which `sindresorhus` is the author
|
|
38
|
+
* - `maintainer:sindresorhus` Show/filter results in which `sindresorhus` is qualifier as a maintainer
|
|
39
|
+
* - `keywords:gulpplugin` Show/filter results that have `gulpplugin` in the keywords (separate multiple keywords with commas, you may also exclude keywords e.g.: `-framework`)
|
|
40
|
+
* - `not:deprecated` Exclude deprecated packages from the results
|
|
41
|
+
* - `not:unstable` Exclude packages whose version is `< 1.0.0`
|
|
42
|
+
* - `not:insecure` Exclude packages that are insecure or have vulnerable dependencies (as per [nsp](https://nodesecurity.io/))
|
|
43
|
+
* - `is:deprecated` Show/filter is deprecated packages
|
|
44
|
+
* - `is:unstable` Show/filter packages whose version is `< 1.0.0`
|
|
45
|
+
* - `is:insecure` Show/filter packages that are insecure or have vulnerable dependencies (as per [nsp](https://nodesecurity.io/))
|
|
46
|
+
* - `boost-exact:false` Do not boost exact matches, defaults to `true`
|
|
47
|
+
* - `score-effect:14` Set the effect that package scores have for the final search score, defaults to `15.3`
|
|
48
|
+
* - `quality-weight:1` Set the weight that quality has for the each package score, defaults to `1.95`
|
|
49
|
+
* - `popularity-weight:1` Set the weight that popularity has for the each package score, defaults to `3.3`
|
|
50
|
+
* - `maintenance-weight:1` Set the weight that the quality has for the each package score, defaults to `2.05`
|
|
53
51
|
* @param options Additional search options
|
|
54
52
|
* @see https://api-docs.npms.io/#api-Search-ExecuteSearchQuery
|
|
55
53
|
*/
|
|
56
54
|
searchPackage(query, options = {}) {
|
|
57
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
56
|
const endpoint = Endpoints_1.Endpoint.Search.search();
|
|
59
|
-
const params = {
|
|
60
|
-
from: options.from,
|
|
57
|
+
const params = Object.assign(Object.assign({
|
|
61
58
|
// eslint-disable-next-line id-length
|
|
62
|
-
q:
|
|
63
|
-
size: options.size,
|
|
64
|
-
};
|
|
59
|
+
q: query }, (options.from && { from: options.from })), (options.size && { size: options.size }));
|
|
65
60
|
const { data } = yield this.apiClient.get(endpoint, { params });
|
|
66
61
|
return data;
|
|
67
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAPI.js","sourceRoot":"","sources":["../../src/api/SearchAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;AAGtC,MAAa,SAAS;IAGpB,YAAY,SAAwB;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACU,cAAc,CAAC,KAAa,EAAE,UAA8B,EAAE;;YACzE,MAAM,QAAQ,GAAG,oBAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAE1C,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"SearchAPI.js","sourceRoot":"","sources":["../../src/api/SearchAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;A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|
|
10
|
-
"typedoc": "0.22.
|
|
11
|
-
"typescript": "4.6.
|
|
10
|
+
"typedoc": "0.22.14",
|
|
11
|
+
"typescript": "4.6.3"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">= 10.9"
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"dist": "yarn clean && yarn build:ts",
|
|
34
34
|
"test": "exit 0"
|
|
35
35
|
},
|
|
36
|
-
"version": "2.2.
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"version": "2.2.1",
|
|
37
|
+
"gitHead": "ded1923270e86bd0f305708455ebc66259ec40c6"
|
|
38
38
|
}
|