@verdaccio/types 11.0.0-6-next.16 → 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 CHANGED
@@ -1,5 +1,95 @@
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
+
29
+ ## 11.0.0-6-next.17
30
+
31
+ ### Major Changes
32
+
33
+ - 9fc2e796: feat(plugins): improve plugin loader
34
+
35
+ ### Changes
36
+
37
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
38
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
39
+ - https://github.com/verdaccio/verdaccio/issues/1394
40
+ - `config.plugins` plugin path validations
41
+ - Updated algorithm for plugin loader.
42
+ - improved documentation (included dev)
43
+
44
+ ## Features
45
+
46
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
47
+ - Custom prefix:
48
+
49
+ ```
50
+ // config.yaml
51
+ server:
52
+ pluginPrefix: mycompany
53
+ middleware:
54
+ audit:
55
+ foo: 1
56
+ ```
57
+
58
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
59
+
60
+ ## Breaking Changes
61
+
62
+ ### sinopia plugins
63
+
64
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
65
+
66
+ ### plugin filter
67
+
68
+ - method rename `filter_metadata`->`filterMetadata`
69
+
70
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
71
+
72
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
73
+
74
+ ```
75
+ // config.yaml
76
+ auth:
77
+ plugin:
78
+ foo: 1
79
+ bar: 2
80
+
81
+ export class Plugin<T> {
82
+ public constructor(config: T, options: PluginOptions) {
83
+ console.log(config);
84
+ // {foo:1, bar: 2}
85
+ }
86
+ }
87
+ ```
88
+
89
+ ### Minor Changes
90
+
91
+ - 62c24b63: feat: add passwordValidationRegex property
92
+
3
93
  ## 11.0.0-6-next.16
4
94
 
5
95
  ### Patch 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
- ```
@@ -1,14 +1,14 @@
1
1
  /// <reference types="node" />
2
- export declare type Callback = Function;
3
- export declare type CallbackAction = (err: any | null) => void;
4
- export declare type CallbackError = (err: NodeJS.ErrnoException) => void;
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 declare type StringValue = string | void | null;
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 declare type URLPrefix = {
21
+ export type URLPrefix = {
22
22
  absolute: boolean;
23
23
  basePath: string;
24
24
  };
@@ -1,5 +1,5 @@
1
1
  import { PackageAccess, PackageList } from './manifest';
2
- export declare type TypeToken = 'Bearer' | 'Basic';
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 declare type LoggerType = 'stdout' | 'file';
13
- export declare type LoggerFormat = 'pretty' | 'pretty-timestamped' | 'json';
14
- export declare type LoggerLevel = 'http' | 'fatal' | 'warn' | 'info' | 'debug' | 'trace';
15
- export declare type LoggerConfigItem = {
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 declare type RateLimit = {
62
+ export type RateLimit = {
63
63
  windowMs?: number;
64
64
  max?: number;
65
65
  };
66
- export declare type FlagsConfig = {
66
+ export type FlagsConfig = {
67
67
  searchRemote?: boolean;
68
68
  changePassword?: boolean;
69
69
  };
70
- export declare type PackageManagers = 'pnpm' | 'yarn' | 'npm';
71
- export declare type CommonWebConf = {
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 declare type TemplateUIOptions = {
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?: string;
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 declare type WebConf = {
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 declare type AuthConf = any | AuthHtpasswd;
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 declare type HttpsConf = HttpsConfKeyCert | HttpsConfPfx;
170
+ export type HttpsConf = HttpsConfKeyCert | HttpsConfPfx;
171
171
  export interface Notifications {
172
172
  method: string;
173
173
  packagePattern: RegExp;
@@ -176,10 +176,18 @@ export interface Notifications {
176
176
  content: string;
177
177
  headers: Headers;
178
178
  }
179
- export declare type Notification = Notifications;
180
- export declare type ServerSettingsConf = {
179
+ export type Notification = Notifications;
180
+ export type ServerSettingsConf = {
181
181
  rateLimit: RateLimit;
182
182
  keepAliveTimeout?: number;
183
+ /**
184
+ * Plugins should be prefixed verdaccio-XXXXXX by default.
185
+ * To override the default prefix, use this property without `-`
186
+ * If you set pluginPrefix: acme, the packages to resolve will be
187
+ * acme-XXXXXX
188
+ */
189
+ pluginPrefix?: string;
190
+ passwordValidationRegex?: RegExp;
183
191
  };
184
192
  /**
185
193
  * YAML configuration file available options.
@@ -198,7 +206,7 @@ export interface ConfigYaml {
198
206
  listen?: ListenAddress;
199
207
  https?: HttpsConf;
200
208
  http_proxy?: string;
201
- plugins?: string | void;
209
+ plugins?: string | void | null;
202
210
  https_proxy?: string;
203
211
  no_proxy?: string;
204
212
  max_body_size?: string;
@@ -213,7 +221,7 @@ export interface ConfigYaml {
213
221
  configPath?: string;
214
222
  }
215
223
  /**
216
- * Configuration object with additonal methods for configuration, includes yaml and internal medatada.
224
+ * Configuration object with additional methods for configuration, includes yaml and internal medatada.
217
225
  * @interface Config
218
226
  * @extends {ConfigYaml}
219
227
  */
@@ -194,14 +194,14 @@ export interface Manifest extends FullRemoteManifest, PublishManifest {
194
194
  */
195
195
  _rev: string;
196
196
  }
197
- export declare type AbbreviatedVersion = Pick<Version, 'name' | 'version' | 'description' | 'dependencies' | 'devDependencies' | 'bin' | 'dist' | 'engines' | 'funding' | 'peerDependencies'>;
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 declare type AbbreviatedManifest = Pick<Manifest, 'name' | 'dist-tags' | 'time'> & {
204
+ export type AbbreviatedManifest = Pick<Manifest, 'name' | 'dist-tags' | 'time'> & {
205
205
  modified: string;
206
206
  versions: AbbreviatedVersions;
207
207
  };
@@ -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 { Config, Logger } from '../configuration';
5
2
  import { Manifest, Token } from '../manifest';
6
- import { IPlugin } from './commons';
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 declare type onSearchPackage = (item: Manifest, cb: CallbackAction) => void;
40
- export declare type onEndSearchPackage = (error?: any) => void;
41
- export declare type onValidatePackage = (name: string) => boolean;
42
- export declare type StorageUpdateCallback = (data: Manifest, cb: CallbackAction) => void;
43
- export declare type StorageWriteCallback = (name: string, json: Manifest, callback: Callback) => void;
44
- export declare type PackageTransformer = (pkg: Manifest) => Manifest;
45
- export declare type ReadPackageCallback = (err: any | null, data?: Manifest) => void;
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 & Config;
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 declare type PublisherMaintainer = {
1
+ export type PublisherMaintainer = {
2
2
  username: string;
3
3
  email: string;
4
4
  };
5
- export declare type SearchPackageBody = {
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 declare type SearchResultWeb = {
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.16",
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.11.56",
38
- "typedoc": "beta",
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 --excludeExternals --tsconfig tsconfig.build.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\n### Usage\n\n```ts\nimport type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';\n\nclass LocalData implements ILocalData {\n path: string;\n logger: Logger;\n data: LocalStorage;\n config: Config;\n locked: boolean;\n ...\n}\n```\n\n### Run docs\n\nGenerate the package types documentation at `./docs` folder.\n\n```bash\n pnpm build:docs\n```\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 AuthError
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;
@@ -126,7 +126,7 @@ export type TemplateUIOptions = {
126
126
  showDownloadTarball?: boolean;
127
127
  showRaw?: boolean;
128
128
  base: string;
129
- primaryColor?: string;
129
+ primaryColor: string;
130
130
  version?: string;
131
131
  logoURI?: string;
132
132
  flags: FlagsConfig;
@@ -226,6 +226,14 @@ export type ServerSettingsConf = {
226
226
  // express-rate-limit settings
227
227
  rateLimit: RateLimit;
228
228
  keepAliveTimeout?: number;
229
+ /**
230
+ * Plugins should be prefixed verdaccio-XXXXXX by default.
231
+ * To override the default prefix, use this property without `-`
232
+ * If you set pluginPrefix: acme, the packages to resolve will be
233
+ * acme-XXXXXX
234
+ */
235
+ pluginPrefix?: string;
236
+ passwordValidationRegex?: RegExp;
229
237
  };
230
238
 
231
239
  /**
@@ -245,7 +253,7 @@ export interface ConfigYaml {
245
253
  listen?: ListenAddress;
246
254
  https?: HttpsConf;
247
255
  http_proxy?: string;
248
- plugins?: string | void;
256
+ plugins?: string | void | null;
249
257
  https_proxy?: string;
250
258
  no_proxy?: string;
251
259
  max_body_size?: string;
@@ -264,7 +272,7 @@ export interface ConfigYaml {
264
272
  }
265
273
 
266
274
  /**
267
- * Configuration object with additonal methods for configuration, includes yaml and internal medatada.
275
+ * Configuration object with additional methods for configuration, includes yaml and internal medatada.
268
276
  * @interface Config
269
277
  * @extends {ConfigYaml}
270
278
  */
@@ -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';
@@ -1,17 +1,8 @@
1
- import { PassThrough, PipelinePromise, Readable, Stream, Writable } from 'stream';
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 & Config;
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
- }
@@ -2,7 +2,8 @@
2
2
  "extends": "../../../tsconfig.base.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": "./src",
5
- "outDir": "./build"
5
+ "outDir": "./build",
6
+ "noImplicitAny": true
6
7
  },
7
8
  "include": ["src/**/*"],
8
9
  "exclude": ["src/**/*.test.ts"]
package/tsconfig.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "extends": "../../../tsconfig.reference.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": "./src",
5
- "outDir": "./build"
5
+ "outDir": "./build",
6
+ "noImplicitAny": true
6
7
  },
7
8
  "include": ["src/**/*"],
8
9
  "exclude": ["src/**/*.test.ts"]
@@ -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<T>);
4
- }
5
- export interface IPlugin<T> {
6
- version?: string;
7
- }
8
- export interface PluginOptions<T> {
9
- config: T & Config;
10
- logger: Logger;
11
- }
@@ -1,5 +0,0 @@
1
- import { Manifest } from '../manifest';
2
- import { IPlugin } from './commons';
3
- export interface IPluginStorageFilter<T> extends IPlugin<T> {
4
- filter_metadata(packageInfo: Manifest): Promise<Manifest>;
5
- }
@@ -1,5 +0,0 @@
1
- import { IBasicAuth } from './auth';
2
- import { IPlugin } from './commons';
3
- export interface IPluginMiddleware<T, K> extends IPlugin<T> {
4
- register_middlewares(app: any, auth: IBasicAuth<T>, storage: K): void;
5
- }
File without changes
@@ -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
- }
@@ -1,15 +0,0 @@
1
- import { Config, Logger } from '../configuration';
2
-
3
- export class Plugin<T> {
4
- public constructor(config: T, options: PluginOptions<T>) {}
5
- }
6
-
7
- export interface IPlugin<T> {
8
- // TODO: not used on core yet
9
- version?: string;
10
- }
11
-
12
- export interface PluginOptions<T> {
13
- config: T & Config;
14
- logger: Logger;
15
- }
@@ -1,6 +0,0 @@
1
- import { Manifest } from '../manifest';
2
- import { IPlugin } from './commons';
3
-
4
- export interface IPluginStorageFilter<T> extends IPlugin<T> {
5
- filter_metadata(packageInfo: Manifest): Promise<Manifest>;
6
- }
@@ -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
- }
File without changes