@microsoft/teams-js 2.26.0 → 2.27.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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),
@@ -1019,6 +1020,7 @@ __webpack_require__.d(__webpack_exports__, {
1019
1020
  chat: () => (/* reexport */ chat),
1020
1021
  clipboard: () => (/* reexport */ clipboard),
1021
1022
  conversations: () => (/* reexport */ conversations),
1023
+ copilot: () => (/* reexport */ copilot),
1022
1024
  dialog: () => (/* reexport */ dialog),
1023
1025
  enablePrintCapability: () => (/* reexport */ enablePrintCapability),
1024
1026
  executeDeepLink: () => (/* reexport */ executeDeepLink),
@@ -1031,6 +1033,7 @@ __webpack_require__.d(__webpack_exports__, {
1031
1033
  getContext: () => (/* reexport */ getContext),
1032
1034
  getMruTabInstances: () => (/* reexport */ getMruTabInstances),
1033
1035
  getTabInstances: () => (/* reexport */ getTabInstances),
1036
+ hostEntity: () => (/* reexport */ hostEntity),
1034
1037
  initialize: () => (/* reexport */ initialize),
1035
1038
  initializeWithFrameContext: () => (/* reexport */ initializeWithFrameContext),
1036
1039
  liveShare: () => (/* reexport */ liveShare),
@@ -1130,7 +1133,7 @@ function isFollowingApiVersionTagFormat(apiVersionTag) {
1130
1133
  }
1131
1134
 
1132
1135
  ;// CONCATENATED MODULE: ./src/artifactsForCDN/validDomains.json
1133
- 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"]}');
1134
1137
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
1135
1138
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1136
1139
 
@@ -2376,6 +2379,89 @@ var DevicePermission;
2376
2379
  DevicePermission["GeoLocation"] = "geolocation";
2377
2380
  DevicePermission["Media"] = "media";
2378
2381
  })(DevicePermission || (DevicePermission = {}));
2382
+ /**
2383
+ * @hidden
2384
+ *
2385
+ * @beta
2386
+ */
2387
+ var Cohort;
2388
+ (function (Cohort) {
2389
+ Cohort["BCAIS"] = "bcais";
2390
+ Cohort["BCWAF"] = "bcwaf";
2391
+ Cohort["BCWBF"] = "bcwbf";
2392
+ })(Cohort || (Cohort = {}));
2393
+ /**
2394
+ * @hidden
2395
+ *
2396
+ * @beta
2397
+ */
2398
+ var Persona;
2399
+ (function (Persona) {
2400
+ /**
2401
+ * User has a faculty license
2402
+ */
2403
+ Persona["Faculty"] = "faculty";
2404
+ /**
2405
+ * User has a student license
2406
+ */
2407
+ Persona["Student"] = "student";
2408
+ /**
2409
+ * When user is not a faculty or student
2410
+ */
2411
+ Persona["Other"] = "other";
2412
+ })(Persona || (Persona = {}));
2413
+ /**
2414
+ * @hidden
2415
+ *
2416
+ * @beta
2417
+ */
2418
+ // https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values
2419
+ var LegalAgeGroupClassification;
2420
+ (function (LegalAgeGroupClassification) {
2421
+ /**
2422
+ * The user is considered an adult based on the age-related regulations of their country or region.
2423
+ */
2424
+ LegalAgeGroupClassification["Adult"] = "adult";
2425
+ /**
2426
+ * The user is a minor but is from a country or region that has no age-related regulations.
2427
+ */
2428
+ LegalAgeGroupClassification["MinorNoParentalConsentRequired"] = "minorNoParentalConsentRequired";
2429
+ /**
2430
+ * Reserved for future use
2431
+ */
2432
+ LegalAgeGroupClassification["MinorWithoutParentalConsent"] = "minorWithoutParentalConsent";
2433
+ /**
2434
+ * The user is considered a minor based on the age-related regulations of their country or region, and the administrator
2435
+ * of the account obtained appropriate consent from a parent or guardian.
2436
+ */
2437
+ LegalAgeGroupClassification["MinorWithParentalConsent"] = "minorWithParentalConsent";
2438
+ /**
2439
+ * The user is from a country or region that has additional age-related regulations, such as the United States,
2440
+ * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
2441
+ * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
2442
+ */
2443
+ LegalAgeGroupClassification["NonAdult"] = "nonAdult";
2444
+ })(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
2445
+ /**
2446
+ * @hidden
2447
+ *
2448
+ * @beta
2449
+ */
2450
+ var EduType;
2451
+ (function (EduType) {
2452
+ /**
2453
+ * User is from a tenant labeled as “HigherEd”
2454
+ */
2455
+ EduType["HigherEducation"] = "higherEducation";
2456
+ /**
2457
+ * User is from a tenant labeled as “K12”
2458
+ */
2459
+ EduType["K12"] = "k12";
2460
+ /**
2461
+ * User is from a tenant labeled as “Others” (e.g. research institutions)
2462
+ */
2463
+ EduType["Other"] = "other";
2464
+ })(EduType || (EduType = {}));
2379
2465
  /**
2380
2466
  * Currently supported Mime type
2381
2467
  */
@@ -3087,6 +3173,26 @@ function isRuntimeInitialized(runtime) {
3087
3173
  }
3088
3174
  }
3089
3175
  let runtime = _uninitializedRuntime;
3176
+ /**
3177
+ * This object is used as the default runtime for versions of Teams which don't pass a runtime object during
3178
+ * initialization. If the host DOES pass a runtime object during init, then this object is not used.
3179
+ *
3180
+ * In practice, this is used in Teams V1 and ALL versions of Teams mobile since they are the only hosts
3181
+ * that don't pass a runtime object during initialization (since they don't use the host SDK).
3182
+ *
3183
+ * If there are certain versions of Teams V1 or Teams mobile which support a capability but not ALL
3184
+ * versions, then you should modify the mapTeamsVersionToSupportedCapabilities structure for that purpose. That
3185
+ * structure allows you to specify particular versions on particular platforms that support certain capabilities.
3186
+ * This structure is version agnostic.
3187
+ *
3188
+ * In practice, if you are adding a new capability, you are likely only to need to update mapTeamsVersionToSupportedCapabilities
3189
+ * and NOT this structure, as this structure is effectively only used for capabilities that have existed "forever."
3190
+ *
3191
+ * Remember that everything here all still ONLY applies to versions of Teams that don't pass a runtime object during
3192
+ * initialization -- if they do, then neither this object nor the mapTeamsVersionToSupportedCapabilities structure is
3193
+ * used -- all runtime capabilities are dynamically discovered at runtime in the case where the runtime object is passed
3194
+ * during initialization.
3195
+ */
3090
3196
  const versionAndPlatformAgnosticTeamsRuntimeConfig = {
3091
3197
  apiVersion: 4,
3092
3198
  isNAAChannelRecommended: false,
@@ -3225,6 +3331,11 @@ const upgradeChain = [
3225
3331
  },
3226
3332
  },
3227
3333
  ];
3334
+ /**
3335
+ * This structure is used for versions of Teams that don't pass a runtime object during initialization.
3336
+ * Please see the extensive comments in versionAndPlatformAgnosticTeamsRuntimeConfig for more information
3337
+ * on when and how to use this structure.
3338
+ */
3228
3339
  const mapTeamsVersionToSupportedCapabilities = {
3229
3340
  // 1.0.0 just signifies "these capabilities have practically always been supported." For some of these
3230
3341
  // we don't know what the real first version that supported them was -- but it was long enough ago that
@@ -3395,7 +3506,7 @@ const _minRuntimeConfigToUninitialize = {
3395
3506
  * @hidden
3396
3507
  * Package version.
3397
3508
  */
3398
- const version = "2.26.0";
3509
+ const version = "2.27.0";
3399
3510
 
3400
3511
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
3401
3512
 
@@ -5457,6 +5568,9 @@ function tabsNavigateToTabHelper(apiVersionTag, tabInstance) {
5457
5568
  resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));
5458
5569
  });
5459
5570
  }
5571
+ /**
5572
+ * @hidden
5573
+ */
5460
5574
  function returnFocusHelper(apiVersionTag, navigateForward) {
5461
5575
  ensureInitialized(runtime);
5462
5576
  if (!pages.isSupported()) {
@@ -5533,14 +5647,77 @@ function configSetConfigHelper(apiVersionTag, instanceConfig) {
5533
5647
  var pages;
5534
5648
  (function (pages) {
5535
5649
  /**
5536
- * Return focus to the host. Will move focus forward or backward based on where the application container falls in
5537
- * the F6/tab order in the host.
5538
- * On mobile hosts or hosts where there is no keyboard interaction or UI notion of "focus" this function has no
5539
- * effect and will be a no-op when called.
5540
- * @param navigateForward - Determines the direction to focus in host.
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
5541
5679
  */
5542
- function returnFocus(navigateForward) {
5543
- returnFocusHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.returnFocus" /* ApiName.Pages_ReturnFocus */), navigateForward);
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
+ }
5544
5721
  }
5545
5722
  pages.returnFocus = returnFocus;
5546
5723
  /**
@@ -7818,6 +7995,62 @@ var conversations;
7818
7995
  conversations.isSupported = isSupported;
7819
7996
  })(conversations || (conversations = {}));
7820
7997
 
7998
+ ;// CONCATENATED MODULE: ./src/private/copilot.ts
7999
+
8000
+
8001
+
8002
+ /**
8003
+ * @beta
8004
+ * @hidden
8005
+ * Namespace to delegate copilot app specific APIs
8006
+ * @internal
8007
+ * Limited to Microsoft-internal use
8008
+ */
8009
+ var copilot;
8010
+ (function (copilot) {
8011
+ /**
8012
+ * @beta
8013
+ * @hidden
8014
+ * User information required by specific apps
8015
+ * @internal
8016
+ * Limited to Microsoft-internal use
8017
+ */
8018
+ let eligibility;
8019
+ (function (eligibility) {
8020
+ /**
8021
+ * @hidden
8022
+ * @internal
8023
+ * Limited to Microsoft-internal use
8024
+ * @beta
8025
+ * @returns boolean to represent whether copilot.eligibility capability is supported
8026
+ *
8027
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
8028
+ */
8029
+ function isSupported() {
8030
+ var _a;
8031
+ return ensureInitialized(runtime) && !!((_a = runtime.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation);
8032
+ }
8033
+ eligibility.isSupported = isSupported;
8034
+ /**
8035
+ * @hidden
8036
+ * @internal
8037
+ * Limited to Microsoft-internal use
8038
+ * @beta
8039
+ * @returns the copilot eligibility information about the user
8040
+ *
8041
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
8042
+ */
8043
+ function getEligibilityInfo() {
8044
+ ensureInitialized(runtime);
8045
+ if (!isSupported()) {
8046
+ throw errorNotSupportedOnPlatform;
8047
+ }
8048
+ return runtime.hostVersionsInfo.appEligibilityInformation;
8049
+ }
8050
+ eligibility.getEligibilityInfo = getEligibilityInfo;
8051
+ })(eligibility = copilot.eligibility || (copilot.eligibility = {}));
8052
+ })(copilot || (copilot = {}));
8053
+
7821
8054
  ;// CONCATENATED MODULE: ./src/private/externalAppAuthentication.ts
7822
8055
 
7823
8056
 
@@ -10795,23 +11028,75 @@ var videoEffectsEx;
10795
11028
  videoEffectsEx.notifyFatalError = notifyFatalError;
10796
11029
  })(videoEffectsEx || (videoEffectsEx = {}));
10797
11030
 
10798
- ;// CONCATENATED MODULE: ./src/private/index.ts
10799
-
10800
-
10801
-
10802
-
10803
-
10804
-
10805
-
10806
-
10807
-
10808
-
10809
-
10810
-
10811
-
10812
-
10813
-
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
10814
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
+ }
10815
11100
 
10816
11101
  ;// CONCATENATED MODULE: ./src/internal/deepLinkConstants.ts
10817
11102
  /**
@@ -14251,6 +14536,8 @@ var webStorage_awaiter = (undefined && undefined.__awaiter) || function (thisArg
14251
14536
 
14252
14537
 
14253
14538
 
14539
+
14540
+
14254
14541
  /**
14255
14542
  * Contains functionality enabling apps to query properties about how the host manages web storage (`Window.LocalStorage`)
14256
14543
  *
@@ -14273,10 +14560,33 @@ var webStorage;
14273
14560
  if (!isSupported()) {
14274
14561
  throw errorNotSupportedOnPlatform;
14275
14562
  }
14563
+ if (runtime.isLegacyTeams &&
14564
+ (GlobalVars.hostClientType === HostClientType.android ||
14565
+ GlobalVars.hostClientType === HostClientType.ios ||
14566
+ GlobalVars.hostClientType === HostClientType.ipados) &&
14567
+ (yield getHostName()) === HostName.teams) {
14568
+ // On Teams Mobile, they haven't yet implemented this capability. However, for compatibility reasons, we need
14569
+ // to act as if they do. If they did implement it, they would return true, so that's what we do here.
14570
+ // Getting Teams Mobile to implement this is a work-in-progress. Once they do implement it, we can remove this
14571
+ // whole if-block. Until then, we cannot send the message to them because they will not understand it.
14572
+ // Once they do implement it, this if-block will automatically not apply because runtime.isLegacyTeams will no
14573
+ // longer be true. So, we don't need to worry about removing this if block "at the right time". We can
14574
+ // just keep it here until Teams Mobile implements this capability and uses the host SDK everywhere, at which
14575
+ // point we can remove this whole if-block at our leisure.
14576
+ return true;
14577
+ }
14276
14578
  return yield sendAndUnwrap(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "webStorage.isWebStorageClearedOnUserLogOut" /* ApiName.WebStorage_IsWebStorageClearedOnUserLogOut */), "webStorage.isWebStorageClearedOnUserLogOut" /* ApiName.WebStorage_IsWebStorageClearedOnUserLogOut */);
14277
14579
  });
14278
14580
  }
14279
14581
  webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
14582
+ function getHostName() {
14583
+ return webStorage_awaiter(this, void 0, void 0, function* () {
14584
+ if (cachedHostName === null) {
14585
+ cachedHostName = (yield app.getContext()).app.host.name;
14586
+ }
14587
+ return cachedHostName;
14588
+ });
14589
+ }
14280
14590
  /**
14281
14591
  * Checks if webStorage capability is supported by the host
14282
14592
  * @returns boolean to represent whether the webStorage capability is supported
@@ -14290,6 +14600,12 @@ var webStorage;
14290
14600
  }
14291
14601
  webStorage.isSupported = isSupported;
14292
14602
  })(webStorage || (webStorage = {}));
14603
+ // It is safe to cache the host name because the host cannot change at runtime
14604
+ let cachedHostName = null;
14605
+ // ...except during unit tests, where we will change it at runtime regularly for testing purposes
14606
+ function clearWebStorageCachedHostNameForTests() {
14607
+ cachedHostName = null;
14608
+ }
14293
14609
 
14294
14610
  ;// CONCATENATED MODULE: ./src/public/call.ts
14295
14611
 
@@ -14477,7 +14793,8 @@ var thirdPartyCloudStorage;
14477
14793
  /**
14478
14794
  * Get drag-and-drop files using a callback.
14479
14795
  *
14480
- * @param {string} dragAndDropInput - Teams thread id or Teams conversation id from a Teams chat/channel
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.
14481
14798
  * @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
14482
14799
  * A callback function to handle the result of the operation
14483
14800
  * @beta
@@ -15850,6 +16167,289 @@ var marketplace;
15850
16167
 
15851
16168
 
15852
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
15853
16453
 
15854
16454
 
15855
16455