cnpm / cnpmjs.org

‼️ ‼️ ‼️ ‼️ DEPRECATED, please use https://github.com/cnpm/cnpmcore ‼️ ‼️ ‼️ ‼️
https://npmmirror.com
Other
3.55k stars 746 forks source link

feat: add changes api #1734

Closed elrrrrrrr closed 2 years ago

elrrrrrrr commented 2 years ago

Added a new api: /-/all/changes, returns change records through the Tag table, regardless of whether the package is private or public.

This api is mainly used for other registries for synchronization.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 00330d589a0fbaf7184e295071dd801bdb97599b into 4d534cad024f08923b7d4df57d87d14fa96a975a - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 42eff563fe9fd2852af37159daf61316fc265f5b into 4d534cad024f08923b7d4df57d87d14fa96a975a - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging e27ff952a383d93847a43b9da33bbe49abb87e3f into 4d534cad024f08923b7d4df57d87d14fa96a975a - view on LGTM.com

new alerts:

codecov[bot] commented 2 years ago

Codecov Report

Merging #1734 (c6afadf) into master (4d534ca) will decrease coverage by 0.37%. The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master    #1734      +/-   ##
==========================================
- Coverage   86.02%   85.64%   -0.38%     
==========================================
  Files         102      103       +1     
  Lines        4773     4821      +48     
  Branches      918      922       +4     
==========================================
+ Hits         4106     4129      +23     
- Misses        667      692      +25     
Impacted Files Coverage Δ
controllers/utils.js 76.66% <75.00%> (-0.08%) :arrow_down:
services/package.js 96.19% <82.60%> (-0.74%) :arrow_down:
controllers/registry/package/changes.js 94.44% <94.44%> (ø)
routes/registry.js 100.00% <100.00%> (ø)
services/common.js 100.00% <100.00%> (ø)
controllers/sync_module_worker.js 77.72% <0.00%> (-1.78%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us.

killagu commented 2 years ago

Changes should include package version release, tag modify, maintainer add/remove, unpublish.

elrrrrrrr commented 2 years ago

Changes should include package version release, tag modify, maintainer add/remove, unpublish.

I have added some event types:

But we only have the updated data. So we can't calculate some event message, such as PACKAGE_TAG_CHANGED PACKAGE_MAINTAINER_ADDED PACKAGE_MAINTAINER_CHANGED.

For the same reason, we can't calculate a reliable seqId. let's use gmt_modified field instead of .

cc @killagu @gemwuu

killagu commented 2 years ago