@verdaccio/types 10.4.2 → 10.5.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 CHANGED
@@ -1,8 +1,9 @@
1
- # Typescript types for Verdaccio
1
+ # Typescript types
2
2
 
3
3
  Typescript definitions for verdaccio plugins and internal code
4
4
 
5
- # Typescript
5
+ ## Usage
6
+
6
7
  For usage with the library, the `tsconfig.json` should looks like this.
7
8
 
8
9
  ```
@@ -29,9 +30,9 @@ For usage with the library, the `tsconfig.json` should looks like this.
29
30
  }
30
31
  ```
31
32
 
32
- ### Imports
33
+ ### Example
33
34
 
34
- ```
35
+ ```typescript
35
36
  import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';
36
37
 
37
38
  class LocalData implements ILocalData {
@@ -45,4 +46,4 @@ import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';
45
46
  }
46
47
  ```
47
48
 
48
-
49
+ #### Plugins
@@ -0,0 +1,4 @@
1
+ export * from './plugins';
2
+ export * from './manifest';
3
+ export * from './commons';
4
+ export * from './configuration';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/types",
3
- "version": "10.4.2",
3
+ "version": "10.5.0",
4
4
  "description": "verdaccio types definitions",
5
5
  "keywords": [
6
6
  "verdaccio",
@@ -10,6 +10,9 @@
10
10
  "author": "Juan Picado <juanpicado19@gmail.com>",
11
11
  "license": "MIT",
12
12
  "homepage": "https://verdaccio.org",
13
+ "files": [
14
+ "./build"
15
+ ],
13
16
  "repository": {
14
17
  "type": "git",
15
18
  "url": "https://github.com/verdaccio/monorepo",
@@ -21,18 +24,23 @@
21
24
  "publishConfig": {
22
25
  "access": "public"
23
26
  },
24
- "main": "index.d.ts",
25
- "types": "index.d.ts",
27
+ "main": "build/types.d.ts",
28
+ "types": "build/types.d.ts",
26
29
  "devDependencies": {
27
- "@types/node": "14.18.0"
30
+ "@types/node": "12.12.6",
31
+ "typedoc": "^0.22.17",
32
+ "typedoc-plugin-missing-exports": "^0.22.6",
33
+ "typedoc-umlclass": "^0.6.1"
28
34
  },
29
35
  "funding": {
30
36
  "type": "opencollective",
31
37
  "url": "https://opencollective.com/verdaccio"
32
38
  },
33
39
  "scripts": {
40
+ "clean": "rimraf ./build",
34
41
  "test": "exit 0",
35
- "build": "exit 0"
42
+ "build": "tsc --emitDeclarationOnly -p tsconfig.json",
43
+ "docs": "typedoc --options ./typedoc.json --excludeExternals"
36
44
  },
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"
45
+ "readme": "# Typescript types\n\nTypescript definitions for verdaccio plugins and internal code\n\n## Usage\n\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### Example\n\n```typescript\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#### Plugins\n"
38
46
  }
package/CHANGELOG.md DELETED
@@ -1,556 +0,0 @@
1
- # Change Log
2
-
3
- ## 10.4.2
4
-
5
- ### Patch Changes
6
-
7
- - 2d428b3: fix: user_agent property as boolean
8
-
9
- ## 10.4.1
10
-
11
- ### Patch Changes
12
-
13
- - aaf0da4: fix: self_path correct property
14
-
15
- ## 10.4.0
16
-
17
- ### Minor Changes
18
-
19
- - 00e4afd: feat: update configuration types
20
-
21
- ## 10.3.0
22
-
23
- ### Minor Changes
24
-
25
- - 803c518: chore: update core dependencies
26
-
27
- ## 10.2.2
28
-
29
- ### Patch Changes
30
-
31
- - 9ca52a7: fix: move userRateLimit to config body
32
-
33
- ## 10.2.1
34
-
35
- ### Patch Changes
36
-
37
- - 254a282: fix: user_agent can be also string
38
-
39
- ## 10.2.0
40
-
41
- ### Minor Changes
42
-
43
- - 96b62c8: feat: add rate limit and convert user agent type to boolean
44
-
45
- ## 10.1.0
46
-
47
- ### Minor Changes
48
-
49
- - 4e9a3d0: feat: remove core-js from bundle
50
-
51
- By using babel.js core-js injects some requires that are not necessarily dependencies and fails on pnpm and yarn 2 due are strict. No need to add this feature so is removed.
52
-
53
- - https://babeljs.io/docs/en/babel-preset-env#usebuiltins
54
-
55
- ## 10.0.1
56
-
57
- ### Patch Changes
58
-
59
- - 6134415: fix: update dependencies
60
-
61
- All notable changes to this project will be documented in this file.
62
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
63
-
64
- # [10.0.0](https://github.com/verdaccio/monorepo/compare/v9.7.5...v10.0.0) (2021-03-29)
65
-
66
- **Note:** Version bump only for package @verdaccio/types
67
-
68
- ## [9.7.2](https://github.com/verdaccio/monorepo/compare/v9.7.1...v9.7.2) (2020-07-20)
69
-
70
- ### Bug Fixes
71
-
72
- - incorrect AuthAccessCallback and AuthCallback ([#374](https://github.com/verdaccio/monorepo/issues/374)) ([97538f8](https://github.com/verdaccio/monorepo/commit/97538f886271ccdbea7862957f65c4a17c4cd831)), closes [/github.com/verdaccio/verdaccio/blob/master/src/lib/auth.ts#L264](https://github.com//github.com/verdaccio/verdaccio/blob/master/src/lib/auth.ts/issues/L264) [/github.com/verdaccio/verdaccio/blob/master/src/lib/auth.ts#L114](https://github.com//github.com/verdaccio/verdaccio/blob/master/src/lib/auth.ts/issues/L114)
73
-
74
- # [9.7.0](https://github.com/verdaccio/monorepo/compare/v9.6.1...v9.7.0) (2020-06-24)
75
-
76
- ### Features
77
-
78
- - types for https config ([#368](https://github.com/verdaccio/monorepo/issues/368)) ([aa4aa83](https://github.com/verdaccio/monorepo/commit/aa4aa83e8a2f6a29ebe7c0b43ccc560a37fe2da9))
79
-
80
- # [9.5.0](https://github.com/verdaccio/monorepo/compare/v9.4.1...v9.5.0) (2020-05-02)
81
-
82
- ### Features
83
-
84
- - **types:** custom favicon ([#356](https://github.com/verdaccio/monorepo/issues/356)) ([bd78861](https://github.com/verdaccio/monorepo/commit/bd78861f46cd5189808b6689d2018a7bac6755f7))
85
-
86
- # [9.3.0](https://github.com/verdaccio/monorepo/compare/v9.2.0...v9.3.0) (2020-01-29)
87
-
88
- ### Features
89
-
90
- - **types:** adding tag type for auth plugins ([#318](https://github.com/verdaccio/monorepo/issues/318)) ([7f07c94](https://github.com/verdaccio/monorepo/commit/7f07c94d9dba5ac45b35aef3bd1ffd3080fb35db))
91
-
92
- # [9.0.0](https://github.com/verdaccio/monorepo/compare/v8.5.3...v9.0.0) (2020-01-07)
93
-
94
- **Note:** Version bump only for package @verdaccio/types
95
-
96
- ## [8.5.2](https://github.com/verdaccio/monorepo/compare/v8.5.1...v8.5.2) (2019-12-25)
97
-
98
- ### Bug Fixes
99
-
100
- - add types for storage handler ([#307](https://github.com/verdaccio/monorepo/issues/307)) ([c35746e](https://github.com/verdaccio/monorepo/commit/c35746ebba071900db172608dedff66a7d27c23d))
101
-
102
- ## [8.5.1](https://github.com/verdaccio/monorepo/compare/v8.5.0...v8.5.1) (2019-12-24)
103
-
104
- ### Bug Fixes
105
-
106
- - add new types for local storage ([#306](https://github.com/verdaccio/monorepo/issues/306)) ([e715e24](https://github.com/verdaccio/monorepo/commit/e715e24ec7b7e7b3dca31a3321714ebccadf2a8d))
107
-
108
- # [8.5.0](https://github.com/verdaccio/monorepo/compare/v8.4.2...v8.5.0) (2019-12-22)
109
-
110
- ### Bug Fixes
111
-
112
- - **types:** add allow_unpublish generic ([#305](https://github.com/verdaccio/monorepo/issues/305)) ([aeaf64c](https://github.com/verdaccio/monorepo/commit/aeaf64c67cafb9ec16fa5a66aad9c4912f2a3710))
113
-
114
- ## [8.4.2](https://github.com/verdaccio/monorepo/compare/v8.4.1...v8.4.2) (2019-11-23)
115
-
116
- **Note:** Version bump only for package @verdaccio/types
117
-
118
- ## [8.4.1](https://github.com/verdaccio/monorepo/compare/v8.4.0...v8.4.1) (2019-11-22)
119
-
120
- **Note:** Version bump only for package @verdaccio/types
121
-
122
- # [8.4.0](https://github.com/verdaccio/monorepo/compare/v8.3.0...v8.4.0) (2019-11-22)
123
-
124
- ### Bug Fixes
125
-
126
- - adds sort_packages in WebConf Interface ([#227](https://github.com/verdaccio/monorepo/issues/227)) ([5b60ade](https://github.com/verdaccio/monorepo/commit/5b60adef5da49d7d1b62aa9f484b27c9fa319bdd))
127
-
128
- # [8.3.0](https://github.com/verdaccio/monorepo/compare/v8.2.0...v8.3.0) (2019-10-27)
129
-
130
- ### Features
131
-
132
- - improve auth callback TS types ([#225](https://github.com/verdaccio/monorepo/issues/225)) ([ee442a0](https://github.com/verdaccio/monorepo/commit/ee442a0))
133
-
134
- # [8.1.0](https://github.com/verdaccio/monorepo/compare/v8.0.1-next.1...v8.1.0) (2019-09-07)
135
-
136
- **Note:** Version bump only for package @verdaccio/types
137
-
138
- ## [8.0.1-next.1](https://github.com/verdaccio/monorepo/compare/v8.0.1-next.0...v8.0.1-next.1) (2019-08-29)
139
-
140
- **Note:** Version bump only for package @verdaccio/types
141
-
142
- ## [8.0.1-next.0](https://github.com/verdaccio/monorepo/compare/v8.0.0...v8.0.1-next.0) (2019-08-29)
143
-
144
- **Note:** Version bump only for package @verdaccio/types
145
-
146
- # [8.0.0](https://github.com/verdaccio/monorepo/compare/v8.0.0-next.4...v8.0.0) (2019-08-22)
147
-
148
- **Note:** Version bump only for package @verdaccio/types
149
-
150
- # [8.0.0-next.4](https://github.com/verdaccio/monorepo/compare/v8.0.0-next.3...v8.0.0-next.4) (2019-08-18)
151
-
152
- **Note:** Version bump only for package @verdaccio/types
153
-
154
- # [8.0.0-next.2](https://github.com/verdaccio/monorepo/compare/v8.0.0-next.1...v8.0.0-next.2) (2019-08-03)
155
-
156
- ### Bug Fixes
157
-
158
- - update types for tokens ([9734fa8](https://github.com/verdaccio/monorepo/commit/9734fa8))
159
-
160
- # [8.0.0-next.1](https://github.com/verdaccio/monorepo/compare/v8.0.0-next.0...v8.0.0-next.1) (2019-08-01)
161
-
162
- **Note:** Version bump only for package @verdaccio/types
163
-
164
- # [8.0.0-next.0](https://github.com/verdaccio/monorepo/compare/v2.0.0...v8.0.0-next.0) (2019-08-01)
165
-
166
- ### Bug Fixes
167
-
168
- - add \_autogenerated to UpLinkConf ([436bd91](https://github.com/verdaccio/monorepo/commit/436bd91))
169
- - add config prop to IBasicAuth ([2481d6f](https://github.com/verdaccio/monorepo/commit/2481d6f))
170
- - add missing adduser method ([22cdb4e](https://github.com/verdaccio/monorepo/commit/22cdb4e))
171
- - add missing properties ([973c5e4](https://github.com/verdaccio/monorepo/commit/973c5e4))
172
- - allow extend config ([0aea94f](https://github.com/verdaccio/monorepo/commit/0aea94f))
173
- - allow sub types on allow auth methods ([7325f74](https://github.com/verdaccio/monorepo/commit/7325f74))
174
- - deprecated methods are optional ([b77155a](https://github.com/verdaccio/monorepo/commit/b77155a))
175
- - entry point [#14](https://github.com/verdaccio/monorepo/issues/14) ([7575e75](https://github.com/verdaccio/monorepo/commit/7575e75))
176
- - export Author type ([bf7115b](https://github.com/verdaccio/monorepo/commit/bf7115b))
177
- - fix/token i local package manager ([#61](https://github.com/verdaccio/monorepo/issues/61)) ([a7e0fc8](https://github.com/verdaccio/monorepo/commit/a7e0fc8))
178
- - fixes for storage plugin types per code review ([#59](https://github.com/verdaccio/monorepo/issues/59)) ([04fccb8](https://github.com/verdaccio/monorepo/commit/04fccb8))
179
- - getPackageStorage allowed to return undefined ([8a859d0](https://github.com/verdaccio/monorepo/commit/8a859d0))
180
- - improvements config interface ([1dac321](https://github.com/verdaccio/monorepo/commit/1dac321))
181
- - methods return Stream ([22e0672](https://github.com/verdaccio/monorepo/commit/22e0672))
182
- - remove options from get package metadata ([2bfc048](https://github.com/verdaccio/monorepo/commit/2bfc048))
183
- - remove wrong definition ([acba624](https://github.com/verdaccio/monorepo/commit/acba624))
184
- - remove wrong imports ([c82f51c](https://github.com/verdaccio/monorepo/commit/c82f51c))
185
- - restore missing type on RemoteUser ([b596896](https://github.com/verdaccio/monorepo/commit/b596896))
186
- - storage types ([1285675](https://github.com/verdaccio/monorepo/commit/1285675))
187
- - tokens are accesible also in local-storage ([08b342d](https://github.com/verdaccio/monorepo/commit/08b342d))
188
- - update https ([c93c3fc](https://github.com/verdaccio/monorepo/commit/c93c3fc))
189
- - update readTarball with right parameters ([8cbc7d1](https://github.com/verdaccio/monorepo/commit/8cbc7d1))
190
- - update streams type ([7fa7be5](https://github.com/verdaccio/monorepo/commit/7fa7be5))
191
- - update types for local data ([6706770](https://github.com/verdaccio/monorepo/commit/6706770))
192
- - update utils types ([7c37133](https://github.com/verdaccio/monorepo/commit/7c37133))
193
- - wrong signature for auth plugin ([e3e2508](https://github.com/verdaccio/monorepo/commit/e3e2508))
194
-
195
- ### Features
196
-
197
- - add AuthPluginPackage type ([f0e1cea](https://github.com/verdaccio/monorepo/commit/f0e1cea))
198
- - add callback to database methods ([d0d55e9](https://github.com/verdaccio/monorepo/commit/d0d55e9))
199
- - add config file types ([188a3e5](https://github.com/verdaccio/monorepo/commit/188a3e5))
200
- - add gravatar prop for web config ([b3ac873](https://github.com/verdaccio/monorepo/commit/b3ac873))
201
- - add interface for middleware and storage plugin ([2b18e22](https://github.com/verdaccio/monorepo/commit/2b18e22))
202
- - add IStorageManager for middleware plugin ([0ac1cc4](https://github.com/verdaccio/monorepo/commit/0ac1cc4))
203
- - Add locking library on typings ([7f7ab67](https://github.com/verdaccio/monorepo/commit/7f7ab67))
204
- - add RemoteUser type ([7d11892](https://github.com/verdaccio/monorepo/commit/7d11892))
205
- - add search method BREAKING CHANGE: search method must be implemented to allow search functionality ([b6d94e6](https://github.com/verdaccio/monorepo/commit/b6d94e6))
206
- - add secret gateway methods ([5300147](https://github.com/verdaccio/monorepo/commit/5300147))
207
- - add Security configuration ([0cdc0dd](https://github.com/verdaccio/monorepo/commit/0cdc0dd))
208
- - add types for auth plugin ([6378186](https://github.com/verdaccio/monorepo/commit/6378186))
209
- - add types for PackageUsers ([ad5f917](https://github.com/verdaccio/monorepo/commit/ad5f917))
210
- - add types for search class ([e23782d](https://github.com/verdaccio/monorepo/commit/e23782d))
211
- - callback does not return ([fd78bfc](https://github.com/verdaccio/monorepo/commit/fd78bfc))
212
- - merge changes from 5.x ([5f61009](https://github.com/verdaccio/monorepo/commit/5f61009))
213
- - package access props are not optional ([61708e2](https://github.com/verdaccio/monorepo/commit/61708e2))
214
- - remove flow [#70](https://github.com/verdaccio/monorepo/issues/70) ([2218b74](https://github.com/verdaccio/monorepo/commit/2218b74))
215
- - remove sync method ([f60f81c](https://github.com/verdaccio/monorepo/commit/f60f81c))
216
- - secret methods are async ([d5eacf5](https://github.com/verdaccio/monorepo/commit/d5eacf5))
217
- - support for an IPluginStorageFilter ([#58](https://github.com/verdaccio/monorepo/issues/58)) ([eab219e](https://github.com/verdaccio/monorepo/commit/eab219e))
218
- - token types ([#60](https://github.com/verdaccio/monorepo/issues/60)) @Eomm ([6e74da6](https://github.com/verdaccio/monorepo/commit/6e74da6))
219
- - **auth:** add method to update password ([e257c3a](https://github.com/verdaccio/monorepo/commit/e257c3a))
220
- - **storage:** path is not mandatory ([2c42931](https://github.com/verdaccio/monorepo/commit/2c42931))
221
-
222
- ### BREAKING CHANGES
223
-
224
- - remove flow definitions
225
- - storage needs to add new methods
226
-
227
- - add: token types
228
-
229
- - add: typescripts types
230
- - **auth:** it will affect all auth plugins
231
-
232
- # Changelog
233
-
234
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
235
-
236
- ## [7.0.0](https://github.com/verdaccio/flow-types/compare/v6.2.0...v7.0.0) (2019-07-25)
237
-
238
- ### Bug Fixes
239
-
240
- - add \_autogenerated to UpLinkConf ([971e52e](https://github.com/verdaccio/flow-types/commit/971e52e))
241
- - **IPluginAuth:** adduser, changePassword optional ([40d4e7a](https://github.com/verdaccio/flow-types/commit/40d4e7a)), closes [/github.com/verdaccio/verdaccio/blob/66f4197236d9d71af149314aae15102b336f45e1/src/lib/auth.ts#L67-L71](https://github.com/verdaccio/flow-types/issues/L67-L71) [/github.com/verdaccio/verdaccio/blob/66f4197236d9d71af149314aae15102b336f45e1/src/lib/auth.ts#L138-L166](https://github.com/verdaccio/flow-types/issues/L138-L166)
242
- - **IPluginAuth:** remove `login_url` ([1663c07](https://github.com/verdaccio/flow-types/commit/1663c07)), closes [#69](https://github.com/verdaccio/flow-types/issues/69)
243
-
244
- ### Features
245
-
246
- - merge changes from 5.x ([7d2d526](https://github.com/verdaccio/flow-types/commit/7d2d526))
247
- - remove flow [#70](https://github.com/verdaccio/flow-types/issues/70) ([826d5fe](https://github.com/verdaccio/flow-types/commit/826d5fe))
248
-
249
- ### BREAKING CHANGES
250
-
251
- - remove flow definitions
252
-
253
- <a name="6.2.0"></a>
254
-
255
- # [6.2.0](https://github.com/verdaccio/flow-types/compare/v6.1.0...v6.2.0) (2019-05-28)
256
-
257
- ### Features
258
-
259
- - add types for Version ([900861d](https://github.com/verdaccio/flow-types/commit/900861d))
260
-
261
- <a name="6.1.0"></a>
262
-
263
- # [6.1.0](https://github.com/verdaccio/flow-types/compare/v6.0.2...v6.1.0) (2019-05-14)
264
-
265
- ### Bug Fixes
266
-
267
- - revert token signature ([59a03e7](https://github.com/verdaccio/flow-types/commit/59a03e7))
268
-
269
- ### Features
270
-
271
- - moved token api signature ([e51991c](https://github.com/verdaccio/flow-types/commit/e51991c))
272
-
273
- <a name="6.0.2"></a>
274
-
275
- ## [6.0.2](https://github.com/verdaccio/flow-types/compare/v6.0.1...v6.0.2) (2019-05-06)
276
-
277
- ### Bug Fixes
278
-
279
- - fix/token i local package manager ([#61](https://github.com/verdaccio/flow-types/issues/61)) ([14adfb2](https://github.com/verdaccio/flow-types/commit/14adfb2))
280
-
281
- <a name="6.0.1"></a>
282
-
283
- ## [6.0.1](https://github.com/verdaccio/flow-types/compare/v6.0.0...v6.0.1) (2019-05-04)
284
-
285
- ### Bug Fixes
286
-
287
- - tokens are accesible also in local-storage ([56551cf](https://github.com/verdaccio/flow-types/commit/56551cf))
288
-
289
- <a name="6.0.0"></a>
290
-
291
- # [6.0.0](https://github.com/verdaccio/flow-types/compare/v5.0.2...v6.0.0) (2019-04-30)
292
-
293
- ### Bug Fixes
294
-
295
- - remove wrong imports ([a75476a](https://github.com/verdaccio/flow-types/commit/a75476a))
296
-
297
- ### Features
298
-
299
- - token types ([#60](https://github.com/verdaccio/flow-types/issues/60)) @Eomm ([7b74982](https://github.com/verdaccio/flow-types/commit/7b74982))
300
-
301
- ### BREAKING CHANGES
302
-
303
- - storage needs to add new methods
304
-
305
- - add: token types
306
-
307
- - add: typescripts types
308
-
309
- <a name="5.0.2"></a>
310
-
311
- ## [5.0.2](https://github.com/verdaccio/flow-types/compare/v5.0.1...v5.0.2) (2019-04-22)
312
-
313
- ### Bug Fixes
314
-
315
- - fixes for storage plugin types per code review ([#59](https://github.com/verdaccio/flow-types/issues/59)) ([c2ea90b](https://github.com/verdaccio/flow-types/commit/c2ea90b))
316
-
317
- <a name="5.0.1"></a>
318
-
319
- ## [5.0.1](https://github.com/verdaccio/flow-types/compare/v5.0.0...v5.0.1) (2019-04-18)
320
-
321
- <a name="5.0.0"></a>
322
-
323
- # [5.0.0](https://github.com/verdaccio/flow-types/compare/v5.0.0-beta.4...v5.0.0) (2019-04-18)
324
-
325
- ### Features
326
-
327
- - support for an IPluginStorageFilter ([#58](https://github.com/verdaccio/flow-types/issues/58)) ([e67559f](https://github.com/verdaccio/flow-types/commit/e67559f))
328
-
329
- <a name="5.0.0-beta.4"></a>
330
-
331
- # [5.0.0-beta.4](https://github.com/verdaccio/flow-types/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2019-03-29)
332
-
333
- ### Features
334
-
335
- - **storage:** path is not mandatory ([784f1bb](https://github.com/verdaccio/flow-types/commit/784f1bb))
336
-
337
- <a name="5.0.0-beta.3"></a>
338
-
339
- # [5.0.0-beta.3](https://github.com/verdaccio/flow-types/compare/v5.0.0-beta.2...v5.0.0-beta.3) (2019-03-09)
340
-
341
- ### Features
342
-
343
- - add types for PackageUsers ([9bb3c26](https://github.com/verdaccio/flow-types/commit/9bb3c26))
344
-
345
- <a name="5.0.0-beta.2"></a>
346
-
347
- # [5.0.0-beta.2](https://github.com/verdaccio/flow-types/compare/v5.0.0-beta.1...v5.0.0-beta.2) (2019-02-03)
348
-
349
- ### Features
350
-
351
- - allow_access and allow_publish are optional for auth plugin ([0d5a53c](https://github.com/verdaccio/flow-types/commit/0d5a53c))
352
-
353
- <a name="5.0.0-beta.1"></a>
354
-
355
- # [5.0.0-beta.1](https://github.com/verdaccio/flow-types/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2019-02-01)
356
-
357
- <a name="5.0.0-beta.0"></a>
358
-
359
- # [5.0.0-beta.0](https://github.com/verdaccio/flow-types/compare/v4.3.0...v5.0.0-beta.0) (2019-01-27)
360
-
361
- <a name="4.3.0"></a>
362
-
363
- # [4.3.0](https://github.com/verdaccio/flow-types/compare/v4.2.0...v4.3.0) (2019-01-12)
364
-
365
- ### Features
366
-
367
- - add gravatar prop for web config ([99ceae9](https://github.com/verdaccio/flow-types/commit/99ceae9))
368
-
369
- <a name="4.2.0"></a>
370
-
371
- # [4.2.0](https://github.com/verdaccio/flow-types/compare/v4.1.2...v4.2.0) (2019-01-12)
372
-
373
- ### Features
374
-
375
- - add AuthPluginPackage type ([0e46b04](https://github.com/verdaccio/flow-types/commit/0e46b04))
376
-
377
- <a name="4.1.2"></a>
378
-
379
- ## [4.1.2](https://github.com/verdaccio/flow-types/compare/v4.1.1...v4.1.2) (2018-11-11)
380
-
381
- ### Bug Fixes
382
-
383
- - remove wrong definition ([9bc53fc](https://github.com/verdaccio/flow-types/commit/9bc53fc))
384
-
385
- <a name="4.1.1"></a>
386
-
387
- ## [4.1.1](https://github.com/verdaccio/flow-types/compare/v4.1.0...v4.1.1) (2018-10-06)
388
-
389
- ### Bug Fixes
390
-
391
- - deprecated methods are optional ([4c96e89](https://github.com/verdaccio/flow-types/commit/4c96e89))
392
-
393
- <a name="4.1.0"></a>
394
-
395
- # [4.1.0](https://github.com/verdaccio/flow-types/compare/v4.0.0...v4.1.0) (2018-10-06)
396
-
397
- ### Features
398
-
399
- - package access props are not optional ([afabaf1](https://github.com/verdaccio/flow-types/commit/afabaf1))
400
-
401
- <a name="4.0.0"></a>
402
-
403
- # [4.0.0](https://github.com/verdaccio/flow-types/compare/v3.7.2...v4.0.0) (2018-09-30)
404
-
405
- ### Features
406
-
407
- - **auth:** add method to update password ([21fc43f](https://github.com/verdaccio/flow-types/commit/21fc43f))
408
-
409
- ### BREAKING CHANGES
410
-
411
- - **auth:** it will affect all auth plugins
412
-
413
- <a name="3.7.2"></a>
414
-
415
- ## [3.7.2](https://github.com/verdaccio/flow-types/compare/v3.7.1...v3.7.2) (2018-09-27)
416
-
417
- ### Bug Fixes
418
-
419
- - entry point [#14](https://github.com/verdaccio/flow-types/issues/14) ([f7b8982](https://github.com/verdaccio/flow-types/commit/f7b8982))
420
- - export Author type ([7869dde](https://github.com/verdaccio/flow-types/commit/7869dde))
421
-
422
- <a name="3.7.1"></a>
423
-
424
- ## [3.7.1](https://github.com/verdaccio/flow-types/compare/v3.7.0...v3.7.1) (2018-08-11)
425
-
426
- ### Bug Fixes
427
-
428
- - restore missing type on RemoteUser ([88d809e](https://github.com/verdaccio/flow-types/commit/88d809e))
429
-
430
- <a name="3.7.0"></a>
431
-
432
- # [3.7.0](https://github.com/verdaccio/flow-types/compare/v3.6.0...v3.7.0) (2018-08-05)
433
-
434
- ### Features
435
-
436
- - add Security configuration ([0d9aece](https://github.com/verdaccio/flow-types/commit/0d9aece))
437
-
438
- <a name="3.6.0"></a>
439
-
440
- # [3.6.0](https://github.com/verdaccio/flow-types/compare/v3.5.1...v3.6.0) (2018-07-30)
441
-
442
- ### Features
443
-
444
- - changes max_users type to number ([1fa6e73](https://github.com/verdaccio/flow-types/commit/1fa6e73))
445
-
446
- <a name="3.5.1"></a>
447
-
448
- ## [3.5.1](https://github.com/verdaccio/flow-types/compare/v3.5.0...v3.5.1) (2018-07-21)
449
-
450
- ### Bug Fixes
451
-
452
- - login_url should be an optional property ([0fcfb9c](https://github.com/verdaccio/flow-types/commit/0fcfb9c))
453
-
454
- <a name="3.5.0"></a>
455
-
456
- # [3.5.0](https://github.com/verdaccio/flow-types/compare/v3.4.3...v3.5.0) (2018-07-21)
457
-
458
- ### Features
459
-
460
- - add `login_url` to verdaccio\$IPluginAuth ([6e03209](https://github.com/verdaccio/flow-types/commit/6e03209)), closes [verdaccio/verdaccio#834](https://github.com/verdaccio/verdaccio/issues/834)
461
-
462
- <a name="3.4.3"></a>
463
-
464
- ## [3.4.3](https://github.com/verdaccio/flow-types/compare/v3.4.2...v3.4.3) (2018-07-19)
465
-
466
- ### Bug Fixes
467
-
468
- - allow extend config ([06e810f](https://github.com/verdaccio/flow-types/commit/06e810f))
469
-
470
- <a name="3.4.2"></a>
471
-
472
- ## [3.4.2](https://github.com/verdaccio/flow-types/compare/v3.4.1...v3.4.2) (2018-07-17)
473
-
474
- <a name="3.4.1"></a>
475
-
476
- ## [3.4.1](https://github.com/verdaccio/flow-types/compare/v3.4.0...v3.4.1) (2018-07-16)
477
-
478
- ### Bug Fixes
479
-
480
- - allow sub types on allow auth methods ([fa8125b](https://github.com/verdaccio/flow-types/commit/fa8125b))
481
-
482
- <a name="3.4.0"></a>
483
-
484
- # [3.4.0](https://github.com/verdaccio/flow-types/compare/v3.3.3...v3.4.0) (2018-07-16)
485
-
486
- ### Features
487
-
488
- - add RemoteUser type ([aa83839](https://github.com/verdaccio/flow-types/commit/aa83839))
489
-
490
- <a name="3.3.3"></a>
491
-
492
- ## [3.3.3](https://github.com/verdaccio/flow-types/compare/v3.3.2...v3.3.3) (2018-07-16)
493
-
494
- ### Bug Fixes
495
-
496
- - wrong signature for auth plugin ([11a0ce6](https://github.com/verdaccio/flow-types/commit/11a0ce6))
497
-
498
- <a name="3.3.2"></a>
499
-
500
- ## [3.3.2](https://github.com/verdaccio/flow-types/compare/v3.3.1...v3.3.2) (2018-07-16)
501
-
502
- ### Bug Fixes
503
-
504
- - add missing adduser method ([0b54fe7](https://github.com/verdaccio/flow-types/commit/0b54fe7))
505
-
506
- <a name="3.3.1"></a>
507
-
508
- ## [3.3.1](https://github.com/verdaccio/flow-types/compare/v3.3.0...v3.3.1) (2018-07-15)
509
-
510
- ### Bug Fixes
511
-
512
- - add config prop to IBasicAuth ([0714316](https://github.com/verdaccio/flow-types/commit/0714316))
513
-
514
- <a name="3.3.0"></a>
515
-
516
- # [3.3.0](https://github.com/verdaccio/flow-types/compare/v3.2.0...v3.3.0) (2018-07-15)
517
-
518
- ### Features
519
-
520
- - add IStorageManager for middleware plugin ([d473b4c](https://github.com/verdaccio/flow-types/commit/d473b4c))
521
-
522
- <a name="3.2.0"></a>
523
-
524
- # [3.2.0](https://github.com/verdaccio/flow-types/compare/v3.1.0...v3.2.0) (2018-07-15)
525
-
526
- ### Features
527
-
528
- - add interface for middleware and storage plugin ([0028085](https://github.com/verdaccio/flow-types/commit/0028085))
529
-
530
- <a name="3.1.0"></a>
531
-
532
- # [3.1.0](https://github.com/verdaccio/flow-types/compare/v3.0.1...v3.1.0) (2018-07-14)
533
-
534
- ### Features
535
-
536
- - add types for auth plugin ([a9b7bc9](https://github.com/verdaccio/flow-types/commit/a9b7bc9))
537
-
538
- <a name="3.0.1"></a>
539
-
540
- ## [3.0.1](https://github.com/verdaccio/flow-types/compare/v3.0.0...v3.0.1) (2018-07-02)
541
-
542
- ### Bug Fixes
543
-
544
- - improvements config interface ([8ea6276](https://github.com/verdaccio/flow-types/commit/8ea6276))
545
-
546
- <a name="3.0.0"></a>
547
-
548
- # [3.0.0](https://github.com/verdaccio/flow-types/compare/v2.2.2...v3.0.0) (2018-06-08)
549
-
550
- ### Features
551
-
552
- - add search method ([2cf3ce9](https://github.com/verdaccio/flow-types/commit/2cf3ce9))
553
-
554
- ### BREAKING CHANGES
555
-
556
- - search method must be implemented to allow search functionality
package/index.d.ts DELETED
@@ -1,578 +0,0 @@
1
- // <reference types="node" />
2
-
3
- import { PassThrough } from 'stream';
4
-
5
- declare module '@verdaccio/types' {
6
- type StringValue = string | void | null;
7
-
8
- type StorageList = string[];
9
- type Callback = Function;
10
- // FIXME: err should be something flexible enough for any implementation
11
- type CallbackAction = (err: any | null) => void;
12
- type CallbackError = (err: NodeJS.ErrnoException) => void;
13
- interface Author {
14
- name: string;
15
- email?: string;
16
- url?: string;
17
- }
18
-
19
- interface Dist {
20
- integrity?: string;
21
- shasum: string;
22
- tarball: string;
23
- }
24
-
25
- interface RemoteUser {
26
- real_groups: string[];
27
- groups: string[];
28
- name: string | void;
29
- error?: string;
30
- }
31
-
32
- interface LocalStorage {
33
- list: any;
34
- secret: string;
35
- }
36
-
37
- interface Version {
38
- name: string;
39
- version: string;
40
- devDependencies?: string;
41
- directories?: any;
42
- dist: Dist;
43
- author: string | Author;
44
- main: string;
45
- homemage?: string;
46
- license?: string;
47
- readme: string;
48
- readmeFileName?: string;
49
- readmeFilename?: string;
50
- description: string;
51
- bin?: string;
52
- bugs?: any;
53
- files?: string[];
54
- gitHead?: string;
55
- maintainers?: Author[];
56
- contributors?: Author[];
57
- repository?: string | any;
58
- scripts?: any;
59
- homepage?: string;
60
- etag?: string;
61
- dependencies: any;
62
- keywords?: string | string[];
63
- nodeVersion?: string;
64
- _id: string;
65
- _npmVersion?: string;
66
- _npmUser: Author;
67
- _hasShrinkwrap?: boolean;
68
- deprecated?: string;
69
- }
70
-
71
- interface Logger {
72
- child: (conf: any) => any;
73
- debug: (conf: any, template?: string) => void;
74
- error: (conf: any, template?: string) => void;
75
- http: (conf: any, template?: string) => void;
76
- trace: (conf: any, template?: string) => void;
77
- warn: (conf: any, template?: string) => void;
78
- info: (conf: any, template?: string) => void;
79
- }
80
-
81
- interface Versions {
82
- [key: string]: Version;
83
- }
84
-
85
- interface DistFile {
86
- url: string;
87
- sha: string;
88
- registry?: string;
89
- }
90
-
91
- interface MergeTags {
92
- [key: string]: string;
93
- }
94
-
95
- interface DistFiles {
96
- [key: string]: DistFile;
97
- }
98
-
99
- interface AttachMents {
100
- [key: string]: AttachMentsItem;
101
- }
102
-
103
- interface AttachMentsItem {
104
- content_type?: string;
105
- data?: string;
106
- length?: number;
107
- shasum?: string;
108
- version?: string;
109
- }
110
-
111
- interface GenericBody {
112
- [key: string]: string;
113
- }
114
-
115
- interface UpLinkMetadata {
116
- etag: string;
117
- fetched: number;
118
- }
119
-
120
- interface UpLinks {
121
- [key: string]: UpLinkMetadata;
122
- }
123
-
124
- interface Tags {
125
- [key: string]: Version;
126
- }
127
-
128
- interface Headers {
129
- [key: string]: string;
130
- }
131
-
132
- interface PackageUsers {
133
- [key: string]: boolean;
134
- }
135
-
136
- interface Package {
137
- _id?: string;
138
- name: string;
139
- versions: Versions;
140
- 'dist-tags': GenericBody;
141
- time?: GenericBody;
142
- readme?: string;
143
- users?: PackageUsers;
144
- _distfiles: DistFiles;
145
- _attachments: AttachMents;
146
- _uplinks: UpLinks;
147
- _rev: string;
148
- }
149
-
150
- class IUploadTarball extends PassThrough {
151
- abort(): void;
152
- done(): void;
153
- }
154
-
155
- class IReadTarball extends PassThrough {
156
- abort(): void;
157
- }
158
-
159
- interface UpLinkTokenConf {
160
- type: 'Bearer' | 'Basic';
161
- token?: string;
162
- token_env?: boolean | string;
163
- }
164
-
165
- interface UpLinkConf {
166
- url: string;
167
- ca?: string;
168
- cache?: boolean;
169
- timeout?: string | void;
170
- maxage?: string | void;
171
- max_fails?: number | void;
172
- fail_timeout?: string | void;
173
- headers?: Headers;
174
- auth?: UpLinkTokenConf;
175
- strict_ssl?: boolean | void;
176
- _autogenerated?: boolean;
177
- }
178
-
179
- interface AuthPluginPackage {
180
- packageName: string;
181
- packageVersion?: string;
182
- tag?: string;
183
- }
184
-
185
- interface PackageAccess {
186
- storage?: string;
187
- publish?: string[];
188
- proxy?: string[];
189
- access?: string[];
190
- }
191
-
192
- interface PackageList {
193
- [key: string]: PackageAccess;
194
- }
195
-
196
- interface UpLinksConfList {
197
- [key: string]: UpLinkConf;
198
- }
199
-
200
- type LoggerType = 'stdout' | 'stderr' | 'file';
201
- type LoggerFormat = 'pretty' | 'pretty-timestamped' | 'file';
202
- type LoggerLevel = 'http' | 'fatal' | 'warn' | 'info' | 'debug' | 'trace';
203
-
204
- interface LoggerConfItem {
205
- type: LoggerType;
206
- format: LoggerFormat;
207
- level: LoggerLevel;
208
- }
209
-
210
- interface PublishOptions {
211
- allow_offline: boolean;
212
- }
213
-
214
- type AuthConf = any | AuthHtpasswd;
215
-
216
- interface AuthHtpasswd {
217
- file: string;
218
- max_users: number;
219
- }
220
-
221
- interface Notifications {
222
- method: string;
223
- packagePattern: RegExp;
224
- packagePatternFlags: string;
225
- endpoint: string;
226
- content: string;
227
- headers: Headers;
228
- }
229
-
230
- interface ConfigFile {
231
- storage: string;
232
- plugins: string;
233
- self_path: string;
234
- packages: PackageList;
235
- uplinks: UpLinksConfList;
236
- logs: LoggerConf[];
237
- web: WebConf;
238
- auth: AuthConf;
239
- publish?: PublishOptions;
240
- url_prefix?: string;
241
- listen?: ListenAddress;
242
- https?: HttpsConf;
243
- http_proxy?: string;
244
- https_proxy?: string;
245
- no_proxy?: string;
246
- max_body_size?: string;
247
- notifications: Notifications;
248
- }
249
-
250
- interface Token {
251
- user: string;
252
- token: string;
253
- key: string;
254
- cidr?: string[];
255
- readonly: boolean;
256
- created: number | string;
257
- updated?: number | string;
258
- }
259
-
260
- interface TokenFilter {
261
- user: string;
262
- }
263
-
264
- type SyncReturn = Error | void;
265
- type IPackageStorage = ILocalPackageManager | void;
266
- type IPackageStorageManager = ILocalPackageManager;
267
- type IPluginStorage<T> = ILocalData<T>;
268
-
269
- interface AuthHtpasswd {
270
- file: string;
271
- max_users: number;
272
- }
273
-
274
- interface ILocalStorage {
275
- add(name: string): void;
276
- remove(name: string): void;
277
- get(): StorageList;
278
- sync(): void;
279
- }
280
-
281
- interface LoggerConf {
282
- [key: string]: LoggerConfItem;
283
- }
284
-
285
- interface ListenAddress {
286
- [key: string]: string;
287
- }
288
-
289
- interface WebConf {
290
- enable?: boolean;
291
- title?: string;
292
- logo?: string;
293
- favicon?: string;
294
- gravatar?: boolean;
295
- sort_packages?: string;
296
- rateLimit?: RateLimit;
297
- }
298
-
299
- interface HttpsConfKeyCert {
300
- key: string;
301
- cert: string;
302
- ca?: string;
303
- }
304
-
305
- interface HttpsConfPfx {
306
- pfx: string;
307
- passphrase?: string;
308
- }
309
-
310
- type HttpsConf = HttpsConfKeyCert | HttpsConfPfx;
311
-
312
- interface JWTOptions {
313
- sign: JWTSignOptions;
314
- verify: JWTVerifyOptions;
315
- }
316
-
317
- interface JWTVerifyOptions {
318
- algorithm?: string;
319
- expiresIn?: string;
320
- notBefore?: string | number;
321
- ignoreExpiration?: boolean;
322
- maxAge?: string | number;
323
- clockTimestamp?: number;
324
- }
325
-
326
- interface JWTSignOptions {
327
- algorithm?: string;
328
- expiresIn?: string;
329
- notBefore?: string;
330
- ignoreExpiration?: boolean;
331
- maxAge?: string | number;
332
- clockTimestamp?: number;
333
- }
334
-
335
- interface APITokenOptions {
336
- legacy: boolean;
337
- jwt?: JWTOptions;
338
- }
339
-
340
- type RateLimit = {
341
- windowMs?: number;
342
- max?: number;
343
- };
344
-
345
- interface Security {
346
- web: JWTOptions;
347
- api: APITokenOptions;
348
- }
349
-
350
- export type ServerSettingsConf = {
351
- // express-rate-limit settings
352
- rateLimit: RateLimit;
353
- keepAliveTimeout?: number;
354
- };
355
-
356
- interface ConfigYaml {
357
- _debug?: boolean;
358
- storage?: string | void;
359
- packages: PackageList;
360
- uplinks: UpLinksConfList;
361
- // FUTURE: log should be mandatory
362
- logs?: LoggerConfItem;
363
- web?: WebConf;
364
- auth?: AuthConf;
365
- security: Security;
366
- publish?: PublishOptions;
367
- store?: any;
368
- listen?: ListenAddress;
369
- https?: HttpsConf;
370
- http_proxy?: string;
371
- plugins?: string | void;
372
- https_proxy?: string;
373
- no_proxy?: string;
374
- max_body_size?: string;
375
- notifications?: Notifications;
376
- notify?: Notifications | Notifications[];
377
- middlewares?: any;
378
- filters?: any;
379
- url_prefix?: string;
380
- server?: ServerSettingsConf;
381
- }
382
-
383
- interface ConfigRuntime extends ConfigYaml {
384
- // @deprecated on v6 this is config_path
385
- self_path: string;
386
- }
387
-
388
- interface Config extends ConfigYaml, ConfigRuntime {
389
- user_agent?: string | boolean;
390
- server_id: string;
391
- secret: string;
392
- // deprecated
393
- checkSecretKey(token: string): string;
394
- getMatchedPackagesSpec(storage: string): PackageAccess | void;
395
- [key: string]: any;
396
- }
397
-
398
- interface ConfigWithHttps extends Config {
399
- https: HttpsConf;
400
- }
401
-
402
- interface ITokenActions {
403
- saveToken(token: Token): Promise<any>;
404
- deleteToken(user: string, tokenKey: string): Promise<any>;
405
- readTokens(filter: TokenFilter): Promise<Token[]>;
406
- }
407
-
408
- /**
409
- * This method expect return a Package object
410
- * eg:
411
- * {
412
- * name: string;
413
- * time: number;
414
- * ... and other props
415
- * }
416
- *
417
- * The `cb` callback object will be executed if:
418
- * - it might return object (truly)
419
- * - it might reutrn null
420
- */
421
- type onSearchPackage = (item: Package, cb: CallbackAction) => void;
422
- // FIXME: error should be export type `VerdaccioError = HttpError & { code: number };`
423
- // but this type is on @verdaccio/commons-api and cannot be used here yet
424
- type onEndSearchPackage = (error?: any) => void;
425
- type onValidatePackage = (name: string) => boolean;
426
-
427
- interface ILocalData<T> extends IPlugin<T>, ITokenActions {
428
- logger: Logger;
429
- config: T & Config;
430
- add(name: string, callback: Callback): void;
431
- remove(name: string, callback: Callback): void;
432
- get(callback: Callback): void;
433
- getSecret(): Promise<string>;
434
- setSecret(secret: string): Promise<any>;
435
- getPackageStorage(packageInfo: string): IPackageStorage;
436
- search(
437
- onPackage: onSearchPackage,
438
- onEnd: onEndSearchPackage,
439
- validateName: onValidatePackage
440
- ): void;
441
- }
442
-
443
- type StorageUpdateCallback = (data: Package, cb: CallbackAction) => void;
444
- type StorageUpdateHandler = (name: string, cb: StorageUpdateCallback) => void;
445
- type StorageWriteCallback = (name: string, json: Package, callback: Callback) => void;
446
- type PackageTransformer = (pkg: Package) => Package;
447
- type ReadPackageCallback = (err: any | null, data?: Package) => void;
448
-
449
- interface ILocalPackageManager {
450
- logger: Logger;
451
- writeTarball(pkgName: string): IUploadTarball;
452
- readTarball(pkgName: string): IReadTarball;
453
- readPackage(fileName: string, callback: ReadPackageCallback): void;
454
- createPackage(pkgName: string, value: Package, cb: CallbackAction): void;
455
- deletePackage(fileName: string, callback: CallbackAction): void;
456
- removePackage(callback: CallbackAction): void;
457
- updatePackage(
458
- pkgFileName: string,
459
- updateHandler: StorageUpdateCallback,
460
- onWrite: StorageWriteCallback,
461
- transformPackage: PackageTransformer,
462
- onEnd: CallbackAction
463
- ): void;
464
- savePackage(fileName: string, json: Package, callback: CallbackAction): void;
465
- }
466
-
467
- interface TarballActions {
468
- addTarball(name: string, filename: string): IUploadTarball;
469
- getTarball(name: string, filename: string): IReadTarball;
470
- removeTarball(name: string, filename: string, revision: string, callback: Callback): void;
471
- }
472
-
473
- interface StoragePackageActions extends TarballActions {
474
- addVersion(
475
- name: string,
476
- version: string,
477
- metadata: Version,
478
- tag: StringValue,
479
- callback: Callback
480
- ): void;
481
- mergeTags(name: string, tags: MergeTags, callback: Callback): void;
482
- removePackage(name: string, callback: Callback): void;
483
- changePackage(name: string, metadata: Package, revision: string, callback: Callback): void;
484
- }
485
-
486
- interface IStorageManager<T> extends StoragePackageActions {
487
- config: T & Config;
488
- logger: Logger;
489
- init(config: T & Config, filters: any): Promise<any>;
490
- addPackage(name: string, metadata: any, callback: Callback): Promise<any>;
491
- getPackage(options: any): void;
492
- search(startkey: string, options: any): IReadTarball;
493
- getLocalDatabase(callback: Callback): void;
494
- }
495
-
496
- interface IBasicStorage<T> extends StoragePackageActions {
497
- addPackage(name: string, info: Package, callback: Callback): void;
498
- updateVersions(name: string, packageInfo: Package, callback: Callback): void;
499
- getPackageMetadata(name: string, callback: Callback): void;
500
- search(startKey: string, options: any): IReadTarball;
501
- getSecret(config: T & Config): Promise<any>;
502
- }
503
-
504
- interface IBasicAuth<T> {
505
- config: T & Config;
506
- aesEncrypt(buf: Buffer): Buffer;
507
- authenticate(user: string, password: string, cb: Callback): void;
508
- changePassword(user: string, password: string, newPassword: string, cb: Callback): void;
509
- allow_access(pkg: AuthPluginPackage, user: RemoteUser, callback: Callback): void;
510
- add_user(user: string, password: string, cb: Callback): any;
511
- }
512
-
513
- class Plugin<T> {
514
- constructor(config: T, options: PluginOptions<T>);
515
- }
516
-
517
- interface IPlugin<T> {
518
- version?: string;
519
- // In case a plugin needs to be cleaned up/removed
520
- close?(): void;
521
- }
522
-
523
- interface PluginOptions<T> {
524
- config: T & Config;
525
- logger: Logger;
526
- }
527
-
528
- interface AllowAccess {
529
- name: string;
530
- version?: string;
531
- tag?: string;
532
- }
533
-
534
- // FIXME: error should be export type `VerdaccioError = HttpError & { code: number };` instead of AuthError
535
- // but this type is on @verdaccio/commons-api and cannot be used here yet (I don't know why)
536
- interface HttpError extends Error {
537
- status: number;
538
- statusCode: number;
539
- expose: boolean;
540
- headers?: {
541
- [key: string]: string;
542
- };
543
- [key: string]: any;
544
- }
545
-
546
- type AuthError = HttpError & { code: number };
547
- type AuthAccessCallback = (error: AuthError | null, access: boolean) => void;
548
- type AuthCallback = (error: AuthError | null, groups: string[] | false) => void;
549
-
550
- interface IPluginAuth<T> extends IPlugin<T> {
551
- authenticate(user: string, password: string, cb: AuthCallback): void;
552
- adduser?(user: string, password: string, cb: AuthCallback): void;
553
- changePassword?(user: string, password: string, newPassword: string, cb: AuthCallback): void;
554
- allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
555
- allow_access?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
556
- allow_unpublish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
557
- allow_publish?(
558
- user: RemoteUser,
559
- pkg: AllowAccess & PackageAccess,
560
- cb: AuthAccessCallback
561
- ): void;
562
- allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
563
- allow_unpublish?(
564
- user: RemoteUser,
565
- pkg: AllowAccess & PackageAccess,
566
- cb: AuthAccessCallback
567
- ): void;
568
- apiJWTmiddleware?(helpers: any): Function;
569
- }
570
-
571
- interface IPluginMiddleware<T> extends IPlugin<T> {
572
- register_middlewares(app: any, auth: IBasicAuth<T>, storage: IStorageManager<T>): void;
573
- }
574
-
575
- interface IPluginStorageFilter<T> extends IPlugin<T> {
576
- filter_metadata(packageInfo: Package): Promise<Package>;
577
- }
578
- }