@microsoft/teams-js 2.34.0-beta.0 → 2.34.0-beta.1

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.
@@ -152,6 +152,7 @@ export declare const enum ApiName {
152
152
  Logs_Receive = "log.receive",
153
153
  Logs_RegisterLogRequestHandler = "log.request",
154
154
  Mail_ComposeMail = "mail.composeMail",
155
+ Mail_Handoff_ComposeMail = "mail.handoff.composeMail",
155
156
  Mail_OpenMailItem = "mail.openMailItem",
156
157
  Marketplace_AddOrUpdateCartItems = "marketplace.addOrUpdateCartItems",
157
158
  Marketplace_GetCart = "marketplace.getCart",
@@ -7,6 +7,16 @@
7
7
  * @module
8
8
  */
9
9
  import { UUID } from '../../public/uuidObject';
10
+ /**
11
+ * @hidden
12
+ * @internal
13
+ * Limited to Microsoft-internal use
14
+ * @beta
15
+ * @returns boolean to represent whether copilot.customTelemetry capability is supported
16
+ *
17
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
18
+ */
19
+ export declare function isSupported(): boolean;
10
20
  /**
11
21
  * Sends custom telemetry data to the host.
12
22
  *
@@ -32,7 +32,7 @@ export declare function registerAuthenticationHandlers(authenticateParameters: A
32
32
  *
33
33
  * @remarks
34
34
  * The authentication flow must start and end from the same domain, otherwise success and failure messages won't be returned to the window that initiated the call.
35
- * The [Teams authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on
35
+ * The [authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on
36
36
  * your own service (with a redirect round-trip to the 3rd party identity provider in the middle).
37
37
  *
38
38
  * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow
@@ -116,16 +116,24 @@ export declare function getUser(): Promise<UserProfile>;
116
116
  export declare function getUser(userRequest: UserRequest): void;
117
117
  /**
118
118
  * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}, the
119
- * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of
119
+ * window that was opened to execute the authentication flow should call this method after authentication to notify the caller of
120
120
  * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>} that the
121
121
  * authentication request was successful.
122
122
  *
123
123
  * @remarks
124
- * This function is usable only from the authentication window.
124
+ * The `result` parameter should **never** contain the token that was received from the identity provider, because a malicious app (rather than your own app) might have opened
125
+ * the authentication window. If that was the case, passing the token in this parameter would leak it to them. More secure methods for completing the authentication flow include:
126
+ * - For a purely browser-based experience (e.g., a personal app/tab app), you could store the token in browser local storage and then have your personal app retrieve it once
127
+ * this `notifySuccess` call is received.
128
+ * - For a server-based experience (e.g., a message extension), your authentication window could store the token on your service and then generate a unique code passed via this
129
+ * `result` parameter. The caller can then use the unique code to retrieve the token from your service.
130
+ *
131
+ * This function is usable only from an authentication window opened with {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}.
125
132
  * This call causes the authentication window to be closed.
126
133
  *
127
134
  * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives
128
- * this value in its callback or via the `Promise` return value
135
+ * this value in its callback or via the `Promise` return value.
136
+ *
129
137
  */
130
138
  export declare function notifySuccess(result?: string): void;
131
139
  /**
@@ -22,7 +22,7 @@ export * as location from './location';
22
22
  export * as meeting from './meeting/meeting';
23
23
  export * as monetization from './monetization';
24
24
  export * as calendar from './calendar';
25
- export * as mail from './mail';
25
+ export * as mail from './mail/mail';
26
26
  export * as teamsCore from './teamsAPIs';
27
27
  export * as people from './people';
28
28
  export * as profile from './profile';
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Used to interact with mail capability, including opening and composing mail.
3
+ * @module
4
+ *
5
+ * @beta
6
+ */
7
+ import { ComposeMailParams } from './mail';
8
+ /**
9
+ * Extended parameters for {@link composeMail}, including support for external handoff.
10
+ *
11
+ * This interface wraps {@link ComposeMailParamsWithHandoff} to provide additional functionality for scenarios
12
+ * where an external handoff is needed, such as transferring a draft email created in BizChat.
13
+ *
14
+ * @see {@link ComposeNewParams} for parameters when composing a new mail item.
15
+ * @see {@link ComposeReplyOrForwardParams} for reply or forward-specific parameters.
16
+ * @see {@link ComposeMailType} for supported mail operation types.
17
+ *
18
+ * @beta
19
+ */
20
+ export interface ComposeMailParamsWithHandoff {
21
+ /**
22
+ * Base parameters for composing a mail item.
23
+ */
24
+ composeMailParams: ComposeMailParams;
25
+ /**
26
+ * Use this endpoint to retrieve the handoff payload when BizChat creates an email draft for external handoff.
27
+ */
28
+ handoffId: string;
29
+ }
30
+ /**
31
+ * Compose a new email in the user's mailbox, opening it in the drafts UX instead of the standard email.
32
+ *
33
+ * @param composeMailParamsWithHandoff - Object that specifies the type of mail item to compose and the details of the mail item.
34
+ * @returns { Promise<void> } - promise resolves after the compose window has opened successfully in host SDK.
35
+ * @throws Error with a message describing whether the capability is not initialized or the input is invalid.
36
+ *
37
+ * @beta
38
+ */
39
+ export declare function composeMailWithHandoff(composeMailParamsWithHandoff: ComposeMailParamsWithHandoff): Promise<void>;
40
+ /**
41
+ * Checks if the mail capability and handoff sub-capability is supported by the host
42
+ * @returns boolean to represent whether the handoff sub-capability is supported
43
+ *
44
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
45
+ *
46
+ * @beta
47
+ */
48
+ export declare function isSupported(): boolean;
@@ -2,6 +2,7 @@
2
2
  * Used to interact with mail capability, including opening and composing mail.
3
3
  * @module
4
4
  */
5
+ import * as handoff from './handoff';
5
6
  /**
6
7
  * Opens a mail message in the host.
7
8
  *
@@ -86,9 +87,11 @@ export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends
86
87
  /**
87
88
  * Parameters supplied to {@link composeMail} when composing a new mail item
88
89
  *
90
+ * For ComposeMailType.New, it is valid to pass empty arrays for toRecipients, ccRecipients, and bccRecipients.
91
+ * This will result in a new email with (pre-populated) body content but no pre-populated recipients.
89
92
  * @see {@link ComposeNewParams}
90
93
  * @see {@link ComposeReplyOrForwardParams}
91
94
  * @see {@link ComposeMailType}
92
95
  */
93
96
  export type ComposeMailParams = ComposeNewParams | ComposeReplyOrForwardParams<ComposeMailType.Reply> | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll> | ComposeReplyOrForwardParams<ComposeMailType.Forward>;
94
- export {};
97
+ export { handoff };
@@ -57,7 +57,9 @@ interface IRuntimeV4 extends IBaseRuntime {
57
57
  readonly secondaryBrowser?: {};
58
58
  readonly location?: {};
59
59
  readonly logs?: {};
60
- readonly mail?: {};
60
+ readonly mail?: {
61
+ readonly handoff?: {};
62
+ };
61
63
  readonly marketplace?: {};
62
64
  readonly meetingRoom?: {};
63
65
  readonly menus?: {};
@@ -1 +1 @@
1
- export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as D from"./public/pages/pages.js";export{D as pages};import*as F from"./public/menus.js";export{F as menus};import*as w from"./public/media.js";export{w as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as B from"./public/location.js";export{B as location};import*as P from"./public/meeting/meeting.js";export{P as meeting};import*as L from"./public/monetization.js";export{L as monetization};import*as M from"./public/calendar.js";export{M as calendar};import*as U from"./public/mail.js";export{U as mail};import*as O from"./public/teamsAPIs.js";export{O as teamsCore};import*as z from"./public/people.js";export{z as people};import*as V from"./public/profile.js";export{V as profile};import*as W from"./public/videoEffects.js";export{W as videoEffects};import*as N from"./public/search.js";export{N as search};import*as R from"./public/sharing/sharing.js";export{R as sharing};import*as q from"./public/stageView/stageView.js";export{q as stageView};import*as G from"./public/visualMedia/visualMedia.js";export{G as visualMedia};import*as J from"./public/webStorage.js";export{J as webStorage};import*as K from"./public/call.js";export{K as call};import*as Q from"./public/appInitialization.js";export{Q as appInitialization};import*as X from"./public/thirdPartyCloudStorage.js";export{X as thirdPartyCloudStorage};import*as Y from"./public/settings.js";export{Y as settings};import*as Z from"./public/tasks.js";export{Z as tasks};import*as $ from"./public/marketplace.js";export{$ as marketplace};
1
+ export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as D from"./public/pages/pages.js";export{D as pages};import*as F from"./public/menus.js";export{F as menus};import*as w from"./public/media.js";export{w as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as B from"./public/location.js";export{B as location};import*as P from"./public/meeting/meeting.js";export{P as meeting};import*as L from"./public/monetization.js";export{L as monetization};import*as M from"./public/calendar.js";export{M as calendar};import*as U from"./public/mail/mail.js";export{U as mail};import*as O from"./public/teamsAPIs.js";export{O as teamsCore};import*as z from"./public/people.js";export{z as people};import*as V from"./public/profile.js";export{V as profile};import*as W from"./public/videoEffects.js";export{W as videoEffects};import*as N from"./public/search.js";export{N as search};import*as R from"./public/sharing/sharing.js";export{R as sharing};import*as q from"./public/stageView/stageView.js";export{q as stageView};import*as G from"./public/visualMedia/visualMedia.js";export{G as visualMedia};import*as J from"./public/webStorage.js";export{J as webStorage};import*as K from"./public/call.js";export{K as call};import*as Q from"./public/appInitialization.js";export{Q as appInitialization};import*as X from"./public/thirdPartyCloudStorage.js";export{X as thirdPartyCloudStorage};import*as Y from"./public/settings.js";export{Y as settings};import*as Z from"./public/tasks.js";export{Z as tasks};import*as $ from"./public/marketplace.js";export{$ as marketplace};
@@ -1 +1 @@
1
- import{__awaiter as t}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{callFunctionInHost as o}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as i}from"../../internal/telemetry.js";import{getCurrentTimestamp as m}from"../../internal/utils.js";import{runtime as n}from"../../public/runtime.js";const s=r("copilot");function l(r,l){var p;return void 0===l&&(l=null!==(p=m())&&void 0!==p?p:Date.now()),t(this,void 0,void 0,(function*(){return e(n),s("Sending custom telemetry data to host for stage: %s to record timestamp: %s",r,l),o("copilot.customTelemetry.sendCustomTelemetryData",[r.toString(),l],i("v2","copilot.customTelemetry.sendCustomTelemetryData"))}))}export{l as sendCustomTelemetryData};
1
+ import{__awaiter as t}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{callFunctionInHost as o}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as i}from"../../internal/telemetry.js";import{getCurrentTimestamp as n}from"../../internal/utils.js";import{runtime as m}from"../../public/runtime.js";const s=r("copilot");function l(){var t;return e(m)&&!!(null===(t=m.supports.copilot)||void 0===t?void 0:t.customTelemetry)}function p(r,l){var p;return void 0===l&&(l=null!==(p=n())&&void 0!==p?p:Date.now()),t(this,void 0,void 0,(function*(){return e(m),s("Sending custom telemetry data to host for stage: %s to record timestamp: %s",r,l),o("copilot.customTelemetry.sendCustomTelemetryData",[r.toString(),l],i("v2","copilot.customTelemetry.sendCustomTelemetryData"))}))}export{l as isSupported,p as sendCustomTelemetryData};
@@ -0,0 +1 @@
1
+ import{callFunctionInHost as o}from"../../internal/communication.js";import{validateEmailAddress as t}from"../../internal/emailAddressValidation.js";import{ensureInitialized as n}from"../../internal/internalAPIs.js";import{getApiVersionTag as r}from"../../internal/telemetry.js";import{FrameContexts as i}from"../constants.js";import{runtime as e}from"../runtime.js";import{ComposeMailType as a}from"./mail.js";function s(o){o&&0!==o.length&&o.forEach((o=>{t(o)}))}function m(t){if(n(e,i.content),!f())throw new Error("Not supported");return function(o){if(!o.handoffId||0==o.handoffId.trim().length||""===o.handoffId.trim())throw new Error("handoffId should not be null or empty string.");const t=o.composeMailParams;t.type===a.New&&(s(t.toRecipients),s(t.ccRecipients),s(t.bccRecipients))}(t),o("mail.handoff.composeMail",[new c(t)],r("v2","mail.handoff.composeMail"))}function f(){return!!(n(e)&&e.supports.mail&&e.supports.mail.handoff)}class c{constructor(o){this.composeMailParamsWithHandoff=o}serialize(){return this.composeMailParamsWithHandoff}}export{m as composeMailWithHandoff,f as isSupported};
@@ -0,0 +1 @@
1
+ import{sendAndHandleStatusAndReason as r}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{FrameContexts as e}from"../constants.js";import{runtime as n}from"../runtime.js";import*as i from"./handoff.js";export{i as handoff};function m(i){return new Promise((m=>{if(o(n,e.content),!l())throw new Error("Not supported");if(!i.itemId||!i.itemId.trim())throw new Error("Must supply an itemId to openMailItem");m(r(t("v2","mail.openMailItem"),"mail.openMailItem",i))}))}function p(i){return new Promise((m=>{if(o(n,e.content),!l())throw new Error("Not supported");m(r(t("v2","mail.composeMail"),"mail.composeMail",i))}))}function l(){return!(!o(n)||!n.supports.mail)}var a;!function(r){r.New="new",r.Reply="reply",r.ReplyAll="replyAll",r.Forward="forward"}(a||(a={}));export{a as ComposeMailType,p as composeMail,l as isSupported,m as openMailItem};
@@ -1 +1 @@
1
- const t="2.34.0-beta.0";export{t as version};
1
+ const t="2.34.0-beta.1";export{t as version};
@@ -1353,6 +1353,7 @@ __webpack_require__.d(conversations_namespaceObject, {
1353
1353
  var customTelemetry_namespaceObject = {};
1354
1354
  __webpack_require__.r(customTelemetry_namespaceObject);
1355
1355
  __webpack_require__.d(customTelemetry_namespaceObject, {
1356
+ isSupported: () => (customTelemetry_isSupported),
1356
1357
  sendCustomTelemetryData: () => (sendCustomTelemetryData)
1357
1358
  });
1358
1359
 
@@ -1771,12 +1772,21 @@ __webpack_require__.d(calendar_namespaceObject, {
1771
1772
  openCalendarItem: () => (openCalendarItem)
1772
1773
  });
1773
1774
 
1774
- // NAMESPACE OBJECT: ./src/public/mail.ts
1775
+ // NAMESPACE OBJECT: ./src/public/mail/handoff.ts
1776
+ var handoff_namespaceObject = {};
1777
+ __webpack_require__.r(handoff_namespaceObject);
1778
+ __webpack_require__.d(handoff_namespaceObject, {
1779
+ composeMailWithHandoff: () => (composeMailWithHandoff),
1780
+ isSupported: () => (handoff_isSupported)
1781
+ });
1782
+
1783
+ // NAMESPACE OBJECT: ./src/public/mail/mail.ts
1775
1784
  var mail_namespaceObject = {};
1776
1785
  __webpack_require__.r(mail_namespaceObject);
1777
1786
  __webpack_require__.d(mail_namespaceObject, {
1778
1787
  ComposeMailType: () => (ComposeMailType),
1779
1788
  composeMail: () => (composeMail),
1789
+ handoff: () => (handoff_namespaceObject),
1780
1790
  isSupported: () => (mail_isSupported),
1781
1791
  openMailItem: () => (openMailItem)
1782
1792
  });
@@ -4460,7 +4470,7 @@ function isSerializable(arg) {
4460
4470
  * @hidden
4461
4471
  * Package version.
4462
4472
  */
4463
- const version = "2.34.0-beta.0";
4473
+ const version = "2.34.0-beta.1";
4464
4474
 
4465
4475
  ;// ./src/internal/internalAPIs.ts
4466
4476
 
@@ -9289,6 +9299,19 @@ var customTelemetry_awaiter = (undefined && undefined.__awaiter) || function (th
9289
9299
 
9290
9300
  const copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
9291
9301
  const copilotLogger = getLogger('copilot');
9302
+ /**
9303
+ * @hidden
9304
+ * @internal
9305
+ * Limited to Microsoft-internal use
9306
+ * @beta
9307
+ * @returns boolean to represent whether copilot.customTelemetry capability is supported
9308
+ *
9309
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9310
+ */
9311
+ function customTelemetry_isSupported() {
9312
+ var _a;
9313
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.copilot) === null || _a === void 0 ? void 0 : _a.customTelemetry);
9314
+ }
9292
9315
  /**
9293
9316
  * Sends custom telemetry data to the host.
9294
9317
  *
@@ -15559,20 +15582,116 @@ function calendar_isSupported() {
15559
15582
  return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
15560
15583
  }
15561
15584
 
15562
- ;// ./src/public/mail.ts
15585
+ ;// ./src/public/mail/handoff.ts
15563
15586
  /**
15564
15587
  * Used to interact with mail capability, including opening and composing mail.
15565
15588
  * @module
15589
+ *
15590
+ * @beta
15566
15591
  */
15567
15592
 
15568
15593
 
15569
15594
 
15570
15595
 
15571
15596
 
15597
+
15598
+
15572
15599
  /**
15573
15600
  * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
15574
15601
  */
15575
15602
  const mailTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
15603
+ /**
15604
+ * Validates an array of email addresses.
15605
+ * For ComposeMailType.New, it is valid to pass empty arrays for toRecipients, ccRecipients, and bccRecipients.
15606
+ * This will result in a new email with handed-off (pre-populated) body content but no pre-populated recipients.
15607
+ *
15608
+ * @param emails - An optional array of email addresses to validate.
15609
+ * @throws Error with a message describing if the email address is invalid.
15610
+ *
15611
+ * @beta
15612
+ */
15613
+ function validateEmails(emails) {
15614
+ if (!emails || emails.length === 0) {
15615
+ return; // If the array is undefined or empty, consider it valid
15616
+ }
15617
+ // Use validateEmailAddress for each email in the param
15618
+ emails.forEach((email) => {
15619
+ validateEmailAddress(email); // This will throw an error if the email is invalid
15620
+ });
15621
+ }
15622
+ /**
15623
+ * Validates email addresses in the given ComposeMailParams object.
15624
+ * Validates `toRecipients`, `ccRecipients`, and `bccRecipients` for `ComposeNewParams`.
15625
+ *
15626
+ * @param params - The incoming ComposeMailParams object.
15627
+ * @throws Error with a message describing if the email address is invalid.
15628
+ *
15629
+ * @beta
15630
+ */
15631
+ function validateHandoffComposeMailParams(param) {
15632
+ if (!param.handoffId || param.handoffId.trim().length == 0 || param.handoffId.trim() === '') {
15633
+ throw new Error('handoffId should not be null or empty string.');
15634
+ }
15635
+ const composeMailParams = param.composeMailParams;
15636
+ if (composeMailParams.type === ComposeMailType.New) {
15637
+ validateEmails(composeMailParams.toRecipients);
15638
+ validateEmails(composeMailParams.ccRecipients);
15639
+ validateEmails(composeMailParams.bccRecipients);
15640
+ }
15641
+ // For Reply, ReplyAll, and Forward types, no validation needed
15642
+ }
15643
+ /**
15644
+ * Compose a new email in the user's mailbox, opening it in the drafts UX instead of the standard email.
15645
+ *
15646
+ * @param composeMailParamsWithHandoff - Object that specifies the type of mail item to compose and the details of the mail item.
15647
+ * @returns { Promise<void> } - promise resolves after the compose window has opened successfully in host SDK.
15648
+ * @throws Error with a message describing whether the capability is not initialized or the input is invalid.
15649
+ *
15650
+ * @beta
15651
+ */
15652
+ function composeMailWithHandoff(composeMailParamsWithHandoff) {
15653
+ ensureInitialized(runtime, FrameContexts.content);
15654
+ if (!handoff_isSupported()) {
15655
+ throw new Error('Not supported');
15656
+ }
15657
+ validateHandoffComposeMailParams(composeMailParamsWithHandoff);
15658
+ return callFunctionInHost("mail.handoff.composeMail" /* ApiName.Mail_Handoff_ComposeMail */, [new SerializableComposeMailParamsWithHandoff(composeMailParamsWithHandoff)], getApiVersionTag(mailTelemetryVersionNumber, "mail.handoff.composeMail" /* ApiName.Mail_Handoff_ComposeMail */));
15659
+ }
15660
+ /**
15661
+ * Checks if the mail capability and handoff sub-capability is supported by the host
15662
+ * @returns boolean to represent whether the handoff sub-capability is supported
15663
+ *
15664
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
15665
+ *
15666
+ * @beta
15667
+ */
15668
+ function handoff_isSupported() {
15669
+ return ensureInitialized(runtime) && runtime.supports.mail && runtime.supports.mail.handoff ? true : false;
15670
+ }
15671
+ class SerializableComposeMailParamsWithHandoff {
15672
+ constructor(composeMailParamsWithHandoff) {
15673
+ this.composeMailParamsWithHandoff = composeMailParamsWithHandoff;
15674
+ }
15675
+ serialize() {
15676
+ return this.composeMailParamsWithHandoff;
15677
+ }
15678
+ }
15679
+
15680
+ ;// ./src/public/mail/mail.ts
15681
+ /**
15682
+ * Used to interact with mail capability, including opening and composing mail.
15683
+ * @module
15684
+ */
15685
+
15686
+
15687
+
15688
+
15689
+
15690
+
15691
+ /**
15692
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
15693
+ */
15694
+ const mail_mailTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
15576
15695
  /**
15577
15696
  * Opens a mail message in the host.
15578
15697
  *
@@ -15587,7 +15706,7 @@ function openMailItem(openMailItemParams) {
15587
15706
  if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {
15588
15707
  throw new Error('Must supply an itemId to openMailItem');
15589
15708
  }
15590
- resolve(sendAndHandleStatusAndReason(getApiVersionTag(mailTelemetryVersionNumber, "mail.openMailItem" /* ApiName.Mail_OpenMailItem */), 'mail.openMailItem', openMailItemParams));
15709
+ resolve(sendAndHandleStatusAndReason(getApiVersionTag(mail_mailTelemetryVersionNumber, "mail.openMailItem" /* ApiName.Mail_OpenMailItem */), 'mail.openMailItem', openMailItemParams));
15591
15710
  });
15592
15711
  }
15593
15712
  /**
@@ -15602,7 +15721,7 @@ function composeMail(composeMailParams) {
15602
15721
  if (!mail_isSupported()) {
15603
15722
  throw new Error('Not supported');
15604
15723
  }
15605
- resolve(sendAndHandleStatusAndReason(getApiVersionTag(mailTelemetryVersionNumber, "mail.composeMail" /* ApiName.Mail_ComposeMail */), 'mail.composeMail', composeMailParams));
15724
+ resolve(sendAndHandleStatusAndReason(getApiVersionTag(mail_mailTelemetryVersionNumber, "mail.composeMail" /* ApiName.Mail_ComposeMail */), 'mail.composeMail', composeMailParams));
15606
15725
  });
15607
15726
  }
15608
15727
  /**
@@ -15626,6 +15745,7 @@ var ComposeMailType;
15626
15745
  /** Compose a new mail message with the content of an existing mail message forwarded to a new recipient. */
15627
15746
  ComposeMailType["Forward"] = "forward";
15628
15747
  })(ComposeMailType || (ComposeMailType = {}));
15748
+
15629
15749
 
15630
15750
  ;// ./src/public/teamsAPIs.ts
15631
15751
  /**