Socket
Socket
Sign inDemoInstall

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
488
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/teams-js - npm Package Compare versions

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

dist/index.d.ts

179

dist/MicrosoftTeams.js

@@ -1,10 +0,95 @@

;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.microsoftTeams = factory();
}
}(this, function() {
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./src/MicrosoftTeams.ts
if (!String.prototype.startsWith) {

@@ -169,3 +254,2 @@ String.prototype.startsWith = function (search, pos) {

var hostClientType;
var printCapabilityEnabled = false;
var themeChangeHandler;

@@ -181,3 +265,4 @@ handlers["themeChange"] = handleThemeChange;

*/
function initialize() {
function initialize(hostWindow) {
if (hostWindow === void 0) { hostWindow = window; }
if (initializeCalled) {

@@ -190,3 +275,3 @@ // Independent components might not know whether the SDK is initialized so might call it to be safe.

// Undocumented field used to mock the window for unit tests
currentWindow = this._window || window;
currentWindow = hostWindow;
// Listen for messages post to our window

@@ -253,28 +338,8 @@ var messageListener = function (evt) { return processMessage(evt); };

/**
* Enable print capability to support printing page using Ctrl+P and cmd+P
* Initializes the library. This must be called before any other SDK calls
* but after the frame is loaded successfully.
*/
function enablePrintCapability() {
if (!printCapabilityEnabled) {
printCapabilityEnabled = true;
ensureInitialized();
// adding ctrl+P and cmd+P handler
document.addEventListener("keydown", function (event) {
if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
microsoftTeams.print();
event.cancelBubble = true;
event.preventDefault();
event.stopImmediatePropagation();
}
});
}
}
microsoftTeams.enablePrintCapability = enablePrintCapability;
function _uninitialize() { }
microsoftTeams._uninitialize = _uninitialize;
/**
* default print handler
*/
function print() {
window.print();
}
microsoftTeams.print = print;
/**
* Retrieves the current context the frame is running in.

@@ -458,34 +523,2 @@ * @param callback The callback to invoke when the {@link Context} object is retrieved.

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

@@ -1208,3 +1241,9 @@ * This method works just for the first party Apps.

return microsoftTeams;
}));
// CONCATENATED MODULE: ./index.ts
/* concated harmony reexport microsoftTeams */__webpack_require__.d(__webpack_exports__, "microsoftTeams", function() { return microsoftTeams; });
/***/ })
/******/ ]);
//# sourceMappingURL=MicrosoftTeams.js.map

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

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

"scripts": {
"build": "gulp dist",
"install": "yarn install",
"build": "webpack",
"test": "gulp test"

@@ -42,8 +43,15 @@ },

"prettier": "^1.11.1",
"ts-loader": "^5.2.1",
"tslint": "^5.8.0",
"tslint-eslint-rules": "^4.1.1",
"typescript": "2.5.0",
"typescript": "^2.5.0",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
"yargs": "^8.0.1"
},
"files": ["dist/**", "README.md", "LICENSE"]
"files": [
"dist/**",
"README.md",
"LICENSE"
]
}
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