@azure/communication-chat 1.6.0-beta.1 → 1.6.0-beta.3

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/index.js CHANGED
@@ -125,12 +125,22 @@ const mapToChatContentSdkModel = (content) => {
125
125
  }
126
126
  return result;
127
127
  };
128
+ /**
129
+ * @internal
130
+ */
131
+ const mapToChatPolicyViolationSdkModel = (policyVolation) => {
132
+ const { state } = policyVolation;
133
+ const result = {
134
+ result: state,
135
+ };
136
+ return result;
137
+ };
128
138
  /**
129
139
  * @internal
130
140
  * Mapping chat message REST model to chat message SDK model
131
141
  */
132
142
  const mapToChatMessageSdkModel = (chatMessage) => {
133
- const { content, senderCommunicationIdentifier } = chatMessage, otherChatMessage = tslib.__rest(chatMessage, ["content", "senderCommunicationIdentifier"]);
143
+ const { content, senderCommunicationIdentifier, policyViolation } = chatMessage, otherChatMessage = tslib.__rest(chatMessage, ["content", "senderCommunicationIdentifier", "policyViolation"]);
134
144
  let result = Object.assign({}, otherChatMessage);
135
145
  if (content) {
136
146
  result = Object.assign(Object.assign({}, result), { content: mapToChatContentSdkModel(content) });
@@ -139,6 +149,9 @@ const mapToChatMessageSdkModel = (chatMessage) => {
139
149
  const sender = communicationCommon.deserializeCommunicationIdentifier(senderCommunicationIdentifier);
140
150
  result = Object.assign(Object.assign({}, result), { sender });
141
151
  }
152
+ if (policyViolation) {
153
+ result = Object.assign(Object.assign({}, result), { policyViolation: mapToChatPolicyViolationSdkModel(policyViolation) });
154
+ }
142
155
  return result;
143
156
  };
144
157
  /**
@@ -203,7 +216,7 @@ const mapToReadReceiptSdkModel = (readReceipt) => {
203
216
  const tracingClient = coreTracing.createTracingClient({
204
217
  namespace: "Azure.Communication",
205
218
  packageName: "@azure/communication-chat",
206
- packageVersion: "1.6.0-beta.1",
219
+ packageVersion: "1.6.0-beta.2",
207
220
  });
208
221
 
209
222
  /*
@@ -698,6 +711,13 @@ const ChatMessage = {
698
711
  value: { type: { name: "String" } },
699
712
  },
700
713
  },
714
+ policyViolation: {
715
+ serializedName: "policyViolation",
716
+ type: {
717
+ name: "Composite",
718
+ className: "PolicyViolation",
719
+ },
720
+ },
701
721
  },
702
722
  },
703
723
  };
@@ -786,6 +806,22 @@ const ChatParticipant = {
786
806
  },
787
807
  },
788
808
  };
809
+ const PolicyViolation = {
810
+ type: {
811
+ name: "Composite",
812
+ className: "PolicyViolation",
813
+ modelProperties: {
814
+ state: {
815
+ serializedName: "state",
816
+ required: true,
817
+ type: {
818
+ name: "Enum",
819
+ allowedValues: ["contentBlocked", "warning"],
820
+ },
821
+ },
822
+ },
823
+ },
824
+ };
789
825
  const UpdateChatMessageRequest = {
790
826
  type: {
791
827
  name: "Composite",
@@ -1032,6 +1068,27 @@ const ChatThreadProperties = {
1032
1068
  className: "ChatRetentionPolicy",
1033
1069
  },
1034
1070
  },
1071
+ messagingPolicy: {
1072
+ serializedName: "messagingPolicy",
1073
+ type: {
1074
+ name: "Composite",
1075
+ className: "MessagingPolicy",
1076
+ },
1077
+ },
1078
+ },
1079
+ },
1080
+ };
1081
+ const MessagingPolicy = {
1082
+ type: {
1083
+ name: "Composite",
1084
+ className: "MessagingPolicy",
1085
+ modelProperties: {
1086
+ textOnlyChat: {
1087
+ serializedName: "textOnlyChat",
1088
+ type: {
1089
+ name: "Boolean",
1090
+ },
1091
+ },
1035
1092
  },
1036
1093
  },
1037
1094
  };
@@ -1296,10 +1353,12 @@ var Mappers = /*#__PURE__*/Object.freeze({
1296
1353
  ErrorDetail: ErrorDetail,
1297
1354
  ErrorModel: ErrorModel,
1298
1355
  ErrorResponse: ErrorResponse,
1356
+ MessagingPolicy: MessagingPolicy,
1299
1357
  MicrosoftTeamsAppIdentifierModel: MicrosoftTeamsAppIdentifierModel,
1300
1358
  MicrosoftTeamsUserIdentifierModel: MicrosoftTeamsUserIdentifierModel,
1301
1359
  NoneRetentionPolicy: NoneRetentionPolicy,
1302
1360
  PhoneNumberIdentifierModel: PhoneNumberIdentifierModel,
1361
+ PolicyViolation: PolicyViolation,
1303
1362
  SendChatMessageRequest: SendChatMessageRequest,
1304
1363
  SendChatMessageResult: SendChatMessageResult,
1305
1364
  SendReadReceiptRequest: SendReadReceiptRequest,
@@ -1371,7 +1430,7 @@ const skip = {
1371
1430
  const apiVersion = {
1372
1431
  parameterPath: "apiVersion",
1373
1432
  mapper: {
1374
- defaultValue: "2024-03-15-preview",
1433
+ defaultValue: "2024-06-05-preview",
1375
1434
  isConstant: true,
1376
1435
  serializedName: "api-version",
1377
1436
  type: {
@@ -2541,7 +2600,7 @@ class ChatApiClient extends coreClient__namespace.ServiceClient {
2541
2600
  const defaults = {
2542
2601
  requestContentType: "application/json; charset=utf-8",
2543
2602
  };
2544
- const packageDetails = `azsdk-js-communication-chat/1.6.0-beta.1`;
2603
+ const packageDetails = `azsdk-js-communication-chat/1.6.0-beta.2`;
2545
2604
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2546
2605
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2547
2606
  : `${packageDetails}`;
@@ -2552,7 +2611,7 @@ class ChatApiClient extends coreClient__namespace.ServiceClient {
2552
2611
  // Parameter assignments
2553
2612
  this.endpoint = endpoint;
2554
2613
  // Assigning values to Constant parameters
2555
- this.apiVersion = options.apiVersion || "2024-03-15-preview";
2614
+ this.apiVersion = options.apiVersion || "2024-06-05-preview";
2556
2615
  this.chatThread = new ChatThreadImpl(this);
2557
2616
  this.chat = new ChatImpl(this);
2558
2617
  this.addCustomApiVersionPolicy(options.apiVersion);