verdaccio-stats 0.4.3 → 0.4.4

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
@@ -28,12 +28,13 @@ Or install to verdaccio plugin folder:
28
28
  mkdir -p ./install-here/
29
29
  npm install --global-style \
30
30
  --bin-links=false --save=false --package-lock=false \
31
- --omit=dev --omit=optional \
32
- --prefix ./install-here/ \
31
+ --omit=dev --omit=peer --prefix ./install-here/ \
33
32
  verdaccio-stats@latest
34
33
  mv ./install-here/node_modules/verdaccio-stats/ /path/to/verdaccio/plugins/
35
34
  ```
36
35
 
36
+ > **Note:** Do not use `--omit=optional` flag, as this plugin requires optional dependencies (e.g., platform-specific binaries for rollup) to function correctly at runtime.
37
+
37
38
  ## Configuration
38
39
 
39
40
  Add the plugin to your Verdaccio config file:
package/lib/index.js CHANGED
@@ -12,12 +12,13 @@ var weekOfYear = require('dayjs/plugin/weekOfYear');
12
12
  var weekYear = require('dayjs/plugin/weekYear');
13
13
  var buildDebug = require('debug');
14
14
  var core = require('@verdaccio/core');
15
+ var tslib = require('tslib');
15
16
  var sequelizeTypescript = require('sequelize-typescript');
16
17
  var sequelize = require('sequelize');
17
18
  var umzug = require('umzug');
18
19
 
19
20
  var name = "verdaccio-stats";
20
- var version = "0.4.3";
21
+ var version = "0.4.4";
21
22
 
22
23
  const plugin = {
23
24
  name,
@@ -423,81 +424,48 @@ class Stats {
423
424
  };
424
425
  }
425
426
 
426
- /******************************************************************************
427
- Copyright (c) Microsoft Corporation.
428
-
429
- Permission to use, copy, modify, and/or distribute this software for any
430
- purpose with or without fee is hereby granted.
431
-
432
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
433
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
434
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
435
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
436
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
437
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
438
- PERFORMANCE OF THIS SOFTWARE.
439
- ***************************************************************************** */
440
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
441
-
442
-
443
- function __decorate(decorators, target, key, desc) {
444
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
445
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
446
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
447
- return c > 3 && r && Object.defineProperty(target, key, r), r;
448
- }
449
-
450
- function __metadata(metadataKey, metadataValue) {
451
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
452
- }
453
-
454
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
455
- var e = new Error(message);
456
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
457
- };
458
-
459
427
  class StatsModel extends sequelizeTypescript.Model {
460
428
  }
461
- __decorate([
429
+ tslib.__decorate([
462
430
  sequelizeTypescript.Column({
463
431
  type: sequelizeTypescript.DataType.INTEGER,
464
432
  allowNull: false,
465
433
  defaultValue: 0,
466
434
  }),
467
- __metadata("design:type", Number)
435
+ tslib.__metadata("design:type", Number)
468
436
  ], StatsModel.prototype, "count", void 0);
469
- __decorate([
437
+ tslib.__decorate([
470
438
  sequelizeTypescript.ForeignKey(() => Package),
471
439
  sequelizeTypescript.Column({
472
440
  type: sequelizeTypescript.DataType.INTEGER,
473
441
  allowNull: false,
474
442
  }),
475
- __metadata("design:type", Number)
443
+ tslib.__metadata("design:type", Number)
476
444
  ], StatsModel.prototype, "packageId", void 0);
477
- __decorate([
445
+ tslib.__decorate([
478
446
  sequelizeTypescript.Column({
479
447
  type: sequelizeTypescript.DataType.STRING(20),
480
448
  allowNull: false,
481
449
  }),
482
- __metadata("design:type", String)
450
+ tslib.__metadata("design:type", String)
483
451
  ], StatsModel.prototype, "periodType", void 0);
484
- __decorate([
452
+ tslib.__decorate([
485
453
  sequelizeTypescript.Column({
486
454
  type: sequelizeTypescript.DataType.STRING(20),
487
455
  allowNull: false,
488
456
  }),
489
- __metadata("design:type", String)
457
+ tslib.__metadata("design:type", String)
490
458
  ], StatsModel.prototype, "periodValue", void 0);
491
- __decorate([
459
+ tslib.__decorate([
492
460
  sequelizeTypescript.BelongsTo(() => Package, {
493
461
  targetKey: "id",
494
462
  foreignKey: "packageId",
495
463
  }),
496
- __metadata("design:type", Object)
464
+ tslib.__metadata("design:type", Object)
497
465
  ], StatsModel.prototype, "package", void 0);
498
466
  let DownloadStats = class DownloadStats extends StatsModel {
499
467
  };
500
- DownloadStats = __decorate([
468
+ DownloadStats = tslib.__decorate([
501
469
  sequelizeTypescript.Table({
502
470
  tableName: "download_stats",
503
471
  timestamps: true,
@@ -512,7 +480,7 @@ DownloadStats = __decorate([
512
480
  ], DownloadStats);
513
481
  let ManifestViewStats = class ManifestViewStats extends StatsModel {
514
482
  };
515
- ManifestViewStats = __decorate([
483
+ ManifestViewStats = tslib.__decorate([
516
484
  sequelizeTypescript.Table({
517
485
  tableName: "manifest_view_stats",
518
486
  timestamps: true,
@@ -531,34 +499,34 @@ let Package = class Package extends sequelizeTypescript.Model {
531
499
  return `${this.getDataValue("name")}@${this.getDataValue("version")}`;
532
500
  }
533
501
  };
534
- __decorate([
502
+ tslib.__decorate([
535
503
  sequelizeTypescript.Column({
536
504
  type: sequelizeTypescript.DataType.STRING(100),
537
505
  allowNull: false,
538
506
  }),
539
- __metadata("design:type", String)
507
+ tslib.__metadata("design:type", String)
540
508
  ], Package.prototype, "name", void 0);
541
- __decorate([
509
+ tslib.__decorate([
542
510
  sequelizeTypescript.Column({
543
511
  type: sequelizeTypescript.DataType.STRING(50),
544
512
  allowNull: false,
545
513
  }),
546
- __metadata("design:type", String)
514
+ tslib.__metadata("design:type", String)
547
515
  ], Package.prototype, "version", void 0);
548
- __decorate([
516
+ tslib.__decorate([
549
517
  sequelizeTypescript.Column(sequelizeTypescript.DataType.VIRTUAL(sequelizeTypescript.DataType.STRING, ["name", "version"])),
550
- __metadata("design:type", Object),
551
- __metadata("design:paramtypes", [])
518
+ tslib.__metadata("design:type", Object),
519
+ tslib.__metadata("design:paramtypes", [])
552
520
  ], Package.prototype, "displayName", null);
553
- __decorate([
521
+ tslib.__decorate([
554
522
  sequelizeTypescript.HasMany(() => DownloadStats, { sourceKey: "id", foreignKey: "packageId" }),
555
- __metadata("design:type", Object)
523
+ tslib.__metadata("design:type", Object)
556
524
  ], Package.prototype, "downloadStats", void 0);
557
- __decorate([
525
+ tslib.__decorate([
558
526
  sequelizeTypescript.HasMany(() => ManifestViewStats, { sourceKey: "id", foreignKey: "packageId" }),
559
- __metadata("design:type", Object)
527
+ tslib.__metadata("design:type", Object)
560
528
  ], Package.prototype, "manifestViewStats", void 0);
561
- Package = __decorate([
529
+ Package = tslib.__decorate([
562
530
  sequelizeTypescript.Table({
563
531
  tableName: "packages",
564
532
  timestamps: true,
package/lib/index.mjs CHANGED
@@ -8,12 +8,13 @@ import weekOfYear from 'dayjs/plugin/weekOfYear';
8
8
  import weekYear from 'dayjs/plugin/weekYear';
9
9
  import buildDebug from 'debug';
10
10
  import { tarballUtils } from '@verdaccio/core';
11
+ import { __decorate, __metadata } from 'tslib';
11
12
  import { Column, DataType, ForeignKey, BelongsTo, Table, Model, HasMany, Sequelize } from 'sequelize-typescript';
12
13
  import { Op } from 'sequelize';
13
14
  import { Umzug, SequelizeStorage } from 'umzug';
14
15
 
15
16
  var name = "verdaccio-stats";
16
- var version = "0.4.3";
17
+ var version = "0.4.4";
17
18
 
18
19
  const plugin = {
19
20
  name,
@@ -419,39 +420,6 @@ class Stats {
419
420
  };
420
421
  }
421
422
 
422
- /******************************************************************************
423
- Copyright (c) Microsoft Corporation.
424
-
425
- Permission to use, copy, modify, and/or distribute this software for any
426
- purpose with or without fee is hereby granted.
427
-
428
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
429
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
430
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
431
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
432
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
433
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
434
- PERFORMANCE OF THIS SOFTWARE.
435
- ***************************************************************************** */
436
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
437
-
438
-
439
- function __decorate(decorators, target, key, desc) {
440
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
441
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
442
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
443
- return c > 3 && r && Object.defineProperty(target, key, r), r;
444
- }
445
-
446
- function __metadata(metadataKey, metadataValue) {
447
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
448
- }
449
-
450
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
451
- var e = new Error(message);
452
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
453
- };
454
-
455
423
  class StatsModel extends Model {
456
424
  }
457
425
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verdaccio-stats",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "The stats plugin for Verdaccio",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.mjs",
@@ -36,7 +36,6 @@
36
36
  "eslint-plugin-prettier": "^5.5.5",
37
37
  "eslint-plugin-simple-import-sort": "^12.1.1",
38
38
  "eslint-plugin-unicorn": "^63.0.0",
39
- "express": "^4.22.1",
40
39
  "globals": "^17.3.0",
41
40
  "pg": "^8.19.0",
42
41
  "pg-hstore": "^2.3.4",
@@ -45,7 +44,6 @@
45
44
  "rollup": "^4.59.0",
46
45
  "rollup-plugin-node-externals": "^8.1.2",
47
46
  "sqlite3": "^5.1.7",
48
- "tslib": "^2.8.1",
49
47
  "typescript": "^5.9.3",
50
48
  "typescript-eslint": "^8.56.1",
51
49
  "verdaccio": "^6.2.9",
@@ -65,9 +63,14 @@
65
63
  "adminjs": "^7.8.17",
66
64
  "dayjs": "^1.11.19",
67
65
  "debug": "^4.4.3",
66
+ "express": "^4.22.1",
67
+ "express-formidable": "^1.2.0",
68
+ "express-session": "^1.19.0",
68
69
  "ms": "^2.1.3",
70
+ "reflect-metadata": "^0.2.2",
69
71
  "sequelize": "^6.37.7",
70
72
  "sequelize-typescript": "^2.1.6",
73
+ "tslib": "^2.8.1",
71
74
  "umzug": "^3.8.2",
72
75
  "zod": "^4.3.6"
73
76
  },