@wildix/xbees-conversations-client 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageActionNotFoundException = exports.TaggedChannelsLimitReachedException = exports.SystemMessage = exports.ConversationsServiceException = exports.PinnedChannelsLimitReachedException = exports.MessageUnsetFields = exports.GroupChannelUnsetOptions = exports.MarkUnreadChannelsLimitReachedException = exports.TagNotFoundException = exports.TriggerNotFoundException = exports.WebhookEventType = exports.ReactionType = exports.MessageNotFoundException = exports.MemberNotFoundException = exports.TagsLimitReachedException = exports.GroupChannelCreationEventType = exports.ChannelAlreadyExistException = exports.AssignChannelVariant = exports.AssignChannelServiceRequest = exports.AssignChannelAssigneeRequest = exports.MemberAlreadyExistException = exports.ChannelNotFoundException = exports.ChannelMemberRole = exports.ActionTriggerStatus = exports.FileNotFoundException = exports.ConversationFileCategory = exports.MessageWhatsAppStatus = exports.MessageType = exports.MessageSmsStatus = exports.Element = exports.ActionElement = exports.ButtonVariant = exports.ButtonHandler = exports.ChannelWhatsAppStatus = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelType = exports.ChannelAccess = exports.TargetNotFoundException = exports.TargetNotEligibleException = exports.TargetNotEligibleReason = exports.ValidationException = exports.RateLimitExceededException = exports.ForbiddenException = void 0;
3
+ exports.MessageActionNotFoundException = exports.TaggedChannelsLimitReachedException = exports.SystemMessage = exports.ConversationsServiceException = exports.PinnedChannelsLimitReachedException = exports.MessageUnsetFields = exports.GroupChannelUnsetOptions = exports.MarkUnreadChannelsLimitReachedException = exports.TagNotFoundException = exports.TriggerNotFoundException = exports.WebhookEventType = exports.ReactionType = exports.MessageNotFoundException = exports.MemberNotFoundException = exports.TagsLimitReachedException = exports.GroupChannelCreationEventType = exports.ChannelAlreadyExistException = exports.AssignChannelVariant = exports.AssignChannelServiceRequest = exports.AssignChannelAssigneeRequest = exports.MemberDeactivatedException = exports.MemberAlreadyExistException = exports.ChannelNotFoundException = exports.ChannelMemberRole = exports.ActionTriggerStatus = exports.FileNotFoundException = exports.ConversationFileCategory = exports.MessageWhatsAppStatus = exports.MessageType = exports.MessageSmsStatus = exports.Element = exports.ActionElement = exports.ButtonVariant = exports.ButtonHandler = exports.ChannelWhatsAppStatus = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelType = exports.ChannelAccess = exports.TargetNotFoundException = exports.TargetNotEligibleException = exports.TargetNotEligibleReason = exports.ValidationException = exports.RateLimitExceededException = exports.ForbiddenException = void 0;
4
4
  const ConversationsServiceException_1 = require("./ConversationsServiceException");
5
5
  class ForbiddenException extends ConversationsServiceException_1.ConversationsServiceException {
6
6
  name = "ForbiddenException";
@@ -203,6 +203,19 @@ class MemberAlreadyExistException extends ConversationsServiceException_1.Conver
203
203
  }
204
204
  }
205
205
  exports.MemberAlreadyExistException = MemberAlreadyExistException;
206
+ class MemberDeactivatedException extends ConversationsServiceException_1.ConversationsServiceException {
207
+ name = "MemberDeactivatedException";
208
+ $fault = "client";
209
+ constructor(opts) {
210
+ super({
211
+ name: "MemberDeactivatedException",
212
+ $fault: "client",
213
+ ...opts
214
+ });
215
+ Object.setPrototypeOf(this, MemberDeactivatedException.prototype);
216
+ }
217
+ }
218
+ exports.MemberDeactivatedException = MemberDeactivatedException;
206
219
  var AssignChannelAssigneeRequest;
207
220
  (function (AssignChannelAssigneeRequest) {
208
221
  AssignChannelAssigneeRequest.visit = (value, visitor) => {
@@ -1302,7 +1302,6 @@ const de_AddChannelMemberCommand = async (output, context) => {
1302
1302
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
1303
1303
  const doc = (0, smithy_client_1.take)(data, {
1304
1304
  'member': smithy_client_1._json,
1305
- 'skippedMember': smithy_client_1._json,
1306
1305
  'user': smithy_client_1._json,
1307
1306
  });
1308
1307
  Object.assign(contents, doc);
@@ -2220,6 +2219,9 @@ const de_CommandError = async (output, context) => {
2220
2219
  case "MemberAlreadyExistException":
2221
2220
  case "wildix.xbees.conversations#MemberAlreadyExistException":
2222
2221
  throw await de_MemberAlreadyExistExceptionRes(parsedOutput, context);
2222
+ case "MemberDeactivatedException":
2223
+ case "wildix.xbees.conversations#MemberDeactivatedException":
2224
+ throw await de_MemberDeactivatedExceptionRes(parsedOutput, context);
2223
2225
  case "RateLimitExceededException":
2224
2226
  case "smithy.framework#RateLimitExceededException":
2225
2227
  throw await de_RateLimitExceededExceptionRes(parsedOutput, context);
@@ -2400,6 +2402,19 @@ const de_MemberAlreadyExistExceptionRes = async (parsedOutput, context) => {
2400
2402
  });
2401
2403
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2402
2404
  };
2405
+ const de_MemberDeactivatedExceptionRes = async (parsedOutput, context) => {
2406
+ const contents = (0, smithy_client_1.map)({});
2407
+ const data = parsedOutput.body;
2408
+ const doc = (0, smithy_client_1.take)(data, {
2409
+ 'message': smithy_client_1.expectString,
2410
+ });
2411
+ Object.assign(contents, doc);
2412
+ const exception = new models_0_1.MemberDeactivatedException({
2413
+ $metadata: deserializeMetadata(parsedOutput),
2414
+ ...contents
2415
+ });
2416
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2417
+ };
2403
2418
  const de_MemberNotFoundExceptionRes = async (parsedOutput, context) => {
2404
2419
  const contents = (0, smithy_client_1.map)({});
2405
2420
  const data = parsedOutput.body;
@@ -192,6 +192,18 @@ export class MemberAlreadyExistException extends __BaseException {
192
192
  Object.setPrototypeOf(this, MemberAlreadyExistException.prototype);
193
193
  }
194
194
  }
195
+ export class MemberDeactivatedException extends __BaseException {
196
+ name = "MemberDeactivatedException";
197
+ $fault = "client";
198
+ constructor(opts) {
199
+ super({
200
+ name: "MemberDeactivatedException",
201
+ $fault: "client",
202
+ ...opts
203
+ });
204
+ Object.setPrototypeOf(this, MemberDeactivatedException.prototype);
205
+ }
206
+ }
195
207
  export var AssignChannelAssigneeRequest;
196
208
  (function (AssignChannelAssigneeRequest) {
197
209
  AssignChannelAssigneeRequest.visit = (value, visitor) => {
@@ -1,5 +1,5 @@
1
1
  import { ConversationsServiceException as __BaseException } from "../models/ConversationsServiceException";
2
- import { ChannelAlreadyExistException, ChannelNotFoundException, ConversationsServiceException, FileNotFoundException, ForbiddenException, MarkUnreadChannelsLimitReachedException, MemberAlreadyExistException, MemberNotFoundException, MessageActionNotFoundException, MessageNotFoundException, PinnedChannelsLimitReachedException, RateLimitExceededException, TagNotFoundException, TaggedChannelsLimitReachedException, TagsLimitReachedException, TargetNotEligibleException, TargetNotFoundException, TriggerNotFoundException, ValidationException, } from "../models/models_0";
2
+ import { ChannelAlreadyExistException, ChannelNotFoundException, ConversationsServiceException, FileNotFoundException, ForbiddenException, MarkUnreadChannelsLimitReachedException, MemberAlreadyExistException, MemberDeactivatedException, MemberNotFoundException, MessageActionNotFoundException, MessageNotFoundException, PinnedChannelsLimitReachedException, RateLimitExceededException, TagNotFoundException, TaggedChannelsLimitReachedException, TagsLimitReachedException, TargetNotEligibleException, TargetNotFoundException, TriggerNotFoundException, ValidationException, } from "../models/models_0";
3
3
  import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
4
  import { requestBuilder as rb } from "@smithy/core";
5
5
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, strictParseInt32 as __strictParseInt32, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
@@ -1232,7 +1232,6 @@ export const de_AddChannelMemberCommand = async (output, context) => {
1232
1232
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1233
1233
  const doc = take(data, {
1234
1234
  'member': _json,
1235
- 'skippedMember': _json,
1236
1235
  'user': _json,
1237
1236
  });
1238
1237
  Object.assign(contents, doc);
@@ -2085,6 +2084,9 @@ const de_CommandError = async (output, context) => {
2085
2084
  case "MemberAlreadyExistException":
2086
2085
  case "wildix.xbees.conversations#MemberAlreadyExistException":
2087
2086
  throw await de_MemberAlreadyExistExceptionRes(parsedOutput, context);
2087
+ case "MemberDeactivatedException":
2088
+ case "wildix.xbees.conversations#MemberDeactivatedException":
2089
+ throw await de_MemberDeactivatedExceptionRes(parsedOutput, context);
2088
2090
  case "RateLimitExceededException":
2089
2091
  case "smithy.framework#RateLimitExceededException":
2090
2092
  throw await de_RateLimitExceededExceptionRes(parsedOutput, context);
@@ -2265,6 +2267,19 @@ const de_MemberAlreadyExistExceptionRes = async (parsedOutput, context) => {
2265
2267
  });
2266
2268
  return __decorateServiceException(exception, parsedOutput.body);
2267
2269
  };
2270
+ const de_MemberDeactivatedExceptionRes = async (parsedOutput, context) => {
2271
+ const contents = map({});
2272
+ const data = parsedOutput.body;
2273
+ const doc = take(data, {
2274
+ 'message': __expectString,
2275
+ });
2276
+ Object.assign(contents, doc);
2277
+ const exception = new MemberDeactivatedException({
2278
+ $metadata: deserializeMetadata(parsedOutput),
2279
+ ...contents
2280
+ });
2281
+ return __decorateServiceException(exception, parsedOutput.body);
2282
+ };
2268
2283
  const de_MemberNotFoundExceptionRes = async (parsedOutput, context) => {
2269
2284
  const contents = map({});
2270
2285
  const data = parsedOutput.body;
@@ -30,7 +30,7 @@ declare const AddChannelMemberCommand_base: {
30
30
  * Adds a single member to an existing channel.
31
31
  * This operation will either add an existing user or invite a new user to the channel.
32
32
  * This operation is idempotent, meaning that if the member already exists, the operation will still return a successful response.
33
- * If the specified member cannot be added because the account is deactivated in GetStream, the response returns `skippedMember` instead of `member` and `user`.
33
+ * If the specified member cannot be added because the account is deactivated in GetStream, the operation fails with `MemberDeactivatedException`.
34
34
  *
35
35
  * @example
36
36
  * Use a bare-bones client and the command you need to make an API call.
@@ -78,11 +78,6 @@ declare const AddChannelMemberCommand_base: {
78
78
  * // createdAt: "STRING_VALUE",
79
79
  * // updatedAt: "STRING_VALUE",
80
80
  * // },
81
- * // skippedMember: { // SkippedMember
82
- * // id: "STRING_VALUE",
83
- * // email: "STRING_VALUE",
84
- * // phone: "STRING_VALUE",
85
- * // },
86
81
  * // };
87
82
  *
88
83
  * ```
@@ -97,6 +92,8 @@ declare const AddChannelMemberCommand_base: {
97
92
  *
98
93
  * @throws {@link MemberAlreadyExistException} (client fault)
99
94
  *
95
+ * @throws {@link MemberDeactivatedException} (client fault)
96
+ *
100
97
  * @throws {@link ValidationException} (client fault)
101
98
  *
102
99
  * @throws {@link ForbiddenException} (client fault)
@@ -673,26 +673,6 @@ export interface ChannelMember {
673
673
  createdAt: string;
674
674
  role: ChannelMemberRole;
675
675
  }
676
- /**
677
- * @public
678
- */
679
- export interface SkippedMember {
680
- /**
681
- * The unique identifier of the skipped user if it is known.
682
- * @public
683
- */
684
- id?: string | undefined;
685
- /**
686
- * The email address of the skipped user if it is known.
687
- * @public
688
- */
689
- email?: string | undefined;
690
- /**
691
- * The phone number of the skipped user if it is known.
692
- * @public
693
- */
694
- phone?: string | undefined;
695
- }
696
676
  /**
697
677
  * @public
698
678
  */
@@ -701,17 +681,12 @@ export interface AddChannelMemberOutput {
701
681
  * Details of the member added to the channel.
702
682
  * @public
703
683
  */
704
- member?: ChannelMember | undefined;
684
+ member: ChannelMember;
705
685
  /**
706
686
  * Details of the user added to the channel.
707
687
  * @public
708
688
  */
709
- user?: User | undefined;
710
- /**
711
- * Details of the skipped user if the member was not added, for example because the account is deactivated in GetStream.
712
- * @public
713
- */
714
- skippedMember?: SkippedMember | undefined;
689
+ user: User;
715
690
  }
716
691
  /**
717
692
  * @public
@@ -735,6 +710,17 @@ export declare class MemberAlreadyExistException extends __BaseException {
735
710
  */
736
711
  constructor(opts: __ExceptionOptionType<MemberAlreadyExistException, __BaseException>);
737
712
  }
713
+ /**
714
+ * @public
715
+ */
716
+ export declare class MemberDeactivatedException extends __BaseException {
717
+ readonly name: "MemberDeactivatedException";
718
+ readonly $fault: "client";
719
+ /**
720
+ * @internal
721
+ */
722
+ constructor(opts: __ExceptionOptionType<MemberDeactivatedException, __BaseException>);
723
+ }
738
724
  /**
739
725
  * @public
740
726
  */
@@ -775,6 +761,26 @@ export interface AddChannelMembersInput {
775
761
  */
776
762
  unreadMessageId?: string | undefined;
777
763
  }
764
+ /**
765
+ * @public
766
+ */
767
+ export interface SkippedMember {
768
+ /**
769
+ * The unique identifier of the skipped user if it is known.
770
+ * @public
771
+ */
772
+ id?: string | undefined;
773
+ /**
774
+ * The email address of the skipped user if it is known.
775
+ * @public
776
+ */
777
+ email?: string | undefined;
778
+ /**
779
+ * The phone number of the skipped user if it is known.
780
+ * @public
781
+ */
782
+ phone?: string | undefined;
783
+ }
778
784
  /**
779
785
  * @public
780
786
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/xbees-conversations-client",
3
3
  "description": "@wildix/xbees-conversations-client client",
4
- "version": "1.4.1",
4
+ "version": "1.5.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",