1 | import {Request} from '../lib/request';
|
2 | import {Response} from '../lib/response';
|
3 | import {AWSError} from '../lib/error';
|
4 | import {Service} from '../lib/service';
|
5 | import {ServiceConfigurationOptions} from '../lib/service';
|
6 | import {ConfigBase as Config} from '../lib/config';
|
7 | interface Blob {}
|
8 | declare class ConnectParticipant extends Service {
|
9 | |
10 |
|
11 |
|
12 | constructor(options?: ConnectParticipant.Types.ClientConfiguration)
|
13 | config: Config & ConnectParticipant.Types.ClientConfiguration;
|
14 | /**
|
15 | * Creates the participant's connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken. The participant token is valid for the lifetime of the participant – until the they are part of a contact. The response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic. For chat, you need to publish the following on the established websocket connection: {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}} Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.
|
16 | */
|
17 | createParticipantConnection(params: ConnectParticipant.Types.CreateParticipantConnectionRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.CreateParticipantConnectionResponse) => void): Request<ConnectParticipant.Types.CreateParticipantConnectionResponse, AWSError>;
|
18 | |
19 |
|
20 |
|
21 | createParticipantConnection(callback?: (err: AWSError, data: ConnectParticipant.Types.CreateParticipantConnectionResponse) => void): Request<ConnectParticipant.Types.CreateParticipantConnectionResponse, AWSError>;
|
22 | |
23 |
|
24 |
|
25 | disconnectParticipant(params: ConnectParticipant.Types.DisconnectParticipantRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.DisconnectParticipantResponse) => void): Request<ConnectParticipant.Types.DisconnectParticipantResponse, AWSError>;
|
26 | |
27 |
|
28 |
|
29 | disconnectParticipant(callback?: (err: AWSError, data: ConnectParticipant.Types.DisconnectParticipantResponse) => void): Request<ConnectParticipant.Types.DisconnectParticipantResponse, AWSError>;
|
30 | |
31 |
|
32 |
|
33 | getTranscript(params: ConnectParticipant.Types.GetTranscriptRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.GetTranscriptResponse) => void): Request<ConnectParticipant.Types.GetTranscriptResponse, AWSError>;
|
34 | |
35 |
|
36 |
|
37 | getTranscript(callback?: (err: AWSError, data: ConnectParticipant.Types.GetTranscriptResponse) => void): Request<ConnectParticipant.Types.GetTranscriptResponse, AWSError>;
|
38 | |
39 |
|
40 |
|
41 | sendEvent(params: ConnectParticipant.Types.SendEventRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.SendEventResponse) => void): Request<ConnectParticipant.Types.SendEventResponse, AWSError>;
|
42 | |
43 |
|
44 |
|
45 | sendEvent(callback?: (err: AWSError, data: ConnectParticipant.Types.SendEventResponse) => void): Request<ConnectParticipant.Types.SendEventResponse, AWSError>;
|
46 | |
47 |
|
48 |
|
49 | sendMessage(params: ConnectParticipant.Types.SendMessageRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.SendMessageResponse) => void): Request<ConnectParticipant.Types.SendMessageResponse, AWSError>;
|
50 | |
51 |
|
52 |
|
53 | sendMessage(callback?: (err: AWSError, data: ConnectParticipant.Types.SendMessageResponse) => void): Request<ConnectParticipant.Types.SendMessageResponse, AWSError>;
|
54 | }
|
55 | declare namespace ConnectParticipant {
|
56 | export type ChatContent = string;
|
57 | export type ChatContentType = string;
|
58 | export type ChatItemId = string;
|
59 | export type ChatItemType = "MESSAGE"|"EVENT"|"CONNECTION_ACK"|string;
|
60 | export type ClientToken = string;
|
61 | export interface ConnectionCredentials {
|
62 | |
63 |
|
64 |
|
65 | ConnectionToken?: ParticipantToken;
|
66 | |
67 |
|
68 |
|
69 | Expiry?: ISO8601Datetime;
|
70 | }
|
71 | export type ConnectionType = "WEBSOCKET"|"CONNECTION_CREDENTIALS"|string;
|
72 | export type ConnectionTypeList = ConnectionType[];
|
73 | export type ContactId = string;
|
74 | export interface CreateParticipantConnectionRequest {
|
75 | |
76 |
|
77 |
|
78 | Type: ConnectionTypeList;
|
79 | |
80 |
|
81 |
|
82 | ParticipantToken: ParticipantToken;
|
83 | }
|
84 | export interface CreateParticipantConnectionResponse {
|
85 | |
86 |
|
87 |
|
88 | Websocket?: Websocket;
|
89 | |
90 |
|
91 |
|
92 | ConnectionCredentials?: ConnectionCredentials;
|
93 | }
|
94 | export interface DisconnectParticipantRequest {
|
95 | |
96 |
|
97 |
|
98 | ClientToken?: ClientToken;
|
99 | |
100 |
|
101 |
|
102 | ConnectionToken: ParticipantToken;
|
103 | }
|
104 | export interface DisconnectParticipantResponse {
|
105 | }
|
106 | export type DisplayName = string;
|
107 | export interface GetTranscriptRequest {
|
108 | |
109 |
|
110 |
|
111 | ContactId?: ContactId;
|
112 | |
113 |
|
114 |
|
115 | MaxResults?: MaxResults;
|
116 | |
117 |
|
118 |
|
119 | NextToken?: NextToken;
|
120 | |
121 |
|
122 |
|
123 | ScanDirection?: ScanDirection;
|
124 | |
125 |
|
126 |
|
127 | SortOrder?: SortKey;
|
128 | |
129 |
|
130 |
|
131 | StartPosition?: StartPosition;
|
132 | |
133 |
|
134 |
|
135 | ConnectionToken: ParticipantToken;
|
136 | }
|
137 | export interface GetTranscriptResponse {
|
138 | |
139 |
|
140 |
|
141 | InitialContactId?: ContactId;
|
142 | |
143 |
|
144 |
|
145 | Transcript?: Transcript;
|
146 | |
147 |
|
148 |
|
149 | NextToken?: NextToken;
|
150 | }
|
151 | export type ISO8601Datetime = string;
|
152 | export type Instant = string;
|
153 | export interface Item {
|
154 | |
155 |
|
156 |
|
157 | AbsoluteTime?: Instant;
|
158 | |
159 |
|
160 |
|
161 | Content?: ChatContent;
|
162 | |
163 |
|
164 |
|
165 | ContentType?: ChatContentType;
|
166 | |
167 |
|
168 |
|
169 | Id?: ChatItemId;
|
170 | |
171 |
|
172 |
|
173 | Type?: ChatItemType;
|
174 | |
175 |
|
176 |
|
177 | ParticipantId?: ParticipantId;
|
178 | |
179 |
|
180 |
|
181 | DisplayName?: DisplayName;
|
182 | |
183 |
|
184 |
|
185 | ParticipantRole?: ParticipantRole;
|
186 | }
|
187 | export type MaxResults = number;
|
188 | export type MostRecent = number;
|
189 | export type NextToken = string;
|
190 | export type ParticipantId = string;
|
191 | export type ParticipantRole = "AGENT"|"CUSTOMER"|"SYSTEM"|string;
|
192 | export type ParticipantToken = string;
|
193 | export type PreSignedConnectionUrl = string;
|
194 | export type ScanDirection = "FORWARD"|"BACKWARD"|string;
|
195 | export interface SendEventRequest {
|
196 | |
197 |
|
198 |
|
199 | ContentType: ChatContentType;
|
200 | |
201 |
|
202 |
|
203 | Content?: ChatContent;
|
204 | |
205 |
|
206 |
|
207 | ClientToken?: ClientToken;
|
208 | |
209 |
|
210 |
|
211 | ConnectionToken: ParticipantToken;
|
212 | }
|
213 | export interface SendEventResponse {
|
214 | |
215 |
|
216 |
|
217 | Id?: ChatItemId;
|
218 | |
219 |
|
220 |
|
221 | AbsoluteTime?: Instant;
|
222 | }
|
223 | export interface SendMessageRequest {
|
224 | |
225 |
|
226 |
|
227 | ContentType: ChatContentType;
|
228 | |
229 |
|
230 |
|
231 | Content: ChatContent;
|
232 | |
233 |
|
234 |
|
235 | ClientToken?: ClientToken;
|
236 | |
237 |
|
238 |
|
239 | ConnectionToken: ParticipantToken;
|
240 | }
|
241 | export interface SendMessageResponse {
|
242 | |
243 |
|
244 |
|
245 | Id?: ChatItemId;
|
246 | |
247 |
|
248 |
|
249 | AbsoluteTime?: Instant;
|
250 | }
|
251 | export type SortKey = "DESCENDING"|"ASCENDING"|string;
|
252 | export interface StartPosition {
|
253 | |
254 |
|
255 |
|
256 | Id?: ChatItemId;
|
257 | |
258 |
|
259 |
|
260 | AbsoluteTime?: Instant;
|
261 | |
262 |
|
263 |
|
264 | MostRecent?: MostRecent;
|
265 | }
|
266 | export type Transcript = Item[];
|
267 | export interface Websocket {
|
268 | |
269 |
|
270 |
|
271 | Url?: PreSignedConnectionUrl;
|
272 | |
273 |
|
274 |
|
275 | ConnectionExpiry?: ISO8601Datetime;
|
276 | }
|
277 | |
278 |
|
279 |
|
280 | export type apiVersion = "2018-09-07"|"latest"|string;
|
281 | export interface ClientApiVersions {
|
282 | |
283 |
|
284 |
|
285 | apiVersion?: apiVersion;
|
286 | }
|
287 | export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
|
288 | |
289 |
|
290 |
|
291 | export import Types = ConnectParticipant;
|
292 | }
|
293 | export = ConnectParticipant;
|