mirror of
https://github.com/gotempsh/temps.git
synced 2026-04-25 06:15:55 +03:00
[PR #8] [MERGED] fix(cli): add hardcoded fallback for service required parameters #12
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/temps#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/gotempsh/temps/pull/8
Author: @dviejokfs
Created: 2/17/2026
Status: ✅ Merged
Merged: 2/17/2026
Merged by: @dviejokfs
Base:
main← Head:fix/cli-service-params-fallback📝 Commits (1)
faa31fffix(cli): add hardcoded fallback for service required parameters📊 Changes
1 file changed (+25 additions, -7 deletions)
View changed files
📝
apps/temps-cli/src/lib/service-setup.ts(+25 -7)📄 Description
Summary
GET /external-services/types/{type}/parameters) returns{ error }without throwing, causingrequiredFieldsto stay emptyKNOWN_REQUIRED_FIELDShardcoded fallback map so PostgreSQL and MongoDB always getdatabaseandusernamepopulated regardless of whether the schema fetch succeedsRoot cause
The
@hey-apiclient doesn't throw on HTTP errors — it returns{ data: undefined, error: ... }. The previoustry/catchonly caught network-level exceptions, not API-level errors. When the schema call returned an error response,requiredFieldsstayed[]and no parameters were generated.Fix
Two-layer approach:
errorfrom the API response (not just rely ontry/catch)KNOWN_REQUIRED_FIELDS[serviceType]which mapspostgres→['database', 'username']andmongodb→['database', 'username']This ensures service creation works even if the schema endpoint is unreachable, returns an error, or changes format.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.