Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: trends api #697

Merged
merged 1 commit into from
Jun 3, 2024
Merged

chore: trends api #697

merged 1 commit into from
Jun 3, 2024

Conversation

elrrrrrrr
Copy link
Member

@elrrrrrrr elrrrrrrr commented Jun 3, 2024

  • πŸ“š add doc for the trends API.

  • πŸ“š 添加 trends api η›Έε…³ζ–‡ζ‘£

Summary by CodeRabbit

  • Documentation
    • Added sections for [Token] and [Trend] in the Registry API documentation.
    • Introduced a new endpoint GET /downloads/range/:start::end/:pkgName for fetching package download trends.
    • Included sample response data for the Trend endpoint.

@elrrrrrrr elrrrrrrr added the documentation Improvements or additions to documentation label Jun 3, 2024
@elrrrrrrr elrrrrrrr requested a review from fengmk2 June 3, 2024 14:13
Copy link
Contributor

coderabbitai bot commented Jun 3, 2024

Walkthrough

The docs/registry-api.md file has been updated to include new sections for [Token] and [Trend]. A new endpoint, GET /downloads/range/:start::end/:pkgName, has been introduced under the Trend section to fetch download trends for a specific package. Sample response data has also been added to illustrate the download trends and versions with corresponding download counts.

Changes

File Change Summary
docs/registry-api.md Added [Token] and [Trend] sections. Introduced GET /downloads/range/:start::end/:pkgName endpoint with sample response data.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant API
    participant Database
    
    User->>API: GET /downloads/range/:start::end/:pkgName
    API->>Database: Fetch download trends for :pkgName between :start and :end
    Database-->>API: Return download trends data
    API-->>User: Return download trends response
Loading

Poem

In the land of code, where data flows,
A new trend endpoint now bestows.
With tokens and trends, insights to glean,
Download counts in a range, a developer's dream.
πŸŽ‰πŸ“ˆ


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 317e24d and df86231.

Files selected for processing (1)
  • docs/registry-api.md (2 hunks)
Additional context used
LanguageTool
docs/registry-api.md

[misspelling] ~85-~85: Use β€œan” instead of β€˜a’ if the following word starts with a vowel sound, e.g.Β β€˜an article’, β€˜an hour’.
Context: ...-package) * [List packages since from a update time](/docs/registry-api.md#list...


[misspelling] ~607-~607: Use β€œan” instead of β€˜a’ if the following word starts with a vowel sound, e.g.Β β€˜an article’, β€˜an hour’.
Context: ...rue } ### List packages since from a update time GET /-/all/since?stale...


[uncategorized] ~713-~713: Possible missing preposition found.
Context: ....1": "latest" } } } ### List package names by users bash GET /-/by-user/...


[style] ~719-~719: It’s more common nowadays to write this noun as one word.
Context: ...ther1[|$another2...]] ``` * username user name like `fengmk2` * also support multi use...


[uncategorized] ~719-~719: The common word order is β€œalso like”.
Context: ...other2...]] ``` * username user name like `fengmk2` * also support multi users by `name1|name2|nam...


[misspelling] ~755-~755: Use β€œan” instead of β€˜a’ if the following word starts with a vowel sound, e.g.Β β€˜an article’, β€˜an hour’.
Context: ...gistry-api.md#add-a-new-user) - [Update a exists user](/docs/registry-api.md#upda...


[misspelling] ~932-~932: Use β€œan” instead of β€˜a’ if the following word starts with a vowel sound, e.g.Β β€˜an article’, β€˜an hour’.
Context: ...ent update conflict." } ``` ### Update a exists user * Authentication required....

Markdownlint
docs/registry-api.md

752-752: Expected: asterisk; Actual: dash
Unordered list style


753-753: Expected: asterisk; Actual: dash
Unordered list style


754-754: Expected: asterisk; Actual: dash
Unordered list style


755-755: Expected: asterisk; Actual: dash
Unordered list style


971-971: Expected: asterisk; Actual: dash
Unordered list style


972-972: Expected: asterisk; Actual: dash
Unordered list style


973-973: Expected: asterisk; Actual: dash
Unordered list style


60-60: null
Dollar signs used before commands without showing output


66-66: null
Dollar signs used before commands without showing output


618-618: null
Dollar signs used before commands without showing output


725-725: null
Dollar signs used before commands without showing output


726-726: null
Dollar signs used before commands without showing output


983-983: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


994-994: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


1008-1008: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


1015-1015: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


1018-1018: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


984-984: null
Fenced code blocks should be surrounded by blank lines


995-995: null
Fenced code blocks should be surrounded by blank lines


1019-1019: null
Fenced code blocks should be surrounded by blank lines


1009-1009: null
Lists should be surrounded by blank lines


255-255: null
Emphasis used instead of a heading


96-96: null
Fenced code blocks should have a language specified


257-257: null
Fenced code blocks should have a language specified


345-345: null
Fenced code blocks should have a language specified


457-457: null
Fenced code blocks should have a language specified


483-483: null
Fenced code blocks should have a language specified


517-517: null
Fenced code blocks should have a language specified


569-569: null
Fenced code blocks should have a language specified


587-587: null
Fenced code blocks should have a language specified


593-593: null
Fenced code blocks should have a language specified


609-609: null
Fenced code blocks should have a language specified


761-761: null
Fenced code blocks should have a language specified


801-801: null
Fenced code blocks should have a language specified


888-888: null
Fenced code blocks should have a language specified


936-936: null
Fenced code blocks should have a language specified


979-979: null
Fenced code blocks should have a language specified


1011-1011: null
Fenced code blocks should have a language specified


1036-1036: null
Fenced code blocks should have a language specified


1046-1046: null
Fenced code blocks should have a language specified

Additional comments not posted (1)
docs/registry-api.md (1)

11-12: The addition of the [Token](/docs/registry-api.md#token) and [Trend](/docs/registry-api.md#trend) sections in the table of contents is well-placed and enhances the navigability of the document.

docs/registry-api.md Show resolved Hide resolved
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 96.80%. Comparing base (9664504) to head (df86231).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #697   +/-   ##
=======================================
  Coverage   96.80%   96.80%           
=======================================
  Files         181      181           
  Lines       18026    18026           
  Branches     2343     2341    -2     
=======================================
  Hits        17450    17450           
  Misses        576      576           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@fengmk2 fengmk2 merged commit 038736d into master Jun 3, 2024
13 checks passed
@fengmk2 fengmk2 deleted the doc-range-api branch June 3, 2024 14:51
```json
HTTP/1.1 200 OK

// /downloads/range/2024-01-01:2024-12-31/cnpmcore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants