@microsoft/teams-js 2.50.0 → 2.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +3 -1
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +16 -0
- package/dist/esm/packages/teams-js/dts/private/plugins.d.ts +94 -0
- package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +35 -0
- package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +17 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +19 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/plugins.js +1 -0
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +171 -3
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
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.
|
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.51.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.
|
|
49
|
-
integrity="sha384-
|
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.51.0/js/MicrosoftTeams.min.js"
|
|
49
|
+
integrity="sha384-U54aLArLUNmLIfKxJ7P5Ybiq6sXmSH6aNROHNdKLpABDXH+KB/wE17SEz43/zsAe"
|
|
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.
|
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.51.0/dist/MicrosoftTeams.min.js"></script>
|
|
55
55
|
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
|
@@ -20,7 +20,9 @@ export declare abstract class ResponseHandler<SerializedReturnValueFromHost, Des
|
|
|
20
20
|
*/
|
|
21
21
|
abstract deserialize(response: SerializedReturnValueFromHost): DeserializedReturnValueFromHost;
|
|
22
22
|
}
|
|
23
|
-
export type SimpleType = string | number | boolean | null | undefined | SimpleType[]
|
|
23
|
+
export type SimpleType = string | number | boolean | null | undefined | SimpleType[] | {
|
|
24
|
+
[key: string]: SimpleType;
|
|
25
|
+
};
|
|
24
26
|
/**
|
|
25
27
|
* This class is used for validating and deserializing boolean responses from the host.
|
|
26
28
|
*/
|
|
@@ -47,6 +47,7 @@ export declare const enum ApiName {
|
|
|
47
47
|
App_NotifySuccess = "app.notifySuccess",
|
|
48
48
|
App_OpenLink = "app.openLink",
|
|
49
49
|
App_RegisterOnThemeChangeHandler = "app.registerOnThemeChangeHandler",
|
|
50
|
+
App_RegisterOnPromptHandler = "app.registerOnPromptHandler",
|
|
50
51
|
App_RegisterOnContextChangeHandler = "app.registerOnContextChangeHandler",
|
|
51
52
|
AppInitialization_NotifyAppLoaded = "appInitialization.notifyAppLoaded",
|
|
52
53
|
AppInitialization_NotifyExpectedFailure = "appInitialization.notifyExpectedFailure",
|
|
@@ -264,6 +265,8 @@ export declare const enum ApiName {
|
|
|
264
265
|
PrivateAPIs_RegisterUserSettingsChangeHandler = "registerUserSettingsChangeHandler",
|
|
265
266
|
PrivateAPIs_SendCustomMessage = "sendCustomMessage",
|
|
266
267
|
PrivateAPIs_UploadCustomApp = "uploadCustomApp",
|
|
268
|
+
Plugins_ReceiveMessage = "plugins.receiveMessage",
|
|
269
|
+
Plugins_SendMessage = "plugins.sendMessage",
|
|
267
270
|
Profile_ShowProfile = "profile.showProfile",
|
|
268
271
|
PublicAPIs_ExecuteDeepLink = "executeDeepLink",
|
|
269
272
|
PublicAPIs_GetContext = "getContext",
|
|
@@ -18,6 +18,7 @@ export * as messageChannels from './messageChannels/messageChannels';
|
|
|
18
18
|
export * as nestedAppAuthBridge from './nestedAppAuth/nestedAppAuthBridge';
|
|
19
19
|
export * as notifications from './notifications';
|
|
20
20
|
export * as otherAppStateChange from './otherAppStateChange';
|
|
21
|
+
export * as plugins from './plugins';
|
|
21
22
|
export * as remoteCamera from './remoteCamera';
|
|
22
23
|
export * as appEntity from './appEntity';
|
|
23
24
|
export * as teams from './teams/teams';
|
|
@@ -235,6 +235,22 @@ export interface FilePreviewParameters {
|
|
|
235
235
|
* Limited to Microsoft-internal use
|
|
236
236
|
*/
|
|
237
237
|
atpData?: string;
|
|
238
|
+
/**
|
|
239
|
+
* @hidden
|
|
240
|
+
* Optional; sharelink of a ODSP file
|
|
241
|
+
*
|
|
242
|
+
* @internal
|
|
243
|
+
* Limited to Microsoft-internal use
|
|
244
|
+
*/
|
|
245
|
+
shareUrl?: string;
|
|
246
|
+
/**
|
|
247
|
+
* @hidden
|
|
248
|
+
* Optional; the reply chain id of message where file is shared. Usually found in channels
|
|
249
|
+
*
|
|
250
|
+
* @internal
|
|
251
|
+
* Limited to Microsoft-internal use
|
|
252
|
+
*/
|
|
253
|
+
replyChainId?: string;
|
|
238
254
|
}
|
|
239
255
|
/**
|
|
240
256
|
* @hidden
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { SimpleType } from '../internal/responseHandler';
|
|
2
|
+
/**
|
|
3
|
+
* The type of arguments that can be passed in a {@link PluginMessage}.
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
* @internal
|
|
7
|
+
* Limited to Microsoft-internal use
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export type PluginMessageArg = SimpleType;
|
|
11
|
+
/**
|
|
12
|
+
* Indicates whether the plugin capability is available in the current host.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This API validates SDK initialization and then checks runtime capability flags
|
|
16
|
+
* for `supports.plugins`.
|
|
17
|
+
*
|
|
18
|
+
* @returns `true` if the host reports plugin support; otherwise `false`.
|
|
19
|
+
*
|
|
20
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed.
|
|
21
|
+
*
|
|
22
|
+
* @hidden
|
|
23
|
+
* @internal
|
|
24
|
+
* Limited to Microsoft-internal use
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
export declare function isSupported(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Canonical message envelope used for plugin send/receive operations.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Messages are used to communicate between plugin and host.
|
|
33
|
+
*
|
|
34
|
+
* @property func - Function/event name for the message.
|
|
35
|
+
* @property args - Optional JSON payload.
|
|
36
|
+
* @property correlationId - Optional ID for request/response correlation.
|
|
37
|
+
*
|
|
38
|
+
* @hidden
|
|
39
|
+
* @internal
|
|
40
|
+
* Limited to Microsoft-internal use
|
|
41
|
+
* @beta
|
|
42
|
+
*/
|
|
43
|
+
export type PluginMessage = {
|
|
44
|
+
func: string;
|
|
45
|
+
args?: PluginMessageArg;
|
|
46
|
+
correlationId?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Sends a plugin message to the host.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The message payload is serialized before transmission to the host.
|
|
53
|
+
* All payload data must be JSON-safe (see {@link JsonValue}).
|
|
54
|
+
*
|
|
55
|
+
* @returns A promise that resolves when the host acknowledges the message.
|
|
56
|
+
*
|
|
57
|
+
* @throws Error if SDK initialization has not completed, if the host returns
|
|
58
|
+
* an error response, or if `func` is missing.
|
|
59
|
+
*
|
|
60
|
+
* @hidden
|
|
61
|
+
* @internal
|
|
62
|
+
* Limited to Microsoft-internal use
|
|
63
|
+
* @beta
|
|
64
|
+
*/
|
|
65
|
+
export declare function sendPluginMessage(message: PluginMessage): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Handler signature for incoming plugin messages.
|
|
68
|
+
*
|
|
69
|
+
* @param message - Normalized plugin message envelope.
|
|
70
|
+
*
|
|
71
|
+
* @hidden
|
|
72
|
+
* @internal
|
|
73
|
+
* Limited to Microsoft-internal use
|
|
74
|
+
* @beta
|
|
75
|
+
*/
|
|
76
|
+
export type ReceiveMessageHandler = (message: PluginMessage) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Registers a handler to receive plugin messages from the host.
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* This API registers the callback under the `plugin.receiveMessage` handler name.
|
|
82
|
+
* When the host dispatches a plugin message, the supplied handler is invoked with
|
|
83
|
+
* the received JSON payload.
|
|
84
|
+
*
|
|
85
|
+
* @param handler - Callback invoked for each incoming plugin message payload.
|
|
86
|
+
*
|
|
87
|
+
* @throws Error if plugin messaging is not supported by the current host.
|
|
88
|
+
*
|
|
89
|
+
* @hidden
|
|
90
|
+
* @internal
|
|
91
|
+
* Limited to Microsoft-internal use
|
|
92
|
+
* @beta
|
|
93
|
+
*/
|
|
94
|
+
export declare function registerPluginMessage(handler: ReceiveMessageHandler): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FilePreviewParameters, UserSettingTypes } from './interfaces';
|
|
2
2
|
export declare function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void;
|
|
3
3
|
/**
|
|
4
|
+
* @deprecated Use {@link plugins.sendPluginMessage} with {@link plugins.registerPluginMessage} and a correlationId-based response pattern.
|
|
5
|
+
*
|
|
4
6
|
* @hidden
|
|
5
7
|
* Sends a custom action MessageRequest to host or parent window
|
|
6
8
|
*
|
|
@@ -9,6 +11,39 @@ export declare function uploadCustomApp(manifestBlob: Blob, onComplete?: (status
|
|
|
9
11
|
* @param callback - Optionally specify a callback to receive response parameters from the parent
|
|
10
12
|
* @returns id of sent message
|
|
11
13
|
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Prefer the plugin event model for new development. In that model, send a request message
|
|
16
|
+
* with a unique `correlationId` and listen for a response event with the same `correlationId`.
|
|
17
|
+
*
|
|
18
|
+
* Example:
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Request side
|
|
21
|
+
* const correlationId = crypto.randomUUID();
|
|
22
|
+
*
|
|
23
|
+
* plugins.registerPluginMessage((message) => {
|
|
24
|
+
* if (message.func !== 'example.customAction.response') {
|
|
25
|
+
* return;
|
|
26
|
+
* }
|
|
27
|
+
* if (message.correlationId !== correlationId) {
|
|
28
|
+
* return;
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* // This is the response for the request above.
|
|
32
|
+
* const response = message.args;
|
|
33
|
+
* console.log('Received response', response);
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* await plugins.sendPluginMessage({
|
|
37
|
+
* func: 'example.customAction.request',
|
|
38
|
+
* args: { itemId: '12345' },
|
|
39
|
+
* correlationId,
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Host side contract example (conceptual):
|
|
43
|
+
* // On receiving example.customAction.request, send back
|
|
44
|
+
* // example.customAction.response with the same correlationId.
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
12
47
|
* @internal
|
|
13
48
|
* Limited to Microsoft-internal use
|
|
14
49
|
*/
|
|
@@ -162,6 +162,19 @@ export interface AppInfo {
|
|
|
162
162
|
*/
|
|
163
163
|
manifestVersion?: string;
|
|
164
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Features supported by the host that the app can query for via getContext.
|
|
167
|
+
*/
|
|
168
|
+
export type HostFeatures = {
|
|
169
|
+
/**
|
|
170
|
+
* Indicates whether the host supports nested wildcards in valid domains. If true, the host will allow valid domains with nested wildcards (e.g. apps.*.com). If false or undefined, the host will only allow valid domains with a single wildcard level (e.g. *.test.com).
|
|
171
|
+
*/
|
|
172
|
+
nestedWildcardsInValidDomains?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Indicates whether server side rendering is enabled for the host.
|
|
175
|
+
*/
|
|
176
|
+
serverSideRendering?: boolean;
|
|
177
|
+
};
|
|
165
178
|
/**
|
|
166
179
|
* Represents information about the application's host.
|
|
167
180
|
*/
|
|
@@ -174,6 +187,10 @@ export interface AppHostInfo {
|
|
|
174
187
|
* The client type on which the host is running
|
|
175
188
|
*/
|
|
176
189
|
clientType: HostClientType;
|
|
190
|
+
/**
|
|
191
|
+
* The features supported by the host. This is an optional field that may not be populated by all hosts, and may be added to over time as new features are added to hosts. Because of this, apps should always check for the presence of a feature and its value before using it, and should gracefully handle the case where the feature is not present.
|
|
192
|
+
*/
|
|
193
|
+
features?: HostFeatures;
|
|
177
194
|
/**
|
|
178
195
|
* Unique ID for the current Host session for use in correlating telemetry data.
|
|
179
196
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as authentication from './authentication';
|
|
2
2
|
export { ChannelType, DialogDimension, FrameContexts, HostClientType, HostName, RenderingSurfaces, TaskModuleDimension, TeamType, UserTeamRole, } from './constants';
|
|
3
|
-
export { ActionInfo, ActionObjectType, AdaptiveCardVersion, AdaptiveCardDialogInfo, BaseActionObject, BotAdaptiveCardDialogInfo, BotUrlDialogInfo, Context, DeepLinkParameters, DialogInfo, DialogSize, EduType, ErrorCode, FileOpenPreference, FrameContext, FrameInfo, HostMemoryMetrics, HostToAppFrameMemoryMetrics, HostToAppPerformanceMetrics, LoadContext, LocaleInfo, M365ContentAction, ResumeContext, SdkError, SecondaryId, SecondaryM365ContentIdName, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters, TaskInfo, TeamInformation, UrlDialogInfo, } from './interfaces';
|
|
3
|
+
export { ActionInfo, ActionObjectType, AdaptiveCardVersion, AdaptiveCardDialogInfo, AppState, BaseActionObject, BotAdaptiveCardDialogInfo, BotUrlDialogInfo, Context, DeepLinkParameters, DialogInfo, DialogSize, EduType, ErrorCode, FileOpenPreference, FrameContext, FrameInfo, HostMemoryMetrics, HostToAppFrameMemoryMetrics, HostToAppPerformanceMetrics, LoadContext, LocaleInfo, M365ContentAction, ResumeContext, SdkError, SecondaryId, SecondaryM365ContentIdName, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters, TaskInfo, TeamInformation, UrlDialogInfo, } from './interfaces';
|
|
4
4
|
export * as app from './app/app';
|
|
5
5
|
export { AppId } from './appId';
|
|
6
6
|
export * as appPerformanceMetrics from './appPerformanceMetrics';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HostFeatures } from './app/app';
|
|
1
2
|
import { ChannelType, DialogDimension, HostClientType, HostName, RenderingSurfaces, TeamType, UserTeamRole } from './constants';
|
|
2
3
|
import { FrameContexts } from './constants';
|
|
3
4
|
/**
|
|
@@ -729,6 +730,12 @@ export interface Context {
|
|
|
729
730
|
* For example, if Bizchat is running in Calendar in Teams, this would be ["Calendar", "Teams"].
|
|
730
731
|
*/
|
|
731
732
|
hostAncestors?: string[];
|
|
733
|
+
/**
|
|
734
|
+
* @deprecated
|
|
735
|
+
* As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.features | app.Context.app.host.features} instead
|
|
736
|
+
* The features supported by the host. This is an optional field that may not be populated by all hosts, and may be added to over time as new features are added to hosts. Because of this, apps should always check for the presence of a feature and its value before using it, and should gracefully handle the case where the feature is not present.
|
|
737
|
+
*/
|
|
738
|
+
hostFeatures?: HostFeatures;
|
|
732
739
|
}
|
|
733
740
|
/** Represents the parameters used to share a deep link. */
|
|
734
741
|
export interface ShareDeepLinkParameters {
|
|
@@ -1271,15 +1278,27 @@ export type HostToAppFrameMemoryMetrics = {
|
|
|
1271
1278
|
*/
|
|
1272
1279
|
treeLevel: number;
|
|
1273
1280
|
};
|
|
1281
|
+
/**
|
|
1282
|
+
* The state of the app in terms of its lifecycle and caching status, which can impact its performance characteristics and memory usage.
|
|
1283
|
+
*/
|
|
1284
|
+
export type AppState = 'cached' | 'precached' | 'active';
|
|
1274
1285
|
/**
|
|
1275
1286
|
* Memory metrics provided by the host for the app.
|
|
1276
1287
|
*/
|
|
1277
1288
|
export type HostMemoryMetrics = {
|
|
1278
1289
|
/**
|
|
1290
|
+
* The current state of the app, which can be 'cached', 'precached', or 'active'. This provides insight into the app's lifecycle stage and can help developers understand the performance characteristics and memory usage of their app in different states.
|
|
1291
|
+
*/
|
|
1292
|
+
appState: AppState;
|
|
1293
|
+
/**
|
|
1294
|
+
* @deprecated - Use `appState` instead.
|
|
1295
|
+
*
|
|
1279
1296
|
* Indicates if the app is in a hidden state to accelerate future launches.
|
|
1280
1297
|
*/
|
|
1281
1298
|
isCached: boolean;
|
|
1282
1299
|
/**
|
|
1300
|
+
* @deprecated - Use `appState` instead.
|
|
1301
|
+
*
|
|
1283
1302
|
* Indicates if the app is in a preloaded state to accelerate its first launch in the session.
|
|
1284
1303
|
*/
|
|
1285
1304
|
isPrecached: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/conversations.js";export{t as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as p from"./private/copilot/sidePanelInterfaces.js";export{p as sidePanelInterfaces};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/
|
|
1
|
+
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/conversations.js";export{t as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as p from"./private/copilot/sidePanelInterfaces.js";export{p as sidePanelInterfaces};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/plugins.js";export{d as plugins};import*as g from"./private/remoteCamera.js";export{g as remoteCamera};import*as b from"./private/appEntity.js";export{b as appEntity};import*as v from"./private/teams/teams.js";export{v as teams};import*as A from"./private/videoEffectsEx.js";export{A as videoEffectsEx};import*as C from"./private/hostEntity/hostEntity.js";export{C as hostEntity};import*as h from"./private/store.js";export{h as store};import*as S from"./private/widgetHosting/widgetHosting.js";export{S as widgetHosting};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,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{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.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 H from"./public/liveShareHost.js";export{H as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as F from"./public/authentication.js";export{F as authentication};import*as y from"./public/app/app.js";export{y as app};import*as T from"./public/appPerformanceMetrics.js";export{T as appPerformanceMetrics};import*as E from"./public/appInstallDialog.js";export{E as appInstallDialog};import*as w from"./public/barCode.js";export{w as barCode};import*as I from"./public/chat.js";export{I as chat};import*as D from"./public/clipboard.js";export{D as clipboard};import*as P from"./public/dialog/dialog.js";export{P as dialog};import*as B from"./public/nestedAppAuth.js";export{B as nestedAppAuth};import*as k from"./public/geoLocation/geoLocation.js";export{k as geoLocation};import*as L from"./public/pages/pages.js";export{L as pages};import*as M from"./public/menus.js";export{M as menus};import*as U from"./public/media.js";export{U as media};import*as O from"./public/secondaryBrowser.js";export{O as secondaryBrowser};import*as V from"./public/location.js";export{V as location};import*as z from"./public/meeting/meeting.js";export{z as meeting};import*as R from"./public/monetization.js";export{R as monetization};import*as W from"./public/calendar.js";export{W as calendar};import*as N from"./public/mail/mail.js";export{N as mail};import*as q from"./public/teamsAPIs.js";export{q as teamsCore};import*as G from"./public/people.js";export{G as people};import*as J from"./public/profile.js";export{J as profile};import*as K from"./public/videoEffects.js";export{K as videoEffects};import*as Q from"./public/search.js";export{Q as search};import*as X from"./public/sharing/sharing.js";export{X as sharing};import*as Y from"./public/stageView/stageView.js";export{Y as stageView};import*as Z from"./public/visualMedia/visualMedia.js";export{Z as visualMedia};import*as $ from"./public/webStorage.js";export{$ as webStorage};import*as _ from"./public/call.js";export{_ as call};import*as ee from"./public/appInitialization.js";export{ee as appInitialization};import*as re from"./public/thirdPartyCloudStorage.js";export{re as thirdPartyCloudStorage};import*as te from"./public/settings.js";export{te as settings};import*as oe from"./public/tasks.js";export{oe as tasks};import*as pe from"./public/marketplace.js";export{pe as marketplace};import*as ie from"./public/shortcutRelay.js";export{ie as shortcutRelay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as r}from"../public/runtime.js";import{defaultSDKVersionForCompatCheck as e,errorLibraryNotInitialized as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{getLogger as l}from"./telemetry.js";import{isValidPatternUrl as s}from"./urlPattern.js";import{compareSDKVersions as a}from"./utils.js";const f=l("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function m(){if(!o.initializeCalled)throw c(n),new Error(n)}function p(i,...t){if(!o.initializeCompleted)throw d("%s. initializeCalled: %s",n,o.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let r=0;r<t.length;r++)if(t[r]===o.frameContext){i=!0;break}if(!i)
|
|
1
|
+
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as r}from"../public/runtime.js";import{defaultSDKVersionForCompatCheck as e,errorLibraryNotInitialized as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{getLogger as l}from"./telemetry.js";import{isValidPatternUrl as s}from"./urlPattern.js";import{compareSDKVersions as a}from"./utils.js";const f=l("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function m(){if(!o.initializeCalled)throw c(n),new Error(n)}function p(i,...t){if(!o.initializeCompleted)throw d("%s. initializeCalled: %s",n,o.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let r=0;r<t.length;r++)if(t[r]===o.frameContext){i=!0;break}if(!i){const i=`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${o.frameContext}".`;throw d(i),new Error(i)}}return r(i)}function u(i=e){const t=a(o.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return o.hostClientType==i.android||o.hostClientType==i.ios||o.hostClientType==i.ipados||o.hostClientType==i.visionOS}function h(i=e){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=o.additionalValidOrigins.concat(i.filter(i=>"string"==typeof i&&s(i)));const r={};t=t.filter(i=>!r[i]&&(r[i]=!0,!0)),o.additionalValidOrigins=t}export{m as ensureInitializeCalled,p as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as n}from"../internal/communication.js";import{registerHandlerHelper as r}from"../internal/handlers.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as s}from"../public/constants.js";import{runtime as o}from"../public/runtime.js";function u(){return t(o)&&!!o.supports.plugins}function l(r){return e(this,void 0,void 0,function*(){if(t(o),!r.func)throw new Error("func is required in PluginMessage.");return n("plugins.sendMessage",[new c(r)],i("v2","plugins.sendMessage"))})}function p(e){r(i("v2","plugins.receiveMessage"),"plugins.receiveMessage",(...n)=>{e(function(e){if(1===e.length&&function(e){if(!e||"object"!=typeof e)return!1;return"string"==typeof e.func}(e[0]))return e[0];const[n,r,t]=e;return{func:"string"==typeof n?n:String(null!=n?n:""),args:r,correlationId:"string"==typeof t?t:void 0}}(n))},Object.values(s),()=>{if(!u())throw new Error("Receiving plugin messages is not supported in the current host.")})}class c{constructor(e){this.message=e}serialize(){return this.message}}export{u as isSupported,p as registerPluginMessage,l as sendPluginMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../internal/childCommunication.js";import{sendMessageToParent as n}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as s}from"../internal/utils.js";import{FrameContexts as l}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";const m="v1";function p(e,t){r(a),n(o(m,"uploadCustomApp"),"uploadCustomApp",[e],t||s())}function c(e,t,i){r(a),n(o(m,"sendCustomMessage"),e,t,i)}function d(n,i){if(r(a),!e())throw new Error("The child window has not yet been initialized or is not present");t(n,i)}function u(e,t){r(a),i(o(m,"registerCustomHandler"),e,(...e)=>t.apply(this,e))}function f(e,t){r(a),i(o(m,"registerUserSettingsChangeHandler"),"userSettingsChange",t,!0,[e])}function
|
|
1
|
+
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../internal/childCommunication.js";import{sendMessageToParent as n}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as s}from"../internal/utils.js";import{FrameContexts as l}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";const m="v1";function p(e,t){r(a),n(o(m,"uploadCustomApp"),"uploadCustomApp",[e],t||s())}function c(e,t,i){r(a),n(o(m,"sendCustomMessage"),e,t,i)}function d(n,i){if(r(a),!e())throw new Error("The child window has not yet been initialized or is not present");t(n,i)}function u(e,t){r(a),i(o(m,"registerCustomHandler"),e,(...e)=>t.apply(this,e))}function f(e,t){r(a),i(o(m,"registerUserSettingsChangeHandler"),"userSettingsChange",t,!0,[e])}function h(e){r(a,l.content,l.sidePanel,l.task);const t=[e.entityId,e.title,e.description,e.type,e.objectUrl,e.downloadUrl,e.webPreviewUrl,e.webEditUrl,e.baseUrl,e.editFile,e.subEntityId,e.viewerAction,e.fileOpenPreference,e.conversationId,e.sizeInBytes,e.messageId,e.callerInfo,e.atpData,e.shareUrl,e.replyChainId];n(o(m,"openFilePreview"),"openFilePreview",t)}export{h as openFilePreview,u as registerCustomHandler,f as registerUserSettingsChangeHandler,d as sendCustomEvent,c as sendCustomMessage,p as uploadCustomApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,registerOnContextChangeHandlerHelper as s,openLinkHelper as r}from"../../internal/appHelpers.js";import{uninitializeCommunication as l,sendAndUnwrap as m,Communication as d}from"../../internal/communication.js";import{GlobalVars as p}from"../../internal/globalVars.js";import{uninitializeHandlers as c,registerHostToAppPerformanceMetricsHandler as u}from"../../internal/handlers.js";import{ensureInitializeCalled as f}from"../../internal/internalAPIs.js";import{getLogger as h,getApiVersionTag as g}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as y}from"../appId.js";import{HostClientType as S,HostName as T}from"../constants.js";import{version as C}from"../version.js";import*as v from"./lifecycle.js";export{v as lifecycle};import{_clearTelemetryPort as P}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as j}from"../../private/messageChannels/dataLayer.js";const w="v2",O=h("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var b
|
|
1
|
+
import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,registerOnContextChangeHandlerHelper as s,openLinkHelper as r}from"../../internal/appHelpers.js";import{uninitializeCommunication as l,sendAndUnwrap as m,Communication as d}from"../../internal/communication.js";import{GlobalVars as p}from"../../internal/globalVars.js";import{uninitializeHandlers as c,registerHostToAppPerformanceMetricsHandler as u}from"../../internal/handlers.js";import{ensureInitializeCalled as f}from"../../internal/internalAPIs.js";import{getLogger as h,getApiVersionTag as g}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as y}from"../appId.js";import{HostClientType as S,HostName as T}from"../constants.js";import{version as C}from"../version.js";import*as v from"./lifecycle.js";export{v as lifecycle};import{_clearTelemetryPort as P}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as j}from"../../private/messageChannels/dataLayer.js";const w="v2",O=h("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var F,b;function x(){return p.initializeCompleted}function A(){return p.frameContext}function L(i){return e(g(w,"app.initialize"),i)}function z(e){d.currentWindow=e}function D(){p.initializeCalled&&(c(),p.initializeCalled=!1,p.initializeCompleted=!1,p.initializePromise=void 0,p.additionalValidOrigins=[],p.frameContext=void 0,p.hostClientType=void 0,p.isFramelessWindow=!1,P(),j(),l())}function k(){return new Promise(e=>{f(),e(m(g(w,"app.getContext"),"getContext"))}).then(e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,messageId:e.messageId,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:T.teams,clientType:e.hostClientType?e.hostClientType:S.web,features:e.hostFeatures,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId,ancestors:e.hostAncestors},appLaunchId:e.appLaunchId,appId:e.appId?new y(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:p.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e))}function H(){f(),i(g(w,"app.notifyAppLoaded"))}function U(){return t(g(w,"app.notifySuccess"))}function V(e){f(),n(g(w,"app.notifyFailure"),e)}function E(e){f(),a(g(w,"app.notifyExpectedFailure"),e)}function M(e){o(g(w,"app.registerOnThemeChangeHandler"),e)}function W(e){s(g(w,"app.registerOnContextChangeHandler"),e)}function B(e){u(e)}function R(e){return r(g(w,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(F||(F={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),O("teamsjs instance is version %s, starting at %s UTC (%s local)",C,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(I())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?O("teamsjs is being used from %s. %s",i,t):O("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,F as FailedReason,N as Messages,z as _initialize,D as _uninitialize,k as getContext,A as getFrameContext,L as initialize,x as isInitialized,H as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,R as openLink,B as registerHostToAppPerformanceMetricsHandler,W as registerOnContextChangeHandler,M as registerOnThemeChangeHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.
|
|
1
|
+
const o="2.51.0";export{o as version};
|