@15gifts/sdk 0.16.5 → 0.16.7
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 +216 -26
- package/dist/index.d.ts +216 -26
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ interface components {
|
|
|
43
43
|
/**
|
|
44
44
|
* Conversationid
|
|
45
45
|
* @description Unique identifier for the conversation. This will be generated once, at the start of a conversation.
|
|
46
|
+
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
46
47
|
*/
|
|
47
48
|
conversationId?: string | null;
|
|
48
49
|
};
|
|
@@ -60,6 +61,7 @@ interface components {
|
|
|
60
61
|
/**
|
|
61
62
|
* Fallbackmessage
|
|
62
63
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
64
|
+
* @example Your options are a, b or c
|
|
63
65
|
*/
|
|
64
66
|
fallbackMessage: string;
|
|
65
67
|
/**
|
|
@@ -69,6 +71,12 @@ interface components {
|
|
|
69
71
|
conversationSummary: string;
|
|
70
72
|
/** @description Why have we been exited to chat? */
|
|
71
73
|
reason: components['schemas']['ExitToHumanReason'];
|
|
74
|
+
/**
|
|
75
|
+
* Recommendations
|
|
76
|
+
* @description A list of recommendations the user received from the recommender.
|
|
77
|
+
* @default []
|
|
78
|
+
*/
|
|
79
|
+
recommendations: components['schemas']['RecommendationV2'][];
|
|
72
80
|
};
|
|
73
81
|
/**
|
|
74
82
|
* AssistantExitToPhoneMessage
|
|
@@ -84,6 +92,7 @@ interface components {
|
|
|
84
92
|
/**
|
|
85
93
|
* Fallbackmessage
|
|
86
94
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
95
|
+
* @example Your options are a, b or c
|
|
87
96
|
*/
|
|
88
97
|
fallbackMessage: string;
|
|
89
98
|
/** @description Why have we been exited to phone? */
|
|
@@ -115,6 +124,7 @@ interface components {
|
|
|
115
124
|
/**
|
|
116
125
|
* Fallbackmessage
|
|
117
126
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
127
|
+
* @example Your options are a, b or c
|
|
118
128
|
*/
|
|
119
129
|
fallbackMessage: string;
|
|
120
130
|
/** Recommendationidforexit */
|
|
@@ -148,6 +158,7 @@ interface components {
|
|
|
148
158
|
/**
|
|
149
159
|
* Fallbackmessage
|
|
150
160
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
161
|
+
* @example Your options are a, b or c
|
|
151
162
|
*/
|
|
152
163
|
fallbackMessage: string;
|
|
153
164
|
/** Recommendationidforexit */
|
|
@@ -181,6 +192,7 @@ interface components {
|
|
|
181
192
|
/**
|
|
182
193
|
* Fallbackmessage
|
|
183
194
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
195
|
+
* @example Your options are a, b or c
|
|
184
196
|
*/
|
|
185
197
|
fallbackMessage: string;
|
|
186
198
|
/**
|
|
@@ -208,6 +220,7 @@ interface components {
|
|
|
208
220
|
/**
|
|
209
221
|
* Fallbackmessage
|
|
210
222
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
223
|
+
* @example Your options are a, b or c
|
|
211
224
|
*/
|
|
212
225
|
fallbackMessage: string;
|
|
213
226
|
/** Recommendations */
|
|
@@ -227,6 +240,7 @@ interface components {
|
|
|
227
240
|
/**
|
|
228
241
|
* Fallbackmessage
|
|
229
242
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
243
|
+
* @example Your options are a, b or c
|
|
230
244
|
*/
|
|
231
245
|
fallbackMessage: string;
|
|
232
246
|
/** Recommendations */
|
|
@@ -248,6 +262,7 @@ interface components {
|
|
|
248
262
|
/**
|
|
249
263
|
* Fallbackmessage
|
|
250
264
|
* @description What should a client render if they do not have a native renderer for this message type?
|
|
265
|
+
* @example Your options are a, b or c
|
|
251
266
|
*/
|
|
252
267
|
fallbackMessage: string;
|
|
253
268
|
/**
|
|
@@ -275,6 +290,7 @@ interface components {
|
|
|
275
290
|
/**
|
|
276
291
|
* Message
|
|
277
292
|
* @description Message for the conversation.
|
|
293
|
+
* @example Hello, how can I help you today?
|
|
278
294
|
*/
|
|
279
295
|
message: string;
|
|
280
296
|
};
|
|
@@ -340,26 +356,74 @@ interface components {
|
|
|
340
356
|
/** Products */
|
|
341
357
|
products: components['schemas']['ProductV2'][];
|
|
342
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* ChoiceOfferDetails
|
|
361
|
+
* @description Choice details
|
|
362
|
+
*/
|
|
363
|
+
ChoiceOfferDetails: {
|
|
364
|
+
/**
|
|
365
|
+
* Title
|
|
366
|
+
* @description The title when we show the choice offer selection to the user
|
|
367
|
+
*/
|
|
368
|
+
title?: string | null;
|
|
369
|
+
/**
|
|
370
|
+
* Pickfrom
|
|
371
|
+
* @description The options available for the user to pick from in the choice offer
|
|
372
|
+
*/
|
|
373
|
+
pickFrom?: components['schemas']['PickFrom'][] | null;
|
|
374
|
+
/**
|
|
375
|
+
* Pickmin
|
|
376
|
+
* @description The minimum number of options the user must pick in the choice offer
|
|
377
|
+
*/
|
|
378
|
+
pickMin?: number | null;
|
|
379
|
+
/**
|
|
380
|
+
* Pickmax
|
|
381
|
+
* @description The maximum number of options the user can pick in the choice offer
|
|
382
|
+
*/
|
|
383
|
+
pickMax?: number | null;
|
|
384
|
+
};
|
|
343
385
|
/** ConversationContext */
|
|
344
386
|
ConversationContext: {
|
|
345
387
|
/**
|
|
346
388
|
* Eligibleproducts
|
|
347
389
|
* @description What product IDs is the user eligible for?
|
|
390
|
+
* @example [
|
|
391
|
+
* "12345"
|
|
392
|
+
* ]
|
|
348
393
|
*/
|
|
349
394
|
eligibleProducts?: string[] | null;
|
|
350
395
|
/**
|
|
351
396
|
* Eligiblebundles
|
|
352
397
|
* @description What bundle IDs is the user eligible for?
|
|
398
|
+
* @example [
|
|
399
|
+
* "12345"
|
|
400
|
+
* ]
|
|
353
401
|
*/
|
|
354
402
|
eligibleBundles?: string[] | null;
|
|
355
403
|
/**
|
|
356
404
|
* Eligibleoffers
|
|
357
405
|
* @description What offer IDs is the user eligible for?
|
|
406
|
+
* @example [
|
|
407
|
+
* "PROMO1234"
|
|
408
|
+
* ]
|
|
358
409
|
*/
|
|
359
410
|
eligibleOffers?: string[] | null;
|
|
360
411
|
/**
|
|
361
412
|
* Productoverrides
|
|
362
413
|
* @description The fields to override in the product specs as based on eligibility
|
|
414
|
+
* @example {
|
|
415
|
+
* "INTERNET": {
|
|
416
|
+
* "specifications": {
|
|
417
|
+
* "connectionSpeeds": {
|
|
418
|
+
* "averageDownloadSpeed": {
|
|
419
|
+
* "@type": "AverageDownloadSpeed",
|
|
420
|
+
* "unitText": "Mbps",
|
|
421
|
+
* "value": 100
|
|
422
|
+
* }
|
|
423
|
+
* }
|
|
424
|
+
* }
|
|
425
|
+
* }
|
|
426
|
+
* }
|
|
363
427
|
*/
|
|
364
428
|
productOverrides?: {
|
|
365
429
|
[key: string]: {
|
|
@@ -369,6 +433,21 @@ interface components {
|
|
|
369
433
|
/**
|
|
370
434
|
* Bundleoverrides
|
|
371
435
|
* @description The fields to override in the product specs as based on eligibility
|
|
436
|
+
* @example {
|
|
437
|
+
* "BUNDLEDISCOUNT": {
|
|
438
|
+
* "prices": {
|
|
439
|
+
* "@type": "Standard",
|
|
440
|
+
* "description": "$17.50 per month for 12 months",
|
|
441
|
+
* "monthlyCost": 17.5,
|
|
442
|
+
* "parts": [
|
|
443
|
+
* {
|
|
444
|
+
* "@type": "MonthlyPricePart",
|
|
445
|
+
* "value": 17.5
|
|
446
|
+
* }
|
|
447
|
+
* ]
|
|
448
|
+
* }
|
|
449
|
+
* }
|
|
450
|
+
* }
|
|
372
451
|
*/
|
|
373
452
|
bundleOverrides?: {
|
|
374
453
|
[key: string]: {
|
|
@@ -378,6 +457,14 @@ interface components {
|
|
|
378
457
|
/**
|
|
379
458
|
* Offeroverrides
|
|
380
459
|
* @description The fields to override in the offer specs as based on eligibility
|
|
460
|
+
* @example {
|
|
461
|
+
* "PROMO1234": {
|
|
462
|
+
* "discount": {
|
|
463
|
+
* "description": "Big Summer Blowout (20% off)",
|
|
464
|
+
* "value": 20
|
|
465
|
+
* }
|
|
466
|
+
* }
|
|
467
|
+
* }
|
|
381
468
|
*/
|
|
382
469
|
offerOverrides?: {
|
|
383
470
|
[key: string]: {
|
|
@@ -435,6 +522,36 @@ interface components {
|
|
|
435
522
|
* @description Description of the offer from the feed data
|
|
436
523
|
*/
|
|
437
524
|
description?: string | null;
|
|
525
|
+
/**
|
|
526
|
+
* Type
|
|
527
|
+
* @description The type of the offer
|
|
528
|
+
*/
|
|
529
|
+
type?: string | null;
|
|
530
|
+
/** @description Choice contain information needed for choice offers */
|
|
531
|
+
choice?: components['schemas']['ChoiceOfferDetails'] | null;
|
|
532
|
+
};
|
|
533
|
+
/** PickFrom */
|
|
534
|
+
PickFrom: {
|
|
535
|
+
/**
|
|
536
|
+
* Id
|
|
537
|
+
* @description The id of the pick from option.
|
|
538
|
+
*/
|
|
539
|
+
id?: string | null;
|
|
540
|
+
/**
|
|
541
|
+
* Name
|
|
542
|
+
* @description The name of the pick from option.
|
|
543
|
+
*/
|
|
544
|
+
name?: string | null;
|
|
545
|
+
/**
|
|
546
|
+
* Description
|
|
547
|
+
* @description The description of the pick from option.
|
|
548
|
+
*/
|
|
549
|
+
description?: string | null;
|
|
550
|
+
/**
|
|
551
|
+
* Price
|
|
552
|
+
* @description The price description of the pick from option.
|
|
553
|
+
*/
|
|
554
|
+
price?: string | null;
|
|
438
555
|
};
|
|
439
556
|
/** Product */
|
|
440
557
|
Product: {
|
|
@@ -608,16 +725,22 @@ interface components {
|
|
|
608
725
|
* Conversationid
|
|
609
726
|
* Format: uuid
|
|
610
727
|
* @description The conversation id
|
|
728
|
+
* @example 15630a82-0e3d-4d1b-ab7d-fb7481a7a344
|
|
611
729
|
*/
|
|
612
730
|
conversationId: string;
|
|
613
731
|
/**
|
|
614
732
|
* Usermessage
|
|
615
733
|
* @description The user message
|
|
734
|
+
* @example Hello
|
|
616
735
|
*/
|
|
617
736
|
userMessage?: string | null;
|
|
618
737
|
/**
|
|
619
738
|
* Options
|
|
620
739
|
* @description Which select options were picked?
|
|
740
|
+
* @example [
|
|
741
|
+
* "12345",
|
|
742
|
+
* "67890"
|
|
743
|
+
* ]
|
|
621
744
|
*/
|
|
622
745
|
options: string[];
|
|
623
746
|
};
|
|
@@ -636,16 +759,19 @@ interface components {
|
|
|
636
759
|
* Conversationid
|
|
637
760
|
* Format: uuid
|
|
638
761
|
* @description The conversation id
|
|
762
|
+
* @example 15630a82-0e3d-4d1b-ab7d-fb7481a7a344
|
|
639
763
|
*/
|
|
640
764
|
conversationId: string;
|
|
641
765
|
/**
|
|
642
766
|
* Usermessage
|
|
643
767
|
* @description The user message
|
|
768
|
+
* @example Hello
|
|
644
769
|
*/
|
|
645
770
|
userMessage?: string | null;
|
|
646
771
|
/**
|
|
647
772
|
* Option
|
|
648
773
|
* @description Which select option was picked?
|
|
774
|
+
* @example 12345
|
|
649
775
|
*/
|
|
650
776
|
option?: string | null;
|
|
651
777
|
};
|
|
@@ -662,6 +788,11 @@ interface components {
|
|
|
662
788
|
type: 'START_CONVERSATION';
|
|
663
789
|
/** @description Context information we'll be getting with the request */
|
|
664
790
|
conversationContext: components['schemas']['ConversationContext'];
|
|
791
|
+
/**
|
|
792
|
+
* Openingusermessage
|
|
793
|
+
* @description An optional opening message sent by the user as the very first message, for things such as UI chips in the frontend to prepopulate the conversation
|
|
794
|
+
*/
|
|
795
|
+
openingUserMessage?: components['schemas']['UserTextMessage'] | components['schemas']['UserSingleSelectMessage'] | components['schemas']['UserMultiSelectMessage'] | null;
|
|
665
796
|
};
|
|
666
797
|
/**
|
|
667
798
|
* UserTextMessage
|
|
@@ -678,11 +809,13 @@ interface components {
|
|
|
678
809
|
* Conversationid
|
|
679
810
|
* Format: uuid
|
|
680
811
|
* @description The conversation id
|
|
812
|
+
* @example 15630a82-0e3d-4d1b-ab7d-fb7481a7a344
|
|
681
813
|
*/
|
|
682
814
|
conversationId: string;
|
|
683
815
|
/**
|
|
684
816
|
* Usermessage
|
|
685
817
|
* @description The user message
|
|
818
|
+
* @example Hello
|
|
686
819
|
*/
|
|
687
820
|
userMessage: string;
|
|
688
821
|
};
|
|
@@ -742,6 +875,13 @@ interface operations {
|
|
|
742
875
|
[name: string]: unknown;
|
|
743
876
|
};
|
|
744
877
|
content: {
|
|
878
|
+
/**
|
|
879
|
+
* @example {
|
|
880
|
+
* "code": "ERROR_UNHANDLED",
|
|
881
|
+
* "message": "An error occurred",
|
|
882
|
+
* "detail": "Unauthorized access"
|
|
883
|
+
* }
|
|
884
|
+
*/
|
|
745
885
|
'application/json': unknown;
|
|
746
886
|
};
|
|
747
887
|
};
|
|
@@ -751,6 +891,13 @@ interface operations {
|
|
|
751
891
|
[name: string]: unknown;
|
|
752
892
|
};
|
|
753
893
|
content: {
|
|
894
|
+
/**
|
|
895
|
+
* @example {
|
|
896
|
+
* "code": "ERROR_UNHANDLED",
|
|
897
|
+
* "message": "An error occurred",
|
|
898
|
+
* "detail": "Access forbidden"
|
|
899
|
+
* }
|
|
900
|
+
*/
|
|
754
901
|
'application/json': unknown;
|
|
755
902
|
};
|
|
756
903
|
};
|
|
@@ -760,6 +907,13 @@ interface operations {
|
|
|
760
907
|
[name: string]: unknown;
|
|
761
908
|
};
|
|
762
909
|
content: {
|
|
910
|
+
/**
|
|
911
|
+
* @example {
|
|
912
|
+
* "code": "ERROR_UNHANDLED",
|
|
913
|
+
* "message": "An error occurred",
|
|
914
|
+
* "detail": "Customer 1234 not found"
|
|
915
|
+
* }
|
|
916
|
+
*/
|
|
763
917
|
'application/json': unknown;
|
|
764
918
|
};
|
|
765
919
|
};
|
|
@@ -769,6 +923,20 @@ interface operations {
|
|
|
769
923
|
[name: string]: unknown;
|
|
770
924
|
};
|
|
771
925
|
content: {
|
|
926
|
+
/**
|
|
927
|
+
* @example {
|
|
928
|
+
* "code": "ERROR_UNHANDLED",
|
|
929
|
+
* "message": "An error occurred",
|
|
930
|
+
* "detail": {
|
|
931
|
+
* "loc": [
|
|
932
|
+
* "string",
|
|
933
|
+
* 0
|
|
934
|
+
* ],
|
|
935
|
+
* "msg": "string",
|
|
936
|
+
* "type": "string"
|
|
937
|
+
* }
|
|
938
|
+
* }
|
|
939
|
+
*/
|
|
772
940
|
'application/json': unknown;
|
|
773
941
|
};
|
|
774
942
|
};
|
|
@@ -849,6 +1017,14 @@ interface paths {
|
|
|
849
1017
|
[name: string]: unknown;
|
|
850
1018
|
};
|
|
851
1019
|
content: {
|
|
1020
|
+
/**
|
|
1021
|
+
* @example {
|
|
1022
|
+
* "pageviewId": "3c06dccf-06cb-4ffe-a3c2-863f76dcc765",
|
|
1023
|
+
* "sessionId": "2f6863a9-2833-5521-a45d-359dcdfd154a",
|
|
1024
|
+
* "userId": "163a692e-8ee2-623f-9927-0bb563b19853",
|
|
1025
|
+
* "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
|
1026
|
+
* }
|
|
1027
|
+
*/
|
|
852
1028
|
'application/json': {
|
|
853
1029
|
/**
|
|
854
1030
|
* @description A 36 character hash, 5 segments, separated by dashes that uniquely identifies a page view (page-shown event)
|
|
@@ -901,7 +1077,8 @@ interface paths {
|
|
|
901
1077
|
/** @description User tracking event data */
|
|
902
1078
|
requestBody: {
|
|
903
1079
|
content: {
|
|
904
|
-
/**
|
|
1080
|
+
/**
|
|
1081
|
+
* @example {
|
|
905
1082
|
* "conversationId": "386d85d7-9daa-8a87-85d4-3f93c990b292",
|
|
906
1083
|
* "eventName": "entry_point-shown",
|
|
907
1084
|
* "pageviewId": "3c06dccf-06cb-4ffe-a3c2-863f76dcc765",
|
|
@@ -910,73 +1087,85 @@ interface paths {
|
|
|
910
1087
|
* "screenWidth": 390,
|
|
911
1088
|
* "url": "https://www.example.com/telco/",
|
|
912
1089
|
* "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36"
|
|
913
|
-
* }
|
|
1090
|
+
* }
|
|
1091
|
+
*/
|
|
914
1092
|
'application/json': {
|
|
915
1093
|
additionalProperties?: {
|
|
916
|
-
/**
|
|
1094
|
+
/**
|
|
1095
|
+
* @description A 36 character alphanumeric hash that uniquely identifies a user.
|
|
917
1096
|
*
|
|
918
1097
|
*
|
|
919
1098
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
920
1099
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
921
1100
|
*
|
|
922
|
-
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1101
|
+
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1102
|
+
*/
|
|
923
1103
|
user_id?: string;
|
|
924
1104
|
/** @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" */
|
|
925
1105
|
event_at?: string;
|
|
926
1106
|
/** @description The page url at the time the event is fired */
|
|
927
1107
|
url?: string;
|
|
928
|
-
/** @description What web browser the user is using e.g. chrome/firefox/safari etc.
|
|
1108
|
+
/** @description What web browser the user is using e.g. chrome/firefox/safari etc. */
|
|
929
1109
|
browser?: string;
|
|
930
1110
|
/** @description The customer that the event occurred on */
|
|
931
1111
|
customer_id?: string;
|
|
932
1112
|
/** @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" */
|
|
933
1113
|
user_agent?: string;
|
|
934
|
-
/**
|
|
1114
|
+
/**
|
|
1115
|
+
* @description A 36 character alphanumeric hash that uniquely identifies a tracking event
|
|
935
1116
|
*
|
|
936
1117
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
937
1118
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
938
1119
|
*
|
|
939
|
-
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1120
|
+
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1121
|
+
*/
|
|
940
1122
|
event_id?: string;
|
|
941
1123
|
/** @description The name of an event */
|
|
942
1124
|
event_name?: string;
|
|
943
|
-
/**
|
|
1125
|
+
/**
|
|
1126
|
+
* @description A 36 character alphanumeric hash that uniquely identifies a page view (page-shown event)
|
|
944
1127
|
*
|
|
945
1128
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
946
1129
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
947
1130
|
*
|
|
948
|
-
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1131
|
+
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1132
|
+
*/
|
|
949
1133
|
pageview_id?: string;
|
|
950
1134
|
/** @description A unique user id native to our customers web analytics platforms (adobe, google analytics etc). Helps us & our customers align our data with what customers see in their platforms. */
|
|
951
1135
|
web_analytics_platform_user_id?: string | null;
|
|
952
|
-
/**
|
|
1136
|
+
/**
|
|
1137
|
+
* @description A 36 character alphanumeric hash that uniquely identifies a session.
|
|
953
1138
|
*
|
|
954
1139
|
*
|
|
955
1140
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
956
1141
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
957
1142
|
*
|
|
958
1143
|
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
959
|
-
|
|
1144
|
+
*/
|
|
960
1145
|
browser_session_id?: string | null;
|
|
961
1146
|
/** @description The device screen width in pixels - window.screen.width in JS. This is a user level property that should never change. */
|
|
962
1147
|
screen_width?: number;
|
|
963
1148
|
/** @description The device screen height in pixels - window.screen.height in JS. This is a user level property that should never change. */
|
|
964
1149
|
screen_height?: number;
|
|
965
|
-
/**
|
|
1150
|
+
/**
|
|
1151
|
+
* @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.
|
|
966
1152
|
*
|
|
967
1153
|
* Based off https://15gifts.atlassian.net/wiki/spaces/AI/pages/3981443139/Breakpoints+for+mobile+desktop
|
|
968
1154
|
*
|
|
969
1155
|
* screen_width <= 480px = 'mobile'
|
|
970
|
-
* screen_width > 480px = 'large'
|
|
1156
|
+
* screen_width > 480px = 'large'
|
|
1157
|
+
*/
|
|
971
1158
|
screen_size?: string;
|
|
972
1159
|
/** @description The type of entry point the event refers to, e.g. engagement_button (previously named tab), engagement popup (previously named engagement bubble) etc */
|
|
973
1160
|
entry_point_type?: string;
|
|
974
|
-
/**
|
|
1161
|
+
/**
|
|
1162
|
+
* @description A 36 character alphanumeric hash that uniquely identifies a conversation.
|
|
975
1163
|
*
|
|
976
1164
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
977
1165
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
978
1166
|
*
|
|
979
|
-
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1167
|
+
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1168
|
+
*/
|
|
980
1169
|
conversation_id?: string;
|
|
981
1170
|
/** @description The name of the system/service that the event originates from */
|
|
982
1171
|
service?: string;
|
|
@@ -994,14 +1183,15 @@ interface paths {
|
|
|
994
1183
|
tool_ui_closed_reason?: string;
|
|
995
1184
|
/** @description Specifies whether the click on the entry point was a positive or negative CTA. Positive would be expected to open the tool ui, negative would be expected to close the entry point. */
|
|
996
1185
|
entry_point_click_type?: string | null;
|
|
997
|
-
/**
|
|
1186
|
+
/**
|
|
1187
|
+
* @description Describes what exactly was clicked on an entry point that lead to the tool opening.
|
|
998
1188
|
*
|
|
999
1189
|
* Value should be one of the following:
|
|
1000
1190
|
*
|
|
1001
1191
|
* 'main_cta' if the standard sparkles cta is clicked
|
|
1002
1192
|
* 'keyword_box' - if it's the freetext box that's clicked
|
|
1003
1193
|
* 'prompt_chip_{promptchiptext}' - if an example prompt is clicked e.g. 'prompt_chip_what_speed_is_best_for_my_devices' - we'll revise this tracking post fake door test if prompt chips become more permanent
|
|
1004
|
-
|
|
1194
|
+
*/
|
|
1005
1195
|
entry_point_click_element?: string;
|
|
1006
1196
|
/** @description A list of ids that each correspond to their own recommendation, with all recs in the list being 'exit to purchase-able' or 'exit to chat-able' */
|
|
1007
1197
|
recommendation_ids_for_exit?: unknown[];
|
|
@@ -1015,27 +1205,26 @@ interface paths {
|
|
|
1015
1205
|
experiment_variation_name?: string;
|
|
1016
1206
|
/** @description Describes the reason the entry point was closed. When the value is 'customer_triggered' it's because it's been programmatically closed by the customer (by running window.axiom.integrations.hide()). When it's 'user_close_click' it's because the actual end user has closed it manually by clicking. */
|
|
1017
1207
|
entry_point_closed_reason?: string;
|
|
1018
|
-
/** @description A categorical property to denote which party was responsible for suppression. This is useful for accurately calculating control conversion rates, it allows us to count how many users were suppressed before humara loading, and how many were put in a control group.
|
|
1019
|
-
* */
|
|
1208
|
+
/** @description A categorical property to denote which party was responsible for suppression. This is useful for accurately calculating control conversion rates, it allows us to count how many users were suppressed before humara loading, and how many were put in a control group. */
|
|
1020
1209
|
suppressed_by?: unknown[];
|
|
1021
|
-
/** @description A categorical property that describes the reason for the suppression. When the value is 'customer_triggered' it's because it's been programmatically closed by the customer (by running window.axiom.integrations.hide())
|
|
1022
|
-
* */
|
|
1210
|
+
/** @description A categorical property that describes the reason for the suppression. When the value is 'customer_triggered' it's because it's been programmatically closed by the customer (by running window.axiom.integrations.hide()) */
|
|
1023
1211
|
suppressed_reason?: unknown[];
|
|
1024
1212
|
/** @description The type of destination the user will be sent to as a result of exiting to chat. E.g 'phone','chat','email' etc */
|
|
1025
1213
|
exit_destination_type?: string;
|
|
1026
1214
|
/** @description Describes whether a user clicked the thumbs up ('positive') or thumbs down ('negative') on the rec card */
|
|
1027
1215
|
rec_card_feedback_sentiment?: string;
|
|
1028
|
-
/**
|
|
1216
|
+
/**
|
|
1217
|
+
* @description A 32 character alphanumeric hash that uniquely identifies a single rec in a recommendation set.
|
|
1029
1218
|
*
|
|
1030
1219
|
* This should match the UUID V4 as specified in RFC 9652:
|
|
1031
1220
|
* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4
|
|
1032
1221
|
*
|
|
1033
|
-
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1222
|
+
* e.g f81d4fae-7dec-41d0-a765-00a0c91e6bf6
|
|
1223
|
+
*/
|
|
1034
1224
|
recommendation_id?: string;
|
|
1035
|
-
/** @description List of objects that represents the options for single & multiselect questions.
|
|
1225
|
+
/** @description List of objects that represents the options for single & multiselect questions. */
|
|
1036
1226
|
message_select_options?: unknown[];
|
|
1037
|
-
/** @description The text that was visible to the user on the CTA button
|
|
1038
|
-
* */
|
|
1227
|
+
/** @description The text that was visible to the user on the CTA button */
|
|
1039
1228
|
button_text?: string;
|
|
1040
1229
|
};
|
|
1041
1230
|
/**
|
|
@@ -1326,6 +1515,7 @@ declare class Client {
|
|
|
1326
1515
|
fallbackMessage: string;
|
|
1327
1516
|
conversationSummary: string;
|
|
1328
1517
|
reason: components["schemas"]["ExitToHumanReason"];
|
|
1518
|
+
recommendations: components["schemas"]["RecommendationV2"][];
|
|
1329
1519
|
} | {
|
|
1330
1520
|
type: "EXIT_TO_PHONE";
|
|
1331
1521
|
fallbackMessage: string;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var V=Object.create;var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},R=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of b(t))!W.call(e,n)&&n!==s&&c(e,n,{get:()=>t[n],enumerable:!(o=N(t,n))||o.enumerable});return e};var q=(e,t,s)=>(s=e!=null?V(D(e)):{},R(t||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),$=e=>R(c({},"__esModule",{value:!0}),e);var H={};j(H,{CONVERSATION_ID:()=>p,Client:()=>O,JWT_TOKEN:()=>m,SDKError:()=>i,SESSION_ID:()=>x,TTL:()=>U,USER_ID:()=>E,authMiddleware:()=>d,deleteConversationId:()=>u,errorMiddleware:()=>l,getConversationId:()=>v,getSessionId:()=>y,getToken:()=>A,getUserId:()=>C,headerMiddleware:()=>h,isTokenExpired:()=>_,setConversationId:()=>I,setSessionId:()=>M,setToken:()=>T,setUserId:()=>g});module.exports=$(H);var P=q(require("openapi-fetch"));var p="__15gifts_conversation_id",u=()=>sessionStorage.removeItem(p),v=()=>sessionStorage.getItem(p),I=e=>sessionStorage.setItem(p,e);var x="__15gifts_session_id",y=()=>sessionStorage.getItem(x),M=e=>sessionStorage.setItem(x,e);var B=e=>{let t=localStorage.getItem(e);if(!t)return null;let s=JSON.parse(t);return Date.now()>s.expires?(localStorage.removeItem(e),null):s.value},w=B;var F=(e,t,s)=>{let o={expires:Date.now()+s,value:t};localStorage.setItem(e,JSON.stringify(o))},S=F;var J=1e3*60*60*24,E="__15gifts_user_id",U=J*30,C=()=>{let e=w(E);return e&&g(e),e},g=e=>S(E,e,U);var m="__15gifts_identity_token",_=e=>{try{let[,t]=e.split(".");if(!t)throw new Error("Invalid token payload");let s=JSON.parse(atob(t));return s.exp&&Date.now()/1e3>s.exp}catch(t){return console.error("Invalid token format",t),!0}},A=()=>{let e=localStorage.getItem(m);return!e||_(e)?(localStorage.removeItem(m),null):e},T=e=>localStorage.setItem(m,e);var K=e=>({onRequest:async({request:t})=>{if(t.url.includes("/identity/"))return t;if(!e)throw new Error("Access token is required for authentication.");return t.headers.set("Authorization",`Bearer ${e}`),t}}),d=K;var X={onResponse:async({response:e})=>{if(!e.ok){let t=await e.json();throw new Error(t.message)}return e}},l=X;var z=(e,t)=>({onRequest:async({request:s})=>(e.pageviewId&&s.headers.set("X-PAGEVIEW-ID",e.pageviewId),t&&s.headers.set("X-PAGE-URL",t),s)}),h=z;var f="0.16.
|
|
1
|
+
"use strict";var V=Object.create;var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},R=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of b(t))!W.call(e,n)&&n!==s&&c(e,n,{get:()=>t[n],enumerable:!(o=N(t,n))||o.enumerable});return e};var q=(e,t,s)=>(s=e!=null?V(D(e)):{},R(t||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),$=e=>R(c({},"__esModule",{value:!0}),e);var H={};j(H,{CONVERSATION_ID:()=>p,Client:()=>O,JWT_TOKEN:()=>m,SDKError:()=>i,SESSION_ID:()=>x,TTL:()=>U,USER_ID:()=>E,authMiddleware:()=>d,deleteConversationId:()=>u,errorMiddleware:()=>l,getConversationId:()=>v,getSessionId:()=>y,getToken:()=>A,getUserId:()=>C,headerMiddleware:()=>h,isTokenExpired:()=>_,setConversationId:()=>I,setSessionId:()=>M,setToken:()=>T,setUserId:()=>g});module.exports=$(H);var P=q(require("openapi-fetch"));var p="__15gifts_conversation_id",u=()=>sessionStorage.removeItem(p),v=()=>sessionStorage.getItem(p),I=e=>sessionStorage.setItem(p,e);var x="__15gifts_session_id",y=()=>sessionStorage.getItem(x),M=e=>sessionStorage.setItem(x,e);var B=e=>{let t=localStorage.getItem(e);if(!t)return null;let s=JSON.parse(t);return Date.now()>s.expires?(localStorage.removeItem(e),null):s.value},w=B;var F=(e,t,s)=>{let o={expires:Date.now()+s,value:t};localStorage.setItem(e,JSON.stringify(o))},S=F;var J=1e3*60*60*24,E="__15gifts_user_id",U=J*30,C=()=>{let e=w(E);return e&&g(e),e},g=e=>S(E,e,U);var m="__15gifts_identity_token",_=e=>{try{let[,t]=e.split(".");if(!t)throw new Error("Invalid token payload");let s=JSON.parse(atob(t));return s.exp&&Date.now()/1e3>s.exp}catch(t){return console.error("Invalid token format",t),!0}},A=()=>{let e=localStorage.getItem(m);return!e||_(e)?(localStorage.removeItem(m),null):e},T=e=>localStorage.setItem(m,e);var K=e=>({onRequest:async({request:t})=>{if(t.url.includes("/identity/"))return t;if(!e)throw new Error("Access token is required for authentication.");return t.headers.set("Authorization",`Bearer ${e}`),t}}),d=K;var X={onResponse:async({response:e})=>{if(!e.ok){let t=await e.json();throw new Error(t.message)}return e}},l=X;var z=(e,t)=>({onRequest:async({request:s})=>(e.pageviewId&&s.headers.set("X-PAGEVIEW-ID",e.pageviewId),t&&s.headers.set("X-PAGE-URL",t),s)}),h=z;var f="0.16.7";var i=class e extends Error{sdkVersion;cause;constructor(t,{cause:s}={}){super(t),this.name="SDKError",this.cause=s,this.sdkVersion=f,Object.setPrototypeOf(this,e.prototype)}};var O=class{endpoint;identity;constructor(t){let{conversationUrl:s,customerId:o,fetch:n,frontendUrl:r,headers:a}=t,k={...a,"X-SDK-VERSION":f};this.endpoint={conversation:(0,P.default)({baseUrl:s,fetch:n,headers:k,credentials:"include"}),frontend:(0,P.default)({baseUrl:r,fetch:n,headers:k})},this.identity={customerId:o,conversationId:v()??void 0,sessionId:y()??void 0,userId:C()??void 0},this.endpoint.conversation.use(l),this.endpoint.conversation.use(h(this.identity,window.location.href))}async createIdentity(){let{customerId:t,sessionId:s,userId:o}=this.identity;try{let{data:n}=await this.endpoint.frontend.POST("/api/tracking/identity/v2",{body:{customerId:t,sessionId:s,userId:o,url:window.location.href,userAgent:window.navigator.userAgent}});if(!n)throw new i("No data received from identity API");this.identity.pageviewId=n.pageviewId,s||(this.identity.sessionId=n.sessionId,M(n.sessionId)),o||(this.identity.userId=n.userId,g(n.userId)),T(n.token),Object.values(this.endpoint).forEach(r=>{r.use(d(n.token))})}catch(n){throw Object.values(this.endpoint).forEach(r=>{r.use(d())}),new i("Failed to create identity",{cause:n})}}endConversation(){u(),this.identity.conversationId=void 0}async startConversation(t){this.endConversation();let s={...t},{data:o}=await this.endpoint.conversation.POST("/api/conversation/v3",{body:{type:"START_CONVERSATION",conversationContext:s}});if(!o)throw new i("No data received from Conversation API");let[n,...r]=o,a=n.conversationId;if(!a)throw new i("Conversation ID not received in API response");return I(a),this.identity.conversationId=a,r}async sendMessage(t){let s=this.identity.conversationId;if(!s)throw new i("Conversation ID not set");let{data:o}=await this.endpoint.conversation.POST("/api/conversation/v3",{body:{conversationId:s,...t}});if(!o)throw new i("No data received from conversation API");return o.filter(n=>n.type!=="CONVERSATION_ID")}async trackEvent(t,s){let o={additionalProperties:s,conversationId:this.identity.conversationId,eventName:t,pageviewId:this.identity.pageviewId??"unknown",screenWidth:window.screen.width,screenHeight:window.screen.height,screenSize:window.screen.width<=480?"mobile":"large",url:window.location.href,userAgent:window.navigator.userAgent};return this.endpoint.frontend.POST("/api/tracking/user/v2",{body:o})}getIdentity(){return this.identity}getIdentityToken(){return A()}};0&&(module.exports={CONVERSATION_ID,Client,JWT_TOKEN,SDKError,SESSION_ID,TTL,USER_ID,authMiddleware,deleteConversationId,errorMiddleware,getConversationId,getSessionId,getToken,getUserId,headerMiddleware,isTokenExpired,setConversationId,setSessionId,setToken,setUserId});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|