Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 6.0.0 - 2026-02-10
* refactor: simplify upload request structure and remove user_id fields
* Refactor the code upload request interface to use a single unified structure instead
* of separate CSV and JSON variants. Remove user_id fields from multiple template types
* to simplify the data model and improve API consistency.
* Key changes:
* Consolidate UploadRequest from discriminated union to single interface with format field
* Remove user_id fields from ChatMessageTemplate, ChatSessionTemplate, and other templates
* Move UploadRequest from types to client/requests directory
* Update documentation and test fixtures to reflect simplified structure
* Maintain backward compatibility for upload functionality
* 🌿 Generated with Fern

## 5.3.0 - 2026-02-09
* feat: add custom code system export endpoint
* Add new exportCustomCodeSystem method to the construe client that allows exporting custom (non-builtin) code systems as JSON files. This feature enables users to backup and transfer code systems between instances.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phenoml",
"version": "5.3.0",
"version": "6.0.0",
"private": false,
"repository": "github:PhenoML/phenoml-ts-sdk",
"type": "commonjs",
Expand Down
7 changes: 2 additions & 5 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,9 @@ subsequently use the code system for construe/extract and lang2fhir/create (comi

```typescript
await client.construe.uploadCodeSystem({
format: "csv",
name: "CUSTOM_CODES",
version: "1.0",
file: "file",
code_col: "code",
desc_col: "description"
format: "csv"
});

```
Expand All @@ -1193,7 +1190,7 @@ await client.construe.uploadCodeSystem({
<dl>
<dd>

**request:** `phenoml.UploadRequest`
**request:** `phenoml.construe.UploadRequest`

</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class phenomlClient {
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "phenoml",
"X-Fern-SDK-Version": "5.3.0",
"User-Agent": "phenoml/5.3.0",
"X-Fern-SDK-Version": "6.0.0",
"User-Agent": "phenoml/6.0.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/agent/types/ChatMessageTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export interface ChatMessageTemplate {
created?: string;
/** Message updated time */
updated?: string;
/** User ID */
user_id?: string;
/** Function name */
function_name?: string;
/** Function arguments */
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/agent/types/ChatSessionTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
export interface ChatSessionTemplate {
/** Chat session ID */
id?: string;
/** User ID */
user_id?: string;
/** Chat session ID */
session_id?: string;
/** Chat session status */
Expand Down
5 changes: 1 addition & 4 deletions src/api/resources/construe/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ export class Construe {
*
* @example
* await client.construe.uploadCodeSystem({
* format: "csv",
* name: "CUSTOM_CODES",
* version: "1.0",
* file: "file",
* code_col: "code",
* desc_col: "description"
* format: "csv"
* })
*/
public uploadCodeSystem(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// This file was auto-generated by Fern from our API Definition.

import type * as phenoml from "../../../index.js";
import type * as phenoml from "../../../../index.js";

/**
* Upload codes in JSON format. Either 'file' or 'codes' must be provided.
* If both are provided, 'codes' takes precedence.
* @example
* {
* name: "CUSTOM_CODES",
* version: "1.0",
* format: "csv"
* }
*/
export interface UploadRequestJson {
export interface UploadRequest {
/**
* Name of the code system. Names are case-insensitive and stored uppercase.
* Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
Expand All @@ -17,13 +21,22 @@ export interface UploadRequestJson {
version: string;
/** Optional revision number */
revision?: number;
/** Upload format */
format: UploadRequest.Format;
/**
* The file contents as a base64-encoded JSON array string.
* Prefer using 'codes' instead to pass the array directly without base64 encoding.
* The file contents as a base64-encoded string.
* For CSV format, this is the CSV file contents.
* For JSON format, this is a base64-encoded JSON array; prefer using 'codes' instead.
*/
file?: string;
/** Column name containing codes (required for CSV format) */
code_col?: string;
/** Column name containing descriptions (required for CSV format) */
desc_col?: string;
/** Optional column name containing long definitions (for CSV format) */
defn_col?: string;
/**
* The codes to upload as a JSON array.
* The codes to upload as a JSON array (JSON format only).
* This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
* If both 'codes' and 'file' are provided, 'codes' takes precedence.
*/
Expand All @@ -41,3 +54,12 @@ export interface UploadRequestJson {
*/
async?: boolean;
}

export namespace UploadRequest {
/** Upload format */
export const Format = {
Csv: "csv",
Json: "json",
} as const;
export type Format = (typeof Format)[keyof typeof Format];
}
1 change: 1 addition & 0 deletions src/api/resources/construe/client/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConst
export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js";
export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.js";
export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.js";
export type { UploadRequest } from "./UploadRequest.js";
Copy link

Choose a reason for hiding this comment

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

Format const unreachable due to type-only export

Medium Severity

The UploadRequest namespace defines a runtime const Format (with values Csv and Json), but requests/index.ts re-exports it using export type { UploadRequest }. This type-only export strips the runtime value, making UploadRequest.Format.Csv and UploadRequest.Format.Json inaccessible to consumers. All other types with runtime namespace consts (e.g., ExtractRequestConfig, ChatMessageTemplate) live in the types/ directory and use export *, which preserves runtime values. The Format const is effectively dead code through the public API.

Additional Locations (1)

Fix in Cursor Fix in Web

15 changes: 0 additions & 15 deletions src/api/resources/construe/types/UploadRequest.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/api/resources/construe/types/UploadRequestCsv.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/api/resources/construe/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ export * from "./SemanticSearchResponse.js";
export * from "./SemanticSearchResult.js";
export * from "./TextSearchResponse.js";
export * from "./TextSearchResult.js";
export * from "./UploadRequest.js";
export * from "./UploadRequestCsv.js";
export * from "./UploadRequestJson.js";
2 changes: 0 additions & 2 deletions src/api/resources/fhirProvider/types/FhirProviderTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import type * as phenoml from "../../../index.js";
export interface FhirProviderTemplate {
/** Unique identifier for the FHIR provider */
id?: string;
/** ID of the user who owns this FHIR provider */
user_id?: string;
/** Display name for the FHIR provider */
name?: string;
/** Optional description of the FHIR provider */
Expand Down
1 change: 0 additions & 1 deletion src/api/resources/summary/types/SummaryTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export interface SummaryTemplate {
id?: string;
user_id?: string;
name?: string;
description?: string;
/** Template with {{resource.field}} placeholders */
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/tools/types/McpServerResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export namespace McpServerResponse {
export interface Data {
/** ID of the MCP server */
id?: string;
/** ID of the user who created the MCP server */
user_id?: string;
/** Name of the MCP server */
name?: string;
/** Description of the MCP server */
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/tools/types/McpServerToolResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export namespace McpServerToolResponse {
export interface Data {
/** ID of the MCP server tool */
id?: string;
/** ID of the user who created the MCP server tool */
user_id?: string;
/** Name of the MCP server tool */
name?: string;
/** Description of the MCP server tool */
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/workflows/types/WorkflowDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import type * as phenoml from "../../../index.js";
export interface WorkflowDefinition {
/** Unique identifier for the workflow */
id?: string;
/** ID of the user who created the workflow */
user_id?: string;
/** Human-readable name for the workflow */
name?: string;
/** Natural language instructions that define the workflow logic */
Expand Down
2 changes: 0 additions & 2 deletions src/api/resources/workflows/types/WorkflowResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import type * as phenoml from "../../../index.js";
export interface WorkflowResponse {
/** Unique identifier for the workflow */
id?: string;
/** ID of the user who created the workflow */
user_id?: string;
/** Human-readable name for the workflow */
name?: string;
/** Natural language instructions that define the workflow logic */
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = "5.3.0";
export const SDK_VERSION = "6.0.0";
2 changes: 0 additions & 2 deletions tests/wire/agent/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ describe("Agent", () => {
content: "Hello, how are you?",
created: "2021-01-01T00:00:00Z",
updated: "2021-01-01T00:00:00Z",
user_id: "user_123",
function_name: "get_patient_info",
function_args: { patient_id: "123" },
function_result: { name: "John Doe" },
Expand Down Expand Up @@ -925,7 +924,6 @@ describe("Agent", () => {
content: "Hello, how are you?",
created: "2021-01-01T00:00:00Z",
updated: "2021-01-01T00:00:00Z",
user_id: "user_123",
function_name: "get_patient_info",
function_args: {
patient_id: "123",
Expand Down
Loading