verdaccio-stats 0.3.1 → 0.3.2
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/lib/index.js +40 -28
- package/lib/index.mjs +40 -28
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var buildDebug = require('debug');
|
|
|
15
15
|
var umzug = require('umzug');
|
|
16
16
|
|
|
17
17
|
var name = "verdaccio-stats";
|
|
18
|
-
var version = "0.3.
|
|
18
|
+
var version = "0.3.2";
|
|
19
19
|
|
|
20
20
|
const plugin = {
|
|
21
21
|
name,
|
|
@@ -404,7 +404,21 @@ class UI {
|
|
|
404
404
|
{
|
|
405
405
|
resource: Package,
|
|
406
406
|
options: {
|
|
407
|
-
actions: {
|
|
407
|
+
actions: {
|
|
408
|
+
...defaultActions,
|
|
409
|
+
search: {
|
|
410
|
+
before: (request) => {
|
|
411
|
+
if (request.params.action !== "search") {
|
|
412
|
+
return request;
|
|
413
|
+
}
|
|
414
|
+
request.query = {
|
|
415
|
+
...request.query,
|
|
416
|
+
searchProperty: "name",
|
|
417
|
+
};
|
|
418
|
+
return request;
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
},
|
|
408
422
|
titleProperty: "displayName",
|
|
409
423
|
listProperties: ["id", "name", "version", "createdAt"],
|
|
410
424
|
showProperties: ["id", "name", "version", "createdAt"],
|
|
@@ -412,38 +426,36 @@ class UI {
|
|
|
412
426
|
sort: { sortBy: "createdAt", direction: "desc" },
|
|
413
427
|
},
|
|
414
428
|
},
|
|
415
|
-
this.config.countDownloads &&
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
423
|
-
},
|
|
429
|
+
this.config.countDownloads && {
|
|
430
|
+
resource: DownloadStats,
|
|
431
|
+
options: {
|
|
432
|
+
actions: { ...defaultActions },
|
|
433
|
+
properties: {
|
|
434
|
+
periodType: {
|
|
435
|
+
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
424
436
|
},
|
|
425
|
-
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
426
|
-
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
427
|
-
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
428
|
-
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
429
437
|
},
|
|
438
|
+
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
439
|
+
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
440
|
+
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
441
|
+
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
430
442
|
},
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
},
|
|
443
|
+
},
|
|
444
|
+
this.config.countManifestViews && {
|
|
445
|
+
resource: ManifestViewStats,
|
|
446
|
+
options: {
|
|
447
|
+
actions: { ...defaultActions },
|
|
448
|
+
properties: {
|
|
449
|
+
periodType: {
|
|
450
|
+
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
440
451
|
},
|
|
441
|
-
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
442
|
-
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
443
|
-
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
444
|
-
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
445
452
|
},
|
|
453
|
+
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
454
|
+
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
455
|
+
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
456
|
+
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
446
457
|
},
|
|
458
|
+
},
|
|
447
459
|
].filter(Boolean),
|
|
448
460
|
rootPath: rootPath,
|
|
449
461
|
branding: {
|
package/lib/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import buildDebug from 'debug';
|
|
|
11
11
|
import { Umzug, SequelizeStorage } from 'umzug';
|
|
12
12
|
|
|
13
13
|
var name = "verdaccio-stats";
|
|
14
|
-
var version = "0.3.
|
|
14
|
+
var version = "0.3.2";
|
|
15
15
|
|
|
16
16
|
const plugin = {
|
|
17
17
|
name,
|
|
@@ -400,7 +400,21 @@ class UI {
|
|
|
400
400
|
{
|
|
401
401
|
resource: Package,
|
|
402
402
|
options: {
|
|
403
|
-
actions: {
|
|
403
|
+
actions: {
|
|
404
|
+
...defaultActions,
|
|
405
|
+
search: {
|
|
406
|
+
before: (request) => {
|
|
407
|
+
if (request.params.action !== "search") {
|
|
408
|
+
return request;
|
|
409
|
+
}
|
|
410
|
+
request.query = {
|
|
411
|
+
...request.query,
|
|
412
|
+
searchProperty: "name",
|
|
413
|
+
};
|
|
414
|
+
return request;
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
},
|
|
404
418
|
titleProperty: "displayName",
|
|
405
419
|
listProperties: ["id", "name", "version", "createdAt"],
|
|
406
420
|
showProperties: ["id", "name", "version", "createdAt"],
|
|
@@ -408,38 +422,36 @@ class UI {
|
|
|
408
422
|
sort: { sortBy: "createdAt", direction: "desc" },
|
|
409
423
|
},
|
|
410
424
|
},
|
|
411
|
-
this.config.countDownloads &&
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
419
|
-
},
|
|
425
|
+
this.config.countDownloads && {
|
|
426
|
+
resource: DownloadStats,
|
|
427
|
+
options: {
|
|
428
|
+
actions: { ...defaultActions },
|
|
429
|
+
properties: {
|
|
430
|
+
periodType: {
|
|
431
|
+
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
420
432
|
},
|
|
421
|
-
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
422
|
-
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
423
|
-
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
424
|
-
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
425
433
|
},
|
|
434
|
+
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
435
|
+
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
436
|
+
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
437
|
+
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
426
438
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
},
|
|
439
|
+
},
|
|
440
|
+
this.config.countManifestViews && {
|
|
441
|
+
resource: ManifestViewStats,
|
|
442
|
+
options: {
|
|
443
|
+
actions: { ...defaultActions },
|
|
444
|
+
properties: {
|
|
445
|
+
periodType: {
|
|
446
|
+
availableValues: PERIOD_TYPES.map((type) => ({ value: type, label: type })),
|
|
436
447
|
},
|
|
437
|
-
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
438
|
-
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
439
|
-
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
440
|
-
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
441
448
|
},
|
|
449
|
+
listProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
450
|
+
showProperties: ["id", "packageId", "periodType", "periodValue", "count", "createdAt", "updatedAt"],
|
|
451
|
+
filterProperties: ["packageId", "periodType", "periodValue", "createdAt", "updatedAt"],
|
|
452
|
+
sort: { sortBy: "updatedAt", direction: "desc" },
|
|
442
453
|
},
|
|
454
|
+
},
|
|
443
455
|
].filter(Boolean),
|
|
444
456
|
rootPath: rootPath,
|
|
445
457
|
branding: {
|