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
498
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.3.8 to 1.4.0-beta.3.9

dts/index.d.ts

13

dist/MicrosoftTeams.js

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

/******/ (function(modules) { // webpackBootstrap
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(window, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache

@@ -1276,2 +1286,3 @@ /******/ var installedModules = {};

/******/ ]);
});
//# sourceMappingURL=MicrosoftTeams.js.map

2

dist/MicrosoftTeams.min.js

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

!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}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});var i=n(1);e.microsoftTeams=i.microsoftTeams},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}),function(t){const e="1.3.6";function n(t){let e="^",n=t.split(".");for(let t=0;t<n.length;t++)e+=(t>0?"[.]":"")+n[t].replace("*","[^/^.]+");return e+="$"}const i=function(t){let e="";for(let i=0;i<t.length;i++)e+=(0===i?"":"|")+n(t[i]);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"]),o={},s={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};let r;!function(t){let e,n,i,s;t.MenuItem=class{constructor(){this.enabled=!0}},function(t){t.dropDown="dropDown",t.popOver="popOver"}(e=t.MenuListType||(t.MenuListType={})),o.navBarMenuItemPress=function(t){n&&n(t)||(U(),j(c,"handleNavBarMenuItemPress",[t]))},o.actionMenuItemPress=function(t){i&&i(t)||(U(),j(c,"handleActionMenuItemPress",[t]))},o.setModuleView=function(t){s&&s(t)||(U(),j(c,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){U(),s=e,j(c,"setUpViews",[t])},t.setNavBarMenu=function(t,e){U(),n=e,j(c,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){U(),i=e,j(c,"showActionMenu",[t])}}(r=t.menus||(t.menus={}));let a,c,u,l,f,h,d,g,p,m,v,y,b,w=!1,k=!1,T=[],C=[],M=0,I={},S=!1;function E(t){U(),g=t}function O(t){U(),p=t}function N(t){U(),m=t}function P(){U();let t=j(c,"navigateBack",[]);I[t]=(t=>{if(!t)throw new Error("Back navigation is not supported in the current client or context.")})}function U(...t){if(!w)throw new Error("The library has not yet been initialized");if(h&&t&&t.length>0){let e=!1;for(let n=0;n<t.length;n++)if(t[n]===h){e=!0;break}if(!e)throw new Error("This call is not allowed in the '"+h+"' context")}}function _(t){if("id"in t.data){const e=t.data,n=I[e.id];n&&(n.apply(null,e.args),delete I[e.id])}else if("func"in t.data){const e=t.data,n=o[e.func];n&&n.apply(this,e.args)}}function x(t){return t===c?T:t===l?C:[]}function A(t){return t===c?u:t===l?f:null}function B(t){let e=A(t),n=x(t);for(;t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function L(t,e){let n=a.setInterval(()=>{0===x(t).length&&(clearInterval(n),e())},100)}function j(t,e,n){let i=function(t,e){return{id:M++,func:t,args:e||[]}}(e,n);if(k)a&&a.nativeInterface&&a.nativeInterface.framelessPostMessage(JSON.stringify(i));else{let e=A(t);t&&e?t.postMessage(i,e):x(t).push(i)}return i.id}function D(t,e,n){let i=function(t,e){return{id:t,args:e||[]}}(e,n),o=A(t);t&&o&&t.postMessage(i,o)}o.themeChange=function(t){g&&g(t);l&&j(l,"themeChange",[t])},o.fullScreenChange=function(t){p&&p(t)},o.backButtonPress=function(){m&&m()||P()},t.initialize=function(t=window){if(w)return;w=!0;let n=t=>(function(t){if(!t||!t.data||"object"!=typeof t.data)return;let e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===a||n!==a.location.origin&&!i.test(n.toLowerCase())||(function(t,e){c&&t!==c?l&&t!==l||(l=t,f=e):(c=t,u=e),c&&c.closed&&(c=null,u=null),l&&l.closed&&(l=null,f=null),B(c),B(l)}(e,n),e===c?_(t):e===l&&function(t){if("id"in t.data&&"func"in t.data){const e=t.data,n=o[e.func];if(n){let t=n.apply(this,e.args);t&&D(l,e.id,Array.isArray(t)?t:[t])}else{let t=j(c,e.func,e.args);I[t]=((...t)=>{l&&D(l,e.id,t)})}}}(t))})(t);(c=(a=t).parent!==a.self?a.parent:a.opener)?a.addEventListener("message",n,!1):(k=!0,window.onNativeMessage=_);try{u="*";let t=j(c,"initialize",[e]);I[t]=((t,e)=>{h=t,d=e})}finally{u=null}this._uninitialize=(()=>{h&&(E(null),O(null),N(null)),h===s.settings&&v.registerOnSaveHandler(null),h===s.remove&&v.registerOnRemoveHandler(null),k||a.removeEventListener("message",n,!1),w=!1,c=null,u=null,T=[],l=null,f=null,C=[],M=0,I={},h=null,d=null,k=!1})},t._uninitialize=function(){},t.enablePrintCapability=function(){S||(S=!0,U(),document.addEventListener("keydown",e=>{(e.ctrlKey||e.metaKey)&&80===e.keyCode&&(t.print(),e.cancelBubble=!0,e.preventDefault(),e.stopImmediatePropagation())}))},t.print=function(){window.print()},t.getContext=function(t){U();let e=j(c,"getContext");I[e]=t},t.registerOnThemeChangeHandler=E,t.registerFullScreenHandler=O,t.registerBackButtonHandler=N,t.navigateBack=P,t.navigateCrossDomain=function(t){U(s.content,s.settings,s.remove,s.task);let e=j(c,"navigateCrossDomain",[t]);I[e]=(t=>{if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")})},t.getTabInstances=function(t,e){U();let n=j(c,"getTabInstances",[e]);I[n]=t},t.getUserJoinedTeams=function(t,e){U();const n=j(c,"getUserJoinedTeams",[e]);I[n]=t},t.getMruTabInstances=function(t,e){U();let n=j(c,"getMruTabInstances",[e]);I[n]=t},t.shareDeepLink=function(t){U(s.content),j(c,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},t.openFilePreview=function(t){U(s.content);const e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];j(c,"openFilePreview",e)},t.showNotification=function(t){U(s.content);const e=[t.message,t.isDownloadComplete];j(c,"showNotification",e)},t.uploadCustomApp=function(t){U();const e=j(c,"uploadCustomApp",[t]);I[e]=((t,e)=>{if(!t)throw new Error(e)})},t.navigateToTab=function(t){U();let e=j(c,"navigateToTab",[t]);I[e]=(t=>{if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")})},function(t){let e,n;o["settings.save"]=function(t){let n=new i(t);e?e(n):n.notifySuccess()},o["settings.remove"]=function(){let t=new r;n?n(t):t.notifySuccess()},t.setValidityState=function(t){U(s.settings,s.remove),j(c,"settings.setValidityState",[t])},t.getSettings=function(t){U(s.settings,s.remove);let e=j(c,"settings.getSettings");I[e]=t},t.setSettings=function(t){U(s.settings),j(c,"settings.setSettings",[t])},t.registerOnSaveHandler=function(t){U(s.settings),e=t},t.registerOnRemoveHandler=function(t){U(s.remove),n=t};class i{constructor(t){this.notified=!1,this.result=t||{}}notifySuccess(){this.ensureNotNotified(),j(c,"settings.save.success"),this.notified=!0}notifyFailure(t){this.ensureNotNotified(),j(c,"settings.save.failure",[t]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}class r{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),j(c,"settings.remove.success"),this.notified=!0}notifyFailure(t){this.ensureNotNotified(),j(c,"settings.remove.failure",[t]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")}}}(v=t.settings||(t.settings={})),function(t){let e,n;function i(){r();try{l&&l.close()}finally{l=null,f=null}}function r(){n&&(clearInterval(n),n=0),delete o.initialize,delete o.navigateCrossDomain}function u(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function h(t,e,n){if(t){let 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=g(i.href,"result",n)),a.location.assign(g(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=g(i.href,"reason",n)),a.location.assign(g(i.href,"authFailure",""))))}}function g(t,e,n){let i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}o["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},o["authentication.authenticate.failure"]=u,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){let h=void 0!==t?t:e;if(U(s.content,s.settings,s.remove,s.task),"desktop"===d){let t=document.createElement("a");t.href=h.url;let e=j(c,"authentication.authenticate",[t.href,h.width,h.height]);I[e]=((t,e)=>{t?h.successCallback(e):h.failureCallback(e)})}else!function(t){e=t,i();let c=e.width||600,h=e.height||400;c=Math.min(c,a.outerWidth-400),h=Math.min(h,a.outerHeight-200);let g=document.createElement("a");g.href=e.url;let p=void 0!==a.screenLeft?a.screenLeft:a.screenX,m=void 0!==a.screenTop?a.screenTop:a.screenY;p+=a.outerWidth/2-c/2,m+=a.outerHeight/2-h/2,(l=a.open(g.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+m+", left="+p+", width="+c+", height="+h))?(r(),n=a.setInterval(()=>{if(!l||l.closed)u("CancelledByUser");else{let t=f;try{f="*",j(l,"ping")}finally{f=t}}},100),o.initialize=(()=>[s.authentication,d]),o.navigateCrossDomain=(t=>!1)):u("FailedToOpenWindow")}(h)},t.getAuthToken=function(t){U();let e=j(c,"authentication.getAuthToken",[t.resources]);I[e]=((e,n)=>{e?t.successCallback(n):t.failureCallback(n)})},t.getUser=function(t){U();let e=j(c,"authentication.getUser");I[e]=((e,n)=>{e?t.successCallback(n):t.failureCallback(n)})},t.notifySuccess=function(t,e){h(e,"result",t),U(s.authentication),j(c,"authentication.authenticate.success",[t]),L(c,()=>setTimeout(()=>a.close(),200))},t.notifyFailure=function(t,e){h(e,"reason",t),U(s.authentication),j(c,"authentication.authenticate.failure",[t]),L(c,()=>setTimeout(()=>a.close(),200))}}(y=t.authentication||(t.authentication={})),t.sendCustomMessage=function(t,e){return U(),j(c,t,e)},function(t){t.startTask=function(t,e){U(s.content);let n=j(c,"tasks.startTask",[t]);I[n]=e},t.submitTask=function(t,e){U(s.content,s.task),j(c,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(b=t.tasks||(t.tasks={})),t.getChatMembers=function(t){U();const e=j(c,"getChatMembers");I[e]=t}}(e.microsoftTeams||(e.microsoftTeams={}))}]);
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(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});var i=n(1);e.microsoftTeams=i.microsoftTeams},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}),function(t){const e="1.3.6";function n(t){let e="^",n=t.split(".");for(let t=0;t<n.length;t++)e+=(t>0?"[.]":"")+n[t].replace("*","[^/^.]+");return e+="$"}const i=function(t){let e="";for(let i=0;i<t.length;i++)e+=(0===i?"":"|")+n(t[i]);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"]),o={},s={settings:"settings",content:"content",authentication:"authentication",remove:"remove",task:"task"};let r;!function(t){let e,n,i,s;t.MenuItem=class{constructor(){this.enabled=!0}},function(t){t.dropDown="dropDown",t.popOver="popOver"}(e=t.MenuListType||(t.MenuListType={})),o.navBarMenuItemPress=function(t){n&&n(t)||(x(),L(c,"handleNavBarMenuItemPress",[t]))},o.actionMenuItemPress=function(t){i&&i(t)||(x(),L(c,"handleActionMenuItemPress",[t]))},o.setModuleView=function(t){s&&s(t)||(x(),L(c,"viewConfigItemPress",[t]))},t.setUpViews=function(t,e){x(),s=e,L(c,"setUpViews",[t])},t.setNavBarMenu=function(t,e){x(),n=e,L(c,"setNavBarMenu",[t])},t.showActionMenu=function(t,e){x(),i=e,L(c,"showActionMenu",[t])}}(r=t.menus||(t.menus={}));let a,c,u,l,f,d,h,p,g,m,y,v,b,w=!1,k=!1,T=[],C=[],M=0,I={},S=!1;function E(t){x(),p=t}function O(t){x(),g=t}function N(t){x(),m=t}function P(){x();let t=L(c,"navigateBack",[]);I[t]=(t=>{if(!t)throw new Error("Back navigation is not supported in the current client or context.")})}function x(...t){if(!w)throw new Error("The library has not yet been initialized");if(d&&t&&t.length>0){let e=!1;for(let n=0;n<t.length;n++)if(t[n]===d){e=!0;break}if(!e)throw new Error("This call is not allowed in the '"+d+"' context")}}function U(t){if("id"in t.data){const e=t.data,n=I[e.id];n&&(n.apply(null,e.args),delete I[e.id])}else if("func"in t.data){const e=t.data,n=o[e.func];n&&n.apply(this,e.args)}}function _(t){return t===c?T:t===l?C:[]}function j(t){return t===c?u:t===l?f:null}function A(t){let e=j(t),n=_(t);for(;t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function B(t,e){let n=a.setInterval(()=>{0===_(t).length&&(clearInterval(n),e())},100)}function L(t,e,n){let i=function(t,e){return{id:M++,func:t,args:e||[]}}(e,n);if(k)a&&a.nativeInterface&&a.nativeInterface.framelessPostMessage(JSON.stringify(i));else{let e=j(t);t&&e?t.postMessage(i,e):_(t).push(i)}return i.id}function D(t,e,n){let i=function(t,e){return{id:t,args:e||[]}}(e,n),o=j(t);t&&o&&t.postMessage(i,o)}o.themeChange=function(t){p&&p(t);l&&L(l,"themeChange",[t])},o.fullScreenChange=function(t){g&&g(t)},o.backButtonPress=function(){m&&m()||P()},t.initialize=function(t=window){if(w)return;w=!0;let n=t=>(function(t){if(!t||!t.data||"object"!=typeof t.data)return;let e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===a||n!==a.location.origin&&!i.test(n.toLowerCase())||(function(t,e){c&&t!==c?l&&t!==l||(l=t,f=e):(c=t,u=e),c&&c.closed&&(c=null,u=null),l&&l.closed&&(l=null,f=null),A(c),A(l)}(e,n),e===c?U(t):e===l&&function(t){if("id"in t.data&&"func"in t.data){const e=t.data,n=o[e.func];if(n){let t=n.apply(this,e.args);t&&D(l,e.id,Array.isArray(t)?t:[t])}else{let t=L(c,e.func,e.args);I[t]=((...t)=>{l&&D(l,e.id,t)})}}}(t))})(t);(c=(a=t).parent!==a.self?a.parent:a.opener)?a.addEventListener("message",n,!1):(k=!0,window.onNativeMessage=U);try{u="*";let t=L(c,"initialize",[e]);I[t]=((t,e)=>{d=t,h=e})}finally{u=null}this._uninitialize=(()=>{d&&(E(null),O(null),N(null)),d===s.settings&&y.registerOnSaveHandler(null),d===s.remove&&y.registerOnRemoveHandler(null),k||a.removeEventListener("message",n,!1),w=!1,c=null,u=null,T=[],l=null,f=null,C=[],M=0,I={},d=null,h=null,k=!1})},t._uninitialize=function(){},t.enablePrintCapability=function(){S||(S=!0,x(),document.addEventListener("keydown",e=>{(e.ctrlKey||e.metaKey)&&80===e.keyCode&&(t.print(),e.cancelBubble=!0,e.preventDefault(),e.stopImmediatePropagation())}))},t.print=function(){window.print()},t.getContext=function(t){x();let e=L(c,"getContext");I[e]=t},t.registerOnThemeChangeHandler=E,t.registerFullScreenHandler=O,t.registerBackButtonHandler=N,t.navigateBack=P,t.navigateCrossDomain=function(t){x(s.content,s.settings,s.remove,s.task);let e=L(c,"navigateCrossDomain",[t]);I[e]=(t=>{if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")})},t.getTabInstances=function(t,e){x();let n=L(c,"getTabInstances",[e]);I[n]=t},t.getUserJoinedTeams=function(t,e){x();const n=L(c,"getUserJoinedTeams",[e]);I[n]=t},t.getMruTabInstances=function(t,e){x();let n=L(c,"getMruTabInstances",[e]);I[n]=t},t.shareDeepLink=function(t){x(s.content),L(c,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])},t.openFilePreview=function(t){x(s.content);const e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];L(c,"openFilePreview",e)},t.showNotification=function(t){x(s.content);const e=[t.message,t.isDownloadComplete];L(c,"showNotification",e)},t.uploadCustomApp=function(t){x();const e=L(c,"uploadCustomApp",[t]);I[e]=((t,e)=>{if(!t)throw new Error(e)})},t.navigateToTab=function(t){x();let e=L(c,"navigateToTab",[t]);I[e]=(t=>{if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")})},function(t){let e,n;o["settings.save"]=function(t){let n=new i(t);e?e(n):n.notifySuccess()},o["settings.remove"]=function(){let t=new r;n?n(t):t.notifySuccess()},t.setValidityState=function(t){x(s.settings,s.remove),L(c,"settings.setValidityState",[t])},t.getSettings=function(t){x(s.settings,s.remove);let e=L(c,"settings.getSettings");I[e]=t},t.setSettings=function(t){x(s.settings),L(c,"settings.setSettings",[t])},t.registerOnSaveHandler=function(t){x(s.settings),e=t},t.registerOnRemoveHandler=function(t){x(s.remove),n=t};class i{constructor(t){this.notified=!1,this.result=t||{}}notifySuccess(){this.ensureNotNotified(),L(c,"settings.save.success"),this.notified=!0}notifyFailure(t){this.ensureNotNotified(),L(c,"settings.save.failure",[t]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}class r{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),L(c,"settings.remove.success"),this.notified=!0}notifyFailure(t){this.ensureNotNotified(),L(c,"settings.remove.failure",[t]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")}}}(y=t.settings||(t.settings={})),function(t){let e,n;function i(){r();try{l&&l.close()}finally{l=null,f=null}}function r(){n&&(clearInterval(n),n=0),delete o.initialize,delete o.navigateCrossDomain}function u(t){try{e&&e.failureCallback&&e.failureCallback(t)}finally{e=null,i()}}function d(t,e,n){if(t){let 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=p(i.href,"result",n)),a.location.assign(p(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=p(i.href,"reason",n)),a.location.assign(p(i.href,"authFailure",""))))}}function p(t,e,n){let i=t.indexOf("#"),o=-1===i?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),(t=-1===i?t:t.substr(0,i))+o}o["authentication.authenticate.success"]=function(t){try{e&&e.successCallback&&e.successCallback(t)}finally{e=null,i()}},o["authentication.authenticate.failure"]=u,t.registerAuthenticationHandlers=function(t){e=t},t.authenticate=function(t){let d=void 0!==t?t:e;if(x(s.content,s.settings,s.remove,s.task),"desktop"===h){let t=document.createElement("a");t.href=d.url;let e=L(c,"authentication.authenticate",[t.href,d.width,d.height]);I[e]=((t,e)=>{t?d.successCallback(e):d.failureCallback(e)})}else!function(t){e=t,i();let c=e.width||600,d=e.height||400;c=Math.min(c,a.outerWidth-400),d=Math.min(d,a.outerHeight-200);let p=document.createElement("a");p.href=e.url;let g=void 0!==a.screenLeft?a.screenLeft:a.screenX,m=void 0!==a.screenTop?a.screenTop:a.screenY;g+=a.outerWidth/2-c/2,m+=a.outerHeight/2-d/2,(l=a.open(p.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+m+", left="+g+", width="+c+", height="+d))?(r(),n=a.setInterval(()=>{if(!l||l.closed)u("CancelledByUser");else{let t=f;try{f="*",L(l,"ping")}finally{f=t}}},100),o.initialize=(()=>[s.authentication,h]),o.navigateCrossDomain=(t=>!1)):u("FailedToOpenWindow")}(d)},t.getAuthToken=function(t){x();let e=L(c,"authentication.getAuthToken",[t.resources]);I[e]=((e,n)=>{e?t.successCallback(n):t.failureCallback(n)})},t.getUser=function(t){x();let e=L(c,"authentication.getUser");I[e]=((e,n)=>{e?t.successCallback(n):t.failureCallback(n)})},t.notifySuccess=function(t,e){d(e,"result",t),x(s.authentication),L(c,"authentication.authenticate.success",[t]),B(c,()=>setTimeout(()=>a.close(),200))},t.notifyFailure=function(t,e){d(e,"reason",t),x(s.authentication),L(c,"authentication.authenticate.failure",[t]),B(c,()=>setTimeout(()=>a.close(),200))}}(v=t.authentication||(t.authentication={})),t.sendCustomMessage=function(t,e){return x(),L(c,t,e)},function(t){t.startTask=function(t,e){x(s.content);let n=L(c,"tasks.startTask",[t]);I[n]=e},t.submitTask=function(t,e){x(s.content,s.task),L(c,"tasks.completeTask",[t,Array.isArray(e)?e:[e]])}}(b=t.tasks||(t.tasks={})),t.getChatMembers=function(t){x();const e=L(c,"getChatMembers");I[e]=t}}(e.microsoftTeams||(e.microsoftTeams={}))}])});
{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "1.4.0-beta.3.8",
"version": "1.4.0-beta.3.9",
"description": "Microsoft Client SDK for building app for Microsoft teams",
"main": "./dist/MicrosoftTeams.js",
"typings": "./dts/src/index.d.ts",
"main": "./dist/MicrosoftTeams.min.js",
"typings": "./dts/index.d.ts",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

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