@microsoft/teams-js 2.4.2 → 2.5.0-beta.1

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.
@@ -1046,17 +1046,20 @@ __webpack_require__.d(__webpack_exports__, {
1046
1046
  "ActionObjectType": () => (/* reexport */ ActionObjectType),
1047
1047
  "ChannelType": () => (/* reexport */ ChannelType),
1048
1048
  "ChildAppWindow": () => (/* reexport */ ChildAppWindow),
1049
+ "ContainerState": () => (/* reexport */ ContainerState),
1049
1050
  "DialogDimension": () => (/* reexport */ DialogDimension),
1050
1051
  "ErrorCode": () => (/* reexport */ ErrorCode),
1051
1052
  "FileOpenPreference": () => (/* reexport */ FileOpenPreference),
1052
1053
  "FrameContexts": () => (/* reexport */ FrameContexts),
1053
1054
  "HostClientType": () => (/* reexport */ HostClientType),
1054
1055
  "HostName": () => (/* reexport */ HostName),
1056
+ "LiveShareHost": () => (/* reexport */ LiveShareHost),
1055
1057
  "NotificationTypes": () => (/* reexport */ NotificationTypes),
1056
1058
  "ParentAppWindow": () => (/* reexport */ ParentAppWindow),
1057
1059
  "SecondaryM365ContentIdName": () => (/* reexport */ SecondaryM365ContentIdName),
1058
1060
  "TaskModuleDimension": () => (/* reexport */ TaskModuleDimension),
1059
1061
  "TeamType": () => (/* reexport */ TeamType),
1062
+ "UserMeetingRole": () => (/* reexport */ UserMeetingRole),
1060
1063
  "UserSettingTypes": () => (/* reexport */ UserSettingTypes),
1061
1064
  "UserTeamRole": () => (/* reexport */ UserTeamRole),
1062
1065
  "ViewerActionTypes": () => (/* reexport */ ViewerActionTypes),
@@ -1130,7 +1133,7 @@ __webpack_require__.d(__webpack_exports__, {
1130
1133
  });
1131
1134
 
1132
1135
  ;// CONCATENATED MODULE: ./src/public/version.ts
1133
- var version = "2.4.2";
1136
+ var version = "2.5.0-beta.1";
1134
1137
 
1135
1138
  ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1136
1139
  var GlobalVars = /** @class */ (function () {
@@ -1477,13 +1480,17 @@ var validOrigins = [
1477
1480
  'outlook-sdf.office.com',
1478
1481
  'outlook.office365.com',
1479
1482
  'outlook-sdf.office365.com',
1483
+ 'outlook.live.com',
1484
+ 'outlook-sdf.live.com',
1480
1485
  '*.teams.microsoft.com',
1486
+ '*.www.office.com',
1481
1487
  'www.office.com',
1482
1488
  'word.office.com',
1483
1489
  'excel.office.com',
1484
1490
  'powerpoint.office.com',
1485
1491
  'www.officeppe.com',
1486
- '*.www.office.com',
1492
+ '*.www.microsoft365.com',
1493
+ 'www.microsoft365.com',
1487
1494
  ];
1488
1495
  /**
1489
1496
  * @hidden
@@ -1510,6 +1517,21 @@ var teamsDeepLinkProtocol = 'https';
1510
1517
  */
1511
1518
  var teamsDeepLinkHost = 'teams.microsoft.com';
1512
1519
 
1520
+ // EXTERNAL MODULE: ./node_modules/debug/src/browser.js
1521
+ var browser = __webpack_require__(227);
1522
+ ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
1523
+
1524
+ var topLevelLogger = (0,browser.debug)('teamsJs');
1525
+ /**
1526
+ * @internal
1527
+ * Limited to Microsoft-internal use
1528
+ *
1529
+ * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
1530
+ */
1531
+ function getLogger(namespace) {
1532
+ return topLevelLogger.extend(namespace);
1533
+ }
1534
+
1513
1535
  // EXTERNAL MODULE: ../../node_modules/uuid/index.js
1514
1536
  var uuid = __webpack_require__(22);
1515
1537
  ;// CONCATENATED MODULE: ./src/internal/utils.ts
@@ -1843,7 +1865,33 @@ function createTeamsAppLink(params) {
1843
1865
 
1844
1866
 
1845
1867
 
1868
+
1869
+ var internalLogger = getLogger('internal');
1870
+ var ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');
1871
+ var ensureInitializedLogger = internalLogger.extend('ensureInitialized');
1872
+ /**
1873
+ * Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.
1874
+ *
1875
+ * `ensureInitializeCalled` should only be used for APIs which:
1876
+ * - work in all FrameContexts
1877
+ * - are part of a required Capability
1878
+ * - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself
1879
+ *
1880
+ * For most APIs {@link ensureInitialized} is the right validation function to use instead.
1881
+ *
1882
+ * @internal
1883
+ * Limited to Microsoft-internal use
1884
+ */
1885
+ function ensureInitializeCalled() {
1886
+ if (!GlobalVars.initializeCalled) {
1887
+ ensureInitializeCalledLogger('The library has not yet been initialized.');
1888
+ throw new Error('The library has not yet been initialized');
1889
+ }
1890
+ }
1846
1891
  /**
1892
+ * Ensures `initialize` was called and response from Host was received and processed.
1893
+ * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.
1894
+ *
1847
1895
  * @internal
1848
1896
  * Limited to Microsoft-internal use
1849
1897
  */
@@ -1852,10 +1900,11 @@ function ensureInitialized() {
1852
1900
  for (var _i = 0; _i < arguments.length; _i++) {
1853
1901
  expectedFrameContexts[_i] = arguments[_i];
1854
1902
  }
1855
- if (!GlobalVars.initializeCalled) {
1903
+ if (!GlobalVars.initializeCompleted) {
1904
+ ensureInitializedLogger('The library has not yet been initialized. initializeCalled: %s', GlobalVars.initializeCalled.toString());
1856
1905
  throw new Error('The library has not yet been initialized');
1857
1906
  }
1858
- if (GlobalVars.frameContext && expectedFrameContexts && expectedFrameContexts.length > 0) {
1907
+ if (expectedFrameContexts && expectedFrameContexts.length > 0) {
1859
1908
  var found = false;
1860
1909
  for (var i = 0; i < expectedFrameContexts.length; i++) {
1861
1910
  if (expectedFrameContexts[i] === GlobalVars.frameContext) {
@@ -1940,21 +1989,6 @@ function processAdditionalValidOrigins(validMessageOrigins) {
1940
1989
  GlobalVars.additionalValidOrigins = combinedOriginUrls;
1941
1990
  }
1942
1991
 
1943
- // EXTERNAL MODULE: ./node_modules/debug/src/browser.js
1944
- var browser = __webpack_require__(227);
1945
- ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
1946
-
1947
- var topLevelLogger = (0,browser.debug)('teamsJs');
1948
- /**
1949
- * @internal
1950
- * Limited to Microsoft-internal use
1951
- *
1952
- * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
1953
- */
1954
- function getLogger(namespace) {
1955
- return topLevelLogger.extend(namespace);
1956
- }
1957
-
1958
1992
  ;// CONCATENATED MODULE: ./src/public/authentication.ts
1959
1993
 
1960
1994
 
@@ -1965,8 +1999,6 @@ function getLogger(namespace) {
1965
1999
  * Namespace to interact with the authentication-specific part of the SDK.
1966
2000
  *
1967
2001
  * This object is used for starting or completing authentication flows.
1968
- *
1969
- * @beta
1970
2002
  */
1971
2003
  var authentication;
1972
2004
  (function (authentication) {
@@ -2069,7 +2101,7 @@ var authentication;
2069
2101
  });
2070
2102
  }
2071
2103
  function getAuthToken(authTokenRequest) {
2072
- ensureInitialized();
2104
+ ensureInitializeCalled();
2073
2105
  return getAuthTokenHelper(authTokenRequest)
2074
2106
  .then(function (value) {
2075
2107
  if (authTokenRequest && authTokenRequest.successCallback) {
@@ -2105,7 +2137,7 @@ var authentication;
2105
2137
  });
2106
2138
  }
2107
2139
  function getUser(userRequest) {
2108
- ensureInitialized();
2140
+ ensureInitializeCalled();
2109
2141
  return getUserHelper()
2110
2142
  .then(function (value) {
2111
2143
  if (userRequest && userRequest.successCallback) {
@@ -2477,6 +2509,10 @@ var versionConstants = {
2477
2509
  capability: { webStorage: {} },
2478
2510
  hostClientTypes: [HostClientType.desktop],
2479
2511
  },
2512
+ {
2513
+ capability: { profile: {} },
2514
+ hostClientTypes: [HostClientType.desktop, HostClientType.web],
2515
+ },
2480
2516
  ],
2481
2517
  '2.0.5': [
2482
2518
  {
@@ -2572,6 +2608,8 @@ var dialog;
2572
2608
  * Function is called during app initialization
2573
2609
  * @internal
2574
2610
  * Limited to Microsoft-internal use
2611
+ *
2612
+ * @beta
2575
2613
  */
2576
2614
  function initialize() {
2577
2615
  registerHandler('messageForChild', handleDialogMessage, false);
@@ -2601,6 +2639,8 @@ var dialog;
2601
2639
  * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2602
2640
  *
2603
2641
  * @returns a function that can be used to send messages to the dialog.
2642
+ *
2643
+ * @beta
2604
2644
  */
2605
2645
  function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2606
2646
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
@@ -2620,8 +2660,12 @@ var dialog;
2620
2660
  /**
2621
2661
  * Submit the dialog module and close the dialog
2622
2662
  *
2623
- * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2663
+ * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
2664
+ * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
2665
+ *
2624
2666
  * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
2667
+ *
2668
+ * @beta
2625
2669
  */
2626
2670
  function submit(result, appIds) {
2627
2671
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
@@ -2639,6 +2683,8 @@ var dialog;
2639
2683
  * This function is only called from inside of a dialog
2640
2684
  *
2641
2685
  * @param message - The message to send to the parent
2686
+ *
2687
+ * @beta
2642
2688
  */
2643
2689
  function sendMessageToParentFromDialog(
2644
2690
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2654,6 +2700,8 @@ var dialog;
2654
2700
  * Send message to the dialog from the parent
2655
2701
  *
2656
2702
  * @param message - The message to send
2703
+ *
2704
+ * @beta
2657
2705
  */
2658
2706
  function sendMessageToDialog(
2659
2707
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2672,6 +2720,8 @@ var dialog;
2672
2720
  * This function is only called from inside of a dialog.
2673
2721
  *
2674
2722
  * @param listener - The listener that will be triggered.
2723
+ *
2724
+ * @beta
2675
2725
  */
2676
2726
  function registerOnMessageFromParent(listener) {
2677
2727
  ensureInitialized(FrameContexts.task);
@@ -2694,6 +2744,8 @@ var dialog;
2694
2744
  * Checks if dialog module is supported by the host
2695
2745
  *
2696
2746
  * @returns boolean to represent whether dialog module is supported
2747
+ *
2748
+ * @beta
2697
2749
  */
2698
2750
  function isSupported() {
2699
2751
  return runtime.supports.dialog ? true : false;
@@ -2701,6 +2753,8 @@ var dialog;
2701
2753
  dialog.isSupported = isSupported;
2702
2754
  /**
2703
2755
  * Namespace to update the dialog
2756
+ *
2757
+ * @beta
2704
2758
  */
2705
2759
  var update;
2706
2760
  (function (update) {
@@ -2708,6 +2762,8 @@ var dialog;
2708
2762
  * Update dimensions - height/width of a dialog.
2709
2763
  *
2710
2764
  * @param dimensions - An object containing width and height properties.
2765
+ *
2766
+ * @beta
2711
2767
  */
2712
2768
  function resize(dimensions) {
2713
2769
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
@@ -2721,6 +2777,8 @@ var dialog;
2721
2777
  * Checks if dialog.update capability is supported by the host
2722
2778
  *
2723
2779
  * @returns boolean to represent whether dialog.update is supported
2780
+ *
2781
+ * @beta
2724
2782
  */
2725
2783
  function isSupported() {
2726
2784
  return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;
@@ -2729,6 +2787,8 @@ var dialog;
2729
2787
  })(update = dialog.update || (dialog.update = {}));
2730
2788
  /**
2731
2789
  * Namespace to open a dialog that sends results to the bot framework
2790
+ *
2791
+ * @beta
2732
2792
  */
2733
2793
  var bot;
2734
2794
  (function (bot) {
@@ -2740,6 +2800,8 @@ var dialog;
2740
2800
  * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2741
2801
  *
2742
2802
  * @returns a function that can be used to send messages to the dialog.
2803
+ *
2804
+ * @beta
2743
2805
  */
2744
2806
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
2745
2807
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
@@ -2760,6 +2822,8 @@ var dialog;
2760
2822
  * Checks if dialog.bot capability is supported by the host
2761
2823
  *
2762
2824
  * @returns boolean to represent whether dialog.bot is supported
2825
+ *
2826
+ * @beta
2763
2827
  */
2764
2828
  function isSupported() {
2765
2829
  return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;
@@ -2773,6 +2837,8 @@ var dialog;
2773
2837
  *
2774
2838
  * @internal
2775
2839
  * Limited to Microsoft-internal use
2840
+ *
2841
+ * @beta
2776
2842
  */
2777
2843
  function getDialogInfoFromUrlDialogInfo(urlDialogInfo) {
2778
2844
  var dialogInfo = {
@@ -2792,6 +2858,8 @@ var dialog;
2792
2858
  *
2793
2859
  * @internal
2794
2860
  * Limited to Microsoft-internal use
2861
+ *
2862
+ * @beta
2795
2863
  */
2796
2864
  function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo) {
2797
2865
  var dialogInfo = {
@@ -3013,7 +3081,8 @@ var teamsCore;
3013
3081
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3014
3082
  */
3015
3083
  function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
3016
- ensureInitialized();
3084
+ // allow for registration cleanup even when not finished initializing
3085
+ handler && ensureInitialized();
3017
3086
  if (versionSpecificHelper) {
3018
3087
  versionSpecificHelper();
3019
3088
  }
@@ -3049,7 +3118,8 @@ var teamsCore;
3049
3118
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3050
3119
  */
3051
3120
  function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
3052
- ensureInitialized();
3121
+ // allow for registration cleanup even when not finished initializing
3122
+ handler && ensureInitialized();
3053
3123
  if (versionSpecificHelper) {
3054
3124
  versionSpecificHelper();
3055
3125
  }
@@ -3089,8 +3159,6 @@ var teamsCore;
3089
3159
 
3090
3160
  /**
3091
3161
  * Namespace to interact with app initialization and lifecycle.
3092
- *
3093
- * @beta
3094
3162
  */
3095
3163
  var app_app;
3096
3164
  (function (app) {
@@ -3152,7 +3220,7 @@ var app_app;
3152
3220
  * @returns whether the Teams client SDK has been initialized.
3153
3221
  */
3154
3222
  function isInitialized() {
3155
- return GlobalVars.initializeCalled;
3223
+ return GlobalVars.initializeCompleted;
3156
3224
  }
3157
3225
  app.isInitialized = isInitialized;
3158
3226
  /**
@@ -3318,7 +3386,7 @@ var app_app;
3318
3386
  */
3319
3387
  function getContext() {
3320
3388
  return new Promise(function (resolve) {
3321
- ensureInitialized();
3389
+ ensureInitializeCalled();
3322
3390
  resolve(sendAndUnwrap('getContext'));
3323
3391
  }).then(function (legacyContext) { return transformLegacyContextToAppContext(legacyContext); }); // converts globalcontext to app.context
3324
3392
  }
@@ -3327,7 +3395,7 @@ var app_app;
3327
3395
  * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
3328
3396
  */
3329
3397
  function notifyAppLoaded() {
3330
- ensureInitialized();
3398
+ ensureInitializeCalled();
3331
3399
  sendMessageToParent(app.Messages.AppLoaded, [version]);
3332
3400
  }
3333
3401
  app.notifyAppLoaded = notifyAppLoaded;
@@ -3335,7 +3403,7 @@ var app_app;
3335
3403
  * Notifies the frame that app initialization is successful and is ready for user interaction.
3336
3404
  */
3337
3405
  function notifySuccess() {
3338
- ensureInitialized();
3406
+ ensureInitializeCalled();
3339
3407
  sendMessageToParent(app.Messages.Success, [version]);
3340
3408
  }
3341
3409
  app.notifySuccess = notifySuccess;
@@ -3346,7 +3414,7 @@ var app_app;
3346
3414
  * during initialization as well as an optional message.
3347
3415
  */
3348
3416
  function notifyFailure(appInitializationFailedRequest) {
3349
- ensureInitialized();
3417
+ ensureInitializeCalled();
3350
3418
  sendMessageToParent(app.Messages.Failure, [
3351
3419
  appInitializationFailedRequest.reason,
3352
3420
  appInitializationFailedRequest.message,
@@ -3359,7 +3427,7 @@ var app_app;
3359
3427
  * @param expectedFailureRequest - The expected failure request containing the reason and an optional message
3360
3428
  */
3361
3429
  function notifyExpectedFailure(expectedFailureRequest) {
3362
- ensureInitialized();
3430
+ ensureInitializeCalled();
3363
3431
  sendMessageToParent(app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
3364
3432
  }
3365
3433
  app.notifyExpectedFailure = notifyExpectedFailure;
@@ -3372,7 +3440,8 @@ var app_app;
3372
3440
  * @param handler - The handler to invoke when the user changes their theme.
3373
3441
  */
3374
3442
  function registerOnThemeChangeHandler(handler) {
3375
- ensureInitialized();
3443
+ // allow for registration cleanup even when not called initialize
3444
+ handler && ensureInitializeCalled();
3376
3445
  handlers_registerOnThemeChangeHandler(handler);
3377
3446
  }
3378
3447
  app.registerOnThemeChangeHandler = registerOnThemeChangeHandler;
@@ -3501,14 +3570,14 @@ function transformLegacyContextToAppContext(legacyContext) {
3501
3570
 
3502
3571
  /**
3503
3572
  * Navigation-specific part of the SDK.
3504
- *
3505
- * @beta
3506
3573
  */
3507
3574
  var pages;
3508
3575
  (function (pages) {
3509
3576
  /**
3510
3577
  * Return focus to the host. Will move focus forward or backward based on where the application container falls in
3511
3578
  * the F6/tab order in the host.
3579
+ * On mobile hosts or hosts where there is no keyboard interaction or UI notion of "focus" this function has no
3580
+ * effect and will be a no-op when called.
3512
3581
  * @param navigateForward - Determines the direction to focus in host.
3513
3582
  */
3514
3583
  function returnFocus(navigateForward) {
@@ -3523,6 +3592,8 @@ var pages;
3523
3592
  * @hidden
3524
3593
  *
3525
3594
  * Registers a handler for specifying focus when it passes from the host to the application.
3595
+ * On mobile hosts or hosts where there is no UI notion of "focus" the handler registered with
3596
+ * this function will never be called.
3526
3597
  *
3527
3598
  * @param handler - The handler for placing focus within the application.
3528
3599
  *
@@ -3625,6 +3696,7 @@ var pages;
3625
3696
  pages.navigateToApp = navigateToApp;
3626
3697
  /**
3627
3698
  * Shares a deep link that a user can use to navigate back to a specific state in this page.
3699
+ * Please note that this method does yet work on mobile hosts.
3628
3700
  *
3629
3701
  * @param deepLinkParameters - ID and label for the link and fallback URL.
3630
3702
  */
@@ -3643,6 +3715,8 @@ var pages;
3643
3715
  /**
3644
3716
  * Registers a handler for changes from or to full-screen view for a tab.
3645
3717
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
3718
+ * On hosts where there is no support for making an app full screen, the handler registered
3719
+ * with this function will never be called.
3646
3720
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
3647
3721
  */
3648
3722
  function registerFullScreenHandler(handler) {
@@ -3803,7 +3877,8 @@ var pages;
3803
3877
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3804
3878
  */
3805
3879
  function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
3806
- ensureInitialized(FrameContexts.settings);
3880
+ // allow for registration cleanup even when not finished initializing
3881
+ handler && ensureInitialized(FrameContexts.settings);
3807
3882
  if (versionSpecificHelper) {
3808
3883
  versionSpecificHelper();
3809
3884
  }
@@ -3837,7 +3912,8 @@ var pages;
3837
3912
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3838
3913
  */
3839
3914
  function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
3840
- ensureInitialized(FrameContexts.remove, FrameContexts.settings);
3915
+ // allow for registration cleanup even when not finished initializing
3916
+ handler && ensureInitialized(FrameContexts.remove, FrameContexts.settings);
3841
3917
  if (versionSpecificHelper) {
3842
3918
  versionSpecificHelper();
3843
3919
  }
@@ -3995,7 +4071,8 @@ var pages;
3995
4071
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3996
4072
  */
3997
4073
  function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
3998
- ensureInitialized();
4074
+ // allow for registration cleanup even when not finished initializing
4075
+ handler && ensureInitialized();
3999
4076
  if (versionSpecificHelper) {
4000
4077
  versionSpecificHelper();
4001
4078
  }
@@ -4281,7 +4358,8 @@ function doesHandlerExist(name) {
4281
4358
  * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
4282
4359
  */
4283
4360
  function registerHandlerHelper(name, handler, contexts, registrationHelper) {
4284
- ensureInitialized.apply(void 0, contexts);
4361
+ // allow for registration cleanup even when not finished initializing
4362
+ handler && ensureInitialized.apply(void 0, contexts);
4285
4363
  if (registrationHelper) {
4286
4364
  registrationHelper();
4287
4365
  }
@@ -4731,7 +4809,6 @@ function handleChildMessage(evt) {
4731
4809
  }
4732
4810
  else {
4733
4811
  // No handler, proxy to parent
4734
- // tslint:disable-next-line:no-any
4735
4812
  sendMessageToParent(message_1.func, message_1.args, function () {
4736
4813
  var args = [];
4737
4814
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -4803,9 +4880,7 @@ function waitForMessageQueue(targetWindow, callback) {
4803
4880
  * @internal
4804
4881
  * Limited to Microsoft-internal use
4805
4882
  */
4806
- function sendMessageResponseToChild(id,
4807
- // tslint:disable-next-line:no-any
4808
- args, isPartialResponse) {
4883
+ function sendMessageResponseToChild(id, args, isPartialResponse) {
4809
4884
  var targetWindow = Communication.childWindow;
4810
4885
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4811
4886
  var response = createMessageResponse(id, args, isPartialResponse);
@@ -4822,9 +4897,7 @@ args, isPartialResponse) {
4822
4897
  * @internal
4823
4898
  * Limited to Microsoft-internal use
4824
4899
  */
4825
- function sendMessageEventToChild(actionName,
4826
- // tslint:disable-next-line: no-any
4827
- args) {
4900
+ function sendMessageEventToChild(actionName, args) {
4828
4901
  var targetWindow = Communication.childWindow;
4829
4902
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4830
4903
  var customEvent = createMessageEvent(actionName, args);
@@ -4842,7 +4915,6 @@ args) {
4842
4915
  * @internal
4843
4916
  * Limited to Microsoft-internal use
4844
4917
  */
4845
- // tslint:disable-next-line:no-any
4846
4918
  function createMessageRequest(func, args) {
4847
4919
  return {
4848
4920
  id: CommunicationPrivate.nextMessageId++,
@@ -4855,7 +4927,6 @@ function createMessageRequest(func, args) {
4855
4927
  * @internal
4856
4928
  * Limited to Microsoft-internal use
4857
4929
  */
4858
- // tslint:disable-next-line:no-any
4859
4930
  function createMessageResponse(id, args, isPartialResponse) {
4860
4931
  return {
4861
4932
  id: id,
@@ -4870,7 +4941,6 @@ function createMessageResponse(id, args, isPartialResponse) {
4870
4941
  * @internal
4871
4942
  * Limited to Microsoft-internal use
4872
4943
  */
4873
- // tslint:disable-next-line:no-any
4874
4944
  function createMessageEvent(func, args) {
4875
4945
  return {
4876
4946
  func: func,
@@ -4905,7 +4975,8 @@ var logs;
4905
4975
  * Limited to Microsoft-internal use
4906
4976
  */
4907
4977
  function registerGetLogHandler(handler) {
4908
- ensureInitialized();
4978
+ // allow for registration cleanup even when not finished initializing
4979
+ handler && ensureInitialized();
4909
4980
  if (!isSupported()) {
4910
4981
  throw errorNotSupportedOnPlatform;
4911
4982
  }
@@ -5014,11 +5085,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
5014
5085
  * @internal
5015
5086
  * Limited to Microsoft-internal use
5016
5087
  */
5017
- function sendCustomMessage(actionName,
5018
- // tslint:disable-next-line:no-any
5019
- args,
5020
- // tslint:disable-next-line:no-any
5021
- callback) {
5088
+ function sendCustomMessage(actionName, args, callback) {
5022
5089
  ensureInitialized();
5023
5090
  sendMessageToParent(actionName, args, callback);
5024
5091
  }
@@ -5034,9 +5101,7 @@ callback) {
5034
5101
  * @internal
5035
5102
  * Limited to Microsoft-internal use
5036
5103
  */
5037
- function sendCustomEvent(actionName,
5038
- // tslint:disable-next-line:no-any
5039
- args) {
5104
+ function sendCustomEvent(actionName, args) {
5040
5105
  ensureInitialized();
5041
5106
  //validate childWindow
5042
5107
  if (!Communication.childWindow) {
@@ -6102,6 +6167,8 @@ var chat;
6102
6167
  * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
6103
6168
  *
6104
6169
  * @returns Promise resolved upon completion
6170
+ *
6171
+ * @beta
6105
6172
  */
6106
6173
  function openChat(openChatRequest) {
6107
6174
  return new Promise(function (resolve) {
@@ -6130,6 +6197,8 @@ var chat;
6130
6197
  * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).
6131
6198
  *
6132
6199
  * @returns Promise resolved upon completion
6200
+ *
6201
+ * @beta
6133
6202
  */
6134
6203
  function openGroupChat(openChatRequest) {
6135
6204
  return new Promise(function (resolve) {
@@ -6163,6 +6232,13 @@ var chat;
6163
6232
  });
6164
6233
  }
6165
6234
  chat.openGroupChat = openGroupChat;
6235
+ /**
6236
+ * Checks if chat capability is supported by the host
6237
+ *
6238
+ * @returns boolean to represent whether the chat capability is supported
6239
+ *
6240
+ * @beta
6241
+ */
6166
6242
  function isSupported() {
6167
6243
  return runtime.supports.chat ? true : false;
6168
6244
  }
@@ -7015,6 +7091,8 @@ var profile;
7015
7091
  * Opens a profile card at a specified position to show profile information about a persona.
7016
7092
  * @param showProfileRequest The parameters to position the card and identify the target user.
7017
7093
  * @returns Promise that will be fulfilled when the operation has completed
7094
+ *
7095
+ * @beta
7018
7096
  */
7019
7097
  function showProfile(showProfileRequest) {
7020
7098
  ensureInitialized(FrameContexts.content);
@@ -7039,6 +7117,17 @@ var profile;
7039
7117
  });
7040
7118
  }
7041
7119
  profile.showProfile = showProfile;
7120
+ /**
7121
+ * An internal representation of the showProfile parameters suitable for sending via postMessage.
7122
+ * The hub expects to receive an object of this type.
7123
+ */
7124
+ /**
7125
+ * Checks if the profile capability is supported by the host
7126
+ *
7127
+ * @returns boolean to represent whether the profile capability is supported
7128
+ *
7129
+ * @beta
7130
+ */
7042
7131
  function isSupported() {
7043
7132
  return runtime.supports.profile ? true : false;
7044
7133
  }
@@ -7630,7 +7719,7 @@ function print() {
7630
7719
  * @param callback - The callback to invoke when the {@link Context} object is retrieved.
7631
7720
  */
7632
7721
  function getContext(callback) {
7633
- ensureInitialized();
7722
+ ensureInitializeCalled();
7634
7723
  app_app.getContext().then(function (context) {
7635
7724
  if (callback) {
7636
7725
  callback(transformAppContextToLegacyContext(context));
@@ -8248,6 +8337,175 @@ var tasks;
8248
8337
  tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
8249
8338
  })(tasks || (tasks = {}));
8250
8339
 
8340
+ ;// CONCATENATED MODULE: ./src/public/liveShareHost.ts
8341
+
8342
+
8343
+
8344
+ /**
8345
+ * @hidden
8346
+ * Allowed roles during a meeting.
8347
+ *
8348
+ * @beta
8349
+ */
8350
+ var UserMeetingRole;
8351
+ (function (UserMeetingRole) {
8352
+ UserMeetingRole["guest"] = "Guest";
8353
+ UserMeetingRole["attendee"] = "Attendee";
8354
+ UserMeetingRole["presenter"] = "Presenter";
8355
+ UserMeetingRole["organizer"] = "Organizer";
8356
+ })(UserMeetingRole || (UserMeetingRole = {}));
8357
+ /**
8358
+ * @hidden
8359
+ * State of the current Live Share sessions backing fluid container.
8360
+ *
8361
+ * @beta
8362
+ */
8363
+ var ContainerState;
8364
+ (function (ContainerState) {
8365
+ /**
8366
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
8367
+ * for the current Live Share session.
8368
+ */
8369
+ ContainerState["added"] = "Added";
8370
+ /**
8371
+ * A container mapping for the current Live Share Session already exists and should be used
8372
+ * when joining the sessions Fluid container.
8373
+ */
8374
+ ContainerState["alreadyExists"] = "AlreadyExists";
8375
+ /**
8376
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
8377
+ * another client having already set the container ID for the current Live Share session.
8378
+ */
8379
+ ContainerState["conflict"] = "Conflict";
8380
+ /**
8381
+ * A container mapping for the current Live Share session doesn't exist yet.
8382
+ */
8383
+ ContainerState["notFound"] = "NotFound";
8384
+ })(ContainerState || (ContainerState = {}));
8385
+ /**
8386
+ * Live Share host implementation for O365 and Teams clients.
8387
+ *
8388
+ * @beta
8389
+ */
8390
+ var LiveShareHost = /** @class */ (function () {
8391
+ function LiveShareHost() {
8392
+ }
8393
+ /**
8394
+ * @hidden
8395
+ * Returns the Fluid Tenant connection info for user's current context.
8396
+ *
8397
+ * @beta
8398
+ */
8399
+ LiveShareHost.prototype.getFluidTenantInfo = function () {
8400
+ return new Promise(function (resolve) {
8401
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8402
+ resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8403
+ });
8404
+ };
8405
+ /**
8406
+ * @hidden
8407
+ * Returns the fluid access token for mapped container Id.
8408
+ *
8409
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
8410
+ * @returns token for connecting to Fluid's session.
8411
+ *
8412
+ * @beta
8413
+ */
8414
+ LiveShareHost.prototype.getFluidToken = function (containerId) {
8415
+ return new Promise(function (resolve) {
8416
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8417
+ // eslint-disable-next-line strict-null-checks/all
8418
+ resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8419
+ });
8420
+ };
8421
+ /**
8422
+ * @hidden
8423
+ * Returns the ID of the fluid container associated with the user's current context.
8424
+ *
8425
+ * @beta
8426
+ */
8427
+ LiveShareHost.prototype.getFluidContainerId = function () {
8428
+ return new Promise(function (resolve) {
8429
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8430
+ resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8431
+ });
8432
+ };
8433
+ /**
8434
+ * @hidden
8435
+ * Sets the ID of the fluid container associated with the current context.
8436
+ *
8437
+ * @remarks
8438
+ * If this returns false, the client should delete the container they created and then call
8439
+ * `getFluidContainerId()` to get the ID of the container being used.
8440
+ * @param containerId ID of the fluid container the client created.
8441
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
8442
+ *
8443
+ * @beta
8444
+ */
8445
+ LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8446
+ return new Promise(function (resolve) {
8447
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8448
+ resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8449
+ });
8450
+ };
8451
+ /**
8452
+ * @hidden
8453
+ * Returns the shared clock server's current time.
8454
+ *
8455
+ * @beta
8456
+ */
8457
+ LiveShareHost.prototype.getNtpTime = function () {
8458
+ return new Promise(function (resolve) {
8459
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8460
+ resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8461
+ });
8462
+ };
8463
+ /**
8464
+ * @hidden
8465
+ * Associates the fluid client ID with a set of user roles.
8466
+ *
8467
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
8468
+ * @returns The roles for the current user.
8469
+ *
8470
+ * @beta
8471
+ */
8472
+ LiveShareHost.prototype.registerClientId = function (clientId) {
8473
+ return new Promise(function (resolve) {
8474
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8475
+ resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8476
+ });
8477
+ };
8478
+ /**
8479
+ * @hidden
8480
+ * Returns the roles associated with a client ID.
8481
+ *
8482
+ * @param clientId The Client ID the message was received from.
8483
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
8484
+ *
8485
+ * @beta
8486
+ */
8487
+ LiveShareHost.prototype.getClientRoles = function (clientId) {
8488
+ return new Promise(function (resolve) {
8489
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8490
+ resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8491
+ });
8492
+ };
8493
+ /**
8494
+ * Returns a host instance for the client that can be passed to the `LiveShareClient` class.
8495
+ *
8496
+ * @remarks
8497
+ * The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.
8498
+ *
8499
+ * @beta
8500
+ */
8501
+ LiveShareHost.create = function () {
8502
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8503
+ return new LiveShareHost();
8504
+ };
8505
+ return LiveShareHost;
8506
+ }());
8507
+
8508
+
8251
8509
  ;// CONCATENATED MODULE: ./src/public/index.ts
8252
8510
 
8253
8511
 
@@ -8280,6 +8538,7 @@ var tasks;
8280
8538
 
8281
8539
 
8282
8540
 
8541
+
8283
8542
 
8284
8543
 
8285
8544