Skip to content

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

Closed
jaggederest wants to merge 2 commits intomainfrom
jaggederest/api_refactor
Closed

minor api refactor - just an initial PR as a test#531
jaggederest wants to merge 2 commits intomainfrom
jaggederest/api_refactor

Conversation

@jaggederest
Copy link
Copy Markdown
Contributor

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
Copy Markdown

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.

2 participants