@microsoft/teams-js 2.4.1 → 2.4.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ Reference the SDK inside of your `.html` page using:
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
48
  src="https://res.cdn.office.net/teams-js/2.4.1/js/MicrosoftTeams.min.js"
49
- integrity="sha384-l5BX+R3H+6sfSa7KKsqzBsWKsJ9JE9O0a1DqQKtM/RbE1Gb6N6bGYlNJt4EIZZ6X"
49
+ integrity="sha384-f54aC8b3HUFudeEk+QUkv5RpZUpPr2g7TdP4+jnDAMoJSmt+PbMdUV+zGTYCQY1c"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
@@ -3499,7 +3499,7 @@ export namespace app {
3499
3499
  */
3500
3500
  reason: FailedReason;
3501
3501
  /**
3502
- * A message that describes the failure
3502
+ * This property is currently unused.
3503
3503
  */
3504
3504
  message?: string;
3505
3505
  }
@@ -4073,8 +4073,10 @@ export namespace dialog {
4073
4073
  */
4074
4074
  err?: string;
4075
4075
  /**
4076
- * Result value that the dialog is submitted with using {@linkcode submit} function
4077
- *
4076
+ * Value provided in the `result` parameter by the dialog when the {@linkcode submit} function
4077
+ * was called.
4078
+ * If the dialog was closed by the user without submitting (e.g., using a control in the corner
4079
+ * of the dialog), this value will be `undefined` here.
4078
4080
  */
4079
4081
  result?: string | object;
4080
4082
  }
@@ -6366,7 +6368,7 @@ export namespace stageView {
6366
6368
  function isSupported(): boolean;
6367
6369
  }
6368
6370
 
6369
- export const version: string;
6371
+ export const version = "ERROR: This value should be replaced by webpack!";
6370
6372
 
6371
6373
  /**
6372
6374
  * Contains functionality to allow web apps to store data in webview cache
@@ -6895,3 +6897,198 @@ export namespace tasks {
6895
6897
  function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
6896
6898
  }
6897
6899
 
6900
+ /**
6901
+ * @hidden
6902
+ * Allowed roles during a meeting.
6903
+ *
6904
+ * @beta
6905
+ */
6906
+ export enum UserMeetingRole {
6907
+ guest = "Guest",
6908
+ attendee = "Attendee",
6909
+ presenter = "Presenter",
6910
+ organizer = "Organizer"
6911
+ }
6912
+ /**
6913
+ * @hidden
6914
+ * State of the current Live Share sessions backing fluid container.
6915
+ *
6916
+ * @beta
6917
+ */
6918
+ export enum ContainerState {
6919
+ /**
6920
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
6921
+ * for the current Live Share session.
6922
+ */
6923
+ added = "Added",
6924
+ /**
6925
+ * A container mapping for the current Live Share Session already exists and should be used
6926
+ * when joining the sessions Fluid container.
6927
+ */
6928
+ alreadyExists = "AlreadyExists",
6929
+ /**
6930
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
6931
+ * another client having already set the container ID for the current Live Share session.
6932
+ */
6933
+ conflict = "Conflict",
6934
+ /**
6935
+ * A container mapping for the current Live Share session doesn't exist yet.
6936
+ */
6937
+ notFound = "NotFound"
6938
+ }
6939
+ /**
6940
+ * @hidden
6941
+ * Returned from `LiveShareHost.get/setFluidContainerId()` to specify the container mapping for the
6942
+ * current Live Share session.
6943
+ *
6944
+ * @beta
6945
+ */
6946
+ export interface IFluidContainerInfo {
6947
+ /**
6948
+ * State of the containerId mapping.
6949
+ */
6950
+ containerState: ContainerState;
6951
+ /**
6952
+ * ID of the container to join for the meeting. Undefined if the container hasn't been
6953
+ * created yet.
6954
+ */
6955
+ containerId: string | undefined;
6956
+ /**
6957
+ * If true, the local client should create the container and then save the created containers
6958
+ * ID to the mapping service.
6959
+ */
6960
+ shouldCreate: boolean;
6961
+ /**
6962
+ * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready but
6963
+ * another client is creating it. The local client should wait the specified amount of time and
6964
+ * then ask for the container info again.
6965
+ */
6966
+ retryAfter: number;
6967
+ }
6968
+ /**
6969
+ * @hidden
6970
+ * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current
6971
+ * Live Share session.
6972
+ *
6973
+ * @beta
6974
+ */
6975
+ export interface INtpTimeInfo {
6976
+ /**
6977
+ * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'
6978
+ */
6979
+ ntpTime: string;
6980
+ /**
6981
+ * Server time expressed as the number of milliseconds since the ECMAScript epoch.
6982
+ */
6983
+ ntpTimeInUTC: number;
6984
+ }
6985
+ /**
6986
+ * @hidden
6987
+ * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the
6988
+ * current Live Share session.
6989
+ *
6990
+ * @beta
6991
+ */
6992
+ export interface IFluidTenantInfo {
6993
+ /**
6994
+ * The Fluid Tenant ID Live Share should use.
6995
+ */
6996
+ tenantId: string;
6997
+ /**
6998
+ * The Fluid service endpoint Live Share should use.
6999
+ */
7000
+ serviceEndpoint?: string;
7001
+ /**
7002
+ * @deprecated
7003
+ * As of Fluid 1.0 this configuration information has been deprecated in favor of
7004
+ * `serviceEndpoint`.
7005
+ */
7006
+ ordererEndpoint: string;
7007
+ /**
7008
+ * @deprecated
7009
+ * As of Fluid 1.0 this configuration information has been deprecated in favor of
7010
+ * `serviceEndpoint`.
7011
+ */
7012
+ storageEndpoint: string;
7013
+ }
7014
+ /**
7015
+ * Live Share host implementation for O365 and Teams clients.
7016
+ *
7017
+ * @beta
7018
+ */
7019
+ export class LiveShareHost {
7020
+ /**
7021
+ * @hidden
7022
+ * Returns the Fluid Tenant connection info for user's current context.
7023
+ *
7024
+ * @beta
7025
+ */
7026
+ getFluidTenantInfo(): Promise<IFluidTenantInfo>;
7027
+ /**
7028
+ * @hidden
7029
+ * Returns the fluid access token for mapped container Id.
7030
+ *
7031
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
7032
+ * @returns token for connecting to Fluid's session.
7033
+ *
7034
+ * @beta
7035
+ */
7036
+ getFluidToken(containerId?: string): Promise<string>;
7037
+ /**
7038
+ * @hidden
7039
+ * Returns the ID of the fluid container associated with the user's current context.
7040
+ *
7041
+ * @beta
7042
+ */
7043
+ getFluidContainerId(): Promise<IFluidContainerInfo>;
7044
+ /**
7045
+ * @hidden
7046
+ * Sets the ID of the fluid container associated with the current context.
7047
+ *
7048
+ * @remarks
7049
+ * If this returns false, the client should delete the container they created and then call
7050
+ * `getFluidContainerId()` to get the ID of the container being used.
7051
+ * @param containerId ID of the fluid container the client created.
7052
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
7053
+ *
7054
+ * @beta
7055
+ */
7056
+ setFluidContainerId(containerId: string): Promise<IFluidContainerInfo>;
7057
+ /**
7058
+ * @hidden
7059
+ * Returns the shared clock server's current time.
7060
+ *
7061
+ * @beta
7062
+ */
7063
+ getNtpTime(): Promise<INtpTimeInfo>;
7064
+ /**
7065
+ * @hidden
7066
+ * Associates the fluid client ID with a set of user roles.
7067
+ *
7068
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
7069
+ * @returns The roles for the current user.
7070
+ *
7071
+ * @beta
7072
+ */
7073
+ registerClientId(clientId: string): Promise<UserMeetingRole[]>;
7074
+ /**
7075
+ * @hidden
7076
+ * Returns the roles associated with a client ID.
7077
+ *
7078
+ * @param clientId The Client ID the message was received from.
7079
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
7080
+ *
7081
+ * @beta
7082
+ */
7083
+ getClientRoles(clientId: string): Promise<UserMeetingRole[] | undefined>;
7084
+ /**
7085
+ * Returns a host instance for the client that can be passed to the `LiveShareClient` class.
7086
+ *
7087
+ * @remarks
7088
+ * The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.
7089
+ *
7090
+ * @beta
7091
+ */
7092
+ static create(): LiveShareHost;
7093
+ }
7094
+
@@ -1046,17 +1046,20 @@ __webpack_require__.d(__webpack_exports__, {
1046
1046
  "ActionObjectType": () => (/* reexport */ ActionObjectType),
1047
1047
  "ChannelType": () => (/* reexport */ ChannelType),
1048
1048
  "ChildAppWindow": () => (/* reexport */ ChildAppWindow),
1049
+ "ContainerState": () => (/* reexport */ ContainerState),
1049
1050
  "DialogDimension": () => (/* reexport */ DialogDimension),
1050
1051
  "ErrorCode": () => (/* reexport */ ErrorCode),
1051
1052
  "FileOpenPreference": () => (/* reexport */ FileOpenPreference),
1052
1053
  "FrameContexts": () => (/* reexport */ FrameContexts),
1053
1054
  "HostClientType": () => (/* reexport */ HostClientType),
1054
1055
  "HostName": () => (/* reexport */ HostName),
1056
+ "LiveShareHost": () => (/* reexport */ LiveShareHost),
1055
1057
  "NotificationTypes": () => (/* reexport */ NotificationTypes),
1056
1058
  "ParentAppWindow": () => (/* reexport */ ParentAppWindow),
1057
1059
  "SecondaryM365ContentIdName": () => (/* reexport */ SecondaryM365ContentIdName),
1058
1060
  "TaskModuleDimension": () => (/* reexport */ TaskModuleDimension),
1059
1061
  "TeamType": () => (/* reexport */ TeamType),
1062
+ "UserMeetingRole": () => (/* reexport */ UserMeetingRole),
1060
1063
  "UserSettingTypes": () => (/* reexport */ UserSettingTypes),
1061
1064
  "UserTeamRole": () => (/* reexport */ UserTeamRole),
1062
1065
  "ViewerActionTypes": () => (/* reexport */ ViewerActionTypes),
@@ -1130,7 +1133,7 @@ __webpack_require__.d(__webpack_exports__, {
1130
1133
  });
1131
1134
 
1132
1135
  ;// CONCATENATED MODULE: ./src/public/version.ts
1133
- var version = "2.4.1";
1136
+ var version = "2.4.2-beta.1";
1134
1137
 
1135
1138
  ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1136
1139
  var GlobalVars = /** @class */ (function () {
@@ -8248,6 +8251,175 @@ var tasks;
8248
8251
  tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
8249
8252
  })(tasks || (tasks = {}));
8250
8253
 
8254
+ ;// CONCATENATED MODULE: ./src/public/liveShareHost.ts
8255
+
8256
+
8257
+
8258
+ /**
8259
+ * @hidden
8260
+ * Allowed roles during a meeting.
8261
+ *
8262
+ * @beta
8263
+ */
8264
+ var UserMeetingRole;
8265
+ (function (UserMeetingRole) {
8266
+ UserMeetingRole["guest"] = "Guest";
8267
+ UserMeetingRole["attendee"] = "Attendee";
8268
+ UserMeetingRole["presenter"] = "Presenter";
8269
+ UserMeetingRole["organizer"] = "Organizer";
8270
+ })(UserMeetingRole || (UserMeetingRole = {}));
8271
+ /**
8272
+ * @hidden
8273
+ * State of the current Live Share sessions backing fluid container.
8274
+ *
8275
+ * @beta
8276
+ */
8277
+ var ContainerState;
8278
+ (function (ContainerState) {
8279
+ /**
8280
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
8281
+ * for the current Live Share session.
8282
+ */
8283
+ ContainerState["added"] = "Added";
8284
+ /**
8285
+ * A container mapping for the current Live Share Session already exists and should be used
8286
+ * when joining the sessions Fluid container.
8287
+ */
8288
+ ContainerState["alreadyExists"] = "AlreadyExists";
8289
+ /**
8290
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
8291
+ * another client having already set the container ID for the current Live Share session.
8292
+ */
8293
+ ContainerState["conflict"] = "Conflict";
8294
+ /**
8295
+ * A container mapping for the current Live Share session doesn't exist yet.
8296
+ */
8297
+ ContainerState["notFound"] = "NotFound";
8298
+ })(ContainerState || (ContainerState = {}));
8299
+ /**
8300
+ * Live Share host implementation for O365 and Teams clients.
8301
+ *
8302
+ * @beta
8303
+ */
8304
+ var LiveShareHost = /** @class */ (function () {
8305
+ function LiveShareHost() {
8306
+ }
8307
+ /**
8308
+ * @hidden
8309
+ * Returns the Fluid Tenant connection info for user's current context.
8310
+ *
8311
+ * @beta
8312
+ */
8313
+ LiveShareHost.prototype.getFluidTenantInfo = function () {
8314
+ return new Promise(function (resolve) {
8315
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8316
+ resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8317
+ });
8318
+ };
8319
+ /**
8320
+ * @hidden
8321
+ * Returns the fluid access token for mapped container Id.
8322
+ *
8323
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
8324
+ * @returns token for connecting to Fluid's session.
8325
+ *
8326
+ * @beta
8327
+ */
8328
+ LiveShareHost.prototype.getFluidToken = function (containerId) {
8329
+ return new Promise(function (resolve) {
8330
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8331
+ // eslint-disable-next-line strict-null-checks/all
8332
+ resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8333
+ });
8334
+ };
8335
+ /**
8336
+ * @hidden
8337
+ * Returns the ID of the fluid container associated with the user's current context.
8338
+ *
8339
+ * @beta
8340
+ */
8341
+ LiveShareHost.prototype.getFluidContainerId = function () {
8342
+ return new Promise(function (resolve) {
8343
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8344
+ resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8345
+ });
8346
+ };
8347
+ /**
8348
+ * @hidden
8349
+ * Sets the ID of the fluid container associated with the current context.
8350
+ *
8351
+ * @remarks
8352
+ * If this returns false, the client should delete the container they created and then call
8353
+ * `getFluidContainerId()` to get the ID of the container being used.
8354
+ * @param containerId ID of the fluid container the client created.
8355
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
8356
+ *
8357
+ * @beta
8358
+ */
8359
+ LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8360
+ return new Promise(function (resolve) {
8361
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8362
+ resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8363
+ });
8364
+ };
8365
+ /**
8366
+ * @hidden
8367
+ * Returns the shared clock server's current time.
8368
+ *
8369
+ * @beta
8370
+ */
8371
+ LiveShareHost.prototype.getNtpTime = function () {
8372
+ return new Promise(function (resolve) {
8373
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8374
+ resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8375
+ });
8376
+ };
8377
+ /**
8378
+ * @hidden
8379
+ * Associates the fluid client ID with a set of user roles.
8380
+ *
8381
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
8382
+ * @returns The roles for the current user.
8383
+ *
8384
+ * @beta
8385
+ */
8386
+ LiveShareHost.prototype.registerClientId = function (clientId) {
8387
+ return new Promise(function (resolve) {
8388
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8389
+ resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8390
+ });
8391
+ };
8392
+ /**
8393
+ * @hidden
8394
+ * Returns the roles associated with a client ID.
8395
+ *
8396
+ * @param clientId The Client ID the message was received from.
8397
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
8398
+ *
8399
+ * @beta
8400
+ */
8401
+ LiveShareHost.prototype.getClientRoles = function (clientId) {
8402
+ return new Promise(function (resolve) {
8403
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8404
+ resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8405
+ });
8406
+ };
8407
+ /**
8408
+ * Returns a host instance for the client that can be passed to the `LiveShareClient` class.
8409
+ *
8410
+ * @remarks
8411
+ * The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.
8412
+ *
8413
+ * @beta
8414
+ */
8415
+ LiveShareHost.create = function () {
8416
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8417
+ return new LiveShareHost();
8418
+ };
8419
+ return LiveShareHost;
8420
+ }());
8421
+
8422
+
8251
8423
  ;// CONCATENATED MODULE: ./src/public/index.ts
8252
8424
 
8253
8425
 
@@ -8280,6 +8452,7 @@ var tasks;
8280
8452
 
8281
8453
 
8282
8454
 
8455
+
8283
8456
 
8284
8457
 
8285
8458