verdaccio 6.7.4 → 6.9.0
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/README.md +2 -2
- package/bin/verdaccio +5 -1
- package/build/_virtual/_rolldown/runtime.js +23 -0
- package/build/api/debug/index.js +23 -26
- package/build/api/debug/index.js.map +1 -0
- package/build/api/debug/index.mjs +19 -0
- package/build/api/debug/index.mjs.map +1 -0
- package/build/api/endpoint/api/dist-tags.js +62 -75
- package/build/api/endpoint/api/dist-tags.js.map +1 -0
- package/build/api/endpoint/api/dist-tags.mjs +56 -0
- package/build/api/endpoint/api/dist-tags.mjs.map +1 -0
- package/build/api/endpoint/api/package.js +91 -99
- package/build/api/endpoint/api/package.js.map +1 -0
- package/build/api/endpoint/api/package.mjs +89 -0
- package/build/api/endpoint/api/package.mjs.map +1 -0
- package/build/api/endpoint/api/ping.js +13 -11
- package/build/api/endpoint/api/ping.js.map +1 -0
- package/build/api/endpoint/api/ping.mjs +11 -0
- package/build/api/endpoint/api/ping.mjs.map +1 -0
- package/build/api/endpoint/api/publish.d.ts +2 -2
- package/build/api/endpoint/api/publish.js +278 -343
- package/build/api/endpoint/api/publish.js.map +1 -0
- package/build/api/endpoint/api/publish.mjs +280 -0
- package/build/api/endpoint/api/publish.mjs.map +1 -0
- package/build/api/endpoint/api/search.js +57 -105
- package/build/api/endpoint/api/search.js.map +1 -0
- package/build/api/endpoint/api/search.mjs +54 -0
- package/build/api/endpoint/api/search.mjs.map +1 -0
- package/build/api/endpoint/api/star.js +60 -71
- package/build/api/endpoint/api/star.js.map +1 -0
- package/build/api/endpoint/api/star.mjs +54 -0
- package/build/api/endpoint/api/star.mjs.map +1 -0
- package/build/api/endpoint/api/stars.js +40 -40
- package/build/api/endpoint/api/stars.js.map +1 -0
- package/build/api/endpoint/api/stars.mjs +35 -0
- package/build/api/endpoint/api/stars.mjs.map +1 -0
- package/build/api/endpoint/api/user.js +69 -82
- package/build/api/endpoint/api/user.js.map +1 -0
- package/build/api/endpoint/api/user.mjs +64 -0
- package/build/api/endpoint/api/user.mjs.map +1 -0
- package/build/api/endpoint/api/v1/profile.js +50 -67
- package/build/api/endpoint/api/v1/profile.js.map +1 -0
- package/build/api/endpoint/api/v1/profile.mjs +46 -0
- package/build/api/endpoint/api/v1/profile.mjs.map +1 -0
- package/build/api/endpoint/api/v1/search.d.ts +2 -1
- package/build/api/endpoint/api/v1/search.js +149 -168
- package/build/api/endpoint/api/v1/search.js.map +1 -0
- package/build/api/endpoint/api/v1/search.mjs +154 -0
- package/build/api/endpoint/api/v1/search.mjs.map +1 -0
- package/build/api/endpoint/api/v1/token.js +122 -155
- package/build/api/endpoint/api/v1/token.js.map +1 -0
- package/build/api/endpoint/api/v1/token.mjs +119 -0
- package/build/api/endpoint/api/v1/token.mjs.map +1 -0
- package/build/api/endpoint/api/whoami.js +13 -13
- package/build/api/endpoint/api/whoami.js.map +1 -0
- package/build/api/endpoint/api/whoami.mjs +11 -0
- package/build/api/endpoint/api/whoami.mjs.map +1 -0
- package/build/api/endpoint/index.js +58 -67
- package/build/api/endpoint/index.js.map +1 -0
- package/build/api/endpoint/index.mjs +54 -0
- package/build/api/endpoint/index.mjs.map +1 -0
- package/build/api/index.js +85 -106
- package/build/api/index.js.map +1 -0
- package/build/api/index.mjs +78 -0
- package/build/api/index.mjs.map +1 -0
- package/build/api/middleware.js +60 -54
- package/build/api/middleware.js.map +1 -0
- package/build/api/middleware.mjs +55 -0
- package/build/api/middleware.mjs.map +1 -0
- package/build/api/web/api/index.js +25 -29
- package/build/api/web/api/index.js.map +1 -0
- package/build/api/web/api/index.mjs +23 -0
- package/build/api/web/api/index.mjs.map +1 -0
- package/build/api/web/api/package.js +142 -161
- package/build/api/web/api/package.js.map +1 -0
- package/build/api/web/api/package.mjs +139 -0
- package/build/api/web/api/package.mjs.map +1 -0
- package/build/api/web/api/search.js +37 -50
- package/build/api/web/api/search.js.map +1 -0
- package/build/api/web/api/search.mjs +36 -0
- package/build/api/web/api/search.mjs.map +1 -0
- package/build/api/web/api/user.js +52 -73
- package/build/api/web/api/user.js.map +1 -0
- package/build/api/web/api/user.mjs +49 -0
- package/build/api/web/api/user.mjs.map +1 -0
- package/build/api/web/api/utils.js +9 -10
- package/build/api/web/api/utils.js.map +1 -0
- package/build/api/web/api/utils.mjs +11 -0
- package/build/api/web/api/utils.mjs.map +1 -0
- package/build/api/web/index.js +76 -88
- package/build/api/web/index.js.map +1 -0
- package/build/api/web/index.mjs +70 -0
- package/build/api/web/index.mjs.map +1 -0
- package/build/index.js +43 -60
- package/build/index.mjs +5 -0
- package/build/lib/auth-utils.js +12 -14
- package/build/lib/auth-utils.js.map +1 -0
- package/build/lib/auth-utils.mjs +11 -0
- package/build/lib/auth-utils.mjs.map +1 -0
- package/build/lib/bootstrap.js +125 -157
- package/build/lib/bootstrap.js.map +1 -0
- package/build/lib/bootstrap.mjs +125 -0
- package/build/lib/bootstrap.mjs.map +1 -0
- package/build/lib/cli/cli.js +22 -24
- package/build/lib/cli/cli.js.map +1 -0
- package/build/lib/cli/cli.mjs +23 -0
- package/build/lib/cli/cli.mjs.map +1 -0
- package/build/lib/cli/commands/info.js +34 -25
- package/build/lib/cli/commands/info.js.map +1 -0
- package/build/lib/cli/commands/info.mjs +32 -0
- package/build/lib/cli/commands/info.mjs.map +1 -0
- package/build/lib/cli/commands/init.js +61 -79
- package/build/lib/cli/commands/init.js.map +1 -0
- package/build/lib/cli/commands/init.mjs +70 -0
- package/build/lib/cli/commands/init.mjs.map +1 -0
- package/build/lib/cli/commands/version.js +14 -16
- package/build/lib/cli/commands/version.js.map +1 -0
- package/build/lib/cli/commands/version.mjs +14 -0
- package/build/lib/cli/commands/version.mjs.map +1 -0
- package/build/lib/cli/utils.d.ts +2 -2
- package/build/lib/cli/utils.js +16 -15
- package/build/lib/cli/utils.js.map +1 -0
- package/build/lib/cli/utils.mjs +14 -0
- package/build/lib/cli/utils.mjs.map +1 -0
- package/build/lib/cli.js +11 -14
- package/build/lib/cli.js.map +1 -0
- package/build/lib/cli.mjs +12 -0
- package/build/lib/cli.mjs.map +1 -0
- package/build/lib/config.js +19 -21
- package/build/lib/config.js.map +1 -0
- package/build/lib/config.mjs +16 -0
- package/build/lib/config.mjs.map +1 -0
- package/build/lib/constants.js +100 -93
- package/build/lib/constants.js.map +1 -0
- package/build/lib/constants.mjs +28 -0
- package/build/lib/constants.mjs.map +1 -0
- package/build/lib/experiments.js +19 -27
- package/build/lib/experiments.js.map +1 -0
- package/build/lib/experiments.mjs +20 -0
- package/build/lib/experiments.mjs.map +1 -0
- package/build/lib/local-storage.d.ts +5 -2
- package/build/lib/local-storage.js +606 -757
- package/build/lib/local-storage.js.map +1 -0
- package/build/lib/local-storage.mjs +600 -0
- package/build/lib/local-storage.mjs.map +1 -0
- package/build/lib/logger/index.js +24 -19
- package/build/lib/logger/index.js.map +1 -0
- package/build/lib/logger/index.mjs +17 -0
- package/build/lib/logger/index.mjs.map +1 -0
- package/build/lib/metadata-utils.js +24 -36
- package/build/lib/metadata-utils.js.map +1 -0
- package/build/lib/metadata-utils.mjs +23 -0
- package/build/lib/metadata-utils.mjs.map +1 -0
- package/build/lib/run-server.js +83 -114
- package/build/lib/run-server.js.map +1 -0
- package/build/lib/run-server.mjs +82 -0
- package/build/lib/run-server.mjs.map +1 -0
- package/build/lib/storage-utils.d.ts +120 -8
- package/build/lib/storage-utils.js +390 -251
- package/build/lib/storage-utils.js.map +1 -0
- package/build/lib/storage-utils.mjs +400 -0
- package/build/lib/storage-utils.mjs.map +1 -0
- package/build/lib/storage.d.ts +127 -57
- package/build/lib/storage.js +674 -681
- package/build/lib/storage.js.map +1 -0
- package/build/lib/storage.mjs +665 -0
- package/build/lib/storage.mjs.map +1 -0
- package/build/lib/up-storage.js +490 -599
- package/build/lib/up-storage.js.map +1 -0
- package/build/lib/up-storage.mjs +484 -0
- package/build/lib/up-storage.mjs.map +1 -0
- package/build/lib/uplink-util.js +21 -31
- package/build/lib/uplink-util.js.map +1 -0
- package/build/lib/uplink-util.mjs +24 -0
- package/build/lib/uplink-util.mjs.map +1 -0
- package/build/lib/utils.js +172 -231
- package/build/lib/utils.js.map +1 -0
- package/build/lib/utils.mjs +188 -0
- package/build/lib/utils.mjs.map +1 -0
- package/package.json +105 -100
package/build/lib/storage.d.ts
CHANGED
|
@@ -11,95 +11,160 @@ declare class Storage {
|
|
|
11
11
|
uplinks: Record<string, ProxyStorage>;
|
|
12
12
|
filters: IPluginFilters | undefined;
|
|
13
13
|
constructor(config: Config);
|
|
14
|
+
/**
|
|
15
|
+
* Initialize the storage: load the storage plugin (or the default
|
|
16
|
+
* local storage) and the filter plugins. Safe to call once; subsequent
|
|
17
|
+
* calls only reload missing filters.
|
|
18
|
+
* @param {Config} config verdaccio configuration
|
|
19
|
+
* @param {IPluginFilters} filters preloaded filter plugins; when omitted they are loaded from the configuration
|
|
20
|
+
*/
|
|
14
21
|
init(config: Config, filters?: IPluginFilters): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the storage backend: a configured storage plugin when available,
|
|
24
|
+
* otherwise the default `@verdaccio/local-storage` on the configured path.
|
|
25
|
+
* @return {Promise<StoragePlugin>} the storage plugin instance
|
|
26
|
+
*/
|
|
15
27
|
private loadStorage;
|
|
28
|
+
/**
|
|
29
|
+
* Load the storage plugins declared under `store` in the configuration.
|
|
30
|
+
* Only one storage is supported: with several plugins configured the
|
|
31
|
+
* first loaded one wins and a warning is logged.
|
|
32
|
+
* @return {Promise<StoragePluginLegacy<Config> | undefined>} the selected plugin, or undefined when none is configured
|
|
33
|
+
*/
|
|
16
34
|
private loadStorePlugin;
|
|
17
35
|
/**
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
* Add a package to the system (publish flow).
|
|
37
|
+
* Verifies the package does not exist locally nor on any uplink before
|
|
38
|
+
* creating it locally; uplinks being offline rejects the publish unless
|
|
39
|
+
* `publish.allow_offline` is enabled.
|
|
40
|
+
* Used storages: local (write) && uplinks
|
|
41
|
+
* @param {String} name package name
|
|
42
|
+
* @param {Object} metadata package manifest to publish
|
|
43
|
+
* @param {Function} callback invoked with an error when the publish is rejected
|
|
22
44
|
*/
|
|
23
45
|
addPackage(name: string, metadata: any, callback: any): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Whether `publish.allow_offline` is enabled in the configuration.
|
|
48
|
+
* @return {Boolean} true when publishing with unreachable uplinks is allowed
|
|
49
|
+
*/
|
|
24
50
|
private _isAllowPublishOffline;
|
|
51
|
+
/**
|
|
52
|
+
* Read the npm tokens matching the filter from the token storage.
|
|
53
|
+
* Used storages: local (read)
|
|
54
|
+
*/
|
|
25
55
|
readTokens(filter: TokenFilter): Promise<Token[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Save an npm token to the token storage.
|
|
58
|
+
* Used storages: local (write)
|
|
59
|
+
*/
|
|
26
60
|
saveToken(token: Token): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Delete an npm token from the token storage.
|
|
63
|
+
* Used storages: local (write)
|
|
64
|
+
*/
|
|
27
65
|
deleteToken(user: string, tokenKey: string): Promise<any>;
|
|
28
66
|
/**
|
|
29
|
-
* Add a new version of package
|
|
30
|
-
Used storages: local (write)
|
|
67
|
+
* Add a new version of a package to the system.
|
|
68
|
+
* Used storages: local (write)
|
|
69
|
+
* @param {String} name package name
|
|
70
|
+
* @param {String} version version id, eg. 1.0.0
|
|
71
|
+
* @param {Version} metadata version metadata
|
|
72
|
+
* @param {String} tag dist-tag pointing to the version
|
|
73
|
+
* @param {Function} callback
|
|
31
74
|
*/
|
|
32
75
|
addVersion(name: string, version: string, metadata: Version, tag: StringValue, callback: Callback): void;
|
|
33
76
|
/**
|
|
34
|
-
*
|
|
35
|
-
Used storages: local (write)
|
|
77
|
+
* Tag package versions with the provided dist-tags.
|
|
78
|
+
* Used storages: local (write)
|
|
79
|
+
* @param {String} name package name
|
|
80
|
+
* @param {MergeTags} tagHash dist-tag to version mapping to merge
|
|
81
|
+
* @param {Function} callback
|
|
36
82
|
*/
|
|
37
83
|
mergeTags(name: string, tagHash: MergeTags, callback: Callback): void;
|
|
38
84
|
/**
|
|
39
|
-
* Change an existing package (
|
|
40
|
-
|
|
41
|
-
|
|
85
|
+
* Change an existing package (eg. unpublish one version).
|
|
86
|
+
* Used storages: local (write)
|
|
87
|
+
* @param {String} name package name
|
|
88
|
+
* @param {Manifest} metadata updated package manifest
|
|
89
|
+
* @param {String} revision expected revision of the stored manifest
|
|
90
|
+
* @param {Function} callback
|
|
42
91
|
*/
|
|
43
92
|
changePackage(name: string, metadata: Manifest, revision: string, callback: Callback): void;
|
|
44
93
|
/**
|
|
45
|
-
* Remove a package from
|
|
46
|
-
|
|
47
|
-
|
|
94
|
+
* Remove a package from the local storage and the search indexer.
|
|
95
|
+
* Used storages: local (write)
|
|
96
|
+
* @param {String} name package name
|
|
97
|
+
* @param {Function} callback
|
|
48
98
|
*/
|
|
49
99
|
removePackage(name: string, callback: Callback): void;
|
|
50
100
|
/**
|
|
51
|
-
Remove a tarball from
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
101
|
+
* Remove a tarball from the local storage. The tarball must not be
|
|
102
|
+
* linked by any existing version, ie. the version should be
|
|
103
|
+
* unpublished first.
|
|
104
|
+
* Used storages: local (write)
|
|
105
|
+
* @param {String} name package name
|
|
106
|
+
* @param {String} filename tarball file name
|
|
107
|
+
* @param {String} revision expected revision of the stored manifest
|
|
108
|
+
* @param {Function} callback
|
|
56
109
|
*/
|
|
57
110
|
removeTarball(name: string, filename: string, revision: string, callback: Callback): void;
|
|
58
111
|
/**
|
|
59
|
-
* Upload a tarball
|
|
60
|
-
|
|
61
|
-
Used storages: local (write)
|
|
112
|
+
* Upload a tarball (publish flow). Synchronous, returns a writable
|
|
113
|
+
* stream the tarball body is piped into.
|
|
114
|
+
* Used storages: local (write)
|
|
115
|
+
* @param {String} name package name
|
|
116
|
+
* @param {String} filename tarball file name
|
|
117
|
+
* @return {Stream} writable upload stream
|
|
62
118
|
*/
|
|
63
119
|
addTarball(name: string, filename: string): import("@verdaccio/streams").UploadTarball;
|
|
120
|
+
/**
|
|
121
|
+
* Whether a tarball exists in the local storage, without reading it
|
|
122
|
+
* (the stream is aborted as soon as it opens).
|
|
123
|
+
* Used storages: local (read)
|
|
124
|
+
* @param {String} name package name
|
|
125
|
+
* @param {String} filename tarball file name
|
|
126
|
+
* @return {Promise<Boolean>} true when the tarball is stored locally
|
|
127
|
+
*/
|
|
64
128
|
hasLocalTarball(name: string, filename: string): Promise<boolean>;
|
|
65
129
|
/**
|
|
66
|
-
Get a tarball
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
130
|
+
* Get a tarball. Synchronous, returns a readable stream.
|
|
131
|
+
* The tarball is read locally first; on a local miss the distfile record
|
|
132
|
+
* is resolved from the package metadata (see lookupDistFile), syncing the
|
|
133
|
+
* uplinks when the local metadata does not know the file, and the tarball
|
|
134
|
+
* is then fetched from the uplink that serves the distfile url.
|
|
135
|
+
* Used storages: local || uplink (just one)
|
|
136
|
+
* @param {String} name package name
|
|
137
|
+
* @param {String} filename tarball file name
|
|
138
|
+
* @return {Stream} readable tarball stream
|
|
71
139
|
*/
|
|
72
140
|
getTarball(name: string, filename: string): ReadTarball;
|
|
73
141
|
/**
|
|
74
|
-
Retrieve
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* @
|
|
81
|
-
* @property {
|
|
82
|
-
* @property {
|
|
83
|
-
* @property {boolean} options.keepUpLinkData keep up link info in package meta, last update, etc.
|
|
84
|
-
* @property {function} options.callback Callback for receive data
|
|
142
|
+
* Retrieve the package metadata: the local manifest merged with the
|
|
143
|
+
* manifest of every uplink with proxy access to the package.
|
|
144
|
+
* Used storages: local && uplink (proxy_access)
|
|
145
|
+
* @param {Object} options
|
|
146
|
+
* @property {String} options.name package name
|
|
147
|
+
* @property {Object} options.req Express `req` object
|
|
148
|
+
* @property {Boolean} options.keepUpLinkData keep the uplink info (last update, etc.) in the package metadata
|
|
149
|
+
* @property {Boolean} options.abbreviated serve the abbreviated manifest (npm install)
|
|
150
|
+
* @property {Function} options.callback invoked with the merged manifest and any uplink errors
|
|
85
151
|
*/
|
|
86
152
|
getPackage(options: any): void;
|
|
87
153
|
/**
|
|
88
|
-
Retrieve remote and local packages more recent than
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* @
|
|
96
|
-
* @param {*} options
|
|
97
|
-
* @return {Stream}
|
|
154
|
+
* Retrieve remote and local packages more recent than the start key.
|
|
155
|
+
* All uplinks are streamed first, then the local packages; local
|
|
156
|
+
* packages can override registry ones just because they appear in the
|
|
157
|
+
* JSON last — a trade-off made to avoid memory issues.
|
|
158
|
+
* Used storages: local && uplink (proxy_access)
|
|
159
|
+
* @param {String} startkey timestamp to search from
|
|
160
|
+
* @param {Object} options request options; `local=1` in the query skips the uplinks
|
|
161
|
+
* @return {Stream} object stream of search results
|
|
98
162
|
*/
|
|
99
163
|
search(startkey: string, options: any): any;
|
|
100
164
|
/**
|
|
101
|
-
* Retrieve only private local packages
|
|
102
|
-
*
|
|
165
|
+
* Retrieve only private local packages, as the latest version of each.
|
|
166
|
+
* Used storages: local (read)
|
|
167
|
+
* @param {Function} callback invoked with the list of latest versions
|
|
103
168
|
*/
|
|
104
169
|
getLocalDatabase(callback: Callback): void;
|
|
105
170
|
/**
|
|
@@ -107,9 +172,13 @@ declare class Storage {
|
|
|
107
172
|
*/
|
|
108
173
|
private _collectLocalPackages;
|
|
109
174
|
/**
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
175
|
+
* Fetch the package metadata from every uplink with proxy access and
|
|
176
|
+
* synchronize it with the local data; filter plugins are applied to the
|
|
177
|
+
* merged result.
|
|
178
|
+
* @param {String} name package name
|
|
179
|
+
* @param {Manifest} packageInfo local manifest; MUST be provided when the package exists locally
|
|
180
|
+
* @param {ISyncUplinks} options uplink request options
|
|
181
|
+
* @param {Function} callback invoked with (err, mergedManifest, uplinkErrors)
|
|
113
182
|
*/
|
|
114
183
|
_syncUplinksMetadata(name: string, packageInfo: Manifest, options: ISyncUplinks, callback: Callback): void;
|
|
115
184
|
/**
|
|
@@ -126,10 +195,11 @@ declare class Storage {
|
|
|
126
195
|
*/
|
|
127
196
|
private _isTarballAllowedByFilters;
|
|
128
197
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* @
|
|
198
|
+
* Tag each version with the uplink it was fetched from, under a hidden
|
|
199
|
+
* (symbol) key. The local storage uses the tag to record the registry
|
|
200
|
+
* on the distfile records it creates.
|
|
201
|
+
* @param {Versions} versions versions fetched from the uplink
|
|
202
|
+
* @param {ProxyStorage} upLink uplink the versions were fetched from
|
|
133
203
|
*/
|
|
134
204
|
_updateVersionsHiddenUpLink(versions: Versions, upLink: ProxyStorage): void;
|
|
135
205
|
}
|