@microsoft/teams-js 2.15.0-beta.1 → 2.15.0-beta.3
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 +56 -92
- package/dist/MicrosoftTeams.js +249 -146
- 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
@@ -824,12 +824,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
824
824
|
"appEntity": () => (/* reexport */ appEntity),
|
825
825
|
"appInitialization": () => (/* reexport */ appInitialization),
|
826
826
|
"appInstallDialog": () => (/* reexport */ appInstallDialog),
|
827
|
-
"appNotification": () => (/* reexport */ appNotification),
|
828
827
|
"authentication": () => (/* reexport */ authentication),
|
829
828
|
"barCode": () => (/* reexport */ barCode),
|
830
829
|
"calendar": () => (/* reexport */ calendar),
|
831
830
|
"call": () => (/* reexport */ call),
|
832
831
|
"chat": () => (/* reexport */ chat),
|
832
|
+
"clipboard": () => (/* reexport */ clipboard),
|
833
833
|
"conversations": () => (/* reexport */ conversations),
|
834
834
|
"dialog": () => (/* reexport */ dialog),
|
835
835
|
"enablePrintCapability": () => (/* reexport */ enablePrintCapability),
|
@@ -1288,6 +1288,16 @@ var DevicePermission;
|
|
1288
1288
|
DevicePermission["GeoLocation"] = "geolocation";
|
1289
1289
|
DevicePermission["Media"] = "media";
|
1290
1290
|
})(DevicePermission || (DevicePermission = {}));
|
1291
|
+
/**
|
1292
|
+
* Currently supported Mime type
|
1293
|
+
*/
|
1294
|
+
var ClipboardSupportedMimeType;
|
1295
|
+
(function (ClipboardSupportedMimeType) {
|
1296
|
+
ClipboardSupportedMimeType["TextPlain"] = "text/plain";
|
1297
|
+
ClipboardSupportedMimeType["TextHtml"] = "text/html";
|
1298
|
+
ClipboardSupportedMimeType["ImagePNG"] = "image/png";
|
1299
|
+
ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
|
1300
|
+
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
1291
1301
|
|
1292
1302
|
;// CONCATENATED MODULE: ./src/public/constants.ts
|
1293
1303
|
/** HostClientType represents the different client platforms on which host can be run. */
|
@@ -1468,6 +1478,7 @@ var teamsMinAdaptiveCardVersion = {
|
|
1468
1478
|
|
1469
1479
|
|
1470
1480
|
|
1481
|
+
|
1471
1482
|
/**
|
1472
1483
|
* @param pattern - reference pattern
|
1473
1484
|
* @param host - candidate string
|
@@ -1494,6 +1505,7 @@ function validateHostAgainstPattern(pattern, host) {
|
|
1494
1505
|
}
|
1495
1506
|
return false;
|
1496
1507
|
}
|
1508
|
+
var validateOriginLogger = getLogger('validateOrigin');
|
1497
1509
|
/**
|
1498
1510
|
* @internal
|
1499
1511
|
* Limited to Microsoft-internal use
|
@@ -1501,6 +1513,7 @@ function validateHostAgainstPattern(pattern, host) {
|
|
1501
1513
|
function validateOrigin(messageOrigin) {
|
1502
1514
|
// Check whether the url is in the pre-known allowlist or supplied by user
|
1503
1515
|
if (!isValidHttpsURL(messageOrigin)) {
|
1516
|
+
validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
|
1504
1517
|
return false;
|
1505
1518
|
}
|
1506
1519
|
var messageOriginHost = messageOrigin.host;
|
@@ -1514,6 +1527,7 @@ function validateOrigin(messageOrigin) {
|
|
1514
1527
|
return true;
|
1515
1528
|
}
|
1516
1529
|
}
|
1530
|
+
validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOrigins, GlobalVars.additionalValidOrigins);
|
1517
1531
|
return false;
|
1518
1532
|
}
|
1519
1533
|
/**
|
@@ -1812,6 +1826,64 @@ function isHostAdaptiveCardSchemaVersionUnsupported(hostAdaptiveCardSchemaVersio
|
|
1812
1826
|
function isValidHttpsURL(url) {
|
1813
1827
|
return url.protocol === 'https:';
|
1814
1828
|
}
|
1829
|
+
/**
|
1830
|
+
* Convert base64 string to blob
|
1831
|
+
* @param base64Data string respresenting the content
|
1832
|
+
* @param contentType Mimetype
|
1833
|
+
* @returns Promise
|
1834
|
+
*/
|
1835
|
+
function base64ToBlob(mimeType, base64String) {
|
1836
|
+
return new Promise(function (resolve, reject) {
|
1837
|
+
if (!mimeType) {
|
1838
|
+
reject('MimeType cannot be null or empty.');
|
1839
|
+
}
|
1840
|
+
if (!base64String) {
|
1841
|
+
reject('Base64 string cannot be null or empty.');
|
1842
|
+
}
|
1843
|
+
var byteCharacters = atob(base64String);
|
1844
|
+
/**
|
1845
|
+
* For images we need to convert binary data to image to achieve that:
|
1846
|
+
* 1. A new Uint8Array is created with a length equal to the length of byteCharacters.
|
1847
|
+
* The byteCharacters is a string representing the base64 data decoded using atob.
|
1848
|
+
* 2. Then loop iterates over each character in the byteCharacters string and assigns the
|
1849
|
+
* corresponding character code to the corresponding index in the byteArray. The purpose
|
1850
|
+
* of this loop is to convert the base64 string to a binary representation, as the Blob
|
1851
|
+
* constructor expects binary data.
|
1852
|
+
*/
|
1853
|
+
if (mimeType.startsWith('image/')) {
|
1854
|
+
var byteArray = new Uint8Array(byteCharacters.length);
|
1855
|
+
for (var i = 0; i < byteCharacters.length; i++) {
|
1856
|
+
byteArray[i] = byteCharacters.charCodeAt(i);
|
1857
|
+
}
|
1858
|
+
resolve(new Blob([byteArray], { type: mimeType }));
|
1859
|
+
}
|
1860
|
+
resolve(new Blob([byteCharacters], { type: mimeType }));
|
1861
|
+
});
|
1862
|
+
}
|
1863
|
+
/**
|
1864
|
+
* Converts blob to base64 string.
|
1865
|
+
* @param blob Blob to convert to base64 string.
|
1866
|
+
*/
|
1867
|
+
function getBase64StringFromBlob(blob) {
|
1868
|
+
return new Promise(function (resolve, reject) {
|
1869
|
+
if (blob.size === 0) {
|
1870
|
+
reject(new Error('Blob cannot be empty.'));
|
1871
|
+
}
|
1872
|
+
var reader = new FileReader();
|
1873
|
+
reader.onloadend = function () {
|
1874
|
+
if (reader.result) {
|
1875
|
+
resolve(reader.result.toString().split(',')[1]);
|
1876
|
+
}
|
1877
|
+
else {
|
1878
|
+
reject(new Error('Failed to read the blob'));
|
1879
|
+
}
|
1880
|
+
};
|
1881
|
+
reader.onerror = function () {
|
1882
|
+
reject(reader.error);
|
1883
|
+
};
|
1884
|
+
reader.readAsDataURL(blob);
|
1885
|
+
});
|
1886
|
+
}
|
1815
1887
|
|
1816
1888
|
;// CONCATENATED MODULE: ./src/public/runtime.ts
|
1817
1889
|
/* eslint-disable @typescript-eslint/ban-types */
|
@@ -1826,13 +1898,24 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
1826
1898
|
};
|
1827
1899
|
return __assign.apply(this, arguments);
|
1828
1900
|
};
|
1901
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
1902
|
+
var t = {};
|
1903
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
1904
|
+
t[p] = s[p];
|
1905
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
1906
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
1907
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
1908
|
+
t[p[i]] = s[p[i]];
|
1909
|
+
}
|
1910
|
+
return t;
|
1911
|
+
};
|
1829
1912
|
|
1830
1913
|
|
1831
1914
|
|
1832
1915
|
|
1833
1916
|
|
1834
1917
|
var runtimeLogger = getLogger('runtime');
|
1835
|
-
var latestRuntimeApiVersion =
|
1918
|
+
var latestRuntimeApiVersion = 3;
|
1836
1919
|
function isLatestRuntimeVersion(runtime) {
|
1837
1920
|
return runtime.apiVersion === latestRuntimeApiVersion;
|
1838
1921
|
}
|
@@ -1864,7 +1947,7 @@ function isRuntimeInitialized(runtime) {
|
|
1864
1947
|
}
|
1865
1948
|
var runtime = _uninitializedRuntime;
|
1866
1949
|
var teamsRuntimeConfig = {
|
1867
|
-
apiVersion:
|
1950
|
+
apiVersion: 3,
|
1868
1951
|
hostVersionsInfo: teamsMinAdaptiveCardVersion,
|
1869
1952
|
isLegacyTeams: true,
|
1870
1953
|
supports: {
|
@@ -1953,7 +2036,6 @@ function fastForwardRuntime(outdatedRuntime) {
|
|
1953
2036
|
* Limited to Microsoft-internal use
|
1954
2037
|
*/
|
1955
2038
|
var upgradeChain = [
|
1956
|
-
// This upgrade has been included for testing, it may be removed when there is a real upgrade implemented
|
1957
2039
|
{
|
1958
2040
|
versionToUpgradeFrom: 1,
|
1959
2041
|
upgradeToNextVersion: function (previousVersionRuntime) {
|
@@ -1972,6 +2054,14 @@ var upgradeChain = [
|
|
1972
2054
|
};
|
1973
2055
|
},
|
1974
2056
|
},
|
2057
|
+
{
|
2058
|
+
versionToUpgradeFrom: 2,
|
2059
|
+
upgradeToNextVersion: function (previousVersionRuntime) {
|
2060
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ /* Intentionally assigned to unused variable to delete propery when destructuring */
|
2061
|
+
var _a = previousVersionRuntime.supports, _ = _a.appNotification, newSupports = __rest(_a, ["appNotification"]);
|
2062
|
+
return __assign(__assign({}, previousVersionRuntime), { apiVersion: 3, supports: newSupports });
|
2063
|
+
},
|
2064
|
+
},
|
1975
2065
|
];
|
1976
2066
|
var versionConstants = {
|
1977
2067
|
'1.9.0': [
|
@@ -2041,7 +2131,7 @@ function generateBackCompatRuntimeConfig(highestSupportedVersion) {
|
|
2041
2131
|
}
|
2042
2132
|
});
|
2043
2133
|
var backCompatRuntimeConfig = {
|
2044
|
-
apiVersion:
|
2134
|
+
apiVersion: latestRuntimeApiVersion,
|
2045
2135
|
hostVersionsInfo: teamsMinAdaptiveCardVersion,
|
2046
2136
|
isLegacyTeams: true,
|
2047
2137
|
supports: newSupports,
|
@@ -2073,7 +2163,7 @@ function setUnitializedRuntime() {
|
|
2073
2163
|
* Limited to Microsoft-internal use
|
2074
2164
|
*/
|
2075
2165
|
var _minRuntimeConfigToUninitialize = {
|
2076
|
-
apiVersion:
|
2166
|
+
apiVersion: latestRuntimeApiVersion,
|
2077
2167
|
supports: {
|
2078
2168
|
pages: {
|
2079
2169
|
appButton: {},
|
@@ -2092,7 +2182,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2092
2182
|
* @hidden
|
2093
2183
|
* Package version.
|
2094
2184
|
*/
|
2095
|
-
var version = "2.15.0-beta.
|
2185
|
+
var version = "2.15.0-beta.3";
|
2096
2186
|
|
2097
2187
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2098
2188
|
|
@@ -2324,7 +2414,8 @@ var authentication;
|
|
2324
2414
|
GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||
|
2325
2415
|
GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
|
2326
2416
|
GlobalVars.hostClientType === HostClientType.teamsPhones ||
|
2327
|
-
GlobalVars.hostClientType === HostClientType.teamsDisplays
|
2417
|
+
GlobalVars.hostClientType === HostClientType.teamsDisplays ||
|
2418
|
+
GlobalVars.hostClientType === HostClientType.surfaceHub) {
|
2328
2419
|
// Convert any relative URLs into absolute URLs before sending them over to the parent window.
|
2329
2420
|
var link = document.createElement('a');
|
2330
2421
|
link.href = authenticateParameters.url;
|
@@ -3957,7 +4048,7 @@ var pages;
|
|
3957
4048
|
pages.navigateToApp = navigateToApp;
|
3958
4049
|
/**
|
3959
4050
|
* Shares a deep link that a user can use to navigate back to a specific state in this page.
|
3960
|
-
* Please note that this method does yet work on mobile hosts.
|
4051
|
+
* Please note that this method does not yet work on mobile hosts.
|
3961
4052
|
*
|
3962
4053
|
* @param deepLinkParameters - ID and label for the link and fallback URL.
|
3963
4054
|
*/
|
@@ -4974,6 +5065,7 @@ function sendMessageToParentHelper(actionName, args) {
|
|
4974
5065
|
}
|
4975
5066
|
return request;
|
4976
5067
|
}
|
5068
|
+
var processMessageLogger = communicationLogger.extend('processMessage');
|
4977
5069
|
/**
|
4978
5070
|
* @internal
|
4979
5071
|
* Limited to Microsoft-internal use
|
@@ -4981,13 +5073,16 @@ function sendMessageToParentHelper(actionName, args) {
|
|
4981
5073
|
function processMessage(evt) {
|
4982
5074
|
// Process only if we received a valid message
|
4983
5075
|
if (!evt || !evt.data || typeof evt.data !== 'object') {
|
5076
|
+
processMessageLogger('Unrecognized message format received by app, message being ignored. Message: %o', evt);
|
4984
5077
|
return;
|
4985
5078
|
}
|
4986
5079
|
// Process only if the message is coming from a different window and a valid origin
|
4987
|
-
// valid origins are either a pre-known
|
5080
|
+
// valid origins are either a pre-known origin or one specified by the app developer
|
5081
|
+
// in their call to app.initialize
|
4988
5082
|
var messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);
|
4989
5083
|
var messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);
|
4990
5084
|
if (!shouldProcessMessage(messageSource, messageOrigin)) {
|
5085
|
+
processMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin');
|
4991
5086
|
return;
|
4992
5087
|
}
|
4993
5088
|
// Update our parent and child relationships based on this message
|
@@ -5000,6 +5095,7 @@ function processMessage(evt) {
|
|
5000
5095
|
handleChildMessage(evt);
|
5001
5096
|
}
|
5002
5097
|
}
|
5098
|
+
var shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMessage');
|
5003
5099
|
/**
|
5004
5100
|
* @hidden
|
5005
5101
|
* Validates the message source and origin, if it should be processed
|
@@ -5011,6 +5107,7 @@ function shouldProcessMessage(messageSource, messageOrigin) {
|
|
5011
5107
|
// Process if message source is a different window and if origin is either in
|
5012
5108
|
// Teams' pre-known whitelist or supplied as valid origin by user during initialization
|
5013
5109
|
if (Communication.currentWindow && messageSource === Communication.currentWindow) {
|
5110
|
+
shouldProcessMessageLogger('Should not process message because it is coming from the current window');
|
5014
5111
|
return false;
|
5015
5112
|
}
|
5016
5113
|
else if (Communication.currentWindow &&
|
@@ -5020,7 +5117,11 @@ function shouldProcessMessage(messageSource, messageOrigin) {
|
|
5020
5117
|
return true;
|
5021
5118
|
}
|
5022
5119
|
else {
|
5023
|
-
|
5120
|
+
var isOriginValid = validateOrigin(new URL(messageOrigin));
|
5121
|
+
if (!isOriginValid) {
|
5122
|
+
shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);
|
5123
|
+
}
|
5124
|
+
return isOriginValid;
|
5024
5125
|
}
|
5025
5126
|
}
|
5026
5127
|
/**
|
@@ -5713,135 +5814,6 @@ var appInstallDialog;
|
|
5713
5814
|
appInstallDialog.isSupported = isSupported;
|
5714
5815
|
})(appInstallDialog || (appInstallDialog = {}));
|
5715
5816
|
|
5716
|
-
;// CONCATENATED MODULE: ./src/public/appNotification.ts
|
5717
|
-
|
5718
|
-
|
5719
|
-
|
5720
|
-
|
5721
|
-
/**
|
5722
|
-
* Namespace to interact with the appNotification specific part of the SDK
|
5723
|
-
* @beta
|
5724
|
-
*/
|
5725
|
-
var appNotification;
|
5726
|
-
(function (appNotification) {
|
5727
|
-
/**
|
5728
|
-
* @internal
|
5729
|
-
*
|
5730
|
-
* @hidden
|
5731
|
-
*
|
5732
|
-
* @beta
|
5733
|
-
*
|
5734
|
-
* This converts the notifcationActionUrl from a URL type to a string type for proper flow across the iframe
|
5735
|
-
* @param notificationDisplayParam - appNotification display parameter with the notificationActionUrl as a URL type
|
5736
|
-
* @returns a serialized object that can be sent to the host SDK
|
5737
|
-
*/
|
5738
|
-
function serializeParam(notificationDisplayParam) {
|
5739
|
-
var _a;
|
5740
|
-
return {
|
5741
|
-
title: notificationDisplayParam.title,
|
5742
|
-
content: notificationDisplayParam.content,
|
5743
|
-
notificationIconAsString: (_a = notificationDisplayParam.icon) === null || _a === void 0 ? void 0 : _a.href,
|
5744
|
-
displayDurationInSeconds: notificationDisplayParam.displayDurationInSeconds,
|
5745
|
-
notificationActionUrlAsString: notificationDisplayParam.notificationActionUrl.href,
|
5746
|
-
};
|
5747
|
-
}
|
5748
|
-
/**
|
5749
|
-
* Checks the valididty of the URL passed
|
5750
|
-
*
|
5751
|
-
* @param url
|
5752
|
-
* @returns True if a valid url was passed
|
5753
|
-
*
|
5754
|
-
* @beta
|
5755
|
-
*/
|
5756
|
-
function isValidUrl(url) {
|
5757
|
-
var validProtocols = ['https:'];
|
5758
|
-
return validProtocols.includes(url.protocol);
|
5759
|
-
}
|
5760
|
-
/**
|
5761
|
-
* Validates that the input string is of property length
|
5762
|
-
*
|
5763
|
-
* @param inputString and maximumLength
|
5764
|
-
* @returns True if string length is within specified limit
|
5765
|
-
*
|
5766
|
-
* @beta
|
5767
|
-
*/
|
5768
|
-
function isValidLength(inputString, maxLength) {
|
5769
|
-
return inputString.length <= maxLength;
|
5770
|
-
}
|
5771
|
-
/**
|
5772
|
-
* Validates that all the required appNotification display parameters are either supplied or satisfy the required checks
|
5773
|
-
* @param notificationDisplayParam
|
5774
|
-
* @throws Error if any of the required parameters aren't supplied
|
5775
|
-
* @throws Error if content or title length is beyond specific limit
|
5776
|
-
* @throws Error if invalid url is passed
|
5777
|
-
* @returns void
|
5778
|
-
*
|
5779
|
-
* @beta
|
5780
|
-
*/
|
5781
|
-
function validateNotificationDisplayParams(notificationDisplayParam) {
|
5782
|
-
var maxTitleLength = 75;
|
5783
|
-
var maxContentLength = 1500;
|
5784
|
-
if (!notificationDisplayParam.title) {
|
5785
|
-
throw new Error('Must supply notification title');
|
5786
|
-
}
|
5787
|
-
if (!isValidLength(notificationDisplayParam.title, maxTitleLength)) {
|
5788
|
-
throw new Error("Invalid notification title length: Maximum title length ".concat(maxTitleLength, ", title length supplied ").concat(notificationDisplayParam.title.length));
|
5789
|
-
}
|
5790
|
-
if (!notificationDisplayParam.content) {
|
5791
|
-
throw new Error('Must supply notification content');
|
5792
|
-
}
|
5793
|
-
if (!isValidLength(notificationDisplayParam.content, maxContentLength)) {
|
5794
|
-
throw new Error("Invalid notification content length: Maximum content length ".concat(maxContentLength, ", content length supplied ").concat(notificationDisplayParam.content.length));
|
5795
|
-
}
|
5796
|
-
if (!notificationDisplayParam.notificationActionUrl) {
|
5797
|
-
throw new Error('Must supply notification url');
|
5798
|
-
}
|
5799
|
-
if (!isValidUrl(notificationDisplayParam.notificationActionUrl)) {
|
5800
|
-
throw new Error('Invalid notificationAction url');
|
5801
|
-
}
|
5802
|
-
if ((notificationDisplayParam === null || notificationDisplayParam === void 0 ? void 0 : notificationDisplayParam.icon) !== undefined && !isValidUrl(notificationDisplayParam === null || notificationDisplayParam === void 0 ? void 0 : notificationDisplayParam.icon)) {
|
5803
|
-
throw new Error('Invalid icon url');
|
5804
|
-
}
|
5805
|
-
if (!notificationDisplayParam.displayDurationInSeconds) {
|
5806
|
-
throw new Error('Must supply notification display duration in seconds');
|
5807
|
-
}
|
5808
|
-
if (notificationDisplayParam.displayDurationInSeconds < 0) {
|
5809
|
-
throw new Error('Notification display time must be greater than zero');
|
5810
|
-
}
|
5811
|
-
}
|
5812
|
-
/**
|
5813
|
-
* Displays appNotification after making a validiity check on all of the required parameters, by calling the validateNotificationDisplayParams helper function
|
5814
|
-
* An interface object containing all the required parameters to be displayed on the notification would be passed in here
|
5815
|
-
* The notificationDisplayParam would be serialized before passing across to the message handler to ensure all objects passed contain simple parameters that would properly pass across the Iframe
|
5816
|
-
* @param notificationdisplayparam - Interface object with all the parameters required to display an appNotificiation
|
5817
|
-
* @returns a promise resolution upon conclusion
|
5818
|
-
* @throws Error if appNotification capability is not supported
|
5819
|
-
* @throws Error if notficationDisplayParam was not validated successfully
|
5820
|
-
*
|
5821
|
-
* @beta
|
5822
|
-
*/
|
5823
|
-
function displayInAppNotification(notificationDisplayParam) {
|
5824
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.stage, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5825
|
-
if (!isSupported()) {
|
5826
|
-
throw errorNotSupportedOnPlatform;
|
5827
|
-
}
|
5828
|
-
validateNotificationDisplayParams(notificationDisplayParam);
|
5829
|
-
return sendAndHandleSdkError('appNotification.displayInAppNotification', serializeParam(notificationDisplayParam));
|
5830
|
-
}
|
5831
|
-
appNotification.displayInAppNotification = displayInAppNotification;
|
5832
|
-
/**
|
5833
|
-
* Checks if appNotification is supported by the host
|
5834
|
-
* @returns boolean to represent whether the appNotification capability is supported
|
5835
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
5836
|
-
*
|
5837
|
-
* @beta
|
5838
|
-
*/
|
5839
|
-
function isSupported() {
|
5840
|
-
return ensureInitialized(runtime) && runtime.supports.appNotification ? true : false;
|
5841
|
-
}
|
5842
|
-
appNotification.isSupported = isSupported;
|
5843
|
-
})(appNotification || (appNotification = {}));
|
5844
|
-
|
5845
5817
|
;// CONCATENATED MODULE: ./src/public/media.ts
|
5846
5818
|
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
5847
5819
|
var __extends = (undefined && undefined.__extends) || (function () {
|
@@ -6774,6 +6746,137 @@ var chat;
|
|
6774
6746
|
chat.isSupported = isSupported;
|
6775
6747
|
})(chat || (chat = {}));
|
6776
6748
|
|
6749
|
+
;// CONCATENATED MODULE: ./src/public/clipboard.ts
|
6750
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6751
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6752
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
6753
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6754
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6755
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
6756
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
6757
|
+
});
|
6758
|
+
};
|
6759
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
6760
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
6761
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
6762
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
6763
|
+
function step(op) {
|
6764
|
+
if (f) throw new TypeError("Generator is already executing.");
|
6765
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
6766
|
+
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;
|
6767
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
6768
|
+
switch (op[0]) {
|
6769
|
+
case 0: case 1: t = op; break;
|
6770
|
+
case 4: _.label++; return { value: op[1], done: false };
|
6771
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
6772
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
6773
|
+
default:
|
6774
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
6775
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
6776
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
6777
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
6778
|
+
if (t[2]) _.ops.pop();
|
6779
|
+
_.trys.pop(); continue;
|
6780
|
+
}
|
6781
|
+
op = body.call(thisArg, _);
|
6782
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
6783
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
6784
|
+
}
|
6785
|
+
};
|
6786
|
+
|
6787
|
+
|
6788
|
+
|
6789
|
+
|
6790
|
+
|
6791
|
+
|
6792
|
+
|
6793
|
+
/**
|
6794
|
+
* Interact with the system clipboard
|
6795
|
+
*
|
6796
|
+
* @beta
|
6797
|
+
*/
|
6798
|
+
var clipboard;
|
6799
|
+
(function (clipboard) {
|
6800
|
+
/**
|
6801
|
+
* Function to copy data to clipboard.
|
6802
|
+
* @remarks
|
6803
|
+
* Note: clipboard.write only supports Text, HTML, PNG, and JPEG data format.
|
6804
|
+
* MIME type for Text -> `text/plain`, HTML -> `text/html`, PNG/JPEG -> `image/(png | jpeg)`
|
6805
|
+
* Also, JPEG will be converted to PNG image when copying to clipboard.
|
6806
|
+
*
|
6807
|
+
* @param blob - A Blob object representing the data to be copied to clipboard.
|
6808
|
+
* @returns A string promise which resolves to success message from the clipboard or
|
6809
|
+
* rejects with error stating the reason for failure.
|
6810
|
+
*/
|
6811
|
+
function write(blob) {
|
6812
|
+
return __awaiter(this, void 0, void 0, function () {
|
6813
|
+
var base64StringContent, writeParams;
|
6814
|
+
return __generator(this, function (_a) {
|
6815
|
+
switch (_a.label) {
|
6816
|
+
case 0:
|
6817
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
|
6818
|
+
if (!isSupported()) {
|
6819
|
+
throw errorNotSupportedOnPlatform;
|
6820
|
+
}
|
6821
|
+
if (!(blob.type && Object.values(ClipboardSupportedMimeType).includes(blob.type))) {
|
6822
|
+
throw new Error("Blob type ".concat(blob.type, " is not supported. Supported blob types are ").concat(Object.values(ClipboardSupportedMimeType)));
|
6823
|
+
}
|
6824
|
+
return [4 /*yield*/, getBase64StringFromBlob(blob)];
|
6825
|
+
case 1:
|
6826
|
+
base64StringContent = _a.sent();
|
6827
|
+
writeParams = {
|
6828
|
+
mimeType: blob.type,
|
6829
|
+
content: base64StringContent,
|
6830
|
+
};
|
6831
|
+
return [2 /*return*/, sendAndHandleSdkError('clipboard.writeToClipboard', writeParams)];
|
6832
|
+
}
|
6833
|
+
});
|
6834
|
+
});
|
6835
|
+
}
|
6836
|
+
clipboard.write = write;
|
6837
|
+
/**
|
6838
|
+
* Function to read data from clipboard.
|
6839
|
+
*
|
6840
|
+
* @returns A promise blob which resolves to the data read from the clipboard or
|
6841
|
+
* rejects stating the reason for failure.
|
6842
|
+
* Note: Returned blob type will contain one of the MIME type `image/png`, `text/plain` or `text/html`.
|
6843
|
+
*/
|
6844
|
+
function read() {
|
6845
|
+
return __awaiter(this, void 0, void 0, function () {
|
6846
|
+
var response, _a, _b;
|
6847
|
+
return __generator(this, function (_c) {
|
6848
|
+
switch (_c.label) {
|
6849
|
+
case 0:
|
6850
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
|
6851
|
+
if (!isSupported()) {
|
6852
|
+
throw errorNotSupportedOnPlatform;
|
6853
|
+
}
|
6854
|
+
if (!(isHostClientMobile() || GlobalVars.hostClientType === HostClientType.macos)) return [3 /*break*/, 2];
|
6855
|
+
_b = (_a = JSON).parse;
|
6856
|
+
return [4 /*yield*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
|
6857
|
+
case 1:
|
6858
|
+
response = _b.apply(_a, [_c.sent()]);
|
6859
|
+
return [2 /*return*/, base64ToBlob(response.mimeType, response.content)];
|
6860
|
+
case 2: return [2 /*return*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
|
6861
|
+
}
|
6862
|
+
});
|
6863
|
+
});
|
6864
|
+
}
|
6865
|
+
clipboard.read = read;
|
6866
|
+
/**
|
6867
|
+
* Checks if clipboard capability is supported by the host
|
6868
|
+
* @returns boolean to represent whether the clipboard capability is supported
|
6869
|
+
*
|
6870
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6871
|
+
*
|
6872
|
+
* @beta
|
6873
|
+
*/
|
6874
|
+
function isSupported() {
|
6875
|
+
return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
|
6876
|
+
}
|
6877
|
+
clipboard.isSupported = isSupported;
|
6878
|
+
})(clipboard || (clipboard = {}));
|
6879
|
+
|
6777
6880
|
;// CONCATENATED MODULE: ./src/public/geoLocation.ts
|
6778
6881
|
|
6779
6882
|
|
@@ -7148,7 +7251,7 @@ var location_location;
|
|
7148
7251
|
})(location_location || (location_location = {}));
|
7149
7252
|
|
7150
7253
|
;// CONCATENATED MODULE: ./src/public/meeting.ts
|
7151
|
-
var
|
7254
|
+
var meeting_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7152
7255
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7153
7256
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7154
7257
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7157,7 +7260,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
7157
7260
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7158
7261
|
});
|
7159
7262
|
};
|
7160
|
-
var
|
7263
|
+
var meeting_generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
7161
7264
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
7162
7265
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
7163
7266
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
@@ -7590,9 +7693,9 @@ var meeting;
|
|
7590
7693
|
if (typeof isHostAudioless !== 'boolean') {
|
7591
7694
|
throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');
|
7592
7695
|
}
|
7593
|
-
var micStateChangedCallback = function (micState) { return
|
7696
|
+
var micStateChangedCallback = function (micState) { return meeting_awaiter(_this, void 0, void 0, function () {
|
7594
7697
|
var newMicState, micStateDidUpdate, _a;
|
7595
|
-
return
|
7698
|
+
return meeting_generator(this, function (_b) {
|
7596
7699
|
switch (_b.label) {
|
7597
7700
|
case 0:
|
7598
7701
|
_b.trys.push([0, 2, , 3]);
|
@@ -8785,7 +8888,7 @@ var video_generator = (undefined && undefined.__generator) || function (thisArg,
|
|
8785
8888
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
8786
8889
|
}
|
8787
8890
|
};
|
8788
|
-
var
|
8891
|
+
var video_rest = (undefined && undefined.__rest) || function (s, e) {
|
8789
8892
|
var t = {};
|
8790
8893
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
8791
8894
|
t[p] = s[p];
|
@@ -9043,7 +9146,7 @@ var video;
|
|
9043
9146
|
}
|
9044
9147
|
else {
|
9045
9148
|
// The host may pass the VideoFrame with the old definition which has `data` instead of `videoFrameBuffer`
|
9046
|
-
var data = videoBufferData.data, newVideoBufferData =
|
9149
|
+
var data = videoBufferData.data, newVideoBufferData = video_rest(videoBufferData, ["data"]);
|
9047
9150
|
return video_assign(video_assign({}, newVideoBufferData), { videoFrameBuffer: data });
|
9048
9151
|
}
|
9049
9152
|
}
|