@microsoft/teams-js 2.27.0-beta.0 → 2.28.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 +279 -6
- package/dist/MicrosoftTeams.js +433 -31
- 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 +36 -1
package/dist/MicrosoftTeams.js
CHANGED
@@ -991,6 +991,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
991
991
|
// EXPORTS
|
992
992
|
__webpack_require__.d(__webpack_exports__, {
|
993
993
|
ActionObjectType: () => (/* reexport */ ActionObjectType),
|
994
|
+
AppId: () => (/* reexport */ AppId),
|
994
995
|
ChannelType: () => (/* reexport */ ChannelType),
|
995
996
|
ChildAppWindow: () => (/* reexport */ ChildAppWindow),
|
996
997
|
DialogDimension: () => (/* reexport */ DialogDimension),
|
@@ -1032,6 +1033,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1032
1033
|
getContext: () => (/* reexport */ getContext),
|
1033
1034
|
getMruTabInstances: () => (/* reexport */ getMruTabInstances),
|
1034
1035
|
getTabInstances: () => (/* reexport */ getTabInstances),
|
1036
|
+
hostEntity: () => (/* reexport */ hostEntity),
|
1035
1037
|
initialize: () => (/* reexport */ initialize),
|
1036
1038
|
initializeWithFrameContext: () => (/* reexport */ initializeWithFrameContext),
|
1037
1039
|
liveShare: () => (/* reexport */ liveShare),
|
@@ -1131,7 +1133,7 @@ function isFollowingApiVersionTagFormat(apiVersionTag) {
|
|
1131
1133
|
}
|
1132
1134
|
|
1133
1135
|
;// CONCATENATED MODULE: ./src/artifactsForCDN/validDomains.json
|
1134
|
-
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
|
1136
|
+
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
|
1135
1137
|
var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
|
1136
1138
|
;// CONCATENATED MODULE: ./src/internal/constants.ts
|
1137
1139
|
|
@@ -2750,6 +2752,9 @@ function generateGUID() {
|
|
2750
2752
|
*/
|
2751
2753
|
function utils_deepFreeze(obj) {
|
2752
2754
|
Object.keys(obj).forEach((prop) => {
|
2755
|
+
if (obj[prop] === null || obj[prop] === undefined) {
|
2756
|
+
return;
|
2757
|
+
}
|
2753
2758
|
if (typeof obj[prop] === 'object') {
|
2754
2759
|
utils_deepFreeze(obj[prop]);
|
2755
2760
|
}
|
@@ -3504,7 +3509,7 @@ const _minRuntimeConfigToUninitialize = {
|
|
3504
3509
|
* @hidden
|
3505
3510
|
* Package version.
|
3506
3511
|
*/
|
3507
|
-
const version = "2.
|
3512
|
+
const version = "2.28.0";
|
3508
3513
|
|
3509
3514
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
3510
3515
|
|
@@ -5566,6 +5571,9 @@ function tabsNavigateToTabHelper(apiVersionTag, tabInstance) {
|
|
5566
5571
|
resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));
|
5567
5572
|
});
|
5568
5573
|
}
|
5574
|
+
/**
|
5575
|
+
* @hidden
|
5576
|
+
*/
|
5569
5577
|
function returnFocusHelper(apiVersionTag, navigateForward) {
|
5570
5578
|
ensureInitialized(runtime);
|
5571
5579
|
if (!pages.isSupported()) {
|
@@ -5642,14 +5650,77 @@ function configSetConfigHelper(apiVersionTag, instanceConfig) {
|
|
5642
5650
|
var pages;
|
5643
5651
|
(function (pages) {
|
5644
5652
|
/**
|
5645
|
-
*
|
5646
|
-
*
|
5647
|
-
*
|
5648
|
-
*
|
5649
|
-
*
|
5653
|
+
* @hidden
|
5654
|
+
* List of enter focus action items
|
5655
|
+
*
|
5656
|
+
* @internal
|
5657
|
+
* Limited to Microsoft-internal use
|
5650
5658
|
*/
|
5651
|
-
|
5652
|
-
|
5659
|
+
let EnterFocusType;
|
5660
|
+
(function (EnterFocusType) {
|
5661
|
+
/**
|
5662
|
+
* Determines the previous direction to focus in app when hot keys entered.
|
5663
|
+
*/
|
5664
|
+
EnterFocusType[EnterFocusType["PreviousLandmark"] = 0] = "PreviousLandmark";
|
5665
|
+
/**
|
5666
|
+
* Determines the next direction to focus in app when hot keys entered.
|
5667
|
+
*/
|
5668
|
+
EnterFocusType[EnterFocusType["NextLandmark"] = 1] = "NextLandmark";
|
5669
|
+
/**
|
5670
|
+
* Determines if the focus should go to the particular content of the app.
|
5671
|
+
* Read - Focus should go to the content of the app.
|
5672
|
+
*/
|
5673
|
+
EnterFocusType[EnterFocusType["Read"] = 2] = "Read";
|
5674
|
+
/**
|
5675
|
+
* Determines if the focus should go to the particular content of the app.
|
5676
|
+
* Compose - Focus should go to the compose area (such as textbox) of the app.
|
5677
|
+
*/
|
5678
|
+
EnterFocusType[EnterFocusType["Compose"] = 3] = "Compose";
|
5679
|
+
})(EnterFocusType = pages.EnterFocusType || (pages.EnterFocusType = {}));
|
5680
|
+
/**
|
5681
|
+
* Return focus action items
|
5682
|
+
*/
|
5683
|
+
let ReturnFocusType;
|
5684
|
+
(function (ReturnFocusType) {
|
5685
|
+
/**
|
5686
|
+
* Determines the direction to focus in host for previous landmark.
|
5687
|
+
*/
|
5688
|
+
ReturnFocusType[ReturnFocusType["PreviousLandmark"] = 0] = "PreviousLandmark";
|
5689
|
+
/**
|
5690
|
+
* Determines the direction to focus in host for next landmark.
|
5691
|
+
*/
|
5692
|
+
ReturnFocusType[ReturnFocusType["NextLandmark"] = 1] = "NextLandmark";
|
5693
|
+
/**
|
5694
|
+
* Determines if the focus should go to the host's activity feed
|
5695
|
+
*/
|
5696
|
+
ReturnFocusType[ReturnFocusType["GoToActivityFeed"] = 2] = "GoToActivityFeed";
|
5697
|
+
})(ReturnFocusType = pages.ReturnFocusType || (pages.ReturnFocusType = {}));
|
5698
|
+
/**
|
5699
|
+
* @hidden
|
5700
|
+
*/
|
5701
|
+
function returnFocus(arg1) {
|
5702
|
+
const apiVersionTag = getApiVersionTag(pagesTelemetryVersionNumber, "pages.returnFocus" /* ApiName.Pages_ReturnFocus */);
|
5703
|
+
ensureInitialized(runtime);
|
5704
|
+
if (!pages.isSupported()) {
|
5705
|
+
throw errorNotSupportedOnPlatform;
|
5706
|
+
}
|
5707
|
+
if (arg1 === undefined) {
|
5708
|
+
sendMessageToParent(apiVersionTag, 'returnFocus', [false]);
|
5709
|
+
}
|
5710
|
+
if (typeof arg1 === 'boolean') {
|
5711
|
+
sendMessageToParent(apiVersionTag, 'returnFocus', [arg1]);
|
5712
|
+
}
|
5713
|
+
else {
|
5714
|
+
switch (arg1) {
|
5715
|
+
case pages.ReturnFocusType.PreviousLandmark:
|
5716
|
+
case pages.ReturnFocusType.GoToActivityFeed:
|
5717
|
+
sendMessageToParent(apiVersionTag, 'returnFocus', [false, arg1]);
|
5718
|
+
break;
|
5719
|
+
case pages.ReturnFocusType.NextLandmark:
|
5720
|
+
sendMessageToParent(apiVersionTag, 'returnFocus', [true, arg1]);
|
5721
|
+
break;
|
5722
|
+
}
|
5723
|
+
}
|
5653
5724
|
}
|
5654
5725
|
pages.returnFocus = returnFocus;
|
5655
5726
|
/**
|
@@ -10960,24 +11031,75 @@ var videoEffectsEx;
|
|
10960
11031
|
videoEffectsEx.notifyFatalError = notifyFatalError;
|
10961
11032
|
})(videoEffectsEx || (videoEffectsEx = {}));
|
10962
11033
|
|
10963
|
-
;// CONCATENATED MODULE: ./src/
|
10964
|
-
|
10965
|
-
|
10966
|
-
|
10967
|
-
|
10968
|
-
|
10969
|
-
|
10970
|
-
|
10971
|
-
|
10972
|
-
|
10973
|
-
|
10974
|
-
|
10975
|
-
|
10976
|
-
|
10977
|
-
|
10978
|
-
|
10979
|
-
|
11034
|
+
;// CONCATENATED MODULE: ./src/internal/appIdValidation.ts
|
11035
|
+
/**
|
11036
|
+
* This function can be used to validate if a string is a "valid" app id.
|
11037
|
+
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
11038
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
11039
|
+
* However, there are some older internal/hard-coded apps which violate this schema and use names like com.microsoft.teamspace.tab.youtube.
|
11040
|
+
* For compatibility with these legacy apps, we unfortunately cannot securely and completely validate app ids as UUIDs. Based
|
11041
|
+
* on this, the validation is limited to checking for script tags, length, and non-printable characters.
|
11042
|
+
*
|
11043
|
+
* @param potentialAppId A string to check if it's a "valid" app id
|
11044
|
+
* @throws Error with a message describing the exact validation violation
|
11045
|
+
*/
|
11046
|
+
function validateStringAsAppId(potentialAppId) {
|
11047
|
+
if (doesStringContainScriptTags(potentialAppId)) {
|
11048
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);
|
11049
|
+
}
|
11050
|
+
if (!isStringWithinAppIdLengthLimits(potentialAppId)) {
|
11051
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; its length ${potentialAppId.length} is not within the length limits (${minimumValidAppIdLength}-${maximumValidAppIdLength}).`);
|
11052
|
+
}
|
11053
|
+
if (doesStringContainNonPrintableCharacters(potentialAppId)) {
|
11054
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains non-printable characters.`);
|
11055
|
+
}
|
11056
|
+
}
|
11057
|
+
function doesStringContainScriptTags(str) {
|
11058
|
+
const scriptRegex = /<script[^>]*>[\s\S]*?<\/script[^>]*>/gi;
|
11059
|
+
return scriptRegex.test(str);
|
11060
|
+
}
|
11061
|
+
const minimumValidAppIdLength = 4;
|
11062
|
+
const maximumValidAppIdLength = 256;
|
11063
|
+
function isStringWithinAppIdLengthLimits(potentialAppId) {
|
11064
|
+
return potentialAppId.length < maximumValidAppIdLength && potentialAppId.length > minimumValidAppIdLength;
|
11065
|
+
}
|
11066
|
+
function doesStringContainNonPrintableCharacters(str) {
|
11067
|
+
return [...str].some((char) => {
|
11068
|
+
const charCode = char.charCodeAt(0);
|
11069
|
+
return charCode < 32 || charCode > 126;
|
11070
|
+
});
|
11071
|
+
}
|
11072
|
+
|
11073
|
+
;// CONCATENATED MODULE: ./src/public/appId.ts
|
10980
11074
|
|
11075
|
+
/**
|
11076
|
+
* A strongly-typed class used to represent a "valid" app id.
|
11077
|
+
*
|
11078
|
+
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
11079
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
11080
|
+
* However, there are some older internal/hard-coded apps which violate this schema and use names like
|
11081
|
+
* com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot
|
11082
|
+
* securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking
|
11083
|
+
* for script tags, length, and non-printable characters.
|
11084
|
+
*/
|
11085
|
+
class AppId {
|
11086
|
+
/**
|
11087
|
+
* Creates a strongly-typed AppId from a string
|
11088
|
+
*
|
11089
|
+
* @param appIdAsString An app id represented as a string
|
11090
|
+
* @throws Error with a message describing the exact validation violation
|
11091
|
+
*/
|
11092
|
+
constructor(appIdAsString) {
|
11093
|
+
this.appIdAsString = appIdAsString;
|
11094
|
+
validateStringAsAppId(appIdAsString);
|
11095
|
+
}
|
11096
|
+
/**
|
11097
|
+
* Returns the app id as a string
|
11098
|
+
*/
|
11099
|
+
toString() {
|
11100
|
+
return this.appIdAsString;
|
11101
|
+
}
|
11102
|
+
}
|
10981
11103
|
|
10982
11104
|
;// CONCATENATED MODULE: ./src/internal/deepLinkConstants.ts
|
10983
11105
|
/**
|
@@ -14068,10 +14190,6 @@ var sharing;
|
|
14068
14190
|
throw errorNotSupportedOnPlatform;
|
14069
14191
|
}
|
14070
14192
|
const contentDetails = yield sendAndHandleSdkError(getApiVersionTag(sharingTelemetryVersionNumber_v2, "sharing.history.getContent" /* ApiName.Sharing_History_GetContent */), 'sharing.history.getContent');
|
14071
|
-
contentDetails.map((contentDetails) => {
|
14072
|
-
validateUuid(contentDetails.author);
|
14073
|
-
validateUuid(contentDetails.threadId);
|
14074
|
-
});
|
14075
14193
|
return contentDetails;
|
14076
14194
|
});
|
14077
14195
|
}
|
@@ -14674,7 +14792,8 @@ var thirdPartyCloudStorage;
|
|
14674
14792
|
/**
|
14675
14793
|
* Get drag-and-drop files using a callback.
|
14676
14794
|
*
|
14677
|
-
* @param {string} dragAndDropInput -
|
14795
|
+
* @param {string} dragAndDropInput - unique id which is a combination of replyToId + threadId of teams chat and channel.
|
14796
|
+
* Both replyToId and threadId can be fetched from application context.
|
14678
14797
|
* @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
|
14679
14798
|
* A callback function to handle the result of the operation
|
14680
14799
|
* @beta
|
@@ -16047,6 +16166,289 @@ var marketplace;
|
|
16047
16166
|
|
16048
16167
|
|
16049
16168
|
|
16169
|
+
|
16170
|
+
|
16171
|
+
|
16172
|
+
|
16173
|
+
|
16174
|
+
|
16175
|
+
|
16176
|
+
|
16177
|
+
|
16178
|
+
|
16179
|
+
|
16180
|
+
|
16181
|
+
|
16182
|
+
|
16183
|
+
|
16184
|
+
|
16185
|
+
|
16186
|
+
|
16187
|
+
|
16188
|
+
|
16189
|
+
;// CONCATENATED MODULE: ./src/private/hostEntity.ts
|
16190
|
+
|
16191
|
+
|
16192
|
+
|
16193
|
+
|
16194
|
+
|
16195
|
+
|
16196
|
+
/**
|
16197
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
16198
|
+
*/
|
16199
|
+
const hostEntityTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
16200
|
+
/**
|
16201
|
+
* @hidden
|
16202
|
+
* @internal
|
16203
|
+
* @beta
|
16204
|
+
* Limited to Microsoft-internal use
|
16205
|
+
*
|
16206
|
+
* This capability allows an app to associate apps with a host entity, such as a Teams channel or chat, and configure them as needed.
|
16207
|
+
*/
|
16208
|
+
var hostEntity;
|
16209
|
+
(function (hostEntity) {
|
16210
|
+
let AppTypes;
|
16211
|
+
(function (AppTypes) {
|
16212
|
+
AppTypes["edu"] = "EDU";
|
16213
|
+
})(AppTypes = hostEntity.AppTypes || (hostEntity.AppTypes = {}));
|
16214
|
+
/**
|
16215
|
+
* @hidden
|
16216
|
+
* @internal
|
16217
|
+
* @beta
|
16218
|
+
* Limited to Microsoft-internal use
|
16219
|
+
*
|
16220
|
+
* CRUD operations for tabs associated with apps
|
16221
|
+
*/
|
16222
|
+
let tab;
|
16223
|
+
(function (tab_1) {
|
16224
|
+
/**
|
16225
|
+
* @hidden
|
16226
|
+
* @internal
|
16227
|
+
* @beta
|
16228
|
+
* Limited to Microsoft-internal use
|
16229
|
+
*
|
16230
|
+
* Launches host-owned UI that lets a user select an app, installs it if required,
|
16231
|
+
* runs through app configuration if required, and then associates the app with the threadId provided
|
16232
|
+
*
|
16233
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
16234
|
+
*
|
16235
|
+
* @param appTypes What type of applications to show the user. If EDU is passed as appType, only apps supported by EDU tenant are shown.
|
16236
|
+
* If no value is passed, all apps are shown.
|
16237
|
+
*
|
16238
|
+
* @returns The HostEntityTabInstance of the newly associated app
|
16239
|
+
*
|
16240
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or installing
|
16241
|
+
* or configuring or adding tab fails
|
16242
|
+
*/
|
16243
|
+
function addAndConfigure(hostEntityIds, appTypes) {
|
16244
|
+
ensureInitialized(runtime);
|
16245
|
+
if (!isSupported()) {
|
16246
|
+
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
16247
|
+
}
|
16248
|
+
validateThreadId(hostEntityIds.threadId);
|
16249
|
+
if (appTypes && appTypes.length === 0) {
|
16250
|
+
throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);
|
16251
|
+
}
|
16252
|
+
return sendMessageToParentAsync(getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.addAndConfigure" /* ApiName.HostEntity_Tab_addAndConfigureApp */), 'hostEntity.tab.addAndConfigure', [hostEntityIds, appTypes]).then(([response]) => {
|
16253
|
+
var _a;
|
16254
|
+
if (isSdkError(response)) {
|
16255
|
+
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
16256
|
+
}
|
16257
|
+
return response;
|
16258
|
+
});
|
16259
|
+
}
|
16260
|
+
tab_1.addAndConfigure = addAndConfigure;
|
16261
|
+
/**
|
16262
|
+
* @hidden
|
16263
|
+
* @internal
|
16264
|
+
* @beta
|
16265
|
+
* Limited to Microsoft-internal use
|
16266
|
+
*
|
16267
|
+
* Returns all tab instances associated with a host entity
|
16268
|
+
*
|
16269
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
16270
|
+
*
|
16271
|
+
* @returns Object with array of HostEntityTabInstance's associated with a host entity
|
16272
|
+
*
|
16273
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid or fetching tabs fails
|
16274
|
+
*/
|
16275
|
+
function getAll(hostEntityIds) {
|
16276
|
+
ensureInitialized(runtime);
|
16277
|
+
if (!isSupported()) {
|
16278
|
+
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
16279
|
+
}
|
16280
|
+
validateThreadId(hostEntityIds.threadId);
|
16281
|
+
return sendMessageToParentAsync(getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.getAll" /* ApiName.HostEntity_Tab_getAll */), 'hostEntity.tab.getAll', [hostEntityIds]).then(([response]) => {
|
16282
|
+
var _a;
|
16283
|
+
if (isSdkError(response)) {
|
16284
|
+
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
16285
|
+
}
|
16286
|
+
return response;
|
16287
|
+
});
|
16288
|
+
}
|
16289
|
+
tab_1.getAll = getAll;
|
16290
|
+
/**
|
16291
|
+
* @hidden
|
16292
|
+
* @internal
|
16293
|
+
* @beta
|
16294
|
+
* Limited to Microsoft-internal use
|
16295
|
+
*
|
16296
|
+
* Launches host-owned UI that lets a user re-configure the contentUrl of the tab
|
16297
|
+
*
|
16298
|
+
* @param tab Configurable tab instance that needs to be updated
|
16299
|
+
*
|
16300
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
16301
|
+
*
|
16302
|
+
* @returns The HostEntityTabInstance of the updated tab
|
16303
|
+
*
|
16304
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,
|
16305
|
+
* re-configuring tab fails or if tab is a static tab
|
16306
|
+
*/
|
16307
|
+
function reconfigure(tab, hostEntityIds) {
|
16308
|
+
ensureInitialized(runtime);
|
16309
|
+
if (!isSupported()) {
|
16310
|
+
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
16311
|
+
}
|
16312
|
+
validateTab(tab);
|
16313
|
+
validateThreadId(hostEntityIds.threadId);
|
16314
|
+
return sendMessageToParentAsync(getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.reconfigure" /* ApiName.HostEntity_Tab_reconfigure */), 'hostEntity.tab.reconfigure', [tab, hostEntityIds]).then(([response]) => {
|
16315
|
+
var _a;
|
16316
|
+
if (isSdkError(response)) {
|
16317
|
+
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
16318
|
+
}
|
16319
|
+
return response;
|
16320
|
+
});
|
16321
|
+
}
|
16322
|
+
tab_1.reconfigure = reconfigure;
|
16323
|
+
/**
|
16324
|
+
* @hidden
|
16325
|
+
* @internal
|
16326
|
+
* @beta
|
16327
|
+
* Limited to Microsoft-internal use
|
16328
|
+
*
|
16329
|
+
* Launches host-owned UI that lets a user rename the tab
|
16330
|
+
*
|
16331
|
+
* @param tab Configurable tab instance that needs to be updated
|
16332
|
+
*
|
16333
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
16334
|
+
*
|
16335
|
+
* @returns The HostEntityTabInstance of the updated tab
|
16336
|
+
*
|
16337
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,
|
16338
|
+
* re-naming tab fails or if tab is a static tab
|
16339
|
+
*/
|
16340
|
+
function rename(tab, hostEntityIds) {
|
16341
|
+
ensureInitialized(runtime);
|
16342
|
+
if (!isSupported()) {
|
16343
|
+
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
16344
|
+
}
|
16345
|
+
validateTab(tab);
|
16346
|
+
validateThreadId(hostEntityIds.threadId);
|
16347
|
+
return sendMessageToParentAsync(getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.rename" /* ApiName.HostEntity_Tab_rename */), 'hostEntity.tab.rename', [tab, hostEntityIds]).then(([response]) => {
|
16348
|
+
var _a;
|
16349
|
+
if (isSdkError(response)) {
|
16350
|
+
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
16351
|
+
}
|
16352
|
+
return response;
|
16353
|
+
});
|
16354
|
+
}
|
16355
|
+
tab_1.rename = rename;
|
16356
|
+
/**
|
16357
|
+
* @hidden
|
16358
|
+
* @internal
|
16359
|
+
* @beta
|
16360
|
+
* Limited to Microsoft-internal use
|
16361
|
+
*
|
16362
|
+
* Launches host-owned UI that lets a user remove the tab
|
16363
|
+
*
|
16364
|
+
* @param tab tab instance that needs to be updated. Can be static tab or configurable tab.
|
16365
|
+
*
|
16366
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
16367
|
+
*
|
16368
|
+
* @returns Boolean. Returns true if removing tab was successful
|
16369
|
+
*
|
16370
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or
|
16371
|
+
* removing tab fails
|
16372
|
+
*/
|
16373
|
+
function remove(tab, hostEntityIds) {
|
16374
|
+
ensureInitialized(runtime);
|
16375
|
+
if (!isSupported()) {
|
16376
|
+
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
16377
|
+
}
|
16378
|
+
validateThreadId(hostEntityIds.threadId);
|
16379
|
+
validateTab(tab);
|
16380
|
+
return sendMessageToParentAsync(getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.remove" /* ApiName.HostEntity_Tab_remove */), 'hostEntity.tab.remove', [tab, hostEntityIds]).then(([response]) => {
|
16381
|
+
var _a;
|
16382
|
+
if (isSdkError(response)) {
|
16383
|
+
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
16384
|
+
}
|
16385
|
+
return true;
|
16386
|
+
});
|
16387
|
+
}
|
16388
|
+
tab_1.remove = remove;
|
16389
|
+
/**
|
16390
|
+
* @hidden
|
16391
|
+
* @internal
|
16392
|
+
* @beta
|
16393
|
+
* Limited to Microsoft-internal use
|
16394
|
+
*
|
16395
|
+
* Checks if the hostEntity.tab capability is supported by the host
|
16396
|
+
* @returns boolean to represent whether the histEntity and hostEntity.tab capability is supported
|
16397
|
+
*
|
16398
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
16399
|
+
*/
|
16400
|
+
function isSupported() {
|
16401
|
+
var _a;
|
16402
|
+
return ensureInitialized(runtime) && hostEntity.isSupported() && ((_a = runtime.supports.hostEntity) === null || _a === void 0 ? void 0 : _a.tab) ? true : false;
|
16403
|
+
}
|
16404
|
+
tab_1.isSupported = isSupported;
|
16405
|
+
/**
|
16406
|
+
* @hidden
|
16407
|
+
* @internal
|
16408
|
+
* @beta
|
16409
|
+
* Limited to Microsoft-internal use
|
16410
|
+
*
|
16411
|
+
* Checks if the threadId is defined
|
16412
|
+
* @throws Error if threadId is null, undefined or empty
|
16413
|
+
*/
|
16414
|
+
function validateThreadId(threadId) {
|
16415
|
+
if (!threadId || threadId.length == 0) {
|
16416
|
+
throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`);
|
16417
|
+
}
|
16418
|
+
}
|
16419
|
+
/**
|
16420
|
+
* @hidden
|
16421
|
+
* @internal
|
16422
|
+
* @beta
|
16423
|
+
* Limited to Microsoft-internal use
|
16424
|
+
*
|
16425
|
+
* Checks if the tabId is defined
|
16426
|
+
* @throws Error if tabId is null, undefined or empty
|
16427
|
+
*/
|
16428
|
+
function validateTab(tab) {
|
16429
|
+
if (!(tab === null || tab === void 0 ? void 0 : tab.internalTabInstanceId) || tab.internalTabInstanceId.length === 0) {
|
16430
|
+
throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`);
|
16431
|
+
}
|
16432
|
+
}
|
16433
|
+
})(tab = hostEntity.tab || (hostEntity.tab = {}));
|
16434
|
+
/**
|
16435
|
+
* @hidden
|
16436
|
+
* @internal
|
16437
|
+
* @beta
|
16438
|
+
* Limited to Microsoft-internal use
|
16439
|
+
*
|
16440
|
+
* Checks if the hostEntity capability is supported by the host
|
16441
|
+
* @returns boolean to represent whether the hostEntity capability is supported
|
16442
|
+
*
|
16443
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
16444
|
+
*/
|
16445
|
+
function isSupported() {
|
16446
|
+
return ensureInitialized(runtime) && runtime.supports.hostEntity ? true : false;
|
16447
|
+
}
|
16448
|
+
hostEntity.isSupported = isSupported;
|
16449
|
+
})(hostEntity || (hostEntity = {}));
|
16450
|
+
|
16451
|
+
;// CONCATENATED MODULE: ./src/private/index.ts
|
16050
16452
|
|
16051
16453
|
|
16052
16454
|
|