@cimulate/copilot-widget 1.38.1 → 1.39.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/CHANGELOG.md +11 -0
- package/dist/cimulate-copilot-widget.d.ts +11 -0
- package/dist/cimulate-copilot-widget.es.js +3228 -3197
- package/dist/cimulate-copilot-widget.umd.js +27 -27
- package/dist/copilot.es.js +3243 -3212
- package/dist/copilot.umd.js +26 -26
- package/dist/messaging.d.ts +13 -2
- package/dist/messaging.es.js +11708 -11599
- package/dist/messaging.umd.js +39 -39
- package/package.json +1 -1
package/dist/messaging.d.ts
CHANGED
|
@@ -358,6 +358,7 @@ export declare const eventHandlers: {
|
|
|
358
358
|
};
|
|
359
359
|
session: {
|
|
360
360
|
resetConversation: () => void;
|
|
361
|
+
endConversation: () => void;
|
|
361
362
|
};
|
|
362
363
|
};
|
|
363
364
|
|
|
@@ -460,6 +461,7 @@ export declare interface MessagingContextType {
|
|
|
460
461
|
sendMessage: SendMessage;
|
|
461
462
|
addToCart: (params: AddToCartParams) => void;
|
|
462
463
|
resetConversation: () => Promise<void>;
|
|
464
|
+
endConversation: () => Promise<void>;
|
|
463
465
|
retryLastMessage: () => ReturnType<SendMessage> | undefined;
|
|
464
466
|
retryConnection: () => void;
|
|
465
467
|
downloadTranscript: () => Promise<void>;
|
|
@@ -526,6 +528,14 @@ export declare interface MessagingModeConfig {
|
|
|
526
528
|
* block (product search or product-details lookup).
|
|
527
529
|
*/
|
|
528
530
|
onProductResult?: (detail: ProductResultDetail) => void;
|
|
531
|
+
/**
|
|
532
|
+
* Invoked when the user clicks "End conversation". Fires before the
|
|
533
|
+
* conversation ends, allowing the storefront to show a satisfaction survey or
|
|
534
|
+
* perform cleanup. Can return a Promise to delay the disconnect (waits up to
|
|
535
|
+
* 30 seconds). The conversation ends gracefully even if the callback throws
|
|
536
|
+
* or times out.
|
|
537
|
+
*/
|
|
538
|
+
onEndConversation?: (conversationId: string | null) => Promise<void> | void;
|
|
529
539
|
/**
|
|
530
540
|
* Capabilities version for the SCRT2 token request. Required (>= "63", i.e.
|
|
531
541
|
* release 254) for action progress indicators (`CONVERSATION_PROGRESS_INDICATOR`)
|
|
@@ -550,7 +560,7 @@ export declare interface MessagingModeConfig {
|
|
|
550
560
|
progressStepsLimit?: number;
|
|
551
561
|
}
|
|
552
562
|
|
|
553
|
-
export declare const MessagingProvider: ({ scrt2Url, orgId, esDeveloperName, routingAttributes, capabilitiesVersion, enableLogging, onConnect, onMessage, onError, onProductResult, children, }: MessagingProviderProps) => JSX_2.Element;
|
|
563
|
+
export declare const MessagingProvider: ({ scrt2Url, orgId, esDeveloperName, routingAttributes, capabilitiesVersion, enableLogging, onConnect, onMessage, onError, onProductResult, onEndConversation, children, }: MessagingProviderProps) => JSX_2.Element;
|
|
554
564
|
|
|
555
565
|
declare interface MessagingProviderProps {
|
|
556
566
|
scrt2Url: string;
|
|
@@ -564,6 +574,7 @@ declare interface MessagingProviderProps {
|
|
|
564
574
|
onMessage?: (message: MessagingMessage) => void;
|
|
565
575
|
onError?: (error: string) => void;
|
|
566
576
|
onProductResult?: (detail: ProductResultDetail) => void;
|
|
577
|
+
onEndConversation?: (conversationId: string | null) => Promise<void> | void;
|
|
567
578
|
children: ReactNode;
|
|
568
579
|
}
|
|
569
580
|
|
|
@@ -865,7 +876,7 @@ declare interface ProductTileImage {
|
|
|
865
876
|
}
|
|
866
877
|
|
|
867
878
|
declare interface ProductTileImageGroup {
|
|
868
|
-
viewType: string;
|
|
879
|
+
viewType: string | null;
|
|
869
880
|
vattr: ProductTileImageGroupVariantAttr[] | null;
|
|
870
881
|
imgs: ProductTileImage[];
|
|
871
882
|
}
|