@verdaccio/types 11.0.0-6-next.17 → 11.0.0-6-next.18
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 +26 -0
- package/README.md +0 -23
- package/build/commons.d.ts +5 -5
- package/build/configuration.d.ts +16 -16
- package/build/manifest.d.ts +2 -2
- package/build/plugins/index.d.ts +0 -24
- package/build/plugins/storage.d.ts +8 -51
- package/build/search.d.ts +3 -3
- package/package.json +5 -6
- package/src/commons.ts +1 -1
- package/src/configuration.ts +1 -1
- package/src/plugins/index.ts +0 -30
- package/src/plugins/storage.ts +2 -51
- package/tsconfig.build.json +2 -1
- package/tsconfig.json +2 -1
- package/build/plugins/auth.d.ts +0 -21
- package/build/plugins/commons.d.ts +0 -11
- package/build/plugins/filter.d.ts +0 -5
- package/build/plugins/middleware.d.ts +0 -5
- package/build/plugins/theme.d.ts +0 -0
- package/src/plugins/auth.ts +0 -22
- package/src/plugins/commons.ts +0 -15
- package/src/plugins/filter.ts +0 -6
- package/src/plugins/middleware.ts +0 -8
- package/src/plugins/theme.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.0.0-6-next.18
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 99978797: feat(web): components for custom user interfaces
|
|
8
|
+
|
|
9
|
+
Provides a package that includes all components from the user interface, instead being embedded at the `@verdaccio/ui-theme` package.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm i -D @verdaccio/ui-components
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The package contains
|
|
16
|
+
|
|
17
|
+
- Components
|
|
18
|
+
- Providers
|
|
19
|
+
- Redux Storage
|
|
20
|
+
- Layouts (precomposed layouts ready to use)
|
|
21
|
+
- Custom Material Theme
|
|
22
|
+
|
|
23
|
+
The `@verdaccio/ui-theme` will consume this package and will use only those are need it.
|
|
24
|
+
|
|
25
|
+
> Prerequisites are using Redux, Material-UI and Translations with `i18next`.
|
|
26
|
+
|
|
27
|
+
Users could have their own Material UI theme and build custom layouts, adding new features without the need to modify the default project.
|
|
28
|
+
|
|
3
29
|
## 11.0.0-6-next.17
|
|
4
30
|
|
|
5
31
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
# @verdaccio/types
|
|
2
2
|
|
|
3
3
|
TypeScript definitions for Verdaccio plugins and internal code.
|
|
4
|
-
|
|
5
|
-
### Usage
|
|
6
|
-
|
|
7
|
-
```ts
|
|
8
|
-
import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';
|
|
9
|
-
|
|
10
|
-
class LocalData implements ILocalData {
|
|
11
|
-
path: string;
|
|
12
|
-
logger: Logger;
|
|
13
|
-
data: LocalStorage;
|
|
14
|
-
config: Config;
|
|
15
|
-
locked: boolean;
|
|
16
|
-
...
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Run docs
|
|
21
|
-
|
|
22
|
-
Generate the package types documentation at `./docs` folder.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm build:docs
|
|
26
|
-
```
|
package/build/commons.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type Callback = Function;
|
|
3
|
+
export type CallbackAction = (err: any | null) => void;
|
|
4
|
+
export type CallbackError = (err: NodeJS.ErrnoException) => void;
|
|
5
5
|
export interface RemoteUser {
|
|
6
6
|
real_groups: string[];
|
|
7
7
|
groups: string[];
|
|
8
8
|
name: string | void;
|
|
9
9
|
error?: string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type StringValue = string | void | null;
|
|
12
12
|
export interface HttpError extends Error {
|
|
13
13
|
status: number;
|
|
14
14
|
statusCode: number;
|
|
@@ -18,7 +18,7 @@ export interface HttpError extends Error {
|
|
|
18
18
|
};
|
|
19
19
|
[key: string]: any;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type URLPrefix = {
|
|
22
22
|
absolute: boolean;
|
|
23
23
|
basePath: string;
|
|
24
24
|
};
|
package/build/configuration.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageAccess, PackageList } from './manifest';
|
|
2
|
-
export
|
|
2
|
+
export type TypeToken = 'Bearer' | 'Basic';
|
|
3
3
|
export interface Logger {
|
|
4
4
|
child: (conf: any) => any;
|
|
5
5
|
debug: (conf: any, template?: string) => void;
|
|
@@ -9,10 +9,10 @@ export interface Logger {
|
|
|
9
9
|
warn: (conf: any, template?: string) => void;
|
|
10
10
|
info: (conf: any, template?: string) => void;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
12
|
+
export type LoggerType = 'stdout' | 'file';
|
|
13
|
+
export type LoggerFormat = 'pretty' | 'pretty-timestamped' | 'json';
|
|
14
|
+
export type LoggerLevel = 'http' | 'fatal' | 'warn' | 'info' | 'debug' | 'trace';
|
|
15
|
+
export type LoggerConfigItem = {
|
|
16
16
|
type?: LoggerType;
|
|
17
17
|
/**
|
|
18
18
|
* The format
|
|
@@ -59,16 +59,16 @@ export interface UpLinkConf {
|
|
|
59
59
|
strict_ssl?: boolean | void;
|
|
60
60
|
_autogenerated?: boolean;
|
|
61
61
|
}
|
|
62
|
-
export
|
|
62
|
+
export type RateLimit = {
|
|
63
63
|
windowMs?: number;
|
|
64
64
|
max?: number;
|
|
65
65
|
};
|
|
66
|
-
export
|
|
66
|
+
export type FlagsConfig = {
|
|
67
67
|
searchRemote?: boolean;
|
|
68
68
|
changePassword?: boolean;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
71
|
-
export
|
|
70
|
+
export type PackageManagers = 'pnpm' | 'yarn' | 'npm';
|
|
71
|
+
export type CommonWebConf = {
|
|
72
72
|
title?: string;
|
|
73
73
|
logo?: string;
|
|
74
74
|
favicon?: string;
|
|
@@ -84,7 +84,7 @@ export declare type CommonWebConf = {
|
|
|
84
84
|
/**
|
|
85
85
|
* Options are passed to the index.html
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type TemplateUIOptions = {
|
|
88
88
|
uri?: string;
|
|
89
89
|
darkMode?: boolean;
|
|
90
90
|
protocol?: string;
|
|
@@ -99,7 +99,7 @@ export declare type TemplateUIOptions = {
|
|
|
99
99
|
showDownloadTarball?: boolean;
|
|
100
100
|
showRaw?: boolean;
|
|
101
101
|
base: string;
|
|
102
|
-
primaryColor
|
|
102
|
+
primaryColor: string;
|
|
103
103
|
version?: string;
|
|
104
104
|
logoURI?: string;
|
|
105
105
|
flags: FlagsConfig;
|
|
@@ -107,7 +107,7 @@ export declare type TemplateUIOptions = {
|
|
|
107
107
|
/**
|
|
108
108
|
* Options on config.yaml for web
|
|
109
109
|
*/
|
|
110
|
-
export
|
|
110
|
+
export type WebConf = {
|
|
111
111
|
primary_color?: string;
|
|
112
112
|
enable?: boolean;
|
|
113
113
|
scriptsHead?: string[];
|
|
@@ -123,7 +123,7 @@ export interface AuthHtpasswd {
|
|
|
123
123
|
file: string;
|
|
124
124
|
max_users: number;
|
|
125
125
|
}
|
|
126
|
-
export
|
|
126
|
+
export type AuthConf = any | AuthHtpasswd;
|
|
127
127
|
export interface JWTOptions {
|
|
128
128
|
sign: JWTSignOptions;
|
|
129
129
|
verify: JWTVerifyOptions;
|
|
@@ -167,7 +167,7 @@ export interface HttpsConfPfx {
|
|
|
167
167
|
pfx: string;
|
|
168
168
|
passphrase?: string;
|
|
169
169
|
}
|
|
170
|
-
export
|
|
170
|
+
export type HttpsConf = HttpsConfKeyCert | HttpsConfPfx;
|
|
171
171
|
export interface Notifications {
|
|
172
172
|
method: string;
|
|
173
173
|
packagePattern: RegExp;
|
|
@@ -176,8 +176,8 @@ export interface Notifications {
|
|
|
176
176
|
content: string;
|
|
177
177
|
headers: Headers;
|
|
178
178
|
}
|
|
179
|
-
export
|
|
180
|
-
export
|
|
179
|
+
export type Notification = Notifications;
|
|
180
|
+
export type ServerSettingsConf = {
|
|
181
181
|
rateLimit: RateLimit;
|
|
182
182
|
keepAliveTimeout?: number;
|
|
183
183
|
/**
|
package/build/manifest.d.ts
CHANGED
|
@@ -194,14 +194,14 @@ export interface Manifest extends FullRemoteManifest, PublishManifest {
|
|
|
194
194
|
*/
|
|
195
195
|
_rev: string;
|
|
196
196
|
}
|
|
197
|
-
export
|
|
197
|
+
export type AbbreviatedVersion = Pick<Version, 'name' | 'version' | 'description' | 'dependencies' | 'devDependencies' | 'bin' | 'dist' | 'engines' | 'funding' | 'peerDependencies'>;
|
|
198
198
|
export interface AbbreviatedVersions {
|
|
199
199
|
[key: string]: AbbreviatedVersion;
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
202
|
*
|
|
203
203
|
*/
|
|
204
|
-
export
|
|
204
|
+
export type AbbreviatedManifest = Pick<Manifest, 'name' | 'dist-tags' | 'time'> & {
|
|
205
205
|
modified: string;
|
|
206
206
|
versions: AbbreviatedVersions;
|
|
207
207
|
};
|
package/build/plugins/index.d.ts
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
import { RemoteUser } from '../commons';
|
|
2
|
-
import { AllowAccess } from '../configuration';
|
|
3
|
-
import { PackageAccess } from '../manifest';
|
|
4
|
-
import { AuthAccessCallback, AuthCallback } from './auth';
|
|
5
|
-
import { IPlugin } from './commons';
|
|
6
|
-
export interface IPluginAuth<T> extends IPlugin<T> {
|
|
7
|
-
/**
|
|
8
|
-
* @param props user from Application component
|
|
9
|
-
*/
|
|
10
|
-
authenticate(user: string, password: string, cb: AuthCallback): void;
|
|
11
|
-
adduser?(user: string, password: string, cb: AuthCallback): void;
|
|
12
|
-
changePassword?(user: string, password: string, newPassword: string, cb: AuthCallback): void;
|
|
13
|
-
allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
14
|
-
allow_access?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
15
|
-
allow_unpublish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
16
|
-
allow_publish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
17
|
-
allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
18
|
-
allow_unpublish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
19
|
-
apiJWTmiddleware?(helpers: any): Function;
|
|
20
|
-
}
|
|
21
|
-
export * from './auth';
|
|
22
1
|
export * from './storage';
|
|
23
|
-
export * from './middleware';
|
|
24
|
-
export * from './commons';
|
|
25
|
-
export * from './filter';
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable, Writable } from 'stream';
|
|
3
1
|
import { Callback, CallbackAction } from '../commons';
|
|
4
|
-
import { Logger } from '../configuration';
|
|
5
2
|
import { Manifest, Token } from '../manifest';
|
|
6
|
-
|
|
7
|
-
export declare type StorageList = string[];
|
|
8
|
-
export interface LocalStorage {
|
|
9
|
-
list: any;
|
|
10
|
-
secret: string;
|
|
11
|
-
}
|
|
3
|
+
export type StorageList = string[];
|
|
12
4
|
export interface ILocalStorage {
|
|
13
5
|
add(name: string): void;
|
|
14
6
|
remove(name: string): void;
|
|
@@ -36,45 +28,10 @@ export interface ITokenActions {
|
|
|
36
28
|
* - it might return object (truly)
|
|
37
29
|
* - it might reutrn null
|
|
38
30
|
*/
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export interface ILocalPackageManager {
|
|
47
|
-
logger: Logger;
|
|
48
|
-
deletePackage(fileName: string): Promise<void>;
|
|
49
|
-
removePackage(): Promise<void>;
|
|
50
|
-
updatePackage(packageName: string, handleUpdate: (manifest: Manifest) => Promise<Manifest>): Promise<Manifest>;
|
|
51
|
-
readPackage(name: string): Promise<Manifest>;
|
|
52
|
-
savePackage(pkgName: string, value: Manifest): Promise<void>;
|
|
53
|
-
readTarball(pkgName: string, { signal }: {
|
|
54
|
-
signal: any;
|
|
55
|
-
}): Promise<Readable>;
|
|
56
|
-
createPackage(name: string, manifest: Manifest): Promise<void>;
|
|
57
|
-
writeTarball(tarballName: string, { signal }: {
|
|
58
|
-
signal: any;
|
|
59
|
-
}): Promise<Writable>;
|
|
60
|
-
hasTarball(fileName: string): Promise<boolean>;
|
|
61
|
-
hasPackage(): Promise<boolean>;
|
|
62
|
-
}
|
|
63
|
-
export declare type IPackageStorage = ILocalPackageManager | void;
|
|
64
|
-
export declare type IPluginStorage<T> = ILocalData<T>;
|
|
65
|
-
export declare type IPackageStorageManager = ILocalPackageManager;
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated use @verdaccio/core pluginUtils instead
|
|
68
|
-
*/
|
|
69
|
-
interface ILocalData<T> extends IPlugin<T>, ITokenActions {
|
|
70
|
-
logger: Logger;
|
|
71
|
-
config: T;
|
|
72
|
-
add(name: string): Promise<void>;
|
|
73
|
-
remove(name: string): Promise<void>;
|
|
74
|
-
get(): Promise<any>;
|
|
75
|
-
init(): Promise<void>;
|
|
76
|
-
getSecret(): Promise<string>;
|
|
77
|
-
setSecret(secret: string): Promise<any>;
|
|
78
|
-
getPackageStorage(packageInfo: string): IPackageStorage;
|
|
79
|
-
}
|
|
80
|
-
export {};
|
|
31
|
+
export type onSearchPackage = (item: Manifest, cb: CallbackAction) => void;
|
|
32
|
+
export type onEndSearchPackage = (error?: any) => void;
|
|
33
|
+
export type onValidatePackage = (name: string) => boolean;
|
|
34
|
+
export type StorageUpdateCallback = (data: Manifest, cb: CallbackAction) => void;
|
|
35
|
+
export type StorageWriteCallback = (name: string, json: Manifest, callback: Callback) => void;
|
|
36
|
+
export type PackageTransformer = (pkg: Manifest) => Manifest;
|
|
37
|
+
export type ReadPackageCallback = (err: any | null, data?: Manifest) => void;
|
package/build/search.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PublisherMaintainer = {
|
|
2
2
|
username: string;
|
|
3
3
|
email: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type SearchPackageBody = {
|
|
6
6
|
name: string;
|
|
7
7
|
scope: string;
|
|
8
8
|
description: string;
|
|
@@ -19,7 +19,7 @@ export declare type SearchPackageBody = {
|
|
|
19
19
|
publisher?: any;
|
|
20
20
|
maintainers?: PublisherMaintainer[];
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type SearchResultWeb = {
|
|
23
23
|
name: string;
|
|
24
24
|
version: string;
|
|
25
25
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/types",
|
|
3
|
-
"version": "11.0.0-6-next.
|
|
3
|
+
"version": "11.0.0-6-next.18",
|
|
4
4
|
"description": "verdaccio types definitions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"private",
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
"main": "build/types.d.ts",
|
|
35
35
|
"types": "build/types.d.ts",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "16.
|
|
38
|
-
"typedoc": "
|
|
39
|
-
"typedoc-plugin-missing-exports": "1.0.0"
|
|
37
|
+
"@types/node": "16.18.10",
|
|
38
|
+
"typedoc": "0.23.23"
|
|
40
39
|
},
|
|
41
40
|
"typedoc": {
|
|
42
41
|
"entryPoint": "./src/types.ts",
|
|
@@ -50,9 +49,9 @@
|
|
|
50
49
|
"scripts": {
|
|
51
50
|
"clean": "rimraf ./build",
|
|
52
51
|
"test": "pnpm type-check",
|
|
53
|
-
"build:docs": "typedoc --options ./typedoc.json --
|
|
52
|
+
"build:docs": "typedoc --options ./typedoc.json --tsconfig tsconfig.build.json",
|
|
54
53
|
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
55
54
|
"build": "tsc --emitDeclarationOnly -p tsconfig.build.json"
|
|
56
55
|
},
|
|
57
|
-
"readme": "# @verdaccio/types\n\nTypeScript definitions for Verdaccio plugins and internal code.\n
|
|
56
|
+
"readme": "# @verdaccio/types\n\nTypeScript definitions for Verdaccio plugins and internal code.\n"
|
|
58
57
|
}
|
package/src/commons.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface RemoteUser {
|
|
|
15
15
|
export type StringValue = string | void | null;
|
|
16
16
|
|
|
17
17
|
// FIXME: error should be export type `VerdaccioError = HttpError & { code: number };`
|
|
18
|
-
// instead of
|
|
18
|
+
// instead of VerdaccioError
|
|
19
19
|
// but this type is on @verdaccio/core and cannot be used here yet (I don't know why)
|
|
20
20
|
export interface HttpError extends Error {
|
|
21
21
|
status: number;
|
package/src/configuration.ts
CHANGED
package/src/plugins/index.ts
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
import { RemoteUser } from '../commons';
|
|
2
|
-
import { AllowAccess } from '../configuration';
|
|
3
|
-
import { PackageAccess } from '../manifest';
|
|
4
|
-
import { AuthAccessCallback, AuthCallback } from './auth';
|
|
5
|
-
import { IPlugin } from './commons';
|
|
6
|
-
|
|
7
|
-
export interface IPluginAuth<T> extends IPlugin<T> {
|
|
8
|
-
/**
|
|
9
|
-
* @param props user from Application component
|
|
10
|
-
*/
|
|
11
|
-
authenticate(user: string, password: string, cb: AuthCallback): void;
|
|
12
|
-
adduser?(user: string, password: string, cb: AuthCallback): void;
|
|
13
|
-
changePassword?(user: string, password: string, newPassword: string, cb: AuthCallback): void;
|
|
14
|
-
allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
15
|
-
allow_access?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
16
|
-
allow_unpublish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
|
|
17
|
-
allow_publish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
18
|
-
allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
|
|
19
|
-
allow_unpublish?(
|
|
20
|
-
user: RemoteUser,
|
|
21
|
-
pkg: AllowAccess & PackageAccess,
|
|
22
|
-
cb: AuthAccessCallback
|
|
23
|
-
): void;
|
|
24
|
-
apiJWTmiddleware?(helpers: any): Function;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export * from './auth';
|
|
28
1
|
export * from './storage';
|
|
29
|
-
export * from './middleware';
|
|
30
|
-
export * from './commons';
|
|
31
|
-
export * from './filter';
|
package/src/plugins/storage.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Callback, CallbackAction, StringValue } from '../commons';
|
|
4
|
-
import { Config, Logger } from '../configuration';
|
|
5
|
-
import { Manifest, MergeTags, Token, Version } from '../manifest';
|
|
6
|
-
import { IPlugin } from './commons';
|
|
1
|
+
import { Callback, CallbackAction } from '../commons';
|
|
2
|
+
import { Manifest, Token } from '../manifest';
|
|
7
3
|
|
|
8
4
|
export type StorageList = string[];
|
|
9
5
|
|
|
10
|
-
export interface LocalStorage {
|
|
11
|
-
list: any;
|
|
12
|
-
secret: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
6
|
export interface ILocalStorage {
|
|
16
7
|
add(name: string): void;
|
|
17
8
|
remove(name: string): void;
|
|
@@ -53,43 +44,3 @@ export type StorageUpdateCallback = (data: Manifest, cb: CallbackAction) => void
|
|
|
53
44
|
export type StorageWriteCallback = (name: string, json: Manifest, callback: Callback) => void;
|
|
54
45
|
export type PackageTransformer = (pkg: Manifest) => Manifest;
|
|
55
46
|
export type ReadPackageCallback = (err: any | null, data?: Manifest) => void;
|
|
56
|
-
|
|
57
|
-
export interface ILocalPackageManager {
|
|
58
|
-
logger: Logger;
|
|
59
|
-
deletePackage(fileName: string): Promise<void>;
|
|
60
|
-
removePackage(): Promise<void>;
|
|
61
|
-
// next packages migration (this list is meant to replace the callback parent functions)
|
|
62
|
-
updatePackage(
|
|
63
|
-
packageName: string,
|
|
64
|
-
handleUpdate: (manifest: Manifest) => Promise<Manifest>
|
|
65
|
-
): Promise<Manifest>;
|
|
66
|
-
readPackage(name: string): Promise<Manifest>;
|
|
67
|
-
savePackage(pkgName: string, value: Manifest): Promise<void>;
|
|
68
|
-
readTarball(pkgName: string, { signal }): Promise<Readable>;
|
|
69
|
-
createPackage(name: string, manifest: Manifest): Promise<void>;
|
|
70
|
-
writeTarball(tarballName: string, { signal }): Promise<Writable>;
|
|
71
|
-
// verify if tarball exist in the storage
|
|
72
|
-
hasTarball(fileName: string): Promise<boolean>;
|
|
73
|
-
// verify if package exist in the storage
|
|
74
|
-
hasPackage(): Promise<boolean>;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type IPackageStorage = ILocalPackageManager | void;
|
|
78
|
-
|
|
79
|
-
export type IPluginStorage<T> = ILocalData<T>;
|
|
80
|
-
export type IPackageStorageManager = ILocalPackageManager;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated use @verdaccio/core pluginUtils instead
|
|
84
|
-
*/
|
|
85
|
-
interface ILocalData<T> extends IPlugin<T>, ITokenActions {
|
|
86
|
-
logger: Logger;
|
|
87
|
-
config: T;
|
|
88
|
-
add(name: string): Promise<void>;
|
|
89
|
-
remove(name: string): Promise<void>;
|
|
90
|
-
get(): Promise<any>;
|
|
91
|
-
init(): Promise<void>;
|
|
92
|
-
getSecret(): Promise<string>;
|
|
93
|
-
setSecret(secret: string): Promise<any>;
|
|
94
|
-
getPackageStorage(packageInfo: string): IPackageStorage;
|
|
95
|
-
}
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
package/build/plugins/auth.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Callback, HttpError, RemoteUser } from '../commons';
|
|
3
|
-
import { Config } from '../configuration';
|
|
4
|
-
export interface AuthPluginPackage {
|
|
5
|
-
packageName: string;
|
|
6
|
-
packageVersion?: string;
|
|
7
|
-
tag?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare type AuthError = HttpError & {
|
|
10
|
-
code: number;
|
|
11
|
-
};
|
|
12
|
-
export declare type AuthAccessCallback = (error: AuthError | null, access: boolean) => void;
|
|
13
|
-
export declare type AuthCallback = (error: AuthError | null, groups: string[] | false) => void;
|
|
14
|
-
export interface IBasicAuth<T> {
|
|
15
|
-
config: T & Config;
|
|
16
|
-
aesEncrypt(buf: Buffer): Buffer;
|
|
17
|
-
authenticate(user: string, password: string, cb: Callback): void;
|
|
18
|
-
changePassword(user: string, password: string, newPassword: string, cb: Callback): void;
|
|
19
|
-
allow_access(pkg: AuthPluginPackage, user: RemoteUser, callback: Callback): void;
|
|
20
|
-
add_user(user: string, password: string, cb: Callback): any;
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Config, Logger } from '../configuration';
|
|
2
|
-
export declare class Plugin<T> {
|
|
3
|
-
constructor(config: T, options: PluginOptions);
|
|
4
|
-
}
|
|
5
|
-
export interface IPlugin<T> {
|
|
6
|
-
version?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface PluginOptions {
|
|
9
|
-
config: Config;
|
|
10
|
-
logger: Logger;
|
|
11
|
-
}
|
package/build/plugins/theme.d.ts
DELETED
|
File without changes
|
package/src/plugins/auth.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Callback, HttpError, RemoteUser } from '../commons';
|
|
2
|
-
import { Config } from '../configuration';
|
|
3
|
-
|
|
4
|
-
export interface AuthPluginPackage {
|
|
5
|
-
packageName: string;
|
|
6
|
-
packageVersion?: string;
|
|
7
|
-
tag?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type AuthError = HttpError & { code: number };
|
|
11
|
-
export type AuthAccessCallback = (error: AuthError | null, access: boolean) => void;
|
|
12
|
-
export type AuthCallback = (error: AuthError | null, groups: string[] | false) => void;
|
|
13
|
-
|
|
14
|
-
// @deprecated use IBasicAuth from @verdaccio/auth
|
|
15
|
-
export interface IBasicAuth<T> {
|
|
16
|
-
config: T & Config;
|
|
17
|
-
aesEncrypt(buf: Buffer): Buffer;
|
|
18
|
-
authenticate(user: string, password: string, cb: Callback): void;
|
|
19
|
-
changePassword(user: string, password: string, newPassword: string, cb: Callback): void;
|
|
20
|
-
allow_access(pkg: AuthPluginPackage, user: RemoteUser, callback: Callback): void;
|
|
21
|
-
add_user(user: string, password: string, cb: Callback): any;
|
|
22
|
-
}
|
package/src/plugins/commons.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Config, Logger } from '../configuration';
|
|
2
|
-
|
|
3
|
-
export class Plugin<T> {
|
|
4
|
-
public constructor(config: T, options: PluginOptions) {}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface IPlugin<T> {
|
|
8
|
-
// TODO: not used on core yet
|
|
9
|
-
version?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface PluginOptions {
|
|
13
|
-
config: Config;
|
|
14
|
-
logger: Logger;
|
|
15
|
-
}
|
package/src/plugins/filter.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Config } from '../configuration';
|
|
2
|
-
import { IBasicAuth } from './auth';
|
|
3
|
-
import { IPlugin } from './commons';
|
|
4
|
-
|
|
5
|
-
// TODO: convert to generic storage should come from implementation
|
|
6
|
-
export interface IPluginMiddleware<T, K> extends IPlugin<T> {
|
|
7
|
-
register_middlewares(app: any, auth: IBasicAuth<T>, storage: K): void;
|
|
8
|
-
}
|
package/src/plugins/theme.ts
DELETED
|
File without changes
|