Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
499
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.10 to 1.4.0-beta.11

dts/MicrosoftTeams.interface.d.ts

33

dist/MicrosoftTeams.js

@@ -131,3 +131,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

}
var version = "1.4.0-beta.10";
var version = "1.3.6";
var validOrigins = [

@@ -286,4 +286,2 @@ "https://teams.microsoft.com",

handlers["backButtonPress"] = handleBackButtonPress;
var beforeUnloadHandler;
handlers["beforeUnload"] = handleBeforeUnload;
/**

@@ -338,3 +336,2 @@ * Initializes the library. This must be called before any other SDK calls

registerBackButtonHandler(null);
registerBeforeUnloadHandler(null);
}

@@ -415,4 +412,2 @@ if (frameContext === frameContexts.settings) {

themeChangeHandler = handler;
handler &&
sendMessageRequest(parentWindow, "registerHandler", ["themeChange"]);
}

@@ -436,4 +431,2 @@ exports.registerOnThemeChangeHandler = registerOnThemeChangeHandler;

fullScreenChangeHandler = handler;
handler &&
sendMessageRequest(parentWindow, "registerHandler", ["fullScreen"]);
}

@@ -456,4 +449,2 @@ exports.registerFullScreenHandler = registerFullScreenHandler;

backButtonPressHandler = handler;
handler &&
sendMessageRequest(parentWindow, "registerHandler", ["backButton"]);
}

@@ -481,22 +472,2 @@ exports.registerBackButtonHandler = registerBackButtonHandler;

/**
* Registers a handler to be called before the page is unloaded.
* @param handler The handler to invoke before the page is unloaded. If this handler returns true the page should
* invoke the readyToUnload function provided to it once it's ready to be unloaded.
*/
function registerBeforeUnloadHandler(handler) {
ensureInitialized();
beforeUnloadHandler = handler;
handler &&
sendMessageRequest(parentWindow, "registerHandler", ["beforeUnload"]);
}
exports.registerBeforeUnloadHandler = registerBeforeUnloadHandler;
function handleBeforeUnload() {
var readyToUnload = function () {
sendMessageRequest(parentWindow, "readyToUnload", []);
};
if (!beforeUnloadHandler || !beforeUnloadHandler(readyToUnload)) {
readyToUnload();
}
}
/**
* Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the

@@ -732,3 +703,2 @@ * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be

saveHandler = handler;
handler && sendMessageRequest(parentWindow, "registerHandler", ["save"]);
}

@@ -746,3 +716,2 @@ settings.registerOnSaveHandler = registerOnSaveHandler;

removeHandler = handler;
handler && sendMessageRequest(parentWindow, "registerHandler", ["remove"]);
}

@@ -749,0 +718,0 @@ settings.registerOnRemoveHandler = registerOnRemoveHandler;

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("microsoftTeams",[],e):"object"==typeof exports?exports.microsoftTeams=e():t.microsoftTeams=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(1))},function(t,e,n){"use strict";var i=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var o="1.4.0-beta.10";function r(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}var a=function(t){for(var e="",n=0;n<t.length;n++)e+=(0===n?"":"|")+r(t[n]);return new RegExp(e)}(["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"]),s={},u={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){var e,n,i,o=function(){return function(){this.enabled=!0}}();t.MenuItem=o,function(t){t.dropDown="dropDown",t.popOver="popOver"}(t.MenuListType||(t.MenuListType={})),s.navBarMenuItemPress=function(t){e&&e(t)||(H(),F(f,"handleNavBarMenuItemPress",[t]))},s.actionMenuItemPress=function(t){n&&n(t)||(H(),F(f,"handleActionMenuItemPress",[t]))},s.setModuleView=function(t){i&&i(t)||(H(),F(f,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){H(),i=e,F(f,"setUpViews",[t])},t.setNavBarMenu=function(t,n){H(),e=n,F(f,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){H(),n=e,F(f,"showActionMenu",[t])}}(e.menus||(e.menus={}));var c,f,l,d,h,p,v,g,m,y,b,w,k=!1,T=!1,C=[],O=[],M=0,S={},E=!1;function I(){window.print()}function P(t){H(),g=t,t&&F(f,"registerHandler",["themeChange"])}function x(t){H(),m=t,t&&F(f,"registerHandler",["fullScreen"])}function N(t){H(),y=t,t&&F(f,"registerHandler",["backButton"])}function U(){H();var t=F(f,"navigateBack",[]);S[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function j(t){H(),b=t,t&&F(f,"registerHandler",["beforeUnload"])}function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!k)throw new Error("The library has not yet been initialized");if(p&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===p){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+p+"' context")}}function _(t){if("id"in t.data){var e=t.data,n=S[e.id];n&&(n.apply(null,e.args),delete S[e.id])}else if("func"in t.data){e=t.data;var i=s[e.func];i&&i.apply(this,e.args)}}function B(t){return t===f?C:t===d?O:[]}function L(t){return t===f?l:t===d?h:null}function A(t){for(var e=L(t),n=B(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function D(t,e){var n=c.setInterval(function(){0===B(t).length&&(clearInterval(n),e())},100)}function F(t,e,n){var i=function(t,e){return{id:M++,func:t,args:e||[]}}(e,n);if(T)c&&c.nativeInterface&&c.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=L(t);t&&o?t.postMessage(i,o):B(t).push(i)}return i.id}function z(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=L(t);t&&o&&t.postMessage(i,o)}s.themeChange=function(t){g&&g(t);d&&F(d,"themeChange",[t])},s.fullScreenChange=function(t){m&&m(t)},s.backButtonPress=function(){y&&y()||U()},s.beforeUnload=function(){var t=function(){F(f,"readyToUnload",[])};b&&b(t)||t()},e.initialize=function(t){if(void 0===t&&(t=window),!k){k=!0;var e=function(t){return function(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===c||n!==c.location.origin&&!a.test(n.toLowerCase())||(function(t,e){f&&t!==f?d&&t!==d||(d=t,h=e):(f=t,l=e),f&&f.closed&&(f=null,l=null),d&&d.closed&&(d=null,h=null),A(f),A(d)}(e,n),e===f?_(t):e===d&&function(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=s[e.func];if(n){var i=n.apply(this,e.args);i&&z(d,e.id,Array.isArray(i)?i:[i])}else{var o=F(f,e.func,e.args);S[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];d&&z(d,e.id,t)}}}}(t))}}(t)};(f=(c=t).parent!==c.self?c.parent:c.opener)?c.addEventListener("message",e,!1):(T=!0,window.onNativeMessage=_);try{l="*";var n=F(f,"initialize",[o]);S[n]=function(t,e){p=t,v=e}}finally{l=null}this._uninitialize=function(){p&&(P(null),x(null),N(null),j(null)),p===u.settings&&w.registerOnSaveHandler(null),p===u.remove&&w.registerOnRemoveHandler(null),T||c.removeEventListener("message",e,!1),k=!1,f=null,l=null,C=[],d=null,h=null,O=[],M=0,S={},p=null,v=null,T=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,H(),document.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&80===t.keyCode&&(I(),t.cancelBubble=!0,t.preventDefault(),t.stopImmediatePropagation())}))},e.print=I,e.getContext=function(t){H();var e=F(f,"getContext");S[e]=t},e.registerOnThemeChangeHandler=P,e.registerFullScreenHandler=x,e.registerBackButtonHandler=N,e.navigateBack=U,e.registerBeforeUnloadHandler=j,e.navigateCrossDomain=function(t){H(u.content,u.settings,u.remove,u.task);var e=F(f,"navigateCrossDomain",[t]);S[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}},e.getTabInstances=function(t,e){H();var n=F(f,"getTabInstances",[e]);S[n]=t},e.getUserJoinedTeams=function(t,e){H();var n=F(f,"getUserJoinedTeams",[e]);S[n]=t},e.getMruTabInstances=function(t,e){H();var n=F(f,"getMruTabInstances",[e]);S[n]=t},e.shareDeepLink=function(t){H(u.content),F(f,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},e.openFilePreview=function(t){H(u.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];F(f,"openFilePreview",e)},e.showNotification=function(t){H(u.content);var e=[t.message,t.notificationType];F(f,"showNotification",e)},e.executeDeepLink=function(t){H(u.content);var e=F(f,"executeDeepLink",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){H();var e=F(f,"uploadCustomApp",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){H();var e=F(f,"navigateToTab",[t]);S[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n;s["settings.save"]=function(t){var n=new i(t);e?e(n):n.notifySuccess()},s["settings.remove"]=function(){var t=new o;n?n(t):t.notifySuccess()},t.setValidityState=function(t){H(u.settings,u.remove),F(f,"settings.setValidityState",[t])},t.getSettings=function(t){H(u.content,u.settings,u.remove);var e=F(f,"settings.getSettings");S[e]=t},t.setSettings=function(t){H(u.content,u.settings);var e=F(f,"settings.setSettings",[t]);S[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){H(u.settings),e=t,t&&F(f,"registerHandler",["save"])},t.registerOnRemoveHandler=function(t){H(u.remove),n=t,t&&F(f,"registerHandler",["remove"])};var i=function(){function t(t){this.notified=!1,this.result=t||{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),F(f,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),F(f,"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}();var o=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),F(f,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),F(f,"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}()}(w=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{d&&d.close()}finally{d=null,h=null}}function o(){n&&(clearInterval(n),n=0),delete s.initialize,delete s.navigateCrossDomain}function r(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function a(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=l(i.href,"result",n)),c.location.assign(l(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=l(i.href,"reason",n)),c.location.assign(l(i.href,"authFailure",""))))}}function l(t,e,n){var i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}s["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},s["authentication.authenticate.failure"]=r,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){var a=void 0!==t?t:e;if(H(u.content,u.settings,u.remove,u.task),"desktop"===v||"android"===v||"ios"===v){var l=document.createElement("a");l.href=a.url;var p=F(f,"authentication.authenticate",[l.href,a.width,a.height]);S[p]=function(t,e){t?a.successCallback(e):a.failureCallback(e)}}else!function(t){e=t,i();var a=e.width||600,f=e.height||400;a=Math.min(a,c.outerWidth-400),f=Math.min(f,c.outerHeight-200);var l=document.createElement("a");l.href=e.url;var p=void 0!==c.screenLeft?c.screenLeft:c.screenX,g=void 0!==c.screenTop?c.screenTop:c.screenY;p+=c.outerWidth/2-a/2,g+=c.outerHeight/2-f/2,(d=c.open(l.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+g+", left="+p+", width="+a+", height="+f))?(o(),n=c.setInterval(function(){if(!d||d.closed)r("CancelledByUser");else{var t=h;try{h="*",F(d,"ping")}finally{h=t}}},100),s.initialize=function(){return[u.authentication,v]},s.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(a)},t.getAuthToken=function(t){H();var e=F(f,"authentication.getAuthToken",[t.resources]);S[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){H();var e=F(f,"authentication.getUser");S[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){a(e,"result",t),H(u.authentication),F(f,"authentication.authenticate.success",[t]),D(f,function(){return setTimeout(function(){return c.close()},200)})},t.notifyFailure=function(t,e){a(e,"reason",t),H(u.authentication),F(f,"authentication.authenticate.failure",[t]),D(f,function(){return setTimeout(function(){return c.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return H(),F(f,t,e)},function(t){t.startTask=function(t,e){H(u.content);var n=F(f,"tasks.startTask",[t]);S[n]=e},t.updateTask=function(t){H(u.content,u.task),t.width,t.height;var e=i(t,["width","height"]);if(Object.keys(e).length)throw new Error("updateTask requires a taskInfo argument containing only width and height");F(f,"tasks.updateTask",[t])},t.submitTask=function(t,e){H(u.content,u.task),F(f,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){H();var e=F(f,"getChatMembers");S[e]=t}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("microsoftTeams",[],e):"object"==typeof exports?exports.microsoftTeams=e():t.microsoftTeams=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(1))},function(t,e,n){"use strict";var i=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var o="1.3.6";function r(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}var a=function(t){for(var e="",n=0;n<t.length;n++)e+=(0===n?"":"|")+r(t[n]);return new RegExp(e)}(["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"]),s={},u={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};!function(t){var e,n,i,o=function(){return function(){this.enabled=!0}}();t.MenuItem=o,function(t){t.dropDown="dropDown",t.popOver="popOver"}(t.MenuListType||(t.MenuListType={})),s.navBarMenuItemPress=function(t){e&&e(t)||(j(),D(f,"handleNavBarMenuItemPress",[t]))},s.actionMenuItemPress=function(t){n&&n(t)||(j(),D(f,"handleActionMenuItemPress",[t]))},s.setModuleView=function(t){i&&i(t)||(j(),D(f,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){j(),i=e,D(f,"setUpViews",[t])},t.setNavBarMenu=function(t,n){j(),e=n,D(f,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){j(),n=e,D(f,"showActionMenu",[t])}}(e.menus||(e.menus={}));var c,f,l,h,d,p,v,g,m,y,b,w=!1,k=!1,T=[],C=[],O=0,M={},E=!1;function S(){window.print()}function I(t){j(),g=t}function P(t){j(),m=t}function x(t){j(),y=t}function N(){j();var t=D(f,"navigateBack",[]);M[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function j(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!w)throw new Error("The library has not yet been initialized");if(p&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===p){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+p+"' context")}}function _(t){if("id"in t.data){var e=t.data,n=M[e.id];n&&(n.apply(null,e.args),delete M[e.id])}else if("func"in t.data){e=t.data;var i=s[e.func];i&&i.apply(this,e.args)}}function U(t){return t===f?T:t===h?C:[]}function L(t){return t===f?l:t===h?d:null}function A(t){for(var e=L(t),n=U(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function B(t,e){var n=c.setInterval(function(){0===U(t).length&&(clearInterval(n),e())},100)}function D(t,e,n){var i=function(t,e){return{id:O++,func:t,args:e||[]}}(e,n);if(k)c&&c.nativeInterface&&c.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=L(t);t&&o?t.postMessage(i,o):U(t).push(i)}return i.id}function H(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=L(t);t&&o&&t.postMessage(i,o)}s.themeChange=function(t){g&&g(t);h&&D(h,"themeChange",[t])},s.fullScreenChange=function(t){m&&m(t)},s.backButtonPress=function(){y&&y()||N()},e.initialize=function(t){if(void 0===t&&(t=window),!w){w=!0;var e=function(t){return function(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===c||n!==c.location.origin&&!a.test(n.toLowerCase())||(function(t,e){f&&t!==f?h&&t!==h||(h=t,d=e):(f=t,l=e),f&&f.closed&&(f=null,l=null),h&&h.closed&&(h=null,d=null),A(f),A(h)}(e,n),e===f?_(t):e===h&&function(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=s[e.func];if(n){var i=n.apply(this,e.args);i&&H(h,e.id,Array.isArray(i)?i:[i])}else{var o=D(f,e.func,e.args);M[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];h&&H(h,e.id,t)}}}}(t))}}(t)};(f=(c=t).parent!==c.self?c.parent:c.opener)?c.addEventListener("message",e,!1):(k=!0,window.onNativeMessage=_);try{l="*";var n=D(f,"initialize",[o]);M[n]=function(t,e){p=t,v=e}}finally{l=null}this._uninitialize=function(){p&&(I(null),P(null),x(null)),p===u.settings&&b.registerOnSaveHandler(null),p===u.remove&&b.registerOnRemoveHandler(null),k||c.removeEventListener("message",e,!1),w=!1,f=null,l=null,T=[],h=null,d=null,C=[],O=0,M={},p=null,v=null,k=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,j(),document.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&80===t.keyCode&&(S(),t.cancelBubble=!0,t.preventDefault(),t.stopImmediatePropagation())}))},e.print=S,e.getContext=function(t){j();var e=D(f,"getContext");M[e]=t},e.registerOnThemeChangeHandler=I,e.registerFullScreenHandler=P,e.registerBackButtonHandler=x,e.navigateBack=N,e.navigateCrossDomain=function(t){j(u.content,u.settings,u.remove,u.task);var e=D(f,"navigateCrossDomain",[t]);M[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}},e.getTabInstances=function(t,e){j();var n=D(f,"getTabInstances",[e]);M[n]=t},e.getUserJoinedTeams=function(t,e){j();var n=D(f,"getUserJoinedTeams",[e]);M[n]=t},e.getMruTabInstances=function(t,e){j();var n=D(f,"getMruTabInstances",[e]);M[n]=t},e.shareDeepLink=function(t){j(u.content),D(f,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},e.openFilePreview=function(t){j(u.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];D(f,"openFilePreview",e)},e.showNotification=function(t){j(u.content);var e=[t.message,t.notificationType];D(f,"showNotification",e)},e.executeDeepLink=function(t){j(u.content);var e=D(f,"executeDeepLink",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){j();var e=D(f,"uploadCustomApp",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){j();var e=D(f,"navigateToTab",[t]);M[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n;s["settings.save"]=function(t){var n=new i(t);e?e(n):n.notifySuccess()},s["settings.remove"]=function(){var t=new o;n?n(t):t.notifySuccess()},t.setValidityState=function(t){j(u.settings,u.remove),D(f,"settings.setValidityState",[t])},t.getSettings=function(t){j(u.content,u.settings,u.remove);var e=D(f,"settings.getSettings");M[e]=t},t.setSettings=function(t){j(u.content,u.settings);var e=D(f,"settings.setSettings",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){j(u.settings),e=t},t.registerOnRemoveHandler=function(t){j(u.remove),n=t};var i=function(){function t(t){this.notified=!1,this.result=t||{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),D(f,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),D(f,"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}();var o=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),D(f,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),D(f,"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}()}(b=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{h&&h.close()}finally{h=null,d=null}}function o(){n&&(clearInterval(n),n=0),delete s.initialize,delete s.navigateCrossDomain}function r(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function a(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=l(i.href,"result",n)),c.location.assign(l(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=l(i.href,"reason",n)),c.location.assign(l(i.href,"authFailure",""))))}}function l(t,e,n){var i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}s["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},s["authentication.authenticate.failure"]=r,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){var a=void 0!==t?t:e;if(j(u.content,u.settings,u.remove,u.task),"desktop"===v||"android"===v||"ios"===v){var l=document.createElement("a");l.href=a.url;var p=D(f,"authentication.authenticate",[l.href,a.width,a.height]);M[p]=function(t,e){t?a.successCallback(e):a.failureCallback(e)}}else!function(t){e=t,i();var a=e.width||600,f=e.height||400;a=Math.min(a,c.outerWidth-400),f=Math.min(f,c.outerHeight-200);var l=document.createElement("a");l.href=e.url;var p=void 0!==c.screenLeft?c.screenLeft:c.screenX,g=void 0!==c.screenTop?c.screenTop:c.screenY;p+=c.outerWidth/2-a/2,g+=c.outerHeight/2-f/2,(h=c.open(l.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+g+", left="+p+", width="+a+", height="+f))?(o(),n=c.setInterval(function(){if(!h||h.closed)r("CancelledByUser");else{var t=d;try{d="*",D(h,"ping")}finally{d=t}}},100),s.initialize=function(){return[u.authentication,v]},s.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(a)},t.getAuthToken=function(t){j();var e=D(f,"authentication.getAuthToken",[t.resources]);M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){j();var e=D(f,"authentication.getUser");M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){a(e,"result",t),j(u.authentication),D(f,"authentication.authenticate.success",[t]),B(f,function(){return setTimeout(function(){return c.close()},200)})},t.notifyFailure=function(t,e){a(e,"reason",t),j(u.authentication),D(f,"authentication.authenticate.failure",[t]),B(f,function(){return setTimeout(function(){return c.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return j(),D(f,t,e)},function(t){t.startTask=function(t,e){j(u.content);var n=D(f,"tasks.startTask",[t]);M[n]=e},t.updateTask=function(t){j(u.content,u.task),t.width,t.height;var e=i(t,["width","height"]);if(Object.keys(e).length)throw new Error("updateTask requires a taskInfo argument containing only width and height");D(f,"tasks.updateTask",[t])},t.submitTask=function(t,e){j(u.content,u.task),D(f,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){j();var e=D(f,"getChatMembers");M[e]=t}}])});
export * from "./MicrosoftTeams";

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

import { PageContext } from "@microsoft/sp-page-context";
export declare const enum HostClientType {

@@ -324,8 +325,2 @@ desktop = "desktop",

/**
* Registers a handler to be called before the page is unloaded.
* @param handler The handler to invoke before the page is unloaded. If this handler returns true the page should
* invoke the readyToUnload function provided to it once it's ready to be unloaded.
*/
export declare function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
/**
* Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the

@@ -800,3 +795,3 @@ * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be

*/
sharepoint?: any;
sharepoint?: PageContext;
/**

@@ -803,0 +798,0 @@ * The type of license for the current users tenant.

{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "1.4.0-beta.10",
"version": "1.4.0-beta.11",
"description": "Microsoft Client SDK for building app for Microsoft teams",

@@ -48,3 +48,6 @@ "main": "./dist/MicrosoftTeams.min.js",

]
},
"dependencies": {
"@microsoft/sp-page-context": "^1.7.1"
}
}
}

@@ -30,3 +30,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.10/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.

@@ -51,6 +51,6 @@ ## Usage

<!-- Microsoft Teams JavaScript API (via CDN) -->
<script src="https://unpkg.com/@microsoft/teams-js@1.4.0-beta.10/dist/MicrosoftTeams.min.js" integrity="sha384-khCYPJs7xwzsgVJf0UOV38mpd+RieZ+tq9axu8z9IcoiHgiPbdmP3bZQ+PantdhU" 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.10/dist/MicrosoftTeams.min.js"></script>
<script src="node_modules/@microsoft/teams-js@1.3.6/dist/MicrosoftTeams.min.js"></script>

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

Sorry, the diff of this file is not supported yet

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