verdaccio-stats 0.1.0 → 0.2.1
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 +3 -2
- package/lib/config.d.ts +2 -0
- package/lib/constants.d.ts +5 -1
- package/lib/index.js +228 -253
- package/lib/index.mjs +228 -253
- package/lib/middlewares/hooks.d.ts +1 -2
- package/lib/middlewares/stats.d.ts +1 -3
- package/lib/middlewares/ui.d.ts +13 -0
- package/lib/models.d.ts +1 -0
- package/lib/plugin.d.ts +1 -0
- package/lib/storage/db.d.ts +4 -2
- package/lib/utils.d.ts +8 -0
- package/package.json +7 -8
- package/lib/middlewares/admin-ui.d.ts +0 -17
package/README.md
CHANGED
|
@@ -36,7 +36,8 @@ Add the plugin to your Verdaccio config file:
|
|
|
36
36
|
|
|
37
37
|
```yaml
|
|
38
38
|
middlewares:
|
|
39
|
-
|
|
39
|
+
stats:
|
|
40
|
+
enabled: true
|
|
40
41
|
file: ./stats.db # Optional, SQLite database
|
|
41
42
|
iso-week: false # Optional, whether to use ISO week format
|
|
42
43
|
count-downloads: true # Optional, whether to count downloads
|
|
@@ -59,7 +60,7 @@ After installing and configuring the plugin, it will automatically begin collect
|
|
|
59
60
|
You can view the statistics by visiting the following URL:
|
|
60
61
|
|
|
61
62
|
```
|
|
62
|
-
http://your-registry.com/-/verdaccio/stats/
|
|
63
|
+
http://your-registry.com/-/verdaccio/stats/ui
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
## License
|
package/lib/config.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const statsConfig: z.ZodObject<{
|
|
|
19
19
|
export interface ConfigHolder {
|
|
20
20
|
countDownloads: boolean;
|
|
21
21
|
countManifestViews: boolean;
|
|
22
|
+
favicon: string;
|
|
22
23
|
file: string;
|
|
23
24
|
isoWeek: boolean;
|
|
24
25
|
logo?: string;
|
|
@@ -31,6 +32,7 @@ export declare class ParsedPluginConfig implements ConfigHolder {
|
|
|
31
32
|
get configPath(): string;
|
|
32
33
|
get countDownloads(): boolean;
|
|
33
34
|
get countManifestViews(): boolean;
|
|
35
|
+
get favicon(): string;
|
|
34
36
|
get file(): string;
|
|
35
37
|
get isoWeek(): boolean;
|
|
36
38
|
get logo(): string | undefined;
|
package/lib/constants.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ export declare const plugin: {
|
|
|
5
5
|
export declare const pluginKey: string;
|
|
6
6
|
export declare const UNIVERSE_PACKAGE_NAME = "**";
|
|
7
7
|
export declare const UNIVERSE_PACKAGE_VERSION = "*";
|
|
8
|
-
export declare const PERIOD_TYPES: readonly ["overall", "
|
|
8
|
+
export declare const PERIOD_TYPES: readonly ["overall", "yearly", "monthly", "weekly", "daily"];
|
|
9
9
|
export declare const PERIOD_VALUE_TOTAL = "total";
|
|
10
10
|
export declare const DEFAULT_SQLITE_FILE = "stats.db";
|
|
11
|
+
export declare const ROUTE_TARBALL_DOWNLOAD = "/:package/-/:filename";
|
|
12
|
+
export declare const ROUTE_SCOPED_TARBALL_DOWNLOAD = "/@:scope/:package/-/:filename";
|
|
13
|
+
export declare const ROUTE_MANIFEST_VIEW = "/:package/:version?";
|
|
14
|
+
export declare const ROUTE_SCOPED_MANIFEST_VIEW = "/@:scope/:package/:version?";
|
|
11
15
|
export declare const API_BASE_PATH = "/-/verdaccio/stats";
|