@microsoft/teams-js 2.15.0-beta.2 → 2.15.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.
@@ -1478,6 +1478,7 @@ var teamsMinAdaptiveCardVersion = {
1478
1478
 
1479
1479
 
1480
1480
 
1481
+
1481
1482
  /**
1482
1483
  * @param pattern - reference pattern
1483
1484
  * @param host - candidate string
@@ -1504,6 +1505,7 @@ function validateHostAgainstPattern(pattern, host) {
1504
1505
  }
1505
1506
  return false;
1506
1507
  }
1508
+ var validateOriginLogger = getLogger('validateOrigin');
1507
1509
  /**
1508
1510
  * @internal
1509
1511
  * Limited to Microsoft-internal use
@@ -1511,6 +1513,7 @@ function validateHostAgainstPattern(pattern, host) {
1511
1513
  function validateOrigin(messageOrigin) {
1512
1514
  // Check whether the url is in the pre-known allowlist or supplied by user
1513
1515
  if (!isValidHttpsURL(messageOrigin)) {
1516
+ validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
1514
1517
  return false;
1515
1518
  }
1516
1519
  var messageOriginHost = messageOrigin.host;
@@ -1524,6 +1527,7 @@ function validateOrigin(messageOrigin) {
1524
1527
  return true;
1525
1528
  }
1526
1529
  }
1530
+ validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOrigins, GlobalVars.additionalValidOrigins);
1527
1531
  return false;
1528
1532
  }
1529
1533
  /**
@@ -2178,7 +2182,7 @@ var _minRuntimeConfigToUninitialize = {
2178
2182
  * @hidden
2179
2183
  * Package version.
2180
2184
  */
2181
- var version = "2.15.0-beta.2";
2185
+ var version = "2.15.0-beta.3";
2182
2186
 
2183
2187
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2184
2188
 
@@ -5061,6 +5065,7 @@ function sendMessageToParentHelper(actionName, args) {
5061
5065
  }
5062
5066
  return request;
5063
5067
  }
5068
+ var processMessageLogger = communicationLogger.extend('processMessage');
5064
5069
  /**
5065
5070
  * @internal
5066
5071
  * Limited to Microsoft-internal use
@@ -5068,13 +5073,16 @@ function sendMessageToParentHelper(actionName, args) {
5068
5073
  function processMessage(evt) {
5069
5074
  // Process only if we received a valid message
5070
5075
  if (!evt || !evt.data || typeof evt.data !== 'object') {
5076
+ processMessageLogger('Unrecognized message format received by app, message being ignored. Message: %o', evt);
5071
5077
  return;
5072
5078
  }
5073
5079
  // Process only if the message is coming from a different window and a valid origin
5074
- // valid origins are either a pre-known
5080
+ // valid origins are either a pre-known origin or one specified by the app developer
5081
+ // in their call to app.initialize
5075
5082
  var messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);
5076
5083
  var messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);
5077
5084
  if (!shouldProcessMessage(messageSource, messageOrigin)) {
5085
+ processMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin');
5078
5086
  return;
5079
5087
  }
5080
5088
  // Update our parent and child relationships based on this message
@@ -5087,6 +5095,7 @@ function processMessage(evt) {
5087
5095
  handleChildMessage(evt);
5088
5096
  }
5089
5097
  }
5098
+ var shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMessage');
5090
5099
  /**
5091
5100
  * @hidden
5092
5101
  * Validates the message source and origin, if it should be processed
@@ -5098,6 +5107,7 @@ function shouldProcessMessage(messageSource, messageOrigin) {
5098
5107
  // Process if message source is a different window and if origin is either in
5099
5108
  // Teams' pre-known whitelist or supplied as valid origin by user during initialization
5100
5109
  if (Communication.currentWindow && messageSource === Communication.currentWindow) {
5110
+ shouldProcessMessageLogger('Should not process message because it is coming from the current window');
5101
5111
  return false;
5102
5112
  }
5103
5113
  else if (Communication.currentWindow &&
@@ -5107,7 +5117,11 @@ function shouldProcessMessage(messageSource, messageOrigin) {
5107
5117
  return true;
5108
5118
  }
5109
5119
  else {
5110
- return validateOrigin(new URL(messageOrigin));
5120
+ var isOriginValid = validateOrigin(new URL(messageOrigin));
5121
+ if (!isOriginValid) {
5122
+ shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);
5123
+ }
5124
+ return isOriginValid;
5111
5125
  }
5112
5126
  }
5113
5127
  /**
@@ -6775,6 +6789,7 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
6775
6789
 
6776
6790
 
6777
6791
 
6792
+
6778
6793
  /**
6779
6794
  * Interact with the system clipboard
6780
6795
  *
@@ -6836,7 +6851,7 @@ var clipboard;
6836
6851
  if (!isSupported()) {
6837
6852
  throw errorNotSupportedOnPlatform;
6838
6853
  }
6839
- if (!isHostClientMobile()) return [3 /*break*/, 2];
6854
+ if (!(isHostClientMobile() || GlobalVars.hostClientType === HostClientType.macos)) return [3 /*break*/, 2];
6840
6855
  _b = (_a = JSON).parse;
6841
6856
  return [4 /*yield*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
6842
6857
  case 1: