@microsoft/teams-js 2.0.0-beta.6-dev.5 → 2.0.0-beta.6-dev.8
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/dist/MicrosoftTeams.d.ts +120 -262
- package/dist/MicrosoftTeams.js +552 -461
- 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
@@ -1089,6 +1089,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1089
1089
|
"navigateCrossDomain": () => (/* reexport */ navigateCrossDomain),
|
1090
1090
|
"navigateToTab": () => (/* reexport */ navigateToTab),
|
1091
1091
|
"notifications": () => (/* reexport */ notifications),
|
1092
|
+
"openFilePreview": () => (/* reexport */ openFilePreview),
|
1092
1093
|
"pages": () => (/* reexport */ pages),
|
1093
1094
|
"people": () => (/* reexport */ people),
|
1094
1095
|
"print": () => (/* reexport */ print),
|
@@ -1121,7 +1122,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1121
1122
|
});
|
1122
1123
|
|
1123
1124
|
;// CONCATENATED MODULE: ./src/internal/constants.ts
|
1124
|
-
var version = "2.0.0-beta.6-dev.
|
1125
|
+
var version = "2.0.0-beta.6-dev.8";
|
1125
1126
|
/**
|
1126
1127
|
* @hidden
|
1127
1128
|
* The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
|
@@ -1831,6 +1832,7 @@ function processAdditionalValidOrigins(validMessageOrigins) {
|
|
1831
1832
|
|
1832
1833
|
|
1833
1834
|
|
1835
|
+
|
1834
1836
|
/**
|
1835
1837
|
* @internal
|
1836
1838
|
*/
|
@@ -1926,6 +1928,34 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
|
|
1926
1928
|
ensureInitialized();
|
1927
1929
|
registerHandler('userSettingsChange', handler, true, [settingTypes]);
|
1928
1930
|
}
|
1931
|
+
/**
|
1932
|
+
* @hidden
|
1933
|
+
* Hide from docs.
|
1934
|
+
* ------
|
1935
|
+
* Opens a client-friendly preview of the specified file.
|
1936
|
+
*
|
1937
|
+
* @param file - The file to preview.
|
1938
|
+
*/
|
1939
|
+
function openFilePreview(filePreviewParameters) {
|
1940
|
+
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
1941
|
+
var params = [
|
1942
|
+
filePreviewParameters.entityId,
|
1943
|
+
filePreviewParameters.title,
|
1944
|
+
filePreviewParameters.description,
|
1945
|
+
filePreviewParameters.type,
|
1946
|
+
filePreviewParameters.objectUrl,
|
1947
|
+
filePreviewParameters.downloadUrl,
|
1948
|
+
filePreviewParameters.webPreviewUrl,
|
1949
|
+
filePreviewParameters.webEditUrl,
|
1950
|
+
filePreviewParameters.baseUrl,
|
1951
|
+
filePreviewParameters.editFile,
|
1952
|
+
filePreviewParameters.subEntityId,
|
1953
|
+
filePreviewParameters.viewerAction,
|
1954
|
+
filePreviewParameters.fileOpenPreference,
|
1955
|
+
filePreviewParameters.conversationId,
|
1956
|
+
];
|
1957
|
+
sendMessageToParent('openFilePreview', params);
|
1958
|
+
}
|
1929
1959
|
|
1930
1960
|
;// CONCATENATED MODULE: ./src/public/authentication.ts
|
1931
1961
|
|
@@ -2336,8 +2366,6 @@ var runtime = {
|
|
2336
2366
|
location: undefined,
|
2337
2367
|
logs: undefined,
|
2338
2368
|
mail: undefined,
|
2339
|
-
media: undefined,
|
2340
|
-
meeting: undefined,
|
2341
2369
|
meetingRoom: undefined,
|
2342
2370
|
menus: undefined,
|
2343
2371
|
monetization: undefined,
|
@@ -2374,10 +2402,7 @@ var teamsRuntimeConfig = {
|
|
2374
2402
|
bot: {},
|
2375
2403
|
update: {},
|
2376
2404
|
},
|
2377
|
-
files: {},
|
2378
2405
|
logs: {},
|
2379
|
-
media: {},
|
2380
|
-
meeting: {},
|
2381
2406
|
meetingRoom: {},
|
2382
2407
|
menus: {},
|
2383
2408
|
monetization: {},
|
@@ -4979,9 +5004,9 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
4979
5004
|
|
4980
5005
|
|
4981
5006
|
|
4982
|
-
|
4983
5007
|
/**
|
4984
|
-
* @
|
5008
|
+
* @deprecated
|
5009
|
+
* As of 2.0.0-beta.6, use media only for backwards compatibility of existing code.
|
4985
5010
|
*/
|
4986
5011
|
var media;
|
4987
5012
|
(function (media) {
|
@@ -5002,20 +5027,35 @@ var media;
|
|
5002
5027
|
return File;
|
5003
5028
|
}());
|
5004
5029
|
media.File = File;
|
5030
|
+
/**
|
5031
|
+
* @deprecated
|
5032
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5033
|
+
*
|
5034
|
+
* Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.
|
5035
|
+
*
|
5036
|
+
* @params callback - Callback will be called with an @see SdkError if there are any.
|
5037
|
+
* If error is null or undefined, the callback will be called with a collection of @see File objects
|
5038
|
+
* @remarks
|
5039
|
+
* Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.
|
5040
|
+
* Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
|
5041
|
+
*
|
5042
|
+
*/
|
5005
5043
|
function captureImage(callback) {
|
5044
|
+
if (!callback) {
|
5045
|
+
throw new Error('[captureImage] Callback cannot be null');
|
5046
|
+
}
|
5006
5047
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(wrappedFunction, callback);
|
5048
|
+
if (!GlobalVars.isFramelessWindow) {
|
5049
|
+
var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
|
5050
|
+
callback(notSupportedError, undefined);
|
5051
|
+
return;
|
5052
|
+
}
|
5053
|
+
if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {
|
5054
|
+
var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
5055
|
+
callback(oldPlatformError, undefined);
|
5056
|
+
return;
|
5057
|
+
}
|
5058
|
+
sendMessageToParent('captureImage', callback);
|
5019
5059
|
}
|
5020
5060
|
media.captureImage = captureImage;
|
5021
5061
|
/**
|
@@ -5036,95 +5076,105 @@ var media;
|
|
5036
5076
|
}
|
5037
5077
|
return _this;
|
5038
5078
|
}
|
5079
|
+
/**
|
5080
|
+
* Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob
|
5081
|
+
* @param callback - callback is called with the @see SdkError if there is an error
|
5082
|
+
* If error is null or undefined, the callback will be called with @see Blob.
|
5083
|
+
*/
|
5039
5084
|
Media.prototype.getMedia = function (callback) {
|
5040
|
-
|
5085
|
+
if (!callback) {
|
5086
|
+
throw new Error('[get Media] Callback cannot be null');
|
5087
|
+
}
|
5041
5088
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5055
|
-
|
5056
|
-
|
5057
|
-
|
5058
|
-
}
|
5059
|
-
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(wrappedFunction, callback);
|
5089
|
+
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
5090
|
+
var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
5091
|
+
callback(oldPlatformError, null);
|
5092
|
+
return;
|
5093
|
+
}
|
5094
|
+
if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {
|
5095
|
+
var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
5096
|
+
callback(invalidInput, null);
|
5097
|
+
return;
|
5098
|
+
}
|
5099
|
+
// Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'
|
5100
|
+
if (isCurrentSDKVersionAtLeast(getMediaCallbackSupportVersion)) {
|
5101
|
+
this.getMediaViaCallback(callback);
|
5102
|
+
}
|
5103
|
+
else {
|
5104
|
+
this.getMediaViaHandler(callback);
|
5105
|
+
}
|
5060
5106
|
};
|
5061
|
-
Media.prototype.getMediaViaCallback = function () {
|
5062
|
-
var
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
sendMessageToParent('getMedia', localUriId, function (mediaResult) {
|
5107
|
+
Media.prototype.getMediaViaCallback = function (callback) {
|
5108
|
+
var helper = {
|
5109
|
+
mediaMimeType: this.mimeType,
|
5110
|
+
assembleAttachment: [],
|
5111
|
+
};
|
5112
|
+
var localUriId = [this.content];
|
5113
|
+
function handleGetMediaCallbackRequest(mediaResult) {
|
5114
|
+
if (callback) {
|
5070
5115
|
if (mediaResult && mediaResult.error) {
|
5071
|
-
|
5072
|
-
}
|
5073
|
-
else if (!mediaResult || !mediaResult.mediaChunk) {
|
5074
|
-
reject({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' });
|
5075
|
-
}
|
5076
|
-
else if (mediaResult.mediaChunk.chunkSequence <= 0) {
|
5077
|
-
var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
|
5078
|
-
resolve(file);
|
5116
|
+
callback(mediaResult.error, null);
|
5079
5117
|
}
|
5080
5118
|
else {
|
5081
|
-
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5086
|
-
|
5087
|
-
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
5093
|
-
mediaMimeType: _this.mimeType,
|
5094
|
-
assembleAttachment: [],
|
5095
|
-
};
|
5096
|
-
var params = [actionName, _this.content];
|
5097
|
-
_this.content && sendMessageToParent('getMedia', params);
|
5098
|
-
registerHandler('getMedia' + actionName, function (response) {
|
5099
|
-
try {
|
5100
|
-
var mediaResult = JSON.parse(response);
|
5101
|
-
if (mediaResult.error) {
|
5102
|
-
reject(mediaResult.error);
|
5103
|
-
removeHandler('getMedia' + actionName);
|
5119
|
+
if (mediaResult && mediaResult.mediaChunk) {
|
5120
|
+
// If the chunksequence number is less than equal to 0 implies EOF
|
5121
|
+
// create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
|
5122
|
+
if (mediaResult.mediaChunk.chunkSequence <= 0) {
|
5123
|
+
var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
|
5124
|
+
callback(mediaResult.error, file);
|
5125
|
+
}
|
5126
|
+
else {
|
5127
|
+
// Keep pushing chunks into assemble attachment
|
5128
|
+
var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
|
5129
|
+
helper.assembleAttachment.push(assemble);
|
5130
|
+
}
|
5104
5131
|
}
|
5105
|
-
else
|
5106
|
-
|
5107
|
-
removeHandler('getMedia' + actionName);
|
5132
|
+
else {
|
5133
|
+
callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
|
5108
5134
|
}
|
5109
|
-
|
5135
|
+
}
|
5136
|
+
}
|
5137
|
+
}
|
5138
|
+
sendMessageToParent('getMedia', localUriId, handleGetMediaCallbackRequest);
|
5139
|
+
};
|
5140
|
+
Media.prototype.getMediaViaHandler = function (callback) {
|
5141
|
+
var actionName = generateGUID();
|
5142
|
+
var helper = {
|
5143
|
+
mediaMimeType: this.mimeType,
|
5144
|
+
assembleAttachment: [],
|
5145
|
+
};
|
5146
|
+
var params = [actionName, this.content];
|
5147
|
+
this.content && callback && sendMessageToParent('getMedia', params);
|
5148
|
+
function handleGetMediaRequest(response) {
|
5149
|
+
if (callback) {
|
5150
|
+
var mediaResult = JSON.parse(response);
|
5151
|
+
if (mediaResult.error) {
|
5152
|
+
callback(mediaResult.error, null);
|
5153
|
+
removeHandler('getMedia' + actionName);
|
5154
|
+
}
|
5155
|
+
else {
|
5156
|
+
if (mediaResult.mediaChunk) {
|
5110
5157
|
// If the chunksequence number is less than equal to 0 implies EOF
|
5111
5158
|
// create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5159
|
+
if (mediaResult.mediaChunk.chunkSequence <= 0) {
|
5160
|
+
var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
|
5161
|
+
callback(mediaResult.error, file);
|
5162
|
+
removeHandler('getMedia' + actionName);
|
5163
|
+
}
|
5164
|
+
else {
|
5165
|
+
// Keep pushing chunks into assemble attachment
|
5166
|
+
var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
|
5167
|
+
helper.assembleAttachment.push(assemble);
|
5168
|
+
}
|
5115
5169
|
}
|
5116
5170
|
else {
|
5117
|
-
|
5118
|
-
|
5119
|
-
helper.assembleAttachment.push(assemble);
|
5171
|
+
callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
|
5172
|
+
removeHandler('getMedia' + actionName);
|
5120
5173
|
}
|
5121
5174
|
}
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
}
|
5126
|
-
});
|
5127
|
-
});
|
5175
|
+
}
|
5176
|
+
}
|
5177
|
+
registerHandler('getMedia' + actionName, handleGetMediaRequest);
|
5128
5178
|
};
|
5129
5179
|
return Media;
|
5130
5180
|
}(File));
|
@@ -5139,26 +5189,38 @@ var media;
|
|
5139
5189
|
function MediaController(controllerCallback) {
|
5140
5190
|
this.controllerCallback = controllerCallback;
|
5141
5191
|
}
|
5192
|
+
/**
|
5193
|
+
* @hidden
|
5194
|
+
* Hide from docs
|
5195
|
+
* --------
|
5196
|
+
* Function to notify the host client to programatically control the experience
|
5197
|
+
* @param mediaEvent indicates what the event that needs to be signaled to the host client
|
5198
|
+
* Optional; @param callback is used to send app if host client has successfully handled the notification event or not
|
5199
|
+
*/
|
5142
5200
|
MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
|
5143
5201
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5144
5202
|
try {
|
5145
5203
|
throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);
|
5146
5204
|
}
|
5147
5205
|
catch (err) {
|
5148
|
-
|
5149
|
-
|
5206
|
+
if (callback) {
|
5207
|
+
callback(err);
|
5208
|
+
}
|
5209
|
+
return;
|
5150
5210
|
}
|
5151
|
-
var params = {
|
5152
|
-
|
5153
|
-
|
5154
|
-
|
5155
|
-
|
5156
|
-
|
5157
|
-
};
|
5158
|
-
return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);
|
5211
|
+
var params = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };
|
5212
|
+
sendMessageToParent('media.controller', [params], function (err) {
|
5213
|
+
if (callback) {
|
5214
|
+
callback(err);
|
5215
|
+
}
|
5216
|
+
});
|
5159
5217
|
};
|
5218
|
+
/**
|
5219
|
+
* Function to programatically stop the ongoing media event
|
5220
|
+
* Optional; @param callback is used to send app if host client has successfully stopped the event or not
|
5221
|
+
*/
|
5160
5222
|
MediaController.prototype.stop = function (callback) {
|
5161
|
-
|
5223
|
+
this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);
|
5162
5224
|
};
|
5163
5225
|
return MediaController;
|
5164
5226
|
}());
|
@@ -5174,14 +5236,16 @@ var media;
|
|
5174
5236
|
return MediaType.Video;
|
5175
5237
|
};
|
5176
5238
|
VideoController.prototype.notifyEventToApp = function (mediaEvent) {
|
5239
|
+
if (!this.controllerCallback) {
|
5240
|
+
// Early return as app has not registered with the callback
|
5241
|
+
return;
|
5242
|
+
}
|
5177
5243
|
switch (mediaEvent) {
|
5178
5244
|
case MediaControllerEvent.StartRecording:
|
5179
|
-
this.controllerCallback.onRecordingStarted
|
5180
|
-
|
5181
|
-
|
5182
|
-
|
5183
|
-
this.controllerCallback.onRecordingStopped && this.controllerCallback.onRecordingStopped();
|
5184
|
-
break;
|
5245
|
+
if (this.controllerCallback.onRecordingStarted) {
|
5246
|
+
this.controllerCallback.onRecordingStarted();
|
5247
|
+
break;
|
5248
|
+
}
|
5185
5249
|
}
|
5186
5250
|
};
|
5187
5251
|
return VideoController;
|
@@ -5242,109 +5306,128 @@ var media;
|
|
5242
5306
|
ImageOutputFormats[ImageOutputFormats["IMAGE"] = 1] = "IMAGE";
|
5243
5307
|
ImageOutputFormats[ImageOutputFormats["PDF"] = 2] = "PDF";
|
5244
5308
|
})(ImageOutputFormats = media.ImageOutputFormats || (media.ImageOutputFormats = {}));
|
5309
|
+
/**
|
5310
|
+
* @deprecated
|
5311
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5312
|
+
*
|
5313
|
+
* Select an attachment using camera/gallery
|
5314
|
+
*
|
5315
|
+
* @param mediaInputs - The input params to customize the media to be selected
|
5316
|
+
* @param callback - The callback to invoke after fetching the media
|
5317
|
+
*/
|
5245
5318
|
function selectMedia(mediaInputs, callback) {
|
5319
|
+
if (!callback) {
|
5320
|
+
throw new Error('[select Media] Callback cannot be null');
|
5321
|
+
}
|
5246
5322
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5250
|
-
|
5251
|
-
|
5252
|
-
|
5253
|
-
|
5254
|
-
|
5255
|
-
|
5256
|
-
|
5257
|
-
|
5258
|
-
|
5259
|
-
|
5260
|
-
|
5261
|
-
|
5262
|
-
|
5263
|
-
|
5264
|
-
|
5265
|
-
|
5266
|
-
|
5267
|
-
|
5268
|
-
|
5269
|
-
if (
|
5270
|
-
|
5271
|
-
}
|
5272
|
-
var mediaArray = [];
|
5273
|
-
for (var _i = 0, localAttachments_1 = localAttachments; _i < localAttachments_1.length; _i++) {
|
5274
|
-
var attachment = localAttachments_1[_i];
|
5275
|
-
mediaArray.push(new Media(attachment));
|
5323
|
+
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
5324
|
+
var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
5325
|
+
callback(oldPlatformError, null);
|
5326
|
+
return;
|
5327
|
+
}
|
5328
|
+
try {
|
5329
|
+
throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);
|
5330
|
+
}
|
5331
|
+
catch (err) {
|
5332
|
+
callback(err, null);
|
5333
|
+
return;
|
5334
|
+
}
|
5335
|
+
if (!validateSelectMediaInputs(mediaInputs)) {
|
5336
|
+
var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
5337
|
+
callback(invalidInput, null);
|
5338
|
+
return;
|
5339
|
+
}
|
5340
|
+
var params = [mediaInputs];
|
5341
|
+
// What comes back from native as attachments would just be objects and will be missing getMedia method on them
|
5342
|
+
sendMessageToParent('selectMedia', params, function (err, localAttachments, mediaEvent) {
|
5343
|
+
// MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
|
5344
|
+
if (mediaEvent) {
|
5345
|
+
if (isVideoControllerRegistered(mediaInputs)) {
|
5346
|
+
mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);
|
5276
5347
|
}
|
5277
|
-
return
|
5278
|
-
}
|
5279
|
-
|
5280
|
-
|
5348
|
+
return;
|
5349
|
+
}
|
5350
|
+
// Media Attachments are final response to selectMedia
|
5351
|
+
if (!localAttachments) {
|
5352
|
+
callback(err, null);
|
5353
|
+
return;
|
5354
|
+
}
|
5355
|
+
var mediaArray = [];
|
5356
|
+
for (var _i = 0, localAttachments_1 = localAttachments; _i < localAttachments_1.length; _i++) {
|
5357
|
+
var attachment = localAttachments_1[_i];
|
5358
|
+
mediaArray.push(new Media(attachment));
|
5359
|
+
}
|
5360
|
+
callback(err, mediaArray);
|
5361
|
+
});
|
5281
5362
|
}
|
5282
5363
|
media.selectMedia = selectMedia;
|
5364
|
+
/**
|
5365
|
+
* @deprecated
|
5366
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5367
|
+
*
|
5368
|
+
* View images using native image viewer
|
5369
|
+
* @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call
|
5370
|
+
* @param callback - returns back error if encountered, returns null in case of success
|
5371
|
+
*/
|
5283
5372
|
function viewImages(uriList, callback) {
|
5373
|
+
if (!callback) {
|
5374
|
+
throw new Error('[view images] Callback cannot be null');
|
5375
|
+
}
|
5284
5376
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5285
|
-
|
5286
|
-
|
5287
|
-
|
5288
|
-
|
5289
|
-
|
5290
|
-
|
5291
|
-
|
5292
|
-
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5377
|
+
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
5378
|
+
var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
5379
|
+
callback(oldPlatformError);
|
5380
|
+
return;
|
5381
|
+
}
|
5382
|
+
if (!validateViewImagesInput(uriList)) {
|
5383
|
+
var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
5384
|
+
callback(invalidInput);
|
5385
|
+
return;
|
5386
|
+
}
|
5387
|
+
var params = [uriList];
|
5388
|
+
sendMessageToParent('viewImages', params, callback);
|
5297
5389
|
}
|
5298
5390
|
media.viewImages = viewImages;
|
5299
|
-
|
5300
|
-
|
5301
|
-
|
5302
|
-
|
5303
|
-
|
5304
|
-
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
}
|
5314
|
-
else {
|
5315
|
-
// otherwise, it's a function, so a callback. The second parameter might be a callback
|
5316
|
-
callback = callbackOrConfig;
|
5317
|
-
config = configMaybe;
|
5318
|
-
}
|
5391
|
+
/**
|
5392
|
+
* @deprecated
|
5393
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5394
|
+
*
|
5395
|
+
* Scan Barcode/QRcode using camera
|
5396
|
+
* @remarks
|
5397
|
+
* Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
|
5398
|
+
*
|
5399
|
+
* @param callback - callback to invoke after scanning the barcode
|
5400
|
+
* @param config - optional input configuration to customize the barcode scanning experience
|
5401
|
+
*/
|
5402
|
+
function scanBarCode(callback, config) {
|
5403
|
+
if (!callback) {
|
5404
|
+
throw new Error('[media.scanBarCode] Callback cannot be null');
|
5319
5405
|
}
|
5320
5406
|
ensureInitialized(FrameContexts.content, FrameContexts.task);
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5324
|
-
|
5325
|
-
|
5326
|
-
|
5327
|
-
|
5328
|
-
|
5329
|
-
|
5330
|
-
|
5331
|
-
|
5332
|
-
|
5333
|
-
|
5334
|
-
|
5335
|
-
|
5336
|
-
|
5337
|
-
|
5338
|
-
|
5339
|
-
|
5340
|
-
|
5341
|
-
|
5407
|
+
if (GlobalVars.hostClientType === HostClientType.desktop ||
|
5408
|
+
GlobalVars.hostClientType === HostClientType.web ||
|
5409
|
+
GlobalVars.hostClientType === HostClientType.rigel ||
|
5410
|
+
GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||
|
5411
|
+
GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
|
5412
|
+
GlobalVars.hostClientType === HostClientType.teamsPhones ||
|
5413
|
+
GlobalVars.hostClientType === HostClientType.teamsDisplays) {
|
5414
|
+
var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
|
5415
|
+
callback(notSupportedError, null);
|
5416
|
+
return;
|
5417
|
+
}
|
5418
|
+
if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {
|
5419
|
+
var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
5420
|
+
callback(oldPlatformError, null);
|
5421
|
+
return;
|
5422
|
+
}
|
5423
|
+
if (!validateScanBarCodeInput(config)) {
|
5424
|
+
var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
5425
|
+
callback(invalidInput, null);
|
5426
|
+
return;
|
5427
|
+
}
|
5428
|
+
sendMessageToParent('media.scanBarCode', [config], callback);
|
5342
5429
|
}
|
5343
5430
|
media.scanBarCode = scanBarCode;
|
5344
|
-
function isSupported() {
|
5345
|
-
return runtime.supports.media ? true : false;
|
5346
|
-
}
|
5347
|
-
media.isSupported = isSupported;
|
5348
5431
|
})(media || (media = {}));
|
5349
5432
|
|
5350
5433
|
;// CONCATENATED MODULE: ./src/public/location.ts
|
@@ -5410,10 +5493,9 @@ var location_location;
|
|
5410
5493
|
|
5411
5494
|
|
5412
5495
|
|
5413
|
-
|
5414
|
-
|
5415
5496
|
/**
|
5416
|
-
* @
|
5497
|
+
* @deprecated
|
5498
|
+
* As of 2.0.0-beta.6, use meeting only for backwards compatibility of existing code.
|
5417
5499
|
*/
|
5418
5500
|
var meeting;
|
5419
5501
|
(function (meeting) {
|
@@ -5426,102 +5508,156 @@ var meeting;
|
|
5426
5508
|
MeetingType["Broadcast"] = "Broadcast";
|
5427
5509
|
MeetingType["MeetNow"] = "MeetNow";
|
5428
5510
|
})(MeetingType = meeting.MeetingType || (meeting.MeetingType = {}));
|
5511
|
+
var CallType;
|
5512
|
+
(function (CallType) {
|
5513
|
+
CallType["OneOnOneCall"] = "oneOnOneCall";
|
5514
|
+
CallType["GroupCall"] = "groupCall";
|
5515
|
+
})(CallType = meeting.CallType || (meeting.CallType = {}));
|
5516
|
+
/**
|
5517
|
+
* @deprecated
|
5518
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5519
|
+
*
|
5520
|
+
* Allows an app to get the incoming audio speaker setting for the meeting user
|
5521
|
+
*
|
5522
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5523
|
+
*
|
5524
|
+
* error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
|
5525
|
+
* result can either contain the true/false value, incase of a successful fetch or null when the fetching fails
|
5526
|
+
* result: True means incoming audio is muted and false means incoming audio is unmuted
|
5527
|
+
*/
|
5429
5528
|
function getIncomingClientAudioState(callback) {
|
5529
|
+
if (!callback) {
|
5530
|
+
throw new Error('[get incoming client audio state] Callback cannot be null');
|
5531
|
+
}
|
5430
5532
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5431
|
-
|
5533
|
+
sendMessageToParent('getIncomingClientAudioState', callback);
|
5432
5534
|
}
|
5433
5535
|
meeting.getIncomingClientAudioState = getIncomingClientAudioState;
|
5434
|
-
|
5435
|
-
|
5436
|
-
|
5437
|
-
|
5438
|
-
|
5536
|
+
/**
|
5537
|
+
* @deprecated
|
5538
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5539
|
+
*
|
5540
|
+
* Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa
|
5541
|
+
*
|
5542
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5543
|
+
* error can either contain an error of type SdkError, incase of an error, or null when toggle is successful
|
5544
|
+
* result can either contain the true/false value, incase of a successful toggle or null when the toggling fails
|
5545
|
+
* result: True means incoming audio is muted and false means incoming audio is unmuted
|
5546
|
+
*/
|
5439
5547
|
function toggleIncomingClientAudio(callback) {
|
5548
|
+
if (!callback) {
|
5549
|
+
throw new Error('[toggle incoming client audio] Callback cannot be null');
|
5550
|
+
}
|
5440
5551
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5441
|
-
|
5552
|
+
sendMessageToParent('toggleIncomingClientAudio', callback);
|
5442
5553
|
}
|
5443
5554
|
meeting.toggleIncomingClientAudio = toggleIncomingClientAudio;
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5555
|
+
/**
|
5556
|
+
* @deprecated
|
5557
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5558
|
+
*
|
5559
|
+
* @hidden
|
5560
|
+
* Hide from docs
|
5561
|
+
*
|
5562
|
+
* Allows an app to get the meeting details for the meeting
|
5563
|
+
*
|
5564
|
+
* @param callback - Callback contains 2 parameters, error and meetingDetailsResponse.
|
5565
|
+
* error can either contain an error of type SdkError, incase of an error, or null when get is successful
|
5566
|
+
* result can either contain a IMeetingDetailsResponse value, incase of a successful get or null when the get fails
|
5567
|
+
*
|
5568
|
+
* @internal
|
5569
|
+
*/
|
5449
5570
|
function getMeetingDetails(callback) {
|
5571
|
+
if (!callback) {
|
5572
|
+
throw new Error('[get meeting details] Callback cannot be null');
|
5573
|
+
}
|
5450
5574
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
|
5451
|
-
|
5575
|
+
sendMessageToParent('meeting.getMeetingDetails', callback);
|
5452
5576
|
}
|
5453
5577
|
meeting.getMeetingDetails = getMeetingDetails;
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5457
|
-
|
5458
|
-
|
5578
|
+
/**
|
5579
|
+
* @deprecated
|
5580
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5581
|
+
*
|
5582
|
+
* @hidden
|
5583
|
+
* Allows an app to get the authentication token for the anonymous or guest user in the meeting
|
5584
|
+
*
|
5585
|
+
* @param callback - Callback contains 2 parameters, error and authenticationTokenOfAnonymousUser.
|
5586
|
+
* error can either contain an error of type SdkError, incase of an error, or null when get is successful
|
5587
|
+
* authenticationTokenOfAnonymousUser can either contain a string value, incase of a successful get or null when the get fails
|
5588
|
+
*
|
5589
|
+
* @internal
|
5590
|
+
*/
|
5459
5591
|
function getAuthenticationTokenForAnonymousUser(callback) {
|
5592
|
+
if (!callback) {
|
5593
|
+
throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
|
5594
|
+
}
|
5460
5595
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5461
|
-
|
5596
|
+
sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);
|
5462
5597
|
}
|
5463
5598
|
meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5599
|
+
/**
|
5600
|
+
* @deprecated
|
5601
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5602
|
+
*
|
5603
|
+
* Allows an app to get the state of the live stream in the current meeting
|
5604
|
+
*
|
5605
|
+
* @param callback - Callback contains 2 parameters: error and liveStreamState.
|
5606
|
+
* error can either contain an error of type SdkError, in case of an error, or null when get is successful
|
5607
|
+
* liveStreamState can either contain a LiveStreamState value, or null when operation fails
|
5608
|
+
*/
|
5473
5609
|
function getLiveStreamState(callback) {
|
5474
|
-
|
5475
|
-
|
5610
|
+
if (!callback) {
|
5611
|
+
throw new Error('[get live stream state] Callback cannot be null');
|
5612
|
+
}
|
5613
|
+
ensureInitialized(FrameContexts.sidePanel);
|
5614
|
+
sendMessageToParent('meeting.getLiveStreamState', callback);
|
5476
5615
|
}
|
5477
5616
|
meeting.getLiveStreamState = getLiveStreamState;
|
5478
|
-
function getLiveStreamStateHelper() {
|
5479
|
-
return new Promise(function (resolve) {
|
5480
|
-
resolve(sendAndHandleSdkError('meeting.getLiveStreamState'));
|
5481
|
-
});
|
5482
|
-
}
|
5483
5617
|
/**
|
5484
|
-
* @
|
5485
|
-
*
|
5486
|
-
*
|
5487
|
-
*
|
5488
|
-
*
|
5489
|
-
* @
|
5490
|
-
*
|
5491
|
-
*
|
5618
|
+
* @deprecated
|
5619
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5620
|
+
*
|
5621
|
+
* Allows an app to request the live streaming be started at the given streaming url
|
5622
|
+
*
|
5623
|
+
* @remarks
|
5624
|
+
* Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state
|
5625
|
+
*
|
5626
|
+
* @param streamUrl - the url to the stream resource
|
5627
|
+
* @param streamKey - the key to the stream resource
|
5628
|
+
* @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful
|
5492
5629
|
*/
|
5493
|
-
function requestStartLiveStreaming(
|
5494
|
-
|
5495
|
-
|
5496
|
-
var streamUrl;
|
5497
|
-
var streamKey;
|
5498
|
-
var callback;
|
5499
|
-
if (typeof param1 === 'function') {
|
5500
|
-
// Legacy code, with callbacks.
|
5501
|
-
_a = [param1, param2, param3], callback = _a[0], streamUrl = _a[1], streamKey = _a[2];
|
5502
|
-
}
|
5503
|
-
else if (typeof param1 === 'string') {
|
5504
|
-
_b = [param1, param2], streamUrl = _b[0], streamKey = _b[1];
|
5630
|
+
function requestStartLiveStreaming(callback, streamUrl, streamKey) {
|
5631
|
+
if (!callback) {
|
5632
|
+
throw new Error('[request start live streaming] Callback cannot be null');
|
5505
5633
|
}
|
5506
|
-
|
5634
|
+
ensureInitialized(FrameContexts.sidePanel);
|
5635
|
+
sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);
|
5507
5636
|
}
|
5508
5637
|
meeting.requestStartLiveStreaming = requestStartLiveStreaming;
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5513
|
-
|
5638
|
+
/**
|
5639
|
+
* @deprecated
|
5640
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5641
|
+
*
|
5642
|
+
* Allows an app to request the live streaming be stopped at the given streaming url
|
5643
|
+
*
|
5644
|
+
* @remarks
|
5645
|
+
* Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state
|
5646
|
+
*
|
5647
|
+
* @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful
|
5648
|
+
*/
|
5514
5649
|
function requestStopLiveStreaming(callback) {
|
5650
|
+
if (!callback) {
|
5651
|
+
throw new Error('[request stop live streaming] Callback cannot be null');
|
5652
|
+
}
|
5515
5653
|
ensureInitialized(FrameContexts.sidePanel);
|
5516
|
-
|
5654
|
+
sendMessageToParent('meeting.requestStopLiveStreaming', callback);
|
5517
5655
|
}
|
5518
5656
|
meeting.requestStopLiveStreaming = requestStopLiveStreaming;
|
5519
|
-
function requestStopLiveStreamingHelper() {
|
5520
|
-
return new Promise(function (resolve) {
|
5521
|
-
resolve(sendAndHandleSdkError('meeting.requestStopLiveStreaming'));
|
5522
|
-
});
|
5523
|
-
}
|
5524
5657
|
/**
|
5658
|
+
* @deprecated
|
5659
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5660
|
+
*
|
5525
5661
|
* Registers a handler for changes to the live stream.
|
5526
5662
|
*
|
5527
5663
|
* @remarks
|
@@ -5538,81 +5674,90 @@ var meeting;
|
|
5538
5674
|
}
|
5539
5675
|
meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
|
5540
5676
|
/**
|
5541
|
-
*
|
5542
|
-
*
|
5543
|
-
*
|
5544
|
-
*
|
5545
|
-
*
|
5546
|
-
* @
|
5677
|
+
* @deprecated
|
5678
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5679
|
+
*
|
5680
|
+
* Allows an app to share contents in the meeting
|
5681
|
+
*
|
5682
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5683
|
+
* error can either contain an error of type SdkError, incase of an error, or null when share is successful
|
5684
|
+
* result can either contain a true value, incase of a successful share or null when the share fails
|
5685
|
+
* @param appContentUrl - is the input URL which needs to be shared on to the stage
|
5547
5686
|
*/
|
5548
|
-
function shareAppContentToStage(
|
5549
|
-
|
5550
|
-
|
5551
|
-
var appContentUrl;
|
5552
|
-
var callback;
|
5553
|
-
if (typeof param1 === 'function') {
|
5554
|
-
// Legacy callback
|
5555
|
-
_a = [param1, param2], callback = _a[0], appContentUrl = _a[1];
|
5556
|
-
}
|
5557
|
-
else {
|
5558
|
-
appContentUrl = param1;
|
5687
|
+
function shareAppContentToStage(callback, appContentUrl) {
|
5688
|
+
if (!callback) {
|
5689
|
+
throw new Error('[share app content to stage] Callback cannot be null');
|
5559
5690
|
}
|
5560
|
-
|
5691
|
+
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5692
|
+
sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);
|
5561
5693
|
}
|
5562
5694
|
meeting.shareAppContentToStage = shareAppContentToStage;
|
5563
5695
|
/**
|
5564
|
-
* @
|
5565
|
-
*
|
5566
|
-
*
|
5567
|
-
*
|
5696
|
+
* @deprecated
|
5697
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5698
|
+
*
|
5699
|
+
* Provides information related app's in-meeting sharing capabilities
|
5700
|
+
*
|
5701
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5702
|
+
* error can either contain an error of type SdkError (error indication), or null (non-error indication)
|
5703
|
+
* appContentStageSharingCapabilities can either contain an IAppContentStageSharingCapabilities object
|
5704
|
+
* (indication of successful retrieval), or null (indication of failed retrieval)
|
5568
5705
|
*/
|
5569
|
-
function shareAppContentToStageHelper(appContentUrl) {
|
5570
|
-
return new Promise(function (resolve) {
|
5571
|
-
resolve(sendAndHandleSdkError('meeting.shareAppContentToStage', appContentUrl));
|
5572
|
-
});
|
5573
|
-
}
|
5574
5706
|
function getAppContentStageSharingCapabilities(callback) {
|
5707
|
+
if (!callback) {
|
5708
|
+
throw new Error('[get app content stage sharing capabilities] Callback cannot be null');
|
5709
|
+
}
|
5575
5710
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5576
|
-
|
5711
|
+
sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);
|
5577
5712
|
}
|
5578
5713
|
meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
|
5579
5714
|
/**
|
5715
|
+
* @deprecated
|
5716
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5717
|
+
*
|
5580
5718
|
* @hidden
|
5581
|
-
*
|
5719
|
+
* Hide from docs.
|
5720
|
+
* Terminates current stage sharing session in meeting
|
5721
|
+
*
|
5722
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5723
|
+
* error can either contain an error of type SdkError (error indication), or null (non-error indication)
|
5724
|
+
* result can either contain a true boolean value (successful termination), or null (unsuccessful fetch)
|
5582
5725
|
*/
|
5583
|
-
function getAppContentStageSharingCapabilitiesHelper() {
|
5584
|
-
return new Promise(function (resolve) {
|
5585
|
-
resolve(sendAndHandleSdkError('meeting.getAppContentStageSharingCapabilities'));
|
5586
|
-
});
|
5587
|
-
}
|
5588
5726
|
function stopSharingAppContentToStage(callback) {
|
5727
|
+
if (!callback) {
|
5728
|
+
throw new Error('[stop sharing app content to stage] Callback cannot be null');
|
5729
|
+
}
|
5589
5730
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5590
|
-
|
5731
|
+
sendMessageToParent('meeting.stopSharingAppContentToStage', callback);
|
5591
5732
|
}
|
5592
5733
|
meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
|
5593
5734
|
/**
|
5594
|
-
* @
|
5595
|
-
*
|
5735
|
+
* @deprecated
|
5736
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5737
|
+
*
|
5738
|
+
* Provides information related to current stage sharing state for app
|
5739
|
+
*
|
5740
|
+
* @param callback - Callback contains 2 parameters, error and result.
|
5741
|
+
* error can either contain an error of type SdkError (error indication), or null (non-error indication)
|
5742
|
+
* appContentStageSharingState can either contain an IAppContentStageSharingState object
|
5743
|
+
* (indication of successful retrieval), or null (indication of failed retrieval)
|
5596
5744
|
*/
|
5597
|
-
function stopSharingAppContentToStageHelper() {
|
5598
|
-
return new Promise(function (resolve) {
|
5599
|
-
resolve(sendAndHandleSdkError('meeting.stopSharingAppContentToStage'));
|
5600
|
-
});
|
5601
|
-
}
|
5602
5745
|
function getAppContentStageSharingState(callback) {
|
5746
|
+
if (!callback) {
|
5747
|
+
throw new Error('[get app content stage sharing state] Callback cannot be null');
|
5748
|
+
}
|
5603
5749
|
ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5604
|
-
|
5750
|
+
sendMessageToParent('meeting.getAppContentStageSharingState', callback);
|
5605
5751
|
}
|
5606
5752
|
meeting.getAppContentStageSharingState = getAppContentStageSharingState;
|
5607
|
-
function getAppContentStageSharingStateHelper() {
|
5608
|
-
return new Promise(function (resolve) {
|
5609
|
-
resolve(sendAndHandleSdkError('meeting.getAppContentStageSharingState'));
|
5610
|
-
});
|
5611
|
-
}
|
5612
5753
|
/**
|
5754
|
+
* @deprecated
|
5755
|
+
* As of 2.0.0-beta.6, use only for backwards compatibility of existing code.
|
5756
|
+
*
|
5613
5757
|
* Registers a handler for changes to paticipant speaking states. If any participant is speaking, isSpeakingDetected
|
5614
5758
|
* will be true. If no participants are speaking, isSpeakingDetected will be false. Only one handler can be registered
|
5615
5759
|
* at a time. A subsequent registration replaces an existing registration.
|
5760
|
+
*
|
5616
5761
|
* @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
|
5617
5762
|
*/
|
5618
5763
|
function registerSpeakingStateChangeHandler(handler) {
|
@@ -6842,16 +6987,11 @@ var tasks;
|
|
6842
6987
|
|
6843
6988
|
|
6844
6989
|
|
6845
|
-
|
6846
|
-
|
6847
|
-
|
6848
6990
|
/**
|
6849
6991
|
* @hidden
|
6850
6992
|
* Hide from docs
|
6851
6993
|
* ------
|
6852
6994
|
* Namespace to interact with the files specific part of the SDK.
|
6853
|
-
*
|
6854
|
-
* @alpha
|
6855
6995
|
*/
|
6856
6996
|
var files;
|
6857
6997
|
(function (files_1) {
|
@@ -6924,22 +7064,20 @@ var files;
|
|
6924
7064
|
/**
|
6925
7065
|
* @hidden
|
6926
7066
|
* Hide from docs
|
6927
|
-
* ------
|
6928
|
-
* Gets a list of cloud storage folders added to the channel
|
6929
7067
|
*
|
7068
|
+
* Gets a list of cloud storage folders added to the channel
|
6930
7069
|
* @param channelId - ID of the channel whose cloud storage folders should be retrieved
|
7070
|
+
* @param callback - Callback that will be triggered post folders load
|
6931
7071
|
*/
|
6932
|
-
function getCloudStorageFolders(channelId) {
|
6933
|
-
|
6934
|
-
|
6935
|
-
|
6936
|
-
|
6937
|
-
|
6938
|
-
|
6939
|
-
|
6940
|
-
|
6941
|
-
resolve(sendAndHandleSdkError('files.getCloudStorageFolders', channelId));
|
6942
|
-
});
|
7072
|
+
function getCloudStorageFolders(channelId, callback) {
|
7073
|
+
ensureInitialized(FrameContexts.content);
|
7074
|
+
if (!channelId || channelId.length === 0) {
|
7075
|
+
throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
|
7076
|
+
}
|
7077
|
+
if (!callback) {
|
7078
|
+
throw new Error('[files.getCloudStorageFolders] Callback cannot be null');
|
7079
|
+
}
|
7080
|
+
sendMessageToParent('files.getCloudStorageFolders', [channelId], callback);
|
6943
7081
|
}
|
6944
7082
|
files_1.getCloudStorageFolders = getCloudStorageFolders;
|
6945
7083
|
/**
|
@@ -6947,82 +7085,76 @@ var files;
|
|
6947
7085
|
* Hide from docs
|
6948
7086
|
* ------
|
6949
7087
|
* Initiates the add cloud storage folder flow
|
7088
|
+
*
|
6950
7089
|
* @param channelId - ID of the channel to add cloud storage folder
|
7090
|
+
* @param callback - Callback that will be triggered post add folder flow is compelete
|
6951
7091
|
*/
|
6952
|
-
function addCloudStorageFolder(channelId) {
|
6953
|
-
|
6954
|
-
|
6955
|
-
|
6956
|
-
|
6957
|
-
|
6958
|
-
|
6959
|
-
|
6960
|
-
|
6961
|
-
resolve(sendMessageToParentAsync('files.addCloudStorageFolder', [channelId]));
|
6962
|
-
}).then(function (_a) {
|
6963
|
-
var error = _a[0], isFolderAdded = _a[1], folders = _a[2];
|
6964
|
-
if (error) {
|
6965
|
-
throw error;
|
6966
|
-
}
|
6967
|
-
var result = [isFolderAdded, folders];
|
6968
|
-
return result;
|
6969
|
-
});
|
7092
|
+
function addCloudStorageFolder(channelId, callback) {
|
7093
|
+
ensureInitialized(FrameContexts.content);
|
7094
|
+
if (!channelId || channelId.length === 0) {
|
7095
|
+
throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
|
7096
|
+
}
|
7097
|
+
if (!callback) {
|
7098
|
+
throw new Error('[files.addCloudStorageFolder] Callback cannot be null');
|
7099
|
+
}
|
7100
|
+
sendMessageToParent('files.addCloudStorageFolder', [channelId], callback);
|
6970
7101
|
}
|
6971
7102
|
files_1.addCloudStorageFolder = addCloudStorageFolder;
|
6972
7103
|
/**
|
6973
7104
|
* @hidden
|
6974
7105
|
* Hide from docs
|
6975
7106
|
* ------
|
7107
|
+
*
|
6976
7108
|
* Deletes a cloud storage folder from channel
|
6977
7109
|
*
|
6978
7110
|
* @param channelId - ID of the channel where folder is to be deleted
|
6979
7111
|
* @param folderToDelete - cloud storage folder to be deleted
|
7112
|
+
* @param callback - Callback that will be triggered post delete
|
6980
7113
|
*/
|
6981
|
-
function deleteCloudStorageFolder(channelId, folderToDelete) {
|
6982
|
-
|
6983
|
-
|
6984
|
-
|
6985
|
-
|
6986
|
-
|
6987
|
-
|
6988
|
-
|
6989
|
-
|
6990
|
-
|
6991
|
-
|
6992
|
-
|
6993
|
-
resolve(sendAndHandleSdkError('files.deleteCloudStorageFolder', channelId, folderToDelete));
|
6994
|
-
});
|
7114
|
+
function deleteCloudStorageFolder(channelId, folderToDelete, callback) {
|
7115
|
+
ensureInitialized(FrameContexts.content);
|
7116
|
+
if (!channelId) {
|
7117
|
+
throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
|
7118
|
+
}
|
7119
|
+
if (!folderToDelete) {
|
7120
|
+
throw new Error('[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty');
|
7121
|
+
}
|
7122
|
+
if (!callback) {
|
7123
|
+
throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');
|
7124
|
+
}
|
7125
|
+
sendMessageToParent('files.deleteCloudStorageFolder', [channelId, folderToDelete], callback);
|
6995
7126
|
}
|
6996
7127
|
files_1.deleteCloudStorageFolder = deleteCloudStorageFolder;
|
6997
7128
|
/**
|
6998
7129
|
* @hidden
|
6999
7130
|
* Hide from docs
|
7000
7131
|
* ------
|
7132
|
+
*
|
7001
7133
|
* Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory
|
7002
7134
|
*
|
7003
7135
|
* @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)
|
7004
7136
|
* @param providerCode - Code of the cloud storage folder provider
|
7137
|
+
* @param callback - Callback that will be triggered post contents are loaded
|
7005
7138
|
*/
|
7006
|
-
function getCloudStorageFolderContents(folder, providerCode) {
|
7007
|
-
|
7008
|
-
|
7009
|
-
|
7010
|
-
|
7011
|
-
|
7012
|
-
|
7013
|
-
|
7014
|
-
|
7015
|
-
|
7016
|
-
|
7017
|
-
|
7018
|
-
resolve(sendAndHandleSdkError('files.getCloudStorageFolderContents', folder, providerCode));
|
7019
|
-
});
|
7139
|
+
function getCloudStorageFolderContents(folder, providerCode, callback) {
|
7140
|
+
ensureInitialized(FrameContexts.content);
|
7141
|
+
if (!folder || !providerCode) {
|
7142
|
+
throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
|
7143
|
+
}
|
7144
|
+
if (!callback) {
|
7145
|
+
throw new Error('[files.getCloudStorageFolderContents] Callback cannot be null');
|
7146
|
+
}
|
7147
|
+
if ('isSubdirectory' in folder && !folder.isSubdirectory) {
|
7148
|
+
throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');
|
7149
|
+
}
|
7150
|
+
sendMessageToParent('files.getCloudStorageFolderContents', [folder, providerCode], callback);
|
7020
7151
|
}
|
7021
7152
|
files_1.getCloudStorageFolderContents = getCloudStorageFolderContents;
|
7022
7153
|
/**
|
7023
7154
|
* @hidden
|
7024
7155
|
* Hide from docs
|
7025
7156
|
* ------
|
7157
|
+
*
|
7026
7158
|
* Open a cloud storage file in teams
|
7027
7159
|
*
|
7028
7160
|
* @param file - cloud storage file that should be opened
|
@@ -7031,9 +7163,6 @@ var files;
|
|
7031
7163
|
*/
|
7032
7164
|
function openCloudStorageFile(file, providerCode, fileOpenPreference) {
|
7033
7165
|
ensureInitialized(FrameContexts.content);
|
7034
|
-
if (!isSupported()) {
|
7035
|
-
throw errorNotSupportedOnPlatform;
|
7036
|
-
}
|
7037
7166
|
if (!file || !providerCode) {
|
7038
7167
|
throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
|
7039
7168
|
}
|
@@ -7043,38 +7172,6 @@ var files;
|
|
7043
7172
|
sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);
|
7044
7173
|
}
|
7045
7174
|
files_1.openCloudStorageFile = openCloudStorageFile;
|
7046
|
-
/**
|
7047
|
-
* @hidden
|
7048
|
-
* Hide from docs.
|
7049
|
-
* ------
|
7050
|
-
* Opens a client-friendly preview of the specified file.
|
7051
|
-
*
|
7052
|
-
* @param file - The file to preview.
|
7053
|
-
*/
|
7054
|
-
function openFilePreview(filePreviewParameters) {
|
7055
|
-
ensureInitialized(FrameContexts.content);
|
7056
|
-
if (!isSupported()) {
|
7057
|
-
throw errorNotSupportedOnPlatform;
|
7058
|
-
}
|
7059
|
-
var params = [
|
7060
|
-
filePreviewParameters.entityId,
|
7061
|
-
filePreviewParameters.title,
|
7062
|
-
filePreviewParameters.description,
|
7063
|
-
filePreviewParameters.type,
|
7064
|
-
filePreviewParameters.objectUrl,
|
7065
|
-
filePreviewParameters.downloadUrl,
|
7066
|
-
filePreviewParameters.webPreviewUrl,
|
7067
|
-
filePreviewParameters.webEditUrl,
|
7068
|
-
filePreviewParameters.baseUrl,
|
7069
|
-
filePreviewParameters.editFile,
|
7070
|
-
filePreviewParameters.subEntityId,
|
7071
|
-
filePreviewParameters.viewerAction,
|
7072
|
-
filePreviewParameters.fileOpenPreference,
|
7073
|
-
filePreviewParameters.conversationId,
|
7074
|
-
];
|
7075
|
-
sendMessageToParent('openFilePreview', params);
|
7076
|
-
}
|
7077
|
-
files_1.openFilePreview = openFilePreview;
|
7078
7175
|
/**
|
7079
7176
|
* @hidden
|
7080
7177
|
* Allow 1st party apps to call this function to get the external
|
@@ -7082,15 +7179,13 @@ var files;
|
|
7082
7179
|
* @param excludeAddedProviders: return a list of support third party
|
7083
7180
|
* cloud storages that hasn't been added yet.
|
7084
7181
|
*/
|
7085
|
-
function getExternalProviders(excludeAddedProviders) {
|
7182
|
+
function getExternalProviders(excludeAddedProviders, callback) {
|
7086
7183
|
if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
|
7087
|
-
|
7088
|
-
|
7089
|
-
|
7090
|
-
|
7091
|
-
|
7092
|
-
resolve(sendAndHandleSdkError('files.getExternalProviders', excludeAddedProviders));
|
7093
|
-
});
|
7184
|
+
ensureInitialized(FrameContexts.content);
|
7185
|
+
if (!callback) {
|
7186
|
+
throw new Error('[files.getExternalProviders] Callback cannot be null');
|
7187
|
+
}
|
7188
|
+
sendMessageToParent('files.getExternalProviders', [excludeAddedProviders], callback);
|
7094
7189
|
}
|
7095
7190
|
files_1.getExternalProviders = getExternalProviders;
|
7096
7191
|
/**
|
@@ -7098,42 +7193,41 @@ var files;
|
|
7098
7193
|
* Allow 1st party apps to call this function to move files
|
7099
7194
|
* among SharePoint and third party cloud storages.
|
7100
7195
|
*/
|
7101
|
-
function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove) {
|
7196
|
+
function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove, callback) {
|
7102
7197
|
if (isMove === void 0) { isMove = false; }
|
7103
|
-
|
7104
|
-
|
7105
|
-
|
7106
|
-
|
7107
|
-
|
7108
|
-
|
7109
|
-
|
7110
|
-
|
7111
|
-
|
7112
|
-
|
7113
|
-
|
7114
|
-
|
7115
|
-
|
7116
|
-
|
7117
|
-
|
7118
|
-
|
7119
|
-
|
7120
|
-
resolve(sendAndHandleSdkError('files.copyMoveFiles', selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove));
|
7121
|
-
});
|
7198
|
+
ensureInitialized(FrameContexts.content);
|
7199
|
+
if (!selectedFiles || selectedFiles.length === 0) {
|
7200
|
+
throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
|
7201
|
+
}
|
7202
|
+
if (!providerCode) {
|
7203
|
+
throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');
|
7204
|
+
}
|
7205
|
+
if (!destinationFolder) {
|
7206
|
+
throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');
|
7207
|
+
}
|
7208
|
+
if (!destinationProviderCode) {
|
7209
|
+
throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');
|
7210
|
+
}
|
7211
|
+
if (!callback) {
|
7212
|
+
throw new Error('[files.copyMoveFiles] callback cannot be null');
|
7213
|
+
}
|
7214
|
+
sendMessageToParent('files.copyMoveFiles', [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove], callback);
|
7122
7215
|
}
|
7123
7216
|
files_1.copyMoveFiles = copyMoveFiles;
|
7124
|
-
|
7125
|
-
|
7126
|
-
|
7127
|
-
|
7217
|
+
/**
|
7218
|
+
* @hidden
|
7219
|
+
* Hide from docs
|
7220
|
+
* ------
|
7221
|
+
*
|
7222
|
+
* Gets list of downloads for current user
|
7223
|
+
* @param callback Callback that will be triggered post downloads load
|
7224
|
+
*/
|
7128
7225
|
function getFileDownloads(callback) {
|
7129
7226
|
ensureInitialized(FrameContexts.content);
|
7130
|
-
if (!
|
7131
|
-
throw
|
7227
|
+
if (!callback) {
|
7228
|
+
throw new Error('[files.getFileDownloads] Callback cannot be null');
|
7132
7229
|
}
|
7133
|
-
|
7134
|
-
return new Promise(function (resolve) { return resolve(sendAndHandleSdkError('files.getFileDownloads', [])); });
|
7135
|
-
};
|
7136
|
-
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(wrappedFunction, callback);
|
7230
|
+
sendMessageToParent('files.getFileDownloads', [], callback);
|
7137
7231
|
}
|
7138
7232
|
files_1.getFileDownloads = getFileDownloads;
|
7139
7233
|
/**
|
@@ -7141,15 +7235,12 @@ var files;
|
|
7141
7235
|
* Hide from docs
|
7142
7236
|
*
|
7143
7237
|
* Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId
|
7144
|
-
* @param fileObjectId Id of the file whose containing folder should be opened
|
7238
|
+
* @param fileObjectId - Id of the file whose containing folder should be opened
|
7145
7239
|
* @param callback Callback that will be triggered post open download folder/path
|
7146
7240
|
*/
|
7147
7241
|
function openDownloadFolder(fileObjectId, callback) {
|
7148
7242
|
if (fileObjectId === void 0) { fileObjectId = undefined; }
|
7149
7243
|
ensureInitialized(FrameContexts.content);
|
7150
|
-
if (!isSupported()) {
|
7151
|
-
throw errorNotSupportedOnPlatform;
|
7152
|
-
}
|
7153
7244
|
if (!callback) {
|
7154
7245
|
throw new Error('[files.openDownloadFolder] Callback cannot be null');
|
7155
7246
|
}
|