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.3.0-beta.6 to 1.3.1

60

dist/MicrosoftTeams.d.ts

@@ -223,2 +223,50 @@

}
/**
* Query parameters used when fetching team information
*/
interface TeamInstanceParameters {
/**
* Flag allowing to select favorite teams only
*/
favoriteTeamsOnly?: boolean;
}
/**
* Information on userJoined Teams
*/
interface UserJoinedTeamsInformation {
/**
* List of team information
*/
userJoinedTeams: TeamInformation[];
}
/**
* Represends Team Information
*/
interface TeamInformation {
/**
* Id of the team
*/
teamId: string;
/**
* Team display name
*/
teamName: string;
/**
* Team description
*/
teamDescription?: string;
/**
* Thumbnail Uri
*/
thumbnailUri?: string;
/**
* The Office 365 group ID for the team with which the content is associated.
* This field is available only when the identity permission is requested in the manifest.
*/
groupId?: string;
/**
* Role of current user in the team
*/
userTeamRole?: UserTeamRole;
}
const enum TaskModuleDimension {

@@ -281,2 +329,11 @@ Large = "large",

/**
* @private
* Hide from docs.
* ------
* Allows an app to retrieve information of all user joined teams
* @param callback The callback to invoke when the {@link TeamInstanceParameters} object is retrieved.
* @param teamInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams
*/
function getUserJoinedTeams(callback: (userJoinedTeamsInformation: UserJoinedTeamsInformation) => void, teamInstanceParameters?: TeamInstanceParameters): void;
/**
* Allows an app to retrieve the most recently used tabs for this user.

@@ -293,2 +350,5 @@ * @param callback The callback to invoke when the {@link TabInformation} object is retrieved.

/**
* @private
* Hide from docs.
* ------
* Opens a client-friendly preview of the specified file.

@@ -295,0 +355,0 @@ * @param file The file to preview.

24

dist/MicrosoftTeams.js

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

"use strict";
var version = "1.2";
var version = "1.3.1";
var validOrigins = [

@@ -40,3 +40,4 @@ "https://teams.microsoft.com",

for (var j = 0; j < urlParts.length; j++) {
urlRegExpPart += (j > 0 ? "[.]" : "") + urlParts[j].replace("*", "[^\/^.]+");
urlRegExpPart +=
(j > 0 ? "[.]" : "") + urlParts[j].replace("*", "[^/^.]+");
}

@@ -359,2 +360,18 @@ urlRegExpPart += "$";

/**
* @private
* Hide from docs.
* ------
* Allows an app to retrieve information of all user joined teams
* @param callback The callback to invoke when the {@link TeamInstanceParameters} object is retrieved.
* @param teamInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams
*/
function getUserJoinedTeams(callback, teamInstanceParameters) {
ensureInitialized();
var messageId = sendMessageRequest(parentWindow, "getUserJoinedTeams", [
teamInstanceParameters
]);
callbacks[messageId] = callback;
}
microsoftTeams.getUserJoinedTeams = getUserJoinedTeams;
/**
* Allows an app to retrieve the most recently used tabs for this user.

@@ -386,2 +403,5 @@ * @param callback The callback to invoke when the {@link TabInformation} object is retrieved.

/**
* @private
* Hide from docs.
* ------
* Opens a client-friendly preview of the specified file.

@@ -388,0 +408,0 @@ * @param file The file to preview.

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(!Y){Y=!0,W=this._window||window;var t=function(t){return b(t)};z=W.parent!==W.self?W.parent:W.opener,z?W.addEventListener("message",t,!1):($=!0,window.onNativeMessage=T);try{R="*";var e=N(z,"initialize",[L]);Q[e]=function(t,e){j=t,J=e}}finally{R=null}this._uninitialize=function(){j&&(r(null),s(null),c(null)),j===F.settings&&et.registerOnSaveHandler(null),j===F.remove&&et.registerOnRemoveHandler(null),$||W.removeEventListener("message",t,!1),Y=!1,z=null,R=null,q=[],V=null,_=null,G=[],K=0,Q={},j=null,J=null,$=!1}}}function o(t){w();var e=N(z,"getContext");Q[e]=t}function r(t){w(),X=t}function a(t){X&&X(t),V&&N(V,"themeChange",[t])}function s(t){w(),Z=t}function u(t){Z&&Z(t)}function c(t){w(),tt=t}function f(){tt&&tt()||l()}function l(){w();var t=N(z,"navigateBack",[]);Q[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function h(t){w(F.content,F.settings,F.remove);var e=N(z,"navigateCrossDomain",[t]);Q[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){w();var n=N(z,"getTabInstances",[e]);Q[n]=t}function d(t,e){w();var n=N(z,"getMruTabInstances",[e]);Q[n]=t}function g(t){w(F.content),N(z,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function p(t){w(F.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];N(z,"openFilePreview",e)}function m(t){w();var e=N(z,"uploadCustomApp",[t]);Q[e]=function(t,e){if(!t)throw new Error(e)}}function y(t){w();var e=N(z,"navigateToTab",[t]);Q[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}}function w(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!Y)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 b(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===W||n!==W.location.origin&&!P.test(n.toLowerCase())||(k(e,n),e===z?T(t):e===V&&C(t))}}function k(t,e){z&&t!==z?V&&t!==V||(V=t,_=e):(z=t,R=e),z&&z.closed&&(z=null,R=null),V&&V.closed&&(V=null,_=null),M(z),M(V)}function T(t){if("id"in t.data){var e=t.data,n=Q[e.id];n&&(n.apply(null,e.args),delete Q[e.id])}else if("func"in t.data){var e=t.data,i=x[e.func];i&&i.apply(this,e.args)}}function C(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=x[e.func];if(n){var i=n.apply(this,e.args);i&&U(V,e.id,Array.isArray(i)?i:[i])}else{var o=N(z,e.func,e.args);Q[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];V&&U(V,e.id,t)}}}}function I(t){return t===z?q:t===V?G:[]}function E(t){return t===z?R:t===V?_:null}function M(t){for(var e=E(t),n=I(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function S(t,e){var n=W.setInterval(function(){0===I(t).length&&(clearInterval(n),e())},100)}function N(t,e,n){var i=H(e,n);if($)W&&W.nativeInterface&&W.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=E(t);t&&o?t.postMessage(i,o):I(t).push(i)}return i.id}function U(t,e,n){var i=O(e,n),o=E(t);t&&o&&t.postMessage(i,o)}function H(t,e){return{id:K++,func:t,args:e||[]}}function O(t,e){return{id:t,args:e||[]}}var B,L="1.2",A=["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"],P=n(A),x={},F={settings:"settings",content:"content",authentication:"authentication",remove:"remove"};!function(t){t.desktop="desktop",t.web="web",t.android="android",t.ios="ios"}(B=t.HostClientTypes||(t.HostClientTypes={}));var D;!function(t){function e(t,e){w(),l=e,N(z,"setUpViews",[t])}function n(t){l&&l(t)||(w(),N(z,"viewConfigItemPress",[t]))}function i(t,e){w(),c=e,N(z,"setNavBarMenu",[t])}function o(t){c&&c(t)||(w(),N(z,"handleNavBarMenuItemPress",[t]))}function r(t,e){w(),f=e,N(z,"showActionMenu",[t])}function a(t){f&&f(t)||(w(),N(z,"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;x.navBarMenuItemPress=o;var f;x.actionMenuItemPress=a;var l;x.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=r}(D=t.menus||(t.menus={}));var W,z,R,V,_,j,J,X,Y=!1,$=!1,q=[],G=[],K=0,Q={};x.themeChange=a;var Z;x.fullScreenChange=u;var tt;x.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.getMruTabInstances=d,t.shareDeepLink=g,t.openFilePreview=p,t.uploadCustomApp=m,t.navigateToTab=y;var et;!function(t){function e(t){w(F.settings,F.remove),N(z,"settings.setValidityState",[t])}function n(t){w(F.settings,F.remove);var e=N(z,"settings.getSettings");Q[e]=t}function i(t){w(F.settings),N(z,"settings.setSettings",[t])}function o(t){w(F.settings),u=t}function r(t){w(F.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;x["settings.save"]=a,x["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(),N(z,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),N(z,"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(),N(z,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),N(z,"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}()}(et=t.settings||(t.settings={}));var nt;!function(t){function e(t){g=t}function n(t){var e=void 0!==t?t:g;if(w(F.content,F.settings,F.remove),J===B.desktop){var n=document.createElement("a");n.href=e.url;var i=N(z,"authentication.authenticate",[n.href,e.width,e.height]);Q[i]=function(t,n){t?e.successCallback(n):e.failureCallback(n)}}else a(e)}function i(t){w();var e=N(z,"authentication.getAuthToken",[t.resources]);Q[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function o(t){w();var e=N(z,"authentication.getUser");Q[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function r(){s();try{V&&V.close()}finally{V=null,_=null}}function a(t){g=t,r();var e=g.width||600,n=g.height||400;e=Math.min(e,W.outerWidth-400),n=Math.min(n,W.outerHeight-200);var i=document.createElement("a");i.href=g.url;var o="undefined"!=typeof W.screenLeft?W.screenLeft:W.screenX,a="undefined"!=typeof W.screenTop?W.screenTop:W.screenY;o+=W.outerWidth/2-e/2,a+=W.outerHeight/2-n/2,V=W.open(i.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+a+", left="+o+", width="+e+", height="+n),V?u():h("FailedToOpenWindow")}function s(){p&&(clearInterval(p),p=0),delete x.initialize,delete x.navigateCrossDomain}function u(){s(),p=W.setInterval(function(){if(!V||V.closed)h("CancelledByUser");else{var t=_;try{_="*",N(V,"ping")}finally{_=t}}},100),x.initialize=function(){return[F.authentication,J]},x.navigateCrossDomain=function(t){return!1}}function c(t,e){v(e,"result",t),w(F.authentication),N(z,"authentication.authenticate.success",[t]),S(z,function(){return setTimeout(function(){return W.close()},200)})}function f(t,e){v(e,"reason",t),w(F.authentication),N(z,"authentication.authenticate.failure",[t]),S(z,function(){return setTimeout(function(){return W.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)),W.location.assign(d(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=d(i.href,"reason",n)),W.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;x["authentication.authenticate.success"]=l,x["authentication.authenticate.failure"]=h,t.registerAuthenticationHandlers=e,t.authenticate=n,t.getAuthToken=i,t.getUser=o,t.notifySuccess=c,t.notifyFailure=f}(nt=t.authentication||(t.authentication={}));var it;!function(t){function e(t,e){w(F.content);var n=N(z,"tasks.startTask",[t]);Q[n]=e}function n(t,e){w(F.content),N(z,"tasks.completeTask",[t,e])}t.startTask=e,t.completeTask=n}(it=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(!$){$=!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",[A]);Z[e]=function(t,e){J=t,X=e}}finally{V=null}this._uninitialize=function(){J&&(r(null),s(null),c(null)),J===D.settings&&nt.registerOnSaveHandler(null),J===D.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(D.content,D.settings,D.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 d(t,e){b();var n=U(R,"getTabInstances",[e]);Z[n]=t}function v(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(D.content),U(R,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function m(t){b(D.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&&!x.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=F[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=F[e.func];if(n){var i=n.apply(this,e.args);i&&H(_,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];_&&H(_,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=O(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 H(t,e,n){var i=B(e,n),o=M(t);t&&o&&t.postMessage(i,o)}function O(t,e){return{id:Q++,func:t,args:e||[]}}function B(t,e){return{id:t,args:e||[]}}var L,A="1.3.1",P=["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"],x=n(P),F={},D={settings:"settings",content:"content",authentication:"authentication",remove:"remove"};!function(t){t.desktop="desktop",t.web="web",t.android="android",t.ios="ios"}(L=t.HostClientTypes||(t.HostClientTypes={}));var W;!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;F.navBarMenuItemPress=o;var f;F.actionMenuItemPress=a;var l;F.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=r}(W=t.menus||(t.menus={}));var z,R,V,_,j,J,X,Y,$=!1,q=!1,G=[],K=[],Q=0,Z={};F.themeChange=a;var tt;F.fullScreenChange=u;var et;F.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=d,t.getUserJoinedTeams=v,t.getMruTabInstances=g,t.shareDeepLink=p,t.openFilePreview=m,t.uploadCustomApp=y,t.navigateToTab=w;var nt;!function(t){function e(t){b(D.settings,D.remove),U(R,"settings.setValidityState",[t])}function n(t){b(D.settings,D.remove);var e=U(R,"settings.getSettings");Z[e]=t}function i(t){b(D.settings),U(R,"settings.setSettings",[t])}function o(t){b(D.settings),u=t}function r(t){b(D.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;F["settings.save"]=a,F["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(D.content,D.settings,D.remove),X===L.desktop){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 F.initialize,delete F.navigateCrossDomain}function u(){s(),p=z.setInterval(function(){if(!_||_.closed)h("CancelledByUser");else{var t=j;try{j="*",U(_,"ping")}finally{j=t}}},100),F.initialize=function(){return[D.authentication,X]},F.navigateCrossDomain=function(t){return!1}}function c(t,e){d(e,"result",t),b(D.authentication),U(R,"authentication.authenticate.success",[t]),N(R,function(){return setTimeout(function(){return z.close()},200)})}function f(t,e){d(e,"reason",t),b(D.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 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)),z.location.assign(v(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=v(i.href,"reason",n)),z.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;F["authentication.authenticate.success"]=l,F["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={}));var ot;!function(t){function e(t,e){b(D.content);var n=U(R,"tasks.startTask",[t]);Z[n]=e}function n(t,e){b(D.content),U(R,"tasks.completeTask",[t,e])}t.startTask=e,t.completeTask=n}(ot=t.tasks||(t.tasks={}))}(t||(t={})),t});
{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "1.3.0-beta.6",
"version": "1.3.1",
"description": "Microsoft Client SDK for building app for Microsoft teams",

@@ -24,4 +24,4 @@ "main": "./dist/MicrosoftTeams.min.js",

"gulp-deploy-azure-cdn": "^2.0.0",
"gulp-header": "2.0.5",
"gulp-prettier-plugin": "^1.3.0",
"gulp-header": "2.0.5",
"gulp-rename": "1.2.2",

@@ -36,2 +36,4 @@ "gulp-tslint": "^8.1.2",

"karma": "1.3.0",
"karma-coverage": "1.1.2",
"karma-coveralls": "2.0.0",
"karma-jasmine": "1.0.2",

@@ -46,7 +48,3 @@ "karma-phantomjs-launcher": "1.0.2",

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

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

[![Build Status](https://travis-ci.org/OfficeDev/microsoft-teams-library-js.svg?branch=master)](https://travis-ci.org/OfficeDev/microsoft-teams-library-js)
[![Coverage Status](https://coveralls.io/repos/github/OfficeDev/microsoft-teams-library-js/badge.svg?branch=master)](https://coveralls.io/github/OfficeDev/microsoft-teams-library-js?branch=master)
## Getting Started
1. Clone the repo
2. Navigate to the repo root
3. `yarn install`
4. `gulp`
1. Clone the repo
2. Navigate to the repo root
3. `yarn install`
4. `gulp`
### Installation
To install the stable version:

@@ -27,3 +30,3 @@

You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.2.5/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.1/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.

@@ -39,3 +42,3 @@ ## Usage

```typescript
import * as microsoftTeams from '@microsoft/teams-js';
import * as microsoftTeams from "@microsoft/teams-js";
```

@@ -46,8 +49,9 @@

Reference the library inside of your `.html` page using:
```html
<!-- Microsoft Teams JavaScript API (via CDN) -->
<script src="https://unpkg.com/@microsoft/teams-js@1.2.5/dist/MicrosoftTeams.min.js" integrity="sha384-fTjWNTelhUDsOG+6Xvsly5BVO8estmdrfVmaRQuTGRTtcjHYA3oQANo805/kHXvJ" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@microsoft/teams-js@1.3.1/dist/MicrosoftTeams.min.js" integrity="sha384-W0C47hvPMATrTnRWRl+rY3zESt3SJ7h5GnvMQx9wSgH44X2Xh5gieJ2hAXVeKSlo" crossorigin="anonymous"></script>
<!-- Microsoft Teams JavaScript API (via npm) -->
<script src="node_modules/@microsoft/teams-js@1.2.5/dist/MicrosoftTeams.min.js"></script>
<script src="node_modules/@microsoft/teams-js@1.3.1/dist/MicrosoftTeams.min.js"></script>

@@ -59,6 +63,7 @@ <!-- Microsoft Teams JavaScript API (via local) -->

## Contributing
We strongly welcome and encourage contributions to this project. Please read the [contributor's guide](CONTRIBUTING.md).
- - -
---
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

Sorry, the diff of this file is not supported yet

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