From 7494aa88039bafdc599f1d4d8f2c8128b8da8fe7 Mon Sep 17 00:00:00 2001 From: ZackFan Date: Wed, 8 Jul 2026 14:19:21 +0800 Subject: [PATCH] refactor(etf): remove code query param to match server MR !376 Server-side removed the optional `code` filter param from GET /v1.0/stock/ownership/etf-holdings/:symbol. Drop it from the SDK's advertised params interface and update the test accordingly. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Wfv3Xw3onZwDEEZQ5dvRZr --- src/rest/stock/ownership/etf-holdings.ts | 1 - test/rest-client.spec.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rest/stock/ownership/etf-holdings.ts b/src/rest/stock/ownership/etf-holdings.ts index abfe7eb..d3b58d4 100644 --- a/src/rest/stock/ownership/etf-holdings.ts +++ b/src/rest/stock/ownership/etf-holdings.ts @@ -5,7 +5,6 @@ export interface RestStockOwnershipEtfHoldingsParams { from?: string; to?: string; sort?: 'asc' | 'desc'; - code?: string; } export interface RestStockOwnershipEtfHoldingsComponent { diff --git a/test/rest-client.spec.ts b/test/rest-client.spec.ts index 612461c..ba2693a 100644 --- a/test/rest-client.spec.ts +++ b/test/rest-client.spec.ts @@ -340,9 +340,9 @@ describe('RestClient', () => { it('should request with query params', async () => { const client = new RestClient({ apiKey: 'api-key' }); const stock = client.stock as RestStockClient; - await stock.ownership.etfHoldings({ symbol: '0050', from: '2026-05-01', to: '2026-05-21', sort: 'desc', code: '2330' }); + await stock.ownership.etfHoldings({ symbol: '0050', from: '2026-05-01', to: '2026-05-21', sort: 'desc' }); expect(fetch).toBeCalledWith( - 'https://api.fugle.tw/marketdata/v1.0/stock/ownership/etf-holdings/0050?code=2330&from=2026-05-01&sort=desc&to=2026-05-21', + 'https://api.fugle.tw/marketdata/v1.0/stock/ownership/etf-holdings/0050?from=2026-05-01&sort=desc&to=2026-05-21', { headers: { 'X-API-KEY': 'api-key' } }, ); });