Skip to content
Merged
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
21 changes: 4 additions & 17 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ export interface EmbeddedEventData {
// Window API Types
export interface CortiEmbeddedV1API {
auth(payload: KeycloakTokenResponse): Promise<AuthResponse>;
createInteraction(
payload: CreateInteractionPayload,
): Promise<CreateInteractionResponse>;
createInteraction(payload: CreateInteractionPayload): Promise<CreateInteractionResponse>;
addFacts(payload: AddFactsPayload): Promise<void>;
configureApp(payload: ConfigureAppPayload): Promise<ConfigureAppResponse>;
configureSession(payload: ConfigureSessionPayload): Promise<void>;
Expand All @@ -95,9 +93,7 @@ export interface CortiEmbeddedV1API {
setCredentials(payload: SetCredentialsPayload): Promise<void>;
getStatus(): Promise<GetStatusResponse>;
getTemplates(): Promise<GetTemplatesResponse>;
showDeviceLinkQR(
payload: DeviceLinkTokenResponse,
): Promise<ShowDeviceLinkQRResponse>;
showDeviceLinkQR(payload: DeviceLinkTokenResponse): Promise<ShowDeviceLinkQRResponse>;
}
export interface CortiEmbeddedWindowAPI {
v1: CortiEmbeddedV1API;
Expand Down Expand Up @@ -131,9 +127,7 @@ export interface CortiEmbeddedAPI {
* @param encounter Encounter request data
* @returns Promise resolving to interaction details
*/
createInteraction(
encounter: CreateInteractionPayload,
): Promise<InteractionDetails>;
createInteraction(encounter: CreateInteractionPayload): Promise<InteractionDetails>;

/**
* Configure the current session
Expand Down Expand Up @@ -222,12 +216,5 @@ export interface CortiEmbeddedAPI {
*/
hide(): void;

/**
* Show the device-link QR code in the embedded UI
* @param payload Device-link token response to render as a QR code
* @returns Promise resolving to the rendered QR code state
*/
showDeviceLinkQR(
payload: DeviceLinkTokenResponse,
): Promise<ShowDeviceLinkQRResponse>;
showDeviceLinkQR(payload: DeviceLinkTokenResponse): Promise<ShowDeviceLinkQRResponse>;
}
9 changes: 1 addition & 8 deletions src/types/generated/interview-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ export type EmbeddedInterviewDetails = {
/** Interview title */
title: string | null;
/** Current state of the interaction */
state:
| "planned"
| "ongoing"
| "paused"
| "disconnected"
| "ending"
| "parsing"
| "ended";
state: "planned" | "ongoing" | "paused" | "disconnected" | "ending" | "parsing" | "ended";
/** ISO 8601 timestamp when interview started */
startedAt: string;
/** ISO 8601 timestamp when interview ended */
Expand Down
15 changes: 10 additions & 5 deletions src/types/payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export interface KeycloakTokenResponse {
};
}

export type DeviceLinkTokenResponse = KeycloakTokenResponse & {
refresh_token: string;
};
export type DeviceLinkTokenResponse = KeycloakTokenResponse & { refresh_token: string };

// Fact structure
export interface Fact {
Expand Down Expand Up @@ -83,10 +81,13 @@ export interface InlineTemplateLabel {
}

export interface InlineTemplateSectionInstructions {
contentPrompt?: string;
writingStylePrompt?: string;
miscPrompt?: string;
}

export interface InlineTemplateSection {
inheritFromId?: string;
heading: string;
labels?: InlineTemplateLabel[];
instructions: InlineTemplateSectionInstructions;
Expand All @@ -106,12 +107,12 @@ export interface InlineTemplate {
}

export interface InteractionTemplateReference {
source: "standard" | "project";
source: "standard" | "project" | "inline";
id: string;
}

export interface DefaultInteractionTemplateOptions {
behaviour?: "fallback";
behaviour?: "fallback" | "force-first-document";
template?: InteractionTemplateReference;
allowUserSelection?: boolean;
}
Expand Down Expand Up @@ -149,6 +150,10 @@ export interface InteractionTemplateSources {
ids?: string[];
};
};
inline?: {
enabled?: boolean;
templates?: InlineTemplate[];
};
}

export interface InteractionTemplateOptions {
Expand Down
10 changes: 2 additions & 8 deletions src/types/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

export type APIVersion = "v1";

export type MessageType =
| "CORTI_EMBEDDED"
| "CORTI_EMBEDDED_RESPONSE"
| "CORTI_EMBEDDED_EVENT";
export type MessageType = "CORTI_EMBEDDED" | "CORTI_EMBEDDED_RESPONSE" | "CORTI_EMBEDDED_EVENT";

export type DefaultMode = "virtual" | "in-person";

Expand Down Expand Up @@ -214,7 +211,4 @@ export type AnyDeprecatedEmbeddedEvent =

export type AnyEvent = EmbeddedEventMessage | AnyDeprecatedEmbeddedEvent;

export type AnyEmbeddedMessage =
| AnyEmbeddedRequest
| AnyEmbeddedResponse
| AnyEvent;
export type AnyEmbeddedMessage = AnyEmbeddedRequest | AnyEmbeddedResponse | AnyEvent;
Loading