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