@onedeskpro/chatbot-types 0.3.1 → 0.5.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.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -74,11 +74,20 @@ type UploadAttachmentResponseData = ChatAttachment;
|
|
|
74
74
|
/** Widget / bridge episode mode for AI vs human takeover. */
|
|
75
75
|
type ChatbotTicketMode = 'ai' | 'waiting' | 'human' | 'closed';
|
|
76
76
|
interface ChatResponseData {
|
|
77
|
+
/** Every text the AI sent for this message, in order, separated by a blank line. */
|
|
77
78
|
text: string;
|
|
78
79
|
sessionId: string;
|
|
79
80
|
mode: ChatbotTicketMode;
|
|
81
|
+
/**
|
|
82
|
+
* Files the AI sent with `text`, e.g. the photo of a Product an agent with the Sales
|
|
83
|
+
* ability recommends. Absent when there are none. The API does not send `size`.
|
|
84
|
+
*/
|
|
85
|
+
attachments?: Pick<ChatAttachment, 'type' | 'url' | 'fileName'>[];
|
|
80
86
|
}
|
|
81
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Shared shape for `POST /sdk/human-request`, `POST /sdk/human-request/cancel`,
|
|
89
|
+
* `POST /sdk/conversation/close`, `GET /sdk/ticket-status`, and `ticket:status`.
|
|
90
|
+
*/
|
|
82
91
|
interface TicketStatusData {
|
|
83
92
|
mode: ChatbotTicketMode;
|
|
84
93
|
conversationId?: string;
|
|
@@ -125,10 +134,13 @@ type ChatbotEventMap = {
|
|
|
125
134
|
open: void;
|
|
126
135
|
close: void;
|
|
127
136
|
error: Error;
|
|
137
|
+
/** Fired when the chat is cleared for a new conversation (`resetSession` or `startNewConversation`). */
|
|
128
138
|
'session-reset': void;
|
|
129
139
|
ready: void;
|
|
130
140
|
/** Fired after a successful `POST /sdk/human-request`. */
|
|
131
141
|
'human-requested': void;
|
|
142
|
+
/** Fired when `cancelHumanRequest` handed the conversation back to the AI. */
|
|
143
|
+
'human-request-cancelled': void;
|
|
132
144
|
/** Fired when ticket mode changes via REST restore or `/sdk` socket push. */
|
|
133
145
|
'ticket-status': TicketStatusData;
|
|
134
146
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -74,11 +74,20 @@ type UploadAttachmentResponseData = ChatAttachment;
|
|
|
74
74
|
/** Widget / bridge episode mode for AI vs human takeover. */
|
|
75
75
|
type ChatbotTicketMode = 'ai' | 'waiting' | 'human' | 'closed';
|
|
76
76
|
interface ChatResponseData {
|
|
77
|
+
/** Every text the AI sent for this message, in order, separated by a blank line. */
|
|
77
78
|
text: string;
|
|
78
79
|
sessionId: string;
|
|
79
80
|
mode: ChatbotTicketMode;
|
|
81
|
+
/**
|
|
82
|
+
* Files the AI sent with `text`, e.g. the photo of a Product an agent with the Sales
|
|
83
|
+
* ability recommends. Absent when there are none. The API does not send `size`.
|
|
84
|
+
*/
|
|
85
|
+
attachments?: Pick<ChatAttachment, 'type' | 'url' | 'fileName'>[];
|
|
80
86
|
}
|
|
81
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Shared shape for `POST /sdk/human-request`, `POST /sdk/human-request/cancel`,
|
|
89
|
+
* `POST /sdk/conversation/close`, `GET /sdk/ticket-status`, and `ticket:status`.
|
|
90
|
+
*/
|
|
82
91
|
interface TicketStatusData {
|
|
83
92
|
mode: ChatbotTicketMode;
|
|
84
93
|
conversationId?: string;
|
|
@@ -125,10 +134,13 @@ type ChatbotEventMap = {
|
|
|
125
134
|
open: void;
|
|
126
135
|
close: void;
|
|
127
136
|
error: Error;
|
|
137
|
+
/** Fired when the chat is cleared for a new conversation (`resetSession` or `startNewConversation`). */
|
|
128
138
|
'session-reset': void;
|
|
129
139
|
ready: void;
|
|
130
140
|
/** Fired after a successful `POST /sdk/human-request`. */
|
|
131
141
|
'human-requested': void;
|
|
142
|
+
/** Fired when `cancelHumanRequest` handed the conversation back to the AI. */
|
|
143
|
+
'human-request-cancelled': void;
|
|
132
144
|
/** Fired when ticket mode changes via REST restore or `/sdk` socket push. */
|
|
133
145
|
'ticket-status': TicketStatusData;
|
|
134
146
|
};
|