@microsoft/teams-js 2.27.0-beta.0 → 2.28.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/MicrosoftTeams.d.ts +279 -6
- package/dist/MicrosoftTeams.js +433 -31
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +36 -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.28.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.28.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-gT2igbByugSUPXBgDA+rtfKk4JMSCfG+3DKSivyLqF2Riv4vTLqaC/tFpySw0eIM"
|
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.28.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
package/dist/MicrosoftTeams.d.ts
CHANGED
@@ -2996,6 +2996,182 @@ export namespace videoEffectsEx {
|
|
2996
2996
|
function notifyFatalError(errorMessage: string): void;
|
2997
2997
|
}
|
2998
2998
|
|
2999
|
+
/**
|
3000
|
+
* @hidden
|
3001
|
+
* @internal
|
3002
|
+
* @beta
|
3003
|
+
* Limited to Microsoft-internal use
|
3004
|
+
*
|
3005
|
+
* This capability allows an app to associate apps with a host entity, such as a Teams channel or chat, and configure them as needed.
|
3006
|
+
*/
|
3007
|
+
export namespace hostEntity {
|
3008
|
+
export enum AppTypes {
|
3009
|
+
edu = "EDU"
|
3010
|
+
}
|
3011
|
+
/**
|
3012
|
+
* Id of the teams entity like channel, chat
|
3013
|
+
*/
|
3014
|
+
interface TeamsEntityId {
|
3015
|
+
threadId: string;
|
3016
|
+
}
|
3017
|
+
/**
|
3018
|
+
* Id of message in which channel meeting is created
|
3019
|
+
*/
|
3020
|
+
export interface TeamsChannelMeetingEntityIds extends TeamsEntityId {
|
3021
|
+
parentMessageId: string;
|
3022
|
+
}
|
3023
|
+
/**
|
3024
|
+
* Id of the host entity
|
3025
|
+
*/
|
3026
|
+
export type HostEntityIds = TeamsEntityId | TeamsChannelMeetingEntityIds;
|
3027
|
+
/**
|
3028
|
+
* @hidden
|
3029
|
+
* @internal
|
3030
|
+
* @beta
|
3031
|
+
* Limited to Microsoft-internal use
|
3032
|
+
*
|
3033
|
+
* CRUD operations for tabs associated with apps
|
3034
|
+
*/
|
3035
|
+
export namespace tab {
|
3036
|
+
/**
|
3037
|
+
* Represents information about a static tab instance
|
3038
|
+
*/
|
3039
|
+
interface StaticTabInstance extends TabInstance {
|
3040
|
+
tabType: 'StaticTab';
|
3041
|
+
}
|
3042
|
+
/**
|
3043
|
+
* Represents information about a configurable tab instance
|
3044
|
+
*/
|
3045
|
+
interface ConfigurableTabInstance extends TabInstance {
|
3046
|
+
tabType: 'ConfigurableTab';
|
3047
|
+
}
|
3048
|
+
/**
|
3049
|
+
* Represents information about a tab instance associated with a host entity like chat, channel or meeting. Cab be a configurable tab or static tab.
|
3050
|
+
*/
|
3051
|
+
type HostEntityTabInstance = StaticTabInstance | ConfigurableTabInstance;
|
3052
|
+
/**
|
3053
|
+
* Represents all tabs associated with a host entity like chat, channel or meeting
|
3054
|
+
*/
|
3055
|
+
interface HostEntityTabInstances {
|
3056
|
+
allTabs: HostEntityTabInstance[];
|
3057
|
+
}
|
3058
|
+
/**
|
3059
|
+
* @hidden
|
3060
|
+
* @internal
|
3061
|
+
* @beta
|
3062
|
+
* Limited to Microsoft-internal use
|
3063
|
+
*
|
3064
|
+
* Launches host-owned UI that lets a user select an app, installs it if required,
|
3065
|
+
* runs through app configuration if required, and then associates the app with the threadId provided
|
3066
|
+
*
|
3067
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
3068
|
+
*
|
3069
|
+
* @param appTypes What type of applications to show the user. If EDU is passed as appType, only apps supported by EDU tenant are shown.
|
3070
|
+
* If no value is passed, all apps are shown.
|
3071
|
+
*
|
3072
|
+
* @returns The HostEntityTabInstance of the newly associated app
|
3073
|
+
*
|
3074
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or installing
|
3075
|
+
* or configuring or adding tab fails
|
3076
|
+
*/
|
3077
|
+
function addAndConfigure(hostEntityIds: HostEntityIds, appTypes?: AppTypes[]): Promise<HostEntityTabInstance>;
|
3078
|
+
/**
|
3079
|
+
* @hidden
|
3080
|
+
* @internal
|
3081
|
+
* @beta
|
3082
|
+
* Limited to Microsoft-internal use
|
3083
|
+
*
|
3084
|
+
* Returns all tab instances associated with a host entity
|
3085
|
+
*
|
3086
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
3087
|
+
*
|
3088
|
+
* @returns Object with array of HostEntityTabInstance's associated with a host entity
|
3089
|
+
*
|
3090
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid or fetching tabs fails
|
3091
|
+
*/
|
3092
|
+
function getAll(hostEntityIds: HostEntityIds): Promise<HostEntityTabInstances>;
|
3093
|
+
/**
|
3094
|
+
* @hidden
|
3095
|
+
* @internal
|
3096
|
+
* @beta
|
3097
|
+
* Limited to Microsoft-internal use
|
3098
|
+
*
|
3099
|
+
* Launches host-owned UI that lets a user re-configure the contentUrl of the tab
|
3100
|
+
*
|
3101
|
+
* @param tab Configurable tab instance that needs to be updated
|
3102
|
+
*
|
3103
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
3104
|
+
*
|
3105
|
+
* @returns The HostEntityTabInstance of the updated tab
|
3106
|
+
*
|
3107
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,
|
3108
|
+
* re-configuring tab fails or if tab is a static tab
|
3109
|
+
*/
|
3110
|
+
function reconfigure(tab: ConfigurableTabInstance, hostEntityIds: HostEntityIds): Promise<ConfigurableTabInstance>;
|
3111
|
+
/**
|
3112
|
+
* @hidden
|
3113
|
+
* @internal
|
3114
|
+
* @beta
|
3115
|
+
* Limited to Microsoft-internal use
|
3116
|
+
*
|
3117
|
+
* Launches host-owned UI that lets a user rename the tab
|
3118
|
+
*
|
3119
|
+
* @param tab Configurable tab instance that needs to be updated
|
3120
|
+
*
|
3121
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
3122
|
+
*
|
3123
|
+
* @returns The HostEntityTabInstance of the updated tab
|
3124
|
+
*
|
3125
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,
|
3126
|
+
* re-naming tab fails or if tab is a static tab
|
3127
|
+
*/
|
3128
|
+
function rename(tab: ConfigurableTabInstance, hostEntityIds: HostEntityIds): Promise<ConfigurableTabInstance>;
|
3129
|
+
/**
|
3130
|
+
* @hidden
|
3131
|
+
* @internal
|
3132
|
+
* @beta
|
3133
|
+
* Limited to Microsoft-internal use
|
3134
|
+
*
|
3135
|
+
* Launches host-owned UI that lets a user remove the tab
|
3136
|
+
*
|
3137
|
+
* @param tab tab instance that needs to be updated. Can be static tab or configurable tab.
|
3138
|
+
*
|
3139
|
+
* @param hostEntityIds Ids of the host entity like channel, chat or meeting
|
3140
|
+
*
|
3141
|
+
* @returns Boolean. Returns true if removing tab was successful
|
3142
|
+
*
|
3143
|
+
* @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or
|
3144
|
+
* removing tab fails
|
3145
|
+
*/
|
3146
|
+
function remove(tab: HostEntityTabInstance, hostEntityIds: HostEntityIds): Promise<boolean>;
|
3147
|
+
/**
|
3148
|
+
* @hidden
|
3149
|
+
* @internal
|
3150
|
+
* @beta
|
3151
|
+
* Limited to Microsoft-internal use
|
3152
|
+
*
|
3153
|
+
* Checks if the hostEntity.tab capability is supported by the host
|
3154
|
+
* @returns boolean to represent whether the histEntity and hostEntity.tab capability is supported
|
3155
|
+
*
|
3156
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
3157
|
+
*/
|
3158
|
+
function isSupported(): boolean;
|
3159
|
+
}
|
3160
|
+
/**
|
3161
|
+
* @hidden
|
3162
|
+
* @internal
|
3163
|
+
* @beta
|
3164
|
+
* Limited to Microsoft-internal use
|
3165
|
+
*
|
3166
|
+
* Checks if the hostEntity capability is supported by the host
|
3167
|
+
* @returns boolean to represent whether the hostEntity capability is supported
|
3168
|
+
*
|
3169
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
3170
|
+
*/
|
3171
|
+
export function isSupported(): boolean;
|
3172
|
+
export {};
|
3173
|
+
}
|
3174
|
+
|
2999
3175
|
export namespace authentication {
|
3000
3176
|
/**
|
3001
3177
|
* @hidden
|
@@ -3652,6 +3828,14 @@ export interface TabInstance {
|
|
3652
3828
|
* Website URL of this tab
|
3653
3829
|
*/
|
3654
3830
|
websiteUrl?: string;
|
3831
|
+
/**
|
3832
|
+
* AppId of this tab
|
3833
|
+
*/
|
3834
|
+
appId?: string;
|
3835
|
+
/**
|
3836
|
+
* Order of this tab. Order is 1-indexed.
|
3837
|
+
*/
|
3838
|
+
order?: number;
|
3655
3839
|
}
|
3656
3840
|
/**
|
3657
3841
|
* Indicates information about the tab instance for filtering purposes.
|
@@ -4582,7 +4766,7 @@ export interface AppEligibilityInformation {
|
|
4582
4766
|
/**
|
4583
4767
|
* Education Eligibility Information for the app user
|
4584
4768
|
*/
|
4585
|
-
userClassification: UserClassification;
|
4769
|
+
userClassification: UserClassification | null;
|
4586
4770
|
}
|
4587
4771
|
/**
|
4588
4772
|
* @hidden
|
@@ -5311,6 +5495,30 @@ export namespace app {
|
|
5311
5495
|
}
|
5312
5496
|
}
|
5313
5497
|
|
5498
|
+
/**
|
5499
|
+
* A strongly-typed class used to represent a "valid" app id.
|
5500
|
+
*
|
5501
|
+
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
5502
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
5503
|
+
* However, there are some older internal/hard-coded apps which violate this schema and use names like
|
5504
|
+
* com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot
|
5505
|
+
* securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking
|
5506
|
+
* for script tags, length, and non-printable characters.
|
5507
|
+
*/
|
5508
|
+
export class AppId {
|
5509
|
+
/**
|
5510
|
+
* Creates a strongly-typed AppId from a string
|
5511
|
+
*
|
5512
|
+
* @param appIdAsString An app id represented as a string
|
5513
|
+
* @throws Error with a message describing the exact validation violation
|
5514
|
+
*/
|
5515
|
+
constructor(appIdAsString: string);
|
5516
|
+
/**
|
5517
|
+
* Returns the app id as a string
|
5518
|
+
*/
|
5519
|
+
toString(): string;
|
5520
|
+
}
|
5521
|
+
|
5314
5522
|
export namespace appInstallDialog {
|
5315
5523
|
/** Represents set of parameters needed to open the appInstallDialog. */
|
5316
5524
|
interface OpenAppInstallDialogParams {
|
@@ -5904,6 +6112,9 @@ export function getAdaptiveCardSchemaVersion(): AdaptiveCardVersion | undefined;
|
|
5904
6112
|
export function navigateCrossDomainHelper(apiVersionTag: string, url: string): Promise<void>;
|
5905
6113
|
export function backStackNavigateBackHelper(apiVersionTag: string): Promise<void>;
|
5906
6114
|
export function tabsNavigateToTabHelper(apiVersionTag: string, tabInstance: TabInstance): Promise<void>;
|
6115
|
+
/**
|
6116
|
+
* @hidden
|
6117
|
+
*/
|
5907
6118
|
export function returnFocusHelper(apiVersionTag: string, navigateForward?: boolean): void;
|
5908
6119
|
export function getTabInstancesHelper(apiVersionTag: string, tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
|
5909
6120
|
export function getMruTabInstancesHelper(apiVersionTag: string, tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
|
@@ -5927,6 +6138,51 @@ export namespace pages {
|
|
5927
6138
|
/** Remove event function */
|
5928
6139
|
type removeEventType = (evt: pages.config.RemoveEvent) => void;
|
5929
6140
|
/**
|
6141
|
+
* @hidden
|
6142
|
+
* List of enter focus action items
|
6143
|
+
*
|
6144
|
+
* @internal
|
6145
|
+
* Limited to Microsoft-internal use
|
6146
|
+
*/
|
6147
|
+
enum EnterFocusType {
|
6148
|
+
/**
|
6149
|
+
* Determines the previous direction to focus in app when hot keys entered.
|
6150
|
+
*/
|
6151
|
+
PreviousLandmark = 0,
|
6152
|
+
/**
|
6153
|
+
* Determines the next direction to focus in app when hot keys entered.
|
6154
|
+
*/
|
6155
|
+
NextLandmark = 1,
|
6156
|
+
/**
|
6157
|
+
* Determines if the focus should go to the particular content of the app.
|
6158
|
+
* Read - Focus should go to the content of the app.
|
6159
|
+
*/
|
6160
|
+
Read = 2,
|
6161
|
+
/**
|
6162
|
+
* Determines if the focus should go to the particular content of the app.
|
6163
|
+
* Compose - Focus should go to the compose area (such as textbox) of the app.
|
6164
|
+
*/
|
6165
|
+
Compose = 3
|
6166
|
+
}
|
6167
|
+
/**
|
6168
|
+
* Return focus action items
|
6169
|
+
*/
|
6170
|
+
enum ReturnFocusType {
|
6171
|
+
/**
|
6172
|
+
* Determines the direction to focus in host for previous landmark.
|
6173
|
+
*/
|
6174
|
+
PreviousLandmark = 0,
|
6175
|
+
/**
|
6176
|
+
* Determines the direction to focus in host for next landmark.
|
6177
|
+
*/
|
6178
|
+
NextLandmark = 1,
|
6179
|
+
/**
|
6180
|
+
* Determines if the focus should go to the host's activity feed
|
6181
|
+
*/
|
6182
|
+
GoToActivityFeed = 2
|
6183
|
+
}
|
6184
|
+
/**
|
6185
|
+
* @deprecated
|
5930
6186
|
* Return focus to the host. Will move focus forward or backward based on where the application container falls in
|
5931
6187
|
* the F6/tab order in the host.
|
5932
6188
|
* On mobile hosts or hosts where there is no keyboard interaction or UI notion of "focus" this function has no
|
@@ -5934,6 +6190,14 @@ export namespace pages {
|
|
5934
6190
|
* @param navigateForward - Determines the direction to focus in host.
|
5935
6191
|
*/
|
5936
6192
|
function returnFocus(navigateForward?: boolean): void;
|
6193
|
+
/**
|
6194
|
+
* Return focus to the host. Will attempt to send focus to the appropriate part of the host (as specified by returnFocusType) based on where the application container falls in
|
6195
|
+
* the F6/tab order in the host.
|
6196
|
+
* On mobile hosts or hosts where there is no keyboard interaction or UI notion of "focus" this function has no
|
6197
|
+
* effect and will be a no-op when called.
|
6198
|
+
* @param returnFocusType - Determines the type of focus to return to in the host.
|
6199
|
+
*/
|
6200
|
+
function returnFocus(returnFocusType: pages.ReturnFocusType): void;
|
5937
6201
|
/**
|
5938
6202
|
* @hidden
|
5939
6203
|
*
|
@@ -5946,7 +6210,7 @@ export namespace pages {
|
|
5946
6210
|
* @internal
|
5947
6211
|
* Limited to Microsoft-internal use
|
5948
6212
|
*/
|
5949
|
-
function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void;
|
6213
|
+
function registerFocusEnterHandler(handler: (navigateForward: boolean, enterFocusType?: EnterFocusType) => void): void;
|
5950
6214
|
/**
|
5951
6215
|
* Sets/Updates the current frame with new information
|
5952
6216
|
*
|
@@ -8932,9 +9196,9 @@ export namespace sharing {
|
|
8932
9196
|
title: string;
|
8933
9197
|
/** Reference of the shared content */
|
8934
9198
|
contentReference: string;
|
8935
|
-
/** Id of the thread where the content was shared.
|
9199
|
+
/** Id of the thread where the content was shared. */
|
8936
9200
|
threadId: string;
|
8937
|
-
/** Id of the user who shared the content.
|
9201
|
+
/** Id of the user who shared the content. */
|
8938
9202
|
author: string;
|
8939
9203
|
/** Type of the shared content.
|
8940
9204
|
* For sharing to Teams stage scenarios, this value would be `ShareToStage`
|
@@ -8987,6 +9251,10 @@ export namespace stageView {
|
|
8987
9251
|
* The chat or channel ID.
|
8988
9252
|
*/
|
8989
9253
|
threadId: string;
|
9254
|
+
/**
|
9255
|
+
* The messageId identifies a particular channel meeting within the channel as specified by the threadId above. This should be used only when trying to open the stage view for a channel meeting. It will be a no-op for other scenarios
|
9256
|
+
*/
|
9257
|
+
messageId?: string;
|
8990
9258
|
/**
|
8991
9259
|
* The title to give the stage view.
|
8992
9260
|
*/
|
@@ -9500,13 +9768,18 @@ export namespace thirdPartyCloudStorage {
|
|
9500
9768
|
* @beta
|
9501
9769
|
*/
|
9502
9770
|
interface DragAndDropFileCallback {
|
9503
|
-
/**
|
9771
|
+
/**
|
9772
|
+
* Definition of the callback which is received from third party app when calling {@link thirdPartyCloudStorage.getDragAndDropFiles}
|
9773
|
+
* An array of drag and dropped files {@link thirdPartyCloudStorage.FilesFor3PStorage}
|
9774
|
+
* Error encountered during the API call {@link SdkError}
|
9775
|
+
*/
|
9504
9776
|
(files: FilesFor3PStorage[], error?: SdkError): void;
|
9505
9777
|
}
|
9506
9778
|
/**
|
9507
9779
|
* Get drag-and-drop files using a callback.
|
9508
9780
|
*
|
9509
|
-
* @param {string} dragAndDropInput -
|
9781
|
+
* @param {string} dragAndDropInput - unique id which is a combination of replyToId + threadId of teams chat and channel.
|
9782
|
+
* Both replyToId and threadId can be fetched from application context.
|
9510
9783
|
* @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
|
9511
9784
|
* A callback function to handle the result of the operation
|
9512
9785
|
* @beta
|