Skip to content

Refactor into a shared API client and updated publish to use it - #26

Merged
peytoncasper merged 3 commits into
mainfrom
refactor/shared-api-client-v2
Jan 29, 2026
Merged

peytoncasper merged 3 commits into
mainfrom
refactor/shared-api-client-v2

Conversation

@peytoncasper

Copy link
Copy Markdown
Contributor

This refactors the config into a BaseConfig and then the additional config pieces needed for Publish. A follow on PR will add support for Invoke based on this shared API client.

Extract reusable configuration helpers for CLI commands:
- BaseConfig interface for API key and URL
- requireApiKey/requireProjectId for env validation
- getApiUrl for URL resolution with fallbacks
- validateApiKeyFormat for API key validation
- loadBaseConfig for simple config loading
Extract reusable API helpers for CLI commands:
- parseErrorResponse for handling API error responses
- apiGet/apiPost for authenticated requests
- pollUntil for generic status polling with configurable options
- PublishConfig now extends BaseConfig
- Use requireApiKey/requireProjectId/getApiUrl from shared
- Use parseErrorResponse for error handling
- Use pollUntil for build status polling
@peytoncasper
peytoncasper merged commit 4e071ce into main Jan 29, 2026
3 checks passed
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