@microsoft/teams-js 2.35.0 → 2.37.0-beta.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/childCommunication.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/{appIdValidation.d.ts → idValidation.d.ts} +12 -1
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.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/copilot/eligibility.d.ts +6 -4
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForDA.d.ts +75 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppErrorHandling.d.ts +19 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/private/nestedAppAuth/nestedAppAuthBridge.d.ts +32 -0
- package/dist/esm/packages/teams-js/dts/public/appId.d.ts +6 -11
- package/dist/esm/packages/teams-js/dts/public/featureFlags.d.ts +44 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +55 -5
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/public/uuidObject.d.ts +15 -1
- package/dist/esm/packages/teams-js/dts/public/validatedSafeString.d.ts +25 -0
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/globalVars.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/nestedAppAuthUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/private/constants.js +1 -0
- package/dist/esm/packages/teams-js/src/private/copilot/eligibility.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppErrorHandling.js +1 -0
- package/dist/esm/packages/teams-js/src/private/nestedAppAuth/nestedAppAuthBridge.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
- package/dist/esm/packages/teams-js/src/public/featureFlags.js +1 -0
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
- package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
- package/dist/esm/packages/teams-js/src/public/validatedSafeString.js +1 -0
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +789 -56
- 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 -53
- package/dist/esm/packages/teams-js/src/internal/appIdValidation.js +0 -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.36.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.36.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-Vg2zZJuta2CG1wHGm8f5belcapTREs0cxiGzaMgVWI/apjFxwHqOgYOon/OqPXP7"
|
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.36.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
@@ -12,7 +12,7 @@ export declare function uninitializeChildCommunication(): void;
|
|
12
12
|
* Limited to Microsoft-internal use
|
13
13
|
*/
|
14
14
|
export declare function shouldEventBeRelayedToChild(): boolean;
|
15
|
-
type SendMessageToParentHelper = (apiVersionTag: string, func: string, args?: any[], isProxiedFromChild?: boolean) => MessageRequestWithRequiredProperties;
|
15
|
+
type SendMessageToParentHelper = (apiVersionTag: string, func: string, args?: any[], isProxiedFromChild?: boolean, teamsJsInstanceId?: string) => MessageRequestWithRequiredProperties;
|
16
16
|
type SetCallbackForRequest = (uuid: MessageUUID, callback: Function) => void;
|
17
17
|
/**
|
18
18
|
* @hidden
|
@@ -142,7 +142,7 @@ export declare function sendMessageToParent(apiVersionTag: string, actionName: s
|
|
142
142
|
* @internal
|
143
143
|
* Limited to Microsoft-internal use
|
144
144
|
*/
|
145
|
-
export declare function sendNestedAuthRequestToTopWindow(message: string): NestedAppAuthRequest;
|
145
|
+
export declare function sendNestedAuthRequestToTopWindow(message: string, apiVersionTag: string): NestedAppAuthRequest;
|
146
146
|
/**
|
147
147
|
* @internal
|
148
148
|
* Limited to Microsoft-internal use
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AppId } from '../public/appId';
|
2
|
+
import { ValidatedSafeString } from '../public/validatedSafeString';
|
2
3
|
/**
|
3
4
|
* This function can be used to validate if a string is a "valid" app id.
|
4
5
|
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
@@ -10,7 +11,8 @@ import { AppId } from '../public/appId';
|
|
10
11
|
* @param potentialAppId A string to check if it's a "valid" app id
|
11
12
|
* @throws Error with a message describing the exact validation violation
|
12
13
|
*/
|
13
|
-
export declare function
|
14
|
+
export declare function validateStringLength(potentialAppId: string): void;
|
15
|
+
export declare function validateSafeContent(potentialAppId: string): void;
|
14
16
|
export declare const minimumValidAppIdLength = 4;
|
15
17
|
export declare const maximumValidAppIdLength = 256;
|
16
18
|
export declare function isStringWithinAppIdLengthLimits(potentialAppId: string): boolean;
|
@@ -24,3 +26,12 @@ export declare function doesStringContainNonPrintableCharacters(str: string): bo
|
|
24
26
|
* Limited to Microsoft-internal use
|
25
27
|
*/
|
26
28
|
export declare function validateAppIdInstance(potentialAppId: AppId): void;
|
29
|
+
/**
|
30
|
+
* @hidden
|
31
|
+
* Checks if the incoming string is an instance of ValidatedSafeString
|
32
|
+
* @param incomingString An object to check if it's an instance of ValidatedSafeString
|
33
|
+
* @throws Error with a message describing the violation
|
34
|
+
* @internal
|
35
|
+
* Limited to Microsoft-internal use
|
36
|
+
*/
|
37
|
+
export declare function validateSafeStringInstance(incomingString: ValidatedSafeString): void;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import { MessageRequestWithRequiredProperties } from './messageObjects';
|
2
|
+
import { ApiVersionNumber } from './telemetry';
|
3
|
+
export declare const nestedAppAuthTelemetryVersionNumber: ApiVersionNumber;
|
2
4
|
/**
|
3
5
|
* @hidden
|
4
6
|
* Enumeration for nested app authentication message event names.
|
@@ -92,7 +94,7 @@ export interface NestedAuthExtendedWindow extends Window {
|
|
92
94
|
*/
|
93
95
|
type NestedAppAuthBridgeHandlers = {
|
94
96
|
onMessage: (evt: MessageEvent, onMessageReceived: (response: string) => void) => void;
|
95
|
-
sendPostMessage: (message: string) => void;
|
97
|
+
sendPostMessage: (message: string, apiVersionTag: string) => void;
|
96
98
|
};
|
97
99
|
/**
|
98
100
|
* @hidden
|
@@ -109,6 +109,7 @@ export declare const enum ApiName {
|
|
109
109
|
ExternalAppCardActions_ProcessActionSubmit = "externalAppCardActions.processActionSubmit",
|
110
110
|
ExternalAppCardActionsForCEA_ProcessActionOpenUrl = "externalAppCardActionsForCEA.processActionOpenUrl",
|
111
111
|
ExternalAppCardActionsForCEA_ProcessActionSubmit = "externalAppCardActionsForCEA.processActionSubmit",
|
112
|
+
ExternalAppCardActionsForDA_ProcessActionOpenUrlDialog = "externalAppCardActionsForDA.processActionOpenUrlDialog",
|
112
113
|
ExternalAppCommands_ProcessActionCommands = "externalAppCommands.processActionCommand",
|
113
114
|
Files_AddCloudStorageFolder = "files.addCloudStorageFolder",
|
114
115
|
Files_AddCloudStorageProvider = "files.addCloudStorageProvider",
|
@@ -208,6 +209,8 @@ export declare const enum ApiName {
|
|
208
209
|
Navigation_NavigateCrossDomain = "navigation.navigateCrossDomain",
|
209
210
|
Navigation_NavigateToTab = "navigation.navigateToTab",
|
210
211
|
Navigation_ReturnFocus = "navigation.returnFocus",
|
212
|
+
NestedAppAuth_Execute = "nestedAppAuth.execute",
|
213
|
+
NestedAppAuth_ManageNAATrustedOrigins = "nestedAppAuth.manageNAATrustedOrigins",
|
211
214
|
Notifications_ShowNotification = "notifications.showNotification",
|
212
215
|
OtherAppStateChange_Install = "otherApp.install",
|
213
216
|
OtherAppStateChange_UnregisterInstall = "otherApp.unregisterInstall",
|
@@ -18,12 +18,14 @@ import { AppEligibilityInformation } from '../../public/interfaces';
|
|
18
18
|
*/
|
19
19
|
export declare function isSupported(): boolean;
|
20
20
|
/**
|
21
|
+
*
|
22
|
+
* @param forceRefresh - boolean to represent whether to force refresh the eligibility information
|
23
|
+
* @returns the copilot eligibility information about the user
|
24
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
25
|
+
*
|
21
26
|
* @hidden
|
22
27
|
* @internal
|
23
28
|
* Limited to Microsoft-internal use
|
24
29
|
* @beta
|
25
|
-
* @returns the copilot eligibility information about the user
|
26
|
-
*
|
27
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
28
30
|
*/
|
29
|
-
export declare function getEligibilityInfo(): Promise<AppEligibilityInformation>;
|
31
|
+
export declare function getEligibilityInfo(forceRefresh?: boolean): Promise<AppEligibilityInformation>;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/**
|
2
|
+
* @beta
|
3
|
+
* @hidden
|
4
|
+
* Module to delegate adaptive card action for Declarative Agents execution to the host
|
5
|
+
* @internal
|
6
|
+
* Limited to Microsoft-internal use
|
7
|
+
* @module
|
8
|
+
*/
|
9
|
+
import { DialogSize } from '../public';
|
10
|
+
import { AppId } from '../public';
|
11
|
+
import { ISerializable } from '../public/serializable.interface';
|
12
|
+
import { UUID } from '../public/uuidObject';
|
13
|
+
/**
|
14
|
+
* @beta
|
15
|
+
* @hidden
|
16
|
+
* Base interface for Dialog Information.
|
17
|
+
* @internal
|
18
|
+
* Limited to Microsoft-internal use
|
19
|
+
*
|
20
|
+
* @param title The title of the dialog.
|
21
|
+
* @param size The size of the dialog.
|
22
|
+
*/
|
23
|
+
export interface IDialogActionBase {
|
24
|
+
title: string;
|
25
|
+
size: DialogSize;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* @beta
|
29
|
+
* @hidden
|
30
|
+
* Interface to define the Dialog info for Adaptive Card Action.OpenUrlDialog request.
|
31
|
+
* @internal
|
32
|
+
* Limited to Microsoft-internal use
|
33
|
+
*
|
34
|
+
* @param url The URL to open in the dialog.
|
35
|
+
*/
|
36
|
+
export interface IActionOpenUrlDialogInfo extends IDialogActionBase {
|
37
|
+
url: URL;
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* @beta
|
41
|
+
* @hidden
|
42
|
+
* Delegates an Adaptive Card Action.OpenUrlDialog request to the host for the application with the provided app ID
|
43
|
+
* @internal
|
44
|
+
* Limited to Microsoft-internal use
|
45
|
+
* @param appId ID of the application the request is intended for. This must be a UUID
|
46
|
+
* @param actionOpenUrlDialogInfo Information required to open the URL dialog
|
47
|
+
* @param traceId The trace identifier used for monitoring and live site investigations
|
48
|
+
* @returns Promise that resolves when the request is completed and rejects with ExternalAppError if the request fails
|
49
|
+
*/
|
50
|
+
export declare function processActionOpenUrlDialog(appId: AppId, actionOpenUrlDialogInfo: IActionOpenUrlDialogInfo, traceId: UUID): Promise<void>;
|
51
|
+
/**
|
52
|
+
* @beta
|
53
|
+
* @hidden
|
54
|
+
* Checks if the externalAppCardActions capability is supported by the host
|
55
|
+
* @returns boolean to represent whether externalAppCardActions capability is supported
|
56
|
+
*
|
57
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
58
|
+
*
|
59
|
+
* @internal
|
60
|
+
* Limited to Microsoft-internal use
|
61
|
+
*/
|
62
|
+
export declare function isSupported(): boolean;
|
63
|
+
/**
|
64
|
+
* @beta
|
65
|
+
* @hidden
|
66
|
+
* Serializable class for ActionOpenUrlDialogInfo to send info to the host
|
67
|
+
*
|
68
|
+
* @internal
|
69
|
+
* Limited to Microsoft-internal use
|
70
|
+
*/
|
71
|
+
export declare class SerializableActionOpenUrlDialogInfo implements ISerializable {
|
72
|
+
private info;
|
73
|
+
constructor(info: IActionOpenUrlDialogInfo);
|
74
|
+
serialize(): object;
|
75
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ExternalAppErrorCode } from './constants';
|
2
|
+
/**
|
3
|
+
* @hidden
|
4
|
+
* Error object that can be thrown from externalAppCommands, externalAppCardCommands and other external app APIs
|
5
|
+
* @internal
|
6
|
+
* Limited to Microsoft-internal use
|
7
|
+
*/
|
8
|
+
export interface ExternalAppError {
|
9
|
+
errorCode: ExternalAppErrorCode;
|
10
|
+
message?: string;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* @hidden
|
14
|
+
* Determines if the provided error object is an instance of ExternalAppError
|
15
|
+
* @internal
|
16
|
+
* Limited to Microsoft-internal use
|
17
|
+
* @param err The error object to check whether it is of ExternalAppError type
|
18
|
+
*/
|
19
|
+
export declare function isExternalAppError(err: unknown): err is ExternalAppError;
|
@@ -8,10 +8,12 @@ export * as externalAppAuthentication from './externalAppAuthentication';
|
|
8
8
|
export * as externalAppAuthenticationForCEA from './externalAppAuthenticationForCEA';
|
9
9
|
export * as externalAppCardActions from './externalAppCardActions';
|
10
10
|
export * as externalAppCardActionsForCEA from './externalAppCardActionsForCEA';
|
11
|
+
export * as externalAppCardActionsForDA from './externalAppCardActionsForDA';
|
11
12
|
export * as externalAppCommands from './externalAppCommands';
|
12
13
|
export * as files from './files';
|
13
14
|
export * as meetingRoom from './meetingRoom';
|
14
15
|
export * as messageChannels from './messageChannels/messageChannels';
|
16
|
+
export * as nestedAppAuthBridge from './nestedAppAuth/nestedAppAuthBridge';
|
15
17
|
export * as notifications from './notifications';
|
16
18
|
export * as otherAppStateChange from './otherAppStateChange';
|
17
19
|
export * as remoteCamera from './remoteCamera';
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* @beta
|
3
|
+
* @hidden
|
4
|
+
* Local version of the Nested App Auth Bridge module.
|
5
|
+
*
|
6
|
+
* This version is specific to this standalone module and is not tied to the overall TeamsJS SDK version.
|
7
|
+
* It allows developers to track changes within this module and handle version-based compatibility if needed.
|
8
|
+
*
|
9
|
+
* While not strictly required today, having a version provides flexibility for future updates,
|
10
|
+
* especially if breaking changes are introduced later.
|
11
|
+
*
|
12
|
+
* Example:
|
13
|
+
* if (nestedAppAuthBridge.version.startsWith('1.')) {
|
14
|
+
* // Safe to use with current logic
|
15
|
+
* }
|
16
|
+
*
|
17
|
+
* @internal
|
18
|
+
* Limited to Microsoft-internal use
|
19
|
+
*/
|
20
|
+
export declare const version = "1.0.0";
|
21
|
+
/**
|
22
|
+
* @beta
|
23
|
+
* @hidden
|
24
|
+
* Initializes the Nested App Auth Bridge.
|
25
|
+
* @param window The window object where the bridge will be attached.
|
26
|
+
* @param topOrigin The origin of the top-level frame.
|
27
|
+
* @param enableLogging - Optional flag to enable internal debug and error logging. Defaults to false.
|
28
|
+
*
|
29
|
+
* @internal
|
30
|
+
* Limited to Microsoft-internal use
|
31
|
+
*/
|
32
|
+
export declare function initialize(window: Window | null, topOrigin: string, enableLogging?: boolean): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ValidatedSafeString } from './validatedSafeString';
|
2
2
|
/**
|
3
3
|
* A strongly-typed class used to represent a "valid" app id.
|
4
4
|
*
|
@@ -10,8 +10,7 @@ import { ISerializable } from './serializable.interface';
|
|
10
10
|
* for script tags, length, and non-printable characters. Validation will be updated in the future to ensure
|
11
11
|
* the app id is a valid UUID as legacy apps update.
|
12
12
|
*/
|
13
|
-
export declare class AppId
|
14
|
-
private readonly appIdAsString;
|
13
|
+
export declare class AppId extends ValidatedSafeString {
|
15
14
|
/**
|
16
15
|
* Creates a strongly-typed AppId from a string
|
17
16
|
*
|
@@ -20,14 +19,10 @@ export declare class AppId implements ISerializable {
|
|
20
19
|
*/
|
21
20
|
constructor(appIdAsString: string);
|
22
21
|
/**
|
23
|
-
*
|
24
|
-
* @
|
22
|
+
* Returns a JSON representation of the AppId object
|
23
|
+
* @returns A JSON representation of the AppId object
|
25
24
|
*
|
26
|
-
*
|
25
|
+
* note: this method maintains backward compatibility for JSON serialization
|
27
26
|
*/
|
28
|
-
|
29
|
-
/**
|
30
|
-
* Returns the app id as a string
|
31
|
-
*/
|
32
|
-
toString(): string;
|
27
|
+
toJSON(): object;
|
33
28
|
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/**
|
2
|
+
* This function enables child proxying communication for apps that still needs it.
|
3
|
+
*
|
4
|
+
* @deprecated Child proxying is considered an insecure feature and will be removed in future releases.
|
5
|
+
*/
|
6
|
+
export declare function activateChildProxyingCommunication(): void;
|
7
|
+
/**
|
8
|
+
* @hidden
|
9
|
+
* @internal
|
10
|
+
* Limited to Microsoft-internal use.
|
11
|
+
*/
|
12
|
+
export declare function isChildProxyingEnabled(): boolean;
|
13
|
+
/**
|
14
|
+
* @hidden
|
15
|
+
* @internal
|
16
|
+
* Limited to Microsoft-internal use.
|
17
|
+
*/
|
18
|
+
export declare function resetBuildFeatureFlags(): void;
|
19
|
+
/**
|
20
|
+
* Feature flags to activate or deactivate certain features at runtime for an app.
|
21
|
+
*/
|
22
|
+
export interface RuntimeFeatureFlags {
|
23
|
+
/**
|
24
|
+
* Disables origin validation for responses to child windows. When enabled, this flag bypasses security checks that verify the origin of child window that receives the response.
|
25
|
+
*
|
26
|
+
* Default: false
|
27
|
+
*/
|
28
|
+
disableEnforceOriginMatchForChildResponses: boolean;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* @returns The current state of the runtime feature flags.
|
32
|
+
*/
|
33
|
+
export declare function getCurrentFeatureFlagsState(): RuntimeFeatureFlags;
|
34
|
+
/**
|
35
|
+
* It sets the runtime feature flags to the new feature flags provided.
|
36
|
+
* @param featureFlags The new feature flags to set.
|
37
|
+
*/
|
38
|
+
export declare function setFeatureFlagsState(featureFlags: RuntimeFeatureFlags): void;
|
39
|
+
/**
|
40
|
+
* It overwrites all the feature flags in the runtime feature flags object with the new feature flags provided.
|
41
|
+
* @param newFeatureFlags The new feature flags to set.
|
42
|
+
* @returns The current state of the runtime feature flags.
|
43
|
+
*/
|
44
|
+
export declare function overwriteFeatureFlagsState(newFeatureFlags: Partial<RuntimeFeatureFlags>): RuntimeFeatureFlags;
|
@@ -10,6 +10,7 @@ export * as chat from './chat';
|
|
10
10
|
export { OpenGroupChatRequest, OpenSingleChatRequest } from './chat';
|
11
11
|
export * as clipboard from './clipboard';
|
12
12
|
export * as dialog from './dialog/dialog';
|
13
|
+
export { activateChildProxyingCommunication, getCurrentFeatureFlagsState, overwriteFeatureFlagsState, RuntimeFeatureFlags, setFeatureFlagsState, } from './featureFlags';
|
13
14
|
export * as nestedAppAuth from './nestedAppAuth';
|
14
15
|
export * as geoLocation from './geoLocation/geoLocation';
|
15
16
|
export { getAdaptiveCardSchemaVersion } from './adaptiveCards';
|
@@ -30,6 +31,7 @@ export * as videoEffects from './videoEffects';
|
|
30
31
|
export * as search from './search';
|
31
32
|
export * as sharing from './sharing/sharing';
|
32
33
|
export * as stageView from './stageView/stageView';
|
34
|
+
export { ValidatedSafeString } from './validatedSafeString';
|
33
35
|
export { version } from './version';
|
34
36
|
export * as visualMedia from './visualMedia/visualMedia';
|
35
37
|
export * as webStorage from './webStorage';
|
@@ -1,14 +1,64 @@
|
|
1
1
|
/**
|
2
|
+
* Checks if MSAL-NAA channel recommended by the host
|
3
|
+
* @returns true if host is recommending NAA channel and false otherwise
|
4
|
+
*
|
5
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
export declare function isNAAChannelRecommended(): boolean;
|
9
|
+
/**
|
10
|
+
* Gets the origin of the parent window if available.
|
11
|
+
* This will be the top-level origin in the case of a parent app.
|
12
|
+
* It is used to pass to the embedded child app to initialize the Nested App Auth bridge.
|
13
|
+
|
14
|
+
* @returns The origin string if available, otherwise null
|
15
|
+
*
|
16
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
17
|
+
*
|
2
18
|
* @beta
|
3
|
-
* Nested app auth capabilities
|
4
|
-
* @module
|
5
19
|
*/
|
20
|
+
export declare function getParentOrigin(): string | null;
|
6
21
|
/**
|
7
|
-
* Checks if
|
8
|
-
*
|
22
|
+
* Checks if the parent has the capability to manage its list of trusted child origins
|
23
|
+
* for Nested App Auth (NAA).
|
24
|
+
*
|
25
|
+
* @returns true if parent can manage NAA TrustedOrigins, false otherwise
|
9
26
|
*
|
10
27
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
11
28
|
*
|
12
29
|
* @beta
|
13
30
|
*/
|
14
|
-
export declare function
|
31
|
+
export declare function canParentManageNAATrustedOrigins(): boolean;
|
32
|
+
/**
|
33
|
+
* Checks if NAA deeply nested scenario supported by the host
|
34
|
+
* @returns true if host supports
|
35
|
+
*
|
36
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
37
|
+
*
|
38
|
+
* @beta
|
39
|
+
*/
|
40
|
+
export declare function isDeeplyNestedAuthSupported(): boolean;
|
41
|
+
/**
|
42
|
+
* Registers the origins of child apps as trusted for Nested App Auth (NAA).
|
43
|
+
*
|
44
|
+
* This allows a top-level parent app to specify which child app origins are considered trusted
|
45
|
+
*
|
46
|
+
* @param appOrigins - An array of child app origins to trust (must be a non-empty array).
|
47
|
+
* @returns A Promise resolving with the result of the action.
|
48
|
+
* @throws Error if called from a non-top-level parent or if parameters are invalid.
|
49
|
+
*
|
50
|
+
* @beta
|
51
|
+
*/
|
52
|
+
export declare function addNAATrustedOrigins(appOrigins: string[]): Promise<string>;
|
53
|
+
/**
|
54
|
+
* Removes previously trusted child app origins from Nested App Auth (NAA).
|
55
|
+
*
|
56
|
+
* The specified origins will no longer be considered trusted.
|
57
|
+
*
|
58
|
+
* @param appOrigins - An array of child app origins to remove from the trusted list (must be a non-empty array).
|
59
|
+
* @returns A Promise resolving with the result of the action.
|
60
|
+
* @throws Error if called from a non-top-level parent or if parameters are invalid.
|
61
|
+
*
|
62
|
+
* @beta
|
63
|
+
*/
|
64
|
+
export declare function deleteNAATrustedOrigins(appOrigins: string[]): Promise<string>;
|
@@ -15,6 +15,8 @@ interface IRuntimeV4 extends IBaseRuntime {
|
|
15
15
|
readonly apiVersion: 4;
|
16
16
|
readonly hostVersionsInfo?: HostVersionsInfo;
|
17
17
|
readonly isNAAChannelRecommended?: boolean;
|
18
|
+
readonly canParentManageNAATrustedOrigins?: boolean;
|
19
|
+
readonly isDeeplyNestedAuthSupported?: boolean;
|
18
20
|
readonly isLegacyTeams?: boolean;
|
19
21
|
readonly supports: {
|
20
22
|
readonly app?: {
|
@@ -46,6 +48,7 @@ interface IRuntimeV4 extends IBaseRuntime {
|
|
46
48
|
readonly externalAppAuthenticationForCEA?: {};
|
47
49
|
readonly externalAppCardActions?: {};
|
48
50
|
readonly externalAppCardActionsForCEA?: {};
|
51
|
+
readonly externalAppCardActionsForDA?: {};
|
49
52
|
readonly externalAppCommands?: {};
|
50
53
|
readonly geoLocation?: {
|
51
54
|
readonly map?: {};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ISerializable } from './serializable.interface';
|
1
2
|
/**
|
2
3
|
* @internal
|
3
4
|
* Limited to Microsoft-internal use
|
@@ -5,7 +6,7 @@
|
|
5
6
|
* Represents a UUID (Universally Unique Identifier) object.
|
6
7
|
* This class provides a way to generate, validate, and represent UUIDs as strings.
|
7
8
|
*/
|
8
|
-
export declare class UUID {
|
9
|
+
export declare class UUID implements ISerializable {
|
9
10
|
private readonly uuid;
|
10
11
|
/**
|
11
12
|
* Creates an instance of the UUID class.
|
@@ -21,4 +22,17 @@ export declare class UUID {
|
|
21
22
|
* @returns {string} - The UUID string.
|
22
23
|
*/
|
23
24
|
toString(): string;
|
25
|
+
/**
|
26
|
+
* @returns A serializable representation of an uuid, used for passing uuids to the host.
|
27
|
+
*/
|
28
|
+
serialize(): object | string;
|
24
29
|
}
|
30
|
+
/**
|
31
|
+
* @hidden
|
32
|
+
* Checks if the incoming id is an instance of ValidatedSafeString
|
33
|
+
* @param id An object to check if it's an instance of ValidatedSafeString
|
34
|
+
* @throws Error with a message describing the violation
|
35
|
+
* @internal
|
36
|
+
* Limited to Microsoft-internal use
|
37
|
+
*/
|
38
|
+
export declare function validateUuidInstance(id: UUID): void;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ISerializable } from './serializable.interface';
|
2
|
+
/**
|
3
|
+
* A strongly typed class used to represent a "valid" string id.
|
4
|
+
*/
|
5
|
+
export declare class ValidatedSafeString implements ISerializable {
|
6
|
+
private readonly idAsString;
|
7
|
+
/**
|
8
|
+
* Creates a strongly-typed Id from a string
|
9
|
+
*
|
10
|
+
* @param idAsString An id represented as a string
|
11
|
+
* @throws Error with a message describing the exact validation violation
|
12
|
+
*/
|
13
|
+
constructor(idAsString: string);
|
14
|
+
/**
|
15
|
+
* @hidden
|
16
|
+
* @internal
|
17
|
+
*
|
18
|
+
* @returns A serializable representation of an AppId, used for passing AppIds to the host.
|
19
|
+
*/
|
20
|
+
serialize(): object | string;
|
21
|
+
/**
|
22
|
+
* Returns the app id as a string
|
23
|
+
*/
|
24
|
+
toString(): string;
|
25
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as
|
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/logs.js";export{e as logs};import*as r from"./private/conversations.js";export{r as conversations};import*as t from"./private/copilot/copilot.js";export{t as copilot};import*as o from"./private/externalAppAuthentication.js";export{o 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 a from"./private/externalAppCardActionsForCEA.js";export{a as externalAppCardActionsForCEA};import*as s from"./private/externalAppCardActionsForDA.js";export{s as externalAppCardActionsForDA};import*as m from"./private/externalAppCommands.js";export{m as externalAppCommands};import*as n from"./private/files.js";export{n as files};import*as l from"./private/meetingRoom.js";export{l as meetingRoom};import*as c from"./private/messageChannels/messageChannels.js";export{c as messageChannels};import*as f from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{f as nestedAppAuthBridge};import*as u from"./private/notifications.js";export{u as notifications};import*as x from"./private/otherAppStateChange.js";export{x as otherAppStateChange};import*as j from"./private/remoteCamera.js";export{j as remoteCamera};import*as d from"./private/appEntity.js";export{d as appEntity};import*as g from"./private/teams/teams.js";export{g as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as v from"./private/hostEntity/hostEntity.js";export{v as hostEntity};import*as C from"./private/store.js";export{C 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{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 A from"./public/liveShareHost.js";export{A as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as h from"./public/authentication.js";export{h as authentication};import*as S from"./public/app/app.js";export{S as app};import*as H from"./public/appInstallDialog.js";export{H as appInstallDialog};import*as F from"./public/barCode.js";export{F as barCode};import*as y from"./public/chat.js";export{y as chat};import*as T from"./public/clipboard.js";export{T as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as w from"./public/pages/pages.js";export{w as pages};import*as B from"./public/menus.js";export{B as menus};import*as P from"./public/media.js";export{P as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as L from"./public/location.js";export{L as location};import*as M from"./public/meeting/meeting.js";export{M as meeting};import*as U from"./public/monetization.js";export{U as monetization};import*as O from"./public/calendar.js";export{O as calendar};import*as V from"./public/mail/mail.js";export{V as mail};import*as z from"./public/teamsAPIs.js";export{z as teamsCore};import*as W from"./public/people.js";export{W as people};import*as N from"./public/profile.js";export{N as profile};import*as R from"./public/videoEffects.js";export{R as videoEffects};import*as q from"./public/search.js";export{q as search};import*as G from"./public/sharing/sharing.js";export{G as sharing};import*as J from"./public/stageView/stageView.js";export{J as stageView};import*as K from"./public/visualMedia/visualMedia.js";export{K as visualMedia};import*as Q from"./public/webStorage.js";export{Q as webStorage};import*as X from"./public/call.js";export{X as call};import*as Y from"./public/appInitialization.js";export{Y as appInitialization};import*as Z from"./public/thirdPartyCloudStorage.js";export{Z as thirdPartyCloudStorage};import*as $ from"./public/settings.js";export{$ as settings};import*as _ from"./public/tasks.js";export{_ as tasks};import*as ee from"./public/marketplace.js";export{ee as marketplace};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as n}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{
|
1
|
+
import{__awaiter as n}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{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,(function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,((...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)}))}(d,i,s)}(i,a,c))}))}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
|