@microsoft/teams-js 2.1.0-beta.5 → 2.2.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.
- package/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +232 -78
- package/dist/MicrosoftTeams.js +116 -28
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
package/dist/MicrosoftTeams.js
CHANGED
@@ -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.
|
1130
|
+
var version = "2.2.0-beta.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
|
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
|
-
* @
|
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;
|
@@ -5512,6 +5534,8 @@ function validatePeoplePickerInput(peoplePickerInputs) {
|
|
5512
5534
|
|
5513
5535
|
/**
|
5514
5536
|
* Namespace to interact with the barcode scanning-specific part of the SDK.
|
5537
|
+
*
|
5538
|
+
* @beta
|
5515
5539
|
*/
|
5516
5540
|
var barCode;
|
5517
5541
|
(function (barCode) {
|
@@ -5521,6 +5545,8 @@ var barCode;
|
|
5521
5545
|
* @param barCodeConfig - input configuration to customize the barcode scanning experience
|
5522
5546
|
*
|
5523
5547
|
* @returns a scanned code
|
5548
|
+
*
|
5549
|
+
* @beta
|
5524
5550
|
*/
|
5525
5551
|
function scanBarCode(barCodeConfig) {
|
5526
5552
|
return new Promise(function (resolve) {
|
@@ -5539,6 +5565,8 @@ var barCode;
|
|
5539
5565
|
* Checks whether or not media has user permission
|
5540
5566
|
*
|
5541
5567
|
* @returns true if the user has granted the app permission to media information, false otherwise
|
5568
|
+
*
|
5569
|
+
* @beta
|
5542
5570
|
*/
|
5543
5571
|
function hasPermission() {
|
5544
5572
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
@@ -5555,6 +5583,8 @@ var barCode;
|
|
5555
5583
|
* Requests user permission for media
|
5556
5584
|
*
|
5557
5585
|
* @returns true if the user has granted the app permission to the media, false otherwise
|
5586
|
+
*
|
5587
|
+
* @beta
|
5558
5588
|
*/
|
5559
5589
|
function requestPermission() {
|
5560
5590
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
@@ -5571,6 +5601,8 @@ var barCode;
|
|
5571
5601
|
* Checks if barCode capability is supported by the host
|
5572
5602
|
*
|
5573
5603
|
* @returns boolean to represent whether barCode is supported
|
5604
|
+
*
|
5605
|
+
* @beta
|
5574
5606
|
*/
|
5575
5607
|
function isSupported() {
|
5576
5608
|
return runtime.supports.barCode && runtime.supports.permissions ? true : false;
|
@@ -5601,7 +5633,7 @@ var chat;
|
|
5601
5633
|
*/
|
5602
5634
|
function openChat(openChatRequest) {
|
5603
5635
|
return new Promise(function (resolve) {
|
5604
|
-
ensureInitialized(FrameContexts.content);
|
5636
|
+
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5605
5637
|
if (!isSupported()) {
|
5606
5638
|
throw errorNotSupportedOnPlatform;
|
5607
5639
|
}
|
@@ -5640,7 +5672,7 @@ var chat;
|
|
5640
5672
|
openChat(chatRequest);
|
5641
5673
|
}
|
5642
5674
|
else {
|
5643
|
-
ensureInitialized(FrameContexts.content);
|
5675
|
+
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5644
5676
|
if (!isSupported()) {
|
5645
5677
|
throw errorNotSupportedOnPlatform;
|
5646
5678
|
}
|
@@ -6191,9 +6223,9 @@ var meeting;
|
|
6191
6223
|
}
|
6192
6224
|
meeting.getAppContentStageSharingState = getAppContentStageSharingState;
|
6193
6225
|
/**
|
6194
|
-
* Registers a handler for changes to paticipant speaking states.
|
6195
|
-
*
|
6196
|
-
* 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.
|
6197
6229
|
*
|
6198
6230
|
* @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
|
6199
6231
|
*/
|
@@ -7195,7 +7227,7 @@ function shareDeepLink(deepLinkParameters) {
|
|
7195
7227
|
}
|
7196
7228
|
/**
|
7197
7229
|
* @deprecated
|
7198
|
-
* As of 2.0.0, please use {@link app.openLink
|
7230
|
+
* As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\<void\>} instead.
|
7199
7231
|
*
|
7200
7232
|
* Execute deep link API.
|
7201
7233
|
*
|
@@ -7227,7 +7259,7 @@ function setFrameContext(frameContext) {
|
|
7227
7259
|
* @deprecated
|
7228
7260
|
* As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[],): void} instead.
|
7229
7261
|
*
|
7230
|
-
*
|
7262
|
+
* Initialize with FrameContext
|
7231
7263
|
*
|
7232
7264
|
* @param frameContext - FrameContext information to be set
|
7233
7265
|
* @param callback - The optional callback to be invoked be invoked after initilizing the frame context
|
@@ -7244,6 +7276,8 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
|
|
7244
7276
|
*/
|
7245
7277
|
function transformAppContextToLegacyContext(appContext) {
|
7246
7278
|
var context = {
|
7279
|
+
// actionInfo
|
7280
|
+
actionInfo: appContext.actionInfo,
|
7247
7281
|
// app
|
7248
7282
|
locale: appContext.app.locale,
|
7249
7283
|
appSessionId: appContext.app.sessionId,
|
@@ -7621,7 +7655,7 @@ var tasks;
|
|
7621
7655
|
tasks.getBotUrlDialogInfoFromTaskInfo = getBotUrlDialogInfoFromTaskInfo;
|
7622
7656
|
/**
|
7623
7657
|
* Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
|
7624
|
-
* 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}
|
7625
7659
|
* @param taskInfo TaskInfo object from which to extract size info, if specified
|
7626
7660
|
* @returns TaskInfo with height and width specified
|
7627
7661
|
*/
|
@@ -8027,26 +8061,80 @@ var files;
|
|
8027
8061
|
* @hidden
|
8028
8062
|
* Hide from docs
|
8029
8063
|
*
|
8030
|
-
* Initiates the 3P cloud storage
|
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
|
8066
|
+
*
|
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
|
8031
8087
|
*
|
8032
|
-
*
|
8033
|
-
*
|
8034
|
-
* Delete Action : Allows deleting file(s) from the given 3P cloud storage provider
|
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
|
8035
8090
|
*
|
8036
|
-
* @param
|
8037
|
-
* @param callback Callback that will be triggered post
|
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
|
8038
8093
|
*/
|
8039
|
-
function
|
8094
|
+
function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
|
8040
8095
|
ensureInitialized(FrameContexts.content);
|
8041
8096
|
if (!callback) {
|
8042
|
-
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.
|
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
|
8111
|
+
*
|
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
|
8116
|
+
*/
|
8117
|
+
function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
|
8118
|
+
ensureInitialized(FrameContexts.content);
|
8119
|
+
if (!callback) {
|
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');
|
8043
8127
|
}
|
8044
|
-
if (!(
|
8045
|
-
|
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');
|
8046
8134
|
}
|
8047
|
-
sendMessageToParent('files.
|
8135
|
+
sendMessageToParent('files.uploadCloudStorageProviderFile', [uploadFileRequest], callback);
|
8048
8136
|
}
|
8049
|
-
files_1.
|
8137
|
+
files_1.uploadCloudStorageProviderFile = uploadCloudStorageProviderFile;
|
8050
8138
|
/**
|
8051
8139
|
* @hidden
|
8052
8140
|
* Hide from docs
|
@@ -8062,7 +8150,7 @@ var files;
|
|
8062
8150
|
if (!handler) {
|
8063
8151
|
throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
|
8064
8152
|
}
|
8065
|
-
registerHandler('files.
|
8153
|
+
registerHandler('files.cloudStorageProviderListChange', handler);
|
8066
8154
|
}
|
8067
8155
|
files_1.registerCloudStorageProviderListChangeHandler = registerCloudStorageProviderListChangeHandler;
|
8068
8156
|
/**
|
@@ -8080,7 +8168,7 @@ var files;
|
|
8080
8168
|
if (!handler) {
|
8081
8169
|
throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
|
8082
8170
|
}
|
8083
|
-
registerHandler('files.
|
8171
|
+
registerHandler('files.cloudStorageProviderContentChange', handler);
|
8084
8172
|
}
|
8085
8173
|
files_1.registerCloudStorageProviderContentChangeHandler = registerCloudStorageProviderContentChangeHandler;
|
8086
8174
|
function getSdkError(errorCode, message) {
|