Skip to content

fix: inconsistent API spelling in docs and dashboard#2275

Merged
chronark merged 3 commits intounkeyed:mainfrom
Vardhaman619:fix-inconsistent-api-spelling-in-docs-and-dashboard
Oct 8, 2024
Merged

fix: inconsistent API spelling in docs and dashboard#2275
chronark merged 3 commits intounkeyed:mainfrom
Vardhaman619:fix-inconsistent-api-spelling-in-docs-and-dashboard

Conversation

@Vardhaman619
Copy link
Contributor

@Vardhaman619 Vardhaman619 commented Oct 8, 2024

What does this PR do?

This PR standardizes the spelling of "API" across the dashboard and documentation, addressing inconsistencies that can lead to confusion. By ensuring uniformity, we enhance clarity for users and contributors alike.

Fixes #2222

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

To verify the changes:

  • Review the dashboard and documentation for consistent spelling of "API"
  • Ensure that all instances of "API" are correctly spelled and formatted.

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated API documentation to improve clarity and consistency, including capitalization of "API."
    • Enhanced error documentation to reflect accurate categorization of unauthorized access.
  • Bug Fixes

    • Corrected spelling and capitalization errors in various components and documentation.
  • Documentation

    • Improved consistency in the use of "API" across multiple documents.
    • Updated @unkey/ratelimit library documentation to reflect changes in configuration parameters.

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2024

⚠️ No Changeset found

Latest commit: 5ad0013

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 8, 2024

@Vardhaman619 is attempting to deploy a commit to the Unkey Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:40pm
engineering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:40pm
play ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:40pm
workflows ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:40pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:40pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

📝 Walkthrough

Walkthrough

The pull request introduces several minor textual modifications across various components and documentation files. These changes primarily focus on ensuring consistent capitalization of the term "API" and correcting a specific error categorization in documentation. The updates do not alter any functionality or logic within the application, maintaining the existing structure and behavior of the components.

Changes

File Change Summary
apps/api/src/pkg/hono/app.ts Updated OpenAPI documentation title from "Unkey Api" to "Unkey API."
apps/dashboard/app/(app)/apis/[apiId]/settings/page.tsx Changed "Api ID" to "API ID" in SettingsPage component for consistency.
apps/dashboard/app/(app)/apis/[apiId]/settings/update-api-name.tsx Updated "Api Name" to "API Name" and "Api names are not customer facing." to "API names are not customer facing." in UpdateApiName component.
apps/dashboard/components/dashboard/api-key-table/index.tsx Corrected dialog title from "Revoke Api Key" to "Revoke API Key" and fixed spelling from "permanenty" to "permanently."
apps/docs/api-reference/errors/code/UNAUTHORIZED.mdx Changed openapi-schema from ErrInternalServerError to ErrUnauthorized.
apps/docs/concepts/identities/ratelimits.mdx Updated "Api" to "API" in the Ratelimits document for consistency.
apps/docs/libraries/py/services/apis.mdx Capitalized "API" throughout the ApiService documentation for consistency.
apps/docs/libraries/ts/ratelimit.mdx Updated documentation for Ratelimit class, replacing rootKey with namespace and adding details for timeout and other parameters.

Assessment against linked issues

Objective Addressed Explanation
Consistent "API" spelling in dashboard and docs (#2222)

Possibly related issues

Possibly related PRs

Suggested labels

Documentation, Dashboard, 🕹️ oss.gg, :joystick: 150 points, hacktoberfest

Suggested reviewers

  • mcstepp
  • chronark
  • perkinsjr

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@github-actions github-actions bot added 🕹️ 150 points Bug Something isn't working Good first issue Good for newcomers labels Oct 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2024

Thank you for following the naming conventions for pull request titles! 🙏

@Vardhaman619 Vardhaman619 changed the title Fix inconsistent api spelling in docs and dashboard Fix: inconsistent API spelling in docs and dashboard Oct 8, 2024
@Vardhaman619 Vardhaman619 changed the title Fix: inconsistent API spelling in docs and dashboard fix: inconsistent API spelling in docs and dashboard Oct 8, 2024
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: 0

🧹 Outside diff range and nitpick comments (4)
apps/docs/api-reference/errors/code/UNAUTHORIZED.mdx (1)

Line range hint 1-14: Consider enhancing the documentation with specific examples

The current content effectively describes the UNAUTHORIZED error and provides a clear solution. To further improve the documentation, consider adding:

  1. Common scenarios that might lead to this error (e.g., expired API key, insufficient permissions).
  2. A code snippet demonstrating the correct way to include the API key in the Authorization header.

These additions could provide more immediate assistance to users encountering this error.

apps/docs/libraries/ts/ratelimit.mdx (3)

150-153: LGTM! Consider adding a brief explanation for the namespace parameter.

The replacement of rootKey with namespace in the configuration object is a good change that aligns with the PR objectives. It should provide better organization for rate limits across different areas of an application.

Consider adding a brief explanation of how the namespace parameter helps in organizing rate limits, similar to the explanation provided for the rootKey parameter in the previous version.


Line range hint 165-191: Great improvements to the timeout configuration documentation!

The expanded explanation of the timeout configuration, including how to disable it and the default fallback response, greatly enhances the clarity of the documentation. The warning about Cloudflare Workers' time progression is a valuable addition for developers.

Consider adding a brief example of how to disable the timeout using timeout: false to make it even clearer for users.


Line range hint 193-209: Excellent addition of examples for the onError configuration!

The inclusion of examples demonstrating how to configure the onError handler to either allow or reject requests greatly improves the usability of the documentation. This change aligns well with the PR objectives of enhancing clarity and user experience.

In the example for rejecting the request, the success property is set to true. This appears to be a typo and should be false to correctly demonstrate request rejection. Consider updating it as follows:

 Example rejecting the request:
  ```ts
-   onError: ()=> ({ success: true, limit: 0, remaining: 0, reset: 0})
+   onError: ()=> ({ success: false, limit: 0, remaining: 0, reset: 0})

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**

<details>
<summary>📥 Commits</summary>

Files that changed from the base of the PR and between 20515286a8d7aa4363046a9f46998f49a03f9513 and 5ad0013be04d3668b15694d671545e9395008bc3.

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* apps/api/src/pkg/hono/app.ts (1 hunks)
* apps/dashboard/app/(app)/apis/[apiId]/settings/page.tsx (1 hunks)
* apps/dashboard/app/(app)/apis/[apiId]/settings/update-api-name.tsx (1 hunks)
* apps/dashboard/components/dashboard/api-key-table/index.tsx (1 hunks)
* apps/dashboard/lib/trpc/routers/vercel.ts (1 hunks)
* apps/docs/api-reference/errors/code/UNAUTHORIZED.mdx (1 hunks)
* apps/docs/concepts/identities/ratelimits.mdx (1 hunks)
* apps/docs/libraries/py/services/apis.mdx (1 hunks)
* apps/docs/libraries/ts/ratelimit.mdx (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (7)</summary>

* apps/api/src/pkg/hono/app.ts
* apps/dashboard/app/(app)/apis/[apiId]/settings/page.tsx
* apps/dashboard/app/(app)/apis/[apiId]/settings/update-api-name.tsx
* apps/dashboard/components/dashboard/api-key-table/index.tsx
* apps/dashboard/lib/trpc/routers/vercel.ts
* apps/docs/concepts/identities/ratelimits.mdx
* apps/docs/libraries/py/services/apis.mdx

</details>

<details>
<summary>🧰 Additional context used</summary>





</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>apps/docs/api-reference/errors/code/UNAUTHORIZED.mdx (1)</summary><blockquote>

`3-3`: **Excellent correction of the error schema!**

This change from `ErrInternalServerError` to `ErrUnauthorized` is crucial for maintaining consistency between the error description and its schema. It accurately reflects the nature of the UNAUTHORIZED error, which is about authorization failure rather than an internal server error.

This update enhances the accuracy of the API documentation and aligns well with the overall objective of improving consistency across the application.

</blockquote></details>
<details>
<summary>apps/docs/libraries/ts/ratelimit.mdx (1)</summary><blockquote>

Line range hint `1-209`: **Overall, excellent improvements to the documentation!**

The changes made to this file significantly enhance the clarity and usability of the `@unkey/ratelimit` library documentation. The updates align well with the PR objectives of standardizing API-related terminology and improving user experience. The expanded explanations for `namespace`, `timeout`, and `onError` configurations provide developers with a more comprehensive understanding of how to implement and configure the rate limiting functionality.

These improvements effectively address the issues mentioned in the linked issue #2222 by providing consistent and clear documentation.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@chronark chronark merged commit edbeb2d into unkeyed:main Oct 8, 2024
@oss-gg
Copy link

oss-gg bot commented Oct 8, 2024

Awarding Vardhaman619: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/Vardhaman619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent "API" spelling in dashboard and docs

2 participants