Skip to content

Commit 1117174

Browse files
refactor: simplify upload request type structure for construe API
Refactored the construe upload request type structure from discriminated union to single interface with enum format field. Also removed user_id fields from various template types and updated all related tests and documentation to match the simplified structure. Key changes: - Merged UploadRequestCsv and UploadRequestJson into single UploadRequest interface - Changed from discriminated union to enum-based format field - Removed user_id fields from ChatMessageTemplate, ChatSessionTemplate, FhirProviderTemplate, SummaryTemplate, McpServerResponse, McpServerToolResponse, WorkflowDefinition, and WorkflowResponse - Moved UploadRequest from types to client/requests directory - Updated all test cases and examples to use simplified interface - Updated documentation and type references throughout codebase 🌿 Generated with Fern
1 parent 669e17c commit 1117174

File tree

26 files changed

+63
-223
lines changed

26 files changed

+63
-223
lines changed

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 6.0.0 - 2026-02-10
2+
* refactor: simplify upload request type structure for construe API
3+
* Refactored the construe upload request type structure from discriminated union to single interface with enum format field. Also removed user_id fields from various template types and updated all related tests and documentation to match the simplified structure.
4+
* Key changes:
5+
* Merged UploadRequestCsv and UploadRequestJson into single UploadRequest interface
6+
* Changed from discriminated union to enum-based format field
7+
* Removed user_id fields from ChatMessageTemplate, ChatSessionTemplate, FhirProviderTemplate, SummaryTemplate, McpServerResponse, McpServerToolResponse, WorkflowDefinition, and WorkflowResponse
8+
* Moved UploadRequest from types to client/requests directory
9+
* Updated all test cases and examples to use simplified interface
10+
* Updated documentation and type references throughout codebase
11+
* 🌿 Generated with Fern
12+
113
## 5.3.0 - 2026-02-09
214
* feat: add custom code system export endpoint
315
* 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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phenoml",
3-
"version": "5.3.0",
3+
"version": "6.0.0",
44
"private": false,
55
"repository": "github:PhenoML/phenoml-ts-sdk",
66
"type": "commonjs",

reference.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,12 +1171,9 @@ subsequently use the code system for construe/extract and lang2fhir/create (comi
11711171

11721172
```typescript
11731173
await client.construe.uploadCodeSystem({
1174-
format: "csv",
11751174
name: "CUSTOM_CODES",
11761175
version: "1.0",
1177-
file: "file",
1178-
code_col: "code",
1179-
desc_col: "description"
1176+
format: "csv"
11801177
});
11811178

11821179
```
@@ -1193,7 +1190,7 @@ await client.construe.uploadCodeSystem({
11931190
<dl>
11941191
<dd>
11951192

1196-
**request:** `phenoml.UploadRequest`
1193+
**request:** `phenoml.construe.UploadRequest`
11971194

11981195
</dd>
11991196
</dl>

src/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export class phenomlClient {
4040
{
4141
"X-Fern-Language": "JavaScript",
4242
"X-Fern-SDK-Name": "phenoml",
43-
"X-Fern-SDK-Version": "5.3.0",
44-
"User-Agent": "phenoml/5.3.0",
43+
"X-Fern-SDK-Version": "6.0.0",
44+
"User-Agent": "phenoml/6.0.0",
4545
"X-Fern-Runtime": core.RUNTIME.type,
4646
"X-Fern-Runtime-Version": core.RUNTIME.version,
4747
},

src/api/resources/agent/types/ChatMessageTemplate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export interface ChatMessageTemplate {
1919
created?: string;
2020
/** Message updated time */
2121
updated?: string;
22-
/** User ID */
23-
user_id?: string;
2422
/** Function name */
2523
function_name?: string;
2624
/** Function arguments */

src/api/resources/agent/types/ChatSessionTemplate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
export interface ChatSessionTemplate {
44
/** Chat session ID */
55
id?: string;
6-
/** User ID */
7-
user_id?: string;
86
/** Chat session ID */
97
session_id?: string;
108
/** Chat session status */

src/api/resources/construe/client/Client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ export class Construe {
3737
*
3838
* @example
3939
* await client.construe.uploadCodeSystem({
40-
* format: "csv",
4140
* name: "CUSTOM_CODES",
4241
* version: "1.0",
43-
* file: "file",
44-
* code_col: "code",
45-
* desc_col: "description"
42+
* format: "csv"
4643
* })
4744
*/
4845
public uploadCodeSystem(

src/api/resources/construe/types/UploadRequestJson.ts renamed to src/api/resources/construe/client/requests/UploadRequest.ts

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// This file was auto-generated by Fern from our API Definition.
22

3-
import type * as phenoml from "../../../index.js";
3+
import type * as phenoml from "../../../../index.js";
44

55
/**
6-
* Upload codes in JSON format. Either 'file' or 'codes' must be provided.
7-
* If both are provided, 'codes' takes precedence.
6+
* @example
7+
* {
8+
* name: "CUSTOM_CODES",
9+
* version: "1.0",
10+
* format: "csv"
11+
* }
812
*/
9-
export interface UploadRequestJson {
13+
export interface UploadRequest {
1014
/**
1115
* Name of the code system. Names are case-insensitive and stored uppercase.
1216
* Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
@@ -17,13 +21,22 @@ export interface UploadRequestJson {
1721
version: string;
1822
/** Optional revision number */
1923
revision?: number;
24+
/** Upload format */
25+
format: UploadRequest.Format;
2026
/**
21-
* The file contents as a base64-encoded JSON array string.
22-
* Prefer using 'codes' instead to pass the array directly without base64 encoding.
27+
* The file contents as a base64-encoded string.
28+
* For CSV format, this is the CSV file contents.
29+
* For JSON format, this is a base64-encoded JSON array; prefer using 'codes' instead.
2330
*/
2431
file?: string;
32+
/** Column name containing codes (required for CSV format) */
33+
code_col?: string;
34+
/** Column name containing descriptions (required for CSV format) */
35+
desc_col?: string;
36+
/** Optional column name containing long definitions (for CSV format) */
37+
defn_col?: string;
2538
/**
26-
* The codes to upload as a JSON array.
39+
* The codes to upload as a JSON array (JSON format only).
2740
* This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
2841
* If both 'codes' and 'file' are provided, 'codes' takes precedence.
2942
*/
@@ -41,3 +54,12 @@ export interface UploadRequestJson {
4154
*/
4255
async?: boolean;
4356
}
57+
58+
export namespace UploadRequest {
59+
/** Upload format */
60+
export const Format = {
61+
Csv: "csv",
62+
Json: "json",
63+
} as const;
64+
export type Format = (typeof Format)[keyof typeof Format];
65+
}

src/api/resources/construe/client/requests/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConst
66
export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js";
77
export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.js";
88
export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.js";
9+
export type { UploadRequest } from "./UploadRequest.js";

src/api/resources/construe/types/UploadRequest.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)