Skip to content

Commit bb993e2

Browse files
Release 0.0.21
1 parent 0748535 commit bb993e2

24 files changed

+295
-77
lines changed

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": "0.0.20",
3+
"version": "0.0.21",
44
"private": false,
55
"repository": "github:PhenoML/phenoml-ts-sdk",
66
"type": "commonjs",

reference.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ Retrieves a list of chat messages for a given chat session
514514
await client.agent.getChatMessages({
515515
chat_session_id: "chat_session_id",
516516
num_messages: 1,
517-
role: "role",
517+
role: "user",
518518
order: "asc"
519519
});
520520

@@ -1589,7 +1589,7 @@ Examples:
15891589
</dl>
15901590
</details>
15911591

1592-
<details><summary><code>client.fhir.<a href="/src/api/resources/fhir/client/Client.ts">delete</a>(fhirProviderId, fhirPath, { ...params }) -> Record<string, unknown></code></summary>
1592+
<details><summary><code>client.fhir.<a href="/src/api/resources/fhir/client/Client.ts">delete</a>(fhirProviderId, fhirPath, { ...params }) -> Record&lt;string, unknown&gt;</code></summary>
15931593
<dl>
15941594
<dd>
15951595

@@ -1914,7 +1914,9 @@ The ID of the FHIR provider to use. Can be either:
19141914
<dl>
19151915
<dd>
19161916

1917-
Creates a new FHIR provider configuration with authentication credentials
1917+
Creates a new FHIR provider configuration with authentication credentials.
1918+
1919+
Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
19181920
</dd>
19191921
</dl>
19201922
</dd>
@@ -1982,7 +1984,10 @@ await client.fhirProvider.create({
19821984
<dl>
19831985
<dd>
19841986

1985-
Retrieves a list of all active FHIR providers for the authenticated user
1987+
Retrieves a list of all active FHIR providers for the authenticated user.
1988+
1989+
On shared instances, only sandbox providers are returned.
1990+
Sandbox providers return FhirProviderSandboxInfo.
19861991
</dd>
19871992
</dl>
19881993
</dd>
@@ -2037,7 +2042,10 @@ await client.fhirProvider.list();
20372042
<dl>
20382043
<dd>
20392044

2040-
Retrieves a specific FHIR provider configuration by its ID
2045+
Retrieves a specific FHIR provider configuration by its ID.
2046+
2047+
Sandbox providers return FhirProviderSandboxInfo.
2048+
On shared instances, only sandbox providers can be accessed.
20412049
</dd>
20422050
</dl>
20432051
</dd>
@@ -2100,7 +2108,9 @@ await client.fhirProvider.get("fhir_provider_id");
21002108
<dl>
21012109
<dd>
21022110

2103-
Soft deletes a FHIR provider by setting is_active to false
2111+
Soft deletes a FHIR provider by setting is_active to false.
2112+
2113+
Note: Sandbox providers cannot be deleted.
21042114
</dd>
21052115
</dl>
21062116
</dd>
@@ -2163,7 +2173,10 @@ await client.fhirProvider.delete("fhir_provider_id");
21632173
<dl>
21642174
<dd>
21652175

2166-
Adds a new authentication configuration to an existing FHIR provider. This enables key rotation and multiple auth configurations per provider.
2176+
Adds a new authentication configuration to an existing FHIR provider.
2177+
This enables key rotation and multiple auth configurations per provider.
2178+
2179+
Note: Sandbox providers cannot be modified.
21672180
</dd>
21682181
</dl>
21692182
</dd>
@@ -2224,7 +2237,7 @@ await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad",
22242237
</dl>
22252238
</details>
22262239

2227-
<details><summary><code>client.fhirProvider.<a href="/src/api/resources/fhirProvider/client/Client.ts">setActiveAuthConfig</a>(fhirProviderId, { ...params }) -> phenoml.FhirProviderSetActiveAuthConfigResponse</code></summary>
2240+
<details><summary><code>client.fhirProvider.<a href="/src/api/resources/fhirProvider/client/Client.ts">setActiveAuthConfig</a>(fhirProviderId, { ...params }) -> phenoml.FhirProviderResponse</code></summary>
22282241
<dl>
22292242
<dd>
22302243

@@ -2236,7 +2249,13 @@ await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad",
22362249
<dl>
22372250
<dd>
22382251

2239-
Sets which authentication configuration should be active for a FHIR provider. Only one auth config can be active at a time.
2252+
Sets which authentication configuration should be active for a FHIR provider.
2253+
Only one auth config can be active at a time.
2254+
2255+
If the specified auth config is already active, the request succeeds without
2256+
making any changes and returns a message indicating the config is already active.
2257+
2258+
Note: Sandbox providers cannot be modified.
22402259
</dd>
22412260
</dl>
22422261
</dd>
@@ -2309,7 +2328,10 @@ await client.fhirProvider.setActiveAuthConfig("1716d214-de93-43a4-aa6b-a878d864e
23092328
<dl>
23102329
<dd>
23112330

2312-
Removes an authentication configuration from a FHIR provider. Cannot remove the currently active auth configuration.
2331+
Removes an authentication configuration from a FHIR provider.
2332+
Cannot remove the currently active auth configuration.
2333+
2334+
Note: Sandbox providers cannot be modified.
23132335
</dd>
23142336
</dl>
23152337
</dd>
@@ -2517,7 +2539,14 @@ await client.lang2Fhir.createMulti({
25172539
<dl>
25182540
<dd>
25192541

2520-
Converts natural language text into FHIR search parameters
2542+
Converts natural language text into FHIR search parameters.
2543+
Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.
2544+
2545+
Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition,
2546+
Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location,
2547+
Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner,
2548+
PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson,
2549+
Schedule, ServiceRequest, Slot, and Specimen.
25212550
</dd>
25222551
</dl>
25232552
</dd>

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": "0.0.20",
44-
"User-Agent": "phenoml/0.0.20",
43+
"X-Fern-SDK-Version": "0.0.21",
44+
"User-Agent": "phenoml/0.0.21",
4545
"X-Fern-Runtime": core.RUNTIME.type,
4646
"X-Fern-Runtime-Version": core.RUNTIME.version,
4747
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ export class Agent {
695695
* await client.agent.getChatMessages({
696696
* chat_session_id: "chat_session_id",
697697
* num_messages: 1,
698-
* role: "role",
698+
* role: "user",
699699
* order: "asc"
700700
* })
701701
*/

src/api/resources/agent/client/requests/AgentGetChatMessagesRequest.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type * as phenoml from "../../../../index.js";
77
* {
88
* chat_session_id: "chat_session_id",
99
* num_messages: 1,
10-
* role: "role",
10+
* role: "user",
1111
* order: "asc"
1212
* }
1313
*/
@@ -16,8 +16,17 @@ export interface AgentGetChatMessagesRequest {
1616
chat_session_id: string;
1717
/** Number of messages to return */
1818
num_messages?: number;
19-
/** Filter by role */
20-
role?: string;
19+
/**
20+
* Filter by one or more message roles. Multiple roles can be specified as a comma-separated string.
21+
* If not specified, messages with all roles are returned.
22+
*
23+
* **Available roles:**
24+
* - `user` - Messages from the user
25+
* - `assistant` - Text responses from the AI assistant
26+
* - `model` - Function/tool call requests from the model
27+
* - `function` - Function/tool call results
28+
*/
29+
role?: phenoml.agent.AgentGetChatMessagesRequestRole;
2130
/** Order of messages */
2231
order?: phenoml.agent.AgentGetChatMessagesRequestOrder;
2332
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
export const AgentGetChatMessagesRequestRole = {
4+
User: "user",
5+
Assistant: "assistant",
6+
Model: "model",
7+
Function: "function",
8+
} as const;
9+
export type AgentGetChatMessagesRequestRole =
10+
(typeof AgentGetChatMessagesRequestRole)[keyof typeof AgentGetChatMessagesRequestRole];

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ export interface ChatMessageTemplate {
55
id?: string;
66
/** Chat session ID */
77
session_id?: string;
8-
/** Message role */
9-
role?: string;
8+
/**
9+
* Message role indicating the source/type of the message:
10+
* - `user` - Messages from the user
11+
* - `assistant` - Text responses from the AI assistant
12+
* - `model` - Function/tool call requests to the model
13+
* - `function` - Function/tool call results
14+
*/
15+
role?: ChatMessageTemplate.Role;
1016
/** Message content */
1117
content?: string;
1218
/** Message created time */
@@ -24,3 +30,20 @@ export interface ChatMessageTemplate {
2430
/** Message order */
2531
message_order?: number;
2632
}
33+
34+
export namespace ChatMessageTemplate {
35+
/**
36+
* Message role indicating the source/type of the message:
37+
* - `user` - Messages from the user
38+
* - `assistant` - Text responses from the AI assistant
39+
* - `model` - Function/tool call requests to the model
40+
* - `function` - Function/tool call results
41+
*/
42+
export const Role = {
43+
User: "user",
44+
Assistant: "assistant",
45+
Model: "model",
46+
Function: "function",
47+
} as const;
48+
export type Role = (typeof Role)[keyof typeof Role];
49+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from "./AgentChatResponse.js";
22
export * from "./AgentCreateRequest.js";
33
export * from "./AgentDeleteResponse.js";
44
export * from "./AgentGetChatMessagesRequestOrder.js";
5+
export * from "./AgentGetChatMessagesRequestRole.js";
56
export * from "./AgentGetChatMessagesResponse.js";
67
export * from "./AgentListResponse.js";
78
export * from "./AgentPromptsResponse.js";

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

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export class FhirProvider {
2121
}
2222

2323
/**
24-
* Creates a new FHIR provider configuration with authentication credentials
24+
* Creates a new FHIR provider configuration with authentication credentials.
25+
*
26+
* Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
2527
*
2628
* @param {phenoml.fhirProvider.FhirProviderCreateRequest} request
2729
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
@@ -128,12 +130,14 @@ export class FhirProvider {
128130
}
129131

130132
/**
131-
* Retrieves a list of all active FHIR providers for the authenticated user
133+
* Retrieves a list of all active FHIR providers for the authenticated user.
134+
*
135+
* On shared instances, only sandbox providers are returned.
136+
* Sandbox providers return FhirProviderSandboxInfo.
132137
*
133138
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
134139
*
135140
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
136-
* @throws {@link phenoml.fhirProvider.ForbiddenError}
137141
* @throws {@link phenoml.fhirProvider.InternalServerError}
138142
*
139143
* @example
@@ -181,11 +185,6 @@ export class FhirProvider {
181185
_response.error.body as unknown,
182186
_response.rawResponse,
183187
);
184-
case 403:
185-
throw new phenoml.fhirProvider.ForbiddenError(
186-
_response.error.body as unknown,
187-
_response.rawResponse,
188-
);
189188
case 500:
190189
throw new phenoml.fhirProvider.InternalServerError(
191190
_response.error.body as unknown,
@@ -218,7 +217,10 @@ export class FhirProvider {
218217
}
219218

220219
/**
221-
* Retrieves a specific FHIR provider configuration by its ID
220+
* Retrieves a specific FHIR provider configuration by its ID.
221+
*
222+
* Sandbox providers return FhirProviderSandboxInfo.
223+
* On shared instances, only sandbox providers can be accessed.
222224
*
223225
* @param {string} fhirProviderId - ID of the FHIR provider to retrieve
224226
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
@@ -319,7 +321,9 @@ export class FhirProvider {
319321
}
320322

321323
/**
322-
* Soft deletes a FHIR provider by setting is_active to false
324+
* Soft deletes a FHIR provider by setting is_active to false.
325+
*
326+
* Note: Sandbox providers cannot be deleted.
323327
*
324328
* @param {string} fhirProviderId - ID of the FHIR provider to delete
325329
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
@@ -420,7 +424,10 @@ export class FhirProvider {
420424
}
421425

422426
/**
423-
* Adds a new authentication configuration to an existing FHIR provider. This enables key rotation and multiple auth configurations per provider.
427+
* Adds a new authentication configuration to an existing FHIR provider.
428+
* This enables key rotation and multiple auth configurations per provider.
429+
*
430+
* Note: Sandbox providers cannot be modified.
424431
*
425432
* @param {string} fhirProviderId - ID of the FHIR provider to add auth config to
426433
* @param {phenoml.fhirProvider.FhirProviderAddAuthConfigRequest} request
@@ -535,7 +542,13 @@ export class FhirProvider {
535542
}
536543

537544
/**
538-
* Sets which authentication configuration should be active for a FHIR provider. Only one auth config can be active at a time.
545+
* Sets which authentication configuration should be active for a FHIR provider.
546+
* Only one auth config can be active at a time.
547+
*
548+
* If the specified auth config is already active, the request succeeds without
549+
* making any changes and returns a message indicating the config is already active.
550+
*
551+
* Note: Sandbox providers cannot be modified.
539552
*
540553
* @param {string} fhirProviderId - ID of the FHIR provider
541554
* @param {phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest} request
@@ -556,7 +569,7 @@ export class FhirProvider {
556569
fhirProviderId: string,
557570
request: phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest,
558571
requestOptions?: FhirProvider.RequestOptions,
559-
): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderSetActiveAuthConfigResponse> {
572+
): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse> {
560573
return core.HttpResponsePromise.fromPromise(
561574
this.__setActiveAuthConfig(fhirProviderId, request, requestOptions),
562575
);
@@ -566,7 +579,7 @@ export class FhirProvider {
566579
fhirProviderId: string,
567580
request: phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest,
568581
requestOptions?: FhirProvider.RequestOptions,
569-
): Promise<core.WithRawResponse<phenoml.fhirProvider.FhirProviderSetActiveAuthConfigResponse>> {
582+
): Promise<core.WithRawResponse<phenoml.fhirProvider.FhirProviderResponse>> {
570583
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
571584
this._options?.headers,
572585
mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
@@ -591,7 +604,7 @@ export class FhirProvider {
591604
});
592605
if (_response.ok) {
593606
return {
594-
data: _response.body as phenoml.fhirProvider.FhirProviderSetActiveAuthConfigResponse,
607+
data: _response.body as phenoml.fhirProvider.FhirProviderResponse,
595608
rawResponse: _response.rawResponse,
596609
};
597610
}
@@ -652,7 +665,10 @@ export class FhirProvider {
652665
}
653666

654667
/**
655-
* Removes an authentication configuration from a FHIR provider. Cannot remove the currently active auth configuration.
668+
* Removes an authentication configuration from a FHIR provider.
669+
* Cannot remove the currently active auth configuration.
670+
*
671+
* Note: Sandbox providers cannot be modified.
656672
*
657673
* @param {string} fhirProviderId - ID of the FHIR provider
658674
* @param {phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest} request

src/api/resources/fhirProvider/types/FhirProviderAuthConfig.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ export interface FhirProviderAuthConfig {
1111
auth_method?: phenoml.fhirProvider.AuthMethod;
1212
/** Whether this auth configuration is currently active */
1313
is_active_auth_config?: boolean;
14+
/** Timestamp when this auth configuration was created */
15+
created_at?: string;
16+
/** Timestamp when this auth configuration was last updated */
17+
updated_at?: string;
1418
/** Public key certificate in PEM format (visible for JWT auth) */
1519
public_key_cert_pem?: string;
1620
json_web_key?: phenoml.fhirProvider.JsonWebKey;
1721
/** Expiry time for credentials (JWT auth only) */
1822
credential_expiry?: string;
1923
smart_configuration?: phenoml.fhirProvider.SmartConfiguration;
24+
service_account_metadata?: phenoml.fhirProvider.ServiceAccountMetadata;
2025
/** OAuth scopes */
2126
scopes?: string;
2227
}

0 commit comments

Comments
 (0)