@microsoft/teams-js 2.38.0-beta.0 → 2.39.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.
@@ -1093,6 +1093,7 @@ __webpack_require__.d(__webpack_exports__, {
1093
1093
  settings: () => (/* reexport */ settings_namespaceObject),
1094
1094
  shareDeepLink: () => (/* reexport */ publicAPIs_shareDeepLink),
1095
1095
  sharing: () => (/* reexport */ sharing_namespaceObject),
1096
+ sidePanelInterfaces: () => (/* reexport */ sidePanelInterfaces_namespaceObject),
1096
1097
  stageView: () => (/* reexport */ stageView_namespaceObject),
1097
1098
  store: () => (/* reexport */ store_namespaceObject),
1098
1099
  tasks: () => (/* reexport */ tasks_namespaceObject),
@@ -1359,12 +1360,36 @@ __webpack_require__.d(eligibility_namespaceObject, {
1359
1360
  isSupported: () => (eligibility_isSupported)
1360
1361
  });
1361
1362
 
1363
+ // NAMESPACE OBJECT: ./src/private/copilot/sidePanelInterfaces.ts
1364
+ var sidePanelInterfaces_namespaceObject = {};
1365
+ __webpack_require__.r(sidePanelInterfaces_namespaceObject);
1366
+ __webpack_require__.d(sidePanelInterfaces_namespaceObject, {
1367
+ ContentItemType: () => (ContentItemType),
1368
+ MediaSelectionType: () => (MediaSelectionType),
1369
+ SidePanelErrorCode: () => (SidePanelErrorCode),
1370
+ SidePanelErrorImpl: () => (SidePanelErrorImpl),
1371
+ UserConsent: () => (UserConsent)
1372
+ });
1373
+
1374
+ // NAMESPACE OBJECT: ./src/private/copilot/sidePanel.ts
1375
+ var sidePanel_namespaceObject = {};
1376
+ __webpack_require__.r(sidePanel_namespaceObject);
1377
+ __webpack_require__.d(sidePanel_namespaceObject, {
1378
+ copilotSidePanelNotSupportedOnPlatformError: () => (copilotSidePanelNotSupportedOnPlatformError),
1379
+ getContent: () => (getContent),
1380
+ isResponseAReportableError: () => (isResponseAReportableError),
1381
+ isSupported: () => (sidePanel_isSupported),
1382
+ preCheckUserConsent: () => (preCheckUserConsent),
1383
+ registerUserActionContentSelect: () => (registerUserActionContentSelect)
1384
+ });
1385
+
1362
1386
  // NAMESPACE OBJECT: ./src/private/copilot/copilot.ts
1363
1387
  var copilot_namespaceObject = {};
1364
1388
  __webpack_require__.r(copilot_namespaceObject);
1365
1389
  __webpack_require__.d(copilot_namespaceObject, {
1366
1390
  customTelemetry: () => (customTelemetry_namespaceObject),
1367
- eligibility: () => (eligibility_namespaceObject)
1391
+ eligibility: () => (eligibility_namespaceObject),
1392
+ sidePanel: () => (sidePanel_namespaceObject)
1368
1393
  });
1369
1394
 
1370
1395
  // NAMESPACE OBJECT: ./src/private/externalAppAuthentication.ts
@@ -1863,7 +1888,7 @@ __webpack_require__.d(search_namespaceObject, {
1863
1888
  var history_namespaceObject = {};
1864
1889
  __webpack_require__.r(history_namespaceObject);
1865
1890
  __webpack_require__.d(history_namespaceObject, {
1866
- getContent: () => (getContent),
1891
+ getContent: () => (history_getContent),
1867
1892
  isSupported: () => (history_isSupported)
1868
1893
  });
1869
1894
 
@@ -4355,6 +4380,11 @@ const upgradeChain = [
4355
4380
  },
4356
4381
  },
4357
4382
  ];
4383
+ /**
4384
+ * This version is for legacy Teams mobile clients that don’t pass a runtime object during initialization.
4385
+ * It’s the minimum version required to support deeply nested app auth.
4386
+ */
4387
+ const legacyTeamsMobileVersionForDeeplyNestedAuth = '2.1.2';
4358
4388
  /**
4359
4389
  * This structure is used for versions of Teams that don't pass a runtime object during initialization.
4360
4390
  * Please see the extensive comments in versionAndPlatformAgnosticTeamsRuntimeConfig for more information
@@ -4422,6 +4452,10 @@ const mapTeamsVersionToSupportedCapabilities = {
4422
4452
  hostClientTypes: [HostClientType.android, HostClientType.ios, HostClientType.ipados, HostClientType.visionOS],
4423
4453
  },
4424
4454
  ],
4455
+ '2.1.2': [
4456
+ // isDeeplyNestedAuthSupported: true (based on const legacyTeamsMobileVersionForDeeplyNestedAuth)
4457
+ // for hostClientTypes: [HostClientType.android, HostClientType.ios, HostClientType.ipados, HostClientType.visionOS]
4458
+ ],
4425
4459
  };
4426
4460
  const generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');
4427
4461
  /**
@@ -4551,7 +4585,7 @@ function isSerializable(arg) {
4551
4585
  * @hidden
4552
4586
  * Package version.
4553
4587
  */
4554
- const version = "2.38.0-beta.0";
4588
+ const version = "2.39.0";
4555
4589
 
4556
4590
  ;// ./src/public/featureFlags.ts
4557
4591
  // All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
@@ -9384,10 +9418,238 @@ function isEligibilityInfoValid(eligibilityInfo) {
9384
9418
  return true;
9385
9419
  }
9386
9420
 
9421
+ ;// ./src/private/copilot/sidePanelInterfaces.ts
9422
+ /**
9423
+ * @hidden
9424
+ *
9425
+ * Interface for content data
9426
+ *
9427
+ * @internal
9428
+ * Limited to Microsoft-internal use
9429
+ */
9430
+ var ContentItemType;
9431
+ (function (ContentItemType) {
9432
+ ContentItemType["EMAIL"] = "email";
9433
+ ContentItemType["TEXT"] = "text";
9434
+ ContentItemType["MEDIA"] = "media";
9435
+ ContentItemType["CALENDAR_INVITE"] = "calendarInvite";
9436
+ ContentItemType["WEB_PAGE"] = "webPage";
9437
+ ContentItemType["MIXED"] = "mixed";
9438
+ })(ContentItemType || (ContentItemType = {}));
9439
+ /**
9440
+ * @hidden
9441
+ *
9442
+ * Enum for media selection types
9443
+ *
9444
+ * @internal
9445
+ * Limited to Microsoft-internal use
9446
+ */
9447
+ var MediaSelectionType;
9448
+ (function (MediaSelectionType) {
9449
+ MediaSelectionType["IMAGE"] = "image";
9450
+ MediaSelectionType["AUDIO"] = "audio";
9451
+ MediaSelectionType["VIDEO"] = "video";
9452
+ })(MediaSelectionType || (MediaSelectionType = {}));
9453
+ /**
9454
+ * @hidden
9455
+ *
9456
+ * Enum representing possible user consent states.
9457
+ *
9458
+ * @internal
9459
+ * Limited to Microsoft-internal use
9460
+ */
9461
+ var UserConsent;
9462
+ (function (UserConsent) {
9463
+ UserConsent["Accepted"] = "accepted";
9464
+ UserConsent["NotAccepted"] = "not_accepted";
9465
+ })(UserConsent || (UserConsent = {}));
9466
+ /**
9467
+ * @hidden
9468
+ *
9469
+ * Type for user action handler functions that receive content data.
9470
+ *
9471
+ * @internal
9472
+ * Limited to Microsoft-internal use
9473
+ */
9474
+ var SidePanelErrorCode;
9475
+ (function (SidePanelErrorCode) {
9476
+ SidePanelErrorCode["ConsentNotAccepted"] = "consent_not_accepted";
9477
+ SidePanelErrorCode["PageContentBlockedPolicy"] = "page_content_blocked_policy";
9478
+ SidePanelErrorCode["PageContentBlockedDlp"] = "page_content_blocked_dlp";
9479
+ SidePanelErrorCode["PageContentTypeNotSupportedYet"] = "page_content_type_not_supported_yet";
9480
+ SidePanelErrorCode["PageContentSizeNotSupported"] = "page_content_size_not_supported";
9481
+ SidePanelErrorCode["PageContextChanged"] = "page_context_changed";
9482
+ SidePanelErrorCode["PageContentExtractionFailed"] = "page_content_extraction_failed";
9483
+ SidePanelErrorCode["PageContentSizeNotSupportedPDF"] = "page_content_size_not_supported_pdf";
9484
+ SidePanelErrorCode["NotSupportedOnPlatform"] = "not_supported_on_platform";
9485
+ SidePanelErrorCode["OtherError"] = "other_error";
9486
+ })(SidePanelErrorCode || (SidePanelErrorCode = {}));
9487
+ /**
9488
+ * @hidden
9489
+ * @beta
9490
+ * Implementation of the SidePanelError interface.
9491
+ * This class extends the built-in Error class and includes an error code.
9492
+ * It is used to represent errors that occur during side panel operations.
9493
+ * The error code can be one of the SidePanelErrorCode values or a general ErrorCode.
9494
+ */
9495
+ class SidePanelErrorImpl extends Error {
9496
+ constructor(errorCode, message) {
9497
+ super(message);
9498
+ this.errorCode = errorCode;
9499
+ this.name = 'SidePanelError';
9500
+ }
9501
+ }
9502
+
9503
+ ;// ./src/private/copilot/sidePanel.ts
9504
+ /**
9505
+ * @beta
9506
+ * @hidden
9507
+ * User information required by specific apps
9508
+ * @internal
9509
+ * Limited to Microsoft-internal use
9510
+ * @module
9511
+ */
9512
+ var sidePanel_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
9513
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9514
+ return new (P || (P = Promise))(function (resolve, reject) {
9515
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9516
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9517
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9518
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9519
+ });
9520
+ };
9521
+
9522
+
9523
+
9524
+
9525
+
9526
+
9527
+
9528
+
9529
+
9530
+ const sidePanel_copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
9531
+ /**
9532
+ * @hidden
9533
+ * @internal
9534
+ * Limited to Microsoft-internal use
9535
+ * @beta
9536
+ * @returns boolean to represent whether copilot.sidePanel capability is supported
9537
+ *
9538
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9539
+ */
9540
+ function sidePanel_isSupported() {
9541
+ var _a;
9542
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.copilot) === null || _a === void 0 ? void 0 : _a.sidePanel);
9543
+ }
9544
+ /**
9545
+ * @beta
9546
+ * @hidden
9547
+ * Determines if the provided error object is an instance of SidePanelError or SdkError.
9548
+ * @internal
9549
+ * Limited to Microsoft-internal use
9550
+ * @param err The error object to check whether it is of SidePanelError type
9551
+ */
9552
+ function isResponseAReportableError(err) {
9553
+ if (typeof err !== 'object' || err === null) {
9554
+ return false;
9555
+ }
9556
+ const error = err;
9557
+ return ((Object.values(SidePanelErrorCode).includes(error.errorCode) &&
9558
+ (error.message === undefined || typeof error.message === 'string')) ||
9559
+ isSdkError(err) // If the error is an SdkError, it can be considered a SidePanelError
9560
+ );
9561
+ }
9562
+ /**
9563
+ * Get user content data from the hub to send to copilot app.
9564
+ *
9565
+ * @returns { Promise<Content> } - promise resolves with a content object containing user content data
9566
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
9567
+ *
9568
+ * @hidden
9569
+ * @beta
9570
+ * @internal
9571
+ * Limited to Microsoft-internal use
9572
+ */
9573
+ function getContent(request) {
9574
+ return sidePanel_awaiter(this, void 0, void 0, function* () {
9575
+ ensureInitialized(runtime);
9576
+ const input = request ? [new SerializableContentRequest(request)] : [];
9577
+ return callFunctionInHostAndHandleResponse("copilot.sidePanel.getContent" /* ApiName.Copilot_SidePanel_GetContent */, input, new GetContentResponseHandler(), getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.getContent" /* ApiName.Copilot_SidePanel_GetContent */), isResponseAReportableError);
9578
+ });
9579
+ }
9580
+ /**
9581
+ * When the copilot detects a contextual query it gets the user consent status before making the getContent call.
9582
+ *
9583
+ * @returns { Promise<PreCheckContextResponse> } - promise resolves with a content object containing user content data
9584
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
9585
+ *
9586
+ * @hidden
9587
+ * @beta
9588
+ * @internal
9589
+ * Limited to Microsoft-internal use
9590
+ */
9591
+ function preCheckUserConsent() {
9592
+ return sidePanel_awaiter(this, void 0, void 0, function* () {
9593
+ ensureInitialized(runtime);
9594
+ return callFunctionInHostAndHandleResponse("copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */, [], new PreCheckContextResponseHandler(), getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */), isResponseAReportableError);
9595
+ });
9596
+ }
9597
+ /**
9598
+ * @hidden
9599
+ * @beta
9600
+ * Registers a handler to get updated content data from the hub to send to copilot app.
9601
+ * This handler will be called when the user selects content in the application.
9602
+ * @param handler - The handler for getting user action content select.
9603
+ *
9604
+ * @internal
9605
+ * Limited to Microsoft-internal use
9606
+ */
9607
+ function registerUserActionContentSelect(handler) {
9608
+ registerHandlerHelper(getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.registerUserActionContentSelect" /* ApiName.Copilot_SidePanel_RegisterUserActionContentSelect */), 'copilot.sidePanel.userActionContentSelect', handler, [FrameContexts.content], () => {
9609
+ if (!sidePanel_isSupported()) {
9610
+ throw copilotSidePanelNotSupportedOnPlatformError;
9611
+ }
9612
+ });
9613
+ }
9614
+ /**
9615
+ * @hidden
9616
+ * @beta
9617
+ * @internal
9618
+ * Limited to Microsoft-internal use
9619
+ *
9620
+ * Error thrown when the copilot side panel API is not supported on the current platform.
9621
+ */
9622
+ const copilotSidePanelNotSupportedOnPlatformError = new SidePanelErrorImpl(SidePanelErrorCode.NotSupportedOnPlatform, 'This API is not supported on the current platform.');
9623
+ class GetContentResponseHandler extends ResponseHandler {
9624
+ validate(response) {
9625
+ return response !== null && typeof response === 'object';
9626
+ }
9627
+ deserialize(response) {
9628
+ return response;
9629
+ }
9630
+ }
9631
+ class PreCheckContextResponseHandler extends ResponseHandler {
9632
+ validate(response) {
9633
+ return response !== null && typeof response === 'object';
9634
+ }
9635
+ deserialize(response) {
9636
+ return response;
9637
+ }
9638
+ }
9639
+ class SerializableContentRequest {
9640
+ constructor(contentRequest) {
9641
+ this.contentRequest = contentRequest;
9642
+ }
9643
+ serialize() {
9644
+ return this.contentRequest;
9645
+ }
9646
+ }
9647
+
9387
9648
  ;// ./src/private/copilot/copilot.ts
9388
9649
 
9389
9650
 
9390
9651
 
9652
+
9391
9653
 
9392
9654
  ;// ./src/private/externalAppAuthentication.ts
9393
9655
  /**
@@ -13533,6 +13795,8 @@ function serializeValidSize(size) {
13533
13795
 
13534
13796
 
13535
13797
 
13798
+
13799
+
13536
13800
 
13537
13801
 
13538
13802
 
@@ -14982,7 +15246,16 @@ function canParentManageNAATrustedOrigins() {
14982
15246
  */
14983
15247
  function isDeeplyNestedAuthSupported() {
14984
15248
  var _a;
14985
- return (_a = (ensureInitialized(runtime) && runtime.isDeeplyNestedAuthSupported)) !== null && _a !== void 0 ? _a : false;
15249
+ return ((_a = (ensureInitialized(runtime) &&
15250
+ (runtime.isDeeplyNestedAuthSupported || isDeeplyNestedAuthSupportedForLegacyTeamsMobile()))) !== null && _a !== void 0 ? _a : false);
15251
+ }
15252
+ function isDeeplyNestedAuthSupportedForLegacyTeamsMobile() {
15253
+ return ensureInitialized(runtime) &&
15254
+ isHostAndroidOrIOSOrIPadOSOrVisionOS() &&
15255
+ runtime.isLegacyTeams &&
15256
+ isCurrentSDKVersionAtLeast(legacyTeamsMobileVersionForDeeplyNestedAuth)
15257
+ ? true
15258
+ : false;
14986
15259
  }
14987
15260
  function isNAAChannelRecommendedForLegacyTeamsMobile() {
14988
15261
  return ensureInitialized(runtime) &&
@@ -16961,7 +17234,7 @@ const sharingTelemetryVersionNumber_v2 = "v2" /* ApiVersionNumber.V_2 */;
16961
17234
  *
16962
17235
  * @beta
16963
17236
  */
16964
- function getContent() {
17237
+ function history_getContent() {
16965
17238
  return history_awaiter(this, void 0, void 0, function* () {
16966
17239
  ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
16967
17240
  if (!history_isSupported()) {