From d6d9545db5d531684307059c8c2b6876766e07d5 Mon Sep 17 00:00:00 2001 From: alex-omophub Date: Sun, 31 May 2026 15:51:45 +0100 Subject: [PATCH 1/2] Update CHANGELOG and correct `sortBy` enum values in options interfaces to align with API specifications, fixing TypeScript type errors for ListVocabulariesOptions, VocabularyConceptsOptions, and BasicSearchOptions. --- CHANGELOG.md | 7 +++++++ src/search/interfaces/basic-search-options.ts | 2 +- src/vocabularies/interfaces/list-vocabularies-options.ts | 2 +- src/vocabularies/interfaces/vocabulary-concepts-options.ts | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e38742..cd95196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format ## [Unreleased] +### Fixed + +- Corrected `sortBy` enum values across three options interfaces to match what the API actually accepts. TypeScript users were previously offered values that the server rejects with `validation_error`: + - `ListVocabulariesOptions.sortBy`: was `'name' | 'concept_count' | 'last_updated'`, now `'name' | 'priority' | 'updated'`. + - `VocabularyConceptsOptions.sortBy`: was `'name' | 'concept_count' | 'last_updated'`, now `'name' | 'concept_id' | 'concept_code'`. + - `BasicSearchOptions.sortBy`: was `'relevance' | 'name' | 'concept_count' | 'last_updated'`, now `'relevance' | 'name' | 'code' | 'date'`. + ## [1.0.0] - 2026-05-31 ### Added diff --git a/src/search/interfaces/basic-search-options.ts b/src/search/interfaces/basic-search-options.ts index 99190e4..5d0637a 100644 --- a/src/search/interfaces/basic-search-options.ts +++ b/src/search/interfaces/basic-search-options.ts @@ -11,6 +11,6 @@ export interface BasicSearchOptions extends PaginationOptions { /** Minimum relevance score (0–1). */ minScore?: number; exactMatch?: boolean; - sortBy?: 'relevance' | 'name' | 'concept_count' | 'last_updated'; + sortBy?: 'relevance' | 'name' | 'code' | 'date'; sortOrder?: 'asc' | 'desc'; } diff --git a/src/vocabularies/interfaces/list-vocabularies-options.ts b/src/vocabularies/interfaces/list-vocabularies-options.ts index d2e0dd6..a90f7c6 100644 --- a/src/vocabularies/interfaces/list-vocabularies-options.ts +++ b/src/vocabularies/interfaces/list-vocabularies-options.ts @@ -3,6 +3,6 @@ import type { PaginationOptions } from '../../common/interfaces/pagination.js'; export interface ListVocabulariesOptions extends PaginationOptions { includeStats?: boolean; includeInactive?: boolean; - sortBy?: 'name' | 'concept_count' | 'last_updated'; + sortBy?: 'name' | 'priority' | 'updated'; sortOrder?: 'asc' | 'desc'; } diff --git a/src/vocabularies/interfaces/vocabulary-concepts-options.ts b/src/vocabularies/interfaces/vocabulary-concepts-options.ts index 07b7615..6c65834 100644 --- a/src/vocabularies/interfaces/vocabulary-concepts-options.ts +++ b/src/vocabularies/interfaces/vocabulary-concepts-options.ts @@ -8,6 +8,6 @@ export interface VocabularyConceptsOptions extends PaginationOptions { includeInvalid?: boolean; includeRelationships?: boolean; includeSynonyms?: boolean; - sortBy?: 'name' | 'concept_count' | 'last_updated'; + sortBy?: 'name' | 'concept_id' | 'concept_code'; sortOrder?: 'asc' | 'desc'; } From 5c255114352fa5f049dba34224a52ee8c973a60d Mon Sep 17 00:00:00 2001 From: alex-omophub Date: Mon, 1 Jun 2026 11:59:08 +0100 Subject: [PATCH 2/2] Release version 1.0.1: Update `client.search.semantic()` to use the canonical path `GET /v1/search/semantic`, while maintaining the legacy alias for backward compatibility. Bump version in package.json and version.ts, and update CHANGELOG accordingly. --- CHANGELOG.md | 11 +++++++++-- package.json | 2 +- src/common/utils/normalize-search-response.ts | 2 +- src/search/search.ts | 2 +- src/version.ts | 2 +- test/search/search.test.ts | 4 ++-- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd95196..6f82c69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format ## [Unreleased] +## [1.0.1] - 2026-06-01 + +### Changed + +- `client.search.semantic()` now calls the canonical path `GET /v1/search/semantic` instead of `GET /v1/concepts/semantic-search`. The legacy path remains a permanent server-side alias, so older SDK installations continue to work — no breaking change. The `User-Agent` and `__version__` are bumped to `1.0.1`. + ### Fixed - Corrected `sortBy` enum values across three options interfaces to match what the API actually accepts. TypeScript users were previously offered values that the server rejects with `validation_error`: @@ -70,7 +76,8 @@ client.fhir - resolve, resolveBatch, resolveCodeableConcept Standalone: omophubFhirUrl, getApiKey, setApiKey, hasApiKey ``` - -[Unreleased]: https://github.com/OMOPHub/omophub-node/compare/v1.0.0...HEAD + +[Unreleased]: https://github.com/OMOPHub/omophub-node/compare/v1.0.1...HEAD +[1.0.1]: https://github.com/OMOPHub/omophub-node/releases/tag/v1.0.1 [1.0.0]: https://github.com/OMOPHub/omophub-node/releases/tag/v1.0.0 diff --git a/package.json b/package.json index 2039b41..33dc808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@omophub/omophub-node", - "version": "1.0.0", + "version": "1.0.1", "description": "Official OMOPHub Node.js / TypeScript SDK for the OHDSI medical vocabularies API - search, lookup, map, and navigate concepts across SNOMED, ICD10, RxNorm, LOINC, and more.", "type": "module", "main": "dist/index.js", diff --git a/src/common/utils/normalize-search-response.ts b/src/common/utils/normalize-search-response.ts index 5b3667e..815b4d6 100644 --- a/src/common/utils/normalize-search-response.ts +++ b/src/common/utils/normalize-search-response.ts @@ -40,7 +40,7 @@ export function normaliseBasicSearchData(raw: unknown): SearchResult { } /** - * Normalises `GET /concepts/semantic-search` into a flat + * Normalises `GET /search/semantic` into a flat * `SemanticSearchResult[]` for the iter/all helpers. Handles both * `{ results: [...] }` and bare-array forms. */ diff --git a/src/search/search.ts b/src/search/search.ts index 046ab2e..1b34ee5 100644 --- a/src/search/search.ts +++ b/src/search/search.ts @@ -181,7 +181,7 @@ export class Search { options: SemanticSearchOptions & GetOptions = {}, ): Promise> { const { signal, headers, query: extraQuery, ...flags } = options; - const response = await this.client.get('/concepts/semantic-search', { + const response = await this.client.get('/search/semantic', { signal, headers, query: { ...flags, ...extraQuery, query }, diff --git a/src/version.ts b/src/version.ts index 112dba0..d18e3ac 100644 --- a/src/version.ts +++ b/src/version.ts @@ -2,4 +2,4 @@ * SDK version. Bumped in lockstep with package.json. Surfaced in the * User-Agent header so server-side logs can attribute traffic to a release. */ -export const __version__ = '0.0.1'; +export const __version__ = '1.0.1'; diff --git a/test/search/search.test.ts b/test/search/search.test.ts index 84976f2..7e4bf96 100644 --- a/test/search/search.test.ts +++ b/test/search/search.test.ts @@ -217,7 +217,7 @@ describe('client.search.autocomplete', () => { }); describe('client.search.semantic', () => { - test('hits GET /concepts/semantic-search with snake-cased query', async () => { + test('hits GET /search/semantic with snake-cased query', async () => { const fetchMock = createMockFetch(); enqueueSuccess(fetchMock, { results: [], search_metadata: {} }); const client = new OMOPHub('oh_test', { fetch: fetchMock }); @@ -228,7 +228,7 @@ describe('client.search.semantic', () => { pageSize: 20, }); const { url } = lastCall(fetchMock); - expect(url).toContain('/concepts/semantic-search'); + expect(url).toContain('/search/semantic'); expect(url).toContain('query=high+blood+sugar'); expect(url).toContain('vocabulary_ids=SNOMED'); expect(url).toContain('standard_concept=S');