@microsoft/teams-js 2.17.0-beta.1 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +221 -4
- package/dist/MicrosoftTeams.js +362 -58
- 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 +35 -1
package/dist/MicrosoftTeams.js
CHANGED
@@ -891,6 +891,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
891
891
|
version: () => (/* reexport */ version),
|
892
892
|
videoEffects: () => (/* reexport */ videoEffects),
|
893
893
|
videoEffectsEx: () => (/* reexport */ videoEffectsEx),
|
894
|
+
visualMedia: () => (/* reexport */ visualMedia),
|
894
895
|
webStorage: () => (/* reexport */ webStorage)
|
895
896
|
});
|
896
897
|
|
@@ -1030,6 +1031,11 @@ var validOrigins = [
|
|
1030
1031
|
'www.microsoft365.com',
|
1031
1032
|
'bing.com',
|
1032
1033
|
'edgeservices.bing.com',
|
1034
|
+
'www.bing.com',
|
1035
|
+
'www.staging-bing-int.com',
|
1036
|
+
'teams.cloud.microsoft',
|
1037
|
+
'outlook.cloud.microsoft',
|
1038
|
+
'm365.cloud.microsoft',
|
1033
1039
|
];
|
1034
1040
|
/**
|
1035
1041
|
* @hidden
|
@@ -1476,6 +1482,20 @@ var minAdaptiveCardVersion = { majorVersion: 1, minorVersion: 5 };
|
|
1476
1482
|
var teamsMinAdaptiveCardVersion = {
|
1477
1483
|
adaptiveCardSchemaVersion: { majorVersion: 1, minorVersion: 5 },
|
1478
1484
|
};
|
1485
|
+
/**
|
1486
|
+
* @hidden
|
1487
|
+
* An error object indicates that the image count from visualMedia.image API is invalid.
|
1488
|
+
*
|
1489
|
+
* @beta
|
1490
|
+
*/
|
1491
|
+
var errorInvalidCount = new Error('Invalid input count: Must supply a valid image count (limit of 10).');
|
1492
|
+
/**
|
1493
|
+
* @hidden
|
1494
|
+
* An error object indicates that the response from the visualMedia.image API is invalid.
|
1495
|
+
*
|
1496
|
+
* @beta
|
1497
|
+
*/
|
1498
|
+
var errorInvalidResponse = new Error('Invalid response: Received more images than the specified max limit in the response.');
|
1479
1499
|
|
1480
1500
|
;// CONCATENATED MODULE: ./src/internal/utils.ts
|
1481
1501
|
/* eslint-disable @typescript-eslint/ban-types */
|
@@ -1936,6 +1956,15 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1936
1956
|
}
|
1937
1957
|
return t;
|
1938
1958
|
};
|
1959
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
1960
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
1961
|
+
if (ar || !(i in from)) {
|
1962
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
1963
|
+
ar[i] = from[i];
|
1964
|
+
}
|
1965
|
+
}
|
1966
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
1967
|
+
};
|
1939
1968
|
|
1940
1969
|
|
1941
1970
|
|
@@ -1979,9 +2008,7 @@ var versionAndPlatformAgnosticTeamsRuntimeConfig = {
|
|
1979
2008
|
isLegacyTeams: true,
|
1980
2009
|
supports: {
|
1981
2010
|
app: {
|
1982
|
-
lifecycle: {
|
1983
|
-
caching: {},
|
1984
|
-
},
|
2011
|
+
lifecycle: {},
|
1985
2012
|
},
|
1986
2013
|
appInstallDialog: {},
|
1987
2014
|
appEntity: {},
|
@@ -2004,14 +2031,11 @@ var versionAndPlatformAgnosticTeamsRuntimeConfig = {
|
|
2004
2031
|
monetization: {},
|
2005
2032
|
notifications: {},
|
2006
2033
|
pages: {
|
2007
|
-
appButton: {},
|
2008
|
-
tabs: {},
|
2009
2034
|
config: {},
|
2010
2035
|
backStack: {},
|
2011
2036
|
fullTrust: {},
|
2012
2037
|
},
|
2013
2038
|
remoteCamera: {},
|
2014
|
-
stageView: {},
|
2015
2039
|
teams: {
|
2016
2040
|
fullTrust: {},
|
2017
2041
|
},
|
@@ -2021,11 +2045,9 @@ var versionAndPlatformAgnosticTeamsRuntimeConfig = {
|
|
2021
2045
|
},
|
2022
2046
|
},
|
2023
2047
|
};
|
2024
|
-
var
|
2048
|
+
var v1NonMobileHostClientTypes = [
|
2025
2049
|
HostClientType.desktop,
|
2026
2050
|
HostClientType.web,
|
2027
|
-
HostClientType.android,
|
2028
|
-
HostClientType.ios,
|
2029
2051
|
HostClientType.rigel,
|
2030
2052
|
HostClientType.surfaceHub,
|
2031
2053
|
HostClientType.teamsRoomsWindows,
|
@@ -2033,6 +2055,8 @@ var v1HostClientTypes = [
|
|
2033
2055
|
HostClientType.teamsPhones,
|
2034
2056
|
HostClientType.teamsDisplays,
|
2035
2057
|
];
|
2058
|
+
var v1MobileHostClientTypes = [HostClientType.android, HostClientType.ios, HostClientType.ipados];
|
2059
|
+
var v1HostClientTypes = __spreadArray(__spreadArray([], v1NonMobileHostClientTypes, true), v1MobileHostClientTypes, true);
|
2036
2060
|
/**
|
2037
2061
|
* @hidden
|
2038
2062
|
* Uses upgradeChain to transform an outdated runtime object to the latest format.
|
@@ -2096,6 +2120,15 @@ var upgradeChain = [
|
|
2096
2120
|
},
|
2097
2121
|
];
|
2098
2122
|
var mapTeamsVersionToSupportedCapabilities = {
|
2123
|
+
// 1.0.0 just signifies "these capabilities have practically always been supported." For some of these
|
2124
|
+
// we don't know what the real first version that supported them was -- but it was long enough ago that
|
2125
|
+
// we can just effectively consider them always supported (on the specified platforms)
|
2126
|
+
'1.0.0': [
|
2127
|
+
{
|
2128
|
+
capability: { pages: { appButton: {}, tabs: {} }, stageView: {} },
|
2129
|
+
hostClientTypes: v1NonMobileHostClientTypes,
|
2130
|
+
},
|
2131
|
+
],
|
2099
2132
|
'1.9.0': [
|
2100
2133
|
{
|
2101
2134
|
capability: { location: {} },
|
@@ -2249,7 +2282,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2249
2282
|
* @hidden
|
2250
2283
|
* Package version.
|
2251
2284
|
*/
|
2252
|
-
var version = "2.17.0
|
2285
|
+
var version = "2.17.0";
|
2253
2286
|
|
2254
2287
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2255
2288
|
|
@@ -2386,6 +2419,11 @@ function processAdditionalValidOrigins(validMessageOrigins) {
|
|
2386
2419
|
GlobalVars.additionalValidOrigins = combinedOriginUrls;
|
2387
2420
|
}
|
2388
2421
|
|
2422
|
+
;// CONCATENATED MODULE: ./src/internal/typeCheckUtilities.ts
|
2423
|
+
function isNullOrUndefined(value) {
|
2424
|
+
return value === null || value === undefined;
|
2425
|
+
}
|
2426
|
+
|
2389
2427
|
;// CONCATENATED MODULE: ./src/public/authentication.ts
|
2390
2428
|
|
2391
2429
|
|
@@ -3501,6 +3539,24 @@ var app;
|
|
3501
3539
|
* Number of milliseconds we'll give the initialization call to return before timing it out
|
3502
3540
|
*/
|
3503
3541
|
var initializationTimeoutInMs = 5000;
|
3542
|
+
function logWhereTeamsJsIsBeingUsed() {
|
3543
|
+
if (inServerSideRenderingEnvironment()) {
|
3544
|
+
return;
|
3545
|
+
}
|
3546
|
+
var scripts = document.getElementsByTagName('script');
|
3547
|
+
// This will always be the current script because browsers load and execute scripts in order.
|
3548
|
+
// Whenever a script is executing for the first time it will be the last script in this array.
|
3549
|
+
var currentScriptSrc = scripts && scripts[scripts.length - 1] && scripts[scripts.length - 1].src;
|
3550
|
+
var scriptUsageWarning = 'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';
|
3551
|
+
if (!currentScriptSrc || currentScriptSrc.length === 0) {
|
3552
|
+
appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
|
3553
|
+
}
|
3554
|
+
else {
|
3555
|
+
appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
|
3556
|
+
}
|
3557
|
+
}
|
3558
|
+
// This is called right away to make sure that we capture which script is being executed correctly
|
3559
|
+
logWhereTeamsJsIsBeingUsed();
|
3504
3560
|
/**
|
3505
3561
|
* Initializes the library.
|
3506
3562
|
*
|
@@ -3886,6 +3942,7 @@ function transformLegacyContextToAppContext(legacyContext) {
|
|
3886
3942
|
|
3887
3943
|
|
3888
3944
|
|
3945
|
+
|
3889
3946
|
/**
|
3890
3947
|
* Navigation-specific part of the SDK.
|
3891
3948
|
*/
|
@@ -4039,7 +4096,7 @@ var pages;
|
|
4039
4096
|
*/
|
4040
4097
|
function registerFullScreenHandler(handler) {
|
4041
4098
|
registerHandlerHelper('fullScreenChange', handler, [], function () {
|
4042
|
-
if (handler && !isSupported()) {
|
4099
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
4043
4100
|
throw errorNotSupportedOnPlatform;
|
4044
4101
|
}
|
4045
4102
|
});
|
@@ -4184,7 +4241,7 @@ var pages;
|
|
4184
4241
|
*/
|
4185
4242
|
function registerOnSaveHandler(handler) {
|
4186
4243
|
registerOnSaveHandlerHelper(handler, function () {
|
4187
|
-
if (handler && !isSupported()) {
|
4244
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
4188
4245
|
throw errorNotSupportedOnPlatform;
|
4189
4246
|
}
|
4190
4247
|
});
|
@@ -4202,12 +4259,12 @@ var pages;
|
|
4202
4259
|
*/
|
4203
4260
|
function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
|
4204
4261
|
// allow for registration cleanup even when not finished initializing
|
4205
|
-
handler && ensureInitialized(runtime, FrameContexts.settings);
|
4262
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.settings);
|
4206
4263
|
if (versionSpecificHelper) {
|
4207
4264
|
versionSpecificHelper();
|
4208
4265
|
}
|
4209
4266
|
saveHandler = handler;
|
4210
|
-
handler && sendMessageToParent('registerHandler', ['save']);
|
4267
|
+
!isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['save']);
|
4211
4268
|
}
|
4212
4269
|
config.registerOnSaveHandlerHelper = registerOnSaveHandlerHelper;
|
4213
4270
|
/**
|
@@ -4219,7 +4276,7 @@ var pages;
|
|
4219
4276
|
*/
|
4220
4277
|
function registerOnRemoveHandler(handler) {
|
4221
4278
|
registerOnRemoveHandlerHelper(handler, function () {
|
4222
|
-
if (handler && !isSupported()) {
|
4279
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
4223
4280
|
throw errorNotSupportedOnPlatform;
|
4224
4281
|
}
|
4225
4282
|
});
|
@@ -4237,12 +4294,12 @@ var pages;
|
|
4237
4294
|
*/
|
4238
4295
|
function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
|
4239
4296
|
// allow for registration cleanup even when not finished initializing
|
4240
|
-
handler && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
|
4297
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
|
4241
4298
|
if (versionSpecificHelper) {
|
4242
4299
|
versionSpecificHelper();
|
4243
4300
|
}
|
4244
4301
|
removeHandler = handler;
|
4245
|
-
handler && sendMessageToParent('registerHandler', ['remove']);
|
4302
|
+
!isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['remove']);
|
4246
4303
|
}
|
4247
4304
|
config.registerOnRemoveHandlerHelper = registerOnRemoveHandlerHelper;
|
4248
4305
|
function handleSave(result) {
|
@@ -4390,7 +4447,7 @@ var pages;
|
|
4390
4447
|
*/
|
4391
4448
|
function registerBackButtonHandler(handler) {
|
4392
4449
|
registerBackButtonHandlerHelper(handler, function () {
|
4393
|
-
if (handler && !isSupported()) {
|
4450
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
4394
4451
|
throw errorNotSupportedOnPlatform;
|
4395
4452
|
}
|
4396
4453
|
});
|
@@ -4408,12 +4465,12 @@ var pages;
|
|
4408
4465
|
*/
|
4409
4466
|
function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
|
4410
4467
|
// allow for registration cleanup even when not finished initializing
|
4411
|
-
handler && ensureInitialized(runtime);
|
4468
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
4412
4469
|
if (versionSpecificHelper) {
|
4413
4470
|
versionSpecificHelper();
|
4414
4471
|
}
|
4415
4472
|
backButtonPressHandler = handler;
|
4416
|
-
handler && sendMessageToParent('registerHandler', ['backButton']);
|
4473
|
+
!isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['backButton']);
|
4417
4474
|
}
|
4418
4475
|
backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
|
4419
4476
|
function handleBackButtonPress() {
|
@@ -4615,7 +4672,7 @@ var pages;
|
|
4615
4672
|
|
4616
4673
|
;// CONCATENATED MODULE: ./src/internal/handlers.ts
|
4617
4674
|
/* eslint-disable @typescript-eslint/ban-types */
|
4618
|
-
var
|
4675
|
+
var handlers_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
4619
4676
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4620
4677
|
if (ar || !(i in from)) {
|
4621
4678
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
@@ -4709,7 +4766,7 @@ function registerHandler(name, handler, sendMessage, args) {
|
|
4709
4766
|
if (args === void 0) { args = []; }
|
4710
4767
|
if (handler) {
|
4711
4768
|
HandlersPrivate.handlers[name] = handler;
|
4712
|
-
sendMessage && sendMessageToParent('registerHandler',
|
4769
|
+
sendMessage && sendMessageToParent('registerHandler', handlers_spreadArray([name], args, true));
|
4713
4770
|
}
|
4714
4771
|
else {
|
4715
4772
|
delete HandlersPrivate.handlers[name];
|
@@ -4743,7 +4800,7 @@ function doesHandlerExist(name) {
|
|
4743
4800
|
*/
|
4744
4801
|
function registerHandlerHelper(name, handler, contexts, registrationHelper) {
|
4745
4802
|
// allow for registration cleanup even when not finished initializing
|
4746
|
-
handler && ensureInitialized.apply(void 0,
|
4803
|
+
handler && ensureInitialized.apply(void 0, handlers_spreadArray([runtime], contexts, false));
|
4747
4804
|
if (registrationHelper) {
|
4748
4805
|
registrationHelper();
|
4749
4806
|
}
|
@@ -7150,15 +7207,19 @@ var ParentAppWindow = /** @class */ (function () {
|
|
7150
7207
|
|
7151
7208
|
|
7152
7209
|
/**
|
7153
|
-
* Namespace to power up the in-app browser experiences in the
|
7154
|
-
* For e.g., opening a URL in the
|
7210
|
+
* Namespace to power up the in-app browser experiences in the host app.
|
7211
|
+
* For e.g., opening a URL in the host app inside a browser
|
7155
7212
|
*
|
7156
7213
|
* @beta
|
7157
7214
|
*/
|
7158
7215
|
var secondaryBrowser;
|
7159
7216
|
(function (secondaryBrowser) {
|
7160
7217
|
/**
|
7161
|
-
* Open a URL in the secondary browser
|
7218
|
+
* Open a URL in the secondary browser.
|
7219
|
+
*
|
7220
|
+
* On mobile, this is the in-app browser.
|
7221
|
+
*
|
7222
|
+
* On web and desktop, please use the `window.open()` method or other native external browser methods.
|
7162
7223
|
*
|
7163
7224
|
* @param url Url to open in the browser
|
7164
7225
|
* @returns Promise that successfully resolves if the URL opens in the secondaryBrowser
|
@@ -7940,7 +8001,6 @@ var monetization;
|
|
7940
8001
|
*/
|
7941
8002
|
function openPurchaseExperience(param1, param2) {
|
7942
8003
|
var callback;
|
7943
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
7944
8004
|
var planInfo;
|
7945
8005
|
if (typeof param1 === 'function') {
|
7946
8006
|
callback = param1;
|
@@ -7954,6 +8014,7 @@ var monetization;
|
|
7954
8014
|
if (!isSupported()) {
|
7955
8015
|
throw errorNotSupportedOnPlatform;
|
7956
8016
|
}
|
8017
|
+
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
7957
8018
|
resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));
|
7958
8019
|
});
|
7959
8020
|
};
|
@@ -8111,6 +8172,7 @@ var mail;
|
|
8111
8172
|
|
8112
8173
|
|
8113
8174
|
|
8175
|
+
|
8114
8176
|
/**
|
8115
8177
|
* Namespace containing the set of APIs that support Teams-specific functionalities.
|
8116
8178
|
*/
|
@@ -8157,7 +8219,7 @@ var teamsCore;
|
|
8157
8219
|
*/
|
8158
8220
|
function registerOnLoadHandler(handler) {
|
8159
8221
|
registerOnLoadHandlerHelper(handler, function () {
|
8160
|
-
if (handler && !isSupported()) {
|
8222
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
8161
8223
|
throw errorNotSupportedOnPlatform;
|
8162
8224
|
}
|
8163
8225
|
});
|
@@ -8177,8 +8239,8 @@ var teamsCore;
|
|
8177
8239
|
*/
|
8178
8240
|
function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
|
8179
8241
|
// allow for registration cleanup even when not finished initializing
|
8180
|
-
handler && ensureInitialized(runtime);
|
8181
|
-
if (handler && versionSpecificHelper) {
|
8242
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
8243
|
+
if (!isNullOrUndefined(handler) && versionSpecificHelper) {
|
8182
8244
|
versionSpecificHelper();
|
8183
8245
|
}
|
8184
8246
|
handlers_registerOnLoadHandler(handler);
|
@@ -8197,7 +8259,7 @@ var teamsCore;
|
|
8197
8259
|
*/
|
8198
8260
|
function registerBeforeUnloadHandler(handler) {
|
8199
8261
|
registerBeforeUnloadHandlerHelper(handler, function () {
|
8200
|
-
if (handler && !isSupported()) {
|
8262
|
+
if (!isNullOrUndefined(handler) && !isSupported()) {
|
8201
8263
|
throw errorNotSupportedOnPlatform;
|
8202
8264
|
}
|
8203
8265
|
});
|
@@ -8218,8 +8280,8 @@ var teamsCore;
|
|
8218
8280
|
*/
|
8219
8281
|
function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
|
8220
8282
|
// allow for registration cleanup even when not finished initializing
|
8221
|
-
handler && ensureInitialized(runtime);
|
8222
|
-
if (handler && versionSpecificHelper) {
|
8283
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
8284
|
+
if (!isNullOrUndefined(handler) && versionSpecificHelper) {
|
8223
8285
|
versionSpecificHelper();
|
8224
8286
|
}
|
8225
8287
|
handlers_registerBeforeUnloadHandler(handler);
|
@@ -8262,17 +8324,15 @@ var people;
|
|
8262
8324
|
function selectPeople(param1, param2) {
|
8263
8325
|
var _a;
|
8264
8326
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
|
8265
|
-
|
8266
|
-
var
|
8267
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
8268
|
-
var peoplePickerInputs;
|
8327
|
+
var callback = undefined;
|
8328
|
+
var peoplePickerInputs = undefined;
|
8269
8329
|
if (typeof param1 === 'function') {
|
8270
8330
|
_a = [param1, param2], callback = _a[0], peoplePickerInputs = _a[1];
|
8271
8331
|
}
|
8272
8332
|
else {
|
8273
8333
|
peoplePickerInputs = param1;
|
8274
8334
|
}
|
8275
|
-
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(selectPeopleHelper, callback
|
8335
|
+
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(selectPeopleHelper, callback /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */, peoplePickerInputs);
|
8276
8336
|
}
|
8277
8337
|
people_1.selectPeople = selectPeople;
|
8278
8338
|
function selectPeopleHelper(peoplePickerInputs) {
|
@@ -8280,7 +8340,6 @@ var people;
|
|
8280
8340
|
if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {
|
8281
8341
|
throw { errorCode: ErrorCode.OLD_PLATFORM };
|
8282
8342
|
}
|
8283
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
8284
8343
|
if (!validatePeoplePickerInput(peoplePickerInputs)) {
|
8285
8344
|
throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
8286
8345
|
}
|
@@ -9770,6 +9829,247 @@ var stageView;
|
|
9770
9829
|
stageView.isSupported = isSupported;
|
9771
9830
|
})(stageView || (stageView = {}));
|
9772
9831
|
|
9832
|
+
;// CONCATENATED MODULE: ./src/public/visualMedia.ts
|
9833
|
+
var visualMedia_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
9834
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
9835
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
9836
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
9837
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
9838
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
9839
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9840
|
+
});
|
9841
|
+
};
|
9842
|
+
var visualMedia_generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
9843
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
9844
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
9845
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
9846
|
+
function step(op) {
|
9847
|
+
if (f) throw new TypeError("Generator is already executing.");
|
9848
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
9849
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
9850
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
9851
|
+
switch (op[0]) {
|
9852
|
+
case 0: case 1: t = op; break;
|
9853
|
+
case 4: _.label++; return { value: op[1], done: false };
|
9854
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
9855
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
9856
|
+
default:
|
9857
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
9858
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
9859
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
9860
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
9861
|
+
if (t[2]) _.ops.pop();
|
9862
|
+
_.trys.pop(); continue;
|
9863
|
+
}
|
9864
|
+
op = body.call(thisArg, _);
|
9865
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
9866
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
9867
|
+
}
|
9868
|
+
};
|
9869
|
+
|
9870
|
+
|
9871
|
+
|
9872
|
+
|
9873
|
+
|
9874
|
+
/**
|
9875
|
+
* @hidden
|
9876
|
+
* Interact with images. Allows the app developer ask the user to get images from their camera / camera roll / file system.
|
9877
|
+
*
|
9878
|
+
* @beta
|
9879
|
+
*/
|
9880
|
+
var visualMedia;
|
9881
|
+
(function (visualMedia) {
|
9882
|
+
var maxVisualMediaSelectionLimit = 10;
|
9883
|
+
/**
|
9884
|
+
* @hidden
|
9885
|
+
* Indicate if user is allowed to move between front and back camera or stay in front/back camera only
|
9886
|
+
* If the camera option requested by the app isn't available, the SDK will silently default to the platform's standard camera.
|
9887
|
+
*
|
9888
|
+
* @beta
|
9889
|
+
*/
|
9890
|
+
var CameraRestriction;
|
9891
|
+
(function (CameraRestriction) {
|
9892
|
+
/** User can move between front and back camera */
|
9893
|
+
CameraRestriction[CameraRestriction["FrontOrRear"] = 1] = "FrontOrRear";
|
9894
|
+
/** User can only use the front camera */
|
9895
|
+
CameraRestriction[CameraRestriction["FrontOnly"] = 2] = "FrontOnly";
|
9896
|
+
/** User can only use the back camera */
|
9897
|
+
CameraRestriction[CameraRestriction["RearOnly"] = 3] = "RearOnly";
|
9898
|
+
})(CameraRestriction = visualMedia.CameraRestriction || (visualMedia.CameraRestriction = {}));
|
9899
|
+
/**
|
9900
|
+
* @hidden
|
9901
|
+
* Specifies the image source
|
9902
|
+
*
|
9903
|
+
* @beta
|
9904
|
+
*/
|
9905
|
+
var Source;
|
9906
|
+
(function (Source) {
|
9907
|
+
/** The camera is the source of visual media. */
|
9908
|
+
Source[Source["Camera"] = 1] = "Camera";
|
9909
|
+
/** The source of visual media is the gallery. */
|
9910
|
+
Source[Source["Gallery"] = 2] = "Gallery";
|
9911
|
+
})(Source = visualMedia.Source || (visualMedia.Source = {}));
|
9912
|
+
/**
|
9913
|
+
* @hidden
|
9914
|
+
* Checks whether or not visualMedia has user permission
|
9915
|
+
* @returns Promise that will resolve with true if the user had granted the app permission to media information(including Camera and Gallery permission), or with false otherwise,
|
9916
|
+
* In case of an error, promise will reject with the error.
|
9917
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
9918
|
+
*
|
9919
|
+
* @beta
|
9920
|
+
*/
|
9921
|
+
function hasPermission() {
|
9922
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
9923
|
+
if (!image.isSupported()) {
|
9924
|
+
throw errorNotSupportedOnPlatform;
|
9925
|
+
}
|
9926
|
+
var permissions = DevicePermission.Media;
|
9927
|
+
return sendAndHandleSdkError('permissions.has', permissions);
|
9928
|
+
}
|
9929
|
+
visualMedia.hasPermission = hasPermission;
|
9930
|
+
/**
|
9931
|
+
* @hidden
|
9932
|
+
* Requests user permission for visualMedia
|
9933
|
+
* @returns Promise that will resolve with true if the user consented permission for media(including Camera and Gallery permission), or with false otherwise,
|
9934
|
+
* In case of an error, promise will reject with the error.
|
9935
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
9936
|
+
*
|
9937
|
+
* @beta
|
9938
|
+
*/
|
9939
|
+
function requestPermission() {
|
9940
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
9941
|
+
if (!image.isSupported()) {
|
9942
|
+
throw errorNotSupportedOnPlatform;
|
9943
|
+
}
|
9944
|
+
var permissions = DevicePermission.Media;
|
9945
|
+
return sendAndHandleSdkError('permissions.request', permissions);
|
9946
|
+
}
|
9947
|
+
visualMedia.requestPermission = requestPermission;
|
9948
|
+
/**
|
9949
|
+
* @hidden
|
9950
|
+
* To enable this image capability will let the app developer ask the user to get images from camera/local storage
|
9951
|
+
*
|
9952
|
+
* @beta
|
9953
|
+
*/
|
9954
|
+
var image;
|
9955
|
+
(function (image) {
|
9956
|
+
/**
|
9957
|
+
* @hidden
|
9958
|
+
* Capture one or multiple image(s) using camera.
|
9959
|
+
* @param cameraImageInputs - The input params to customize the image(s) to be captured
|
9960
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
9961
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
9962
|
+
*
|
9963
|
+
* @beta
|
9964
|
+
*/
|
9965
|
+
function captureImages(cameraImageInputs) {
|
9966
|
+
return visualMedia_awaiter(this, void 0, void 0, function () {
|
9967
|
+
var files;
|
9968
|
+
return visualMedia_generator(this, function (_a) {
|
9969
|
+
switch (_a.label) {
|
9970
|
+
case 0:
|
9971
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
9972
|
+
ensureSupported();
|
9973
|
+
ensureImageInputValid(cameraImageInputs);
|
9974
|
+
return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.captureImages', cameraImageInputs)];
|
9975
|
+
case 1:
|
9976
|
+
files = _a.sent();
|
9977
|
+
ensureResponseValid(cameraImageInputs.maxVisualMediaCount, files);
|
9978
|
+
return [2 /*return*/, files];
|
9979
|
+
}
|
9980
|
+
});
|
9981
|
+
});
|
9982
|
+
}
|
9983
|
+
image.captureImages = captureImages;
|
9984
|
+
/**
|
9985
|
+
* @hidden
|
9986
|
+
* Upload the existing image(s) from the gallery.
|
9987
|
+
* @param galleryImageInputs - The input params to customize the image(s) to be captured
|
9988
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
9989
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
9990
|
+
*
|
9991
|
+
* @beta
|
9992
|
+
*/
|
9993
|
+
function retrieveImages(galleryImageInputs) {
|
9994
|
+
return visualMedia_awaiter(this, void 0, void 0, function () {
|
9995
|
+
var files;
|
9996
|
+
return visualMedia_generator(this, function (_a) {
|
9997
|
+
switch (_a.label) {
|
9998
|
+
case 0:
|
9999
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10000
|
+
ensureSupported();
|
10001
|
+
ensureImageInputValid(galleryImageInputs);
|
10002
|
+
return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.retrieveImages', galleryImageInputs)];
|
10003
|
+
case 1:
|
10004
|
+
files = _a.sent();
|
10005
|
+
ensureResponseValid(galleryImageInputs.maxVisualMediaCount, files);
|
10006
|
+
return [2 /*return*/, files];
|
10007
|
+
}
|
10008
|
+
});
|
10009
|
+
});
|
10010
|
+
}
|
10011
|
+
image.retrieveImages = retrieveImages;
|
10012
|
+
/**
|
10013
|
+
* @hidden
|
10014
|
+
* Checks if visualMedia.image capability is supported by the host
|
10015
|
+
* @returns boolean to represent whether visualMedia.image is supported
|
10016
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
10017
|
+
*
|
10018
|
+
* @beta
|
10019
|
+
*/
|
10020
|
+
function isSupported() {
|
10021
|
+
return ensureInitialized(runtime) &&
|
10022
|
+
runtime.supports.visualMedia &&
|
10023
|
+
runtime.supports.visualMedia.image &&
|
10024
|
+
runtime.supports.permissions
|
10025
|
+
? true
|
10026
|
+
: false;
|
10027
|
+
}
|
10028
|
+
image.isSupported = isSupported;
|
10029
|
+
/**
|
10030
|
+
* @hidden
|
10031
|
+
* Ensure visualMedia.image capability is supported by the host
|
10032
|
+
* @throws errorNotSupportedOnPlatform error if isSupported() fails.
|
10033
|
+
*
|
10034
|
+
* @beta
|
10035
|
+
*/
|
10036
|
+
function ensureSupported() {
|
10037
|
+
if (!isSupported()) {
|
10038
|
+
throw errorNotSupportedOnPlatform;
|
10039
|
+
}
|
10040
|
+
}
|
10041
|
+
/**
|
10042
|
+
* @hidden
|
10043
|
+
* @param imageInput the input can be either CameraImageProperties or GalleryImageProperties
|
10044
|
+
* @param source the expected Source
|
10045
|
+
* @throws error if the input check fails.
|
10046
|
+
* @beta
|
10047
|
+
*/
|
10048
|
+
function ensureImageInputValid(imageInput) {
|
10049
|
+
if (!imageInput ||
|
10050
|
+
imageInput.maxVisualMediaCount > maxVisualMediaSelectionLimit ||
|
10051
|
+
imageInput.maxVisualMediaCount < 1) {
|
10052
|
+
throw errorInvalidCount;
|
10053
|
+
}
|
10054
|
+
}
|
10055
|
+
/**
|
10056
|
+
* @hidden
|
10057
|
+
* Ensure the number of images in the response is within the maximum limit.
|
10058
|
+
* @throws error if length check fails.
|
10059
|
+
* @param maxCount the maxVisualMediaCount set in the imageInpus
|
10060
|
+
* @param response the response passed from host app
|
10061
|
+
*
|
10062
|
+
* @beta
|
10063
|
+
*/
|
10064
|
+
function ensureResponseValid(maxCount, response) {
|
10065
|
+
// to ensure the number of images in the response is within the maximum limit.
|
10066
|
+
if (response.length > maxCount) {
|
10067
|
+
throw errorInvalidResponse;
|
10068
|
+
}
|
10069
|
+
}
|
10070
|
+
})(image = visualMedia.image || (visualMedia.image = {}));
|
10071
|
+
})(visualMedia || (visualMedia = {}));
|
10072
|
+
|
9773
10073
|
;// CONCATENATED MODULE: ./src/public/webStorage.ts
|
9774
10074
|
|
9775
10075
|
|
@@ -10187,14 +10487,14 @@ function shareDeepLink(deepLinkParameters) {
|
|
10187
10487
|
*/
|
10188
10488
|
function executeDeepLink(deepLink, onComplete) {
|
10189
10489
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
10190
|
-
|
10490
|
+
var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
10191
10491
|
app
|
10192
10492
|
.openLink(deepLink)
|
10193
10493
|
.then(function () {
|
10194
|
-
|
10494
|
+
completionHandler(true);
|
10195
10495
|
})
|
10196
10496
|
.catch(function (err) {
|
10197
|
-
|
10497
|
+
completionHandler(false, err.message);
|
10198
10498
|
});
|
10199
10499
|
}
|
10200
10500
|
/**
|
@@ -10251,14 +10551,14 @@ function returnFocus(navigateForward) {
|
|
10251
10551
|
*/
|
10252
10552
|
function navigateToTab(tabInstance, onComplete) {
|
10253
10553
|
ensureInitialized(runtime);
|
10254
|
-
|
10554
|
+
var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
10255
10555
|
pages.tabs
|
10256
10556
|
.navigateToTab(tabInstance)
|
10257
10557
|
.then(function () {
|
10258
|
-
|
10558
|
+
completionHandler(true);
|
10259
10559
|
})
|
10260
10560
|
.catch(function (error) {
|
10261
|
-
|
10561
|
+
completionHandler(false, error.message);
|
10262
10562
|
});
|
10263
10563
|
}
|
10264
10564
|
/**
|
@@ -10276,14 +10576,14 @@ function navigateToTab(tabInstance, onComplete) {
|
|
10276
10576
|
*/
|
10277
10577
|
function navigateCrossDomain(url, onComplete) {
|
10278
10578
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
10279
|
-
|
10579
|
+
var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
10280
10580
|
pages
|
10281
10581
|
.navigateCrossDomain(url)
|
10282
10582
|
.then(function () {
|
10283
|
-
|
10583
|
+
completionHandler(true);
|
10284
10584
|
})
|
10285
10585
|
.catch(function (error) {
|
10286
|
-
|
10586
|
+
completionHandler(false, error.message);
|
10287
10587
|
});
|
10288
10588
|
}
|
10289
10589
|
/**
|
@@ -10297,14 +10597,14 @@ function navigateCrossDomain(url, onComplete) {
|
|
10297
10597
|
*/
|
10298
10598
|
function navigateBack(onComplete) {
|
10299
10599
|
ensureInitialized(runtime);
|
10300
|
-
|
10600
|
+
var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
10301
10601
|
pages.backStack
|
10302
10602
|
.navigateBack()
|
10303
10603
|
.then(function () {
|
10304
|
-
|
10604
|
+
completionHandler(true);
|
10305
10605
|
})
|
10306
10606
|
.catch(function (error) {
|
10307
|
-
|
10607
|
+
completionHandler(false, error.message);
|
10308
10608
|
});
|
10309
10609
|
}
|
10310
10610
|
|
@@ -10362,14 +10662,14 @@ var settings;
|
|
10362
10662
|
*/
|
10363
10663
|
function setSettings(instanceSettings, onComplete) {
|
10364
10664
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
|
10365
|
-
|
10665
|
+
var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
10366
10666
|
pages.config
|
10367
10667
|
.setConfig(instanceSettings)
|
10368
10668
|
.then(function () {
|
10369
|
-
|
10669
|
+
completionHandler(true);
|
10370
10670
|
})
|
10371
10671
|
.catch(function (error) {
|
10372
|
-
|
10672
|
+
completionHandler(false, error.message);
|
10373
10673
|
});
|
10374
10674
|
}
|
10375
10675
|
settings.setSettings = setSettings;
|
@@ -10451,8 +10751,7 @@ var tasks;
|
|
10451
10751
|
*/
|
10452
10752
|
function startTask(taskInfo, submitHandler) {
|
10453
10753
|
var dialogSubmitHandler = submitHandler
|
10454
|
-
?
|
10455
|
-
function (sdkResponse) { return submitHandler(sdkResponse.err, sdkResponse.result); }
|
10754
|
+
? function (sdkResponse) { var _a, _b; return submitHandler((_a = sdkResponse.err) !== null && _a !== void 0 ? _a : '', (_b = sdkResponse.result) !== null && _b !== void 0 ? _b : ''); }
|
10456
10755
|
: undefined;
|
10457
10756
|
if (taskInfo.card === undefined && taskInfo.url === undefined) {
|
10458
10757
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
@@ -10508,7 +10807,9 @@ var tasks;
|
|
10508
10807
|
* @returns - Converted UrlDialogInfo object
|
10509
10808
|
*/
|
10510
10809
|
function getUrlDialogInfoFromTaskInfo(taskInfo) {
|
10511
|
-
|
10810
|
+
if (taskInfo.url === undefined) {
|
10811
|
+
throw new Error("url property of taskInfo object can't be undefined");
|
10812
|
+
}
|
10512
10813
|
var urldialogInfo = {
|
10513
10814
|
url: taskInfo.url,
|
10514
10815
|
size: {
|
@@ -10526,7 +10827,9 @@ var tasks;
|
|
10526
10827
|
* @returns - converted BotUrlDialogInfo object
|
10527
10828
|
*/
|
10528
10829
|
function getBotUrlDialogInfoFromTaskInfo(taskInfo) {
|
10529
|
-
|
10830
|
+
if (taskInfo.url === undefined || taskInfo.completionBotId === undefined) {
|
10831
|
+
throw new Error("Both url ".concat(taskInfo.url, " and completionBotId ").concat(taskInfo.completionBotId, " are required for bot url dialog. At least one is undefined."));
|
10832
|
+
}
|
10530
10833
|
var botUrldialogInfo = {
|
10531
10834
|
url: taskInfo.url,
|
10532
10835
|
size: {
|
@@ -11219,6 +11522,7 @@ var marketplace;
|
|
11219
11522
|
|
11220
11523
|
|
11221
11524
|
|
11525
|
+
|
11222
11526
|
|
11223
11527
|
|
11224
11528
|
|