@aiqa/sdk 2.0.0-develop.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,8 @@ A TypeScript/JavaScript SDK for interacting with the AIQA WebSocket service. Thi
19
19
  - [VerificationStatus](#verificationstatus)
20
20
  - [FactVerifiedPayload](#factverifiedpayload)
21
21
  - [FlagFactResult](#flagfactresult)
22
+ - [UpdateConversationInput](#updateconversationinput)
23
+ - [UpdateConversationResult](#updateconversationresult)
22
24
  - [Examples](#examples)
23
25
  - [Error Handling](#error-handling)
24
26
  - [Semantic Versioning](#semantic-versioning)
@@ -130,6 +132,25 @@ const result = await sdk.setConversationLanguage(ConversationLanguage.EN);
130
132
  console.log(result.success, result.language);
131
133
  ```
132
134
 
135
+ #### `updateConversation(input)`
136
+
137
+ Updates fields on the current conversation. Pass only the fields you want to
138
+ change.
139
+
140
+ **Parameters:**
141
+
142
+ - `input: UpdateConversationInput` - partial set of conversation fields to update
143
+ - `policyNumber?: string` - non-empty; surrounding whitespace is trimmed
144
+
145
+ **Returns:**
146
+
147
+ - `Promise<{ success: boolean; conversation: { policy_number?: string } }>`
148
+
149
+ ```typescript
150
+ const result = await sdk.updateConversation({ policyNumber: "POL-123" });
151
+ console.log(result.success, result.conversation.policy_number);
152
+ ```
153
+
133
154
  ### Fact Management
134
155
 
135
156
  #### `addFact(fact)`
@@ -566,6 +587,29 @@ enum ConversationLanguage {
566
587
  }
567
588
  ```
568
589
 
590
+ ### UpdateConversationInput
591
+
592
+ Partial set of conversation fields accepted by `updateConversation()`.
593
+
594
+ ```typescript
595
+ type UpdateConversationInput = {
596
+ policyNumber?: string;
597
+ };
598
+ ```
599
+
600
+ ### UpdateConversationResult
601
+
602
+ Returned by `updateConversation()`.
603
+
604
+ ```typescript
605
+ type UpdateConversationResult = {
606
+ success: boolean;
607
+ conversation: {
608
+ policy_number?: string;
609
+ };
610
+ };
611
+ ```
612
+
569
613
  ### FactUpdateEvent
570
614
 
571
615
  ```typescript
@@ -17,7 +17,8 @@ declare enum Methods {
17
17
  ADD_FACT = "ADD_FACT",
18
18
  FLAG_FACT = "FLAG_FACT",
19
19
  SET_CONVERSATION_PRODUCT = "SET_CONVERSATION_PRODUCT",
20
- SET_CONVERSATION_LANGUAGE = "SET_CONVERSATION_LANGUAGE"
20
+ SET_CONVERSATION_LANGUAGE = "SET_CONVERSATION_LANGUAGE",
21
+ UPDATE_CONVERSATION = "UPDATE_CONVERSATION"
21
22
  }
22
23
  type SetConversationProductResult = {
23
24
  success: boolean;
@@ -27,6 +28,15 @@ type SetConversationLanguageResult = {
27
28
  success: boolean;
28
29
  language: string;
29
30
  };
31
+ type UpdateConversationInput = {
32
+ policyNumber?: string;
33
+ };
34
+ type UpdateConversationResult = {
35
+ success: boolean;
36
+ conversation: {
37
+ policy_number?: string;
38
+ };
39
+ };
30
40
  declare enum ConversationLanguage {
31
41
  EN = "en",
32
42
  ES = "es",
@@ -264,6 +274,7 @@ declare abstract class IAiqaSdk {
264
274
  abstract getFacts(): Promise<ApplicationFact[]>;
265
275
  abstract setConversationProduct(product: string): Promise<SetConversationProductResult>;
266
276
  abstract setConversationLanguage(language: ConversationLanguage): Promise<SetConversationLanguageResult>;
277
+ abstract updateConversation(input: UpdateConversationInput): Promise<UpdateConversationResult>;
267
278
  }
268
279
 
269
280
  declare class AiQaSdk implements IAiqaSdk {
@@ -287,6 +298,7 @@ declare class AiQaSdk implements IAiqaSdk {
287
298
  flagFact(factId: string): Promise<FlagFactResult>;
288
299
  setConversationProduct(product: string): Promise<SetConversationProductResult>;
289
300
  setConversationLanguage(language: ConversationLanguage): Promise<SetConversationLanguageResult>;
301
+ updateConversation(input: UpdateConversationInput): Promise<UpdateConversationResult>;
290
302
  authenticate(): Promise<void>;
291
303
  startRecording(): Promise<boolean>;
292
304
  stopRecording(): Promise<boolean>;
@@ -296,4 +308,4 @@ declare class AiQaSdk implements IAiqaSdk {
296
308
  private isManagerEvent;
297
309
  }
298
310
 
299
- export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, ConversationLanguage, type DialogAct, type DialogActConfidence, FactAnswerFormatType, type FactVerifiedPayload, type FlagFactResult, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationLanguageResult, type SetConversationProductResult, type TranscriptionUpdate, type Utterance, type VerificationStatus };
311
+ export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, ConversationLanguage, type DialogAct, type DialogActConfidence, FactAnswerFormatType, type FactVerifiedPayload, type FlagFactResult, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationLanguageResult, type SetConversationProductResult, type TranscriptionUpdate, type UpdateConversationInput, type UpdateConversationResult, type Utterance, type VerificationStatus };
@@ -3348,6 +3348,7 @@ var Methods = /* @__PURE__ */ ((Methods2) => {
3348
3348
  Methods2["FLAG_FACT"] = "FLAG_FACT";
3349
3349
  Methods2["SET_CONVERSATION_PRODUCT"] = "SET_CONVERSATION_PRODUCT";
3350
3350
  Methods2["SET_CONVERSATION_LANGUAGE"] = "SET_CONVERSATION_LANGUAGE";
3351
+ Methods2["UPDATE_CONVERSATION"] = "UPDATE_CONVERSATION";
3351
3352
  return Methods2;
3352
3353
  })(Methods || {});
3353
3354
  var ConversationLanguage = /* @__PURE__ */ ((ConversationLanguage3) => {
@@ -3396,7 +3397,7 @@ var compareVersions = (left, right) => {
3396
3397
  // package.json
3397
3398
  var package_default = {
3398
3399
  name: "@aiqa/sdk",
3399
- version: "1.6.0-develop.1",
3400
+ version: "2.0.0-develop.2",
3400
3401
  main: "dist/node/node.js",
3401
3402
  module: "dist/node/node.js",
3402
3403
  types: "dist/node/node.d.ts",
@@ -3734,6 +3735,10 @@ var AiQaSdk = class {
3734
3735
  });
3735
3736
  return result && result.data !== void 0 ? result.data : result;
3736
3737
  }
3738
+ async updateConversation(input) {
3739
+ const result = await this.sendMessage("UPDATE_CONVERSATION" /* UPDATE_CONVERSATION */, input);
3740
+ return result && result.data !== void 0 ? result.data : result;
3741
+ }
3737
3742
  async authenticate() {
3738
3743
  try {
3739
3744
  const result = await this.sendMessage("AUTHENTICATE" /* AUTHENTICATE */, {