@wildix/xbees-conversations-client 1.0.28 → 1.0.29
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-cjs/Conversations.js +10 -0
- package/dist-cjs/commands/DeleteMessageCommand.js +41 -0
- package/dist-cjs/commands/ListChannelsCommand.js +41 -0
- package/dist-cjs/commands/ListMessagesCommand.js +41 -0
- package/dist-cjs/commands/PartialUpdateMessageCommand.js +41 -0
- package/dist-cjs/commands/UpdateMessageCommand.js +41 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/models/models_0.js +32 -11
- package/dist-cjs/protocols/Aws_restJson1.js +353 -3
- package/dist-es/Conversations.js +10 -0
- package/dist-es/commands/DeleteMessageCommand.js +37 -0
- package/dist-es/commands/ListChannelsCommand.js +37 -0
- package/dist-es/commands/ListMessagesCommand.js +37 -0
- package/dist-es/commands/PartialUpdateMessageCommand.js +37 -0
- package/dist-es/commands/UpdateMessageCommand.js +37 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/models/models_0.js +28 -8
- package/dist-es/protocols/Aws_restJson1.js +343 -3
- package/dist-types/Conversations.d.ts +35 -0
- package/dist-types/ConversationsClient.d.ts +7 -2
- package/dist-types/commands/CreateChannelCommand.d.ts +1 -0
- package/dist-types/commands/CreateMessageCommand.d.ts +1 -1
- package/dist-types/commands/DeleteMessageCommand.d.ts +76 -0
- package/dist-types/commands/GetMessageCommand.d.ts +1 -0
- package/dist-types/commands/JoinChannelCommand.d.ts +1 -0
- package/dist-types/commands/ListChannelsCommand.d.ts +139 -0
- package/dist-types/commands/ListMessagesCommand.d.ts +211 -0
- package/dist-types/commands/PartialUpdateChannelCommand.d.ts +1 -0
- package/dist-types/commands/PartialUpdateMessageCommand.d.ts +365 -0
- package/dist-types/commands/UpdateChannelCommand.d.ts +1 -0
- package/dist-types/commands/UpdateMessageCommand.d.ts +362 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/models/models_0.d.ts +124 -7
- package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UpdateChannelCommand = exports.de_ScheduleExternalFlagAdjustmentJobCommand = exports.de_PartialUpdateChannelCommand = exports.de_JoinChannelCommand = exports.de_GetMessageCommand = exports.de_GetChannelMemberCommand = exports.de_GetChannelCommand = exports.de_DeleteChannelCommand = exports.de_CreateMessageCommand = exports.de_CreateChannelCommand = exports.se_UpdateChannelCommand = exports.se_ScheduleExternalFlagAdjustmentJobCommand = exports.se_PartialUpdateChannelCommand = exports.se_JoinChannelCommand = exports.se_GetMessageCommand = exports.se_GetChannelMemberCommand = exports.se_GetChannelCommand = exports.se_DeleteChannelCommand = exports.se_CreateMessageCommand = exports.se_CreateChannelCommand = void 0;
|
|
3
|
+
exports.de_UpdateMessageCommand = exports.de_UpdateChannelCommand = exports.de_ScheduleExternalFlagAdjustmentJobCommand = exports.de_PartialUpdateMessageCommand = exports.de_PartialUpdateChannelCommand = exports.de_ListMessagesCommand = exports.de_ListChannelsCommand = exports.de_JoinChannelCommand = exports.de_GetMessageCommand = exports.de_GetChannelMemberCommand = exports.de_GetChannelCommand = exports.de_DeleteMessageCommand = exports.de_DeleteChannelCommand = exports.de_CreateMessageCommand = exports.de_CreateChannelCommand = exports.se_UpdateMessageCommand = exports.se_UpdateChannelCommand = exports.se_ScheduleExternalFlagAdjustmentJobCommand = exports.se_PartialUpdateMessageCommand = exports.se_PartialUpdateChannelCommand = exports.se_ListMessagesCommand = exports.se_ListChannelsCommand = exports.se_JoinChannelCommand = exports.se_GetMessageCommand = exports.se_GetChannelMemberCommand = exports.se_GetChannelCommand = exports.se_DeleteMessageCommand = exports.se_DeleteChannelCommand = exports.se_CreateMessageCommand = exports.se_CreateChannelCommand = void 0;
|
|
4
4
|
const ConversationsServiceException_1 = require("../models/ConversationsServiceException");
|
|
5
5
|
const models_0_1 = require("../models/models_0");
|
|
6
6
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
@@ -11,6 +11,9 @@ const se_CreateChannelCommand = async (input, context) => {
|
|
|
11
11
|
'content-type': 'application/json',
|
|
12
12
|
};
|
|
13
13
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
|
|
14
|
+
const query = (0, smithy_client_1.map)({
|
|
15
|
+
"user": [, input.userId],
|
|
16
|
+
});
|
|
14
17
|
let body;
|
|
15
18
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
16
19
|
'channel': _ => (0, smithy_client_1._json)(_),
|
|
@@ -22,6 +25,7 @@ const se_CreateChannelCommand = async (input, context) => {
|
|
|
22
25
|
method: "POST",
|
|
23
26
|
headers,
|
|
24
27
|
path: resolvedPath,
|
|
28
|
+
query,
|
|
25
29
|
body,
|
|
26
30
|
});
|
|
27
31
|
};
|
|
@@ -34,7 +38,7 @@ const se_CreateMessageCommand = async (input, context) => {
|
|
|
34
38
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
|
|
35
39
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
36
40
|
const query = (0, smithy_client_1.map)({
|
|
37
|
-
"
|
|
41
|
+
"user": [, input.userId],
|
|
38
42
|
});
|
|
39
43
|
let body;
|
|
40
44
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
@@ -69,6 +73,24 @@ const se_DeleteChannelCommand = async (input, context) => {
|
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
exports.se_DeleteChannelCommand = se_DeleteChannelCommand;
|
|
76
|
+
const se_DeleteMessageCommand = async (input, context) => {
|
|
77
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
78
|
+
const headers = {};
|
|
79
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
|
|
80
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
81
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
82
|
+
let body;
|
|
83
|
+
return new protocol_http_1.HttpRequest({
|
|
84
|
+
protocol,
|
|
85
|
+
hostname,
|
|
86
|
+
port,
|
|
87
|
+
method: "DELETE",
|
|
88
|
+
headers,
|
|
89
|
+
path: resolvedPath,
|
|
90
|
+
body,
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
exports.se_DeleteMessageCommand = se_DeleteMessageCommand;
|
|
72
94
|
const se_GetChannelCommand = async (input, context) => {
|
|
73
95
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
74
96
|
const headers = {};
|
|
@@ -107,8 +129,9 @@ exports.se_GetChannelMemberCommand = se_GetChannelMemberCommand;
|
|
|
107
129
|
const se_GetMessageCommand = async (input, context) => {
|
|
108
130
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
109
131
|
const headers = {};
|
|
110
|
-
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
|
|
132
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
|
|
111
133
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
134
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
112
135
|
let body;
|
|
113
136
|
return new protocol_http_1.HttpRequest({
|
|
114
137
|
protocol,
|
|
@@ -126,6 +149,9 @@ const se_JoinChannelCommand = async (input, context) => {
|
|
|
126
149
|
const headers = {};
|
|
127
150
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/join";
|
|
128
151
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
152
|
+
const query = (0, smithy_client_1.map)({
|
|
153
|
+
"user": [, input.userId],
|
|
154
|
+
});
|
|
129
155
|
let body;
|
|
130
156
|
return new protocol_http_1.HttpRequest({
|
|
131
157
|
protocol,
|
|
@@ -134,10 +160,50 @@ const se_JoinChannelCommand = async (input, context) => {
|
|
|
134
160
|
method: "POST",
|
|
135
161
|
headers,
|
|
136
162
|
path: resolvedPath,
|
|
163
|
+
query,
|
|
137
164
|
body,
|
|
138
165
|
});
|
|
139
166
|
};
|
|
140
167
|
exports.se_JoinChannelCommand = se_JoinChannelCommand;
|
|
168
|
+
const se_ListChannelsCommand = async (input, context) => {
|
|
169
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
170
|
+
const headers = {};
|
|
171
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
|
|
172
|
+
const query = (0, smithy_client_1.map)({
|
|
173
|
+
"user": [, input.userId],
|
|
174
|
+
"limit": [() => input.limit !== void 0, () => (input.limit.toString())],
|
|
175
|
+
"offset": [() => input.offset !== void 0, () => (input.offset.toString())],
|
|
176
|
+
});
|
|
177
|
+
let body;
|
|
178
|
+
return new protocol_http_1.HttpRequest({
|
|
179
|
+
protocol,
|
|
180
|
+
hostname,
|
|
181
|
+
port,
|
|
182
|
+
method: "GET",
|
|
183
|
+
headers,
|
|
184
|
+
path: resolvedPath,
|
|
185
|
+
query,
|
|
186
|
+
body,
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
exports.se_ListChannelsCommand = se_ListChannelsCommand;
|
|
190
|
+
const se_ListMessagesCommand = async (input, context) => {
|
|
191
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
192
|
+
const headers = {};
|
|
193
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
|
|
194
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
195
|
+
let body;
|
|
196
|
+
return new protocol_http_1.HttpRequest({
|
|
197
|
+
protocol,
|
|
198
|
+
hostname,
|
|
199
|
+
port,
|
|
200
|
+
method: "GET",
|
|
201
|
+
headers,
|
|
202
|
+
path: resolvedPath,
|
|
203
|
+
body,
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
exports.se_ListMessagesCommand = se_ListMessagesCommand;
|
|
141
207
|
const se_PartialUpdateChannelCommand = async (input, context) => {
|
|
142
208
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
143
209
|
const headers = {
|
|
@@ -145,6 +211,9 @@ const se_PartialUpdateChannelCommand = async (input, context) => {
|
|
|
145
211
|
};
|
|
146
212
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
|
|
147
213
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
214
|
+
const query = (0, smithy_client_1.map)({
|
|
215
|
+
"user": [, input.userId],
|
|
216
|
+
});
|
|
148
217
|
let body;
|
|
149
218
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
150
219
|
'set': _ => (0, smithy_client_1._json)(_),
|
|
@@ -157,10 +226,39 @@ const se_PartialUpdateChannelCommand = async (input, context) => {
|
|
|
157
226
|
method: "PATCH",
|
|
158
227
|
headers,
|
|
159
228
|
path: resolvedPath,
|
|
229
|
+
query,
|
|
160
230
|
body,
|
|
161
231
|
});
|
|
162
232
|
};
|
|
163
233
|
exports.se_PartialUpdateChannelCommand = se_PartialUpdateChannelCommand;
|
|
234
|
+
const se_PartialUpdateMessageCommand = async (input, context) => {
|
|
235
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
236
|
+
const headers = {
|
|
237
|
+
'content-type': 'application/json',
|
|
238
|
+
};
|
|
239
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
|
|
240
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
241
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
242
|
+
const query = (0, smithy_client_1.map)({
|
|
243
|
+
"user": [, input.userId],
|
|
244
|
+
});
|
|
245
|
+
let body;
|
|
246
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
247
|
+
'set': _ => se_MessageUpdateFields(_, context),
|
|
248
|
+
'unset': _ => (0, smithy_client_1._json)(_),
|
|
249
|
+
}));
|
|
250
|
+
return new protocol_http_1.HttpRequest({
|
|
251
|
+
protocol,
|
|
252
|
+
hostname,
|
|
253
|
+
port,
|
|
254
|
+
method: "PATCH",
|
|
255
|
+
headers,
|
|
256
|
+
path: resolvedPath,
|
|
257
|
+
query,
|
|
258
|
+
body,
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
exports.se_PartialUpdateMessageCommand = se_PartialUpdateMessageCommand;
|
|
164
262
|
const se_ScheduleExternalFlagAdjustmentJobCommand = async (input, context) => {
|
|
165
263
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
166
264
|
const headers = {
|
|
@@ -189,6 +287,9 @@ const se_UpdateChannelCommand = async (input, context) => {
|
|
|
189
287
|
};
|
|
190
288
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
|
|
191
289
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
290
|
+
const query = (0, smithy_client_1.map)({
|
|
291
|
+
"user": [, input.userId],
|
|
292
|
+
});
|
|
192
293
|
let body;
|
|
193
294
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
194
295
|
'channel': _ => (0, smithy_client_1._json)(_),
|
|
@@ -200,10 +301,38 @@ const se_UpdateChannelCommand = async (input, context) => {
|
|
|
200
301
|
method: "PUT",
|
|
201
302
|
headers,
|
|
202
303
|
path: resolvedPath,
|
|
304
|
+
query,
|
|
203
305
|
body,
|
|
204
306
|
});
|
|
205
307
|
};
|
|
206
308
|
exports.se_UpdateChannelCommand = se_UpdateChannelCommand;
|
|
309
|
+
const se_UpdateMessageCommand = async (input, context) => {
|
|
310
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
311
|
+
const headers = {
|
|
312
|
+
'content-type': 'application/json',
|
|
313
|
+
};
|
|
314
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
|
|
315
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
316
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
317
|
+
const query = (0, smithy_client_1.map)({
|
|
318
|
+
"user": [, input.userId],
|
|
319
|
+
});
|
|
320
|
+
let body;
|
|
321
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
322
|
+
'message': _ => se_MessageUpdateFields(_, context),
|
|
323
|
+
}));
|
|
324
|
+
return new protocol_http_1.HttpRequest({
|
|
325
|
+
protocol,
|
|
326
|
+
hostname,
|
|
327
|
+
port,
|
|
328
|
+
method: "PUT",
|
|
329
|
+
headers,
|
|
330
|
+
path: resolvedPath,
|
|
331
|
+
query,
|
|
332
|
+
body,
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
exports.se_UpdateMessageCommand = se_UpdateMessageCommand;
|
|
207
336
|
const de_CreateChannelCommand = async (output, context) => {
|
|
208
337
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
209
338
|
return de_CreateChannelCommandError(output, context);
|
|
@@ -311,6 +440,42 @@ const de_DeleteChannelCommandError = async (output, context) => {
|
|
|
311
440
|
});
|
|
312
441
|
}
|
|
313
442
|
};
|
|
443
|
+
const de_DeleteMessageCommand = async (output, context) => {
|
|
444
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
445
|
+
return de_DeleteMessageCommandError(output, context);
|
|
446
|
+
}
|
|
447
|
+
const contents = (0, smithy_client_1.map)({
|
|
448
|
+
$metadata: deserializeMetadata(output),
|
|
449
|
+
});
|
|
450
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
451
|
+
return contents;
|
|
452
|
+
};
|
|
453
|
+
exports.de_DeleteMessageCommand = de_DeleteMessageCommand;
|
|
454
|
+
const de_DeleteMessageCommandError = async (output, context) => {
|
|
455
|
+
const parsedOutput = {
|
|
456
|
+
...output,
|
|
457
|
+
body: await parseErrorBody(output.body, context)
|
|
458
|
+
};
|
|
459
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
460
|
+
switch (errorCode) {
|
|
461
|
+
case "ChannelNotFoundException":
|
|
462
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
463
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
464
|
+
case "MessageNotFoundException":
|
|
465
|
+
case "wildix.xbees.conversations#MessageNotFoundException":
|
|
466
|
+
throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
|
|
467
|
+
case "ValidationException":
|
|
468
|
+
case "smithy.framework#ValidationException":
|
|
469
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
470
|
+
default:
|
|
471
|
+
const parsedBody = parsedOutput.body;
|
|
472
|
+
return throwDefaultError({
|
|
473
|
+
output,
|
|
474
|
+
parsedBody,
|
|
475
|
+
errorCode
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
};
|
|
314
479
|
const de_GetChannelCommand = async (output, context) => {
|
|
315
480
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
316
481
|
return de_GetChannelCommandError(output, context);
|
|
@@ -465,6 +630,77 @@ const de_JoinChannelCommandError = async (output, context) => {
|
|
|
465
630
|
});
|
|
466
631
|
}
|
|
467
632
|
};
|
|
633
|
+
const de_ListChannelsCommand = async (output, context) => {
|
|
634
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
635
|
+
return de_ListChannelsCommandError(output, context);
|
|
636
|
+
}
|
|
637
|
+
const contents = (0, smithy_client_1.map)({
|
|
638
|
+
$metadata: deserializeMetadata(output),
|
|
639
|
+
});
|
|
640
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
641
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
642
|
+
'channels': smithy_client_1._json,
|
|
643
|
+
});
|
|
644
|
+
Object.assign(contents, doc);
|
|
645
|
+
return contents;
|
|
646
|
+
};
|
|
647
|
+
exports.de_ListChannelsCommand = de_ListChannelsCommand;
|
|
648
|
+
const de_ListChannelsCommandError = async (output, context) => {
|
|
649
|
+
const parsedOutput = {
|
|
650
|
+
...output,
|
|
651
|
+
body: await parseErrorBody(output.body, context)
|
|
652
|
+
};
|
|
653
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
654
|
+
switch (errorCode) {
|
|
655
|
+
case "ValidationException":
|
|
656
|
+
case "smithy.framework#ValidationException":
|
|
657
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
658
|
+
default:
|
|
659
|
+
const parsedBody = parsedOutput.body;
|
|
660
|
+
return throwDefaultError({
|
|
661
|
+
output,
|
|
662
|
+
parsedBody,
|
|
663
|
+
errorCode
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
const de_ListMessagesCommand = async (output, context) => {
|
|
668
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
669
|
+
return de_ListMessagesCommandError(output, context);
|
|
670
|
+
}
|
|
671
|
+
const contents = (0, smithy_client_1.map)({
|
|
672
|
+
$metadata: deserializeMetadata(output),
|
|
673
|
+
});
|
|
674
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
675
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
676
|
+
'messages': _ => de_MessagesList(_, context),
|
|
677
|
+
});
|
|
678
|
+
Object.assign(contents, doc);
|
|
679
|
+
return contents;
|
|
680
|
+
};
|
|
681
|
+
exports.de_ListMessagesCommand = de_ListMessagesCommand;
|
|
682
|
+
const de_ListMessagesCommandError = async (output, context) => {
|
|
683
|
+
const parsedOutput = {
|
|
684
|
+
...output,
|
|
685
|
+
body: await parseErrorBody(output.body, context)
|
|
686
|
+
};
|
|
687
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
688
|
+
switch (errorCode) {
|
|
689
|
+
case "ChannelNotFoundException":
|
|
690
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
691
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
692
|
+
case "ValidationException":
|
|
693
|
+
case "smithy.framework#ValidationException":
|
|
694
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
695
|
+
default:
|
|
696
|
+
const parsedBody = parsedOutput.body;
|
|
697
|
+
return throwDefaultError({
|
|
698
|
+
output,
|
|
699
|
+
parsedBody,
|
|
700
|
+
errorCode
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
};
|
|
468
704
|
const de_PartialUpdateChannelCommand = async (output, context) => {
|
|
469
705
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
470
706
|
return de_PartialUpdateChannelCommandError(output, context);
|
|
@@ -502,6 +738,46 @@ const de_PartialUpdateChannelCommandError = async (output, context) => {
|
|
|
502
738
|
});
|
|
503
739
|
}
|
|
504
740
|
};
|
|
741
|
+
const de_PartialUpdateMessageCommand = async (output, context) => {
|
|
742
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
743
|
+
return de_PartialUpdateMessageCommandError(output, context);
|
|
744
|
+
}
|
|
745
|
+
const contents = (0, smithy_client_1.map)({
|
|
746
|
+
$metadata: deserializeMetadata(output),
|
|
747
|
+
});
|
|
748
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
749
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
750
|
+
'message': _ => de_Message(_, context),
|
|
751
|
+
});
|
|
752
|
+
Object.assign(contents, doc);
|
|
753
|
+
return contents;
|
|
754
|
+
};
|
|
755
|
+
exports.de_PartialUpdateMessageCommand = de_PartialUpdateMessageCommand;
|
|
756
|
+
const de_PartialUpdateMessageCommandError = async (output, context) => {
|
|
757
|
+
const parsedOutput = {
|
|
758
|
+
...output,
|
|
759
|
+
body: await parseErrorBody(output.body, context)
|
|
760
|
+
};
|
|
761
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
762
|
+
switch (errorCode) {
|
|
763
|
+
case "ChannelNotFoundException":
|
|
764
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
765
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
766
|
+
case "MessageNotFoundException":
|
|
767
|
+
case "wildix.xbees.conversations#MessageNotFoundException":
|
|
768
|
+
throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
|
|
769
|
+
case "ValidationException":
|
|
770
|
+
case "smithy.framework#ValidationException":
|
|
771
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
772
|
+
default:
|
|
773
|
+
const parsedBody = parsedOutput.body;
|
|
774
|
+
return throwDefaultError({
|
|
775
|
+
output,
|
|
776
|
+
parsedBody,
|
|
777
|
+
errorCode
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
};
|
|
505
781
|
const de_ScheduleExternalFlagAdjustmentJobCommand = async (output, context) => {
|
|
506
782
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
507
783
|
return de_ScheduleExternalFlagAdjustmentJobCommandError(output, context);
|
|
@@ -575,6 +851,46 @@ const de_UpdateChannelCommandError = async (output, context) => {
|
|
|
575
851
|
});
|
|
576
852
|
}
|
|
577
853
|
};
|
|
854
|
+
const de_UpdateMessageCommand = async (output, context) => {
|
|
855
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
856
|
+
return de_UpdateMessageCommandError(output, context);
|
|
857
|
+
}
|
|
858
|
+
const contents = (0, smithy_client_1.map)({
|
|
859
|
+
$metadata: deserializeMetadata(output),
|
|
860
|
+
});
|
|
861
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
862
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
863
|
+
'message': _ => de_Message(_, context),
|
|
864
|
+
});
|
|
865
|
+
Object.assign(contents, doc);
|
|
866
|
+
return contents;
|
|
867
|
+
};
|
|
868
|
+
exports.de_UpdateMessageCommand = de_UpdateMessageCommand;
|
|
869
|
+
const de_UpdateMessageCommandError = async (output, context) => {
|
|
870
|
+
const parsedOutput = {
|
|
871
|
+
...output,
|
|
872
|
+
body: await parseErrorBody(output.body, context)
|
|
873
|
+
};
|
|
874
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
875
|
+
switch (errorCode) {
|
|
876
|
+
case "ChannelNotFoundException":
|
|
877
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
878
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
879
|
+
case "MessageNotFoundException":
|
|
880
|
+
case "wildix.xbees.conversations#MessageNotFoundException":
|
|
881
|
+
throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
|
|
882
|
+
case "ValidationException":
|
|
883
|
+
case "smithy.framework#ValidationException":
|
|
884
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
885
|
+
default:
|
|
886
|
+
const parsedBody = parsedOutput.body;
|
|
887
|
+
return throwDefaultError({
|
|
888
|
+
output,
|
|
889
|
+
parsedBody,
|
|
890
|
+
errorCode
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
};
|
|
578
894
|
const throwDefaultError = (0, smithy_client_1.withBaseException)(ConversationsServiceException_1.ConversationsServiceException);
|
|
579
895
|
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
580
896
|
const contents = (0, smithy_client_1.map)({});
|
|
@@ -641,6 +957,19 @@ const de_MemberNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
641
957
|
});
|
|
642
958
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
643
959
|
};
|
|
960
|
+
const de_MessageNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
961
|
+
const contents = (0, smithy_client_1.map)({});
|
|
962
|
+
const data = parsedOutput.body;
|
|
963
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
964
|
+
'message': smithy_client_1.expectString,
|
|
965
|
+
});
|
|
966
|
+
Object.assign(contents, doc);
|
|
967
|
+
const exception = new models_0_1.MessageNotFoundException({
|
|
968
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
969
|
+
...contents
|
|
970
|
+
});
|
|
971
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
972
|
+
};
|
|
644
973
|
const se_Message = (input, context) => {
|
|
645
974
|
return (0, smithy_client_1.take)(input, {
|
|
646
975
|
'attachments': smithy_client_1._json,
|
|
@@ -680,6 +1009,21 @@ const se_MessageCreateFields = (input, context) => {
|
|
|
680
1009
|
'type': [],
|
|
681
1010
|
});
|
|
682
1011
|
};
|
|
1012
|
+
const se_MessageUpdateFields = (input, context) => {
|
|
1013
|
+
return (0, smithy_client_1.take)(input, {
|
|
1014
|
+
'attachments': smithy_client_1._json,
|
|
1015
|
+
'event': [],
|
|
1016
|
+
'forward': smithy_client_1._json,
|
|
1017
|
+
'giphy': smithy_client_1._json,
|
|
1018
|
+
'mentions': smithy_client_1._json,
|
|
1019
|
+
'quote': _ => se_Message(_, context),
|
|
1020
|
+
'silent': [],
|
|
1021
|
+
'sms': [],
|
|
1022
|
+
'smsStatus': [],
|
|
1023
|
+
'text': [],
|
|
1024
|
+
'type': [],
|
|
1025
|
+
});
|
|
1026
|
+
};
|
|
683
1027
|
const de_Message = (output, context) => {
|
|
684
1028
|
return (0, smithy_client_1.take)(output, {
|
|
685
1029
|
'attachments': smithy_client_1._json,
|
|
@@ -703,6 +1047,12 @@ const de_Message = (output, context) => {
|
|
|
703
1047
|
'user': smithy_client_1._json,
|
|
704
1048
|
});
|
|
705
1049
|
};
|
|
1050
|
+
const de_MessagesList = (output, context) => {
|
|
1051
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1052
|
+
return de_Message(entry, context);
|
|
1053
|
+
});
|
|
1054
|
+
return retVal;
|
|
1055
|
+
};
|
|
706
1056
|
const deserializeMetadata = (output) => ({
|
|
707
1057
|
httpStatusCode: output.statusCode,
|
|
708
1058
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-es/Conversations.js
CHANGED
|
@@ -2,25 +2,35 @@ import { ConversationsClient, } from "./ConversationsClient";
|
|
|
2
2
|
import { CreateChannelCommand, } from "./commands/CreateChannelCommand";
|
|
3
3
|
import { CreateMessageCommand, } from "./commands/CreateMessageCommand";
|
|
4
4
|
import { DeleteChannelCommand, } from "./commands/DeleteChannelCommand";
|
|
5
|
+
import { DeleteMessageCommand, } from "./commands/DeleteMessageCommand";
|
|
5
6
|
import { GetChannelCommand, } from "./commands/GetChannelCommand";
|
|
6
7
|
import { GetChannelMemberCommand, } from "./commands/GetChannelMemberCommand";
|
|
7
8
|
import { GetMessageCommand, } from "./commands/GetMessageCommand";
|
|
8
9
|
import { JoinChannelCommand, } from "./commands/JoinChannelCommand";
|
|
10
|
+
import { ListChannelsCommand, } from "./commands/ListChannelsCommand";
|
|
11
|
+
import { ListMessagesCommand, } from "./commands/ListMessagesCommand";
|
|
9
12
|
import { PartialUpdateChannelCommand, } from "./commands/PartialUpdateChannelCommand";
|
|
13
|
+
import { PartialUpdateMessageCommand, } from "./commands/PartialUpdateMessageCommand";
|
|
10
14
|
import { ScheduleExternalFlagAdjustmentJobCommand, } from "./commands/ScheduleExternalFlagAdjustmentJobCommand";
|
|
11
15
|
import { UpdateChannelCommand, } from "./commands/UpdateChannelCommand";
|
|
16
|
+
import { UpdateMessageCommand, } from "./commands/UpdateMessageCommand";
|
|
12
17
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
13
18
|
const commands = {
|
|
14
19
|
CreateChannelCommand,
|
|
15
20
|
CreateMessageCommand,
|
|
16
21
|
DeleteChannelCommand,
|
|
22
|
+
DeleteMessageCommand,
|
|
17
23
|
GetChannelCommand,
|
|
18
24
|
GetChannelMemberCommand,
|
|
19
25
|
GetMessageCommand,
|
|
20
26
|
JoinChannelCommand,
|
|
27
|
+
ListChannelsCommand,
|
|
28
|
+
ListMessagesCommand,
|
|
21
29
|
PartialUpdateChannelCommand,
|
|
30
|
+
PartialUpdateMessageCommand,
|
|
22
31
|
ScheduleExternalFlagAdjustmentJobCommand,
|
|
23
32
|
UpdateChannelCommand,
|
|
33
|
+
UpdateMessageCommand,
|
|
24
34
|
};
|
|
25
35
|
export class Conversations extends ConversationsClient {
|
|
26
36
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { de_DeleteMessageCommand, se_DeleteMessageCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class DeleteMessageCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
12
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
13
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
14
|
+
const { logger } = configuration;
|
|
15
|
+
const clientName = "ConversationsClient";
|
|
16
|
+
const commandName = "DeleteMessageCommand";
|
|
17
|
+
const handlerExecutionContext = {
|
|
18
|
+
logger,
|
|
19
|
+
clientName,
|
|
20
|
+
commandName,
|
|
21
|
+
inputFilterSensitiveLog: (_) => _,
|
|
22
|
+
outputFilterSensitiveLog: (_) => _,
|
|
23
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
24
|
+
service: "Conversations",
|
|
25
|
+
operation: "DeleteMessage",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const { requestHandler } = configuration;
|
|
29
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
|
+
}
|
|
31
|
+
serialize(input, context) {
|
|
32
|
+
return se_DeleteMessageCommand(input, context);
|
|
33
|
+
}
|
|
34
|
+
deserialize(output, context) {
|
|
35
|
+
return de_DeleteMessageCommand(output, context);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { de_ListChannelsCommand, se_ListChannelsCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class ListChannelsCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
12
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
13
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
14
|
+
const { logger } = configuration;
|
|
15
|
+
const clientName = "ConversationsClient";
|
|
16
|
+
const commandName = "ListChannelsCommand";
|
|
17
|
+
const handlerExecutionContext = {
|
|
18
|
+
logger,
|
|
19
|
+
clientName,
|
|
20
|
+
commandName,
|
|
21
|
+
inputFilterSensitiveLog: (_) => _,
|
|
22
|
+
outputFilterSensitiveLog: (_) => _,
|
|
23
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
24
|
+
service: "Conversations",
|
|
25
|
+
operation: "ListChannels",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const { requestHandler } = configuration;
|
|
29
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
|
+
}
|
|
31
|
+
serialize(input, context) {
|
|
32
|
+
return se_ListChannelsCommand(input, context);
|
|
33
|
+
}
|
|
34
|
+
deserialize(output, context) {
|
|
35
|
+
return de_ListChannelsCommand(output, context);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { de_ListMessagesCommand, se_ListMessagesCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class ListMessagesCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
12
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
13
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
14
|
+
const { logger } = configuration;
|
|
15
|
+
const clientName = "ConversationsClient";
|
|
16
|
+
const commandName = "ListMessagesCommand";
|
|
17
|
+
const handlerExecutionContext = {
|
|
18
|
+
logger,
|
|
19
|
+
clientName,
|
|
20
|
+
commandName,
|
|
21
|
+
inputFilterSensitiveLog: (_) => _,
|
|
22
|
+
outputFilterSensitiveLog: (_) => _,
|
|
23
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
24
|
+
service: "Conversations",
|
|
25
|
+
operation: "ListMessages",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const { requestHandler } = configuration;
|
|
29
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
|
+
}
|
|
31
|
+
serialize(input, context) {
|
|
32
|
+
return se_ListMessagesCommand(input, context);
|
|
33
|
+
}
|
|
34
|
+
deserialize(output, context) {
|
|
35
|
+
return de_ListMessagesCommand(output, context);
|
|
36
|
+
}
|
|
37
|
+
}
|