@microsoft/teams-js 2.23.0 → 2.24.0-beta.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.
@@ -3395,7 +3395,7 @@ const _minRuntimeConfigToUninitialize = {
3395
3395
  * @hidden
3396
3396
  * Package version.
3397
3397
  */
3398
- const version = "2.23.0";
3398
+ const version = "2.24.0-beta.0";
3399
3399
 
3400
3400
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
3401
3401
 
@@ -4706,6 +4706,7 @@ var menus;
4706
4706
 
4707
4707
 
4708
4708
 
4709
+
4709
4710
  /**
4710
4711
  * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
4711
4712
  */
@@ -4982,6 +4983,8 @@ var app;
4982
4983
  GlobalVars.frameContext = undefined;
4983
4984
  GlobalVars.hostClientType = undefined;
4984
4985
  GlobalVars.isFramelessWindow = false;
4986
+ messageChannels.telemetry._clearTelemetryPort();
4987
+ messageChannels.dataLayer._clearDataLayerPort();
4985
4988
  uninitializeCommunication();
4986
4989
  }
4987
4990
  app._uninitialize = _uninitialize;
@@ -6217,6 +6220,60 @@ function handlers_registerOnResumeHandler(handler) {
6217
6220
  ]);
6218
6221
  }
6219
6222
 
6223
+ ;// CONCATENATED MODULE: ./src/internal/uuidObject.ts
6224
+
6225
+ /**
6226
+ * @internal
6227
+ * Limited to Microsoft-internal use
6228
+ *
6229
+ * UUID object
6230
+ */
6231
+ class UUID {
6232
+ constructor(uuid = generateGUID()) {
6233
+ this.uuid = uuid;
6234
+ validateUuid(uuid);
6235
+ }
6236
+ toString() {
6237
+ return this.uuid;
6238
+ }
6239
+ }
6240
+
6241
+ ;// CONCATENATED MODULE: ./src/internal/messageObjects.ts
6242
+ var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
6243
+ var t = {};
6244
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6245
+ t[p] = s[p];
6246
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6247
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6248
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
6249
+ t[p[i]] = s[p[i]];
6250
+ }
6251
+ return t;
6252
+ };
6253
+
6254
+ const serializeMessageRequest = (message) => {
6255
+ const { uuid } = message, restOfMessage = messageObjects_rest(message, ["uuid"]);
6256
+ const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
6257
+ const request = Object.assign(Object.assign({}, restOfMessage), { uuidAsString: uuidAsString });
6258
+ return request;
6259
+ };
6260
+ const deserializeMessageRequest = (message) => {
6261
+ const { uuidAsString } = message, restOfMessage = messageObjects_rest(message, ["uuidAsString"]);
6262
+ const request = Object.assign(Object.assign({}, restOfMessage), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
6263
+ return request;
6264
+ };
6265
+ const deserializeMessageResponse = (serializedResponse) => {
6266
+ const { uuidAsString } = serializedResponse, restOfResponse = messageObjects_rest(serializedResponse, ["uuidAsString"]);
6267
+ const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
6268
+ return messageResponse;
6269
+ };
6270
+ const serializeMessageResponse = (response) => {
6271
+ const { uuid } = response, restOfResponse = messageObjects_rest(response, ["uuid"]);
6272
+ const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
6273
+ const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuidAsString: uuidAsString });
6274
+ return messageResponse;
6275
+ };
6276
+
6220
6277
  ;// CONCATENATED MODULE: ./src/internal/nestedAppAuthUtils.ts
6221
6278
 
6222
6279
 
@@ -6341,6 +6398,8 @@ var communication_awaiter = (undefined && undefined.__awaiter) || function (this
6341
6398
 
6342
6399
 
6343
6400
 
6401
+
6402
+
6344
6403
  const communicationLogger = getLogger('communication');
6345
6404
  /**
6346
6405
  * @internal
@@ -6358,9 +6417,10 @@ CommunicationPrivate.parentMessageQueue = [];
6358
6417
  CommunicationPrivate.childMessageQueue = [];
6359
6418
  CommunicationPrivate.topMessageQueue = [];
6360
6419
  CommunicationPrivate.nextMessageId = 0;
6361
- CommunicationPrivate.callbacks = {};
6362
- CommunicationPrivate.promiseCallbacks = {};
6363
- CommunicationPrivate.portCallbacks = {};
6420
+ CommunicationPrivate.callbacks = new Map();
6421
+ CommunicationPrivate.promiseCallbacks = new Map();
6422
+ CommunicationPrivate.portCallbacks = new Map();
6423
+ CommunicationPrivate.legacyMessageIdsToUuidMap = {};
6364
6424
  /**
6365
6425
  * @internal
6366
6426
  * Limited to Microsoft-internal use
@@ -6428,9 +6488,10 @@ function uninitializeCommunication() {
6428
6488
  CommunicationPrivate.parentMessageQueue = [];
6429
6489
  CommunicationPrivate.childMessageQueue = [];
6430
6490
  CommunicationPrivate.nextMessageId = 0;
6431
- CommunicationPrivate.callbacks = {};
6432
- CommunicationPrivate.promiseCallbacks = {};
6433
- CommunicationPrivate.portCallbacks = {};
6491
+ CommunicationPrivate.callbacks.clear();
6492
+ CommunicationPrivate.promiseCallbacks.clear();
6493
+ CommunicationPrivate.portCallbacks.clear();
6494
+ CommunicationPrivate.legacyMessageIdsToUuidMap = {};
6434
6495
  }
6435
6496
  /**
6436
6497
  * @hidden
@@ -6505,7 +6566,7 @@ function sendMessageToParentAsync(apiVersionTag, actionName, args = undefined) {
6505
6566
  }
6506
6567
  return new Promise((resolve) => {
6507
6568
  const request = sendMessageToParentHelper(apiVersionTag, actionName, args);
6508
- resolve(waitForResponse(request.id));
6569
+ resolve(waitForResponse(request.uuid));
6509
6570
  });
6510
6571
  }
6511
6572
  /**
@@ -6519,15 +6580,15 @@ function requestPortFromParentWithVersion(apiVersionTag, actionName, args = unde
6519
6580
  throw Error(`apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);
6520
6581
  }
6521
6582
  const request = sendMessageToParentHelper(apiVersionTag, actionName, args);
6522
- return waitForPort(request.id);
6583
+ return waitForPort(request.uuid);
6523
6584
  }
6524
6585
  /**
6525
6586
  * @internal
6526
6587
  * Limited to Microsoft-internal use
6527
6588
  */
6528
- function waitForPort(requestId) {
6589
+ function waitForPort(requestUuid) {
6529
6590
  return new Promise((resolve, reject) => {
6530
- CommunicationPrivate.portCallbacks[requestId] = (port, args) => {
6591
+ CommunicationPrivate.portCallbacks.set(requestUuid, (port, args) => {
6531
6592
  if (port instanceof MessagePort) {
6532
6593
  resolve(port);
6533
6594
  }
@@ -6535,16 +6596,16 @@ function waitForPort(requestId) {
6535
6596
  // First arg is the error message, if present
6536
6597
  reject(args && args.length > 0 ? args[0] : new Error('Host responded without port or error details.'));
6537
6598
  }
6538
- };
6599
+ });
6539
6600
  });
6540
6601
  }
6541
6602
  /**
6542
6603
  * @internal
6543
6604
  * Limited to Microsoft-internal use
6544
6605
  */
6545
- function waitForResponse(requestId) {
6606
+ function waitForResponse(requestUuid) {
6546
6607
  return new Promise((resolve) => {
6547
- CommunicationPrivate.promiseCallbacks[requestId] = resolve;
6608
+ CommunicationPrivate.promiseCallbacks.set(requestUuid, resolve);
6548
6609
  });
6549
6610
  }
6550
6611
  /**
@@ -6567,9 +6628,7 @@ function sendMessageToParent(apiVersionTag, actionName, argsOrCallback, callback
6567
6628
  }
6568
6629
  const request = sendMessageToParentHelper(apiVersionTag, actionName, args);
6569
6630
  if (callback) {
6570
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6571
- // @ts-ignore
6572
- CommunicationPrivate.callbacks[request.id] = callback;
6631
+ CommunicationPrivate.callbacks.set(request.uuid, callback);
6573
6632
  }
6574
6633
  }
6575
6634
  const sendNestedAuthRequestToTopWindowLogger = communicationLogger.extend('sendNestedAuthRequestToTopWindow');
@@ -6581,7 +6640,7 @@ function sendNestedAuthRequestToTopWindow(message) {
6581
6640
  const logger = sendNestedAuthRequestToTopWindowLogger;
6582
6641
  const targetWindow = Communication.topWindow;
6583
6642
  const request = createNestedAppAuthRequest(message);
6584
- logger('Message %i information: %o', request.id, { actionName: request.func });
6643
+ logger('Message %i information: %o', request.uuid, { actionName: request.func });
6585
6644
  return sendRequestToTargetWindowHelper(targetWindow, request);
6586
6645
  }
6587
6646
  const sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRequestToTargetWindowHelper');
@@ -6589,12 +6648,13 @@ const sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRe
6589
6648
  * @internal
6590
6649
  * Limited to Microsoft-internal use
6591
6650
  */
6592
- function sendRequestToTargetWindowHelper(targetWindow, request) {
6651
+ function sendRequestToTargetWindowHelper(targetWindow, messageRequest) {
6593
6652
  const logger = sendRequestToTargetWindowHelperLogger;
6594
6653
  const targetWindowName = getTargetName(targetWindow);
6654
+ const request = serializeMessageRequest(messageRequest);
6595
6655
  if (GlobalVars.isFramelessWindow) {
6596
6656
  if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {
6597
- logger(`Sending message %i to ${targetWindowName} via framelessPostMessage interface`, request.id);
6657
+ logger(`Sending message %i to ${targetWindowName} via framelessPostMessage interface`, request.uuidAsString);
6598
6658
  Communication.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(request));
6599
6659
  }
6600
6660
  }
@@ -6603,15 +6663,15 @@ function sendRequestToTargetWindowHelper(targetWindow, request) {
6603
6663
  // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
6604
6664
  // queue the message and send it after the origin is established
6605
6665
  if (targetWindow && targetOrigin) {
6606
- logger(`Sending message %i to ${targetWindowName} via postMessage`, request.id);
6666
+ logger(`Sending message %i to ${targetWindowName} via postMessage`, request.uuidAsString);
6607
6667
  targetWindow.postMessage(request, targetOrigin);
6608
6668
  }
6609
6669
  else {
6610
- logger(`Adding message %i to ${targetWindowName} message queue`, request.id);
6611
- getTargetMessageQueue(targetWindow).push(request);
6670
+ logger(`Adding message %i to ${targetWindowName} message queue`, request.uuidAsString);
6671
+ getTargetMessageQueue(targetWindow).push(messageRequest);
6612
6672
  }
6613
6673
  }
6614
- return request;
6674
+ return messageRequest;
6615
6675
  }
6616
6676
  const sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');
6617
6677
  /**
@@ -6622,8 +6682,7 @@ function sendMessageToParentHelper(apiVersionTag, actionName, args) {
6622
6682
  const logger = sendMessageToParentHelperLogger;
6623
6683
  const targetWindow = Communication.parentWindow;
6624
6684
  const request = createMessageRequest(apiVersionTag, actionName, args);
6625
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6626
- logger('Message %i information: %o', request.id, { actionName, args });
6685
+ logger('Message %i information: %o', request.uuid, { actionName, args });
6627
6686
  return sendRequestToTargetWindowHelper(targetWindow, request);
6628
6687
  }
6629
6688
  const processMessageLogger = communicationLogger.extend('processMessage');
@@ -6787,6 +6846,70 @@ function updateRelationships(messageSource, messageOrigin) {
6787
6846
  flushMessageQueue(Communication.childWindow);
6788
6847
  }
6789
6848
  const handleParentMessageLogger = communicationLogger.extend('handleParentMessage');
6849
+ /**
6850
+ * @internal
6851
+ * Limited to Microsoft-internal use
6852
+ */
6853
+ function retrieveMessageUUIDFromResponse(response) {
6854
+ var _a;
6855
+ const logger = handleParentMessageLogger;
6856
+ if (response.uuid) {
6857
+ const responseUUID = response.uuid;
6858
+ const callbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.callbacks, responseUUID);
6859
+ if (callbackUUID) {
6860
+ return callbackUUID;
6861
+ }
6862
+ const promiseCallbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.promiseCallbacks, responseUUID);
6863
+ if (promiseCallbackUUID) {
6864
+ return promiseCallbackUUID;
6865
+ }
6866
+ const portCallbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.portCallbacks, responseUUID);
6867
+ if (portCallbackUUID) {
6868
+ return portCallbackUUID;
6869
+ }
6870
+ }
6871
+ else {
6872
+ return CommunicationPrivate.legacyMessageIdsToUuidMap[response.id];
6873
+ }
6874
+ logger(`Received a message with uuid: ${(_a = response.uuid) === null || _a === void 0 ? void 0 : _a.toString()} and legacyId: %i that failed to produce a callbackId`, response.id);
6875
+ return undefined;
6876
+ }
6877
+ /**
6878
+ * @internal
6879
+ * Limited to Microsoft-internal use
6880
+ *
6881
+ * This function is used to compare a new MessageUUID object value to the key values in the specified callback and retrieving that key
6882
+ * We use this because two objects with the same value are not considered equivalent therefore we can't use the new MessageUUID object
6883
+ * as a key to retrieve the value assosciated with it and should use this function instead.
6884
+ */
6885
+ function retrieveMessageUUIDFromCallback(map, responseUUID) {
6886
+ if (responseUUID) {
6887
+ const callback = [...map].find(([key, _value]) => {
6888
+ return key.toString() === responseUUID.toString();
6889
+ });
6890
+ if (callback) {
6891
+ return callback[0];
6892
+ }
6893
+ }
6894
+ return undefined;
6895
+ }
6896
+ /**
6897
+ * @internal
6898
+ * Limited to Microsoft-internal use
6899
+ */
6900
+ function removeMessageHandlers(message, map) {
6901
+ const callbackId = retrieveMessageUUIDFromCallback(map, message.uuid);
6902
+ if (callbackId) {
6903
+ map.delete(callbackId);
6904
+ }
6905
+ if (!message.uuid) {
6906
+ delete CommunicationPrivate.legacyMessageIdsToUuidMap[message.id];
6907
+ }
6908
+ else {
6909
+ //If we are here, then the parent is capable of sending UUIDs, therefore free up memory
6910
+ CommunicationPrivate.legacyMessageIdsToUuidMap = {};
6911
+ }
6912
+ }
6790
6913
  /**
6791
6914
  * @internal
6792
6915
  * Limited to Microsoft-internal use
@@ -6795,37 +6918,44 @@ function handleParentMessage(evt) {
6795
6918
  const logger = handleParentMessageLogger;
6796
6919
  if ('id' in evt.data && typeof evt.data.id === 'number') {
6797
6920
  // Call any associated Communication.callbacks
6798
- const message = evt.data;
6799
- const callback = CommunicationPrivate.callbacks[message.id];
6800
- logger('Received a response from parent for message %i', message.id);
6801
- if (callback) {
6802
- logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);
6803
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6804
- // @ts-ignore
6805
- callback.apply(null, [...message.args, message.isPartialResponse]);
6806
- // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response
6807
- if (!isPartialResponse(evt)) {
6808
- logger('Removing registered callback for message %i', message.id);
6809
- delete CommunicationPrivate.callbacks[message.id];
6921
+ const serializedResponse = evt.data;
6922
+ const message = deserializeMessageResponse(serializedResponse);
6923
+ const callbackId = retrieveMessageUUIDFromResponse(message);
6924
+ if (callbackId) {
6925
+ const callback = CommunicationPrivate.callbacks.get(callbackId);
6926
+ logger('Received a response from parent for message %i', callbackId);
6927
+ if (callback) {
6928
+ logger('Invoking the registered callback for message %i with arguments %o', callbackId, message.args);
6929
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6930
+ // @ts-ignore
6931
+ callback.apply(null, [...message.args, message.isPartialResponse]);
6932
+ // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response
6933
+ if (!isPartialResponse(evt)) {
6934
+ logger('Removing registered callback for message %i', callbackId);
6935
+ removeMessageHandlers(message, CommunicationPrivate.callbacks);
6936
+ }
6810
6937
  }
6811
- }
6812
- const promiseCallback = CommunicationPrivate.promiseCallbacks[message.id];
6813
- if (promiseCallback) {
6814
- logger('Invoking the registered promise callback for message %i with arguments %o', message.id, message.args);
6815
- promiseCallback(message.args);
6816
- logger('Removing registered promise callback for message %i', message.id);
6817
- delete CommunicationPrivate.promiseCallbacks[message.id];
6818
- }
6819
- const portCallback = CommunicationPrivate.portCallbacks[message.id];
6820
- if (portCallback) {
6821
- logger('Invoking the registered port callback for message %i with arguments %o', message.id, message.args);
6822
- let port;
6823
- if (evt.ports && evt.ports[0] instanceof MessagePort) {
6824
- port = evt.ports[0];
6938
+ const promiseCallback = CommunicationPrivate.promiseCallbacks.get(callbackId);
6939
+ if (promiseCallback) {
6940
+ logger('Invoking the registered promise callback for message %i with arguments %o', callbackId, message.args);
6941
+ promiseCallback(message.args);
6942
+ logger('Removing registered promise callback for message %i', callbackId);
6943
+ removeMessageHandlers(message, CommunicationPrivate.promiseCallbacks);
6944
+ }
6945
+ const portCallback = CommunicationPrivate.portCallbacks.get(callbackId);
6946
+ if (portCallback) {
6947
+ logger('Invoking the registered port callback for message %i with arguments %o', callbackId, message.args);
6948
+ let port;
6949
+ if (evt.ports && evt.ports[0] instanceof MessagePort) {
6950
+ port = evt.ports[0];
6951
+ }
6952
+ portCallback(port, message.args);
6953
+ logger('Removing registered port callback for message %i', callbackId);
6954
+ removeMessageHandlers(message, CommunicationPrivate.portCallbacks);
6955
+ }
6956
+ if (message.uuid) {
6957
+ CommunicationPrivate.legacyMessageIdsToUuidMap = {};
6825
6958
  }
6826
- portCallback(port, message.args);
6827
- logger('Removing registered port callback for message %i', message.id);
6828
- delete CommunicationPrivate.portCallbacks[message.id];
6829
6959
  }
6830
6960
  }
6831
6961
  else if ('func' in evt.data && typeof evt.data.func === 'string') {
@@ -6852,12 +6982,12 @@ function isPartialResponse(evt) {
6852
6982
  function handleChildMessage(evt) {
6853
6983
  if ('id' in evt.data && 'func' in evt.data) {
6854
6984
  // Try to delegate the request to the proper handler, if defined
6855
- const message = evt.data;
6985
+ const message = deserializeMessageRequest(evt.data);
6856
6986
  const [called, result] = callHandler(message.func, message.args);
6857
6987
  if (called && typeof result !== 'undefined') {
6858
6988
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6859
6989
  // @ts-ignore
6860
- sendMessageResponseToChild(message.id, Array.isArray(result) ? result : [result]);
6990
+ sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
6861
6991
  }
6862
6992
  else {
6863
6993
  // No handler, proxy to parent
@@ -6866,7 +6996,7 @@ function handleChildMessage(evt) {
6866
6996
  const isPartialResponse = args.pop();
6867
6997
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6868
6998
  // @ts-ignore
6869
- sendMessageResponseToChild(message.id, args, isPartialResponse);
6999
+ sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
6870
7000
  }
6871
7001
  });
6872
7002
  }
@@ -6947,10 +7077,13 @@ function flushMessageQueue(targetWindow) {
6947
7077
  const targetMessageQueue = getTargetMessageQueue(targetWindow);
6948
7078
  const target = getTargetName(targetWindow);
6949
7079
  while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
6950
- const request = targetMessageQueue.shift();
6951
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6952
- flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request === null || request === void 0 ? void 0 : request.id);
6953
- targetWindow.postMessage(request, targetOrigin);
7080
+ const messageRequest = targetMessageQueue.shift();
7081
+ if (messageRequest) {
7082
+ const request = serializeMessageRequest(messageRequest);
7083
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7084
+ flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request === null || request === void 0 ? void 0 : request.uuidAsString);
7085
+ targetWindow.postMessage(request, targetOrigin);
7086
+ }
6954
7087
  }
6955
7088
  }
6956
7089
  /**
@@ -6976,12 +7109,13 @@ function waitForMessageQueue(targetWindow, callback) {
6976
7109
  * @internal
6977
7110
  * Limited to Microsoft-internal use
6978
7111
  */
6979
- function sendMessageResponseToChild(id, args, isPartialResponse) {
7112
+ function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
6980
7113
  const targetWindow = Communication.childWindow;
6981
- const response = createMessageResponse(id, args, isPartialResponse);
7114
+ const response = createMessageResponse(id, uuid, args, isPartialResponse);
7115
+ const serializedResponse = serializeMessageResponse(response);
6982
7116
  const targetOrigin = getTargetOrigin(targetWindow);
6983
7117
  if (targetWindow && targetOrigin) {
6984
- targetWindow.postMessage(response, targetOrigin);
7118
+ targetWindow.postMessage(serializedResponse, targetOrigin);
6985
7119
  }
6986
7120
  }
6987
7121
  /**
@@ -7011,8 +7145,12 @@ function sendMessageEventToChild(actionName, args) {
7011
7145
  * Limited to Microsoft-internal use
7012
7146
  */
7013
7147
  function createMessageRequest(apiVersionTag, func, args) {
7148
+ const messageId = CommunicationPrivate.nextMessageId++;
7149
+ const messageUuid = new UUID();
7150
+ CommunicationPrivate.legacyMessageIdsToUuidMap[messageId] = messageUuid;
7014
7151
  return {
7015
- id: CommunicationPrivate.nextMessageId++,
7152
+ id: messageId,
7153
+ uuid: messageUuid,
7016
7154
  func: func,
7017
7155
  timestamp: Date.now(),
7018
7156
  args: args || [],
@@ -7031,8 +7169,12 @@ function createMessageRequest(apiVersionTag, func, args) {
7031
7169
  * @returns {NestedAppAuthRequest} Returns a NestedAppAuthRequest object with a unique id, the function name set to 'nestedAppAuthRequest', the current timestamp, an empty args array, and the provided message as data.
7032
7170
  */
7033
7171
  function createNestedAppAuthRequest(message) {
7172
+ const messageId = CommunicationPrivate.nextMessageId++;
7173
+ const messageUuid = new UUID();
7174
+ CommunicationPrivate.legacyMessageIdsToUuidMap[messageId] = messageUuid;
7034
7175
  return {
7035
- id: CommunicationPrivate.nextMessageId++,
7176
+ id: messageId,
7177
+ uuid: messageUuid,
7036
7178
  func: 'nestedAppAuth.execute',
7037
7179
  timestamp: Date.now(),
7038
7180
  // Since this is a nested app auth request, we don't need to send any args.
@@ -7045,9 +7187,10 @@ function createNestedAppAuthRequest(message) {
7045
7187
  * @internal
7046
7188
  * Limited to Microsoft-internal use
7047
7189
  */
7048
- function createMessageResponse(id, args, isPartialResponse) {
7190
+ function createMessageResponse(id, uuid, args, isPartialResponse) {
7049
7191
  return {
7050
7192
  id: id,
7193
+ uuid: uuid,
7051
7194
  args: args || [],
7052
7195
  isPartialResponse,
7053
7196
  };