@microsoft/teams-js 2.20.0-beta.2 → 2.20.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4128,6 +4128,10 @@ export interface ClipboardParams {
4128
4128
  }
4129
4129
 
4130
4130
  export function appInitializeHelper(apiVersionTag: string, validMessageOrigins?: string[]): Promise<void>;
4131
+ export function notifyAppLoadedHelper(apiVersionTag: string): void;
4132
+ export function notifyExpectedFailureHelper(apiVersionTag: string, expectedFailureRequest: app.IExpectedFailureRequest): void;
4133
+ export function notifyFailureHelper(apiVersiontag: string, appInitializationFailedRequest: app.IFailedRequest): void;
4134
+ export function notifySuccessHelper(apiVersionTag: string): void;
4131
4135
  export function registerOnThemeChangeHandlerHelper(apiVersionTag: string, handler: app.themeHandler): void;
4132
4136
  export function openLinkHelper(apiVersionTag: string, deepLink: string): Promise<void>;
4133
4137
  /**
@@ -4224,7 +4228,7 @@ export namespace app {
4224
4228
  */
4225
4229
  locale: string;
4226
4230
  /**
4227
- * The current UI theme of the host. Possible values: "default", "dark", or "contrast".
4231
+ * The current UI theme of the host. Possible values: "default", "dark", "contrast" or "glass".
4228
4232
  */
4229
4233
  theme: string;
4230
4234
  /**
@@ -8546,10 +8550,6 @@ export namespace call {
8546
8550
  function isSupported(): boolean;
8547
8551
  }
8548
8552
 
8549
- /**
8550
- * @deprecated
8551
- * As of 2.0.0, please use {@link app} namespace instead.
8552
- */
8553
8553
  export namespace appInitialization {
8554
8554
  /**
8555
8555
  * @deprecated
@@ -990,7 +990,16 @@ var ApiName;
990
990
  ApiName["App_NotifySuccess"] = "app.notifySuccess";
991
991
  ApiName["App_OpenLink"] = "app.openLink";
992
992
  ApiName["App_RegisterOnThemeChangeHandler"] = "app.registerOnThemeChangeHandler";
993
+ ApiName["AppInitialization_NotifyAppLoaded"] = "appInitialization.notifyAppLoaded";
994
+ ApiName["AppInitialization_NotifyExpectedFailure"] = "appInitialization.notifyExpectedFailure";
995
+ ApiName["AppInitialization_NotifyFailure"] = "appInitialization.notifyFailure";
996
+ ApiName["AppInitialization_NotifySuccess"] = "appInitialization.notifySuccess";
993
997
  ApiName["AppEntity_SelectAppEntity"] = "appEntity.selectAppEntity";
998
+ ApiName["AppInstallDialog_OpenAppInstallDialog"] = "appInstallDialog.openAppInstallDialog";
999
+ ApiName["AppWindow_ChildAppWindow_AddEventListener"] = "appWindow.childAppWindow.addEventListener";
1000
+ ApiName["AppWindow_ChildAppWindow_PostMessage"] = "appWindow.childAppWindow.postMessage";
1001
+ ApiName["AppWindow_ParentAppWindow_AddEventListener"] = "appWindow.parentAppWindow.addEventListener";
1002
+ ApiName["AppWindow_ParentAppWindow_PostMessage"] = "appWindow.parentAppWindow.postMessage";
994
1003
  ApiName["BarCode_HasPermission"] = "barCode.hasPermission";
995
1004
  ApiName["BarCode_RequestPermission"] = "barCode.requestPermission";
996
1005
  ApiName["BarCode_ScanBarCode"] = "barCode.scanBarCode";
@@ -1155,6 +1164,8 @@ var ApiName;
1155
1164
  ApiName["PublicAPIs_SetFrameContext"] = "setFrameContext";
1156
1165
  ApiName["PublicAPIs_ShareDeepLink"] = "shareDeepLink";
1157
1166
  ApiName["RegisterHandler"] = "registerHandler";
1167
+ ApiName["RegisterBeforeUnloadHandler"] = "registerBeforeUnloadHandler";
1168
+ ApiName["RegisterLoadHandler"] = "registerLoadHandler";
1158
1169
  ApiName["RegisterOnThemeChangeHandler"] = "registerOnThemeChangeHandler";
1159
1170
  ApiName["RemoteCamera_GetCapableParticipants"] = "remoteCamera.getCapableParticipants";
1160
1171
  ApiName["RemoteCamera_RegisterOnCapableParticipantsChangeHandler"] = "remoteCamera.registerOnCapableParticipantsChangeHandler";
@@ -1208,6 +1219,9 @@ var ApiName;
1208
1219
  ApiName["VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler"] = "videoEffectsEX.registerSetFrameProcessTimeLimitHandler";
1209
1220
  ApiName["VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler"] = "videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler";
1210
1221
  ApiName["VideoEffectsEx_UpdatePersonalizedEffects"] = "videoEffectsEx.updatePersonalizedEffects";
1222
+ ApiName["VideoEffectsUtils_EffectFailure"] = "videoEffectsUtils.effectFailure";
1223
+ ApiName["VideoEffectsUtils_ReportVideoEffectChanged"] = "videoEffectsUtils.reportVideoEffectChanged";
1224
+ ApiName["VideoEffectsUtils_TransformerWithMetadata_Constructor"] = "videoEffectsUtils.transformerWithMetadata.constructor";
1211
1225
  ApiName["VideoPerformanceMonitor_Constructor"] = "videoPerformanceMonitor.performanceDataGenerated";
1212
1226
  ApiName["VideoPerformanceMonitor_ReportFrameProcessed"] = "videoPerformanceMonitor.reportFrameProcessed";
1213
1227
  ApiName["VideoPerformanceMonitor_ReportTextureStreamAcquired"] = "videoPerformanceMonitor.reportTextureStreamAcquired";
@@ -2502,7 +2516,7 @@ const _minRuntimeConfigToUninitialize = {
2502
2516
  * @hidden
2503
2517
  * Package version.
2504
2518
  */
2505
- const version = "2.20.0-beta.2";
2519
+ const version = "2.20.0-beta.3";
2506
2520
 
2507
2521
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2508
2522
 
@@ -3808,6 +3822,24 @@ function appInitializeHelper(apiVersionTag, validMessageOrigins) {
3808
3822
  return Promise.resolve();
3809
3823
  }
3810
3824
  }
3825
+ function notifyAppLoadedHelper(apiVersionTag) {
3826
+ sendMessageToParentWithVersion(apiVersionTag, app.Messages.AppLoaded, [version]);
3827
+ }
3828
+ function notifyExpectedFailureHelper(apiVersionTag, expectedFailureRequest) {
3829
+ sendMessageToParentWithVersion(apiVersionTag, app.Messages.ExpectedFailure, [
3830
+ expectedFailureRequest.reason,
3831
+ expectedFailureRequest.message,
3832
+ ]);
3833
+ }
3834
+ function notifyFailureHelper(apiVersiontag, appInitializationFailedRequest) {
3835
+ sendMessageToParentWithVersion(apiVersiontag, app.Messages.Failure, [
3836
+ appInitializationFailedRequest.reason,
3837
+ appInitializationFailedRequest.message,
3838
+ ]);
3839
+ }
3840
+ function notifySuccessHelper(apiVersionTag) {
3841
+ sendMessageToParentWithVersion(apiVersionTag, app.Messages.Success, [version]);
3842
+ }
3811
3843
  const initializeHelperLogger = appLogger.extend('initializeHelper');
3812
3844
  function initializeHelper(apiVersionTag, validMessageOrigins) {
3813
3845
  return new Promise((resolve) => {
@@ -4065,7 +4097,7 @@ var app;
4065
4097
  */
4066
4098
  function notifyAppLoaded() {
4067
4099
  ensureInitializeCalled();
4068
- sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyAppLoaded), app.Messages.AppLoaded, [version]);
4100
+ notifyAppLoadedHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyAppLoaded));
4069
4101
  }
4070
4102
  app.notifyAppLoaded = notifyAppLoaded;
4071
4103
  /**
@@ -4073,7 +4105,7 @@ var app;
4073
4105
  */
4074
4106
  function notifySuccess() {
4075
4107
  ensureInitializeCalled();
4076
- sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifySuccess), app.Messages.Success, [version]);
4108
+ notifySuccessHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifySuccess));
4077
4109
  }
4078
4110
  app.notifySuccess = notifySuccess;
4079
4111
  /**
@@ -4084,7 +4116,7 @@ var app;
4084
4116
  */
4085
4117
  function notifyFailure(appInitializationFailedRequest) {
4086
4118
  ensureInitializeCalled();
4087
- sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyFailure), app.Messages.Failure, [appInitializationFailedRequest.reason, appInitializationFailedRequest.message]);
4119
+ notifyFailureHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyFailure), appInitializationFailedRequest);
4088
4120
  }
4089
4121
  app.notifyFailure = notifyFailure;
4090
4122
  /**
@@ -4094,7 +4126,7 @@ var app;
4094
4126
  */
4095
4127
  function notifyExpectedFailure(expectedFailureRequest) {
4096
4128
  ensureInitializeCalled();
4097
- sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyExpectedFailure), app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
4129
+ notifyExpectedFailureHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyExpectedFailure), expectedFailureRequest);
4098
4130
  }
4099
4131
  app.notifyExpectedFailure = notifyExpectedFailure;
4100
4132
  /**
@@ -5309,7 +5341,8 @@ function handleBeforeUnload() {
5309
5341
  */
5310
5342
  function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
5311
5343
  HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
5312
- !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['beforeUnload']);
5344
+ !isNullOrUndefined(handler) &&
5345
+ sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterBeforeUnloadHandler), 'registerHandler', ['beforeUnload']);
5313
5346
  }
5314
5347
  /**
5315
5348
  * @internal
@@ -5317,7 +5350,8 @@ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
5317
5350
  */
5318
5351
  function handlers_registerOnResumeHandler(handler) {
5319
5352
  HandlersPrivate.resumeHandler = handler;
5320
- !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['load']);
5353
+ !isNullOrUndefined(handler) &&
5354
+ sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterLoadHandler), 'registerHandler', ['load']);
5321
5355
  }
5322
5356
 
5323
5357
  ;// CONCATENATED MODULE: ./src/internal/nestedAppAuth.ts
@@ -6661,6 +6695,11 @@ function createTeamsDeepLinkForAppInstallDialog(appId) {
6661
6695
 
6662
6696
 
6663
6697
 
6698
+
6699
+ /**
6700
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
6701
+ */
6702
+ const appInstallDialogTelemetryVersionNumber = ApiVersionNumber.V_1;
6664
6703
  var appInstallDialog;
6665
6704
  (function (appInstallDialog) {
6666
6705
  /**
@@ -6674,11 +6713,14 @@ var appInstallDialog;
6674
6713
  if (!isSupported()) {
6675
6714
  throw new Error('Not supported');
6676
6715
  }
6716
+ const apiVersionTag = getApiVersionTag(appInstallDialogTelemetryVersionNumber, ApiName.AppInstallDialog_OpenAppInstallDialog);
6677
6717
  if (runtime_runtime.isLegacyTeams) {
6678
- resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
6718
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
6679
6719
  }
6680
6720
  else {
6681
- sendMessageToParent('appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);
6721
+ sendMessageToParentWithVersion(apiVersionTag, 'appInstallDialog.openAppInstallDialog', [
6722
+ openAPPInstallDialogParams,
6723
+ ]);
6682
6724
  resolve();
6683
6725
  }
6684
6726
  });
@@ -7891,6 +7933,11 @@ function getAdaptiveCardSchemaVersion() {
7891
7933
 
7892
7934
 
7893
7935
 
7936
+
7937
+ /**
7938
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
7939
+ */
7940
+ const appWindowTelemetryVersionNumber = ApiVersionNumber.V_1;
7894
7941
  /**
7895
7942
  * An object that application can utilize to establish communication
7896
7943
  * with the child window it opened, which contains the corresponding task.
@@ -7904,7 +7951,7 @@ class ChildAppWindow {
7904
7951
  */
7905
7952
  postMessage(message, onComplete) {
7906
7953
  internalAPIs_ensureInitialized(runtime_runtime);
7907
- sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7954
+ sendMessageToParentWithVersion(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_PostMessage), 'messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7908
7955
  }
7909
7956
  /**
7910
7957
  * Add a listener that will be called when an event is received from the ChildAppWindow.
@@ -7915,7 +7962,7 @@ class ChildAppWindow {
7915
7962
  addEventListener(type, listener) {
7916
7963
  internalAPIs_ensureInitialized(runtime_runtime);
7917
7964
  if (type === 'message') {
7918
- registerHandler('messageForParent', listener);
7965
+ registerHandlerWithVersion(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_AddEventListener), 'messageForParent', listener);
7919
7966
  }
7920
7967
  }
7921
7968
  }
@@ -7938,7 +7985,7 @@ class ParentAppWindow {
7938
7985
  */
7939
7986
  postMessage(message, onComplete) {
7940
7987
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7941
- sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7988
+ sendMessageToParentWithVersion(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_PostMessage), 'messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7942
7989
  }
7943
7990
  /**
7944
7991
  * Add a listener that will be called when an event is received from the ParentAppWindow.
@@ -7949,7 +7996,7 @@ class ParentAppWindow {
7949
7996
  addEventListener(type, listener) {
7950
7997
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7951
7998
  if (type === 'message') {
7952
- registerHandler('messageForChild', listener);
7999
+ registerHandlerWithVersion(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_AddEventListener), 'messageForChild', listener);
7953
8000
  }
7954
8001
  }
7955
8002
  }
@@ -8854,11 +8901,12 @@ var calendar;
8854
8901
  if (!isSupported()) {
8855
8902
  throw new Error('Not supported');
8856
8903
  }
8904
+ const apiVersionTag = getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_ComposeMeeting);
8857
8905
  if (runtime_runtime.isLegacyTeams) {
8858
- resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
8906
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
8859
8907
  }
8860
8908
  else {
8861
- resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_ComposeMeeting), 'calendar.composeMeeting', composeMeetingParams));
8909
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'calendar.composeMeeting', composeMeetingParams));
8862
8910
  }
8863
8911
  });
8864
8912
  }
@@ -9296,6 +9344,16 @@ var videoEffectsUtils_awaiter = (undefined && undefined.__awaiter) || function (
9296
9344
 
9297
9345
 
9298
9346
 
9347
+
9348
+ /**
9349
+ * @hidden
9350
+ * Align with the W3C spec: https://www.w3.org/TR/webcodecs/
9351
+ *
9352
+ * @internal
9353
+ * Limited to Microsoft-internal use
9354
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
9355
+ */
9356
+ const videoEffectsUtilTelemetryVersionNumber = ApiVersionNumber.V_2;
9299
9357
  /**
9300
9358
  * @hidden
9301
9359
  * Create a MediaStreamTrack from the media stream with the given streamId and processed by videoFrameHandler.
@@ -9606,7 +9664,7 @@ class TransformerWithMetadata {
9606
9664
  },
9607
9665
  };
9608
9666
  });
9609
- registerHandler('video.mediaStream.audioInferenceDiscardStatusChange', ({ discardAudioInferenceResult }) => {
9667
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_TransformerWithMetadata_Constructor), 'video.mediaStream.audioInferenceDiscardStatusChange', ({ discardAudioInferenceResult }) => {
9610
9668
  this.shouldDiscardAudioInferenceResult = discardAudioInferenceResult;
9611
9669
  });
9612
9670
  }
@@ -9620,11 +9678,11 @@ function createEffectParameterChangeCallback(callback, videoPerformanceMonitor)
9620
9678
  callback(effectId, effectParam)
9621
9679
  .then(() => {
9622
9680
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportVideoEffectChanged(effectId || '', effectParam);
9623
- sendMessageToParent('video.videoEffectReadiness', [true, effectId, undefined, effectParam]);
9681
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_ReportVideoEffectChanged), 'video.videoEffectReadiness', [true, effectId, undefined, effectParam]);
9624
9682
  })
9625
9683
  .catch((reason) => {
9626
9684
  const validReason = reason in videoEffects.EffectFailureReason ? reason : videoEffects.EffectFailureReason.InitializationFailure;
9627
- sendMessageToParent('video.videoEffectReadiness', [false, effectId, validReason, effectParam]);
9685
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_EffectFailure), 'video.videoEffectReadiness', [false, effectId, validReason, effectParam]);
9628
9686
  });
9629
9687
  };
9630
9688
  }
@@ -10776,10 +10834,14 @@ var call;
10776
10834
 
10777
10835
  ;// CONCATENATED MODULE: ./src/public/appInitialization.ts
10778
10836
 
10837
+
10779
10838
  /**
10780
10839
  * @deprecated
10781
10840
  * As of 2.0.0, please use {@link app} namespace instead.
10841
+ *
10842
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
10782
10843
  */
10844
+ const appInitializationTelemetryVersionNumber = ApiVersionNumber.V_1;
10783
10845
  var appInitialization;
10784
10846
  (function (appInitialization) {
10785
10847
  /**
@@ -10807,7 +10869,7 @@ var appInitialization;
10807
10869
  * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
10808
10870
  */
10809
10871
  function notifyAppLoaded() {
10810
- app.notifyAppLoaded();
10872
+ notifyAppLoadedHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyAppLoaded));
10811
10873
  }
10812
10874
  appInitialization.notifyAppLoaded = notifyAppLoaded;
10813
10875
  /**
@@ -10817,7 +10879,7 @@ var appInitialization;
10817
10879
  * Notifies the frame that app initialization is successful and is ready for user interaction.
10818
10880
  */
10819
10881
  function notifySuccess() {
10820
- app.notifySuccess();
10882
+ notifySuccessHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifySuccess));
10821
10883
  }
10822
10884
  appInitialization.notifySuccess = notifySuccess;
10823
10885
  /**
@@ -10829,7 +10891,7 @@ var appInitialization;
10829
10891
  * during initialization as well as an optional message.
10830
10892
  */
10831
10893
  function notifyFailure(appInitializationFailedRequest) {
10832
- app.notifyFailure(appInitializationFailedRequest);
10894
+ notifyFailureHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyFailure), appInitializationFailedRequest);
10833
10895
  }
10834
10896
  appInitialization.notifyFailure = notifyFailure;
10835
10897
  /**
@@ -10840,7 +10902,7 @@ var appInitialization;
10840
10902
  * @param expectedFailureRequest - The expected failure request containing the reason and an optional message
10841
10903
  */
10842
10904
  function notifyExpectedFailure(expectedFailureRequest) {
10843
- app.notifyExpectedFailure(expectedFailureRequest);
10905
+ notifyExpectedFailureHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyExpectedFailure), expectedFailureRequest);
10844
10906
  }
10845
10907
  appInitialization.notifyExpectedFailure = notifyExpectedFailure;
10846
10908
  })(appInitialization || (appInitialization = {}));