@aiqa/sdk 2.1.1 → 2.2.0-develop.2

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
@@ -230,6 +230,7 @@ change.
230
230
  | `agentId` / `agentName` | `string` | 64/128 | |
231
231
  | `advisorId` / `advisorName` | `string` | 64/128 | |
232
232
  | `agentGroups` | `string[]` | 32 × 128 | entries cannot contain a comma |
233
+ | `externalStatus` | `string` | — | see [`ExternalStatus`](#externalstatus) |
233
234
 
234
235
  Every string (including each `agentGroups` entry) must be non-empty;
235
236
  surrounding whitespace is trimmed first, so a value of only spaces is
@@ -245,10 +246,16 @@ change.
245
246
  const result = await sdk.updateConversation({
246
247
  policyNumber: "POL-123",
247
248
  clientEmail: "jane@example.com",
249
+ externalStatus: ExternalStatus.COMPLETED,
248
250
  });
249
251
  console.log(result.success, result.conversation.policy_number);
250
252
  ```
251
253
 
254
+ ##### `ExternalStatus`
255
+
256
+ User-provided application status: `draft`, `pending`, `completed`, `expired`,
257
+ `closed`.
258
+
252
259
  ### Fact Management
253
260
 
254
261
  #### `addFact(fact)`
@@ -289,6 +296,8 @@ a timeout, a rejected payload.
289
296
  question: string;
290
297
  expected_answer: any;
291
298
  answer_format: { type: "STRING" }
299
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
300
+ prefilled?: boolean
292
301
  /**
293
302
  * Optional. Your own identifiers for this fact — a form field ID, a
294
303
  * section name, anything that lets your UI map the result back to the
@@ -499,6 +508,8 @@ Rules:
499
508
  `unmatched`). Show progress from the `FACT_VERIFIED` event, show the final
500
509
  result from the Promise.
501
510
  - **Handle a `verification_status` you don't recognize as `processing`.**
511
+ - **A fact sent with `prefilled: true` is never verified**, so it gets no
512
+ `verification_status` and no `FACT_VERIFIED` event.
502
513
  - **`pending_confirmation_*` is never final.** The answer can still change,
503
514
  so don't show it as a decision.
504
515
  - **A fact can be revised after `addFact()` has resolved.** If you keep its
@@ -718,6 +729,8 @@ type ApplicationFactInput = {
718
729
  // and one of them sets status to "critical_errors".
719
730
  critical?: boolean;
720
731
  is_skipped?: boolean;
732
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
733
+ prefilled?: boolean;
721
734
  /**
722
735
  * Optional. Your own identifiers for this fact — a form field ID, a section
723
736
  * name, anything that lets your UI map the result back to the right place.
@@ -768,6 +781,7 @@ type UpdateConversationInput = {
768
781
  advisorId?: string;
769
782
  advisorName?: string;
770
783
  agentGroups?: string[];
784
+ externalStatus?: ExternalStatus | (string & {});
771
785
  };
772
786
  ```
773
787
 
@@ -791,6 +805,7 @@ type UpdateConversationResult = {
791
805
  advisor_id?: string;
792
806
  advisor_name?: string;
793
807
  agent_groups?: string[];
808
+ external_status?: string;
794
809
  };
795
810
  };
796
811
  ```
@@ -84,6 +84,14 @@ type SetConversationLanguageResult = {
84
84
  success: boolean;
85
85
  language: string;
86
86
  };
87
+ /** User-provided application status. */
88
+ declare enum ExternalStatus {
89
+ DRAFT = "draft",
90
+ PENDING = "pending",
91
+ COMPLETED = "completed",
92
+ EXPIRED = "expired",
93
+ CLOSED = "closed"
94
+ }
87
95
  type UpdateConversationInput = {
88
96
  policyNumber?: string;
89
97
  insuredPhone?: string;
@@ -96,6 +104,7 @@ type UpdateConversationInput = {
96
104
  advisorId?: string;
97
105
  advisorName?: string;
98
106
  agentGroups?: string[];
107
+ externalStatus?: ExternalStatus | (string & {});
99
108
  };
100
109
  /** Only the fields you sent come back in `conversation`. */
101
110
  type UpdateConversationResult = {
@@ -112,6 +121,7 @@ type UpdateConversationResult = {
112
121
  advisor_id?: string;
113
122
  advisor_name?: string;
114
123
  agent_groups?: string[];
124
+ external_status?: string;
115
125
  };
116
126
  };
117
127
  declare enum ConversationLanguage {
@@ -160,6 +170,8 @@ type ApplicationFactInput = {
160
170
  */
161
171
  critical?: boolean;
162
172
  is_skipped?: boolean;
173
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
174
+ prefilled?: boolean;
163
175
  /**
164
176
  * Your own identifiers for this fact — a form field ID, a section name,
165
177
  * anything that lets your UI map the result back to the right place.
@@ -207,6 +219,7 @@ interface AddFactResult {
207
219
  answer_type?: string;
208
220
  agent_answer?: string;
209
221
  ai_answer?: string;
222
+ /** `false` for a fact that was never verified, such as a prefilled one. */
210
223
  is_valid_answer: boolean;
211
224
  question_asked?: boolean;
212
225
  /**
@@ -345,4 +358,4 @@ declare class AiQaSdk implements IAiqaSdk {
345
358
  private isManagerEvent;
346
359
  }
347
360
 
348
- export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, type ApplicationVerificationStatus, type ApplicationVerificationSummary, 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 };
361
+ export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, type ApplicationVerificationStatus, type ApplicationVerificationSummary, ConversationLanguage, type DialogAct, type DialogActConfidence, ExternalStatus, 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 };
@@ -3352,6 +3352,14 @@ var Methods = /* @__PURE__ */ ((Methods2) => {
3352
3352
  Methods2["UPDATE_CONVERSATION"] = "UPDATE_CONVERSATION";
3353
3353
  return Methods2;
3354
3354
  })(Methods || {});
3355
+ var ExternalStatus = /* @__PURE__ */ ((ExternalStatus2) => {
3356
+ ExternalStatus2["DRAFT"] = "draft";
3357
+ ExternalStatus2["PENDING"] = "pending";
3358
+ ExternalStatus2["COMPLETED"] = "completed";
3359
+ ExternalStatus2["EXPIRED"] = "expired";
3360
+ ExternalStatus2["CLOSED"] = "closed";
3361
+ return ExternalStatus2;
3362
+ })(ExternalStatus || {});
3355
3363
  var ConversationLanguage = /* @__PURE__ */ ((ConversationLanguage3) => {
3356
3364
  ConversationLanguage3["EN"] = "en";
3357
3365
  ConversationLanguage3["ES"] = "es";
@@ -3398,7 +3406,7 @@ var compareVersions = (left, right) => {
3398
3406
  // package.json
3399
3407
  var package_default = {
3400
3408
  name: "@aiqa/sdk",
3401
- version: "2.1.0-develop.5",
3409
+ version: "2.2.0-develop.1",
3402
3410
  main: "dist/node/node.js",
3403
3411
  module: "dist/node/node.js",
3404
3412
  types: "dist/node/node.d.ts",
@@ -3808,6 +3816,7 @@ var shared_default = AiQaSdk;
3808
3816
  export {
3809
3817
  shared_default as AiQaSdk,
3810
3818
  ConversationLanguage,
3819
+ ExternalStatus,
3811
3820
  FactAnswerFormatType,
3812
3821
  IAiqaSdk,
3813
3822
  Methods