@microsoft/teams-js 2.29.0-beta.2 → 2.29.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/emailAddressValidation.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -0
- package/dist/esm/packages/teams-js/src/public/emailAddress.js +1 -0
- package/dist/esm/packages/teams-js/src/public/meeting.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.d.ts +206 -52
- package/dist/umd/MicrosoftTeams.js +253 -5
- 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 +51 -1
@@ -995,6 +995,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
995
995
|
ChannelType: () => (/* reexport */ ChannelType),
|
996
996
|
ChildAppWindow: () => (/* reexport */ ChildAppWindow),
|
997
997
|
DialogDimension: () => (/* reexport */ DialogDimension),
|
998
|
+
EmailAddress: () => (/* reexport */ EmailAddress),
|
998
999
|
ErrorCode: () => (/* reexport */ ErrorCode),
|
999
1000
|
FileOpenPreference: () => (/* reexport */ FileOpenPreference),
|
1000
1001
|
FrameContexts: () => (/* reexport */ FrameContexts),
|
@@ -1025,6 +1026,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1025
1026
|
enablePrintCapability: () => (/* reexport */ enablePrintCapability),
|
1026
1027
|
executeDeepLink: () => (/* reexport */ executeDeepLink),
|
1027
1028
|
externalAppAuthentication: () => (/* reexport */ externalAppAuthentication),
|
1029
|
+
externalAppAuthenticationForCEA: () => (/* reexport */ externalAppAuthenticationForCEA),
|
1028
1030
|
externalAppCardActions: () => (/* reexport */ externalAppCardActions),
|
1029
1031
|
externalAppCardActionsForCEA: () => (/* reexport */ externalAppCardActionsForCEA),
|
1030
1032
|
externalAppCommands: () => (/* reexport */ externalAppCommands),
|
@@ -3509,7 +3511,7 @@ const _minRuntimeConfigToUninitialize = {
|
|
3509
3511
|
* @hidden
|
3510
3512
|
* Package version.
|
3511
3513
|
*/
|
3512
|
-
const version = "2.29.0
|
3514
|
+
const version = "2.29.0";
|
3513
3515
|
|
3514
3516
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
3515
3517
|
|
@@ -8158,13 +8160,29 @@ const externalAppAuthenticationTelemetryVersionNumber = "v2" /* ApiVersionNumber
|
|
8158
8160
|
*/
|
8159
8161
|
var externalAppAuthentication;
|
8160
8162
|
(function (externalAppAuthentication) {
|
8163
|
+
/**
|
8164
|
+
* @beta
|
8165
|
+
* @hidden
|
8166
|
+
* Determines if the provided response object is an instance of IActionExecuteResponse
|
8167
|
+
* @internal
|
8168
|
+
* Limited to Microsoft-internal use
|
8169
|
+
* @param response The object to check whether it is of IActionExecuteResponse type
|
8170
|
+
*/
|
8171
|
+
function isActionExecuteResponse(response) {
|
8172
|
+
const actionResponse = response;
|
8173
|
+
return (actionResponse.responseType === externalAppAuthentication.InvokeResponseType.ActionExecuteInvokeResponse &&
|
8174
|
+
actionResponse.value !== undefined &&
|
8175
|
+
actionResponse.statusCode !== undefined &&
|
8176
|
+
actionResponse.type !== undefined);
|
8177
|
+
}
|
8178
|
+
externalAppAuthentication.isActionExecuteResponse = isActionExecuteResponse;
|
8161
8179
|
/**
|
8162
8180
|
* @hidden
|
8163
8181
|
* This is the only allowed value for IActionExecuteInvokeRequest.type. Used for validation
|
8164
8182
|
* @internal
|
8165
8183
|
* Limited to Microsoft-internal use
|
8166
8184
|
*/
|
8167
|
-
|
8185
|
+
externalAppAuthentication.ActionExecuteInvokeRequestType = 'Action.Execute';
|
8168
8186
|
/**
|
8169
8187
|
* @hidden
|
8170
8188
|
* Used to differentiate between IOriginalRequestInfo types
|
@@ -8187,6 +8205,23 @@ var externalAppAuthentication;
|
|
8187
8205
|
InvokeResponseType["ActionExecuteInvokeResponse"] = "ActionExecuteInvokeResponse";
|
8188
8206
|
InvokeResponseType["QueryMessageExtensionResponse"] = "QueryMessageExtensionResponse";
|
8189
8207
|
})(InvokeResponseType = externalAppAuthentication.InvokeResponseType || (externalAppAuthentication.InvokeResponseType = {}));
|
8208
|
+
/**
|
8209
|
+
* @beta
|
8210
|
+
* @hidden
|
8211
|
+
* Determines if the provided error object is an instance of InvokeError
|
8212
|
+
* @internal
|
8213
|
+
* Limited to Microsoft-internal use
|
8214
|
+
* @param err The error object to check whether it is of InvokeError type
|
8215
|
+
*/
|
8216
|
+
function isInvokeError(err) {
|
8217
|
+
if (typeof err !== 'object' || err === null) {
|
8218
|
+
return false;
|
8219
|
+
}
|
8220
|
+
const error = err;
|
8221
|
+
return (Object.values(externalAppAuthentication.InvokeErrorCode).includes(error.errorCode) &&
|
8222
|
+
(error.message === undefined || typeof error.message === 'string'));
|
8223
|
+
}
|
8224
|
+
externalAppAuthentication.isInvokeError = isInvokeError;
|
8190
8225
|
/**
|
8191
8226
|
* @hidden
|
8192
8227
|
*
|
@@ -8206,10 +8241,10 @@ var externalAppAuthentication;
|
|
8206
8241
|
function validateOriginalRequestInfo(originalRequestInfo) {
|
8207
8242
|
if (originalRequestInfo.requestType === OriginalRequestType.ActionExecuteInvokeRequest) {
|
8208
8243
|
const actionExecuteRequest = originalRequestInfo;
|
8209
|
-
if (actionExecuteRequest.type !== ActionExecuteInvokeRequestType) {
|
8244
|
+
if (actionExecuteRequest.type !== externalAppAuthentication.ActionExecuteInvokeRequestType) {
|
8210
8245
|
const error = {
|
8211
8246
|
errorCode: InvokeErrorCode.INTERNAL_ERROR,
|
8212
|
-
message: `Invalid action type ${actionExecuteRequest.type}. Action type must be "${ActionExecuteInvokeRequestType}"`,
|
8247
|
+
message: `Invalid action type ${actionExecuteRequest.type}. Action type must be "${externalAppAuthentication.ActionExecuteInvokeRequestType}"`,
|
8213
8248
|
};
|
8214
8249
|
throw error;
|
8215
8250
|
}
|
@@ -8400,6 +8435,189 @@ var externalAppAuthentication;
|
|
8400
8435
|
externalAppAuthentication.isSupported = isSupported;
|
8401
8436
|
})(externalAppAuthentication || (externalAppAuthentication = {}));
|
8402
8437
|
|
8438
|
+
;// CONCATENATED MODULE: ./src/private/externalAppAuthenticationForCEA.ts
|
8439
|
+
var externalAppAuthenticationForCEA_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
8440
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
8441
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
8442
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
8443
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
8444
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8445
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8446
|
+
});
|
8447
|
+
};
|
8448
|
+
|
8449
|
+
|
8450
|
+
|
8451
|
+
|
8452
|
+
|
8453
|
+
|
8454
|
+
|
8455
|
+
const externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
8456
|
+
/**
|
8457
|
+
* @hidden
|
8458
|
+
* Namespace to delegate authentication requests to the host for custom engine agents
|
8459
|
+
* @internal
|
8460
|
+
* Limited to Microsoft-internal use
|
8461
|
+
* @beta
|
8462
|
+
*/
|
8463
|
+
var externalAppAuthenticationForCEA;
|
8464
|
+
(function (externalAppAuthenticationForCEA) {
|
8465
|
+
/**
|
8466
|
+
* @beta
|
8467
|
+
* @hidden
|
8468
|
+
* Signals to the host to perform SSO authentication for the application specified by the app ID, and then send the authResult to the application backend.
|
8469
|
+
* @internal
|
8470
|
+
* Limited to Microsoft-internal use
|
8471
|
+
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
|
8472
|
+
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
|
8473
|
+
* @param authTokenRequest Parameters for SSO authentication
|
8474
|
+
* @throws InvokeError if the host encounters an error while authenticating
|
8475
|
+
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure
|
8476
|
+
*/
|
8477
|
+
function authenticateWithSSO(appId, conversationId, authTokenRequest) {
|
8478
|
+
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
8479
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8480
|
+
if (!isSupported()) {
|
8481
|
+
throw errorNotSupportedOnPlatform;
|
8482
|
+
}
|
8483
|
+
validateId(conversationId, new Error('conversation id is not valid.'));
|
8484
|
+
const error = yield sendAndUnwrap(getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */), "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, appId.toString(), conversationId, authTokenRequest.claims, authTokenRequest.silent);
|
8485
|
+
if (error) {
|
8486
|
+
throw error;
|
8487
|
+
}
|
8488
|
+
});
|
8489
|
+
}
|
8490
|
+
externalAppAuthenticationForCEA.authenticateWithSSO = authenticateWithSSO;
|
8491
|
+
/**
|
8492
|
+
* @beta
|
8493
|
+
* @hidden
|
8494
|
+
* Signals to the host to perform authentication using the given authentication parameters and then send the auth result to the application backend.
|
8495
|
+
* @internal
|
8496
|
+
* Limited to Microsoft-internal use
|
8497
|
+
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
|
8498
|
+
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
|
8499
|
+
* @param authenticateParameters Parameters for the authentication pop-up
|
8500
|
+
* @throws InvokeError if the host encounters an error while authenticating
|
8501
|
+
* @returns A promise that resolves from the application backend and rejects with InvokeError if the host encounters an error while authenticating
|
8502
|
+
*/
|
8503
|
+
function authenticateWithOauth(appId, conversationId, authenticateParameters) {
|
8504
|
+
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
8505
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8506
|
+
if (!isSupported()) {
|
8507
|
+
throw errorNotSupportedOnPlatform;
|
8508
|
+
}
|
8509
|
+
validateId(conversationId, new Error('conversation id is not valid.'));
|
8510
|
+
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
8511
|
+
const error = yield sendAndUnwrap(getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithOauth" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithOauth */), "externalAppAuthenticationForCEA.authenticateWithOauth" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithOauth */, appId.toString(), conversationId, authenticateParameters.url.href, authenticateParameters.width, authenticateParameters.height, authenticateParameters.isExternal);
|
8512
|
+
if (error) {
|
8513
|
+
throw error;
|
8514
|
+
}
|
8515
|
+
});
|
8516
|
+
}
|
8517
|
+
externalAppAuthenticationForCEA.authenticateWithOauth = authenticateWithOauth;
|
8518
|
+
/**
|
8519
|
+
* @beta
|
8520
|
+
* @hidden
|
8521
|
+
* Signals to the host to perform authentication using the given authentication parameters and then resend the request to the application backend with the authentication result.
|
8522
|
+
* @internal
|
8523
|
+
* Limited to Microsoft-internal use
|
8524
|
+
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
|
8525
|
+
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
|
8526
|
+
* @param authenticateParameters Parameters for the authentication pop-up
|
8527
|
+
* @param originalRequestInfo Information about the original request that should be resent
|
8528
|
+
* @throws InvokeError if the host encounters an error while authenticating or resending the request
|
8529
|
+
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
8530
|
+
*/
|
8531
|
+
function authenticateAndResendRequest(appId, conversationId, authenticateParameters, originalRequestInfo) {
|
8532
|
+
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
8533
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8534
|
+
if (!isSupported()) {
|
8535
|
+
throw errorNotSupportedOnPlatform;
|
8536
|
+
}
|
8537
|
+
validateId(conversationId, new Error('conversation id is not valid.'));
|
8538
|
+
validateOriginalRequestInfo(originalRequestInfo);
|
8539
|
+
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
8540
|
+
const response = yield sendAndUnwrap(getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateAndResendRequest */), "externalAppAuthenticationForCEA.authenticateAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateAndResendRequest */, appId.toString(), conversationId, originalRequestInfo, authenticateParameters.url.href, authenticateParameters.width, authenticateParameters.height, authenticateParameters.isExternal);
|
8541
|
+
if (externalAppAuthentication.isActionExecuteResponse(response)) {
|
8542
|
+
return response;
|
8543
|
+
}
|
8544
|
+
else {
|
8545
|
+
throw externalAppAuthentication.isInvokeError(response) ? response : defaultExternalAppError;
|
8546
|
+
}
|
8547
|
+
});
|
8548
|
+
}
|
8549
|
+
externalAppAuthenticationForCEA.authenticateAndResendRequest = authenticateAndResendRequest;
|
8550
|
+
/**
|
8551
|
+
* @beta
|
8552
|
+
* @hidden
|
8553
|
+
* Signals to the host to perform SSO authentication for the application specified by the app ID and then resend the request to the application backend with the authentication result and originalRequestInfo
|
8554
|
+
* @internal
|
8555
|
+
* Limited to Microsoft-internal use
|
8556
|
+
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
|
8557
|
+
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
|
8558
|
+
* @param authTokenRequest Parameters for SSO authentication
|
8559
|
+
* @param originalRequestInfo Information about the original request that should be resent
|
8560
|
+
* @throws InvokeError if the host encounters an error while authenticating or resending the request
|
8561
|
+
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
8562
|
+
*/
|
8563
|
+
function authenticateWithSSOAndResendRequest(appId, conversationId, authTokenRequest, originalRequestInfo) {
|
8564
|
+
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
8565
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8566
|
+
if (!isSupported()) {
|
8567
|
+
throw errorNotSupportedOnPlatform;
|
8568
|
+
}
|
8569
|
+
validateId(conversationId, new Error('conversation id is not valid.'));
|
8570
|
+
validateOriginalRequestInfo(originalRequestInfo);
|
8571
|
+
const response = yield sendAndUnwrap(getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */), "externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */, appId.toString(), conversationId, originalRequestInfo, authTokenRequest.claims, authTokenRequest.silent);
|
8572
|
+
if (externalAppAuthentication.isActionExecuteResponse(response)) {
|
8573
|
+
return response;
|
8574
|
+
}
|
8575
|
+
else {
|
8576
|
+
throw externalAppAuthentication.isInvokeError(response) ? response : defaultExternalAppError;
|
8577
|
+
}
|
8578
|
+
});
|
8579
|
+
}
|
8580
|
+
externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest = authenticateWithSSOAndResendRequest;
|
8581
|
+
/**
|
8582
|
+
* @beta
|
8583
|
+
* @hidden
|
8584
|
+
* Checks if the externalAppAuthenticationForCEA capability is supported by the host
|
8585
|
+
* @returns boolean to represent whether externalAppAuthenticationForCEA capability is supported
|
8586
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
8587
|
+
* @internal
|
8588
|
+
* Limited to Microsoft-internal use
|
8589
|
+
*/
|
8590
|
+
function isSupported() {
|
8591
|
+
return ensureInitialized(runtime) && runtime.supports.externalAppAuthenticationForCEA ? true : false;
|
8592
|
+
}
|
8593
|
+
externalAppAuthenticationForCEA.isSupported = isSupported;
|
8594
|
+
/**
|
8595
|
+
* @hidden
|
8596
|
+
* @internal
|
8597
|
+
* Limited to Microsoft-internal use
|
8598
|
+
* @beta
|
8599
|
+
*/
|
8600
|
+
function validateOriginalRequestInfo(actionExecuteRequest) {
|
8601
|
+
if (actionExecuteRequest.type !== externalAppAuthentication.ActionExecuteInvokeRequestType) {
|
8602
|
+
const error = {
|
8603
|
+
errorCode: externalAppAuthentication.InvokeErrorCode.INTERNAL_ERROR,
|
8604
|
+
message: `Invalid action type ${actionExecuteRequest.type}. Action type must be "${externalAppAuthentication.ActionExecuteInvokeRequestType}"`,
|
8605
|
+
};
|
8606
|
+
throw error;
|
8607
|
+
}
|
8608
|
+
}
|
8609
|
+
/**
|
8610
|
+
* @hidden
|
8611
|
+
* @internal
|
8612
|
+
* Limited to Microsoft-internal use
|
8613
|
+
* @beta
|
8614
|
+
*/
|
8615
|
+
const defaultExternalAppError = {
|
8616
|
+
errorCode: externalAppAuthentication.InvokeErrorCode.INTERNAL_ERROR,
|
8617
|
+
message: 'No valid response received',
|
8618
|
+
};
|
8619
|
+
})(externalAppAuthenticationForCEA || (externalAppAuthenticationForCEA = {}));
|
8620
|
+
|
8403
8621
|
;// CONCATENATED MODULE: ./src/private/externalAppCardActions.ts
|
8404
8622
|
|
8405
8623
|
|
@@ -11502,6 +11720,35 @@ var hostEntity;
|
|
11502
11720
|
|
11503
11721
|
|
11504
11722
|
|
11723
|
+
|
11724
|
+
|
11725
|
+
;// CONCATENATED MODULE: ./src/internal/emailAddressValidation.ts
|
11726
|
+
function validateEmailAddress(emailString) {
|
11727
|
+
const emailIsEmptyOrUndefined = emailString ? emailString.length <= 0 : true;
|
11728
|
+
const atIndex = emailString === null || emailString === void 0 ? void 0 : emailString.indexOf('@');
|
11729
|
+
const periodIndexAfterAt = emailString === null || emailString === void 0 ? void 0 : emailString.indexOf('.', atIndex);
|
11730
|
+
if (emailIsEmptyOrUndefined || atIndex === -1 || periodIndexAfterAt === -1) {
|
11731
|
+
throw new Error('Input email address does not have the correct format.');
|
11732
|
+
}
|
11733
|
+
}
|
11734
|
+
|
11735
|
+
;// CONCATENATED MODULE: ./src/public/emailAddress.ts
|
11736
|
+
|
11737
|
+
/**
|
11738
|
+
* Represents a validated email.
|
11739
|
+
*/
|
11740
|
+
class EmailAddress {
|
11741
|
+
constructor(val) {
|
11742
|
+
this.val = val;
|
11743
|
+
validateEmailAddress(val);
|
11744
|
+
}
|
11745
|
+
/**
|
11746
|
+
* Retrieve the validated email address as a string.
|
11747
|
+
*/
|
11748
|
+
toString() {
|
11749
|
+
return this.val;
|
11750
|
+
}
|
11751
|
+
}
|
11505
11752
|
|
11506
11753
|
;// CONCATENATED MODULE: ./src/internal/deepLinkConstants.ts
|
11507
11754
|
/**
|
@@ -13304,7 +13551,7 @@ var meeting;
|
|
13304
13551
|
throw new Error((_a = error === null || error === void 0 ? void 0 : error.errorCode) === null || _a === void 0 ? void 0 : _a.toString());
|
13305
13552
|
}
|
13306
13553
|
if ((((_b = response.details) === null || _b === void 0 ? void 0 : _b.type) == CallType.GroupCall || ((_c = response.details) === null || _c === void 0 ? void 0 : _c.type) == CallType.OneOnOneCall) &&
|
13307
|
-
!response.details.
|
13554
|
+
!response.details.originalCallerInfo) {
|
13308
13555
|
throw new Error(ErrorCode.NOT_SUPPORTED_ON_PLATFORM.toString());
|
13309
13556
|
}
|
13310
13557
|
return response;
|
@@ -16585,6 +16832,7 @@ var marketplace;
|
|
16585
16832
|
|
16586
16833
|
|
16587
16834
|
|
16835
|
+
|
16588
16836
|
|
16589
16837
|
|
16590
16838
|
|