Socket
Socket
Sign inDemoInstall

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
488
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/teams-js - npm Package Compare versions

Comparing version 1.4.0-beta.0 to 1.4.0-beta.1

89

dist/MicrosoftTeams.d.ts

@@ -1,6 +0,3 @@

declare module '@microsoft/teams-js' {
export = microsoftTeams;
}
interface String {
export = microsoftTeams;
declare interface String {
startsWith(search: string, pos?: number): boolean;

@@ -39,3 +36,3 @@ }

android = "android",
ios = "ios",
ios = "ios"
}

@@ -122,3 +119,3 @@ /**

dropDown = "dropDown",
popOver = "popOver",
popOver = "popOver"
}

@@ -229,3 +226,3 @@ /**

Plc = 3,
Staff = 4,
Staff = 4
}

@@ -238,3 +235,3 @@ /**

User = 1,
Guest = 2,
Guest = 2
}

@@ -311,3 +308,3 @@ /**

Medium = "medium",
Small = "small",
Small = "small"
}

@@ -320,2 +317,10 @@ /**

/**
* Enable print capability to support printing page using Ctrl+P and cmd+P
*/
function enablePrintCapability(): void;
/**
* default print handler
*/
function print(): void;
/**
* Retrieves the current context the frame is running in.

@@ -398,2 +403,18 @@ * @param callback The callback to invoke when the {@link Context} object is retrieved.

* ------
* download file.
* @param file The file to download.
*/
function downloadFile(fileDownloadParameters: FileDownloadParameters): void;
/**
* @private
* Hide from docs.
* ------
* download file.
* @param file The file to download.
*/
function showNotification(showNotificationParameters: ShowNotificationParameters): void;
/**
* @private
* Hide from docs.
* ------
* Upload a custom App manifest directly to both team and personal scopes.

@@ -862,2 +883,13 @@ * This method works just for the first party Apps.

}
interface FileDownloadParameters {
/**
* A url to the source of the file, used to open the content in the user's default browser
*/
objectUrl: string;
title: string;
}
interface ShowNotificationParameters {
message: string;
isDownloadComplete: boolean;
}
/**

@@ -897,2 +929,8 @@ * @private

fallbackUrl?: string;
/**
* Specifies a bot ID to send the result of the user's interaction with the task module.
* If specified, the bot will receive a task/complete invoke event with a JSON object
* in the event payload.
*/
completionBotId?: string;
}

@@ -917,2 +955,33 @@ /**

}
/**
* @private
* Hide from docs
* --------
* Information about all members in a chat
*/
interface ChatMembersInformation {
members: ThreadMember[];
}
/**
* @private
* Hide from docs
* --------
* Information about a chat member
*/
interface ThreadMember {
/**
* The member's user principal name in the current tenant.
*/
upn: string;
}
/**
* @private
* Hide from docs
* ------
* Allows an app to retrieve information of all chat members
* Because a malicious party run your content in a browser, this value should
* be used only as a hint as to who the members are and never as proof of membership.
* @param callback The callback to invoke when the {@link ChatMembersInformation} object is retrieved.
*/
function getChatMembers(callback: (chatMembersInformation: ChatMembersInformation) => void): void;
}

@@ -21,3 +21,3 @@ ;(function(root, factory) {

"use strict";
var version = "1.3.4";
var version = "1.3.6";
var validOrigins = [

@@ -33,3 +33,5 @@ "https://teams.microsoft.com",

"https://*.sharepoint-df.com",
"https://*.sharepointonline.com"
"https://*.sharepointonline.com",
"https://outlook.office.com",
"https://outlook-sdf.office.com"
];

@@ -77,3 +79,3 @@ // This will return a reg expression a given url

*/
var MenuItem = (function () {
var MenuItem = /** @class */ (function () {
function MenuItem() {

@@ -170,2 +172,3 @@ /**

var hostClientType;
var printCapabilityEnabled = false;
var themeChangeHandler;

@@ -251,2 +254,28 @@ handlers["themeChange"] = handleThemeChange;

/**
* Enable print capability to support printing page using Ctrl+P and cmd+P
*/
function enablePrintCapability() {
if (!printCapabilityEnabled) {
printCapabilityEnabled = true;
ensureInitialized();
// adding ctrl+P and cmd+P handler
document.addEventListener("keydown", function (event) {
if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
microsoftTeams.print();
event.cancelBubble = true;
event.preventDefault();
event.stopImmediatePropagation();
}
});
}
}
microsoftTeams.enablePrintCapability = enablePrintCapability;
/**
* default print handler
*/
function print() {
window.print();
}
microsoftTeams.print = print;
/**
* Retrieves the current context the frame is running in.

@@ -334,3 +363,3 @@ * @param callback The callback to invoke when the {@link Context} object is retrieved.

function navigateCrossDomain(url) {
ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove);
ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove, frameContexts.task);
var messageId = sendMessageRequest(parentWindow, "navigateCrossDomain", [

@@ -431,2 +460,34 @@ url

* ------
* download file.
* @param file The file to download.
*/
function downloadFile(fileDownloadParameters) {
ensureInitialized(frameContexts.content);
var params = [
fileDownloadParameters.objectUrl,
fileDownloadParameters.title
];
sendMessageRequest(parentWindow, "downloadFile", params);
}
microsoftTeams.downloadFile = downloadFile;
/**
* @private
* Hide from docs.
* ------
* download file.
* @param file The file to download.
*/
function showNotification(showNotificationParameters) {
ensureInitialized(frameContexts.content);
var params = [
showNotificationParameters.message,
showNotificationParameters.isDownloadComplete
];
sendMessageRequest(parentWindow, "showNotification", params);
}
microsoftTeams.showNotification = showNotification;
/**
* @private
* Hide from docs.
* ------
* Upload a custom App manifest directly to both team and personal scopes.

@@ -545,3 +606,3 @@ * This method works just for the first party Apps.

*/
var SaveEventImpl = (function () {
var SaveEventImpl = /** @class */ (function () {
function SaveEventImpl(result) {

@@ -582,3 +643,3 @@ this.notified = false;

*/
var RemoveEventImpl = (function () {
var RemoveEventImpl = /** @class */ (function () {
function RemoveEventImpl() {

@@ -630,3 +691,3 @@ this.notified = false;

: authParams;
ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove);
ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove, frameContexts.task);
if (hostClientType === "desktop" /* desktop */) {

@@ -1041,4 +1102,4 @@ // Convert any relative URLs into absolute URLs before sending them over to the parent window.

function sendMessageRequest(targetWindow, actionName,
// tslint:disable-next-line: no-any
args) {
// tslint:disable-next-line: no-any
args) {
var request = createMessageRequest(actionName, args);

@@ -1072,4 +1133,4 @@ if (isFramelessWindow) {

function sendCustomMessage(actionName,
// tslint:disable-next-line:no-any
args) {
// tslint:disable-next-line:no-any
args) {
ensureInitialized();

@@ -1080,4 +1141,4 @@ return sendMessageRequest(parentWindow, actionName, args);

function sendMessageResponse(targetWindow, id,
// tslint:disable-next-line:no-any
args) {
// tslint:disable-next-line:no-any
args) {
var response = createMessageResponse(id, args);

@@ -1130,3 +1191,4 @@ var targetOrigin = getTargetOrigin(targetWindow);

ensureInitialized(frameContexts.content, frameContexts.task);
sendMessageRequest(parentWindow, "tasks.submitTask", [
// Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
sendMessageRequest(parentWindow, "tasks.completeTask", [
result,

@@ -1138,2 +1200,17 @@ Array.isArray(appIds) ? appIds : [appIds]

})(tasks = microsoftTeams.tasks || (microsoftTeams.tasks = {}));
/**
* @private
* Hide from docs
* ------
* Allows an app to retrieve information of all chat members
* Because a malicious party run your content in a browser, this value should
* be used only as a hint as to who the members are and never as proof of membership.
* @param callback The callback to invoke when the {@link ChatMembersInformation} object is retrieved.
*/
function getChatMembers(callback) {
ensureInitialized();
var messageId = sendMessageRequest(parentWindow, "getChatMembers");
callbacks[messageId] = callback;
}
microsoftTeams.getChatMembers = getChatMembers;
})(microsoftTeams || (microsoftTeams = {}));

@@ -1140,0 +1217,0 @@

2

dist/MicrosoftTeams.min.js

@@ -1,1 +0,1 @@

!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.microsoftTeams=e()}(this,function(){String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var t;return function(t){"use strict";function e(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}function n(t){for(var n="",i=0;i<t.length;i++)n+=(0===i?"":"|")+e(t[i]);return new RegExp(n)}function i(){if(!$){$=!0,z=this._window||window;var t=function(t){return k(t)};R=z.parent!==z.self?z.parent:z.opener,R?z.addEventListener("message",t,!1):(q=!0,window.onNativeMessage=C);try{V="*";var e=U(R,"initialize",[P]);Z[e]=function(t,e){J=t,X=e}}finally{V=null}this._uninitialize=function(){J&&(r(null),s(null),c(null)),J===W.settings&&nt.registerOnSaveHandler(null),J===W.remove&&nt.registerOnRemoveHandler(null),q||z.removeEventListener("message",t,!1),$=!1,R=null,V=null,G=[],_=null,j=null,K=[],Q=0,Z={},J=null,X=null,q=!1}}}function o(t){b();var e=U(R,"getContext");Z[e]=t}function r(t){b(),Y=t}function a(t){Y&&Y(t),_&&U(_,"themeChange",[t])}function s(t){b(),tt=t}function u(t){tt&&tt(t)}function c(t){b(),et=t}function f(){et&&et()||l()}function l(){b();var t=U(R,"navigateBack",[]);Z[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function h(t){b(W.content,W.settings,W.remove);var e=U(R,"navigateCrossDomain",[t]);Z[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}}function v(t,e){b();var n=U(R,"getTabInstances",[e]);Z[n]=t}function d(t,e){b();var n=U(R,"getUserJoinedTeams",[e]);Z[n]=t}function g(t,e){b();var n=U(R,"getMruTabInstances",[e]);Z[n]=t}function p(t){b(W.content),U(R,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function m(t){b(W.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];U(R,"openFilePreview",e)}function y(t){b();var e=U(R,"uploadCustomApp",[t]);Z[e]=function(t,e){if(!t)throw new Error(e)}}function w(t){b();var e=U(R,"navigateToTab",[t]);Z[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!$)throw new Error("The library has not yet been initialized");if(J&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===J){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+J+"' context")}}function k(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===z||n!==z.location.origin&&!F.test(n.toLowerCase())||(T(e,n),e===R?C(t):e===_&&I(t))}}function T(t,e){R&&t!==R?_&&t!==_||(_=t,j=e):(R=t,V=e),R&&R.closed&&(R=null,V=null),_&&_.closed&&(_=null,j=null),S(R),S(_)}function C(t){if("id"in t.data){var e=t.data,n=Z[e.id];n&&(n.apply(null,e.args),delete Z[e.id])}else if("func"in t.data){var e=t.data,i=D[e.func];i&&i.apply(this,e.args)}}function I(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=D[e.func];if(n){var i=n.apply(this,e.args);i&&O(_,e.id,Array.isArray(i)?i:[i])}else{var o=U(R,e.func,e.args);Z[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];_&&O(_,e.id,t)}}}}function E(t){return t===R?G:t===_?K:[]}function M(t){return t===R?V:t===_?j:null}function S(t){for(var e=M(t),n=E(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function N(t,e){var n=z.setInterval(function(){0===E(t).length&&(clearInterval(n),e())},100)}function U(t,e,n){var i=B(e,n);if(q)z&&z.nativeInterface&&z.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=M(t);t&&o?t.postMessage(i,o):E(t).push(i)}return i.id}function A(t,e){return b(),U(R,t,e)}function O(t,e,n){var i=L(e,n),o=M(t);t&&o&&t.postMessage(i,o)}function B(t,e){return{id:Q++,func:t,args:e||[]}}function L(t,e){return{id:t,args:e||[]}}var H,P="1.3.4",x=["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local","https://msft.spoppe.com","https://*.sharepoint.com","https://*.sharepoint-df.com","https://*.sharepointonline.com"],F=n(x),D={},W={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){function e(t,e){b(),l=e,U(R,"setUpViews",[t])}function n(t){l&&l(t)||(b(),U(R,"viewConfigItemPress",[t]))}function i(t,e){b(),c=e,U(R,"setNavBarMenu",[t])}function o(t){c&&c(t)||(b(),U(R,"handleNavBarMenuItemPress",[t]))}function r(t,e){b(),f=e,U(R,"showActionMenu",[t])}function a(t){f&&f(t)||(b(),U(R,"handleActionMenuItemPress",[t]))}var s=function(){function t(){this.enabled=!0}return t}();t.MenuItem=s;var u;!function(t){t.dropDown="dropDown",t.popOver="popOver"}(u=t.MenuListType||(t.MenuListType={}));var c;D.navBarMenuItemPress=o;var f;D.actionMenuItemPress=a;var l;D.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=r}(H=t.menus||(t.menus={}));var z,R,V,_,j,J,X,Y,$=!1,q=!1,G=[],K=[],Q=0,Z={};D.themeChange=a;var tt;D.fullScreenChange=u;var et;D.backButtonPress=f,t.initialize=i,t.getContext=o,t.registerOnThemeChangeHandler=r,t.registerFullScreenHandler=s,t.registerBackButtonHandler=c,t.navigateBack=l,t.navigateCrossDomain=h,t.getTabInstances=v,t.getUserJoinedTeams=d,t.getMruTabInstances=g,t.shareDeepLink=p,t.openFilePreview=m,t.uploadCustomApp=y,t.navigateToTab=w;var nt;!function(t){function e(t){b(W.settings,W.remove),U(R,"settings.setValidityState",[t])}function n(t){b(W.settings,W.remove);var e=U(R,"settings.getSettings");Z[e]=t}function i(t){b(W.settings),U(R,"settings.setSettings",[t])}function o(t){b(W.settings),u=t}function r(t){b(W.remove),c=t}function a(t){var e=new f(t);u?u(e):e.notifySuccess()}function s(){var t=new l;c?c(t):t.notifySuccess()}var u,c;D["settings.save"]=a,D["settings.remove"]=s,t.setValidityState=e,t.getSettings=n,t.setSettings=i,t.registerOnSaveHandler=o,t.registerOnRemoveHandler=r;var f=function(){function t(t){this.notified=!1,this.result=t?t:{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),U(R,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),U(R,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}(),l=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),U(R,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),U(R,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(nt=t.settings||(t.settings={}));var it;!function(t){function e(t){g=t}function n(t){var e=void 0!==t?t:g;if(b(W.content,W.settings,W.remove),"desktop"===X){var n=document.createElement("a");n.href=e.url;var i=U(R,"authentication.authenticate",[n.href,e.width,e.height]);Z[i]=function(t,n){t?e.successCallback(n):e.failureCallback(n)}}else a(e)}function i(t){b();var e=U(R,"authentication.getAuthToken",[t.resources]);Z[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function o(t){b();var e=U(R,"authentication.getUser");Z[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function r(){s();try{_&&_.close()}finally{_=null,j=null}}function a(t){g=t,r();var e=g.width||600,n=g.height||400;e=Math.min(e,z.outerWidth-400),n=Math.min(n,z.outerHeight-200);var i=document.createElement("a");i.href=g.url;var o="undefined"!=typeof z.screenLeft?z.screenLeft:z.screenX,a="undefined"!=typeof z.screenTop?z.screenTop:z.screenY;o+=z.outerWidth/2-e/2,a+=z.outerHeight/2-n/2,_=z.open(i.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+a+", left="+o+", width="+e+", height="+n),_?u():h("FailedToOpenWindow")}function s(){p&&(clearInterval(p),p=0),delete D.initialize,delete D.navigateCrossDomain}function u(){s(),p=z.setInterval(function(){if(!_||_.closed)h("CancelledByUser");else{var t=j;try{j="*",U(_,"ping")}finally{j=t}}},100),D.initialize=function(){return[W.authentication,X]},D.navigateCrossDomain=function(t){return!1}}function c(t,e){v(e,"result",t),b(W.authentication),U(R,"authentication.authenticate.success",[t]),N(R,function(){return setTimeout(function(){return z.close()},200)})}function f(t,e){v(e,"reason",t),b(W.authentication),U(R,"authentication.authenticate.failure",[t]),N(R,function(){return setTimeout(function(){return z.close()},200)})}function l(t){try{g&&g.successCallback&&g.successCallback(t)}finally{g=null,r()}}function h(t){try{g&&g.failureCallback&&g.failureCallback(t)}finally{g=null,r()}}function v(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=d(i.href,"result",n)),z.location.assign(d(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=d(i.href,"reason",n)),z.location.assign(d(i.href,"authFailure",""))))}}function d(t,e,n){var i=t.indexOf("#"),o=i===-1?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),t=i===-1?t:t.substr(0,i),t+o}var g,p;D["authentication.authenticate.success"]=l,D["authentication.authenticate.failure"]=h,t.registerAuthenticationHandlers=e,t.authenticate=n,t.getAuthToken=i,t.getUser=o,t.notifySuccess=c,t.notifyFailure=f}(it=t.authentication||(t.authentication={})),t.sendCustomMessage=A;var ot;!function(t){function e(t,e){b(W.content);var n=U(R,"tasks.startTask",[t]);Z[n]=e}function n(t,e){b(W.content,W.task),U(R,"tasks.submitTask",[t,Array.isArray(e)?e:[e]])}t.startTask=e,t.submitTask=n}(ot=t.tasks||(t.tasks={}))}(t||(t={})),t});
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.microsoftTeams=e()}(this,function(){String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var t;return function(t){"use strict";function e(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}function n(t){for(var n="",i=0;i<t.length;i++)n+=(0===i?"":"|")+e(t[i]);return new RegExp(n)}function i(){if(!Z){Z=!0,J=this._window||window;var t=function(t){return E(t)};K=J.parent!==J.self?J.parent:J.opener,K?J.addEventListener("message",t,!1):(tt=!0,window.onNativeMessage=S);try{X="*";var e=O(K,"initialize",[z]);ot[e]=function(t,e){q=t,G=e}}finally{X=null}this._uninitialize=function(){q&&(s(null),c(null),l(null)),q===j.settings&&ut.registerOnSaveHandler(null),q===j.remove&&ut.registerOnRemoveHandler(null),tt||J.removeEventListener("message",t,!1),Z=!1,K=null,X=null,et=[],Y=null,$=null,nt=[],it=0,ot={},q=null,G=null,tt=!1}}}function o(){at||(at=!0,I(),document.addEventListener("keydown",function(e){(e.ctrlKey||e.metaKey)&&80===e.keyCode&&(t.print(),e.cancelBubble=!0,e.preventDefault(),e.stopImmediatePropagation())}))}function a(){window.print()}function r(t){I();var e=O(K,"getContext");ot[e]=t}function s(t){I(),Q=t}function u(t){Q&&Q(t),Y&&O(Y,"themeChange",[t])}function c(t){I(),rt=t}function f(t){rt&&rt(t)}function l(t){I(),st=t}function h(){st&&st()||d()}function d(){I();var t=O(K,"navigateBack",[]);ot[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function v(t){I(j.content,j.settings,j.remove,j.task);var e=O(K,"navigateCrossDomain",[t]);ot[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}}function g(t,e){I();var n=O(K,"getTabInstances",[e]);ot[n]=t}function p(t,e){I();var n=O(K,"getUserJoinedTeams",[e]);ot[n]=t}function m(t,e){I();var n=O(K,"getMruTabInstances",[e]);ot[n]=t}function y(t){I(j.content),O(K,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function w(t){I(j.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];O(K,"openFilePreview",e)}function b(t){I(j.content);var e=[t.objectUrl,t.title];O(K,"downloadFile",e)}function k(t){I(j.content);var e=[t.message,t.isDownloadComplete];O(K,"showNotification",e)}function C(t){I();var e=O(K,"uploadCustomApp",[t]);ot[e]=function(t,e){if(!t)throw new Error(e)}}function T(t){I();var e=O(K,"navigateToTab",[t]);ot[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}}function I(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!Z)throw new Error("The library has not yet been initialized");if(q&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===q){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+q+"' context")}}function E(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===J||n!==J.location.origin&&!V.test(n.toLowerCase())||(M(e,n),e===K?S(t):e===Y&&N(t))}}function M(t,e){K&&t!==K?Y&&t!==Y||(Y=t,$=e):(K=t,X=e),K&&K.closed&&(K=null,X=null),Y&&Y.closed&&(Y=null,$=null),B(K),B(Y)}function S(t){if("id"in t.data){var e=t.data,n=ot[e.id];n&&(n.apply(null,e.args),delete ot[e.id])}else if("func"in t.data){var e=t.data,i=_[e.func];i&&i.apply(this,e.args)}}function N(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=_[e.func];if(n){var i=n.apply(this,e.args);i&&F(Y,e.id,Array.isArray(i)?i:[i])}else{var o=O(K,e.func,e.args);ot[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];Y&&F(Y,e.id,t)}}}}function U(t){return t===K?et:t===Y?nt:[]}function A(t){return t===K?X:t===Y?$:null}function B(t){for(var e=A(t),n=U(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function L(t,e){var n=J.setInterval(function(){0===U(t).length&&(clearInterval(n),e())},100)}function O(t,e,n){var i=D(e,n);if(tt)J&&J.nativeInterface&&J.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=A(t);t&&o?t.postMessage(i,o):U(t).push(i)}return i.id}function P(t,e){return I(),O(K,t,e)}function F(t,e,n){var i=H(e,n),o=A(t);t&&o&&t.postMessage(i,o)}function D(t,e){return{id:it++,func:t,args:e||[]}}function H(t,e){return{id:t,args:e||[]}}function x(t){I();var e=O(K,"getChatMembers");ot[e]=t}var W,z="1.3.6",R=["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local","https://msft.spoppe.com","https://*.sharepoint.com","https://*.sharepoint-df.com","https://*.sharepointonline.com","https://outlook.office.com","https://outlook-sdf.office.com"],V=n(R),_={},j={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){function e(t,e){I(),l=e,O(K,"setUpViews",[t])}function n(t){l&&l(t)||(I(),O(K,"viewConfigItemPress",[t]))}function i(t,e){I(),c=e,O(K,"setNavBarMenu",[t])}function o(t){c&&c(t)||(I(),O(K,"handleNavBarMenuItemPress",[t]))}function a(t,e){I(),f=e,O(K,"showActionMenu",[t])}function r(t){f&&f(t)||(I(),O(K,"handleActionMenuItemPress",[t]))}var s=function(){function t(){this.enabled=!0}return t}();t.MenuItem=s;var u;!function(t){t.dropDown="dropDown",t.popOver="popOver"}(u=t.MenuListType||(t.MenuListType={}));var c;_.navBarMenuItemPress=o;var f;_.actionMenuItemPress=r;var l;_.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=a}(W=t.menus||(t.menus={}));var J,K,X,Y,$,q,G,Q,Z=!1,tt=!1,et=[],nt=[],it=0,ot={},at=!1;_.themeChange=u;var rt;_.fullScreenChange=f;var st;_.backButtonPress=h,t.initialize=i,t.enablePrintCapability=o,t.print=a,t.getContext=r,t.registerOnThemeChangeHandler=s,t.registerFullScreenHandler=c,t.registerBackButtonHandler=l,t.navigateBack=d,t.navigateCrossDomain=v,t.getTabInstances=g,t.getUserJoinedTeams=p,t.getMruTabInstances=m,t.shareDeepLink=y,t.openFilePreview=w,t.downloadFile=b,t.showNotification=k,t.uploadCustomApp=C,t.navigateToTab=T;var ut;!function(t){function e(t){I(j.settings,j.remove),O(K,"settings.setValidityState",[t])}function n(t){I(j.settings,j.remove);var e=O(K,"settings.getSettings");ot[e]=t}function i(t){I(j.settings),O(K,"settings.setSettings",[t])}function o(t){I(j.settings),u=t}function a(t){I(j.remove),c=t}function r(t){var e=new f(t);u?u(e):e.notifySuccess()}function s(){var t=new l;c?c(t):t.notifySuccess()}var u,c;_["settings.save"]=r,_["settings.remove"]=s,t.setValidityState=e,t.getSettings=n,t.setSettings=i,t.registerOnSaveHandler=o,t.registerOnRemoveHandler=a;var f=function(){function t(t){this.notified=!1,this.result=t?t:{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),O(K,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),O(K,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}(),l=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),O(K,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),O(K,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(ut=t.settings||(t.settings={}));var ct;!function(t){function e(t){g=t}function n(t){var e=void 0!==t?t:g;if(I(j.content,j.settings,j.remove,j.task),"desktop"===G){var n=document.createElement("a");n.href=e.url;var i=O(K,"authentication.authenticate",[n.href,e.width,e.height]);ot[i]=function(t,n){t?e.successCallback(n):e.failureCallback(n)}}else r(e)}function i(t){I();var e=O(K,"authentication.getAuthToken",[t.resources]);ot[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function o(t){I();var e=O(K,"authentication.getUser");ot[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function a(){s();try{Y&&Y.close()}finally{Y=null,$=null}}function r(t){g=t,a();var e=g.width||600,n=g.height||400;e=Math.min(e,J.outerWidth-400),n=Math.min(n,J.outerHeight-200);var i=document.createElement("a");i.href=g.url;var o="undefined"!=typeof J.screenLeft?J.screenLeft:J.screenX,r="undefined"!=typeof J.screenTop?J.screenTop:J.screenY;o+=J.outerWidth/2-e/2,r+=J.outerHeight/2-n/2,Y=J.open(i.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+r+", left="+o+", width="+e+", height="+n),Y?u():h("FailedToOpenWindow")}function s(){p&&(clearInterval(p),p=0),delete _.initialize,delete _.navigateCrossDomain}function u(){s(),p=J.setInterval(function(){if(!Y||Y.closed)h("CancelledByUser");else{var t=$;try{$="*",O(Y,"ping")}finally{$=t}}},100),_.initialize=function(){return[j.authentication,G]},_.navigateCrossDomain=function(t){return!1}}function c(t,e){d(e,"result",t),I(j.authentication),O(K,"authentication.authenticate.success",[t]),L(K,function(){return setTimeout(function(){return J.close()},200)})}function f(t,e){d(e,"reason",t),I(j.authentication),O(K,"authentication.authenticate.failure",[t]),L(K,function(){return setTimeout(function(){return J.close()},200)})}function l(t){try{g&&g.successCallback&&g.successCallback(t)}finally{g=null,a()}}function h(t){try{g&&g.failureCallback&&g.failureCallback(t)}finally{g=null,a()}}function d(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=v(i.href,"result",n)),J.location.assign(v(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=v(i.href,"reason",n)),J.location.assign(v(i.href,"authFailure",""))))}}function v(t,e,n){var i=t.indexOf("#"),o=i===-1?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),t=i===-1?t:t.substr(0,i),t+o}var g,p;_["authentication.authenticate.success"]=l,_["authentication.authenticate.failure"]=h,t.registerAuthenticationHandlers=e,t.authenticate=n,t.getAuthToken=i,t.getUser=o,t.notifySuccess=c,t.notifyFailure=f}(ct=t.authentication||(t.authentication={})),t.sendCustomMessage=P;var ft;!function(t){function e(t,e){I(j.content);var n=O(K,"tasks.startTask",[t]);ot[n]=e}function n(t,e){I(j.content,j.task),O(K,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}t.startTask=e,t.submitTask=n}(ft=t.tasks||(t.tasks={})),t.getChatMembers=x}(t||(t={})),t});
{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "1.4.0-beta.0",
"version": "1.4.0-beta.1",
"description": "Microsoft Client SDK for building app for Microsoft teams",

@@ -47,2 +47,2 @@ "main": "./dist/MicrosoftTeams.min.js",

"files": ["dist/**", "README.md", "LICENSE"]
}
}

@@ -29,3 +29,3 @@ # [Microsoft Teams JavaScript Library](https://msdn.microsoft.com/en-us/microsoft-teams/)

You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.4.0-beta.0/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.

@@ -50,6 +50,6 @@ ## Usage

<!-- Microsoft Teams JavaScript API (via CDN) -->
<script src="https://unpkg.com/@microsoft/teams-js@1.4.0-beta.0/dist/MicrosoftTeams.min.js" integrity="sha384-iw3J1uu47cqIME8+X6wHhOShkDGmNMhNT05YvuuRFp1Jhkq7dJc6fyAK1ZGBHrPP" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js" integrity="sha384-bw/tQKCO7OgnYN29MFvAaRlOI7YaLpqeRtWhE//yfPA9pFx5THAydRA7o43Vt2JS" crossorigin="anonymous"></script>
<!-- Microsoft Teams JavaScript API (via npm) -->
<script src="node_modules/@microsoft/teams-js@1.4.0-beta.0/dist/MicrosoftTeams.min.js"></script>
<script src="node_modules/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js"></script>

@@ -56,0 +56,0 @@ <!-- Microsoft Teams JavaScript API (via local) -->

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc