@15gifts/sdk 0.10.0 → 0.11.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/dist/index.d.mts CHANGED
@@ -6,7 +6,7 @@ import { Client as Client$1, ClientOptions, Middleware } from 'openapi-fetch';
6
6
  * Do not make direct changes to the file.
7
7
  */
8
8
  interface paths$1 {
9
- '/api/conversation/v3': {
9
+ "/api/conversation/v3": {
10
10
  parameters: {
11
11
  query?: never;
12
12
  header?: never;
@@ -16,7 +16,7 @@ interface paths$1 {
16
16
  get?: never;
17
17
  put?: never;
18
18
  /** Generate Conversation Json Response With Jwt */
19
- post: operations['generate_conversation_json_response_with_jwt_api_conversation_v3_post'];
19
+ post: operations["generate_conversation_json_response_with_jwt_api_conversation_v3_post"];
20
20
  delete?: never;
21
21
  options?: never;
22
22
  head?: never;
@@ -33,14 +33,17 @@ interface components {
33
33
  * @default actions_matched_by_triggered_branches
34
34
  * @constant
35
35
  */
36
- id: 'actions_matched_by_triggered_branches';
36
+ id: "actions_matched_by_triggered_branches";
37
37
  /**
38
38
  * Timestamp
39
39
  * Format: date-time
40
40
  */
41
41
  timestamp?: string;
42
42
  /** Data */
43
- data: [string, string[]][];
43
+ data: [
44
+ string,
45
+ string[]
46
+ ][];
44
47
  };
45
48
  /** ApplicationVersionRecord */
46
49
  ApplicationVersionRecord: {
@@ -49,7 +52,7 @@ interface components {
49
52
  * @default application_version
50
53
  * @constant
51
54
  */
52
- id: 'application_version';
55
+ id: "application_version";
53
56
  /**
54
57
  * Timestamp
55
58
  * Format: date-time
@@ -68,7 +71,7 @@ interface components {
68
71
  * @default CONVERSATION_ID
69
72
  * @constant
70
73
  */
71
- type: 'CONVERSATION_ID';
74
+ type: "CONVERSATION_ID";
72
75
  /**
73
76
  * Conversationid
74
77
  * @description Unique identifier for the conversation. This will be generated once, at the start of a conversation.
@@ -85,12 +88,12 @@ interface components {
85
88
  * @default DEBUG
86
89
  * @constant
87
90
  */
88
- type: 'DEBUG';
91
+ type: "DEBUG";
89
92
  /**
90
93
  * Records
91
94
  * @description List of debug records.
92
95
  */
93
- records: (components['schemas']['EmbeddingTokenCountRecord'] | components['schemas']['SystemPromptRecord'] | components['schemas']['TriggeredBranchesRecord'] | components['schemas']['ActionsMatchedByTriggeredBranchesRecord'] | components['schemas']['RunActionDetailsRecord'] | components['schemas']['MaxCosineSimilarityScoresRecord'] | components['schemas']['LLMTokenCountRecord'] | components['schemas']['ContextChunksRecord'] | components['schemas']['ApplicationVersionRecord'] | components['schemas']['DBVersionRecord'] | components['schemas']['PhraseTokenProbabilitiesRecord'] | components['schemas']['ConversationTurnIDRecord'] | components['schemas']['ConversationStageTransitionRecord'] | components['schemas']['MaxProgressScoreRecord'])[];
96
+ records: (components["schemas"]["EmbeddingTokenCountRecord"] | components["schemas"]["SystemPromptRecord"] | components["schemas"]["TriggeredBranchesRecord"] | components["schemas"]["ActionsMatchedByTriggeredBranchesRecord"] | components["schemas"]["RunActionDetailsRecord"] | components["schemas"]["MaxCosineSimilarityScoresRecord"] | components["schemas"]["LLMTokenCountRecord"] | components["schemas"]["ContextChunksRecord"] | components["schemas"]["ApplicationVersionRecord"] | components["schemas"]["DBVersionRecord"] | components["schemas"]["PhraseTokenProbabilitiesRecord"] | components["schemas"]["ConversationTurnIDRecord"] | components["schemas"]["ConversationStageTransitionRecord"] | components["schemas"]["MaxProgressScoreRecord"] | components["schemas"]["EligibilityRecord"])[];
94
97
  };
95
98
  /**
96
99
  * AssistantExitToChatMessage
@@ -102,7 +105,7 @@ interface components {
102
105
  * @default EXIT_TO_CHAT
103
106
  * @constant
104
107
  */
105
- type: 'EXIT_TO_CHAT';
108
+ type: "EXIT_TO_CHAT";
106
109
  /**
107
110
  * Fallbackmessage
108
111
  * @description What should a client render if they do not have a native renderer for this message type?
@@ -114,7 +117,7 @@ interface components {
114
117
  */
115
118
  conversationSummary: string;
116
119
  /** @description Why have we been exited to chat? */
117
- reason: components['schemas']['ExitToChatReason'];
120
+ reason: components["schemas"]["ExitToChatReason"];
118
121
  };
119
122
  /**
120
123
  * AssistantExitToPurchaseMessage
@@ -126,20 +129,20 @@ interface components {
126
129
  * @default EXIT_TO_PURCHASE
127
130
  * @constant
128
131
  */
129
- type: 'EXIT_TO_PURCHASE';
132
+ type: "EXIT_TO_PURCHASE";
130
133
  /**
131
134
  * Fallbackmessage
132
135
  * @description What should a client render if they do not have a native renderer for this message type?
133
136
  */
134
137
  fallbackMessage: string;
135
138
  /** Products */
136
- products: components['schemas']['Product'][];
139
+ products: components["schemas"]["Product"][];
137
140
  /**
138
141
  * Bundles
139
142
  * @description The bundles that were recommended
140
143
  * @default []
141
144
  */
142
- bundles: components['schemas']['Bundle'][];
145
+ bundles: components["schemas"]["Bundle"][];
143
146
  };
144
147
  /**
145
148
  * AssistantMultiSelectMessage
@@ -151,7 +154,7 @@ interface components {
151
154
  * @default MULTI_SELECT
152
155
  * @constant
153
156
  */
154
- type: 'MULTI_SELECT';
157
+ type: "MULTI_SELECT";
155
158
  /**
156
159
  * Fallbackmessage
157
160
  * @description What should a client render if they do not have a native renderer for this message type?
@@ -161,7 +164,7 @@ interface components {
161
164
  * Options
162
165
  * @description What selectable options should be available?
163
166
  */
164
- options: components['schemas']['ConversationOption'][];
167
+ options: components["schemas"]["ConversationOption"][];
165
168
  /**
166
169
  * Allowfreetext
167
170
  * @description Should we expect a free text response to this message?
@@ -178,14 +181,14 @@ interface components {
178
181
  * @default RECOMMENDATION
179
182
  * @constant
180
183
  */
181
- type: 'RECOMMENDATION';
184
+ type: "RECOMMENDATION";
182
185
  /**
183
186
  * Fallbackmessage
184
187
  * @description What should a client render if they do not have a native renderer for this message type?
185
188
  */
186
189
  fallbackMessage: string;
187
190
  /** Recommendations */
188
- recommendations: components['schemas']['Recommendation-Output'][];
191
+ recommendations: components["schemas"]["Recommendation"][];
189
192
  };
190
193
  /**
191
194
  * AssistantSingleSelectMessage
@@ -197,7 +200,7 @@ interface components {
197
200
  * @default SINGLE_SELECT
198
201
  * @constant
199
202
  */
200
- type: 'SINGLE_SELECT';
203
+ type: "SINGLE_SELECT";
201
204
  /**
202
205
  * Fallbackmessage
203
206
  * @description What should a client render if they do not have a native renderer for this message type?
@@ -207,7 +210,7 @@ interface components {
207
210
  * Options
208
211
  * @description What selectable options should be available?
209
212
  */
210
- options: components['schemas']['ConversationOption'][];
213
+ options: components["schemas"]["ConversationOption"][];
211
214
  /**
212
215
  * Allowfreetext
213
216
  * @description Should we expect a free text response to this message?
@@ -224,7 +227,7 @@ interface components {
224
227
  * @default MESSAGE
225
228
  * @constant
226
229
  */
227
- type: 'MESSAGE';
230
+ type: "MESSAGE";
228
231
  /**
229
232
  * Message
230
233
  * @description Message for the conversation.
@@ -257,7 +260,7 @@ interface components {
257
260
  * Products
258
261
  * @description The products that make up this bundle.
259
262
  */
260
- products: components['schemas']['Product'][];
263
+ products: components["schemas"]["Product"][];
261
264
  };
262
265
  /** ContextChunksRecord */
263
266
  ContextChunksRecord: {
@@ -266,22 +269,45 @@ interface components {
266
269
  * @default context_chunks
267
270
  * @constant
268
271
  */
269
- id: 'context_chunks';
272
+ id: "context_chunks";
270
273
  /**
271
274
  * Timestamp
272
275
  * Format: date-time
273
276
  */
274
277
  timestamp?: string;
275
278
  /** Data */
276
- data: components['schemas']['ProductInformationChunkQueryResult'][];
279
+ data: components["schemas"]["ProductInformationChunkQueryResult"][];
277
280
  };
278
281
  /** ConversationContext */
279
282
  ConversationContext: {
280
283
  /**
281
- * Availableproductids
282
- * @description What product IDs are available to recommend?
284
+ * Eligibleproducts
285
+ * @description What product IDs is the user eligible to?
283
286
  */
284
- availableProductIds?: string[] | null;
287
+ eligibleProducts?: string[] | null;
288
+ /**
289
+ * Eligiblebundles
290
+ * @description What bundle IDs is the user eligible to?
291
+ */
292
+ eligibleBundles?: string[] | null;
293
+ /**
294
+ * Productoverrides
295
+ * @description The fields to override in the product specs as based on eligibility
296
+ */
297
+ productOverrides?: {
298
+ [key: string]: {
299
+ [key: string]: string | number | Record<string, never> | unknown[];
300
+ };
301
+ } | null;
302
+ /**
303
+ * Bundleoverrides
304
+ * @description The fields to override in the product specs as based on eligibility
305
+ */
306
+ bundleOverrides?: {
307
+ [key: string]: {
308
+ [key: string]: string | number | Record<string, never> | unknown[];
309
+ };
310
+ } | null;
285
311
  } & {
286
312
  [key: string]: unknown;
287
313
  };
@@ -316,14 +342,13 @@ interface components {
316
342
  * @default conversation_stage_transition
317
343
  * @constant
318
344
  */
319
- id: 'conversation_stage_transition';
345
+ id: "conversation_stage_transition";
320
346
  /**
321
347
  * Timestamp
322
348
  * Format: date-time
323
349
  */
324
350
  timestamp?: string;
325
- /** Data */
326
- data: string;
351
+ data: components["schemas"]["CurrentConversationStageRecord"];
327
352
  };
328
353
  /** ConversationTurnIDRecord */
329
354
  ConversationTurnIDRecord: {
@@ -332,7 +357,7 @@ interface components {
332
357
  * @default conversation_turn_id
333
358
  * @constant
334
359
  */
335
- id: 'conversation_turn_id';
360
+ id: "conversation_turn_id";
336
361
  /**
337
362
  * Timestamp
338
363
  * Format: date-time
@@ -344,6 +369,18 @@ interface components {
344
369
  */
345
370
  conversation_turn_id: string;
346
371
  };
372
+ /** CurrentConversationStageRecord */
373
+ CurrentConversationStageRecord: {
374
+ /** Current Stage Name */
375
+ current_stage_name: string;
376
+ /** Llm Response */
377
+ llm_response: string;
378
+ /**
379
+ * Reason
380
+ * @enum {string}
381
+ */
382
+ reason: "NotApplicable" | "Success" | "Failure";
383
+ };
347
384
  /** DBVersionRecord */
348
385
  DBVersionRecord: {
349
386
  /**
@@ -351,7 +388,7 @@ interface components {
351
388
  * @default db_version
352
389
  * @constant
353
390
  */
354
- id: 'db_version';
391
+ id: "db_version";
355
392
  /**
356
393
  * Timestamp
357
394
  * Format: date-time
@@ -363,6 +400,21 @@ interface components {
363
400
  */
364
401
  db_version: string;
365
402
  };
403
+ /** EligibilityRecord */
404
+ EligibilityRecord: {
405
+ /**
406
+ * Id
407
+ * @default eligibility
408
+ * @constant
409
+ */
410
+ id: "eligibility";
411
+ /**
412
+ * Timestamp
413
+ * Format: date-time
414
+ */
415
+ timestamp?: string;
416
+ context: components["schemas"]["ConversationContext"];
417
+ };
366
418
  /** EmbeddingTokenCountRecord */
367
419
  EmbeddingTokenCountRecord: {
368
420
  /**
@@ -370,23 +422,23 @@ interface components {
370
422
  * @default embedding_token_count
371
423
  * @constant
372
424
  */
373
- id: 'embedding_token_count';
425
+ id: "embedding_token_count";
374
426
  /**
375
427
  * Timestamp
376
428
  * Format: date-time
377
429
  */
378
430
  timestamp?: string;
379
- data: components['schemas']['platform_py_contracts__models__debug_record_v1__EmbeddingTokenCountRecord__Data'];
431
+ data: components["schemas"]["platform_py_contracts__models__debug_record_v1__EmbeddingTokenCountRecord__Data"];
380
432
  };
381
433
  /**
382
434
  * ExitToChatReason
383
435
  * @enum {string}
384
436
  */
385
- ExitToChatReason: 'WANT_TO_TALK_TO_HUMAN' | 'OUT_OF_SCOPE_QUESTIONS' | 'NOT_BEHAVING_CORRECTLY';
437
+ ExitToChatReason: "WANT_TO_TALK_TO_HUMAN" | "OUT_OF_SCOPE_QUESTIONS" | "NOT_BEHAVING_CORRECTLY";
386
438
  /** HTTPValidationError */
387
439
  HTTPValidationError: {
388
440
  /** Detail */
389
- detail?: components['schemas']['ValidationError'][];
441
+ detail?: components["schemas"]["ValidationError"][];
390
442
  };
391
443
  /** LLMTokenCountRecord */
392
444
  LLMTokenCountRecord: {
@@ -395,13 +447,13 @@ interface components {
395
447
  * @default llm_token_count
396
448
  * @constant
397
449
  */
398
- id: 'llm_token_count';
450
+ id: "llm_token_count";
399
451
  /**
400
452
  * Timestamp
401
453
  * Format: date-time
402
454
  */
403
455
  timestamp?: string;
404
- data: components['schemas']['platform_py_contracts__models__debug_record_v1__LLMTokenCountRecord__Data'];
456
+ data: components["schemas"]["platform_py_contracts__models__debug_record_v1__LLMTokenCountRecord__Data"];
405
457
  };
406
458
  /** MaxCosineSimilarityScoresRecord */
407
459
  MaxCosineSimilarityScoresRecord: {
@@ -410,7 +462,7 @@ interface components {
410
462
  * @default max_cosine_similarity_scores
411
463
  * @constant
412
464
  */
413
- id: 'max_cosine_similarity_scores';
465
+ id: "max_cosine_similarity_scores";
414
466
  /**
415
467
  * Timestamp
416
468
  * Format: date-time
@@ -428,13 +480,13 @@ interface components {
428
480
  * @default max_progress_score
429
481
  * @constant
430
482
  */
431
- id: 'max_progress_score';
483
+ id: "max_progress_score";
432
484
  /**
433
485
  * Timestamp
434
486
  * Format: date-time
435
487
  */
436
488
  timestamp?: string;
437
- data: components['schemas']['ProgressScoreRecord'];
489
+ data: components["schemas"]["ProgressScoreRecord"];
438
490
  };
439
491
  /** PhraseTokenProbabilitiesRecord */
440
492
  PhraseTokenProbabilitiesRecord: {
@@ -443,14 +495,14 @@ interface components {
443
495
  * @default phrase_token_probabilities
444
496
  * @constant
445
497
  */
446
- id: 'phrase_token_probabilities';
498
+ id: "phrase_token_probabilities";
447
499
  /**
448
500
  * Timestamp
449
501
  * Format: date-time
450
502
  */
451
503
  timestamp?: string;
452
504
  /** Phrase Token Probabilities */
453
- phrase_token_probabilities: components['schemas']['RootModel_list_TokenProbabilityRecord__'][];
505
+ phrase_token_probabilities: components["schemas"]["RootModel_list_TokenProbabilityRecord__"][];
454
506
  };
455
507
  /** Product */
456
508
  Product: {
@@ -486,7 +538,7 @@ interface components {
486
538
  is_ready_for_recommendation: boolean;
487
539
  };
488
540
  /** Recommendation */
489
- 'Recommendation-Output': {
541
+ Recommendation: {
490
542
  /**
491
543
  * Explanation
492
544
  * @description Why was this recommendation made?
@@ -496,16 +548,16 @@ interface components {
496
548
  * Products
497
549
  * @description The IDs of the products that make up this recommendation
498
550
  */
499
- products: components['schemas']['Product'][];
551
+ products: components["schemas"]["Product"][];
500
552
  /**
501
553
  * Bundles
502
554
  * @description The bundles that make up this recommendation
503
555
  * @default []
504
556
  */
505
- bundles: components['schemas']['Bundle'][];
557
+ bundles: components["schemas"]["Bundle"][];
506
558
  };
507
559
  /** RootModel[list[TokenProbabilityRecord]] */
508
- RootModel_list_TokenProbabilityRecord__: components['schemas']['TokenProbabilityRecord'][];
560
+ RootModel_list_TokenProbabilityRecord__: components["schemas"]["TokenProbabilityRecord"][];
509
561
  /** RunActionDetailsRecord */
510
562
  RunActionDetailsRecord: {
511
563
  /**
@@ -513,13 +565,13 @@ interface components {
513
565
  * @default run_action_details
514
566
  * @constant
515
567
  */
516
- id: 'run_action_details';
568
+ id: "run_action_details";
517
569
  /**
518
570
  * Timestamp
519
571
  * Format: date-time
520
572
  */
521
573
  timestamp?: string;
522
- data: components['schemas']['platform_py_contracts__models__debug_record_v1__RunActionDetailsRecord__Data'];
574
+ data: components["schemas"]["platform_py_contracts__models__debug_record_v1__RunActionDetailsRecord__Data"];
523
575
  };
524
576
  /** SystemPromptRecord */
525
577
  SystemPromptRecord: {
@@ -528,7 +580,7 @@ interface components {
528
580
  * @default system_prompt
529
581
  * @enum {string}
530
582
  */
531
- id: 'system_prompt' | 'sales_framework_system_prompt' | 'conversation_stage_transition_prompt';
583
+ id: "system_prompt" | "sales_framework_system_prompt" | "conversation_stage_transition_prompt";
532
584
  /**
533
585
  * Timestamp
534
586
  * Format: date-time
@@ -553,7 +605,7 @@ interface components {
553
605
  * @default triggered_branches
554
606
  * @constant
555
607
  */
556
- id: 'triggered_branches';
608
+ id: "triggered_branches";
557
609
  /**
558
610
  * Timestamp
559
611
  * Format: date-time
@@ -572,7 +624,7 @@ interface components {
572
624
  * @default MULTI_SELECT
573
625
  * @constant
574
626
  */
575
- type: 'MULTI_SELECT';
627
+ type: "MULTI_SELECT";
576
628
  /**
577
629
  * Conversationid
578
630
  * @description The conversation id
@@ -599,7 +651,7 @@ interface components {
599
651
  * @default SINGLE_SELECT
600
652
  * @constant
601
653
  */
602
- type: 'SINGLE_SELECT';
654
+ type: "SINGLE_SELECT";
603
655
  /**
604
656
  * Conversationid
605
657
  * @description The conversation id
@@ -626,9 +678,9 @@ interface components {
626
678
  * @default START_CONVERSATION
627
679
  * @constant
628
680
  */
629
- type: 'START_CONVERSATION';
681
+ type: "START_CONVERSATION";
630
682
  /** @description Context information we'll be getting with the request */
631
- conversationContext: components['schemas']['ConversationContext'];
683
+ conversationContext: components["schemas"]["ConversationContext"];
632
684
  };
633
685
  /**
634
686
  * UserTextMessage
@@ -640,7 +692,7 @@ interface components {
640
692
  * @default MESSAGE
641
693
  * @constant
642
694
  */
643
- type: 'MESSAGE';
695
+ type: "MESSAGE";
644
696
  /**
645
697
  * Conversationid
646
698
  * @description The conversation id
@@ -702,24 +754,26 @@ interface operations {
702
754
  parameters: {
703
755
  query?: never;
704
756
  header?: {
705
- 'user-agent'?: string;
757
+ "user-agent"?: string;
706
758
  /**
707
759
  * @description Comma-separated list of feature flags (flags might require elevated permissions)
708
- * @example debug,use-output-guardrails,recommend-mock-bundle
760
+ * @example debug
709
761
  */
710
- 'x-feature-flags'?: string | null;
762
+ "x-feature-flags"?: string | null;
711
763
  /**
712
764
  * @description The version of the SDK version that is being used
713
765
  * @example 1.0.0
714
766
  */
715
- 'x-sdk-version'?: string | null;
767
+ "x-sdk-version"?: string | null;
768
+ /** @description A UUID marking the unique page view ID, if this request came from a web browser */
769
+ "x-pageview-id"?: string | null;
716
770
  };
717
771
  path?: never;
718
772
  cookie?: never;
719
773
  };
720
774
  requestBody: {
721
775
  content: {
722
- 'application/json': components['schemas']['UserTextMessage'] | components['schemas']['UserSingleSelectMessage'] | components['schemas']['UserMultiSelectMessage'] | components['schemas']['UserStartConversationMessage'];
776
+ "application/json": components["schemas"]["UserTextMessage"] | components["schemas"]["UserSingleSelectMessage"] | components["schemas"]["UserMultiSelectMessage"] | components["schemas"]["UserStartConversationMessage"];
723
777
  };
724
778
  };
725
779
  responses: {
@@ -729,7 +783,7 @@ interface operations {
729
783
  [name: string]: unknown;
730
784
  };
731
785
  content: {
732
- 'application/json': (components['schemas']['AssistantTextMessage'] | components['schemas']['AssistantSingleSelectMessage'] | components['schemas']['AssistantMultiSelectMessage'] | components['schemas']['AssistantExitToChatMessage'] | components['schemas']['AssistantRecommendationMessage'] | components['schemas']['AssistantConversationIdMessage'] | components['schemas']['AssistantExitToPurchaseMessage'] | components['schemas']['AssistantDebugMessage'])[];
786
+ "application/json": (components["schemas"]["AssistantTextMessage"] | components["schemas"]["AssistantSingleSelectMessage"] | components["schemas"]["AssistantMultiSelectMessage"] | components["schemas"]["AssistantExitToChatMessage"] | components["schemas"]["AssistantRecommendationMessage"] | components["schemas"]["AssistantConversationIdMessage"] | components["schemas"]["AssistantExitToPurchaseMessage"] | components["schemas"]["AssistantDebugMessage"])[];
733
787
  };
734
788
  };
735
789
  /** @description The user is not authorized to access the requested data */
@@ -738,7 +792,7 @@ interface operations {
738
792
  [name: string]: unknown;
739
793
  };
740
794
  content: {
741
- 'application/json': unknown;
795
+ "application/json": unknown;
742
796
  };
743
797
  };
744
798
  /** @description The user does not have permission to access the requested data */
@@ -747,7 +801,7 @@ interface operations {
747
801
  [name: string]: unknown;
748
802
  };
749
803
  content: {
750
- 'application/json': unknown;
804
+ "application/json": unknown;
751
805
  };
752
806
  };
753
807
  /** @description The customer config was not found */
@@ -756,7 +810,7 @@ interface operations {
756
810
  [name: string]: unknown;
757
811
  };
758
812
  content: {
759
- 'application/json': unknown;
813
+ "application/json": unknown;
760
814
  };
761
815
  };
762
816
  /** @description Validation Error */
@@ -765,7 +819,7 @@ interface operations {
765
819
  [name: string]: unknown;
766
820
  };
767
821
  content: {
768
- 'application/json': unknown;
822
+ "application/json": unknown;
769
823
  };
770
824
  };
771
825
  };
@@ -777,7 +831,7 @@ interface operations {
777
831
  * Do not make direct changes to the file.
778
832
  */
779
833
  interface paths {
780
- '/api/tracking/identity/v2': {
834
+ "/api/tracking/identity/v2": {
781
835
  parameters: {
782
836
  query?: never;
783
837
  header?: never;
@@ -800,7 +854,7 @@ interface paths {
800
854
  /** @description Generate tracking identifiers for a user */
801
855
  requestBody: {
802
856
  content: {
803
- 'application/json': {
857
+ "application/json": {
804
858
  /** @description Customer ID */
805
859
  customerId: string;
806
860
  /** @description Session ID */
@@ -817,7 +871,7 @@ interface paths {
817
871
  [name: string]: unknown;
818
872
  };
819
873
  content: {
820
- 'application/json': {
874
+ "application/json": {
821
875
  /** @description Pageview ID */
822
876
  pageviewId: string;
823
877
  /** @description Session ID */
@@ -837,7 +891,7 @@ interface paths {
837
891
  patch?: never;
838
892
  trace?: never;
839
893
  };
840
- '/api/tracking/sales/v2': {
894
+ "/api/tracking/sales/v2": {
841
895
  parameters: {
842
896
  query?: never;
843
897
  header?: never;
@@ -860,65 +914,84 @@ interface paths {
860
914
  /** @description Sales tracking event data */
861
915
  requestBody: {
862
916
  content: {
863
- /** @example {
864
- * "conversationId": "386d85d7-9daa-8a87-85d4-3f93c990b292",
865
- * "currency": "GBP",
866
- * "items": [
867
- * {
868
- * "name": "Product 1",
869
- * "productRef": "1260449",
870
- * "quantity": 1,
871
- * "recurring": 10
872
- * },
873
- * {
874
- * "name": "Product 2",
875
- * "price": 50,
876
- * "productRef": "fe-56-sd2458",
877
- * "quantity": 2
878
- * }
879
- * ],
880
- * "pageviewId": "3c06dccf-06cb-4ffe-a3c2-863f76dcc765",
881
- * "saleRef": "34596872",
882
- * "totalPrice": 100,
883
- * "totalRecurring": 10
884
- * } */
885
- 'application/json': {
886
- /** @description Conversation ID */
887
- conversationId?: string;
888
- /** @description Contract Length */
889
- contractLength?: number;
890
- /** @description Currency Code */
891
- currency: string;
892
- /**
893
- * @description Device Type
894
- * @enum {string}
895
- */
896
- deviceType?: 'desktop' | 'mobile' | 'tablet';
897
- /** @description Event data */
898
- items?: {
899
- /** @description Product Name */
900
- name?: string;
901
- /** @description Price */
902
- price?: number;
903
- /** @description Product Reference */
904
- productRef?: string;
905
- /** @description Quantity */
906
- quantity?: number;
907
- /** @description Recurring Price */
908
- recurring?: number;
909
- }[];
910
- /** @description Pageview ID */
911
- pageviewId?: string;
912
- /** @description Sale Reference */
913
- saleRef: string;
914
- /** @description Total Price */
915
- totalPrice: number;
916
- /** @description Total Recurring Price */
917
- totalRecurring?: number;
918
- /** @description URL */
919
- url?: string;
920
- /** @description User Agent */
921
- userAgent?: string;
917
+ "application/json": {
918
+ /** @description A 32 character alphanumeric hash that uniquely identifies a session */
919
+ session_id: string;
920
+ /** @description A 32 character alphanumeric hash that uniquely identifies a user */
921
+ user_id: string;
922
+ /** @description A timestamp describing the time the event occurred. This should conform to ISO 8601 standards and be in UTC. Example: \"2024-07-17T10:11:16.591Z\" */
923
+ event_at: string;
924
+ /** @description The page url at the time the event is fired */
925
+ url: string;
926
+ /** @description What web browser the user is using e.g. chrome/firefox/safari etc. */
927
+ browser: string;
928
+ /** @description The customer that the event occurred on */
929
+ customer_id: string;
930
+ /** @description The user agent string e.g. \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\" */
931
+ user_agent: string;
932
+ /** @description A 32 character alphanumeric hash that uniquely identifies a tracking event */
933
+ event_id: string;
934
+ /** @description The name of an event */
935
+ event_name: string;
936
+ /** @description A 32 character alphanumeric hash that uniquely identifies a page view (page-shown event) */
937
+ pageview_id: string;
938
+ /** @description The device screen width in pixels - window.screen.width in JS. This is a user level property that should never change. */
939
+ screen_width: number;
940
+ /** @description The device screen height in pixels - window.screen.width in JS. This is a user level property that should never change. */
941
+ screen_height: number;
942
+ /** @description The size of the device's screen, based off the actual user experience it will generate, assuming the browser window takes up the whole screen.
943
+ *
944
+ * Based off https://15gifts.atlassian.net/wiki/spaces/AI/pages/3981443139/Breakpoints+for+mobile+desktop
945
+ *
946
+ * screen_width <= 480px = 'mobile'
947
+ * screen_width > 480px = 'large' */
948
+ screen_size: string;
949
+ /** @description The ID for the sale, a unique value we can correlate with customer records. */
950
+ sale_id: string;
951
+ /** @description The type of user, for example, existing or prospect. */
952
+ user_type: string;
953
+ /** @description A code that represents what currency the product price is listed in e.g. USD, GBP. This should match the ISO 4217 standard - see https://www.iban.com/currency-codes. */
954
+ currency_code: string;
955
+ /** @description The full basket value of the sale, inclusive of any offers. */
956
+ price_total: number;
957
+ /** @description The monthly cost for all items in the package. */
958
+ price_monthly: number;
959
+ /** @description A list containing separate line items for each product sold. */
960
+ product_items: {
961
+ /** @description The ID or SKU of a product that is provided by the customer */
962
+ site_product_id: string;
963
+ /** @description The name of the product */
964
+ site_product_name: string;
965
+ /** @description The category of products the product belongs to. */
966
+ site_product_type: string;
967
+ /** @description The upfront price the user has to pay for the product. */
968
+ product_price_upfront: number;
969
+ /** @description The number of months the user will pay the product's monthly price. */
970
+ product_contract_length: string;
971
+ /** @description The per-month cost of the product. */
972
+ product_price_monthly: number;
973
+ };
974
+ /** @description The name of the product */
975
+ site_product_name: string;
976
+ /** @description The name of the system/service that the event originates from */
977
+ service: string;
978
+ /** @description A JSON object containing the different versions of services directly used by the service that tracks an event. The version of the service that is firing any tracking event should ALWAYS be included, for example if the conversation_api is firing an event, service_versions should include conversation_api_version. It should also ideally include the version numbers of any other services used in the generation of the event that is being tracked. */
979
+ service_versions: {
980
+ /** @description The version number for the frontend service */
981
+ frontend_version?: string | null;
982
+ /** @description The version number for the frontend api service */
983
+ frontend_api_version?: string | null;
984
+ /** @description The version number for the conversation api service */
985
+ conversation_api_version?: string | null;
986
+ /** @description The version number for the customer configuration service */
987
+ customer_configuration_version?: string | null;
988
+ /** @description The version number for the client library our customers are using */
989
+ sdk_version?: string | null;
990
+ /** @description The version number for the product configuration data */
991
+ product_configuration_version?: string | null;
992
+ };
993
+ /** @description The environment the event originated from (production/development/testing/staging/local/uat/ephemeral) */
994
+ environment: string;
922
995
  };
923
996
  };
924
997
  };
@@ -945,7 +1018,7 @@ interface paths {
945
1018
  patch?: never;
946
1019
  trace?: never;
947
1020
  };
948
- '/api/tracking/user/v2': {
1021
+ "/api/tracking/user/v2": {
949
1022
  parameters: {
950
1023
  query?: never;
951
1024
  header?: never;
@@ -972,9 +1045,13 @@ interface paths {
972
1045
  * "conversationId": "386d85d7-9daa-8a87-85d4-3f93c990b292",
973
1046
  * "eventName": "entry_point-shown",
974
1047
  * "pageviewId": "3c06dccf-06cb-4ffe-a3c2-863f76dcc765",
975
- * "url": "https://www.example.com/telco/"
1048
+ * "screenHeight": 855,
1049
+ * "screenSize": "mobile",
1050
+ * "screenWidth": 390,
1051
+ * "url": "https://www.example.com/telco/",
1052
+ * "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36"
976
1053
  * } */
977
- 'application/json': {
1054
+ "application/json": {
978
1055
  additionalProperties?: {
979
1056
  /** @description A 32 character alphanumeric hash that uniquely identifies a session */
980
1057
  session_id?: string;
@@ -992,6 +1069,8 @@ interface paths {
992
1069
  user_agent?: string;
993
1070
  /** @description A 32 character alphanumeric hash that uniquely identifies a tracking event */
994
1071
  event_id?: string;
1072
+ /** @description The name of an event */
1073
+ event_name?: string;
995
1074
  /** @description A 32 character alphanumeric hash that uniquely identifies a page view (page-shown event) */
996
1075
  pageview_id?: string;
997
1076
  /** @description The device screen width in pixels - window.screen.width in JS. This is a user level property that should never change. */
@@ -1009,7 +1088,7 @@ interface paths {
1009
1088
  service?: string;
1010
1089
  /** @description A JSON object containing the different versions of services directly used by the service that tracks an event. The version of the service that is firing any tracking event should ALWAYS be included, for example if the conversation_api is firing an event, service_versions should include conversation_api_version. It should also ideally include the version numbers of any other services used in the generation of the event that is being tracked. */
1011
1090
  service_versions?: Record<string, never>;
1012
- /** @description The environment the event originated from (production/development/testing/staging/local) */
1091
+ /** @description The environment the event originated from (production/development/testing/staging/local/uat/ephemeral) */
1013
1092
  environment?: string;
1014
1093
  /** @description The associated text based on the answer provided by the user at the end of the conversation when they are asked to provide feedback by clicking on one of the emojis */
1015
1094
  feedback_score_text?: string;
@@ -1035,7 +1114,11 @@ interface paths {
1035
1114
  message_select_options?: unknown[];
1036
1115
  /** @description true or false depending on whether the users message caused the assistant to provide a guardrail response */
1037
1116
  is_user_message_guardrailed?: boolean;
1038
- /** @description A list of products sent in a recommendation message */
1117
+ /** @description A list of all guardrails checked for in the corresponding turn associated with the assistant_message-submitted event this property is part of. Includes whether they were triggered and some meaningful way of measuring how close to being triggered/not triggered they were, as well as categorising into input/output guardrails. */
1118
+ guardrails?: unknown[];
1119
+ /** @description True if assistant_message-submitted event is one that is associated with a message chunk before the conversation api checks the llm response against guardrails. False if it's the final message chunk sent to the frontend. See event level description for assistant_message-submitted for more detail. */
1120
+ is_pre_output_guardrail_checks?: boolean;
1121
+ /** @description A list of products sent in a conversation api message, typically initially in a recommendation message, but then could also be in an exit_to_purchase message. */
1039
1122
  recommendation_products?: unknown[];
1040
1123
  /** @description Contains the fallback text provided by the conversation api to a frontend that non 'text' (single_select/multi_select etc) messages could revert to if they needed to. Described in the conversation api docs as: \"What should a client render if they do not have a native renderer for this message type?\". */
1041
1124
  fallback_text?: string;
@@ -1043,34 +1126,63 @@ interface paths {
1043
1126
  is_allow_free_text_message?: boolean;
1044
1127
  /** @description The reason an exit to chat response was provided by the conversation api */
1045
1128
  exit_to_chat_reason?: string;
1129
+ /** @description The ID for the sale, a unique value we can correlate with customer records. */
1130
+ sale_id?: string;
1131
+ /** @description The type of user, for example, existing or prospect. */
1132
+ user_type?: string;
1133
+ /** @description A code that represents what currency the product price is listed in e.g. USD, GBP. This should match the ISO 4217 standard - see https://www.iban.com/currency-codes. */
1134
+ currency_code?: string;
1135
+ /** @description The full basket value of the sale, inclusive of any offers. */
1136
+ price_total?: number;
1137
+ /** @description The monthly cost for all items in the package. */
1138
+ price_monthly?: number;
1139
+ /** @description A list containing separate line items for each product sold. */
1140
+ product_items?: Record<string, never>;
1141
+ /** @description The name of the product */
1142
+ site_product_name?: string;
1143
+ /** @description true if the experiment is the main uplift test, false if it isn't. */
1144
+ is_main_uplift_experiment?: boolean;
1145
+ /** @description The tracking key that growthbook uses to uniquely identify an experiment. https://docs.growthbook.io/feature-flag-experiments#tracking-key */
1146
+ experiment_id?: string;
1147
+ /** @description The specific variation (or group) that the user is assigned to within the experiment */
1148
+ experiment_variation_id?: number;
1149
+ /** @description The human readable name for the variation as defined in Growthbook */
1150
+ experiment_variation_name?: string;
1151
+ /** @description True if user has qualified for using the 15gifts sales advisor (except on customers with no qualification process where this will always be True) */
1152
+ is_qualified?: boolean;
1153
+ /** @description The stage on the particular customer's site that a user would be expected to qualify at. Should be NULL for customer sites that don't have a qualification process.
1154
+ *
1155
+ * Stage definitions:
1156
+ *
1157
+ * website - On a page on the main customer website (and not in either of the below)
1158
+ *
1159
+ * tool_ui - Within whatever frontend overlay exists that a user would have a conversation in, but not within our actual conversation (managed by conversation api). This value is more aimed to towards something like xfinity on comcast where we have a headless customer and they manage the ui.
1160
+ *
1161
+ * conversation - Within an actual conversation that is managed by the conversation api (a conversation id should exist at this point) */
1162
+ qualification_stage?: string;
1046
1163
  };
1047
1164
  /** @description Conversation ID */
1048
1165
  conversationId?: string;
1049
- /**
1050
- * @description Device Type
1051
- * @enum {string}
1052
- */
1053
- deviceType?: 'desktop' | 'mobile' | 'tablet';
1054
1166
  /**
1055
1167
  * @description Event Name
1056
1168
  * @enum {string}
1057
1169
  */
1058
- eventName: 'entry_point-shown' | 'feedback_submit-clicked' | 'page-shown' | 'tool_ui-closed' | 'user_message-submitted' | 'user_message-submitted message' | 'user_message-submitted single_select' | 'user_message-submitted multi_select' | 'assistant_message-submitted' | 'assistant_message-submitted recommendation' | 'assistant_message-submitted message' | 'assistant_message-submitted single_select' | 'assistant_message-submitted multi_select' | 'assistant_message-submitted exit_to_chat' | 'assistant_message-submitted exit_to_purchase' | 'feedback-shown' | 'feedback_skip-clicked' | 'sale-completed' | 'entry_point-clicked' | 'tool_close-clicked' | 'exit_to_purchase-completed' | 'exit_to_chat-completed';
1170
+ eventName: "entry_point-shown" | "feedback_submit-clicked" | "page-shown" | "tool_ui-closed" | "user_message-submitted" | "user_message-submitted message" | "user_message-submitted single_select" | "user_message-submitted multi_select" | "assistant_message-submitted" | "assistant_message-submitted recommendation" | "assistant_message-submitted message" | "assistant_message-submitted single_select" | "assistant_message-submitted multi_select" | "assistant_message-submitted exit_to_chat" | "assistant_message-submitted exit_to_purchase" | "feedback-shown" | "feedback_skip-clicked" | "sale-completed" | "entry_point-clicked" | "tool_close-clicked" | "experiment_variation-assigned" | "exit_to_chat-completed" | "exit_to_purchase-completed" | "conversation-started" | "user_qualification-identified";
1059
1171
  /** @description Pageview ID */
1060
- pageviewId?: string;
1061
- /** @description Screen Width */
1062
- screenWidth?: number;
1172
+ pageviewId: string;
1063
1173
  /** @description Screen Height */
1064
1174
  screenHeight?: number;
1065
1175
  /**
1066
1176
  * @description Screen Size
1067
1177
  * @enum {string}
1068
1178
  */
1069
- screenSize?: 'mobile' | 'large';
1179
+ screenSize?: "mobile" | "large";
1180
+ /** @description Screen Width */
1181
+ screenWidth?: number;
1070
1182
  /** @description URL */
1071
- url?: string;
1183
+ url: string;
1072
1184
  /** @description User Agent */
1073
- userAgent?: string;
1185
+ userAgent: string;
1074
1186
  };
1075
1187
  };
1076
1188
  };
@@ -1211,7 +1323,7 @@ declare class Client {
1211
1323
  * @example
1212
1324
  * ```ts
1213
1325
  * const client = new Client({ customerId: 'YOUR_CUSTOMER_ID' })
1214
- * const { data } = await client.endpoint.conversation.POST('/api/conversation/v2')
1326
+ * const { data } = await client.endpoint.conversation.POST('/api/conversation/v3')
1215
1327
  * ```
1216
1328
  */
1217
1329
  endpoint: Endpoint;
@@ -1277,12 +1389,7 @@ declare class Client {
1277
1389
  * console.log('Opening message:', openingMessage)
1278
1390
  * ```
1279
1391
  */
1280
- startConversation(context?: {
1281
- eligibleProducts?: string[];
1282
- eligibleBundles?: string[];
1283
- productOverrides?: Record<string, unknown>;
1284
- bundleOverrides?: Record<string, unknown>;
1285
- }): Promise<TextMessage | undefined>;
1392
+ startConversation(context?: components['schemas']['ConversationContext']): Promise<TextMessage | undefined>;
1286
1393
  /**
1287
1394
  * Sends a message in the conversation.
1288
1395
  *
@@ -1336,6 +1443,7 @@ declare class Client {
1336
1443
  customer_id?: string;
1337
1444
  user_agent?: string;
1338
1445
  event_id?: string;
1446
+ event_name?: string;
1339
1447
  pageview_id?: string;
1340
1448
  screen_width?: number;
1341
1449
  screen_height?: number;
@@ -1352,20 +1460,34 @@ declare class Client {
1352
1460
  message_text?: string;
1353
1461
  message_select_options?: unknown[];
1354
1462
  is_user_message_guardrailed?: boolean;
1463
+ guardrails?: unknown[];
1464
+ is_pre_output_guardrail_checks?: boolean;
1355
1465
  recommendation_products?: unknown[];
1356
1466
  fallback_text?: string;
1357
1467
  is_allow_free_text_message?: boolean;
1358
1468
  exit_to_chat_reason?: string;
1469
+ sale_id?: string;
1470
+ user_type?: string;
1471
+ currency_code?: string;
1472
+ price_total?: number;
1473
+ price_monthly?: number;
1474
+ product_items?: Record<string, never>;
1475
+ site_product_name?: string;
1476
+ is_main_uplift_experiment?: boolean;
1477
+ experiment_id?: string;
1478
+ experiment_variation_id?: number;
1479
+ experiment_variation_name?: string;
1480
+ is_qualified?: boolean;
1481
+ qualification_stage?: string;
1359
1482
  };
1360
1483
  conversationId?: string;
1361
- deviceType?: "desktop" | "mobile" | "tablet";
1362
- eventName: "entry_point-shown" | "feedback_submit-clicked" | "page-shown" | "tool_ui-closed" | "user_message-submitted" | "user_message-submitted message" | "user_message-submitted single_select" | "user_message-submitted multi_select" | "assistant_message-submitted" | "assistant_message-submitted recommendation" | "assistant_message-submitted message" | "assistant_message-submitted single_select" | "assistant_message-submitted multi_select" | "assistant_message-submitted exit_to_chat" | "assistant_message-submitted exit_to_purchase" | "feedback-shown" | "feedback_skip-clicked" | "sale-completed" | "entry_point-clicked" | "tool_close-clicked" | "exit_to_purchase-completed" | "exit_to_chat-completed";
1363
- pageviewId?: string;
1364
- screenWidth?: number;
1484
+ eventName: "entry_point-shown" | "feedback_submit-clicked" | "page-shown" | "tool_ui-closed" | "user_message-submitted" | "user_message-submitted message" | "user_message-submitted single_select" | "user_message-submitted multi_select" | "assistant_message-submitted" | "assistant_message-submitted recommendation" | "assistant_message-submitted message" | "assistant_message-submitted single_select" | "assistant_message-submitted multi_select" | "assistant_message-submitted exit_to_chat" | "assistant_message-submitted exit_to_purchase" | "feedback-shown" | "feedback_skip-clicked" | "sale-completed" | "entry_point-clicked" | "tool_close-clicked" | "experiment_variation-assigned" | "exit_to_chat-completed" | "exit_to_purchase-completed" | "conversation-started" | "user_qualification-identified";
1485
+ pageviewId: string;
1365
1486
  screenHeight?: number;
1366
1487
  screenSize?: "mobile" | "large";
1367
- url?: string;
1368
- userAgent?: string;
1488
+ screenWidth?: number;
1489
+ url: string;
1490
+ userAgent: string;
1369
1491
  };
1370
1492
  };
1371
1493
  };
@@ -1599,4 +1721,18 @@ declare const authMiddleware: (accessToken: string) => Middleware;
1599
1721
  */
1600
1722
  declare const errorMiddleware: Middleware;
1601
1723
 
1602
- export { CONVERSATION_ID, Client, type Config, type ConversationIdMessage, type DebugMessage, type Endpoint, type ExitToChatMessage, type ExitToPurchaseMessage, type Identity, JWT_TOKEN, type Message, type MultiSelectMessage, type RecommendationMessage, SESSION_ID, type SingleSelectMessage, TTL, type TextMessage, type TrackingEvent, USER_ID, authMiddleware, deleteConversationId, errorMiddleware, getConversationId, getSessionId, getToken, getUserId, isTokenExpired, setConversationId, setSessionId, setToken, setUserId };
1724
+ /**
1725
+ * Middleware for adding request headers that other services use for tracking.
1726
+ *
1727
+ * @returns A middleware object that throws an error if the response is not ok.
1728
+ *
1729
+ * @example
1730
+ * ```ts
1731
+ * import { pageViewId } from '@15gifts/sdk';
1732
+ *
1733
+ * this.endpoint.conversation.use(headerMiddleware('123', 'https://example.com'))
1734
+ * ```
1735
+ */
1736
+ declare const headerMiddleware: (identity: Identity, url: string) => Middleware;
1737
+
1738
+ export { CONVERSATION_ID, Client, type Config, type ConversationIdMessage, type DebugMessage, type Endpoint, type ExitToChatMessage, type ExitToPurchaseMessage, type Identity, JWT_TOKEN, type Message, type MultiSelectMessage, type RecommendationMessage, SESSION_ID, type SingleSelectMessage, TTL, type TextMessage, type TrackingEvent, USER_ID, authMiddleware, deleteConversationId, errorMiddleware, getConversationId, getSessionId, getToken, getUserId, headerMiddleware, isTokenExpired, setConversationId, setSessionId, setToken, setUserId };