Skip to content

minor api refactor - just an initial PR as a test #531

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

Closed
wants to merge 2 commits into from

Conversation

jaggederest
Copy link

No description provided.

@jaggederest jaggederest self-assigned this Jun 13, 2025
@jaggederest jaggederest requested a review from Copilot June 13, 2025 00:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the API module by centralizing configuration access, extracting helper routines for file/path management, and unifying streaming logic.

  • Added config, path, cert/key getters, and readFile helpers to reduce repetition
  • Refactored needToken and createHttpAgent to use new helpers
  • Extracted shared stream‐to‐ReadableStream code into getStreamFromResponse and updated the fetch adapter
Comments suppressed due to low confidence (2)

src/api.ts:41

  • [nitpick] The name checkEmptyString suggests a boolean return; rename this to something like nonEmptyStringOrUndefined to clarify its behavior.
function checkEmptyString(str: string): string | undefined {

src/api.ts:187

  • [nitpick] Indentation here is inconsistent with surrounding code; aligning this block will improve readability.
const getHeaderFromResponse = (name: string) => {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jaggederest jaggederest deleted the jaggederest/api_refactor branch June 16, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant