@verdaccio/types 10.1.0 → 10.3.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/CHANGELOG.md +24 -0
- package/index.d.ts +36 -5
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 803c518: chore: update core dependencies
|
|
8
|
+
|
|
9
|
+
## 10.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9ca52a7: fix: move userRateLimit to config body
|
|
14
|
+
|
|
15
|
+
## 10.2.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 254a282: fix: user_agent can be also string
|
|
20
|
+
|
|
21
|
+
## 10.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 96b62c8: feat: add rate limit and convert user agent type to boolean
|
|
26
|
+
|
|
3
27
|
## 10.1.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/index.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ declare module '@verdaccio/types' {
|
|
|
293
293
|
favicon?: string;
|
|
294
294
|
gravatar?: boolean;
|
|
295
295
|
sort_packages?: string;
|
|
296
|
+
rateLimit?: RateLimit;
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
interface HttpsConfKeyCert {
|
|
@@ -336,15 +337,27 @@ declare module '@verdaccio/types' {
|
|
|
336
337
|
jwt?: JWTOptions;
|
|
337
338
|
}
|
|
338
339
|
|
|
340
|
+
type RateLimit = {
|
|
341
|
+
windowMs?: number;
|
|
342
|
+
max?: number;
|
|
343
|
+
};
|
|
344
|
+
|
|
339
345
|
interface Security {
|
|
340
346
|
web: JWTOptions;
|
|
341
347
|
api: APITokenOptions;
|
|
342
348
|
}
|
|
343
349
|
|
|
350
|
+
type Server = {
|
|
351
|
+
keepAliveTimeout?: number;
|
|
352
|
+
rateLimit: RateLimit;
|
|
353
|
+
};
|
|
354
|
+
|
|
344
355
|
interface Config {
|
|
345
|
-
user_agent
|
|
356
|
+
user_agent?: string | boolean;
|
|
357
|
+
userRateLimit: RateLimit;
|
|
346
358
|
server_id: any;
|
|
347
359
|
_debug?: boolean;
|
|
360
|
+
server?: Server;
|
|
348
361
|
storage?: string | void;
|
|
349
362
|
plugins?: string | void;
|
|
350
363
|
secret: string;
|
|
@@ -410,7 +423,11 @@ declare module '@verdaccio/types' {
|
|
|
410
423
|
getSecret(): Promise<string>;
|
|
411
424
|
setSecret(secret: string): Promise<any>;
|
|
412
425
|
getPackageStorage(packageInfo: string): IPackageStorage;
|
|
413
|
-
search(
|
|
426
|
+
search(
|
|
427
|
+
onPackage: onSearchPackage,
|
|
428
|
+
onEnd: onEndSearchPackage,
|
|
429
|
+
validateName: onValidatePackage
|
|
430
|
+
): void;
|
|
414
431
|
}
|
|
415
432
|
|
|
416
433
|
type StorageUpdateCallback = (data: Package, cb: CallbackAction) => void;
|
|
@@ -444,7 +461,13 @@ declare module '@verdaccio/types' {
|
|
|
444
461
|
}
|
|
445
462
|
|
|
446
463
|
interface StoragePackageActions extends TarballActions {
|
|
447
|
-
addVersion(
|
|
464
|
+
addVersion(
|
|
465
|
+
name: string,
|
|
466
|
+
version: string,
|
|
467
|
+
metadata: Version,
|
|
468
|
+
tag: StringValue,
|
|
469
|
+
callback: Callback
|
|
470
|
+
): void;
|
|
448
471
|
mergeTags(name: string, tags: MergeTags, callback: Callback): void;
|
|
449
472
|
removePackage(name: string, callback: Callback): void;
|
|
450
473
|
changePackage(name: string, metadata: Package, revision: string, callback: Callback): void;
|
|
@@ -521,9 +544,17 @@ declare module '@verdaccio/types' {
|
|
|
521
544
|
allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
522
545
|
allow_access?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
523
546
|
allow_unpublish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
524
|
-
allow_publish?(
|
|
547
|
+
allow_publish?(
|
|
548
|
+
user: RemoteUser,
|
|
549
|
+
pkg: AllowAccess & PackageAccess,
|
|
550
|
+
cb: AuthAccessCallback
|
|
551
|
+
): void;
|
|
525
552
|
allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
526
|
-
allow_unpublish?(
|
|
553
|
+
allow_unpublish?(
|
|
554
|
+
user: RemoteUser,
|
|
555
|
+
pkg: AllowAccess & PackageAccess,
|
|
556
|
+
cb: AuthAccessCallback
|
|
557
|
+
): void;
|
|
527
558
|
apiJWTmiddleware?(helpers: any): Function;
|
|
528
559
|
}
|
|
529
560
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/types",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "verdaccio types definitions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"verdaccio",
|
|
@@ -33,5 +33,6 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"test": "exit 0",
|
|
35
35
|
"build": "exit 0"
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"readme": "# Typescript types for Verdaccio\n\nTypescript definitions for verdaccio plugins and internal code\n\n# Typescript\nFor usage with the library, the `tsconfig.json` should looks like this.\n\n```\n//tsconfig.json\n{\n \"compilerOptions\": {\n \"target\": \"esnext\",\n \"module\": \"commonjs\",\n \"declaration\": true,\n \"noImplicitAny\": false,\n \"strict\": true,\n \"outDir\": \"lib\",\n \"allowSyntheticDefaultImports\": true,\n \"esModuleInterop\": true,\n \"typeRoots\": [\n \"./node_modules/@verdaccio/types/lib/verdaccio\",\n \"./node_modules/@types\"\n ]\n },\n \"include\": [\n \"src/*.ts\",\n \"types/*.d.ts\"\n ]\n}\n```\n\n### Imports\n\n```\nimport type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';\n\n class LocalData implements ILocalData {\n\n path: string;\n logger: Logger;\n data: LocalStorage;\n config: Config;\n locked: boolean;\n ...\n}\n```\n\n\n"
|
|
37
38
|
}
|