@microsoft/teams-js 2.0.0-beta.6 → 2.0.0-beta.6-dev.22
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 +164 -13
- package/dist/MicrosoftTeams.js +100 -13
- 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 +1 -32
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the latest [2.0 preview version](https://docs.microsoft.com/en-us/jav
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can access [these files on unpkg](https://res.cdn.office.net/teams-js/2.0.0-beta.
|
27
|
+
You can access [these files on unpkg](https://res.cdn.office.net/teams-js/2.0.0-beta.5/js/MicrosoftTeams.min.js), download them, or point your package manager to them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the SDK 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.0.0-beta.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.0.0-beta.5/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-vZRWEk6i8zcVUxh4lQUp+rKbFHv1Thlixb5Z3DAanwntS8owtI9t2K9BmCU0WBxL"
|
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.0.0-beta.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.0.0-beta.5/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
@@ -1760,6 +1760,11 @@ export enum FileOpenPreference {
|
|
1760
1760
|
Desktop = "desktop",
|
1761
1761
|
Web = "web"
|
1762
1762
|
}
|
1763
|
+
/**
|
1764
|
+
* @deprecated
|
1765
|
+
* As of 2.0.0-beta.1, please use {@link app.Context} instead.
|
1766
|
+
* Represents structure of the received context message.
|
1767
|
+
*/
|
1763
1768
|
export interface Context {
|
1764
1769
|
/**
|
1765
1770
|
* @hidden
|
@@ -2297,26 +2302,78 @@ export namespace app {
|
|
2297
2302
|
Failure: string;
|
2298
2303
|
ExpectedFailure: string;
|
2299
2304
|
};
|
2305
|
+
/**
|
2306
|
+
* Describes errors that caused app initialization to fail
|
2307
|
+
*/
|
2300
2308
|
enum FailedReason {
|
2309
|
+
/**
|
2310
|
+
* Authentication failed
|
2311
|
+
*/
|
2301
2312
|
AuthFailed = "AuthFailed",
|
2313
|
+
/**
|
2314
|
+
* The application timed out
|
2315
|
+
*/
|
2302
2316
|
Timeout = "Timeout",
|
2317
|
+
/**
|
2318
|
+
* The app failed for a different reason
|
2319
|
+
*/
|
2303
2320
|
Other = "Other"
|
2304
2321
|
}
|
2322
|
+
/**
|
2323
|
+
* Describes expected errors that occurred during an otherwise successful
|
2324
|
+
* app initialization
|
2325
|
+
*/
|
2305
2326
|
enum ExpectedFailureReason {
|
2327
|
+
/**
|
2328
|
+
* There was a permission error
|
2329
|
+
*/
|
2306
2330
|
PermissionError = "PermissionError",
|
2331
|
+
/**
|
2332
|
+
* The item was not found
|
2333
|
+
*/
|
2307
2334
|
NotFound = "NotFound",
|
2335
|
+
/**
|
2336
|
+
* The network is currently throttled
|
2337
|
+
*/
|
2308
2338
|
Throttling = "Throttling",
|
2339
|
+
/**
|
2340
|
+
* The application is currently offline
|
2341
|
+
*/
|
2309
2342
|
Offline = "Offline",
|
2343
|
+
/**
|
2344
|
+
* The app failed for a different reason
|
2345
|
+
*/
|
2310
2346
|
Other = "Other"
|
2311
2347
|
}
|
2348
|
+
/**
|
2349
|
+
* Represents the failed request sent during a failed app initialization.
|
2350
|
+
*/
|
2312
2351
|
interface IFailedRequest {
|
2352
|
+
/**
|
2353
|
+
* The reason for the failure
|
2354
|
+
*/
|
2313
2355
|
reason: FailedReason;
|
2356
|
+
/**
|
2357
|
+
* A message that describes the failure
|
2358
|
+
*/
|
2314
2359
|
message?: string;
|
2315
2360
|
}
|
2361
|
+
/**
|
2362
|
+
* Represents the failure request sent during an erroneous app initialization.
|
2363
|
+
*/
|
2316
2364
|
interface IExpectedFailureRequest {
|
2365
|
+
/**
|
2366
|
+
* The reason for the failure
|
2367
|
+
*/
|
2317
2368
|
reason: ExpectedFailureReason;
|
2369
|
+
/**
|
2370
|
+
* A message that describes the failure
|
2371
|
+
*/
|
2318
2372
|
message?: string;
|
2319
2373
|
}
|
2374
|
+
/**
|
2375
|
+
* Represents application information.
|
2376
|
+
*/
|
2320
2377
|
interface AppInfo {
|
2321
2378
|
/**
|
2322
2379
|
* The current locale that the user has configured for the app formatted as
|
@@ -2363,6 +2420,9 @@ export namespace app {
|
|
2363
2420
|
*/
|
2364
2421
|
appLaunchId?: string;
|
2365
2422
|
}
|
2423
|
+
/**
|
2424
|
+
* Represents information about the application's host.
|
2425
|
+
*/
|
2366
2426
|
interface AppHostInfo {
|
2367
2427
|
/**
|
2368
2428
|
* The name of the host client. Possible values are: Office, Orange, Outlook, Teams
|
@@ -2381,6 +2441,9 @@ export namespace app {
|
|
2381
2441
|
*/
|
2382
2442
|
ringId?: string;
|
2383
2443
|
}
|
2444
|
+
/**
|
2445
|
+
* Represents Channel information.
|
2446
|
+
*/
|
2384
2447
|
interface ChannelInfo {
|
2385
2448
|
/**
|
2386
2449
|
* The Microsoft Teams ID for the channel with which the content is associated.
|
@@ -2411,18 +2474,27 @@ export namespace app {
|
|
2411
2474
|
*/
|
2412
2475
|
ownerGroupId?: string;
|
2413
2476
|
}
|
2477
|
+
/**
|
2478
|
+
* Represents Chat information.
|
2479
|
+
*/
|
2414
2480
|
interface ChatInfo {
|
2415
2481
|
/**
|
2416
2482
|
* The Microsoft Teams ID for the chat with which the content is associated.
|
2417
2483
|
*/
|
2418
2484
|
id: string;
|
2419
2485
|
}
|
2486
|
+
/**
|
2487
|
+
* Represents Meeting information.
|
2488
|
+
*/
|
2420
2489
|
interface MeetingInfo {
|
2421
2490
|
/**
|
2422
2491
|
* Meeting Id used by tab when running in meeting context
|
2423
2492
|
*/
|
2424
2493
|
id: string;
|
2425
2494
|
}
|
2495
|
+
/**
|
2496
|
+
* Represents Page information.
|
2497
|
+
*/
|
2426
2498
|
interface PageInfo {
|
2427
2499
|
/**
|
2428
2500
|
* The developer-defined unique ID for the page this content points to.
|
@@ -2451,6 +2523,9 @@ export namespace app {
|
|
2451
2523
|
*/
|
2452
2524
|
sourceOrigin?: string;
|
2453
2525
|
}
|
2526
|
+
/**
|
2527
|
+
* Represents Team information.
|
2528
|
+
*/
|
2454
2529
|
interface TeamInfo {
|
2455
2530
|
/**
|
2456
2531
|
* The Microsoft Teams ID for the team with which the content is associated.
|
@@ -2485,6 +2560,9 @@ export namespace app {
|
|
2485
2560
|
*/
|
2486
2561
|
userRole?: UserTeamRole;
|
2487
2562
|
}
|
2563
|
+
/**
|
2564
|
+
* Represents User information.
|
2565
|
+
*/
|
2488
2566
|
interface UserInfo {
|
2489
2567
|
/**
|
2490
2568
|
* The Azure AD object id of the current user.
|
@@ -2528,6 +2606,9 @@ export namespace app {
|
|
2528
2606
|
*/
|
2529
2607
|
tenant?: TenantInfo;
|
2530
2608
|
}
|
2609
|
+
/**
|
2610
|
+
* Represents Tenant information.
|
2611
|
+
*/
|
2531
2612
|
interface TenantInfo {
|
2532
2613
|
/**
|
2533
2614
|
* The Azure AD tenant ID of the current user.
|
@@ -2568,7 +2649,7 @@ export namespace app {
|
|
2568
2649
|
mySitePath?: string;
|
2569
2650
|
}
|
2570
2651
|
/**
|
2571
|
-
* Represents structure of the context message
|
2652
|
+
* Represents structure of the received context message.
|
2572
2653
|
*/
|
2573
2654
|
interface Context {
|
2574
2655
|
/**
|
@@ -2614,7 +2695,7 @@ export namespace app {
|
|
2614
2695
|
*/
|
2615
2696
|
function isInitialized(): boolean;
|
2616
2697
|
/**
|
2617
|
-
* Gets the Frame Context that the App is running in. {@
|
2698
|
+
* Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.
|
2618
2699
|
* @returns the Frame Context.
|
2619
2700
|
*/
|
2620
2701
|
function getFrameContext(): FrameContexts;
|
@@ -2651,7 +2732,7 @@ export namespace app {
|
|
2651
2732
|
/**
|
2652
2733
|
* Retrieves the current context the frame is running in.
|
2653
2734
|
*
|
2654
|
-
* @returns Promise that will resolve with the {@link Context} object.
|
2735
|
+
* @returns Promise that will resolve with the {@link app.Context} object.
|
2655
2736
|
*/
|
2656
2737
|
function getContext(): Promise<app.Context>;
|
2657
2738
|
/**
|
@@ -2664,10 +2745,15 @@ export namespace app {
|
|
2664
2745
|
function notifySuccess(): void;
|
2665
2746
|
/**
|
2666
2747
|
* Notifies the frame that app initialization has failed and to show an error page in its place.
|
2748
|
+
*
|
2749
|
+
* @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
|
2750
|
+
* during initialization as well as an optional message.
|
2667
2751
|
*/
|
2668
2752
|
function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
|
2669
2753
|
/**
|
2670
2754
|
* Notifies the frame that app initialized with some expected errors.
|
2755
|
+
*
|
2756
|
+
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
2671
2757
|
*/
|
2672
2758
|
function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
|
2673
2759
|
/**
|
@@ -2906,7 +2992,7 @@ export namespace dialog {
|
|
2906
2992
|
}
|
2907
2993
|
|
2908
2994
|
/**
|
2909
|
-
* Navigation
|
2995
|
+
* Navigation-specific part of the SDK.
|
2910
2996
|
*
|
2911
2997
|
* @beta
|
2912
2998
|
*/
|
@@ -2919,6 +3005,7 @@ export namespace pages {
|
|
2919
3005
|
function returnFocus(navigateForward?: boolean): void;
|
2920
3006
|
/**
|
2921
3007
|
* @hidden
|
3008
|
+
*
|
2922
3009
|
* Registers a handler when focus needs to be passed from teams to the place of choice on app.
|
2923
3010
|
*
|
2924
3011
|
* @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
|
@@ -2926,8 +3013,26 @@ export namespace pages {
|
|
2926
3013
|
* @internal
|
2927
3014
|
*/
|
2928
3015
|
function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void;
|
3016
|
+
/**
|
3017
|
+
* Sets/Updates the current frame with new information
|
3018
|
+
*
|
3019
|
+
* @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
|
3020
|
+
* user clicks 'Go To Website'
|
3021
|
+
*/
|
2929
3022
|
function setCurrentFrame(frameInfo: FrameInfo): void;
|
3023
|
+
/**
|
3024
|
+
* Initializes the library with context information for the frame
|
3025
|
+
*
|
3026
|
+
* @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
|
3027
|
+
* user clicks 'Go To Website'
|
3028
|
+
* @param callback - An optional user-set callback that is executed once the app has finished initialization.
|
3029
|
+
* @param validMessageOrigins - An optional list of cross-frame message origins. They must have
|
3030
|
+
* https: protocol otherwise they will be ignored. Example: https:www.example.com
|
3031
|
+
*/
|
2930
3032
|
function initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[]): void;
|
3033
|
+
/**
|
3034
|
+
* Defines the configuration of the current or desired instance
|
3035
|
+
*/
|
2931
3036
|
interface InstanceConfig {
|
2932
3037
|
/**
|
2933
3038
|
* A suggested display name for the new content.
|
@@ -2989,7 +3094,9 @@ export namespace pages {
|
|
2989
3094
|
*/
|
2990
3095
|
function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void;
|
2991
3096
|
/**
|
2992
|
-
* Checks if
|
3097
|
+
* Checks if the current application host supports the pages capability
|
3098
|
+
* @returns true if the pages capability is enabled in runtime.supports.pages and
|
3099
|
+
* false if it is disabled
|
2993
3100
|
*/
|
2994
3101
|
function isSupported(): boolean;
|
2995
3102
|
/**
|
@@ -3032,17 +3139,19 @@ export namespace pages {
|
|
3032
3139
|
* Allows an app to retrieve for this user tabs that are owned by this app.
|
3033
3140
|
* If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.
|
3034
3141
|
* @param tabInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
|
3035
|
-
* @returns Promise that resolves with the {@link TabInformation}.
|
3142
|
+
* @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.
|
3036
3143
|
*/
|
3037
3144
|
function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
|
3038
3145
|
/**
|
3039
3146
|
* Allows an app to retrieve the most recently used tabs for this user.
|
3040
|
-
* @param tabInstanceParameters OPTIONAL Ignored, kept for future use
|
3041
|
-
* @returns Promise that resolves with the {@link TabInformation}.
|
3147
|
+
* @param tabInstanceParameters OPTIONAL Ignored, kept for future use.
|
3148
|
+
* @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.
|
3042
3149
|
*/
|
3043
3150
|
function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
|
3044
3151
|
/**
|
3045
|
-
* Checks if pages.
|
3152
|
+
* Checks if the current application host supports the pages.tab capability
|
3153
|
+
* @returns true if the pages.tabs capability is enabled in runtime.supports.pages.tabs and
|
3154
|
+
* false if it is disabled
|
3046
3155
|
*/
|
3047
3156
|
function isSupported(): boolean;
|
3048
3157
|
}
|
@@ -3051,6 +3160,13 @@ export namespace pages {
|
|
3051
3160
|
* This object is usable only on the config frame.
|
3052
3161
|
*/
|
3053
3162
|
namespace config {
|
3163
|
+
/**
|
3164
|
+
* @hidden
|
3165
|
+
* Hide from docs because this function is only used during initialization
|
3166
|
+
* ------------------
|
3167
|
+
* Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}
|
3168
|
+
* @internal
|
3169
|
+
*/
|
3054
3170
|
function initialize(): void;
|
3055
3171
|
/**
|
3056
3172
|
* Sets the validity state for the config.
|
@@ -3082,10 +3198,14 @@ export namespace pages {
|
|
3082
3198
|
*/
|
3083
3199
|
function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void;
|
3084
3200
|
/**
|
3085
|
-
* Registers a handler for when the
|
3201
|
+
* Registers a handler for when the tab configuration is changed by the user
|
3086
3202
|
* @param handler The handler to invoke when the user click on Settings.
|
3087
3203
|
*/
|
3088
3204
|
function registerChangeConfigHandler(handler: () => void): void;
|
3205
|
+
/**
|
3206
|
+
* Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure
|
3207
|
+
* to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.
|
3208
|
+
*/
|
3089
3209
|
interface SaveEvent {
|
3090
3210
|
/**
|
3091
3211
|
* Object containing properties passed as arguments to the settings.save event.
|
@@ -3101,6 +3221,10 @@ export namespace pages {
|
|
3101
3221
|
*/
|
3102
3222
|
notifyFailure(reason?: string): void;
|
3103
3223
|
}
|
3224
|
+
/**
|
3225
|
+
* Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure
|
3226
|
+
* to indicate the status of whether the settings.save call succeeded or not and why.
|
3227
|
+
*/
|
3104
3228
|
interface RemoveEvent {
|
3105
3229
|
/**
|
3106
3230
|
* Indicates that the underlying resource has been removed and the content can be removed.
|
@@ -3112,6 +3236,9 @@ export namespace pages {
|
|
3112
3236
|
*/
|
3113
3237
|
notifyFailure(reason?: string): void;
|
3114
3238
|
}
|
3239
|
+
/**
|
3240
|
+
* Parameters used in the settings.save event
|
3241
|
+
*/
|
3115
3242
|
interface SaveParameters {
|
3116
3243
|
/**
|
3117
3244
|
* Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save
|
@@ -3119,7 +3246,9 @@ export namespace pages {
|
|
3119
3246
|
webhookUrl?: string;
|
3120
3247
|
}
|
3121
3248
|
/**
|
3122
|
-
* Checks if pages.config capability
|
3249
|
+
* Checks if the current application host supports the pages.config capability
|
3250
|
+
* @returns true if the pages.config capability is enabled in runtime.supports.pages.config and
|
3251
|
+
* false if it is disabled
|
3123
3252
|
*/
|
3124
3253
|
function isSupported(): boolean;
|
3125
3254
|
}
|
@@ -3143,10 +3272,18 @@ export namespace pages {
|
|
3143
3272
|
*/
|
3144
3273
|
function registerBackButtonHandler(handler: () => boolean): void;
|
3145
3274
|
/**
|
3146
|
-
* Checks if pages.backStack capability
|
3275
|
+
* Checks if the current application host supports the pages.backStack capability
|
3276
|
+
* @returns true if the pages.backStack capability is enabled in runtime.supports.pages.backStack and
|
3277
|
+
* false if it is disabled
|
3147
3278
|
*/
|
3148
3279
|
function isSupported(): boolean;
|
3149
3280
|
}
|
3281
|
+
/**
|
3282
|
+
* @hidden
|
3283
|
+
* Hide from docs
|
3284
|
+
* ------
|
3285
|
+
* Namespace to interact with the full-trust part of the SDK. Limited to 1P apps
|
3286
|
+
*/
|
3150
3287
|
namespace fullTrust {
|
3151
3288
|
/**
|
3152
3289
|
* @hidden
|
@@ -3163,7 +3300,12 @@ export namespace pages {
|
|
3163
3300
|
*/
|
3164
3301
|
function exitFullscreen(): void;
|
3165
3302
|
/**
|
3166
|
-
*
|
3303
|
+
* @hidden
|
3304
|
+
* Hide from docs
|
3305
|
+
* ------
|
3306
|
+
* Checks if the current application host supports the pages.fullTrust capability
|
3307
|
+
* @returns true if the pages.fullTrust capability is enabled in runtime.supports.pages.fullTrust and
|
3308
|
+
* false if it is disabled
|
3167
3309
|
*/
|
3168
3310
|
function isSupported(): boolean;
|
3169
3311
|
}
|
@@ -3191,6 +3333,8 @@ export namespace pages {
|
|
3191
3333
|
function onHoverLeave(handler: () => void): void;
|
3192
3334
|
/**
|
3193
3335
|
* Checks if pages.appButton capability is supported currently
|
3336
|
+
* @returns true if the pages.appButton capability is enabled in runtime.supports.pages.appButton and
|
3337
|
+
* false if it is disabled
|
3194
3338
|
*/
|
3195
3339
|
function isSupported(): boolean;
|
3196
3340
|
}
|
@@ -4566,25 +4710,32 @@ export namespace appInitialization {
|
|
4566
4710
|
/**
|
4567
4711
|
* @deprecated
|
4568
4712
|
* As of 2.0.0-beta.1, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.
|
4713
|
+
*
|
4569
4714
|
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
|
4570
4715
|
*/
|
4571
4716
|
function notifyAppLoaded(): void;
|
4572
4717
|
/**
|
4573
4718
|
* @deprecated
|
4574
4719
|
* As of 2.0.0-beta.1, please use {@link app.notifySuccess app.notifySuccess(): void} instead.
|
4720
|
+
*
|
4575
4721
|
* Notifies the frame that app initialization is successful and is ready for user interaction.
|
4576
4722
|
*/
|
4577
4723
|
function notifySuccess(): void;
|
4578
4724
|
/**
|
4579
4725
|
* @deprecated
|
4580
4726
|
* As of 2.0.0-beta.1, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.
|
4727
|
+
*
|
4581
4728
|
* Notifies the frame that app initialization has failed and to show an error page in its place.
|
4729
|
+
* @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
|
4730
|
+
* during initialization as well as an optional message.
|
4582
4731
|
*/
|
4583
4732
|
function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
|
4584
4733
|
/**
|
4585
4734
|
* @deprecated
|
4586
4735
|
* As of 2.0.0-beta.1, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.
|
4736
|
+
*
|
4587
4737
|
* Notifies the frame that app initialized with some expected errors.
|
4738
|
+
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
4588
4739
|
*/
|
4589
4740
|
function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
|
4590
4741
|
}
|