mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* feat(api): EN-1023 expose connector capabilities on v3
Add `GET /v3/connectors/capabilities` (full catalog, ETag-cached for the
stateless console) and `GET /v3/connectors/{connectorID}/capabilities`,
and inline a `capabilities` field on each row of `v3ListConnectors` so
platform-ui can gate per-connector submenus (Accounts/Payments/Transfers)
on what the underlying plugin actually supports.
Capability owns its JSON wire encoding (MarshalJSON/UnmarshalJSON) so
the format stays aligned with the DB Value/Scan representation.
Co-authored-by: Cursor <[email protected]>
* fix(api): EN-1023 address CodeRabbit review
- Replace `new(value)` with the local-variable `&v` pattern used elsewhere
in v3 for `api.BaseResponse.Data`.
- Service: drop the registry error from the 404 translation, honouring
the comment's non-leak intent.
- List handler: normalise the storage provider through `ToV3Provider`
before looking up capabilities so legacy v2 rows (`"STRIPE"`, etc.) hit
the registry's lowercase keys; test now exercises that path.
- Registry: clone capability slices in `GetAllCapabilities` so callers
can't mutate plugin registrations through the returned map.
- E2E: wait for the uninstall workflow via the shared helper and assert a
concrete capability instead of just non-nil.
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Cursor <[email protected]>
16 lines
405 B
Go
16 lines
405 B
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
type V3ConnectorCapabilitiesResponse struct {
|
|
// Map of provider name to the capabilities its plugin advertises.
|
|
Data map[string][]V3Capability `json:"data"`
|
|
}
|
|
|
|
func (o *V3ConnectorCapabilitiesResponse) GetData() map[string][]V3Capability {
|
|
if o == nil {
|
|
return map[string][]V3Capability{}
|
|
}
|
|
return o.Data
|
|
}
|