@verdaccio/types 11.0.0-6-next.25 → 12.0.0-next-7.3

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 CHANGED
@@ -1,5 +1,418 @@
1
1
  # Change Log
2
2
 
3
+ ## 12.0.0-next-7.3
4
+
5
+ ### Minor Changes
6
+
7
+ - bd8703e: feat: add migrateToSecureLegacySignature and remove enhancedLegacySignature property
8
+
9
+ ## 12.0.0-next.2
10
+
11
+ ### Minor Changes
12
+
13
+ - f047cc8: refactor: auth with legacy sign support
14
+
15
+ ## 12.0.0-next.1
16
+
17
+ ### Major Changes
18
+
19
+ - e7ebccb61: update major dependencies, remove old nodejs support
20
+
21
+ ## 12.0.0-next.0
22
+
23
+ ### Major Changes
24
+
25
+ - feat!: bump to v7
26
+
27
+ ## 11.0.0
28
+
29
+ ### Major Changes
30
+
31
+ - 292c0a37f: feat!: replace deprecated request dependency by got
32
+
33
+ This is a big refactoring of the core, fetching dependencies, improve code, more tests and better stability. This is essential for the next release, will take some time but would allow modularize more the core.
34
+
35
+ ## Notes
36
+
37
+ - Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
38
+ - Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
39
+ - Refactor with promises instead callback wherever is possible
40
+ - ~Document the API~
41
+ - Improve testing, integration tests
42
+ - Bugfix
43
+ - Clean up old validations
44
+ - Improve performance
45
+
46
+ ## 💥 Breaking changes
47
+
48
+ - Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
49
+ - Write Tarball, Read Tarball methods parameters change, a new set of options like `AbortController` signals are being provided to the `addAbortSignal` can be internally used with Streams when a request is aborted. eg: `addAbortSignal(signal, fs.createReadStream(pathName));`
50
+ - `@verdaccio/streams` stream abort support is legacy is being deprecated removed
51
+ - Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
52
+
53
+ - a3a209b5e: feat: migrate to pino.js 8
54
+ - 459b6fa72: refactor: search v1 endpoint and local-database
55
+
56
+ - refactor search `api v1` endpoint, improve performance
57
+ - remove usage of `async` dependency https://github.com/verdaccio/verdaccio/issues/1225
58
+ - refactor method storage class
59
+ - create new module `core` to reduce the ammount of modules with utilities
60
+ - use `undici` instead `node-fetch`
61
+ - use `fastify` instead `express` for functional test
62
+
63
+ ### Breaking changes
64
+
65
+ - plugin storage API changes
66
+ - remove old search endpoint (return 404)
67
+ - filter local private packages at plugin level
68
+
69
+ The storage api changes for methods `get`, `add`, `remove` as promise base. The `search` methods also changes and recieves a `query` object that contains all query params from the client.
70
+
71
+ ```ts
72
+ export interface IPluginStorage<T> extends IPlugin {
73
+ add(name: string): Promise<void>;
74
+ remove(name: string): Promise<void>;
75
+ get(): Promise<any>;
76
+ init(): Promise<void>;
77
+ getSecret(): Promise<string>;
78
+ setSecret(secret: string): Promise<any>;
79
+ getPackageStorage(packageInfo: string): IPackageStorage;
80
+ search(query: searchUtils.SearchQuery): Promise<searchUtils.SearchItem[]>;
81
+ saveToken(token: Token): Promise<any>;
82
+ deleteToken(user: string, tokenKey: string): Promise<any>;
83
+ readTokens(filter: TokenFilter): Promise<Token[]>;
84
+ }
85
+ ```
86
+
87
+ - 9fc2e7961: feat(plugins): improve plugin loader
88
+
89
+ ### Changes
90
+
91
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
92
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
93
+ - https://github.com/verdaccio/verdaccio/issues/1394
94
+ - `config.plugins` plugin path validations
95
+ - Updated algorithm for plugin loader.
96
+ - improved documentation (included dev)
97
+
98
+ ## Features
99
+
100
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
101
+ - Custom prefix:
102
+
103
+ ```
104
+ // config.yaml
105
+ server:
106
+ pluginPrefix: mycompany
107
+ middleware:
108
+ audit:
109
+ foo: 1
110
+ ```
111
+
112
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
113
+
114
+ ## Breaking Changes
115
+
116
+ ### sinopia plugins
117
+
118
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
119
+
120
+ ### plugin filter
121
+
122
+ - method rename `filter_metadata`->`filterMetadata`
123
+
124
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
125
+
126
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
127
+
128
+ ```
129
+ // config.yaml
130
+ auth:
131
+ plugin:
132
+ foo: 1
133
+ bar: 2
134
+
135
+ export class Plugin<T> {
136
+ public constructor(config: T, options: PluginOptions) {
137
+ console.log(config);
138
+ // {foo:1, bar: 2}
139
+ }
140
+ }
141
+ ```
142
+
143
+ - 794af76c5: Remove Node 12 support
144
+
145
+ - We need move to the new `undici` and does not support Node.js 12
146
+
147
+ - 10aeb4f13: feat!: experiments config renamed to flags
148
+
149
+ - The `experiments` configuration is renamed to `flags`. The functionality is exactly the same.
150
+
151
+ ```js
152
+ flags: token: false;
153
+ search: false;
154
+ ```
155
+
156
+ - The `self_path` property from the config file is being removed in favor of `config_file` full path.
157
+ - Refactor `config` module, better types and utilities
158
+
159
+ - e367c3f1e: - Replace signature handler for legacy tokens by removing deprecated crypto.createDecipher by createCipheriv
160
+
161
+ - Introduce environment variables for legacy tokens
162
+
163
+ ### Code Improvements
164
+
165
+ - Add debug library for improve developer experience
166
+
167
+ ### Breaking change
168
+
169
+ - The new signature invalidates all previous tokens generated by Verdaccio 4 or previous versions.
170
+ - The secret key must have 32 characters long.
171
+
172
+ ### New environment variables
173
+
174
+ - `VERDACCIO_LEGACY_ALGORITHM`: Allows to define the specific algorithm for the token signature which by default is `aes-256-ctr`
175
+ - `VERDACCIO_LEGACY_ENCRYPTION_KEY`: By default, the token stores in the database, but using this variable allows to get it from memory
176
+
177
+ - 999787974: feat(web): components for custom user interfaces
178
+
179
+ Provides a package that includes all components from the user interface, instead being embedded at the `@verdaccio/ui-theme` package.
180
+
181
+ ```
182
+ npm i -D @verdaccio/ui-components
183
+ ```
184
+
185
+ The package contains
186
+
187
+ - Components
188
+ - Providers
189
+ - Redux Storage
190
+ - Layouts (precomposed layouts ready to use)
191
+ - Custom Material Theme
192
+
193
+ The `@verdaccio/ui-theme` will consume this package and will use only those are need it.
194
+
195
+ > Prerequisites are using Redux, Material-UI and Translations with `i18next`.
196
+
197
+ Users could have their own Material UI theme and build custom layouts, adding new features without the need to modify the default project.
198
+
199
+ - 82cb0f2bf: feat!: config.logs throw an error, logging config not longer accept array or logs property
200
+
201
+ ### 💥 Breaking change
202
+
203
+ This is valid
204
+
205
+ ```yaml
206
+ log: { type: stdout, format: pretty, level: http }
207
+ ```
208
+
209
+ This is invalid
210
+
211
+ ```yaml
212
+ logs: { type: stdout, format: pretty, level: http }
213
+ ```
214
+
215
+ or
216
+
217
+ ```yaml
218
+ logs:
219
+ - [{ type: stdout, format: pretty, level: http }]
220
+ ```
221
+
222
+ - 000d43746: feat: upgrade to material ui 5
223
+ - 8f43bf17d: feat: node api new structure based on promise
224
+
225
+ ```js
226
+ import { runServer } from "@verdaccio/node-api";
227
+ // or
228
+ import { runServer } from "verdaccio";
229
+
230
+ const app = await runServer(); // default configuration
231
+ const app = await runServer("./config/config.yaml");
232
+ const app = await runServer({ configuration });
233
+ app.listen(4000, (event) => {
234
+ // do something
235
+ });
236
+ ```
237
+
238
+ ### Breaking Change
239
+
240
+ If you are using the node-api, the new structure is Promise based and less arguments.
241
+
242
+ ### Minor Changes
243
+
244
+ - 0da7031e7: allow disable login on ui and endpoints
245
+
246
+ To be able disable the login, set `login: false`, anything else would enable login. This flag will disable access via UI and web endpoints.
247
+
248
+ ```yml
249
+ web:
250
+ title: verdaccio
251
+ login: false
252
+ ```
253
+
254
+ - 974cd8c19: fix: startup messages improved and logs support on types
255
+ - ef88da3b4: feat: improve support for fs promises older nodejs
256
+ - 631abe1ac: feat: refactor logger
257
+ - b61f762d6: feat: add server rate limit protection to all request
258
+
259
+ To modify custom values, use the server settings property.
260
+
261
+ ```markdown
262
+ server:
263
+
264
+ ## https://www.npmjs.com/package/express-rate-limit#configuration-options
265
+
266
+ rateLimit:
267
+ windowMs: 1000
268
+ max: 10000
269
+ ```
270
+
271
+ The values are intended to be high, if you want to improve security of your server consider
272
+ using different values.
273
+
274
+ - d43894e8f: feat: rework web header for mobile, add new settings and raw manifest button
275
+
276
+ ### New set of variables to hide features
277
+
278
+ Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
279
+ enabled by default_.
280
+
281
+ ```yaml
282
+ # login: true <-- already exist but worth the reminder
283
+ # showInfo: true
284
+ # showSettings: true
285
+ # In combination with darkMode you can force specific theme
286
+ # showThemeSwitch: true
287
+ # showFooter: true
288
+ # showSearch: true
289
+ # showDownloadTarball: true
290
+ ```
291
+
292
+ > If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
293
+ > ignored and force all themes to the one in the configuration file.
294
+
295
+ Future could be extended to
296
+
297
+ ### Raw button to display manifest package
298
+
299
+ A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
300
+
301
+ ```yaml
302
+ showRaw: true
303
+ ```
304
+
305
+ #### Rework header buttons
306
+
307
+ - The header has been rework, the mobile was not looking broken.
308
+ - Removed info button in the header and moved to a dialog
309
+ - Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
310
+ - Separate settings and info to avoid collapse too much info (for mobile still need some work)
311
+
312
+ - 154b2ecd3: refactor: remove @verdaccio/commons-api in favor @verdaccio/core and remove duplications
313
+ - aa763baec: feat: add typescript project references settings
314
+
315
+ Reading https://ebaytech.berlin/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440 I realized I can use project references to solve the issue to pre-compile modules on develop mode.
316
+
317
+ It allows to navigate (IDE) trough the packages without need compile the packages.
318
+
319
+ Add two `tsconfig`, one using the previous existing configuration that is able to produce declaration files (`tsconfig.build`) and a new one `tsconfig` which is enables [_projects references_](https://www.typescriptlang.org/docs/handbook/project-references.html).
320
+
321
+ - 16e38df8a: feat: trustProxy property
322
+ - dc571aabd: feat: add forceEnhancedLegacySignature
323
+ - 62c24b632: feat: add passwordValidationRegex property
324
+ - 5167bb528: feat: ui search support for remote, local and private packages
325
+
326
+ The command `npm search` search globally and return all matches, with this improvement the user interface
327
+ is powered with the same capabilities.
328
+
329
+ The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
330
+
331
+ - 5cf041a1a: feat: add dist.signatures to core/types
332
+
333
+ According to [`npm`](https://docs.npmjs.com/about-registry-signatures): _"Signatures are provided in the package's `packument` in each published version within the `dist` object"_
334
+
335
+ Here's an [example of a package version from the public npm registry with `dist.signatures`](https://registry.npmjs.org/light-cycle/1.4.3).
336
+
337
+ - 37274e4c8: feat: implement abbreviated manifest
338
+
339
+ Enable abbreviated manifest data by adding the header:
340
+
341
+ ```
342
+ curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
343
+ ```
344
+
345
+ It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
346
+
347
+ Current support for packages managers:
348
+
349
+ - npm: yes
350
+ - pnpm: yes
351
+ - yarn classic: yes
352
+ - yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
353
+
354
+ https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
355
+
356
+ - 45c03819e: refactor: render html middleware
357
+ - aecbd226d: web: allow ui hide package managers on sidebar
358
+
359
+ If there is a package manager of preference over others, you can define the package managers to be displayed on the detail page and sidebar, just define in the `config.yaml` and web section the list of package managers to be displayed.
360
+
361
+ ```
362
+ web:
363
+ title: Verdaccio
364
+ sort_packages: asc
365
+ primary_color: #cccccc
366
+ pkgManagers:
367
+ - pnpm
368
+ - yarn
369
+ # - npm
370
+ ```
371
+
372
+ To disable all package managers, just define empty:
373
+
374
+ ```
375
+ web:
376
+ title: Verdaccio
377
+ sort_packages: asc
378
+ primary_color: #cccccc
379
+ pkgManagers:
380
+ ```
381
+
382
+ and the section would be hidden.
383
+
384
+ ### Patch Changes
385
+
386
+ - 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
387
+ - 7ef599cc4: fix: missing version on footer
388
+ - 19d272d10: fix: restore logger on init
389
+
390
+ Enable logger after parse configuration and log the very first step on startup phase.
391
+
392
+ ```bash
393
+ warn --- experiments are enabled, it is recommended do not use experiments in production comment out this section to disable it
394
+ info --- support for experiment [token] is disabled
395
+ info --- support for experiment [search] is disabled
396
+ (node:50831) Warning: config.logs is deprecated, rename configuration to "config.log"
397
+ (Use `node --trace-warnings ...` to show where the warning was created)
398
+ info --- http address http://localhost:4873/
399
+ info --- version: 6.0.0-6-next.11
400
+ info --- server started
401
+ ```
402
+
403
+ - a610ef26b: chore: add release step to private regisry on merge changeset pr
404
+ - 4fc21146a: fix: missing logo on header
405
+ - 34f0f1101: Enable prerelease mode with **changesets**
406
+ - 68ea21214: ESLint Warnings Fixed
407
+
408
+ Related to issue #1461
409
+
410
+ - max-len: most of the sensible max-len errors are fixed
411
+ - no-unused-vars: most of these types of errors are fixed by deleting not needed declarations
412
+ - @typescript-eslint/no-unused-vars: same as above
413
+
414
+ - b849128de: fix: handle upload scoped tarball
415
+
3
416
  ## 11.0.0-6-next.25
4
417
 
5
418
  ### Minor Changes
@@ -407,14 +820,14 @@
407
820
  - 5c5057fc: feat: node api new structure based on promise
408
821
 
409
822
  ```js
410
- import { runServer } from '@verdaccio/node-api';
823
+ import { runServer } from "@verdaccio/node-api";
411
824
  // or
412
- import { runServer } from 'verdaccio';
825
+ import { runServer } from "verdaccio";
413
826
 
414
827
  const app = await runServer(); // default configuration
415
- const app = await runServer('./config/config.yaml');
828
+ const app = await runServer("./config/config.yaml");
416
829
  const app = await runServer({ configuration });
417
- app.listen(4000, event => {
830
+ app.listen(4000, (event) => {
418
831
  // do something
419
832
  });
420
833
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/types",
3
- "version": "11.0.0-6-next.25",
3
+ "version": "12.0.0-next-7.3",
4
4
  "description": "verdaccio types definitions",
5
5
  "keywords": [
6
6
  "private",
@@ -17,7 +17,7 @@
17
17
  "license": "MIT",
18
18
  "homepage": "https://verdaccio.org",
19
19
  "engines": {
20
- "node": ">=12"
20
+ "node": ">=18"
21
21
  },
22
22
  "repository": {
23
23
  "type": "https",
@@ -33,7 +33,6 @@
33
33
  "main": "src/types.ts",
34
34
  "types": "src/types.ts",
35
35
  "devDependencies": {
36
- "@types/node": "16.18.10",
37
36
  "typedoc": "0.23.25"
38
37
  },
39
38
  "typedoc": {
@@ -51,6 +50,5 @@
51
50
  "build:docs": "typedoc --options ./typedoc.json --tsconfig tsconfig.build.json",
52
51
  "type-check": "tsc --noEmit -p tsconfig.build.json",
53
52
  "build": "echo 0"
54
- },
55
- "readme": "# @verdaccio/types\n\nTypeScript definitions for Verdaccio plugins and internal code.\n"
53
+ }
56
54
  }
@@ -18,9 +18,6 @@ export type LoggerLevel = 'http' | 'fatal' | 'warn' | 'info' | 'debug' | 'trace'
18
18
 
19
19
  export type LoggerConfigItem = {
20
20
  type?: LoggerType;
21
- /**
22
- * The format
23
- */
24
21
  format?: LoggerFormat;
25
22
  path?: string;
26
23
  level?: string;
@@ -101,6 +98,7 @@ export type CommonWebConf = {
101
98
  showFooter?: boolean;
102
99
  showThemeSwitch?: boolean;
103
100
  showDownloadTarball?: boolean;
101
+ hideDeprecatedVersions?: boolean;
104
102
  primaryColor: string;
105
103
  showRaw?: boolean;
106
104
  };
@@ -153,18 +151,29 @@ export interface JWTOptions {
153
151
  verify: JWTVerifyOptions;
154
152
  }
155
153
 
154
+ export type Algorithm =
155
+ | 'HS256'
156
+ | 'HS384'
157
+ | 'HS512'
158
+ | 'RS256'
159
+ | 'RS384'
160
+ | 'RS512'
161
+ | 'ES256'
162
+ | 'ES384'
163
+ | 'ES512'
164
+ | 'PS256'
165
+ | 'PS384'
166
+ | 'PS512'
167
+ | 'none';
168
+
156
169
  export interface JWTSignOptions {
157
- algorithm?: string;
158
- expiresIn?: string;
159
- notBefore?: string;
160
- ignoreExpiration?: boolean;
161
- maxAge?: string | number;
162
- clockTimestamp?: number;
170
+ algorithm?: Algorithm | undefined;
171
+ expiresIn?: string | number | undefined;
172
+ notBefore?: string | number | undefined;
163
173
  }
164
174
 
165
175
  export interface JWTVerifyOptions {
166
- algorithm?: string;
167
- expiresIn?: string;
176
+ algorithm?: Algorithm | undefined;
168
177
  notBefore?: string | number;
169
178
  ignoreExpiration?: boolean;
170
179
  maxAge?: string | number;
@@ -173,11 +182,14 @@ export interface JWTVerifyOptions {
173
182
 
174
183
  export interface APITokenOptions {
175
184
  legacy: boolean;
185
+ /**
186
+ * Temporary flag to allow migration to the new legacy signature
187
+ */
188
+ migrateToSecureLegacySignature: boolean;
176
189
  jwt?: JWTOptions;
177
190
  }
178
191
 
179
192
  export interface Security {
180
- enhancedLegacySignature?: boolean;
181
193
  web: JWTOptions;
182
194
  api: APITokenOptions;
183
195
  }
@@ -287,7 +299,7 @@ export interface Config extends Omit<ConfigYaml, 'packages' | 'security' | 'conf
287
299
  // security object defaults is added by the config file but optional in the yaml file
288
300
  security: Security;
289
301
  // @deprecated (pending adding the replacement)
290
- checkSecretKey(token: string): string;
302
+ checkSecretKey(token: string | void): string;
291
303
  getMatchedPackagesSpec(storage: string): PackageAccess | void;
292
304
  // TODO: verify how to handle this in the future
293
305
  [key: string]: any;
package/src/manifest.ts CHANGED
@@ -3,7 +3,7 @@ export interface PackageAccess {
3
3
  publish?: string[];
4
4
  proxy?: string[];
5
5
  access?: string[];
6
- unpublish: string[];
6
+ unpublish?: string[];
7
7
  }
8
8
 
9
9
  export interface PackageList {