@wildix/xbees-conversations-client 1.0.32 → 1.0.34
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 +6 -4
- package/dist-cjs/commands/{SendSystemMessageCommand.js → HideChannelCommand.js} +7 -7
- package/dist-cjs/commands/ListMessageReactionsCommand.js +41 -0
- package/dist-cjs/commands/{GetMessageReactionsCommand.js → ShowChannelCommand.js} +7 -7
- package/dist-cjs/commands/index.js +3 -2
- package/dist-cjs/protocols/Aws_restJson1.js +138 -135
- package/dist-es/Conversations.js +6 -4
- package/dist-es/commands/{SendSystemMessageCommand.js → HideChannelCommand.js} +6 -6
- package/dist-es/commands/ListMessageReactionsCommand.js +37 -0
- package/dist-es/commands/{GetMessageReactionsCommand.js → ShowChannelCommand.js} +6 -6
- package/dist-es/commands/index.js +3 -2
- package/dist-es/protocols/Aws_restJson1.js +125 -124
- package/dist-types/Conversations.d.ts +21 -14
- package/dist-types/ConversationsClient.d.ts +5 -4
- package/dist-types/commands/AddChannelMemberCommand.d.ts +1 -0
- package/dist-types/commands/AddChannelMembersCommand.d.ts +1 -0
- package/dist-types/commands/GetMessageCommand.d.ts +29 -47
- package/dist-types/commands/HideChannelCommand.d.ts +140 -0
- package/dist-types/commands/{GetMessageReactionsCommand.d.ts → ListMessageReactionsCommand.d.ts} +18 -18
- package/dist-types/commands/ListMessagesCommand.d.ts +31 -47
- package/dist-types/commands/PartialUpdateMessageCommand.d.ts +65 -138
- package/dist-types/commands/SendGiphyCommand.d.ts +29 -47
- package/dist-types/commands/SendMessageCommand.d.ts +65 -138
- package/dist-types/commands/ShowChannelCommand.d.ts +140 -0
- package/dist-types/commands/UpdateMessageCommand.d.ts +65 -138
- package/dist-types/commands/index.d.ts +3 -2
- package/dist-types/models/models_0.d.ts +150 -119
- package/dist-types/protocols/Aws_restJson1.d.ts +27 -18
- package/package.json +1 -1
- package/dist-types/commands/SendSystemMessageCommand.d.ts +0 -213
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.de_UpdateMessageCommand = exports.de_UpdateChannelCommand = exports.
|
|
3
|
+
exports.de_ListChannelsCommand = exports.de_ListChannelMembersCommand = exports.de_LeaveChannelCommand = exports.de_JoinChannelCommand = exports.de_InviteCommand = exports.de_HideChannelCommand = exports.de_GetOrCreateDirectChannelCommand = exports.de_GetMessageCommand = exports.de_GetDirectChannelIdCommand = exports.de_GetChannelMemberCommand = exports.de_GetChannelCommand = exports.de_DeleteMessageReactionCommand = exports.de_DeleteMessageCommand = exports.de_DeleteChannelMemberCommand = exports.de_DeleteChannelCommand = exports.de_CreateGroupChannelCommand = exports.de_AddChannelMembersCommand = exports.de_AddChannelMemberCommand = exports.se_UpdateMessageCommand = exports.se_UpdateChannelCommand = exports.se_ShowChannelCommand = exports.se_SendTypingStopCommand = exports.se_SendTypingStartCommand = exports.se_SendMessageReactionCommand = exports.se_SendMessageCommand = exports.se_SendGiphyCommand = exports.se_ScheduleExternalFlagAdjustmentJobCommand = exports.se_PartialUpdateMessageCommand = exports.se_PartialUpdateChannelCommand = exports.se_MarkReadCommand = exports.se_ListMessagesCommand = exports.se_ListMessageReactionsCommand = exports.se_ListChannelsCommand = exports.se_ListChannelMembersCommand = exports.se_LeaveChannelCommand = exports.se_JoinChannelCommand = exports.se_InviteCommand = exports.se_HideChannelCommand = exports.se_GetOrCreateDirectChannelCommand = exports.se_GetMessageCommand = exports.se_GetDirectChannelIdCommand = exports.se_GetChannelMemberCommand = exports.se_GetChannelCommand = exports.se_DeleteMessageReactionCommand = exports.se_DeleteMessageCommand = exports.se_DeleteChannelMemberCommand = exports.se_DeleteChannelCommand = exports.se_CreateGroupChannelCommand = exports.se_AddChannelMembersCommand = exports.se_AddChannelMemberCommand = void 0;
|
|
4
|
+
exports.de_UpdateMessageCommand = exports.de_UpdateChannelCommand = exports.de_ShowChannelCommand = exports.de_SendTypingStopCommand = exports.de_SendTypingStartCommand = exports.de_SendMessageReactionCommand = exports.de_SendMessageCommand = exports.de_SendGiphyCommand = exports.de_ScheduleExternalFlagAdjustmentJobCommand = exports.de_PartialUpdateMessageCommand = exports.de_PartialUpdateChannelCommand = exports.de_MarkReadCommand = exports.de_ListMessagesCommand = exports.de_ListMessageReactionsCommand = void 0;
|
|
5
5
|
const ConversationsServiceException_1 = require("../models/ConversationsServiceException");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
@@ -17,6 +17,7 @@ const se_AddChannelMemberCommand = async (input, context) => {
|
|
|
17
17
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
18
18
|
'memberId': [],
|
|
19
19
|
'memberToInvite': _ => (0, smithy_client_1._json)(_),
|
|
20
|
+
'silent': [],
|
|
20
21
|
}));
|
|
21
22
|
return new protocol_http_1.HttpRequest({
|
|
22
23
|
protocol,
|
|
@@ -40,6 +41,7 @@ const se_AddChannelMembersCommand = async (input, context) => {
|
|
|
40
41
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
41
42
|
'members': _ => (0, smithy_client_1._json)(_),
|
|
42
43
|
'membersToInvite': _ => (0, smithy_client_1._json)(_),
|
|
44
|
+
'silent': [],
|
|
43
45
|
}));
|
|
44
46
|
return new protocol_http_1.HttpRequest({
|
|
45
47
|
protocol,
|
|
@@ -248,43 +250,41 @@ const se_GetMessageCommand = async (input, context) => {
|
|
|
248
250
|
});
|
|
249
251
|
};
|
|
250
252
|
exports.se_GetMessageCommand = se_GetMessageCommand;
|
|
251
|
-
const
|
|
253
|
+
const se_GetOrCreateDirectChannelCommand = async (input, context) => {
|
|
252
254
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
253
|
-
const headers = {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
resolvedPath = (
|
|
255
|
+
const headers = {
|
|
256
|
+
'content-type': 'application/json',
|
|
257
|
+
};
|
|
258
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/direct/get_or_create_channel";
|
|
257
259
|
const query = (0, smithy_client_1.map)({
|
|
258
|
-
"
|
|
259
|
-
"offset": [() => input.offset !== void 0, () => (input.offset.toString())],
|
|
260
|
+
"user": [, input.userId],
|
|
260
261
|
});
|
|
261
262
|
let body;
|
|
263
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
264
|
+
'memberId': [],
|
|
265
|
+
'memberToInvite': _ => (0, smithy_client_1._json)(_),
|
|
266
|
+
}));
|
|
262
267
|
return new protocol_http_1.HttpRequest({
|
|
263
268
|
protocol,
|
|
264
269
|
hostname,
|
|
265
270
|
port,
|
|
266
|
-
method: "
|
|
271
|
+
method: "POST",
|
|
267
272
|
headers,
|
|
268
273
|
path: resolvedPath,
|
|
269
274
|
query,
|
|
270
275
|
body,
|
|
271
276
|
});
|
|
272
277
|
};
|
|
273
|
-
exports.
|
|
274
|
-
const
|
|
278
|
+
exports.se_GetOrCreateDirectChannelCommand = se_GetOrCreateDirectChannelCommand;
|
|
279
|
+
const se_HideChannelCommand = async (input, context) => {
|
|
275
280
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
276
|
-
const headers = {
|
|
277
|
-
|
|
278
|
-
};
|
|
279
|
-
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/direct/get_or_create_channel";
|
|
281
|
+
const headers = {};
|
|
282
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/hide";
|
|
283
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
280
284
|
const query = (0, smithy_client_1.map)({
|
|
281
285
|
"user": [, input.userId],
|
|
282
286
|
});
|
|
283
287
|
let body;
|
|
284
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
285
|
-
'memberId': [],
|
|
286
|
-
'memberToInvite': _ => (0, smithy_client_1._json)(_),
|
|
287
|
-
}));
|
|
288
288
|
return new protocol_http_1.HttpRequest({
|
|
289
289
|
protocol,
|
|
290
290
|
hostname,
|
|
@@ -296,7 +296,7 @@ const se_GetOrCreateDirectChannelCommand = async (input, context) => {
|
|
|
296
296
|
body,
|
|
297
297
|
});
|
|
298
298
|
};
|
|
299
|
-
exports.
|
|
299
|
+
exports.se_HideChannelCommand = se_HideChannelCommand;
|
|
300
300
|
const se_InviteCommand = async (input, context) => {
|
|
301
301
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
302
302
|
const headers = {
|
|
@@ -414,11 +414,38 @@ const se_ListChannelsCommand = async (input, context) => {
|
|
|
414
414
|
});
|
|
415
415
|
};
|
|
416
416
|
exports.se_ListChannelsCommand = se_ListChannelsCommand;
|
|
417
|
+
const se_ListMessageReactionsCommand = async (input, context) => {
|
|
418
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
419
|
+
const headers = {};
|
|
420
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}/reactions";
|
|
421
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
422
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
423
|
+
const query = (0, smithy_client_1.map)({
|
|
424
|
+
"limit": [() => input.limit !== void 0, () => (input.limit.toString())],
|
|
425
|
+
"offset": [() => input.offset !== void 0, () => (input.offset.toString())],
|
|
426
|
+
});
|
|
427
|
+
let body;
|
|
428
|
+
return new protocol_http_1.HttpRequest({
|
|
429
|
+
protocol,
|
|
430
|
+
hostname,
|
|
431
|
+
port,
|
|
432
|
+
method: "GET",
|
|
433
|
+
headers,
|
|
434
|
+
path: resolvedPath,
|
|
435
|
+
query,
|
|
436
|
+
body,
|
|
437
|
+
});
|
|
438
|
+
};
|
|
439
|
+
exports.se_ListMessageReactionsCommand = se_ListMessageReactionsCommand;
|
|
417
440
|
const se_ListMessagesCommand = async (input, context) => {
|
|
418
441
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
419
442
|
const headers = {};
|
|
420
443
|
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
|
|
421
444
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
445
|
+
const query = (0, smithy_client_1.map)({
|
|
446
|
+
"limit": [() => input.limit !== void 0, () => (input.limit.toString())],
|
|
447
|
+
"offset": [() => input.offset !== void 0, () => (input.offset.toString())],
|
|
448
|
+
});
|
|
422
449
|
let body;
|
|
423
450
|
return new protocol_http_1.HttpRequest({
|
|
424
451
|
protocol,
|
|
@@ -427,6 +454,7 @@ const se_ListMessagesCommand = async (input, context) => {
|
|
|
427
454
|
method: "GET",
|
|
428
455
|
headers,
|
|
429
456
|
path: resolvedPath,
|
|
457
|
+
query,
|
|
430
458
|
body,
|
|
431
459
|
});
|
|
432
460
|
};
|
|
@@ -489,7 +517,7 @@ const se_PartialUpdateMessageCommand = async (input, context) => {
|
|
|
489
517
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
|
|
490
518
|
let body;
|
|
491
519
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
492
|
-
'set': _ =>
|
|
520
|
+
'set': _ => (0, smithy_client_1._json)(_),
|
|
493
521
|
'unset': _ => (0, smithy_client_1._json)(_),
|
|
494
522
|
}));
|
|
495
523
|
return new protocol_http_1.HttpRequest({
|
|
@@ -567,7 +595,7 @@ const se_SendMessageCommand = async (input, context) => {
|
|
|
567
595
|
'forward': _ => (0, smithy_client_1._json)(_),
|
|
568
596
|
'mentions': _ => (0, smithy_client_1._json)(_),
|
|
569
597
|
'messageId': [],
|
|
570
|
-
'quote': _ =>
|
|
598
|
+
'quote': _ => (0, smithy_client_1._json)(_),
|
|
571
599
|
'text': [],
|
|
572
600
|
}));
|
|
573
601
|
return new protocol_http_1.HttpRequest({
|
|
@@ -609,20 +637,15 @@ const se_SendMessageReactionCommand = async (input, context) => {
|
|
|
609
637
|
});
|
|
610
638
|
};
|
|
611
639
|
exports.se_SendMessageReactionCommand = se_SendMessageReactionCommand;
|
|
612
|
-
const
|
|
640
|
+
const se_SendTypingStartCommand = async (input, context) => {
|
|
613
641
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
614
|
-
const headers = {
|
|
615
|
-
|
|
616
|
-
};
|
|
617
|
-
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/send_system_message";
|
|
642
|
+
const headers = {};
|
|
643
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/send_typing_start";
|
|
618
644
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
619
645
|
const query = (0, smithy_client_1.map)({
|
|
620
646
|
"user": [, input.userId],
|
|
621
647
|
});
|
|
622
648
|
let body;
|
|
623
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
624
|
-
'messageId': [],
|
|
625
|
-
}));
|
|
626
649
|
return new protocol_http_1.HttpRequest({
|
|
627
650
|
protocol,
|
|
628
651
|
hostname,
|
|
@@ -634,11 +657,11 @@ const se_SendSystemMessageCommand = async (input, context) => {
|
|
|
634
657
|
body,
|
|
635
658
|
});
|
|
636
659
|
};
|
|
637
|
-
exports.
|
|
638
|
-
const
|
|
660
|
+
exports.se_SendTypingStartCommand = se_SendTypingStartCommand;
|
|
661
|
+
const se_SendTypingStopCommand = async (input, context) => {
|
|
639
662
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
640
663
|
const headers = {};
|
|
641
|
-
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/
|
|
664
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/send_typing_stop";
|
|
642
665
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
643
666
|
const query = (0, smithy_client_1.map)({
|
|
644
667
|
"user": [, input.userId],
|
|
@@ -655,11 +678,11 @@ const se_SendTypingStartCommand = async (input, context) => {
|
|
|
655
678
|
body,
|
|
656
679
|
});
|
|
657
680
|
};
|
|
658
|
-
exports.
|
|
659
|
-
const
|
|
681
|
+
exports.se_SendTypingStopCommand = se_SendTypingStopCommand;
|
|
682
|
+
const se_ShowChannelCommand = async (input, context) => {
|
|
660
683
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
661
684
|
const headers = {};
|
|
662
|
-
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/
|
|
685
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/show";
|
|
663
686
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
|
|
664
687
|
const query = (0, smithy_client_1.map)({
|
|
665
688
|
"user": [, input.userId],
|
|
@@ -676,7 +699,7 @@ const se_SendTypingStopCommand = async (input, context) => {
|
|
|
676
699
|
body,
|
|
677
700
|
});
|
|
678
701
|
};
|
|
679
|
-
exports.
|
|
702
|
+
exports.se_ShowChannelCommand = se_ShowChannelCommand;
|
|
680
703
|
const se_UpdateChannelCommand = async (input, context) => {
|
|
681
704
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
682
705
|
const headers = {
|
|
@@ -721,7 +744,7 @@ const se_UpdateMessageCommand = async (input, context) => {
|
|
|
721
744
|
'attachments': _ => (0, smithy_client_1._json)(_),
|
|
722
745
|
'forward': _ => (0, smithy_client_1._json)(_),
|
|
723
746
|
'mentions': _ => (0, smithy_client_1._json)(_),
|
|
724
|
-
'quote': _ =>
|
|
747
|
+
'quote': _ => (0, smithy_client_1._json)(_),
|
|
725
748
|
'text': [],
|
|
726
749
|
}));
|
|
727
750
|
return new protocol_http_1.HttpRequest({
|
|
@@ -1146,7 +1169,7 @@ const de_GetMessageCommand = async (output, context) => {
|
|
|
1146
1169
|
});
|
|
1147
1170
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1148
1171
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1149
|
-
'message':
|
|
1172
|
+
'message': smithy_client_1._json,
|
|
1150
1173
|
});
|
|
1151
1174
|
Object.assign(contents, doc);
|
|
1152
1175
|
return contents;
|
|
@@ -1177,31 +1200,28 @@ const de_GetMessageCommandError = async (output, context) => {
|
|
|
1177
1200
|
});
|
|
1178
1201
|
}
|
|
1179
1202
|
};
|
|
1180
|
-
const
|
|
1203
|
+
const de_GetOrCreateDirectChannelCommand = async (output, context) => {
|
|
1181
1204
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1182
|
-
return
|
|
1205
|
+
return de_GetOrCreateDirectChannelCommandError(output, context);
|
|
1183
1206
|
}
|
|
1184
1207
|
const contents = (0, smithy_client_1.map)({
|
|
1185
1208
|
$metadata: deserializeMetadata(output),
|
|
1186
1209
|
});
|
|
1187
1210
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1188
1211
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1189
|
-
'
|
|
1212
|
+
'channel': smithy_client_1._json,
|
|
1190
1213
|
});
|
|
1191
1214
|
Object.assign(contents, doc);
|
|
1192
1215
|
return contents;
|
|
1193
1216
|
};
|
|
1194
|
-
exports.
|
|
1195
|
-
const
|
|
1217
|
+
exports.de_GetOrCreateDirectChannelCommand = de_GetOrCreateDirectChannelCommand;
|
|
1218
|
+
const de_GetOrCreateDirectChannelCommandError = async (output, context) => {
|
|
1196
1219
|
const parsedOutput = {
|
|
1197
1220
|
...output,
|
|
1198
1221
|
body: await parseErrorBody(output.body, context)
|
|
1199
1222
|
};
|
|
1200
1223
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1201
1224
|
switch (errorCode) {
|
|
1202
|
-
case "ChannelNotFoundException":
|
|
1203
|
-
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
1204
|
-
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
1205
1225
|
case "ForbiddenException":
|
|
1206
1226
|
case "smithy.framework#ForbiddenException":
|
|
1207
1227
|
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
@@ -1217,9 +1237,9 @@ const de_GetMessageReactionsCommandError = async (output, context) => {
|
|
|
1217
1237
|
});
|
|
1218
1238
|
}
|
|
1219
1239
|
};
|
|
1220
|
-
const
|
|
1240
|
+
const de_HideChannelCommand = async (output, context) => {
|
|
1221
1241
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1222
|
-
return
|
|
1242
|
+
return de_HideChannelCommandError(output, context);
|
|
1223
1243
|
}
|
|
1224
1244
|
const contents = (0, smithy_client_1.map)({
|
|
1225
1245
|
$metadata: deserializeMetadata(output),
|
|
@@ -1231,14 +1251,17 @@ const de_GetOrCreateDirectChannelCommand = async (output, context) => {
|
|
|
1231
1251
|
Object.assign(contents, doc);
|
|
1232
1252
|
return contents;
|
|
1233
1253
|
};
|
|
1234
|
-
exports.
|
|
1235
|
-
const
|
|
1254
|
+
exports.de_HideChannelCommand = de_HideChannelCommand;
|
|
1255
|
+
const de_HideChannelCommandError = async (output, context) => {
|
|
1236
1256
|
const parsedOutput = {
|
|
1237
1257
|
...output,
|
|
1238
1258
|
body: await parseErrorBody(output.body, context)
|
|
1239
1259
|
};
|
|
1240
1260
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1241
1261
|
switch (errorCode) {
|
|
1262
|
+
case "ChannelNotFoundException":
|
|
1263
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
1264
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
1242
1265
|
case "ForbiddenException":
|
|
1243
1266
|
case "smithy.framework#ForbiddenException":
|
|
1244
1267
|
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
@@ -1445,6 +1468,46 @@ const de_ListChannelsCommandError = async (output, context) => {
|
|
|
1445
1468
|
});
|
|
1446
1469
|
}
|
|
1447
1470
|
};
|
|
1471
|
+
const de_ListMessageReactionsCommand = async (output, context) => {
|
|
1472
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1473
|
+
return de_ListMessageReactionsCommandError(output, context);
|
|
1474
|
+
}
|
|
1475
|
+
const contents = (0, smithy_client_1.map)({
|
|
1476
|
+
$metadata: deserializeMetadata(output),
|
|
1477
|
+
});
|
|
1478
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1479
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
1480
|
+
'reactions': smithy_client_1._json,
|
|
1481
|
+
});
|
|
1482
|
+
Object.assign(contents, doc);
|
|
1483
|
+
return contents;
|
|
1484
|
+
};
|
|
1485
|
+
exports.de_ListMessageReactionsCommand = de_ListMessageReactionsCommand;
|
|
1486
|
+
const de_ListMessageReactionsCommandError = async (output, context) => {
|
|
1487
|
+
const parsedOutput = {
|
|
1488
|
+
...output,
|
|
1489
|
+
body: await parseErrorBody(output.body, context)
|
|
1490
|
+
};
|
|
1491
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1492
|
+
switch (errorCode) {
|
|
1493
|
+
case "ChannelNotFoundException":
|
|
1494
|
+
case "wildix.xbees.conversations#ChannelNotFoundException":
|
|
1495
|
+
throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
|
|
1496
|
+
case "ForbiddenException":
|
|
1497
|
+
case "smithy.framework#ForbiddenException":
|
|
1498
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
1499
|
+
case "ValidationException":
|
|
1500
|
+
case "smithy.framework#ValidationException":
|
|
1501
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1502
|
+
default:
|
|
1503
|
+
const parsedBody = parsedOutput.body;
|
|
1504
|
+
return throwDefaultError({
|
|
1505
|
+
output,
|
|
1506
|
+
parsedBody,
|
|
1507
|
+
errorCode
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1448
1511
|
const de_ListMessagesCommand = async (output, context) => {
|
|
1449
1512
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1450
1513
|
return de_ListMessagesCommandError(output, context);
|
|
@@ -1454,7 +1517,7 @@ const de_ListMessagesCommand = async (output, context) => {
|
|
|
1454
1517
|
});
|
|
1455
1518
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1456
1519
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1457
|
-
'messages':
|
|
1520
|
+
'messages': smithy_client_1._json,
|
|
1458
1521
|
});
|
|
1459
1522
|
Object.assign(contents, doc);
|
|
1460
1523
|
return contents;
|
|
@@ -1570,7 +1633,7 @@ const de_PartialUpdateMessageCommand = async (output, context) => {
|
|
|
1570
1633
|
});
|
|
1571
1634
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1572
1635
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1573
|
-
'message':
|
|
1636
|
+
'message': smithy_client_1._json,
|
|
1574
1637
|
});
|
|
1575
1638
|
Object.assign(contents, doc);
|
|
1576
1639
|
return contents;
|
|
@@ -1649,7 +1712,7 @@ const de_SendGiphyCommand = async (output, context) => {
|
|
|
1649
1712
|
});
|
|
1650
1713
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1651
1714
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1652
|
-
'message':
|
|
1715
|
+
'message': smithy_client_1._json,
|
|
1653
1716
|
});
|
|
1654
1717
|
Object.assign(contents, doc);
|
|
1655
1718
|
return contents;
|
|
@@ -1689,7 +1752,7 @@ const de_SendMessageCommand = async (output, context) => {
|
|
|
1689
1752
|
});
|
|
1690
1753
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1691
1754
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1692
|
-
'message':
|
|
1755
|
+
'message': smithy_client_1._json,
|
|
1693
1756
|
});
|
|
1694
1757
|
Object.assign(contents, doc);
|
|
1695
1758
|
return contents;
|
|
@@ -1756,22 +1819,18 @@ const de_SendMessageReactionCommandError = async (output, context) => {
|
|
|
1756
1819
|
});
|
|
1757
1820
|
}
|
|
1758
1821
|
};
|
|
1759
|
-
const
|
|
1822
|
+
const de_SendTypingStartCommand = async (output, context) => {
|
|
1760
1823
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1761
|
-
return
|
|
1824
|
+
return de_SendTypingStartCommandError(output, context);
|
|
1762
1825
|
}
|
|
1763
1826
|
const contents = (0, smithy_client_1.map)({
|
|
1764
1827
|
$metadata: deserializeMetadata(output),
|
|
1765
1828
|
});
|
|
1766
|
-
|
|
1767
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
1768
|
-
'message': _ => de_Message(_, context),
|
|
1769
|
-
});
|
|
1770
|
-
Object.assign(contents, doc);
|
|
1829
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
1771
1830
|
return contents;
|
|
1772
1831
|
};
|
|
1773
|
-
exports.
|
|
1774
|
-
const
|
|
1832
|
+
exports.de_SendTypingStartCommand = de_SendTypingStartCommand;
|
|
1833
|
+
const de_SendTypingStartCommandError = async (output, context) => {
|
|
1775
1834
|
const parsedOutput = {
|
|
1776
1835
|
...output,
|
|
1777
1836
|
body: await parseErrorBody(output.body, context)
|
|
@@ -1796,9 +1855,9 @@ const de_SendSystemMessageCommandError = async (output, context) => {
|
|
|
1796
1855
|
});
|
|
1797
1856
|
}
|
|
1798
1857
|
};
|
|
1799
|
-
const
|
|
1858
|
+
const de_SendTypingStopCommand = async (output, context) => {
|
|
1800
1859
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1801
|
-
return
|
|
1860
|
+
return de_SendTypingStopCommandError(output, context);
|
|
1802
1861
|
}
|
|
1803
1862
|
const contents = (0, smithy_client_1.map)({
|
|
1804
1863
|
$metadata: deserializeMetadata(output),
|
|
@@ -1806,8 +1865,8 @@ const de_SendTypingStartCommand = async (output, context) => {
|
|
|
1806
1865
|
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
1807
1866
|
return contents;
|
|
1808
1867
|
};
|
|
1809
|
-
exports.
|
|
1810
|
-
const
|
|
1868
|
+
exports.de_SendTypingStopCommand = de_SendTypingStopCommand;
|
|
1869
|
+
const de_SendTypingStopCommandError = async (output, context) => {
|
|
1811
1870
|
const parsedOutput = {
|
|
1812
1871
|
...output,
|
|
1813
1872
|
body: await parseErrorBody(output.body, context)
|
|
@@ -1832,18 +1891,22 @@ const de_SendTypingStartCommandError = async (output, context) => {
|
|
|
1832
1891
|
});
|
|
1833
1892
|
}
|
|
1834
1893
|
};
|
|
1835
|
-
const
|
|
1894
|
+
const de_ShowChannelCommand = async (output, context) => {
|
|
1836
1895
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1837
|
-
return
|
|
1896
|
+
return de_ShowChannelCommandError(output, context);
|
|
1838
1897
|
}
|
|
1839
1898
|
const contents = (0, smithy_client_1.map)({
|
|
1840
1899
|
$metadata: deserializeMetadata(output),
|
|
1841
1900
|
});
|
|
1842
|
-
|
|
1901
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1902
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
1903
|
+
'channel': smithy_client_1._json,
|
|
1904
|
+
});
|
|
1905
|
+
Object.assign(contents, doc);
|
|
1843
1906
|
return contents;
|
|
1844
1907
|
};
|
|
1845
|
-
exports.
|
|
1846
|
-
const
|
|
1908
|
+
exports.de_ShowChannelCommand = de_ShowChannelCommand;
|
|
1909
|
+
const de_ShowChannelCommandError = async (output, context) => {
|
|
1847
1910
|
const parsedOutput = {
|
|
1848
1911
|
...output,
|
|
1849
1912
|
body: await parseErrorBody(output.body, context)
|
|
@@ -1917,7 +1980,7 @@ const de_UpdateMessageCommand = async (output, context) => {
|
|
|
1917
1980
|
});
|
|
1918
1981
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
1919
1982
|
const doc = (0, smithy_client_1.take)(data, {
|
|
1920
|
-
'message':
|
|
1983
|
+
'message': smithy_client_1._json,
|
|
1921
1984
|
});
|
|
1922
1985
|
Object.assign(contents, doc);
|
|
1923
1986
|
return contents;
|
|
@@ -2056,66 +2119,6 @@ const de_MessageNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
2056
2119
|
});
|
|
2057
2120
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
2058
2121
|
};
|
|
2059
|
-
const se_Message = (input, context) => {
|
|
2060
|
-
return (0, smithy_client_1.take)(input, {
|
|
2061
|
-
'attachments': smithy_client_1._json,
|
|
2062
|
-
'channelId': [],
|
|
2063
|
-
'createdAt': [],
|
|
2064
|
-
'edit': [],
|
|
2065
|
-
'event': [],
|
|
2066
|
-
'forward': smithy_client_1._json,
|
|
2067
|
-
'giphy': smithy_client_1._json,
|
|
2068
|
-
'latestReactions': smithy_client_1._json,
|
|
2069
|
-
'mentions': smithy_client_1._json,
|
|
2070
|
-
'messageId': [],
|
|
2071
|
-
'quote': _ => se_Message(_, context),
|
|
2072
|
-
'reactionCounts': smithy_client_1._json,
|
|
2073
|
-
'silent': [],
|
|
2074
|
-
'sms': [],
|
|
2075
|
-
'smsStatus': [],
|
|
2076
|
-
'text': [],
|
|
2077
|
-
'type': [],
|
|
2078
|
-
'updatedAt': [],
|
|
2079
|
-
'user': smithy_client_1._json,
|
|
2080
|
-
});
|
|
2081
|
-
};
|
|
2082
|
-
const se_PartialUpdateMessageSetInput = (input, context) => {
|
|
2083
|
-
return (0, smithy_client_1.take)(input, {
|
|
2084
|
-
'attachments': smithy_client_1._json,
|
|
2085
|
-
'forward': smithy_client_1._json,
|
|
2086
|
-
'quote': _ => se_Message(_, context),
|
|
2087
|
-
'text': [],
|
|
2088
|
-
});
|
|
2089
|
-
};
|
|
2090
|
-
const de_Message = (output, context) => {
|
|
2091
|
-
return (0, smithy_client_1.take)(output, {
|
|
2092
|
-
'attachments': smithy_client_1._json,
|
|
2093
|
-
'channelId': smithy_client_1.expectString,
|
|
2094
|
-
'createdAt': smithy_client_1.expectString,
|
|
2095
|
-
'edit': smithy_client_1.expectBoolean,
|
|
2096
|
-
'event': smithy_client_1.expectString,
|
|
2097
|
-
'forward': smithy_client_1._json,
|
|
2098
|
-
'giphy': smithy_client_1._json,
|
|
2099
|
-
'latestReactions': smithy_client_1._json,
|
|
2100
|
-
'mentions': smithy_client_1._json,
|
|
2101
|
-
'messageId': smithy_client_1.expectString,
|
|
2102
|
-
'quote': (_) => de_Message(_, context),
|
|
2103
|
-
'reactionCounts': smithy_client_1._json,
|
|
2104
|
-
'silent': smithy_client_1.expectBoolean,
|
|
2105
|
-
'sms': smithy_client_1.expectBoolean,
|
|
2106
|
-
'smsStatus': smithy_client_1.expectString,
|
|
2107
|
-
'text': smithy_client_1.expectString,
|
|
2108
|
-
'type': smithy_client_1.expectString,
|
|
2109
|
-
'updatedAt': smithy_client_1.expectString,
|
|
2110
|
-
'user': smithy_client_1._json,
|
|
2111
|
-
});
|
|
2112
|
-
};
|
|
2113
|
-
const de_MessagesList = (output, context) => {
|
|
2114
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
2115
|
-
return de_Message(entry, context);
|
|
2116
|
-
});
|
|
2117
|
-
return retVal;
|
|
2118
|
-
};
|
|
2119
2122
|
const deserializeMetadata = (output) => ({
|
|
2120
2123
|
httpStatusCode: output.statusCode,
|
|
2121
2124
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-es/Conversations.js
CHANGED
|
@@ -10,13 +10,14 @@ import { GetChannelCommand, } from "./commands/GetChannelCommand";
|
|
|
10
10
|
import { GetChannelMemberCommand, } from "./commands/GetChannelMemberCommand";
|
|
11
11
|
import { GetDirectChannelIdCommand, } from "./commands/GetDirectChannelIdCommand";
|
|
12
12
|
import { GetMessageCommand, } from "./commands/GetMessageCommand";
|
|
13
|
-
import { GetMessageReactionsCommand, } from "./commands/GetMessageReactionsCommand";
|
|
14
13
|
import { GetOrCreateDirectChannelCommand, } from "./commands/GetOrCreateDirectChannelCommand";
|
|
14
|
+
import { HideChannelCommand, } from "./commands/HideChannelCommand";
|
|
15
15
|
import { InviteCommand, } from "./commands/InviteCommand";
|
|
16
16
|
import { JoinChannelCommand, } from "./commands/JoinChannelCommand";
|
|
17
17
|
import { LeaveChannelCommand, } from "./commands/LeaveChannelCommand";
|
|
18
18
|
import { ListChannelMembersCommand, } from "./commands/ListChannelMembersCommand";
|
|
19
19
|
import { ListChannelsCommand, } from "./commands/ListChannelsCommand";
|
|
20
|
+
import { ListMessageReactionsCommand, } from "./commands/ListMessageReactionsCommand";
|
|
20
21
|
import { ListMessagesCommand, } from "./commands/ListMessagesCommand";
|
|
21
22
|
import { MarkReadCommand, } from "./commands/MarkReadCommand";
|
|
22
23
|
import { PartialUpdateChannelCommand, } from "./commands/PartialUpdateChannelCommand";
|
|
@@ -25,9 +26,9 @@ import { ScheduleExternalFlagAdjustmentJobCommand, } from "./commands/ScheduleEx
|
|
|
25
26
|
import { SendGiphyCommand, } from "./commands/SendGiphyCommand";
|
|
26
27
|
import { SendMessageCommand, } from "./commands/SendMessageCommand";
|
|
27
28
|
import { SendMessageReactionCommand, } from "./commands/SendMessageReactionCommand";
|
|
28
|
-
import { SendSystemMessageCommand, } from "./commands/SendSystemMessageCommand";
|
|
29
29
|
import { SendTypingStartCommand, } from "./commands/SendTypingStartCommand";
|
|
30
30
|
import { SendTypingStopCommand, } from "./commands/SendTypingStopCommand";
|
|
31
|
+
import { ShowChannelCommand, } from "./commands/ShowChannelCommand";
|
|
31
32
|
import { UpdateChannelCommand, } from "./commands/UpdateChannelCommand";
|
|
32
33
|
import { UpdateMessageCommand, } from "./commands/UpdateMessageCommand";
|
|
33
34
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
@@ -43,13 +44,14 @@ const commands = {
|
|
|
43
44
|
GetChannelMemberCommand,
|
|
44
45
|
GetDirectChannelIdCommand,
|
|
45
46
|
GetMessageCommand,
|
|
46
|
-
GetMessageReactionsCommand,
|
|
47
47
|
GetOrCreateDirectChannelCommand,
|
|
48
|
+
HideChannelCommand,
|
|
48
49
|
InviteCommand,
|
|
49
50
|
JoinChannelCommand,
|
|
50
51
|
LeaveChannelCommand,
|
|
51
52
|
ListChannelMembersCommand,
|
|
52
53
|
ListChannelsCommand,
|
|
54
|
+
ListMessageReactionsCommand,
|
|
53
55
|
ListMessagesCommand,
|
|
54
56
|
MarkReadCommand,
|
|
55
57
|
PartialUpdateChannelCommand,
|
|
@@ -58,9 +60,9 @@ const commands = {
|
|
|
58
60
|
SendGiphyCommand,
|
|
59
61
|
SendMessageCommand,
|
|
60
62
|
SendMessageReactionCommand,
|
|
61
|
-
SendSystemMessageCommand,
|
|
62
63
|
SendTypingStartCommand,
|
|
63
64
|
SendTypingStopCommand,
|
|
65
|
+
ShowChannelCommand,
|
|
64
66
|
UpdateChannelCommand,
|
|
65
67
|
UpdateMessageCommand,
|
|
66
68
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { de_HideChannelCommand, se_HideChannelCommand, } from "../protocols/Aws_restJson1";
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
5
|
export { $Command };
|
|
6
|
-
export class
|
|
6
|
+
export class HideChannelCommand extends $Command {
|
|
7
7
|
constructor(input) {
|
|
8
8
|
super();
|
|
9
9
|
this.input = input;
|
|
@@ -13,7 +13,7 @@ export class SendSystemMessageCommand extends $Command {
|
|
|
13
13
|
const stack = clientStack.concat(this.middlewareStack);
|
|
14
14
|
const { logger } = configuration;
|
|
15
15
|
const clientName = "ConversationsClient";
|
|
16
|
-
const commandName = "
|
|
16
|
+
const commandName = "HideChannelCommand";
|
|
17
17
|
const handlerExecutionContext = {
|
|
18
18
|
logger,
|
|
19
19
|
clientName,
|
|
@@ -22,16 +22,16 @@ export class SendSystemMessageCommand extends $Command {
|
|
|
22
22
|
outputFilterSensitiveLog: (_) => _,
|
|
23
23
|
[SMITHY_CONTEXT_KEY]: {
|
|
24
24
|
service: "Conversations",
|
|
25
|
-
operation: "
|
|
25
|
+
operation: "HideChannel",
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
const { requestHandler } = configuration;
|
|
29
29
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
30
|
}
|
|
31
31
|
serialize(input, context) {
|
|
32
|
-
return
|
|
32
|
+
return se_HideChannelCommand(input, context);
|
|
33
33
|
}
|
|
34
34
|
deserialize(output, context) {
|
|
35
|
-
return
|
|
35
|
+
return de_HideChannelCommand(output, context);
|
|
36
36
|
}
|
|
37
37
|
}
|