@microsoft/teams-js 2.40.0-beta.0 → 2.41.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 CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.40.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.41.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.40.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-QXdQxWIYy1PLsb9pdWIm5k6mjLxVKAF4ISp0BVCZZCiZNyaKXinYNAQVT8+8hEIf"
48
+ src="https://res.cdn.office.net/teams-js/2.41.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-foat9bCJflCyiUx3dfsImCX29CW3tNCWjj2SYbHfO8fhbVBR6Z/UsY6i2ihfwpvZ"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.40.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.41.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -88,6 +88,7 @@ export declare const enum ApiName {
88
88
  Copilot_SidePanel_RegisterOnUserConsentChange = "copilot.sidePanel.registerOnUserConsentChange",
89
89
  Copilot_SidePanel_GetContent = "copilot.sidePanel.getContent",
90
90
  Copilot_SidePanel_PreCheckUserConsent = "copilot.sidePanel.preCheckUserConsent",
91
+ Copilot_View_CloseSidePanel = "copilot.view.closeSidePanel",
91
92
  Dialog_AdaptiveCard_Bot_Open = "dialog.adaptiveCard.bot.open",
92
93
  Dialog_AdaptiveCard_Open = "dialog.adaptiveCard.open",
93
94
  Dialog_RegisterMessageForChildHandler = "dialog.registerMessageForChildHandler",
@@ -1,4 +1,5 @@
1
1
  import * as customTelemetry from './customTelemetry';
2
2
  import * as eligibility from './eligibility';
3
3
  import * as sidePanel from './sidePanel';
4
- export { customTelemetry, eligibility, sidePanel };
4
+ import * as view from './view';
5
+ export { customTelemetry, eligibility, sidePanel, view };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @hidden
3
+ * @internal
4
+ * Limited to Microsoft-internal use
5
+ * @beta
6
+ * @returns boolean to represent whether copilot.view capability is supported
7
+ *
8
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9
+ */
10
+ export declare function isSupported(): boolean;
11
+ /**
12
+ * Closes the side panel that is hosting the copilot app.
13
+ *
14
+ * @throws { Error } - Throws a Error if host SDK returns an error as a response to this call
15
+ *
16
+ * @hidden
17
+ * @beta
18
+ * @internal
19
+ * Limited to Microsoft-internal use
20
+ */
21
+ export declare function closeSidePanel(): Promise<void>;
@@ -103,9 +103,17 @@ export declare enum FrameContexts {
103
103
  */
104
104
  export declare enum RenderingSurfaces {
105
105
  /**
106
- * The mode the copilot app rendered by the host.
106
+ * Copilot running as a side panel in the host application.
107
107
  */
108
- copilotSidePanel = "copilotSidePanel"
108
+ copilotSidePanel = "copilotSidePanel",
109
+ /**
110
+ * Copilot running in the main pane of the host application.
111
+ */
112
+ copilotMainPane = "copilotMainPane",
113
+ /**
114
+ * Copilot running in full screen mode as an embedded app in the host application.
115
+ */
116
+ copilotFullScreen = "copilotFullScreen"
109
117
  }
110
118
  /**
111
119
  * Indicates the team type, currently used to distinguish between different team
@@ -34,6 +34,7 @@ interface IRuntimeV4 extends IBaseRuntime {
34
34
  readonly customTelemetry?: {};
35
35
  readonly eligibility?: {};
36
36
  readonly sidePanel?: {};
37
+ readonly view?: {};
37
38
  };
38
39
  readonly dialog?: {
39
40
  readonly card?: {
@@ -1 +1 @@
1
- import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};import*as e from"./sidePanel.js";export{e as sidePanel};
1
+ import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};import*as e from"./sidePanel.js";export{e as sidePanel};import*as t from"./view.js";export{t as view};
@@ -0,0 +1 @@
1
+ import{__awaiter as e}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHostAndHandleResponse as i}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{ResponseHandler as r}from"../../internal/responseHandler.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{runtime as n}from"../../public/runtime.js";function l(){var e;return o(n)&&!!(null===(e=n.supports.copilot)||void 0===e?void 0:e.view)}function s(){return e(this,void 0,void 0,(function*(){o(n),yield i("copilot.view.closeSidePanel",[],new p,t("v2","copilot.view.closeSidePanel"))}))}class p extends r{validate(e){return!0}deserialize(e){return e}}export{s as closeSidePanel,l as isSupported};
@@ -1 +1 @@
1
- import{ErrorCode as e}from"./interfaces.js";var o,a,i,s,n,t,r,m;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(a||(a={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(i||(i={})),function(e){e.copilotSidePanel="copilotSidePanel"}(s||(s={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(n||(n={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(t||(t={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(r||(r={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(m||(m={}));const d={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},l={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},c=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{m as ChannelType,r as DialogDimension,i as FrameContexts,o as HostClientType,a as HostName,s as RenderingSurfaces,r as TaskModuleDimension,n as TeamType,t as UserTeamRole,c as errorInvalidCount,f as errorInvalidResponse,d as errorNotSupportedOnPlatform,l as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
1
+ import{ErrorCode as e}from"./interfaces.js";var o,i,a,n,s,t,r,m;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(i||(i={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(a||(a={})),function(e){e.copilotSidePanel="copilotSidePanel",e.copilotMainPane="copilotMainPane",e.copilotFullScreen="copilotFullScreen"}(n||(n={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(s||(s={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(t||(t={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(r||(r={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(m||(m={}));const l={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},c={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},u=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{m as ChannelType,r as DialogDimension,a as FrameContexts,o as HostClientType,i as HostName,n as RenderingSurfaces,r as TaskModuleDimension,s as TeamType,t as UserTeamRole,u as errorInvalidCount,f as errorInvalidResponse,l as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,c as teamsMinAdaptiveCardVersion};
@@ -1 +1 @@
1
- const t="2.40.0-beta.0";export{t as version};
1
+ const o="2.41.0";export{o as version};
@@ -1388,13 +1388,22 @@ __webpack_require__.d(sidePanel_namespaceObject, {
1388
1388
  registerUserActionContentSelect: () => (registerUserActionContentSelect)
1389
1389
  });
1390
1390
 
1391
+ // NAMESPACE OBJECT: ./src/private/copilot/view.ts
1392
+ var view_namespaceObject = {};
1393
+ __webpack_require__.r(view_namespaceObject);
1394
+ __webpack_require__.d(view_namespaceObject, {
1395
+ closeSidePanel: () => (closeSidePanel),
1396
+ isSupported: () => (view_isSupported)
1397
+ });
1398
+
1391
1399
  // NAMESPACE OBJECT: ./src/private/copilot/copilot.ts
1392
1400
  var copilot_namespaceObject = {};
1393
1401
  __webpack_require__.r(copilot_namespaceObject);
1394
1402
  __webpack_require__.d(copilot_namespaceObject, {
1395
1403
  customTelemetry: () => (customTelemetry_namespaceObject),
1396
1404
  eligibility: () => (eligibility_namespaceObject),
1397
- sidePanel: () => (sidePanel_namespaceObject)
1405
+ sidePanel: () => (sidePanel_namespaceObject),
1406
+ view: () => (view_namespaceObject)
1398
1407
  });
1399
1408
 
1400
1409
  // NAMESPACE OBJECT: ./src/private/externalAppAuthentication.ts
@@ -3475,9 +3484,17 @@ var FrameContexts;
3475
3484
  var RenderingSurfaces;
3476
3485
  (function (RenderingSurfaces) {
3477
3486
  /**
3478
- * The mode the copilot app rendered by the host.
3487
+ * Copilot running as a side panel in the host application.
3479
3488
  */
3480
3489
  RenderingSurfaces["copilotSidePanel"] = "copilotSidePanel";
3490
+ /**
3491
+ * Copilot running in the main pane of the host application.
3492
+ */
3493
+ RenderingSurfaces["copilotMainPane"] = "copilotMainPane";
3494
+ /**
3495
+ * Copilot running in full screen mode as an embedded app in the host application.
3496
+ */
3497
+ RenderingSurfaces["copilotFullScreen"] = "copilotFullScreen";
3481
3498
  })(RenderingSurfaces || (RenderingSurfaces = {}));
3482
3499
  /**
3483
3500
  * Indicates the team type, currently used to distinguish between different team
@@ -4590,7 +4607,7 @@ function isSerializable(arg) {
4590
4607
  * @hidden
4591
4608
  * Package version.
4592
4609
  */
4593
- const version = "2.40.0-beta.0";
4610
+ const version = "2.41.0";
4594
4611
 
4595
4612
  ;// ./src/public/featureFlags.ts
4596
4613
  // 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.
@@ -9762,11 +9779,66 @@ class SerializableContentRequest {
9762
9779
  }
9763
9780
  }
9764
9781
 
9782
+ ;// ./src/private/copilot/view.ts
9783
+ var view_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
9784
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9785
+ return new (P || (P = Promise))(function (resolve, reject) {
9786
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9787
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9788
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9789
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9790
+ });
9791
+ };
9792
+
9793
+
9794
+
9795
+
9796
+
9797
+ const view_copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
9798
+ /**
9799
+ * @hidden
9800
+ * @internal
9801
+ * Limited to Microsoft-internal use
9802
+ * @beta
9803
+ * @returns boolean to represent whether copilot.view capability is supported
9804
+ *
9805
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9806
+ */
9807
+ function view_isSupported() {
9808
+ var _a;
9809
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.copilot) === null || _a === void 0 ? void 0 : _a.view);
9810
+ }
9811
+ /**
9812
+ * Closes the side panel that is hosting the copilot app.
9813
+ *
9814
+ * @throws { Error } - Throws a Error if host SDK returns an error as a response to this call
9815
+ *
9816
+ * @hidden
9817
+ * @beta
9818
+ * @internal
9819
+ * Limited to Microsoft-internal use
9820
+ */
9821
+ function closeSidePanel() {
9822
+ return view_awaiter(this, void 0, void 0, function* () {
9823
+ ensureInitialized(runtime);
9824
+ yield callFunctionInHostAndHandleResponse("copilot.view.closeSidePanel" /* ApiName.Copilot_View_CloseSidePanel */, [], new CloseSidePanelResponseHandler(), getApiVersionTag(view_copilotTelemetryVersionNumber, "copilot.view.closeSidePanel" /* ApiName.Copilot_View_CloseSidePanel */));
9825
+ });
9826
+ }
9827
+ class CloseSidePanelResponseHandler extends ResponseHandler {
9828
+ validate(_response) {
9829
+ return true;
9830
+ }
9831
+ deserialize(response) {
9832
+ return response;
9833
+ }
9834
+ }
9835
+
9765
9836
  ;// ./src/private/copilot/copilot.ts
9766
9837
 
9767
9838
 
9768
9839
 
9769
9840
 
9841
+
9770
9842
 
9771
9843
  ;// ./src/private/externalAppAuthentication.ts
9772
9844
  /**