@microsoft/teams-js 2.1.0 → 2.2.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.
@@ -1043,6 +1043,7 @@ __webpack_require__.r(__webpack_exports__);
1043
1043
 
1044
1044
  // EXPORTS
1045
1045
  __webpack_require__.d(__webpack_exports__, {
1046
+ "ActionObjectType": () => (/* reexport */ ActionObjectType),
1046
1047
  "ChannelType": () => (/* reexport */ ChannelType),
1047
1048
  "ChildAppWindow": () => (/* reexport */ ChildAppWindow),
1048
1049
  "DialogDimension": () => (/* reexport */ DialogDimension),
@@ -1053,6 +1054,7 @@ __webpack_require__.d(__webpack_exports__, {
1053
1054
  "HostName": () => (/* reexport */ HostName),
1054
1055
  "NotificationTypes": () => (/* reexport */ NotificationTypes),
1055
1056
  "ParentAppWindow": () => (/* reexport */ ParentAppWindow),
1057
+ "SecondaryM365ContentIdName": () => (/* reexport */ SecondaryM365ContentIdName),
1056
1058
  "TaskModuleDimension": () => (/* reexport */ TaskModuleDimension),
1057
1059
  "TeamType": () => (/* reexport */ TeamType),
1058
1060
  "UserSettingTypes": () => (/* reexport */ UserSettingTypes),
@@ -1125,7 +1127,7 @@ __webpack_require__.d(__webpack_exports__, {
1125
1127
  });
1126
1128
 
1127
1129
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1128
- var version = "2.1.0";
1130
+ var version = "2.2.0";
1129
1131
  /**
1130
1132
  * @hidden
1131
1133
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -1287,6 +1289,27 @@ var FileOpenPreference;
1287
1289
  FileOpenPreference["Desktop"] = "desktop";
1288
1290
  FileOpenPreference["Web"] = "web";
1289
1291
  })(FileOpenPreference || (FileOpenPreference = {}));
1292
+ /**
1293
+ * Possible Action Types
1294
+ *
1295
+ * @beta
1296
+ */
1297
+ var ActionObjectType;
1298
+ (function (ActionObjectType) {
1299
+ ActionObjectType["M365Content"] = "m365content";
1300
+ })(ActionObjectType || (ActionObjectType = {}));
1301
+ /**
1302
+ * These correspond with field names in the MSGraph
1303
+ *
1304
+ * @beta
1305
+ */
1306
+ var SecondaryM365ContentIdName;
1307
+ (function (SecondaryM365ContentIdName) {
1308
+ SecondaryM365ContentIdName["DriveId"] = "driveId";
1309
+ SecondaryM365ContentIdName["GroupId"] = "groupId";
1310
+ SecondaryM365ContentIdName["SiteId"] = "siteId";
1311
+ SecondaryM365ContentIdName["UserId"] = "userId";
1312
+ })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1290
1313
  var ErrorCode;
1291
1314
  (function (ErrorCode) {
1292
1315
  /**
@@ -2569,7 +2592,7 @@ var dialog;
2569
2592
  * Hide from docs because this function is only used during initialization
2570
2593
  * ------------------
2571
2594
  * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}
2572
- * Function is called during app intitialization
2595
+ * Function is called during app initialization
2573
2596
  * @internal
2574
2597
  */
2575
2598
  function initialize() {
@@ -2617,7 +2640,7 @@ var dialog;
2617
2640
  }
2618
2641
  dialog.open = open;
2619
2642
  /**
2620
- * Submit the dialog module.
2643
+ * Submit the dialog module and close the dialog
2621
2644
  *
2622
2645
  * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2623
2646
  * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
@@ -3348,6 +3371,7 @@ var app_app;
3348
3371
  */
3349
3372
  function transformLegacyContextToAppContext(legacyContext) {
3350
3373
  var context = {
3374
+ actionInfo: legacyContext.actionInfo,
3351
3375
  app: {
3352
3376
  locale: legacyContext.locale,
3353
3377
  sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',
@@ -5123,9 +5147,7 @@ var media;
5123
5147
  }(MediaController));
5124
5148
  media.VideoController = VideoController;
5125
5149
  /**
5126
- * @hidden
5127
- * Hide from docs
5128
- * --------
5150
+ * @beta
5129
5151
  * Events which are used to communicate between the app and the host client during the media recording flow
5130
5152
  */
5131
5153
  var MediaControllerEvent;
@@ -5611,7 +5633,7 @@ var chat;
5611
5633
  */
5612
5634
  function openChat(openChatRequest) {
5613
5635
  return new Promise(function (resolve) {
5614
- ensureInitialized(FrameContexts.content);
5636
+ ensureInitialized(FrameContexts.content, FrameContexts.task);
5615
5637
  if (!isSupported()) {
5616
5638
  throw errorNotSupportedOnPlatform;
5617
5639
  }
@@ -5650,7 +5672,7 @@ var chat;
5650
5672
  openChat(chatRequest);
5651
5673
  }
5652
5674
  else {
5653
- ensureInitialized(FrameContexts.content);
5675
+ ensureInitialized(FrameContexts.content, FrameContexts.task);
5654
5676
  if (!isSupported()) {
5655
5677
  throw errorNotSupportedOnPlatform;
5656
5678
  }
@@ -6201,9 +6223,9 @@ var meeting;
6201
6223
  }
6202
6224
  meeting.getAppContentStageSharingState = getAppContentStageSharingState;
6203
6225
  /**
6204
- * Registers a handler for changes to paticipant speaking states. If any participant is speaking, isSpeakingDetected
6205
- * will be true. If no participants are speaking, isSpeakingDetected will be false. Only one handler can be registered
6206
- * at a time. A subsequent registration replaces an existing registration.
6226
+ * Registers a handler for changes to paticipant speaking states. This API returns {@link ISpeakingState}, which will have isSpeakingDetected
6227
+ * and/or an error object. If any participant is speaking, isSpeakingDetected will be true. If no participants are speaking, isSpeakingDetected
6228
+ * will be false. Default value is false. Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
6207
6229
  *
6208
6230
  * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
6209
6231
  */
@@ -7205,7 +7227,7 @@ function shareDeepLink(deepLinkParameters) {
7205
7227
  }
7206
7228
  /**
7207
7229
  * @deprecated
7208
- * As of 2.0.0, please use {@link app.openLink core.openLink(deepLink: string): Promise\<void\>} instead.
7230
+ * As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\<void\>} instead.
7209
7231
  *
7210
7232
  * Execute deep link API.
7211
7233
  *
@@ -7237,7 +7259,7 @@ function setFrameContext(frameContext) {
7237
7259
  * @deprecated
7238
7260
  * As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[],): void} instead.
7239
7261
  *
7240
- * Initilize with FrameContext
7262
+ * Initialize with FrameContext
7241
7263
  *
7242
7264
  * @param frameContext - FrameContext information to be set
7243
7265
  * @param callback - The optional callback to be invoked be invoked after initilizing the frame context
@@ -7254,6 +7276,8 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
7254
7276
  */
7255
7277
  function transformAppContextToLegacyContext(appContext) {
7256
7278
  var context = {
7279
+ // actionInfo
7280
+ actionInfo: appContext.actionInfo,
7257
7281
  // app
7258
7282
  locale: appContext.app.locale,
7259
7283
  appSessionId: appContext.app.sessionId,
@@ -7631,7 +7655,7 @@ var tasks;
7631
7655
  tasks.getBotUrlDialogInfoFromTaskInfo = getBotUrlDialogInfoFromTaskInfo;
7632
7656
  /**
7633
7657
  * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
7634
- * otherwise uses the height and width values corresponding to {@link TaskModuleDimension.Small}
7658
+ * otherwise uses the height and width values corresponding to {@link TaskModuleDimension | TaskModuleDimension.Small}
7635
7659
  * @param taskInfo TaskInfo object from which to extract size info, if specified
7636
7660
  * @returns TaskInfo with height and width specified
7637
7661
  */
@@ -8037,26 +8061,80 @@ var files;
8037
8061
  * @hidden
8038
8062
  * Hide from docs
8039
8063
  *
8040
- * Initiates the 3P cloud storage provider file action (Upload / Download / Delete) flow
8064
+ * Initiates the delete 3P cloud storage file(s) / folder (folder has to be empty) flow,
8065
+ * which will delete existing file(s) / folder from the given 3P provider
8041
8066
  *
8042
- * Upload Action : Allows uploading file(s) to the given 3P cloud storage provider
8043
- * Download Action : Allows downloading file(s) from the given 3P cloud storage provider
8044
- * Delete Action : Allows deleting file(s) from the given 3P cloud storage provider
8067
+ * @param deleteFileRequest 3P cloud storage provider delete action request content
8068
+ * @param callback Callback that will be triggered post deleting existing file(s) flow is finished
8069
+ */
8070
+ function deleteCloudStorageProviderFile(deleteFileRequest, callback) {
8071
+ ensureInitialized(FrameContexts.content);
8072
+ if (!callback) {
8073
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');
8074
+ }
8075
+ if (!(deleteFileRequest &&
8076
+ deleteFileRequest.content &&
8077
+ deleteFileRequest.content.itemList &&
8078
+ deleteFileRequest.content.itemList.length > 0)) {
8079
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing');
8080
+ }
8081
+ sendMessageToParent('files.deleteCloudStorageProviderFile', [deleteFileRequest], callback);
8082
+ }
8083
+ files_1.deleteCloudStorageProviderFile = deleteCloudStorageProviderFile;
8084
+ /**
8085
+ * @hidden
8086
+ * Hide from docs
8087
+ *
8088
+ * Initiates the download 3P cloud storage file(s) flow,
8089
+ * which will download existing file(s) from the given 3P provider in the teams client side without sharing any file info in the callback
8090
+ *
8091
+ * @param downloadFileRequest 3P cloud storage provider download file(s) action request content
8092
+ * @param callback Callback that will be triggered post downloading existing file(s) flow is finished
8093
+ */
8094
+ function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
8095
+ ensureInitialized(FrameContexts.content);
8096
+ if (!callback) {
8097
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] callback cannot be null');
8098
+ }
8099
+ if (!(downloadFileRequest &&
8100
+ downloadFileRequest.content &&
8101
+ downloadFileRequest.content.itemList &&
8102
+ downloadFileRequest.content.itemList.length > 0)) {
8103
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing');
8104
+ }
8105
+ sendMessageToParent('files.downloadCloudStorageProviderFile', [downloadFileRequest], callback);
8106
+ }
8107
+ files_1.downloadCloudStorageProviderFile = downloadCloudStorageProviderFile;
8108
+ /**
8109
+ * @hidden
8110
+ * Hide from docs
8045
8111
  *
8046
- * @param cloudStorageProviderFileActionRequest 3P cloud storage provider file action (Upload / Download / Delete) request content
8047
- * @param callback Callback that will be triggered post 3P cloud storage action
8112
+ * Initiates the upload 3P cloud storage file(s) flow, which will upload file(s) to the given 3P provider
8113
+ *
8114
+ * @param uploadFileRequest 3P cloud storage provider upload file(s) action request content
8115
+ * @param callback Callback that will be triggered post uploading file(s) flow is finished
8048
8116
  */
8049
- function performCloudStorageProviderFileAction(cloudStorageProviderFileActionRequest, callback) {
8117
+ function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
8050
8118
  ensureInitialized(FrameContexts.content);
8051
8119
  if (!callback) {
8052
- throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.performCloudStorageProviderFileAction] callback cannot be null');
8120
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');
8121
+ }
8122
+ if (!(uploadFileRequest &&
8123
+ uploadFileRequest.content &&
8124
+ uploadFileRequest.content.itemList &&
8125
+ uploadFileRequest.content.itemList.length > 0)) {
8126
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing');
8053
8127
  }
8054
- if (!(cloudStorageProviderFileActionRequest && cloudStorageProviderFileActionRequest.content)) {
8055
- throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.performCloudStorageProviderFileAction] 3P cloud storage provider request content is missing');
8128
+ if (!(uploadFileRequest.content.destinationFolder &&
8129
+ (uploadFileRequest.content.providerCode === CloudStorageProvider.SharePoint
8130
+ ? uploadFileRequest.content.destinationFolder.isFolder
8131
+ : uploadFileRequest.content.destinationFolder.isSubdirectory) &&
8132
+ uploadFileRequest.content.destinationFolder.objectUrl)) {
8133
+ throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] Invalid destination folder details');
8056
8134
  }
8057
- sendMessageToParent('files.performCloudStorageProviderFileAction', [cloudStorageProviderFileActionRequest], callback);
8135
+ sendMessageToParent('files.uploadCloudStorageProviderFile', [uploadFileRequest], callback);
8058
8136
  }
8059
- files_1.performCloudStorageProviderFileAction = performCloudStorageProviderFileAction;
8137
+ files_1.uploadCloudStorageProviderFile = uploadCloudStorageProviderFile;
8060
8138
  /**
8061
8139
  * @hidden
8062
8140
  * Hide from docs
@@ -8072,7 +8150,7 @@ var files;
8072
8150
  if (!handler) {
8073
8151
  throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
8074
8152
  }
8075
- registerHandler('files.cloudStorageProviderList', handler);
8153
+ registerHandler('files.cloudStorageProviderListChange', handler);
8076
8154
  }
8077
8155
  files_1.registerCloudStorageProviderListChangeHandler = registerCloudStorageProviderListChangeHandler;
8078
8156
  /**
@@ -8090,7 +8168,7 @@ var files;
8090
8168
  if (!handler) {
8091
8169
  throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
8092
8170
  }
8093
- registerHandler('files.cloudStorageProviderContent', handler);
8171
+ registerHandler('files.cloudStorageProviderContentChange', handler);
8094
8172
  }
8095
8173
  files_1.registerCloudStorageProviderContentChangeHandler = registerCloudStorageProviderContentChangeHandler;
8096
8174
  function getSdkError(errorCode, message) {