Skip to content

v1 prep#6

Merged
alex-omophub merged 20 commits into
mainfrom
develop
May 31, 2026
Merged

v1 prep#6
alex-omophub merged 20 commits into
mainfrom
develop

Conversation

@alex-omophub
Copy link
Copy Markdown
Member

@alex-omophub alex-omophub commented May 31, 2026

Summary by cubic

Prepares the v1.0.0 release of @omophub/omophub-node with a typed OMOPHub client (concepts, search, mappings, relationships, hierarchy, domains, vocabularies) and a FHIR resolver. Adds docs, examples, tests, and improved CI/publish workflows; hardens auth, retry/backoff (RFC 9110 Retry-After), and pagination.

  • New Features

    • OMOPHub client: concepts, search (basic/advanced/autocomplete), mappings, relationships, hierarchy, domains, vocabularies, and FHIR resolve (single, batch, CodeableConcept) with omophubFhirUrl.
    • HTTP layer: per-call headers/query/AbortSignal/timeout, idempotency key (POST), and retries on 429/502/503/504 or network errors with full‑jitter backoff honoring Retry-After. POSTs are safely retried on 429 even without an idempotency key because the server declines without side effects.
    • Errors + pagination: methods return { data, error, meta, headers }; misuse throws OMOPHubError; async iterators throw OMOPHubIteratorError. Async pagination helpers and fetch‑all; request keys auto snake_cased; normalized search responses.
    • Tooling/CI/release: strict TypeScript, Biome, Vitest with coverage, e2e suite and runnable examples, CI on Node 22/24, npm publish with provenance. CI integration job runs only on pushes or manual dispatches to main/develop (branch‑gated to protect API keys).
    • Hardening: trim whitespace in setApiKey; strict RFC 9110 Retry-After parsing; pagination helpers handle outer envelopes and bare arrays.
  • Migration

    • Requires Node 22+.
    • Set OMOPHUB_API_KEY or pass the key to new OMOPHub('oh_...').

Written for commit f040834. Summary will update on new commits.

Review in cubic

alex-omophub and others added 15 commits May 29, 2026 23:20
…configuration files, client implementation, and CI/CD workflows. Added .gitignore, README, changelog, and basic error handling. Implemented request methods with retry logic and pagination support.
…ode.js version requirement, and improve error handling. Introduced methods for concepts and domains, updated changelog, and refined query building logic. Added synthetic error handling for client-side validation and improved retry logic for API requests.
… type definitions. Ensure positional `query` argument takes precedence over options, and streamline `GetConceptByCodeOptions` to inherit from `GetConceptOptions`. Update `list` method in domains to return non-paginated results. Add tests to validate new behavior.
Initial project setup with TypeScript SDK for OMOPHub API
…esources. Introduce methods for fetching concept hierarchy, ancestors, descendants, and mappings. Implement pagination utilities and normalize search response shapes. Update changelog to reflect new features and improvements.
…esponse handling. Update `ConceptRelationshipsOptions` to include pagination options, enhance error messages for empty input arrays, and normalize search response structures. Add tests to ensure proper error handling for invalid inputs.
Enhance SDK with new hierarchy, mappings, and relationships
…ting processes. Enhance README with usage examples and configuration details. Add comprehensive e2e test suite covering various API interactions, including error handling and response validation. Introduce new TypeScript configuration for e2e tests and implement minimal environment variable loading for test execution.
…ng and comment handling. Update softThrottle implementation for better API rate limiting across test files. Modify error handling in tests to account for rate limit exceeded scenarios. Introduce common options interface for FHIR resolver methods to reduce redundancy. Add tests for setApiKey to ensure proper error handling for read-only environment scenarios.
…nsive features including a new FHIR resolver, enhanced error handling, and improved API interactions. Updated documentation and examples for better user guidance. Updated dependencies and TypeScript configurations for improved performance and compatibility.
…accept top-level and nested display fields for semantic fallback, and refine mapping interface documentation. Add tests for new FHIR resolver functionality.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 147 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

Comment thread src/common/utils/to-snake-case.ts Outdated
Comment thread src/common/utils/paginate.ts
Comment thread src/auth/auth.ts Outdated
Comment thread src/common/utils/backoff.ts Outdated
Comment thread src/common/utils/backoff.ts Outdated
…ata processing. Trim whitespace in setApiKey before persisting, enhance parseRetryAfter to strictly validate input formats, and update pagination functions to correctly handle outer envelope responses. Add tests for new behaviors and edge cases.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/common/utils/backoff.ts Outdated
alex-omophub added 2 commits May 31, 2026 14:11
…mats by implementing full regex checks for `IMF-fixdate`, `rfc850-date`, and `asctime-date`. Update tests to cover rejection of malformed dates and acceptance of valid formats, ensuring compliance with RFC 9110 specifications.
…ucing a new integration job for end-to-end tests. The integration job runs on pushes to main and develop branches, ensuring secure testing against the live API while avoiding exposure of sensitive keys in pull requests.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread .github/workflows/ci.yml Outdated
alex-omophub added 2 commits May 31, 2026 14:21
…, ensuring it only runs on pushes or manual dispatches to main and develop branches. This change enhances security by preventing exposure of sensitive API keys during pull request workflows.
…ucing `isNoSideEffectStatus` function. Update `isRetryableRequest` to allow retries for non-idempotent requests when the server declines without processing. Enhance tests to verify behavior for 429 responses.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/client.ts">

<violation number="1" location="src/client.ts:200">
P1: This retry condition now allows POST/PATCH retries without an `Idempotency-Key` on 429 responses, which breaks the SDK’s documented retry contract for non-idempotent requests.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/client.ts
if (
isRetryableStatus(response.status) &&
attempt < this.maxRetries &&
(isNoSideEffectStatus(response.status) || isRetryableRequest(method, headers))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This retry condition now allows POST/PATCH retries without an Idempotency-Key on 429 responses, which breaks the SDK’s documented retry contract for non-idempotent requests.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/client.ts, line 200:

<comment>This retry condition now allows POST/PATCH retries without an `Idempotency-Key` on 429 responses, which breaks the SDK’s documented retry contract for non-idempotent requests.</comment>

<file context>
@@ -197,7 +197,7 @@ export class OMOPHub {
           isRetryableStatus(response.status) &&
           attempt < this.maxRetries &&
-          isRetryableRequest(method, headers)
+          (isNoSideEffectStatus(response.status) || isRetryableRequest(method, headers))
         ) {
           const retryAfter = response.headers.get('retry-after');
</file context>

@alex-omophub alex-omophub merged commit 21431c8 into main May 31, 2026
7 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.

1 participant