@verdaccio/types 14.0.0-next-9.4 → 14.0.0-next-9.5
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/package.json +1 -1
- package/src/configuration.ts +0 -8
- package/src/search.ts +59 -2
package/package.json
CHANGED
package/src/configuration.ts
CHANGED
|
@@ -89,14 +89,6 @@ export type RateLimit = {
|
|
|
89
89
|
* All flags are optional and default to `false` when not specified.
|
|
90
90
|
*/
|
|
91
91
|
export type FlagsConfig = {
|
|
92
|
-
/**
|
|
93
|
-
* Enables searching for packages in remote registries.
|
|
94
|
-
* If `false`, only the local registry will be queried.
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
searchRemote?: boolean;
|
|
99
|
-
|
|
100
92
|
/**
|
|
101
93
|
* Enables user password change functionality.
|
|
102
94
|
*
|
package/src/search.ts
CHANGED
|
@@ -21,8 +21,65 @@ export type SearchPackageBody = {
|
|
|
21
21
|
maintainers?: PublisherMaintainer[];
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Flat response shape, e.g. from the local registry packument-style search:
|
|
26
|
+
*
|
|
27
|
+
* ```json
|
|
28
|
+
* { "name": "...", "version": "...", "description": "...", "dist": { ... } }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export type SearchResultWebFlat = {
|
|
25
32
|
name: string;
|
|
26
33
|
version: string;
|
|
27
|
-
description
|
|
34
|
+
description?: string;
|
|
35
|
+
main?: string;
|
|
36
|
+
readmeFilename?: string;
|
|
37
|
+
dependencies?: Record<string, string>;
|
|
38
|
+
dist?: {
|
|
39
|
+
shasum?: string;
|
|
40
|
+
tarball?: string;
|
|
41
|
+
};
|
|
42
|
+
contributors?: unknown[];
|
|
28
43
|
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* npm-style "search objects" response where each entry is wrapped in a
|
|
47
|
+
* `package` envelope and carries verdaccio-specific metadata flags.
|
|
48
|
+
*/
|
|
49
|
+
export type SearchResultWebWrapped = {
|
|
50
|
+
package: {
|
|
51
|
+
name: string;
|
|
52
|
+
version: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
scope?: string;
|
|
55
|
+
keywords?: string[];
|
|
56
|
+
date?: string;
|
|
57
|
+
author?: PublisherMaintainer | { name?: string; email?: string };
|
|
58
|
+
publisher?: any;
|
|
59
|
+
maintainers?: Array<{ name?: string; email?: string }>;
|
|
60
|
+
links?: {
|
|
61
|
+
npm?: string;
|
|
62
|
+
homepage?: string;
|
|
63
|
+
repository?: any;
|
|
64
|
+
bugs?: any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
score?: {
|
|
68
|
+
final?: number;
|
|
69
|
+
detail?: {
|
|
70
|
+
maintenance?: number;
|
|
71
|
+
popularity?: number;
|
|
72
|
+
quality?: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
searchScore?: number;
|
|
76
|
+
verdaccioPkgCached?: boolean;
|
|
77
|
+
verdaccioPrivate?: boolean;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Union of the two search response shapes the web UI can consume.
|
|
82
|
+
* The Search component auto-detects the shape at render time — no feature
|
|
83
|
+
* flag is required to switch between them.
|
|
84
|
+
*/
|
|
85
|
+
export type SearchResultWeb = SearchResultWebFlat | SearchResultWebWrapped;
|