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.9 to 1.4.0-beta.10

63

dist/MicrosoftTeams.js

@@ -116,2 +116,11 @@ (function webpackUniversalModuleDefinition(root, factory) {

var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -123,3 +132,3 @@ if (!String.prototype.startsWith) {

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

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

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

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

registerBackButtonHandler(null);
registerBeforeUnloadHandler(null);
}

@@ -404,2 +416,4 @@ if (frameContext === frameContexts.settings) {

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

@@ -423,2 +437,4 @@ exports.registerOnThemeChangeHandler = registerOnThemeChangeHandler;

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

@@ -441,2 +457,4 @@ exports.registerFullScreenHandler = registerFullScreenHandler;

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

@@ -464,2 +482,22 @@ 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

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

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

@@ -708,2 +747,3 @@ settings.registerOnSaveHandler = registerOnSaveHandler;

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

@@ -809,5 +849,5 @@ settings.registerOnRemoveHandler = registerOnRemoveHandler;

ensureInitialized(frameContexts.content, frameContexts.settings, frameContexts.remove, frameContexts.task);
if (hostClientType === "desktop" /* desktop */
|| hostClientType === "android" /* android */
|| hostClientType === "ios" /* ios */) {
if (hostClientType === "desktop" /* desktop */ ||
hostClientType === "android" /* android */ ||
hostClientType === "ios" /* ios */) {
// Convert any relative URLs into absolute URLs before sending them over to the parent window.

@@ -1301,2 +1341,17 @@ var link = document.createElement("a");

/**
* Update height/width task info properties.
* @param taskInfo An object containing width and height properties
*/
function updateTask(taskInfo) {
ensureInitialized(frameContexts.content, frameContexts.task);
var width = taskInfo.width, height = taskInfo.height, extra = __rest(taskInfo, ["width", "height"]);
if (!Object.keys(extra).length) {
sendMessageRequest(parentWindow, "tasks.updateTask", [taskInfo]);
}
else {
throw new Error("updateTask requires a taskInfo argument containing only width and height");
}
}
tasks.updateTask = updateTask;
/**
* Submit the task module.

@@ -1303,0 +1358,0 @@ * @param result Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it

2

dist/MicrosoftTeams.min.js

@@ -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";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 i="1.4.0-beta.9";function o(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}var r=function(t){for(var e="",n=0;n<t.length;n++)e+=(0===n?"":"|")+o(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"]),a={},s={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={})),a.navBarMenuItemPress=function(t){e&&e(t)||(x(),B(c,"handleNavBarMenuItemPress",[t]))},a.actionMenuItemPress=function(t){n&&n(t)||(x(),B(c,"handleActionMenuItemPress",[t]))},a.setModuleView=function(t){i&&i(t)||(x(),B(c,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){x(),i=e,B(c,"setUpViews",[t])},t.setNavBarMenu=function(t,n){x(),e=n,B(c,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){x(),n=e,B(c,"showActionMenu",[t])}}(e.menus||(e.menus={}));var u,c,f,l,d,h,v,p,g,m,y,b=!1,w=!1,k=[],T=[],C=0,M={},E=!1;function I(){window.print()}function S(t){x(),p=t}function O(t){x(),g=t}function P(t){x(),m=t}function N(){x();var t=B(c,"navigateBack",[]);M[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function x(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!b)throw new Error("The library has not yet been initialized");if(h&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===h){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+h+"' context")}}function U(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=a[e.func];i&&i.apply(this,e.args)}}function _(t){return t===c?k:t===l?T:[]}function j(t){return t===c?f:t===l?d:null}function L(t){for(var e=j(t),n=_(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function A(t,e){var n=u.setInterval(function(){0===_(t).length&&(clearInterval(n),e())},100)}function B(t,e,n){var i=function(t,e){return{id:C++,func:t,args:e||[]}}(e,n);if(w)u&&u.nativeInterface&&u.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=j(t);t&&o?t.postMessage(i,o):_(t).push(i)}return i.id}function D(t,e,n){var i=function(t,e){return{id:t,args:e||[]}}(e,n),o=j(t);t&&o&&t.postMessage(i,o)}a.themeChange=function(t){p&&p(t);l&&B(l,"themeChange",[t])},a.fullScreenChange=function(t){g&&g(t)},a.backButtonPress=function(){m&&m()||N()},e.initialize=function(t){if(void 0===t&&(t=window),!b){b=!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===u||n!==u.location.origin&&!r.test(n.toLowerCase())||(function(t,e){c&&t!==c?l&&t!==l||(l=t,d=e):(c=t,f=e),c&&c.closed&&(c=null,f=null),l&&l.closed&&(l=null,d=null),L(c),L(l)}(e,n),e===c?U(t):e===l&&function(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=a[e.func];if(n){var i=n.apply(this,e.args);i&&D(l,e.id,Array.isArray(i)?i:[i])}else{var o=B(c,e.func,e.args);M[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];l&&D(l,e.id,t)}}}}(t))}}(t)};(c=(u=t).parent!==u.self?u.parent:u.opener)?u.addEventListener("message",e,!1):(w=!0,window.onNativeMessage=U);try{f="*";var n=B(c,"initialize",[i]);M[n]=function(t,e){h=t,v=e}}finally{f=null}this._uninitialize=function(){h&&(S(null),O(null),P(null)),h===s.settings&&y.registerOnSaveHandler(null),h===s.remove&&y.registerOnRemoveHandler(null),w||u.removeEventListener("message",e,!1),b=!1,c=null,f=null,k=[],l=null,d=null,T=[],C=0,M={},h=null,v=null,w=!1}}},e._uninitialize=function(){},e.enablePrintCapability=function(){E||(E=!0,x(),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){x();var e=B(c,"getContext");M[e]=t},e.registerOnThemeChangeHandler=S,e.registerFullScreenHandler=O,e.registerBackButtonHandler=P,e.navigateBack=N,e.navigateCrossDomain=function(t){x(s.content,s.settings,s.remove,s.task);var e=B(c,"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){x();var n=B(c,"getTabInstances",[e]);M[n]=t},e.getUserJoinedTeams=function(t,e){x();var n=B(c,"getUserJoinedTeams",[e]);M[n]=t},e.getMruTabInstances=function(t,e){x();var n=B(c,"getMruTabInstances",[e]);M[n]=t},e.shareDeepLink=function(t){x(s.content),B(c,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},e.openFilePreview=function(t){x(s.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];B(c,"openFilePreview",e)},e.showNotification=function(t){x(s.content);var e=[t.message,t.notificationType];B(c,"showNotification",e)},e.executeDeepLink=function(t){x(s.content);var e=B(c,"executeDeepLink",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.uploadCustomApp=function(t){x();var e=B(c,"uploadCustomApp",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},e.navigateToTab=function(t){x();var e=B(c,"navigateToTab",[t]);M[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}},function(t){var e,n;a["settings.save"]=function(t){var n=new i(t);e?e(n):n.notifySuccess()},a["settings.remove"]=function(){var t=new o;n?n(t):t.notifySuccess()},t.setValidityState=function(t){x(s.settings,s.remove),B(c,"settings.setValidityState",[t])},t.getSettings=function(t){x(s.content,s.settings,s.remove);var e=B(c,"settings.getSettings");M[e]=t},t.setSettings=function(t){x(s.content,s.settings);var e=B(c,"settings.setSettings",[t]);M[e]=function(t,e){if(!t)throw new Error(e)}},t.registerOnSaveHandler=function(t){x(s.settings),e=t},t.registerOnRemoveHandler=function(t){x(s.remove),n=t};var i=function(){function t(t){this.notified=!1,this.result=t||{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),B(c,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),B(c,"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(),B(c,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),B(c,"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}()}(y=e.settings||(e.settings={})),function(t){var e,n;function i(){o();try{l&&l.close()}finally{l=null,d=null}}function o(){n&&(clearInterval(n),n=0),delete a.initialize,delete a.navigateCrossDomain}function r(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function f(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=h(i.href,"result",n)),u.location.assign(h(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=h(i.href,"reason",n)),u.location.assign(h(i.href,"authFailure",""))))}}function h(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}a["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},a["authentication.authenticate.failure"]=r,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){var f=void 0!==t?t:e;if(x(s.content,s.settings,s.remove,s.task),"desktop"===v||"android"===v||"ios"===v){var h=document.createElement("a");h.href=f.url;var p=B(c,"authentication.authenticate",[h.href,f.width,f.height]);M[p]=function(t,e){t?f.successCallback(e):f.failureCallback(e)}}else!function(t){e=t,i();var c=e.width||600,f=e.height||400;c=Math.min(c,u.outerWidth-400),f=Math.min(f,u.outerHeight-200);var h=document.createElement("a");h.href=e.url;var p=void 0!==u.screenLeft?u.screenLeft:u.screenX,g=void 0!==u.screenTop?u.screenTop:u.screenY;p+=u.outerWidth/2-c/2,g+=u.outerHeight/2-f/2,(l=u.open(h.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+g+", left="+p+", width="+c+", height="+f))?(o(),n=u.setInterval(function(){if(!l||l.closed)r("CancelledByUser");else{var t=d;try{d="*",B(l,"ping")}finally{d=t}}},100),a.initialize=function(){return[s.authentication,v]},a.navigateCrossDomain=function(t){return!1}):r("FailedToOpenWindow")}(f)},t.getAuthToken=function(t){x();var e=B(c,"authentication.getAuthToken",[t.resources]);M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.getUser=function(t){x();var e=B(c,"authentication.getUser");M[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}},t.notifySuccess=function(t,e){f(e,"result",t),x(s.authentication),B(c,"authentication.authenticate.success",[t]),A(c,function(){return setTimeout(function(){return u.close()},200)})},t.notifyFailure=function(t,e){f(e,"reason",t),x(s.authentication),B(c,"authentication.authenticate.failure",[t]),A(c,function(){return setTimeout(function(){return u.close()},200)})}}(e.authentication||(e.authentication={})),e.sendCustomMessage=function(t,e){return x(),B(c,t,e)},function(t){t.startTask=function(t,e){x(s.content);var n=B(c,"tasks.startTask",[t]);M[n]=e},t.submitTask=function(t,e){x(s.content,s.task),B(c,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(e.tasks||(e.tasks={})),e.getChatMembers=function(t){x();var e=B(c,"getChatMembers");M[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.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}}])});

@@ -241,3 +241,3 @@ export declare const enum HostClientType {

/**
* Represends Team Information
* Represents Team Information
*/

@@ -325,2 +325,8 @@ export interface TeamInformation {

/**
* 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

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

/**
* The root ShatePoint folder associated with the team.
* The root SharePoint folder associated with the team.
*/

@@ -785,3 +791,3 @@ teamSiteUrl?: string;

/**
* Indicates wheather team is archived.
* Indicates whether team is archived.
* Apps should use this as a signal to prevent any changes to content associated with archived teams.

@@ -928,2 +934,7 @@ */

/**
* Update height/width task info properties.
* @param taskInfo An object containing width and height properties
*/
function updateTask(taskInfo: TaskInfo): void;
/**
* Submit the task module.

@@ -930,0 +941,0 @@ * @param result Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it

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

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

@@ -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.9/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.4.0-beta.10/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.9/dist/MicrosoftTeams.min.js" integrity="sha384-wEKnQvQeXbo30jDLL1R90V0UW+RjonEDSoHs2agqyiNnjTmv+fpXLlqHp+lRAFQm" crossorigin="anonymous"></script>
<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>
<!-- Microsoft Teams JavaScript API (via npm) -->
<script src="node_modules/@microsoft/teams-js@1.4.0-beta.9/dist/MicrosoftTeams.min.js"></script>
<script src="node_modules/@microsoft/teams-js@1.4.0-beta.10/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

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