connectparticipant.d.ts
12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import {Request} from '../lib/request';
import {Response} from '../lib/response';
import {AWSError} from '../lib/error';
import {Service} from '../lib/service';
import {ServiceConfigurationOptions} from '../lib/service';
import {ConfigBase as Config} from '../lib/config-base';
interface Blob {}
declare class ConnectParticipant extends Service {
/**
* Constructs a service object. This object has one method for each API operation.
*/
constructor(options?: ConnectParticipant.Types.ClientConfiguration)
config: Config & ConnectParticipant.Types.ClientConfiguration;
/**
* 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.
*/
createParticipantConnection(params: ConnectParticipant.Types.CreateParticipantConnectionRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.CreateParticipantConnectionResponse) => void): Request<ConnectParticipant.Types.CreateParticipantConnectionResponse, AWSError>;
/**
* 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.
*/
createParticipantConnection(callback?: (err: AWSError, data: ConnectParticipant.Types.CreateParticipantConnectionResponse) => void): Request<ConnectParticipant.Types.CreateParticipantConnectionResponse, AWSError>;
/**
* Disconnects a participant. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
disconnectParticipant(params: ConnectParticipant.Types.DisconnectParticipantRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.DisconnectParticipantResponse) => void): Request<ConnectParticipant.Types.DisconnectParticipantResponse, AWSError>;
/**
* Disconnects a participant. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
disconnectParticipant(callback?: (err: AWSError, data: ConnectParticipant.Types.DisconnectParticipantResponse) => void): Request<ConnectParticipant.Types.DisconnectParticipantResponse, AWSError>;
/**
* Retrieves a transcript of the session. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
getTranscript(params: ConnectParticipant.Types.GetTranscriptRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.GetTranscriptResponse) => void): Request<ConnectParticipant.Types.GetTranscriptResponse, AWSError>;
/**
* Retrieves a transcript of the session. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
getTranscript(callback?: (err: AWSError, data: ConnectParticipant.Types.GetTranscriptResponse) => void): Request<ConnectParticipant.Types.GetTranscriptResponse, AWSError>;
/**
* Sends an event. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
sendEvent(params: ConnectParticipant.Types.SendEventRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.SendEventResponse) => void): Request<ConnectParticipant.Types.SendEventResponse, AWSError>;
/**
* Sends an event. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
sendEvent(callback?: (err: AWSError, data: ConnectParticipant.Types.SendEventResponse) => void): Request<ConnectParticipant.Types.SendEventResponse, AWSError>;
/**
* Sends a message. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
sendMessage(params: ConnectParticipant.Types.SendMessageRequest, callback?: (err: AWSError, data: ConnectParticipant.Types.SendMessageResponse) => void): Request<ConnectParticipant.Types.SendMessageResponse, AWSError>;
/**
* Sends a message. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
*/
sendMessage(callback?: (err: AWSError, data: ConnectParticipant.Types.SendMessageResponse) => void): Request<ConnectParticipant.Types.SendMessageResponse, AWSError>;
}
declare namespace ConnectParticipant {
export type ChatContent = string;
export type ChatContentType = string;
export type ChatItemId = string;
export type ChatItemType = "MESSAGE"|"EVENT"|"CONNECTION_ACK"|string;
export type ClientToken = string;
export interface ConnectionCredentials {
/**
* The connection token.
*/
ConnectionToken?: ParticipantToken;
/**
* The expiration of the token. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
Expiry?: ISO8601Datetime;
}
export type ConnectionType = "WEBSOCKET"|"CONNECTION_CREDENTIALS"|string;
export type ConnectionTypeList = ConnectionType[];
export type ContactId = string;
export interface CreateParticipantConnectionRequest {
/**
* Type of connection information required.
*/
Type: ConnectionTypeList;
/**
* Participant Token as obtained from StartChatContact API response.
*/
ParticipantToken: ParticipantToken;
}
export interface CreateParticipantConnectionResponse {
/**
* Creates the participant's websocket connection.
*/
Websocket?: Websocket;
/**
* Creates the participant's connection credentials. The authentication token associated with the participant's connection.
*/
ConnectionCredentials?: ConnectionCredentials;
}
export interface DisconnectParticipantRequest {
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
ClientToken?: ClientToken;
/**
* The authentication token associated with the participant's connection.
*/
ConnectionToken: ParticipantToken;
}
export interface DisconnectParticipantResponse {
}
export type DisplayName = string;
export interface GetTranscriptRequest {
/**
* The contactId from the current contact chain for which transcript is needed.
*/
ContactId?: ContactId;
/**
* The maximum number of results to return in the page. Default: 10.
*/
MaxResults?: MaxResults;
/**
* The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.
*/
NextToken?: NextToken;
/**
* The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition.
*/
ScanDirection?: ScanDirection;
/**
* The sort order for the records. Default: DESCENDING.
*/
SortOrder?: SortKey;
/**
* A filtering option for where to start.
*/
StartPosition?: StartPosition;
/**
* The authentication token associated with the participant's connection.
*/
ConnectionToken: ParticipantToken;
}
export interface GetTranscriptResponse {
/**
* The initial contact ID for the contact.
*/
InitialContactId?: ContactId;
/**
* The list of messages in the session.
*/
Transcript?: Transcript;
/**
* The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.
*/
NextToken?: NextToken;
}
export type ISO8601Datetime = string;
export type Instant = string;
export interface Item {
/**
* The time when the message or event was sent. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
AbsoluteTime?: Instant;
/**
* The content of the message or event.
*/
Content?: ChatContent;
/**
* The type of content of the item.
*/
ContentType?: ChatContentType;
/**
* The ID of the item.
*/
Id?: ChatItemId;
/**
* Type of the item: message or event.
*/
Type?: ChatItemType;
/**
* The ID of the sender in the session.
*/
ParticipantId?: ParticipantId;
/**
* The chat display name of the sender.
*/
DisplayName?: DisplayName;
/**
* The role of the sender. For example, is it a customer, agent, or system.
*/
ParticipantRole?: ParticipantRole;
}
export type MaxResults = number;
export type MostRecent = number;
export type NextToken = string;
export type ParticipantId = string;
export type ParticipantRole = "AGENT"|"CUSTOMER"|"SYSTEM"|string;
export type ParticipantToken = string;
export type PreSignedConnectionUrl = string;
export type ScanDirection = "FORWARD"|"BACKWARD"|string;
export interface SendEventRequest {
/**
* The content type of the request. Supported types are: application/vnd.amazonaws.connect.event.typing application/vnd.amazonaws.connect.event.connection.acknowledged
*/
ContentType: ChatContentType;
/**
* The content of the event to be sent (for example, message text). This is not yet supported.
*/
Content?: ChatContent;
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
ClientToken?: ClientToken;
/**
* The authentication token associated with the participant's connection.
*/
ConnectionToken: ParticipantToken;
}
export interface SendEventResponse {
/**
* The ID of the response.
*/
Id?: ChatItemId;
/**
* The time when the event was sent. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
AbsoluteTime?: Instant;
}
export interface SendMessageRequest {
/**
* The type of the content. Supported types are text/plain.
*/
ContentType: ChatContentType;
/**
* The content of the message.
*/
Content: ChatContent;
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
ClientToken?: ClientToken;
/**
* The authentication token associated with the connection.
*/
ConnectionToken: ParticipantToken;
}
export interface SendMessageResponse {
/**
* The ID of the message.
*/
Id?: ChatItemId;
/**
* The time when the message was sent. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
AbsoluteTime?: Instant;
}
export type SortKey = "DESCENDING"|"ASCENDING"|string;
export interface StartPosition {
/**
* The ID of the message or event where to start.
*/
Id?: ChatItemId;
/**
* The time in ISO format where to start. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
AbsoluteTime?: Instant;
/**
* The start position of the most recent message where you want to start.
*/
MostRecent?: MostRecent;
}
export type Transcript = Item[];
export interface Websocket {
/**
* The URL of the websocket.
*/
Url?: PreSignedConnectionUrl;
/**
* The URL expiration timestamp in ISO date format. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
*/
ConnectionExpiry?: ISO8601Datetime;
}
/**
* A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
*/
export type apiVersion = "2018-09-07"|"latest"|string;
export interface ClientApiVersions {
/**
* A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
*/
apiVersion?: apiVersion;
}
export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
/**
* Contains interfaces for use with the ConnectParticipant client.
*/
export import Types = ConnectParticipant;
}
export = ConnectParticipant;